Animation playing method and device, electronic equipment and computer storage medium

By selecting target images from the animation file and decoding and rendering them in the playback order, the problem of slow playback speed caused by the first frame of the animation is solved, and faster animation playback is achieved.

CN117409113BActive Publication Date: 2026-06-16TCL COMMUNICATION TECHNOLOGY (NINGBO) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TCL COMMUNICATION TECHNOLOGY (NINGBO) CO LTD
Filing Date
2023-03-14
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

When the first frame of an animation is used as a keyframe, the decoding and rendering speed is slow, resulting in a slower animation playback speed.

Method used

The target images in the animation file are filtered out except for the first frame, and then decoded and rendered according to the playback order of the target images. This avoids decoding and rendering the first frame and starts directly from the second frame.

🎯Benefits of technology

It improves the playback speed of animations, reduces the amount of data for decoding and rendering, and enhances the playback efficiency of animations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117409113B_ABST
    Figure CN117409113B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an animation playing method and device, electronic equipment and computer storage medium; in the embodiments of the present application, the trigger instruction corresponding to the icon of target animation is acquired;According to the trigger instruction, the animation file corresponding to the target animation is acquired, and the state of the icon is determined;If the state of the icon is the first frame state, the data corresponding to the target image in the target animation is filtered out from the animation file, and the target image is the image in the target animation except the first frame image;According to the playing order of the target image in the target animation, the data corresponding to the target image is decoded to obtain the decoded data of the target image;According to the decoded data, the target image is rendered, and the target animation is played according to the target image.The embodiments of the present application can improve the speed of animation playing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, specifically to an animation playback method, apparatus, electronic device, and computer storage medium. Background Technology

[0002] When an animation is not playing, a frame is selected from the animation and displayed as the animation icon on the screen. When the user clicks the icon, the phone decodes and renders the corresponding animation file to play the animation.

[0003] When decoding and rendering the animation file corresponding to the animation, the first frame of the animation is a keyframe image, so the decoding and rendering speed is slow, resulting in a slow playback speed of the animation. Summary of the Invention

[0004] This application provides an animation playback method, apparatus, electronic device, and computer storage medium, which can solve the technical problem of animation playback speed.

[0005] This application provides an animation playback method, including:

[0006] Get the trigger command for the icon corresponding to the target animation;

[0007] Based on the above triggering command, obtain the animation file corresponding to the target animation and determine the status of the icon;

[0008] If the state of the above icon is the first frame state, then the data corresponding to the target image in the above target animation is filtered out from the above animation file. The above target image is the image in the above target animation other than the first frame image.

[0009] Based on the playback order of the target images in the target animation, the data corresponding to the target images are decoded to obtain the decoded data of the target images.

[0010] The decoded data is rendered to obtain the target image, and the target animation is played based on the target image.

[0011] Accordingly, embodiments of this application provide an animation playback device, including:

[0012] The acquisition module is used to acquire the trigger instructions for the icon corresponding to the target animation;

[0013] The determination module is used to obtain the animation file corresponding to the target animation based on the above triggering instructions, and to determine the status of the above icon;

[0014] The filtering module is used to filter out the data corresponding to the target image in the target animation from the animation file if the state of the above icon is the first frame state. The target image is the image in the target animation other than the first frame image.

[0015] The decoding module is used to decode the data corresponding to the target image according to the playback order of the target image in the target animation, so as to obtain the decoded data of the target image.

[0016] The playback module is used to render the decoded data to obtain the target image and play the target animation based on the target image.

[0017] Furthermore, this application also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the animation playback method provided in this application.

[0018] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program adapted for loading by a processor to execute any of the animation playback methods provided in embodiments of this application.

[0019] Furthermore, this application also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the animation playback methods provided in this application.

[0020] In this embodiment, a trigger command for the icon corresponding to the target animation is obtained; according to the trigger command, the animation file corresponding to the target animation is obtained, and the state of the icon is determined; if the state of the icon is the first frame state, the data corresponding to the target image in the target animation is filtered out from the animation file, and the target image is the image in the target animation other than the first frame image; according to the playback order of the target image in the target animation, the data corresponding to the target image is decoded to obtain the decoded data of the target image; the decoded data is rendered to obtain the target image, and the target animation is played according to the target image. This achieves that during the playback of the target animation, if the icon of the target animation is the first frame image of the target animation, the animation file is decoded and rendered starting from the second frame image of the target animation, without needing to decode and render the first frame image of the target animation, thus improving the playback speed of the target animation. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart illustrating the animation playback method provided in an embodiment of this application;

