Method for calling animation special effect and electronic device
By storing various types of animation effects in electronic devices and selecting appropriate animation effects for rendering based on the current device information, the problem of lag caused by animation effects consuming CPU resources is solved, thus improving user experience and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2021-07-01
- Publication Date
- 2026-04-17
AI Technical Summary
When electronic devices render animation effects, complex animation effects can consume a lot of CPU resources, causing lag under heavy use and affecting the user experience.
Electronic devices can store various types of animation effects. Based on the current device information and preset relationships, appropriate animation effects are selected for rendering to ensure resource utilization and rendering effect.
By selecting appropriate animation effects, lag during interface transitions was avoided, improving user experience and resource utilization.
Smart Images

Figure CN115562769B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic device technology, and in particular to a method for invoking animation effects and an electronic device. Background Technology
[0002] With the development of technology, electronic devices (such as mobile phones, tablets, or smartwatches) can use animation effects to render the process of displaying animated interfaces, thereby improving the display effect of the electronic devices. These animation effects are built into the operating system installed on the electronic device. For example, electronic devices can use animation effects to render the process of launching an application. Another example is the process of switching between applications.
[0003] However, during the rendering process of electronic devices using animation effects, these effects consume the computing resources of the device's central processing unit (CPU). Furthermore, the more complex the animation effect, the more CPU resources it consumes.
[0004] As a result, when electronic devices are under heavy use (e.g., multiple applications are running in the background), the CPU's computing resources may be insufficient, which may cause frame drops in the displayed animation effects and stuttering during interface switching, thus affecting the user experience. Summary of the Invention
[0005] This application provides a method for invoking animation effects and an electronic device, which can prevent stuttering during the display of animated interfaces on electronic devices and improve the display effect of animated interfaces on electronic devices.
[0006] Firstly, this application provides a method for invoking animation effects, which can be applied to electronic devices that store various types of animation effects, with different resource overheads for different types of animation effects.
[0007] In this method, the electronic device can receive a first operation, which triggers the display of an animated interface. In response to the first operation, the electronic device can obtain its current device information; this information indicates the computing resources currently being used by the device. The device stores preset device information and a first relationship, which defines the relationship between various types of animation effects and the preset device information. Then, based on the current device information and the first relationship, the electronic device can determine a target animation effect that matches the current device information from among the various types of animation effects. Finally, the electronic device can invoke the target animation effect to render the process of displaying the animated interface.
[0008] Based on the above technical solution, electronic devices store various animation effects with different resource costs. The electronic device can combine the relationship between currently used computing resources, various types of animation effects, and preset device information to determine the target animation effect that matches the current device information from among the various types of animation effects. In this way, the electronic device can call different animation effect types for rendering when the current device information is different. Thus, the computing resources of the electronic device can be fully utilized, ensuring that the electronic device achieves optimal rendering results without lag.
[0009] In conjunction with the first aspect, in one possible design approach, multiple types of animation effects include: Type I animation effects, Type II animation effects, and Type III animation effects; wherein, the resource cost of Type I animation effects is greater than that of Type II animation effects, and the resource cost of Type II animation effects is greater than that of Type III animation effects.
[0010] In other words, the resource cost of the first type of animation effect is the highest among all types of animation effects, the resource cost of the second type of animation effect is moderate among all types of animation effects, and the resource cost of the third type of animation effect is the lowest among all types of animation effects.
[0011] In conjunction with the first aspect, in another possible design approach, the preset device information includes: a first preset resource threshold and a second preset resource threshold, wherein the first preset resource threshold is less than the second preset resource threshold. If the current device information is less than or equal to the first preset resource threshold, the electronic device can determine that the target animation effect is a first type of animation effect.
[0012] Understandably, the first preset resource threshold is relatively small. If the current device information is less than the first preset resource threshold, it means that the utilization rate of the electronic device's current computing resources is low, and the electronic device has a lot of available computing resources. Therefore, the electronic device can identify the first type of animation effect, which has higher complexity and greater resource consumption, as the target animation effect.
[0013] If the current device information is greater than the first preset resource threshold and less than or equal to the second preset resource threshold, the electronic device can determine that the target animation effect is a second type of animation effect. If the current device information is greater than the second preset resource threshold, the electronic device can determine that the target animation effect is a third type of animation effect.
[0014] Understandably, the second preset resource threshold is relatively high. If the current device information exceeds the second preset resource threshold, it indicates that the electronic device's current computing resource utilization is high, and the available computing resources are limited. Therefore, the electronic device can determine the third type of animation effect, which has lower complexity and lower resource consumption, as the target animation effect.
[0015] In conjunction with the first aspect, in another possible design approach, the duration of the first type of animation effect is longer than that of the second type of animation effect, and the duration of the second type of animation effect is longer than that of the third type of animation effect; wherein, the duration of the effect is used to indicate the duration of rendering of the process by which the electronic device invokes the animation effect to display the animated interface of the electronic device.
[0016] It's understandable that the longer the animation effects last, the better the rendering effect. However, the longer the animation effects last, the greater the resource consumption.
[0017] In conjunction with the first aspect, in another possible design approach, each type of animation effect includes at least one animation effect, and each of the at least one animation effect corresponds to a scene displaying the animation interface.
[0018] In this way, electronic devices can render scenes based on the interface, using animation effects corresponding to those scenes. This not only avoids display anomalies but also ensures the quality of the rendering.
[0019] In conjunction with the first aspect, in another possible design approach, an animation effect consists of at least one type of animation element; wherein, the electronic device stores multiple types of animation elements, with different types of animation elements having different resource costs. The multiple types of animation elements include: a first type of animation element, a second type of animation element, and a third type of animation element; wherein the resource cost of the first type of animation element is greater than that of the second type of animation element, and the resource cost of the second type of animation element is greater than that of the third type of animation element.
[0020] It's understandable that an animation effect consists of at least one type of animation element, and the number of animation effects can be increased. Furthermore, animation effects can be configured reasonably based on the resource costs of different animation element types to ensure that the resource costs of the animation effects remain within an appropriate range.
[0021] In conjunction with the first aspect, in another possible design approach, the current device information includes the current CPU utilization.
[0022] In a second aspect, this application provides an electronic device comprising: a memory, a display screen, and one or more processors, wherein the memory, the display screen, and the processors are coupled; the memory is used to store computer program code, the computer program code including computer instructions; when the computer instructions are executed by the one or more processors, the electronic device performs the method as described in the first aspect and any possible design thereof.
[0023] Thirdly, this application provides a chip system applied to an electronic device. The chip system includes one or more interface circuits and one or more processors. The interface circuits and processors are interconnected via lines. The interface circuits are used to receive signals from the electronic device's memory and send the signals to the processors, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device performs the method described in the first aspect and any of its possible design embodiments.
[0024] Fourthly, this application provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect and any possible design thereof.
[0025] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform the method described in the first aspect and any possible design thereof.
[0026] It is understood that the beneficial effects achieved by the electronic device described in the second aspect, the chip system described in the third aspect, the computer-readable storage medium described in the fourth aspect, and the computer program product described in the fifth aspect can be referred to as the beneficial effects in the first aspect and any possible design mode thereof, which will not be repeated here. Attached Figure Description
[0027] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0028] Figure 2 A flowchart illustrating a method for invoking animation effects provided in this application embodiment;
[0029] Figure 3 A schematic diagram illustrating an example of a display interface provided in an embodiment of this application;
[0030] Figure 4 A flowchart illustrating another method for invoking animation effects provided in this application embodiment;
[0031] Figure 5 This is a schematic diagram of the structural composition of a chip system provided in an embodiment of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0033] In this application, the character " / " generally indicates that the objects before and after it are in an "or" relationship. For example, A / B can be understood as A or B.
[0034] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.
[0035] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the steps or modules listed, but may optionally include other steps or modules not listed, or may optionally include other steps or modules inherent to such process, method, product, or device.
[0036] Furthermore, in the embodiments of this application, the words "exemplary" or "for example" are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design that is described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design options. Specifically, the use of the words "exemplary" or "for example" is intended to present concepts in a concrete manner.
[0037] To facilitate understanding of the technical solution of this application, conventional techniques will be introduced before a detailed description of the method for adjusting animation effects in the embodiments of this application.
[0038] With the development of technology, electronic devices (such as mobile phones, tablets, or smartwatches) can use animation effects to render the process of displaying animated interfaces, thereby improving the display effect. These animation effects are built into the operating system installed on the electronic device. However, under heavy use (e.g., with multiple applications running in the background), the CPU's computing resources may be insufficient, potentially causing dropped frames in the animation effects and stuttering during interface switching, thus affecting the user experience.
[0039] In conventional technology, electronic devices can be configured with multiple animation effects of equal complexity, each used to render a specific scene. For example, an electronic device can configure animation effect A for the scene of launching an application. That is, the electronic device can render the application launch process using animation effect A. Similarly, an electronic device can configure animation effect B for the scene of switching applications. The electronic device can render the application switching process using animation effect B. In this way, the electronic device can pre-configure a low-complexity animation effect using these conventional techniques. Thus, under heavy usage, the electronic device can render using a low-complexity animation effect, reducing the computational resources consumed by the animation effect and preventing lag.
[0040] However, in the above technical solutions, an electronic device can only be configured with multiple animation effects of the same complexity. This means that when the animation effects built into the operating system of the electronic device are of low complexity, and the device is under light use (e.g., no applications are running in the background), the device uses these low-complexity animation effects for rendering, leaving a large amount of the device's computing resources idle, resulting in low utilization of computing resources. Furthermore, the low-complexity animation effects have poor detail, leading to a poor user experience.
[0041] Therefore, this application provides a method for invoking animation effects. This method can be applied to displaying animated interfaces on electronic devices. In this method, the electronic device is configured with multiple animation effects, each consuming different amounts of computing resources. The electronic device can obtain device information reflecting its resource usage. Then, based on the device information, the electronic device can determine a target animation effect from among the multiple animation effects and render the animated interface using that target animation effect.
[0042] In other words, when electronic devices are under heavy use, they can use animation effects that consume fewer resources for rendering. This avoids lag during interface switching and improves the user experience. When electronic devices are under light use, they can use animation effects that consume more resources for rendering. This improves resource utilization and enhances rendering quality.
[0043] In summary, electronic devices can rationally select animation effects based on their resource usage. This not only allows for the selection of appropriate animation effects to improve rendering quality but also avoids lag during interface transitions due to insufficient computing resources, thus enhancing the user experience.
[0044] For example, the electronic device in this application embodiment may be a tablet computer, mobile phone, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, vehicle device, etc. This application embodiment does not impose any special restrictions on the specific form of the electronic device.
[0045] The execution subject of the method for invoking animation effects provided in this application can be a device that invokes animation effects, and this execution device can be... Figure 1 The illustrated electronic device. The execution device can also be the CPU of the electronic device, or a control module within the electronic device used to invoke animation effects. This application embodiment uses a method for invoking animation effects by an electronic device as an example to illustrate the method for invoking animation effects provided in this application embodiment.
[0046] Please refer to Figure 1 This application uses electronic devices as an example. Figure 1 Taking the mobile phone 200 shown as an example, the electronic device provided in this application will be described. Among them, Figure 1 The mobile phone 200 shown is merely an example of an electronic device, and the mobile phone 200 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. Figure 1 The various components shown can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0047] like Figure 1 As shown, the mobile phone 200 may include: a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor module 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc.
[0048] The aforementioned sensor module 280 may include sensors such as pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and bone conduction sensors.
[0049] Processor 210 may include one or more processing units, such as application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0050] The controller can serve as the nerve center and command center of the mobile phone 200. Based on the instruction operation code and timing signals, the controller can generate operation control signals to control the fetching and execution of instructions.
[0051] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0052] In some embodiments, the processor 210 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0053] It is understood that the interface connection relationships between the modules illustrated in this embodiment are merely illustrative and do not constitute a structural limitation on the mobile phone 200. In other embodiments, the mobile phone 200 may also adopt different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0054] The charging management module 240 receives charging input from a charger, which can be a wireless charger or a wired charger. While charging the battery 242, the charging management module 240 can also supply power to the electronic device via the power management module 241.
[0055] The power management module 241 connects the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240, and supplies power to the processor 210, internal memory 221, external memory, display 294, camera 293, and wireless communication module 260, etc. In some embodiments, the power management module 241 and the charging management module 240 may also be housed in the same device.
[0056] The wireless communication function of mobile phone 200 can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor, and baseband processor. In some embodiments, antenna 1 of mobile phone 200 is coupled to mobile communication module 250, and antenna 2 is coupled to wireless communication module 260, enabling mobile phone 200 to communicate with networks and other devices through wireless communication technology.
[0057] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 200 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0058] The mobile communication module 250 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G for mobile phones 200. The mobile communication module 250 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation.
[0059] The mobile communication module 250 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 250 can be housed in the processor 210. In some embodiments, at least some functional modules of the mobile communication module 250 and at least some modules of the processor 210 can be housed in the same device.
[0060] The wireless communication module 260 can provide solutions for wireless communication applications on the mobile phone 200, including wireless local area networks (WLAN) (such as wireless fidelity, Wi-Fi), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. For example, in this embodiment, the mobile phone 200 can access a Wi-Fi network through the wireless communication module 260.
[0061] The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 210. The wireless communication module 260 can also receive signals to be transmitted from processor 210, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0062] The mobile phone 200 implements its display function through a GPU, a display screen 294, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0063] The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel. For example, in this embodiment, the display screen 294 can be used to display the main interface, the application interface of an application, and animation effects.
[0064] The mobile phone 200 can perform shooting functions through an ISP, camera 293, video codec, GPU, display 294, and application processor. The ISP is used to process data fed back by the camera 293. The camera 293 is used to capture still images or videos. In some embodiments, the mobile phone 200 may include one or N cameras 293, where N is a positive integer greater than 1.
[0065] The external storage interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 200. The external memory card communicates with the processor 210 through the external storage interface 220 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0066] Internal memory 221 can be used to store computer executable program code, which includes instructions. Processor 210 executes various functional applications and data processing of mobile phone 200 by running the instructions stored in internal memory 221. For example, in this embodiment, processor 210 can execute instructions stored in internal memory 221, which may include a program storage area and a data storage area.
[0067] The program storage area can store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.). The data storage area can store data created during the use of the mobile phone 200 (such as audio data, phonebook, etc.). In addition, the internal memory 221 can include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0068] The mobile phone 200 can perform audio functions, such as music playback and recording, through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, and an application processor.
[0069] Buttons 290 include a power button, volume buttons, etc. Buttons 290 can be mechanical buttons or touch buttons. Motor 291 can generate vibration alerts. Motor 291 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 292 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 295 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 295 to achieve contact and separation with the mobile phone 200. The mobile phone 200 can support one or N SIM card interfaces, where N is a positive integer greater than 1. SIM card interface 295 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0070] although Figure 1 As not shown, the mobile phone 200 may also have a flash, a miniature projection device, a near field communication (NFC) device, etc., which will not be described in detail here.
[0071] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the mobile phone 200. In other embodiments, the mobile phone 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0072] The methods described in the following embodiments can all be implemented in electronic devices having the above-described hardware structure and system architecture. The following embodiments use the above-described electronic device (e.g., mobile phone 200) as an example to illustrate the methods of this application.
[0073] In this embodiment, before the electronic device renders the interface display using animation effects, it can pre-save various types of animation effects. Each type of animation effect has a different level of complexity, and the resource overhead varies depending on the complexity. In other words, animation effects belonging to different types have different resource overheads.
[0074] It should be noted that the resource overhead of animation effects refers to the computing resources required by the electronic device to render the animation interface by calling the animation effects. This application does not limit the computing resources of the electronic device. For example, the computing resources of the electronic device can be CPU resources, GPU resources, or memory resources. As another example, the computing resources of the electronic device can include CPU resources, GPU resources, and memory resources. In the following embodiments, the method of this application embodiment is described using CPU resources as an example of the computing resources of the electronic device.
[0075] For example, if animation effect A has a CPU resource overhead of 5%, that is, animation effect A requires 5% of the total CPU computing resources. Similarly, if animation effect B has a CPU resource overhead of 7.5%, that is, animation effect B requires 7.5% of the total CPU computing resources. And if animation effect C has a CPU resource overhead of 20%, that is, animation effect C requires 20% of the total CPU computing resources.
[0076] In some embodiments, developers can pre-configure various types of animation effects for electronic devices. This application does not limit the scope of the developers. For example, the developers can be user experience (UE / UX) designers or user interface (UI) designers.
[0077] In this embodiment, the various types of animation effects may include: a first type of animation effect, a second type of animation effect, and a third type of animation effect. The resource cost of the first type of animation effect is greater than that of the second type of animation effect, and the resource cost of the second type of animation effect is greater than that of the third type of animation effect.
[0078] For example, as shown in Table 1, it illustrates the relationship between each type of animation effect and resource overhead.
[0079] Table 1
[0080] Animation effects type resource overhead Category 1 Animation Effects high Second type of animation effects middle Third category of animation effects Low
[0081] In other words, the resource cost of the first type of animation effect is the highest among all types of animation effects, the resource cost of the second type of animation effect is moderate among all types of animation effects, and the resource cost of the third type of animation effect is the lowest among all types of animation effects.
[0082] In one possible design, various types of animation effects can be categorized based on their resource overhead and a preset resource overhead threshold. The preset resource overhead threshold includes a first preset resource overhead threshold and a second preset resource overhead threshold, with the first preset resource overhead threshold being greater than the second preset resource overhead threshold.
[0083] It should be noted that the embodiments of this application do not limit the first preset resource cost threshold and the second preset resource cost threshold. For example, suppose the first preset resource cost threshold is 30% and the second preset resource cost threshold is 10%. If the resource cost of animation effect A is 35%, then animation effect A is a first-type animation effect. If the resource cost of animation effect B is 15%, then animation effect B is a second-type animation effect. If the resource cost of animation effect C is 8%, then animation effect C is a third-type animation effect.
[0084] Understandably, the higher resource consumption of the first type of animation effect indicates its higher complexity and better rendering quality; however, it also requires more computing resources from electronic devices, placing higher demands on them. The moderate resource consumption of the second type of animation effect indicates its moderate complexity and average rendering quality; furthermore, it requires moderate computing resources from electronic devices, placing lower demands on them compared to the first type. The lower resource consumption of the third type of animation effect indicates its lower complexity and poorer rendering quality; however, it requires fewer computing resources from electronic devices, placing lower demands on them.
[0085] In some embodiments, developers can configure different durations for different types of animation effects. The duration of an effect is the time it takes for an electronic device to render the animation effect and display the animated interface. Specifically, the duration of the first type of animation effect is longer than that of the second type, and the duration of the second type is longer than that of the third type.
[0086] For example, the duration of the first type of animation effect can be 380 milliseconds (ms), the duration of the second type of animation effect can be 250 ms, and the duration of the third type of animation effect can be 200 ms.
[0087] It's understandable that the longer the animation effects last, the better the rendering effect. However, the longer the animation effects last, the greater the resource consumption.
[0088] It's important to note that animation effects are composed of multiple animation elements. Furthermore, different animation elements have varying resource costs. If all animation effects consist of resource-intensive elements, then all animation effects may have high resource costs. This can cause frame drops in animation effects and stuttering during interface transitions when electronic devices are used heavily.
[0089] In this embodiment, the electronic device stores multiple types of animation elements, each with different resource overhead. These multiple types of animation elements may include: a first type of animation element, a second type of animation element, and a third type of animation element. The resource overhead of the first type of animation element is greater than that of the second type, and the resource overhead of the second type of animation element is greater than that of the third type.
[0090] It should be noted that the embodiments of this application do not limit the first type of animation elements, the second type of animation elements, and the third type of animation elements. For example, the first type of animation elements may include: blur, color picking, G2 curve rounded corners, etc. The second type of animation elements may include: scaling, image copying, particle effects, G1 curve rounded corners, etc. The third type of animation elements may include: displacement, cropping, adjusting transparency, etc.
[0091] In one possible design, the types of animation elements can be categorized based on a third preset resource cost threshold and a fourth preset resource cost threshold. The third preset resource cost threshold is greater than the fourth preset resource cost threshold. The resource cost of the first type of animation element is greater than or equal to the third preset resource cost threshold; the resource cost of the second type of animation element is less than the third preset resource cost threshold, and the resource cost of the second type of animation element is greater than or equal to the fourth preset resource cost threshold; the resource cost of the third type of animation element is less than the fourth preset resource cost threshold.
[0092] It should be noted that the embodiments of this application do not limit the third preset resource cost threshold and the fourth preset resource cost threshold. For example, suppose the third preset resource cost threshold is 15% and the fourth preset resource cost threshold is 5%. If the resource cost of animation element A is 17%, then animation element A is a first-class animation element. If the resource cost of animation element B is 8%, then animation element B is a second-class animation element. If the resource cost of animation element C is 3%, then animation element C is a third-class animation element.
[0093] In the embodiments of this application, each type of animation effect includes at least one animation effect, and an animation effect is composed of at least one type of animation element. That is, the resource overhead of an animation effect is determined by the multiple animation elements that make up the animation effect, and the electronic device can render the process of displaying an animated interface using an animation effect composed of multiple animation elements.
[0094] It should be noted that an animation effect consisting of at least one type of animation element means that an animation effect can be composed of one type of animation element; or, an animation effect can be composed of multiple types of animation elements. For example, as shown in Table 2, animation effect A1 belongs to the first category of animation effects, and consists of blur, G2 curve rounded corners, and displacement. Blur, G2 curve rounded corners, and displacement are all first-category animation elements. Animation effect A2 belongs to the second category of animation effects, and consists of scaling, adjusting opacity, and G1 curve rounded corners. Scaling and G1 curve rounded corners are second-category animation elements, while adjusting opacity is a third-category animation element. Animation effect A3 belongs to the third category of animation effects, and consists of displacement, cropping, and adjusting opacity. Displacement, cropping, and adjusting opacity are all third-category animation elements.
[0095] Table 2
[0096] Animation effects type Animation effects resource overhead Animation elements Category 1 Animation Effects Animation Effects A1 high Blur + G2 curve fillet + displacement Second type of animation effects Animation Effects A2 middle Scaling + Adjusting transparency + G1 curve rounded corners Third category of animation effects Animation effects A3 Low Displacement + cropping + adjusting transparency
[0097] It's understandable that an animation effect consists of at least one type of animation element, and the number of animation effects can be increased. Furthermore, animation effects can be configured reasonably based on the resource costs of different animation element types to ensure that the resource costs of the animation effects remain within an appropriate range.
[0098] In this embodiment, to prevent lag in the electronic device, the device can store preset device information and a first relationship, which is the relationship between various types of animation effects and the preset device information. The preset device information includes a first preset resource threshold and a second preset resource threshold.
[0099] It should be noted that the embodiments of this application do not limit the first preset resource threshold and the second preset resource threshold. For example, the first preset resource threshold can be 40%, and the second preset resource threshold can be 70%. Another example is that the first preset resource threshold can be 39%, and the second preset resource threshold can be 69%. Yet another example is that the first preset resource threshold can be 38.5%, and the second preset resource threshold can be 68.5%.
[0100] In this embodiment, the first relationship is used to instruct the electronic device to invoke different types of animation effects based on the current device information. The current device information indicates the computing resources currently being used by the electronic device. For example, the current device information includes the current CPU utilization rate; if the current CPU utilization rate is 50%, it means that the electronic device is currently using 50% of the CPU's computing resources.
[0101] In one possible implementation, the electronic device can create a database to store the relationships between a first type of animation effect, a second type of animation effect, a third type of animation effect, and preset device information. Specifically, the first relationship includes: when the current device information of the electronic device is less than a first preset resource threshold, the electronic device can invoke the first type of animation effect. When the current device information is greater than the first preset resource threshold and less than a second preset resource threshold, the electronic device can invoke the second type of animation effect. When the current device information is greater than the second preset resource threshold, the electronic device can invoke the third type of animation effect.
[0102] For example, suppose the first preset resource threshold can be 40%, and the second preset resource threshold can be 70%. As shown in Table 3, it illustrates the relationship between various types of animation effects and preset device information.
[0103] Table 3
[0104]
[0105]
[0106] Optionally, when the current device information is less than a first preset resource threshold, the electronic device can call either the first type of animation effect, or the second or third type of animation effect. When the current device information is greater than the first preset resource threshold and less than a second preset resource threshold, the electronic device can call either the second type of animation effect or the third type of animation effect. However, in general, to fully utilize the computing resources of the electronic device, the electronic device can usually call animation effect types with higher resource overhead.
[0107] It is understandable that electronic devices can save primary relationships so that they can call the appropriate animation effect type based on the current device information, thereby enabling the electronic device to make reasonable use of computing resources and avoid lag.
[0108] This application provides a method for invoking animation effects, such as... Figure 2 As shown, the methods for calling this animation effect can include S201-S204.
[0109] S201, The electronic device receives the first operation.
[0110] The first operation is used to trigger the electronic device to display an animated interface. For example, the electronic device can display the animated interface when there is a graphical change on the current display interface; or, the electronic device can display the animated interface when switching display interfaces.
[0111] It should be noted that this application does not limit the first operation. For example, the first operation can be a gesture operation, such as a click or swipe. The first operation can also be an operation command, such as a voice command issued by the user. Furthermore, the embodiments of this application do not limit the display of the animated interface. For example, the electronic device can switch the displayed interface from a system interface (e.g., the main interface and the negative one screen) to an application interface. As another example, the electronic device can switch the displayed interface from one system interface to another. As yet another example, when the electronic device launches an application, it will load the application's special effects animation.
[0112] It should be noted that the applications (such as the first application and the second application) in the embodiments of this application can be embedded applications (i.e., system applications of the electronic device) installed in the electronic device or downloadable applications. Embedded applications are applications provided as part of the implementation of an electronic device (such as a mobile phone). Downloadable applications are applications that can provide their own Internet Protocol Multimedia Subsystem (IMS) connectivity; these downloadable applications can be applications pre-installed on the terminal or third-party applications that can be downloaded and installed on the terminal by the user.
[0113] For example, such as Figure 3 As shown in (a), the electronic device can display a main interface 301, which includes a smart home icon 302. The electronic device can receive user actions (e.g., action A) on the smart home icon 302. In response to action A, the electronic device switches the displayed interface to... Figure 3 The smart home interface 303 shown in (b) is shown in the image.
[0114] In this embodiment, the first operation is used to trigger the electronic device to render the animated interface by calling animation effects from various types of animation effects based on the current device information. The current device information indicates the computing resources currently being used by the electronic device.
[0115] For example, current device information may include current CPU utilization. For instance, if the current CPU utilization is 43%, it means that the electronic device is currently using 43% of the CPU's computing resources.
[0116] It should be noted that, in this embodiment, the current device information may include computing resources already used by one or more hardware devices in the electronic device. This embodiment does not limit the hardware devices. For example, hardware devices may include CPUs, graphics processing units (GPUs), and memory modules, etc.
[0117] Optionally, the current device information may include the current graphics processing unit (GPU) utilization rate. For example, a current GPU utilization rate of 28% indicates that the electronic device is currently using 28% of the GPU's computing resources. Optionally, the current device information may include the current CPU utilization rate, current GPU utilization rate, and current memory utilization rate. For example, a current CPU utilization rate of 43%, a current GPU utilization rate of 28%, and a current memory utilization rate of 80% indicates that the electronic device is currently using 43% of the CPU's computing resources, 28% of the GPU's computing resources, and 80% of the memory's resources.
[0118] S202, In response to the first operation, the electronic device obtains the current device information of the electronic device.
[0119] For example, an electronic device can obtain the current CPU utilization from the CPU.
[0120] S203. The electronic device determines the target animation effect that matches the current device information based on the current device information and the first relationship.
[0121] The target animation effect is an animation effect among various types of animation effects.
[0122] In this embodiment, the electronic device can compare current device information with preset device information to obtain a comparison result. Then, based on the comparison result and a first relationship, the electronic device can determine the target animation effect from various types of animation effects.
[0123] like Figure 4 As shown, this application embodiment provides a method for invoking animation effects. In this method for invoking animation effects, step S203 may include steps S2031-S2035.
[0124] S2031. The electronic device determines whether the current device information is less than or equal to the first preset resource threshold.
[0125] In some embodiments, if the electronic device determines that the current device information is less than or equal to a first preset resource threshold, the electronic device may execute S2032. If the electronic device determines that the current device information is greater than the first preset resource threshold, the electronic device may execute S2033.
[0126] S2032. The electronic device determines that the target animation effect is a first-class animation effect.
[0127] In other words, if the electronic device determines that the current device information is less than the first preset resource threshold, the electronic device can determine that the target animation effect is a first type of animation effect.
[0128] Understandably, the first preset resource threshold is relatively small. If the current device information is less than the first preset resource threshold, it means that the utilization rate of the electronic device's current computing resources is low, and the electronic device has a lot of available computing resources. Therefore, the electronic device can identify the first type of animation effect, which has higher complexity and greater resource consumption, as the target animation effect.
[0129] S2033. The electronic device determines whether the current device information is less than or equal to the second preset resource threshold.
[0130] The first preset resource threshold is less than the second preset resource threshold.
[0131] In some embodiments, if the electronic device determines that the current device information is greater than a first preset resource threshold and the current device information is less than or equal to a second preset resource threshold, the electronic device executes S2034. If the electronic device determines that the current device information is greater than the second preset resource threshold, the electronic device executes S2035.
[0132] S2034. The electronic device determines that the target animation effect is a second type of animation effect.
[0133] In other words, if the electronic device determines that the current device information is greater than the first preset resource threshold and the current device information is less than the second preset resource threshold, the electronic device can determine that the target animation effect is a second type of animation effect.
[0134] S2035. Electronic devices determine that the target animation effect is a third-class animation effect.
[0135] In other words, if the electronic device determines that the current device information is greater than the second preset resource threshold, the electronic device can determine that the target animation effect is a third type of animation effect.
[0136] Understandably, the second preset resource threshold is relatively high. If the current device information exceeds the second preset resource threshold, it indicates that the electronic device's current computing resource utilization is high, and the available computing resources are limited. Therefore, the electronic device can determine the third type of animation effect, which has lower complexity and lower resource consumption, as the target animation effect.
[0137] In one possible implementation, if the current device information includes the computing resources already used by a hardware device, the electronic device can compare the computing resources already used by the hardware device with preset device information to determine the target animation effect. For example, suppose the current device information includes the current CPU utilization rate. Referring to Table 3, the first preset resource threshold can be 40%, and the second preset resource threshold can be 70%. If the current CPU utilization rate is 25%, the electronic device can determine the target animation effect as a first-type animation effect. If the current CPU utilization rate is 60%, the electronic device can determine the target animation effect as a second-type animation effect. If the current CPU utilization rate is 80%, the electronic device can determine the target animation effect as a third-type animation effect.
[0138] Understandably, when the current CPU utilization is below the first preset resource threshold (i.e., when CPU utilization is low), the electronic device can classify the target animation effect as a first-type animation effect. This not only fully utilizes CPU computing resources but also improves rendering detail and enhances the user experience. When the current CPU utilization is above the first preset resource threshold and below the second preset resource threshold (i.e., when CPU utilization is moderate), the electronic device can classify the target animation effect as a second-type animation effect. This not only ensures rendering detail but also prevents the electronic device from stuttering. When the current CPU utilization is below the second preset resource threshold (i.e., when CPU utilization is high), the electronic device can classify the target animation effect as a third-type animation effect. This avoids stuttering caused by rendering consuming CPU computing resources, further improving the user experience.
[0139] In another possible implementation, if the current device information includes the computing resources already used by multiple hardware devices, the electronic device can compare the computing resources already used by the multiple hardware devices with the preset device information corresponding to the multiple hardware devices to determine the target animation effect.
[0140] It should be noted that the embodiments of this application do not limit the preset device information corresponding to multiple hardware devices. For example, the preset device information corresponding to multiple hardware devices can be the same. For instance, the first preset resource threshold for both the CPU and GPU is 40%, and the second preset resource threshold for both the CPU and GPU is 70%. For example, the preset device information corresponding to multiple hardware devices can be different. For instance, the first preset resource threshold for the CPU is 40%, and the second preset resource threshold for the CPU is 70%; the first preset resource threshold for the GPU is 35%, and the second preset resource threshold for the GPU is 65%. The embodiments of this application will be described below using the example of multiple hardware devices having the same preset device information.
[0141] For example, suppose the current device information includes current CPU utilization, current GPU utilization, and current memory utilization. Referring to Table 3, the first preset resource threshold can be 40%, and the second preset resource threshold can be 70%. If the current CPU utilization is 30%, the current GPU utilization is 33%, and the current memory utilization is 28%, the electronic device can determine that the target animation effect is a first-type animation effect. If the current CPU utilization is 50%, the current GPU utilization is 33%, and the current memory utilization is 28%, the electronic device can determine that the target animation effect is a second-type animation effect. If the current CPU utilization is 50%, the current GPU utilization is 80%, and the current memory utilization is 28%, the electronic device can determine that the target animation effect is a third-type animation effect.
[0142] In other words, when an electronic device determines the target animation effect based on the computing resources already used by multiple hardware devices, the electronic device needs to determine the target animation effect based on the usage of the hardware device with the highest computing resources among the multiple hardware devices.
[0143] Understandably, electronic devices can more comprehensively combine the currently used computing resources with the current device information from multiple hardware devices to determine the target animation effects. In this way, the computing resources of electronic devices can be fully utilized, ensuring that the electronic devices can achieve the best rendering effect without lag.
[0144] S204. The electronic device invokes the target animation effect to render the process of displaying the animated interface on the electronic device.
[0145] In this embodiment, if the current device information is less than a first preset resource threshold, the electronic device can invoke a first type of animation effect for rendering. If the current device information is greater than the first preset resource threshold and less than a second preset resource threshold, the electronic device can invoke a second type of animation effect for rendering. If the current device information is greater than the second preset resource threshold, the electronic device can invoke a third type of animation effect for rendering.
[0146] It is understandable that electronic devices can call different animation effects for rendering when the current device information is different. This can make full use of the computing resources of electronic devices and ensure that the electronic devices achieve the best rendering effect without lag.
[0147] It should be noted that different levels of animation complexity result in different power consumption. If an electronic device has low remaining battery power, using a power-intensive animation effect will increase the device's power consumption and shorten its usability.
[0148] In some embodiments, the resource overhead of animation effects can be used to indicate the power consumption of an electronic device when invoking the animation effects. Specifically, the power consumption of the first type of animation effect is greater than that of the second type, and the power consumption of the second type is greater than that of the third type. In other words, the higher the complexity of the animation effect, the greater its resource overhead.
[0149] In this embodiment, the current device information of the electronic device can be used to indicate the remaining battery power of the electronic device. The electronic device can, based on the remaining battery power and a first relationship, invoke a target animation effect that matches the current remaining battery power to render the animated interface displayed on the electronic device.
[0150] It should be noted that the process of rendering the animated interface of the electronic device by calling a target animation effect that matches the current remaining battery power and the first relationship can be referred to in the above embodiment, which calls a target animation effect that matches the current computing resources used and the first relationship to render the animated interface of the electronic device. It will not be elaborated here.
[0151] Understandably, electronic devices can render target animation effects based on the current remaining battery power, which can extend the usable time of the electronic device and improve the user experience.
[0152] It should be noted that the process of displaying an animated interface on an electronic device varies depending on the scene (which can be simply referred to as the "rendering scene") used. For example, an electronic device's rendering scene may include launching an application. Figure 3 As shown in (a), the electronic device displays a main interface 301, which includes a smart home icon 302. The electronic device can receive user actions (e.g., action A) on the smart home icon 302. In response to action A, the electronic device switches the displayed interface to... Figure 3 The smart home interface 303 is shown in (b) of the diagram. Exemplarily, the scene of an electronic device rendering interface may also include switching applications. For example, such as... Figure 3 As shown in (b), the smart home interface 303 of the electronic device displays an information prompt message 304, such as "Message from 10086" or "Hello, XXXXX". Afterwards, the electronic device can respond to user input of an application switching operation (e.g., operation B) and switch the displayed interface to... Figure 3 The SMS application interface 305 is shown in (c) above. Therefore, if the same animation effect is used in different interface rendering scenarios, it may lead to inconsistent interface display.
[0153] In some embodiments, each type of animation effect includes at least one animation effect, and each of the at least one animation effect corresponds to a scene that displays an animated interface.
[0154] For example, as shown in Table 4, in conjunction with Table 1, the relationship between animation effects and interface transition scenes is illustrated.
[0155] Table 4
[0156]
[0157] In other words, in the first type of animation effects, animation effect A1 is used to render the animation interface displayed in the scene of launching the application; animation effect A2 is used to render the animation interface displayed in the scene of switching applications; and animation effect A3 is used to render the animation interface displayed in the scene of closing the application. For descriptions of the second and third types of animation effects, please refer to the introduction of the first type of animation effects; they will not be repeated here.
[0158] In one possible design, the electronic device can pre-create a database storing various animation effects for each type of animation effect corresponding to different interface rendering scenarios. For example, as shown in Table 4, when the interface rendering scenario is "launching an application," the animation effects corresponding to this scenario can be animation effect A1, animation effect B1, and animation effect C1. That is, when the electronic device determines that the interface rendering scenario is "launching an application," it can invoke animation effect A1, animation effect B1, or animation effect C1 to render the process of displaying the animated interface. Similarly, when the electronic device determines that the interface rendering scenario is "switching applications," it can invoke animation effect A2, animation effect B2, or animation effect C2 to render the process of switching the display interface. When the electronic device determines that the interface rendering scenario is "closing an application," it can invoke animation effect A3, animation effect B3, or animation effect C3 to render the process of displaying the animated interface.
[0159] In this embodiment, the electronic device can acquire the interface rendering scene and current device information. Then, the electronic device can determine a target animation effect based on the interface rendering scene and the current device information, and this target animation effect matches the current device information and the interface rendering scene.
[0160] For example, suppose the current interface rendering scene is an application launch, and the current device information is 35%. Referring to Tables 3 and 4, we know that the target animation effect is animation effect A1. That is, the electronic device can call animation effect A1 to render the application launch process.
[0161] In this way, electronic devices can render scenes based on the interface, using animation effects corresponding to those scenes. This not only avoids display anomalies but also ensures the quality of the rendering.
[0162] The foregoing primarily describes the solutions provided by the embodiments of this application from the perspective of electronic devices. It is understood that, in order to achieve the aforementioned functions, the electronic device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the steps of the method for invoking animation effects described in conjunction with the embodiments disclosed in this application, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed through hardware or by software-driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0163] Other embodiments of this application provide an electronic device (such as...) Figure 1 The mobile phone 200 shown is an example. The electronic device may include a memory and one or more processors. The memory and processors are coupled. The electronic device may also include a camera. Alternatively, the electronic device may have an external camera. The memory stores computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform various functions or steps performed by the mobile phone in the above method embodiments. The structure of the electronic device can be referenced... Figure 1 The structure of the mobile phone 200 shown.
[0164] This application also provides a chip system, such as... Figure 5 As shown, the chip system includes at least one processor 501 and at least one interface circuit 502. The processor 501 and the interface circuit 502 are interconnected via lines. For example, the interface circuit 502 can be used to receive signals from other devices (e.g., the memory of an electronic device). As another example, the interface circuit 502 can be used to send signals to other devices (e.g., the processor 501). Exemplarily, the interface circuit 502 can read instructions stored in memory and send those instructions to the processor 501. When the instructions are executed by the processor 501, they can cause the electronic device (e.g., the processor 501) to... Figure 1 The mobile phone 200 shown executes the steps in the above embodiments. Of course, the chip system may also include other discrete components, and this application embodiment does not specifically limit this.
[0165] This application embodiment also provides a computer-readable storage medium, which includes computer instructions, and when the computer instructions are used in the above-mentioned electronic device (such as...). Figure 1When the device is run on the mobile phone 200 shown, it causes the electronic device to perform the various functions or steps performed by the mobile phone in the above method embodiment.
[0166] This application also provides a computer program product that, when run on a computer, causes the computer to perform the various functions or steps performed by the mobile phone in the above method embodiments.
[0167] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0168] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0169] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0170] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0171] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0172] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for calling an animation effect, characterized in that, The method is applied to an electronic device that stores various types of animation effects. Different types of animation effects have different resource costs, and the resource cost of each animation effect is determined by the resource cost of the included animation elements. The electronic device stores various types of animation elements, and one type of animation effect includes at least one type of animation element. Different types of animation elements have different resource costs. The method includes: The electronic device receives a first operation, which triggers the electronic device to display an animated interface. In response to the first operation, the electronic device acquires its current device information; wherein the current device information indicates the computing resources currently used by the electronic device, and includes at least the CPU utilization rate; the electronic device stores preset device information and a first relationship, the first relationship being the correspondence between the various types of animation effects and the preset device information; each type of animation effect includes at least one animation effect, and each of the at least one animation effect corresponds to a scene for displaying an animation interface; the preset device information includes: a first preset resource threshold and a second preset resource threshold, wherein the first preset resource threshold is less than the second preset resource threshold; The electronic device determines a target animation effect that matches the current device information and the interface rendering scene from the various types of animation effects, based on the interface rendering scene, the current device information, and the first relationship. The electronic device invokes the target animation effect to render the process of displaying the animated interface on the electronic device.
2. The method of claim 1, wherein, The various types of animation effects include: a first type of animation effect, a second type of animation effect, and a third type of animation effect; wherein, the resource cost of the first type of animation effect is greater than that of the second type of animation effect, and the resource cost of the second type of animation effect is greater than that of the third type of animation effect.
3. The method according to claim 2, characterized in that, The electronic device determines a target animation effect that matches the current device information from among the various types of animation effects, based on the current device information and the first relationship, including: If the current device information is less than or equal to the first preset resource threshold, the electronic device determines that the target animation effect is the first type of animation effect; If the current device information is greater than the first preset resource threshold, and the current device information is less than or equal to the second preset resource threshold, the electronic device determines that the target animation effect is the second type of animation effect; If the current device information is greater than the second preset resource threshold, the electronic device determines the target animation effect as the third type of animation effect.
4. The method according to claim 2 or 3, characterized in that, The duration of the first type of animation effect is longer than the duration of the second type of animation effect, and the duration of the second type of animation effect is longer than the duration of the third type of animation effect; wherein, the duration of the effect is used to instruct the electronic device to call the animation effect and render the process of displaying the animation interface on the electronic device.
5. The method according to any one of claims 1-3, characterized in that, The various types of animation elements include: a first type of animation element, a second type of animation element, and a third type of animation element; wherein, the resource cost of the first type of animation element is greater than that of the second type of animation element, and the resource cost of the second type of animation element is greater than that of the third type of animation element.
6. An electronic device, comprising: The electronic device includes: a memory, a display screen, and one or more processors; the memory, the display screen, and the processors are coupled together; the memory is used to store computer program code, the computer program code including computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1-5.
7. A computer readable storage medium characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
User interface rendering method and device and terminal
CN108628652A
Live gift display method and device
CN111083554A
Animation material playing method and device, electronic equipment and computer readable medium
CN112261426A