[0023] Figure 2 This is a schematic diagram of the screen size of the target animation provided in the embodiments of this application;

[0024] Figure 3 This is a schematic diagram illustrating the process of generating icons provided in an embodiment of this application;

[0025] Figure 4 This is a schematic diagram of another animation playback method provided in an embodiment of this application;

[0026] Figure 5 This is a schematic diagram of another animation playback method provided in an embodiment of this application;

[0027] Figure 6 This is a schematic diagram of the structure of the animation playback device provided in the embodiments of this application;

[0028] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0029] 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.

[0030] This application provides an animation playback method, apparatus, electronic device, and computer storage medium. The animation playback apparatus can be integrated into an electronic device, which can be a server, a terminal, or other similar device.

[0031] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.

[0032] The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and the server can be connected directly or indirectly through wired or wireless communication, which is not limited herein.

[0033] Furthermore, in the embodiments of this application, "multiple" refers to two or more. The terms "first" and "second," etc., in the embodiments of this application are used for distinguishing descriptions and should not be construed as implying relative importance.

[0034] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0035] In this embodiment, the description will be from the perspective of the animation playback device. In order to facilitate the explanation of the animation playback method of this application, the following will describe the animation playback device integrated into the terminal in detail, that is, the terminal will be used as the execution subject in the detailed description.

[0036] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of an animation playback method provided in this application. The animation playback method may include:

[0037] S101. Obtain the trigger command for the icon corresponding to the target animation.

[0038] The icon corresponding to the target animation is a graphic symbol that represents the target animation. It has the characteristics of highly condensing and quickly conveying the information of the target animation and making it easy to remember.

[0039] The terminal can respond to the user's interactive operation to obtain the trigger command for the icon corresponding to the target animation. Alternatively, other terminals can also send the trigger command for the icon corresponding to the target animation to the terminal, and the terminal can then obtain the trigger command for the icon corresponding to the target animation.

[0040] The type of interactive operation can be set according to the actual situation. For example, the interactive operation can be a click operation or a long press operation. This application embodiment does not limit this.

[0041] The method by which the terminal obtains the trigger command for the icon corresponding to the target animation can be selected according to the actual situation, and this application embodiment does not limit it here.

[0042] In some embodiments, before obtaining the trigger instruction for the icon corresponding to the target animation, the method further includes:

[0043] Obtain the screen dimensions of the target animation;

[0044] Determine the icon size based on the screen size of the target animation;

[0045] Display the icon based on its size.

[0046] The screen size of a target animation can refer to the screen size of each frame in the animation. The screen size of each frame in a target animation can be the same or different. When the screen sizes of each frame in a target animation are different, the screen size of the target animation changes dynamically during playback.

[0047] For example, if the image size of each frame in the target animation is different, the playback process of the target animation can be as follows: Figure 2 As shown ( Figure 2 (The content of each frame in the target animation is not shown in the image).

[0048] Typically, icons have a preset size, and icons are generated according to this preset size. However, when the screen size of the target animation differs significantly from the preset icon size, generating an icon based on the preset size can result in an unclear icon. Therefore, in this embodiment, the icon size is determined based on the screen size of the target animation, ensuring that the difference between the icon size and the target animation screen size is not too large, thus making the displayed icon clearer.

[0049] Optionally, the screen size of any frame in the target animation can be used as the screen size of the target animation, or the screen size of the image frame of the generated icon can be used as the screen size of the target animation. The image frame of the generated icon can be the first frame of the target animation or the target image of the target animation.

[0050] In other embodiments, it can also be determined whether the size relationship between the target animation's screen size and a preset threshold needs to be determined based on whether the icon is the first frame image of the target animation. In this case, the process of determining the size relationship between the target animation's screen size and the preset threshold can be as follows:

[0051] Define the icon for the target animation;

[0052] If the icon is the first frame image, then determine the size relationship between the target animation's screen size and the preset threshold.

[0053] If the icon is not the first frame image, the preset size can be used directly as the icon size.

[0054] In other embodiments, the process of determining the icon size based on the screen size of the target animation can be as follows:

[0055] Determine the size relationship between the target animation's screen size and a preset threshold;

[0056] If the size relationship meets the preset conditions, the screen size of the target animation will be used as the size of the icon.

[0057] If the size relationship meets the preset conditions, it indicates that the screen size of the target animation and the preset size of the icon are too different. In this case, the screen size of the target animation will be used as the size of the icon, so that the icon generated based on the size of the icon and the image in the target animation is clear.

[0058] If the size relationship does not meet the preset conditions, it means that the screen size of the target animation and the preset size of the icon will not differ too much. In this case, the preset size is obtained and used as the size of the icon, so that the icon generated based on the size of the icon and the image in the target animation is clear.

[0059] For example, such as Figure 3 As shown, the terminal first obtains the screen size of the target animation, and then determines whether the icon is the first frame image. If the icon is not the first frame image, the terminal obtains the data of the target image, generates the target image based on the target image data and the preset size, and displays the target image as the icon.

[0060] If the icon is the first frame image, then it is determined whether the screen size of the target animation is smaller than a preset threshold. If the screen size of the target animation is smaller than the preset threshold, it indicates that the size relationship between the screen size of the target animation and the preset threshold meets the preset condition. In this case, the first frame image is generated based on the screen size of the target animation and the data of the first frame image, and the first frame image is displayed as the icon.

[0061] If the screen size of the target animation is not less than the preset threshold, the first frame image is generated based on the data of the first frame image and the preset size, and the first frame image is displayed as an icon.

[0062] S102. Based on the trigger command, obtain the animation file corresponding to the target animation and determine the status of the icon.

[0063] An animation file refers to a file containing data for each frame of the target animation. The icon's status indicates whether the icon represents the first frame of the target animation.

[0064] After receiving the trigger command, the terminal can determine the status of the icon while obtaining the animation file corresponding to the target animation, or it can obtain the animation file first and then determine the status of the icon, or it can determine the status of the icon first and then obtain the animation file. This application embodiment does not limit this.

[0065] Optionally, the terminal can obtain the animation file corresponding to the target animation from local storage space, or it can obtain the animation file of the target animation from the server.

[0066] S103. If the icon is in the first frame state, then filter out the data corresponding to the target image in the target animation from the animation file. The target image is the image in the target animation other than the first frame image.

[0067] When the icon is in the first frame state, it indicates that the icon is the first frame image of the target animation. When the icon is not in the first frame state, it indicates that the icon is not the first frame image of the target animation.

[0068] If the icon is the first frame of the target animation, the data of the first frame in the animation file can be skipped and the first frame can be skipped. Decoding and rendering can begin from the second frame of the target animation to reduce the amount of data to be decoded and rendered, thereby increasing the playback speed of the target animation.

[0069] Since there is no need to decode the data of the first frame image in the animation file when the icon is the first frame image of the target animation, the data corresponding to the target image in the target animation can be filtered out from the animation file. The target image is the image in the target animation other than the first frame image, and the target image can include multiple images.

[0070] In some embodiments, when determining the icon size based on the size of the target animation, before filtering out the data corresponding to the target image in the target animation from the animation file if the icon's state is the first frame state, the method further includes:

[0071] Determine the icon size;

[0072] If the icon's size is the same as the target animation's size, then the icon's state is determined to be the first frame state.

[0073] In this embodiment of the application, it can be determined whether the icon is the first frame image based on the size of the icon.

[0074] Alternatively, the image used as an icon can be marked according to a preset identifier. Then, after receiving the trigger command, it can be checked whether the preset identifier exists in the first frame image. If the preset identifier exists, the icon's state is determined to be the first frame state. If the preset identifier does not exist in the first frame image, the image's state is determined to be not the first frame state.

[0075] S104. Based on the playback order of the target image in the target animation, decode the data corresponding to the target image to obtain the decoded data of the target image.

[0076] Since the icon is the first frame of the target animation, decoding and rendering can start from the second frame of the target animation. Therefore, after obtaining the target image, the data corresponding to the target image can be decoded according to the playback order of the target image in the target animation, so as to decode the data in the animation file starting from the second frame of the target animation.

[0077] S105. Render the data based on the decoded data to obtain the target image, and play the target animation based on the target image.

[0078] The terminal can render the data after decoding to obtain the target image, and then play the target animation based on the target image. This saves the data decoding and rendering process of the first frame image and improves the playback speed of the target animation.

[0079] Alternatively, the terminal can render based on the first decoded data of the icon to obtain the first frame image and the target image, and then play the target animation based on the first frame image and the target image. In this case, the data decoding process of the first frame image is saved, and the playback speed of the target animation is improved.

[0080] For example, such as Figure 4 As shown, when determining the icon size based on the target animation's screen size, it is determined whether the icon size matches the target animation's screen size. If the icon size matches the target animation's screen size, it indicates that the icon's first decoded data is the target decoded data of the first frame image. In this case, the target decoded data can be directly used for rendering to obtain and display the first frame image. Then, the decoded data is used for rendering to obtain and display the target image.

[0081] If the icon is not the screen size of the target animation, the data in the animation file is decoded to obtain the target decoded data of the first frame image and the target image decoded data. Then, the target decoded data is used for rendering to obtain the first frame image, which is then displayed. The target image is then obtained and displayed based on the decoded data.

[0082] Optionally, the terminal can play the target animation based on the target image while rendering based on the decoded data, or the terminal can play the target animation based on the target image after rendering based on the decoded data is completed.

[0083] For example, if the target image consists of a second frame and a third frame, the terminal can render the second frame based on the decoded data of the second frame to obtain the second frame image. Then, while displaying the second frame image, it can render the third frame based on the decoded data of the third frame image and then display the third frame image to play the target animation.

[0084] For example, if the target image consists of a second frame and a third frame, the terminal can render the second frame based on the decoded data of the second frame to obtain the second frame image, and then render the third frame based on the decoded data of the third frame to obtain the third frame image. Next, the second frame image is displayed, and when the second frame image is finished displaying, the third frame image is displayed to play the target animation.

[0085] Optionally, the terminal can decode the target image data while rendering it based on the decoded data, or the terminal can decode the target image data first and then render it based on the decoded data.

[0086] In some embodiments, rendering is performed based on the decoded data to obtain a target image, including:

[0087] Determine the positional relationship between the target animation's playback position and the icon's position;

[0088] If the positional relationship satisfies the preset positional relationship, then the target image is obtained by rendering based on the decoded data.

[0089] The playback position of the target animation can refer to the display position of the first frame of the target animation, or the display position of the target image in the target animation.

[0090] Because the playback position of the target animation and the position of the icon may be different, even if the icon is the first frame image, the first frame image needs to be re-rendered, but there is no need to decode the data of the first frame image. Therefore, in this embodiment, the positional relationship between the playback position of the target animation and the position of the icon is determined. If the positional relationship meets the preset positional relationship, it indicates that the playback position of the target animation and the position of the image are matched (matching the playback position of the target animation and the position of the image can be understood as the positional difference between the playback position of the target animation and the position of the image being within a preset range). Then, the target image can be obtained by rendering based on the decoded data.

[0091] Since there's no need to decode the first frame's data when the target animation's playback position and the icon's position are different, but the first frame needs to be re-rendered, after determining the positional relationship between the target animation's playback position and the icon's position, the process also includes:

[0092] If the positional relationship does not meet the preset positional relationship, then obtain the first decoded data of the icon;

[0093] Rendering is performed based on the first decoded data and the decoded data to obtain the first frame image and the target image;

[0094] Based on the first frame image and the target image, play the target animation at the playback position.

[0095] In this embodiment, if the positional relationship does not meet the preset positional relationship, the first decoded data of the icon is obtained, and then the first decoded data and the decoded data are rendered to obtain the first frame image and the target image. Based on the first frame image and the target image, the target animation is played at the playback position. This means that when the playback position of the target animation is different from the position of the icon, there is no need to decode the data of the first frame image and re-render the first frame image, thereby reducing the amount of data to be decoded and improving the speed of playing the target animation.

[0096] For example, such as Figure 5 As shown, when determining the icon size based on the target animation's screen size, it checks whether the icon size matches the target animation's screen size. If the icon does not match the target animation's screen size, it indicates that the icon is not the first frame image. In this case, the data in the animation file is decoded to obtain the target decoded data for the first frame image and the target image's decoded data. The target decoded data is then rendered to obtain and display the first frame image. Finally, the decoded data is rendered again to obtain and display the target image.

[0097] If the icon's size is the same as the target animation's screen size, it means that the icon's first decoded data is the target decoded data of the first frame image. In this case, only the target image's data needs to be decoded to obtain the decoded data. Then, it can be determined whether the playback position of the target animation and the icon's position are the same.

[0098] If the playback position of the target animation is the same as the position of the icon, it means that the positional relationship between the playback position of the target animation and the position of the icon satisfies the preset positional relationship. This means that there is no need to render the first frame image. Instead, the target image is rendered based on the decoded data, and the target animation is played based on the target image.

[0099] If the playback position of the target animation and the position of the icon are not the same, it means that the positional relationship between the playback position of the target animation and the position of the icon does not meet the preset positional relationship. This means that the first frame image needs to be re-rendered. The first frame image is obtained and displayed based on the decoded data of the target. Then, the target image is obtained and displayed based on the decoded data.

[0100] As can be seen from the above, in this embodiment, a trigger instruction for the icon corresponding to the target animation is obtained; according to the trigger instruction, the animation file corresponding to the target animation is obtained, and the state of the icon is determined; if the state of the icon is the first frame state, the data corresponding to the target image in the target animation is filtered out from the animation file, and the target image is the image in the target animation other than the first frame image; according to the playback order of the target image in the target animation, the data corresponding to the target image is decoded to obtain the decoded data of the target image; the decoded data is rendered to obtain the target image, and the target animation is played according to the target image. This achieves that during the playback of the target animation, if the icon of the target animation is the first frame image of the target animation, the animation file is decoded and rendered starting from the second frame image of the target animation, without needing to decode and render the first frame image of the target animation, thus improving the playback speed of the target animation.

[0101] To facilitate better implementation of the animation playback method provided in this application, this application also provides an apparatus based on the above-described animation playback method. The meanings of the terms used are the same as in the above-described animation playback method, and specific implementation details can be found in the descriptions within the method embodiments.

[0102] For example, such as Figure 6 As shown, the animation playback device may include:

[0103] The acquisition module 601 is used to acquire the trigger command for the icon corresponding to the target animation.

[0104] The determination module 602 is used to obtain the animation file corresponding to the target animation according to the trigger instruction, and determine the status of the icon.

[0105] The filtering module 603 is used to filter out the data corresponding to the target image in the target animation from the animation file if the icon is in the first frame state. The target image is the image in the target animation other than the first frame image.

[0106] The decoding module 604 is used to decode the data corresponding to the target image according to the playback order of the target image in the target animation, so as to obtain the decoded data of the target image.

[0107] The playback module 605 is used to render the target image based on the decoded data, and then play the target animation based on the target image.

[0108] Optionally, the playback module 605 is specifically used to perform:

[0109] Determine the positional relationship between the target animation's playback position and the icon's position;

[0110] If the positional relationship satisfies the preset positional relationship, then the target image is obtained by rendering based on the decoded data.

[0111] Optionally, the playback module 605 is also used to perform:

[0112] If the positional relationship does not meet the preset positional relationship, then obtain the first decoded data of the icon;

[0113] Rendering is performed based on the first decoded data and the decoded data to obtain the first frame image and the target image;

[0114] Based on the first frame image and the target image, play the target animation at the playback position.

[0115] Optionally, the animation playback device further includes:

[0116] Generate a module for execution:

[0117] Obtain the screen dimensions of the target animation;

[0118] Determine the icon size based on the screen size of the target animation;

[0119] Display the icon based on its size.

[0120] Optionally, the generation module is specifically used for execution:

[0121] Determine the size relationship between the target animation's screen size and a preset threshold;

[0122] If the size relationship meets the preset conditions, the screen size of the target animation will be used as the size of the icon.

[0123] Optionally, the generation module is specifically used for execution:

[0124] If the size relationship does not meet the preset conditions, then obtain the preset size;

[0125] Use the preset size as the icon size.

[0126] Optionally, the generation module is specifically used for execution:

[0127] Define the icon for the target animation;

[0128] If the icon is the first frame image, then determine the size relationship between the target animation's screen size and the preset threshold.

[0129] In practice, each of the above modules can be implemented as an independent entity or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation methods and corresponding beneficial effects of each of the above modules, please refer to the previous method embodiments, which will not be repeated here.

[0130] This application also provides an electronic device, which may be a server or a terminal, etc. Figure 7 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically:

[0131] The electronic device may include components such as a processor 701 with one or more processing cores, a memory 702 with one or more computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art will understand that... Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0132] The processor 701 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes computer programs and / or modules stored in the memory 702, and calls data stored in the memory 702 to perform various functions and process data. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 701.

[0133] The memory 702 can be used to store computer programs and modules. The processor 701 executes various functional applications and data processing by running the computer programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.

[0134] The electronic device also includes a power supply 703 that supplies power to the various components. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 703 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0135] The electronic device may also include an input unit 704, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0136] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 701 in the electronic device loads the executable files corresponding to the processes of one or more computer programs into the memory 702 according to the following instructions, and the processor 701 runs the computer programs stored in the memory 702 to realize various functions, such as:

[0137] Get the trigger command for the icon corresponding to the target animation;

[0138] Based on the trigger command, obtain the animation file corresponding to the target animation and determine the status of the icon;

[0139] If the icon is in the first frame state, then the data corresponding to the target image in the target animation is filtered out from the animation file. The target image is the image in the target animation other than the first frame image.

[0140] Based on the playback order of the target images in the target animation, the data corresponding to the target images is decoded to obtain the decoded data of the target images;

[0141] The decoded data is rendered to obtain the target image, and the target animation is played based on the target image.

[0142] For details on the specific implementation methods and corresponding beneficial effects of each of the above operations, please refer to the detailed description of the animation playback method above, which will not be repeated here.

[0143] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0144] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute the steps of any of the animation playback methods provided in this application. For example, the computer program can execute the following steps:

[0145] Get the trigger command for the icon corresponding to the target animation;

[0146] Based on the trigger command, obtain the animation file corresponding to the target animation and determine the status of the icon;

[0147] If the icon is in the first frame state, then the data corresponding to the target image in the target animation is filtered out from the animation file. The target image is the image in the target animation other than the first frame image.

[0148] Based on the playback order of the target images in the target animation, the data corresponding to the target images is decoded to obtain the decoded data of the target images;

[0149] The decoded data is rendered to obtain the target image, and the target animation is played based on the target image.

[0150] For details on the specific implementation methods and corresponding beneficial effects of the above operations, please refer to the previous embodiments, which will not be repeated here.

[0151] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0152] Since the computer program stored in the computer-readable storage medium can execute the steps in any of the animation playback methods provided in the embodiments of this application, the beneficial effects that any of the animation playback methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0153] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned animation playback method.

[0154] The above provides a detailed description of an animation playback method, apparatus, electronic device, and computer storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An animation playback method, characterized in that, include: Get the trigger command for the icon corresponding to the target animation; Based on the triggering instruction, obtain the animation file corresponding to the target animation and determine the state of the icon; If the icon is in the first frame state, then the data corresponding to the target image in the target animation is filtered out from the animation file, and the target image is the image in the target animation other than the first frame image; Based on the playback order of the target images in the target animation, the data corresponding to the target images is decoded to obtain the decoded data of the target images; The decoded data is rendered to obtain the target image, and the target animation is played based on the target image.

2. The animation playback method according to claim 1, characterized in that, The step of rendering the target image based on the decoded data includes: Determine the positional relationship between the playback position of the target animation and the position of the icon; If the positional relationship satisfies the preset positional relationship, then the target image is obtained by rendering based on the decoded data.

3. The animation playback method according to claim 2, characterized in that, After determining the positional relationship between the playback position of the target animation and the position of the icon, the method further includes: If the positional relationship does not satisfy the preset positional relationship, then the first decoded data of the icon is obtained; Rendering is performed based on the first decoded data and the decoded data to obtain the first frame image and the target image; Based on the first frame image and the target image, the target animation is played at the playback position.

4. The animation playback method according to claim 1, characterized in that, Before obtaining the trigger instruction for the icon corresponding to the target animation, the method further includes: Obtain the screen dimensions of the target animation; The size of the icon is determined based on the screen size of the target animation; The icon is displayed according to its size.

5. The animation playback method according to claim 4, characterized in that, Determining the size of the icon based on the screen size of the target animation includes: Determine the size relationship between the target animation's screen size and a preset threshold; If the size relationship meets the preset conditions, then the screen size of the target animation will be used as the size of the icon.

6. The animation playback method according to claim 5, characterized in that, After determining the size relationship between the target animation's screen size and a preset threshold, the method further includes: If the size relationship does not meet the preset conditions, then obtain the preset size; The preset size is used as the size of the icon.

7. The animation playback method according to claim 5, characterized in that, Determining the size relationship between the target animation's screen size and a preset threshold includes: Determine the icon for the target animation; If the icon is the first frame image, then the size relationship between the screen size of the target animation and the preset threshold is determined.

8. An animation playback device, characterized in that, include: The acquisition module is used to acquire the trigger instructions for the icon corresponding to the target animation; The determination module is used to obtain the animation file corresponding to the target animation according to the trigger instruction, and determine the state of the icon; A filtering module is used to filter out the data corresponding to the target image in the target animation from the animation file if the state of the icon is the first frame state, wherein the target image is an image in the target animation other than the first frame image; The decoding module is used to decode the data corresponding to the target image according to the playback order of the target image in the target animation, so as to obtain the decoded data of the target image; The playback module is used to render the target image based on the decoded data, and play the target animation based on the target image.

9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor running the computer program in the memory to perform the animation playback 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 adapted for loading by a processor to perform the animation playback method according to any one of claims 1 to 7.