Animation playing method and device, equipment, storage medium and program product

By pre-compressing the image format of the H5 animation file on the server side, generating animation files that support WebP format, and dynamically obtain and play when the terminal device supports WebP format, the problem of excessive H5 animation file size affecting the loading speed, and achieving faster animation file loading and page fluency.

CN120030253APending Publication Date: 2025-05-23GUANGZHOU SHIYINLIAN SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510102765.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The H5 animation file contains a large number of static image elements, which increases the file size, affecting the page loading speed.

Method used

The server compresses the original animation file of the target page in advance, compresses it from the second image format (such as PNG or JEG) to the first image format (such as WebP), and generates a target animation file of a smaller file size, and dynamically obtains and plays the target animation file when the terminal device supports the first image format.

Benefits of technology

On the premise that the terminal device can correctly display the animation file in the first picture format, the speed at which the terminal device loads the animation file in the target page is significantly improved, ensuring the smoothness of the page.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030253A_ABST
    Figure CN120030253A_ABST
Patent Text Reader

Abstract

The invention discloses an animation playing method and device, equipment, a storage medium and a program product, and relates to the technical field of computers. The method comprises the steps of obtaining a picture format supported by the terminal equipment under the condition that an access operation on a target page in an application program is received; the target page is a page for playing an animation file; under the condition that the picture format supported by the terminal equipment comprises a first picture format, sending a target animation acquisition request to a server corresponding to the application program; receiving a target animation file returned by the server according to the target animation acquisition request; the target animation file is obtained by compressing a picture in an original animation file of the target page from a second picture format to the first picture format; the first picture format is different from the second picture format; and playing the target animation file in the target page. According to the method, the speed of loading the animation file in the target page by the terminal equipment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an animation playing method, device, equipment, storage medium and program product. Background Art

[0002] H5 animation can be played on various devices and browsers that support the HTML5 standard, and is particularly suitable for mobile devices such as smartphones and tablets. Therefore, H5 animation has been widely used in Internet applications.

[0003] In the related art, application developers can use H5 animation to create various pages (such as the user's annual report page). When users visit these pages, the H5 animation played in the page can enhance the user experience, attract user attention and provide interactivity.

[0004] However, H5 animations usually use PNG images or JEG images to represent static image elements, such as icons, background patterns, etc. When a large number of static image elements are included, the animation file will be larger, which will affect the loading speed of the page. Summary of the invention

[0005] The embodiments of the present application provide an animation playback method, apparatus, device, storage medium and program product, which can improve the speed of loading animation files in a target page by a terminal device under the premise that the terminal device can correctly display the animation file in a first image format; the technical solution proposed by the present application is as follows:

[0006] According to one aspect of an embodiment of the present application, a method for playing an animation is provided, the method being executed by a terminal device, the method comprising:

[0007] When receiving an access operation to a target page in the application, obtaining a picture format supported by the terminal device; the target page is a page for playing an animation file;

[0008] In a case where the picture formats supported by the terminal device include the first picture format, sending a target animation acquisition request to a server corresponding to the application;

[0009] receiving a target animation file returned by the server according to the target animation acquisition request; the target animation file is obtained by compressing a picture in an original animation file of the target page from a second picture format to the first picture format; the first picture format is different from the second picture format;

[0010] The target animation file is played in the target page.

[0011] According to one aspect of an embodiment of the present application, a method for playing an animation is provided, the method being executed by a server corresponding to an application program; the method comprising:

[0012] receiving a target animation acquisition request sent by a terminal device; the target animation acquisition request is sent by the terminal device when receiving an access operation to a target page in the application, and the image format supported by the terminal device includes a first image format; the target page is a page for playing an animation file;

[0013] According to the target animation acquisition request, the target animation file is returned to the terminal device so that the terminal device plays the target animation file in the target page; the target animation file is obtained by compressing the image in the original animation file of the target page from the second image format to the first image format; the first image format is different from the second image format.

[0014] According to one aspect of an embodiment of the present application, there is provided an animation playing device, the device comprising:

[0015] The image format acquisition module is used to acquire the image format supported by the terminal device when receiving an access operation to a target page in the application; the target page is a page for playing animation files;

[0016] A first request sending module, configured to send a target animation acquisition request to a server corresponding to the application program when the image format supported by the terminal device includes the first image format;

[0017] A first file receiving module is used to receive a target animation file returned by the server according to the target animation acquisition request; the target animation file is obtained by compressing a picture in an original animation file of the target page from a second picture format to the first picture format; the first picture format is different from the second picture format;

[0018] The first animation playing module is used to play the target animation file in the target page.

[0019] In some embodiments, the first request sending module is used to obtain a first terminal performance parameter of the terminal device when the picture format supported by the terminal device includes the first picture format; the first terminal performance parameter is used to indicate the loading performance of the terminal device, and the first performance parameter includes at least one of the following: running memory, power status, and network connection quality;

[0020] The first request sending module is used to send the target animation acquisition request including the first terminal performance parameter to the server;

[0021] Among them, the target animation file is selected by the server from multiple compressed animation files corresponding to the target page according to the first terminal performance parameter; the multiple compressed animation files are obtained by compressing the pictures in the original animation files of the corresponding pages from the second picture format to the first picture format according to different compression rates; the compression rate of the target animation file matches the first terminal performance parameter.

[0022] In some embodiments, the target page is one of at least two consecutive pages;

[0023] The first request sending module is used to send the target animation acquisition request including the first terminal performance parameter to the server when the target page is the first page of the at least two pages;

[0024] The first file receiving module is used to receive the first animation file sent by the server according to the target animation acquisition request, and the first animation file is an animation file with the minimum compression rate that matches the first terminal performance parameter among the multiple compressed animation files.

[0025] In some embodiments, the first request sending module is used to send the target animation acquisition request including the first terminal performance parameter, the second terminal performance parameter and the first compression rate to the server when the target page is not the first page of the at least two pages; the second terminal performance parameter is the terminal performance parameter when the terminal device requests the previous page of the target page, and the first compression rate is the compression rate of the animation file corresponding to the previous page acquired by the terminal device;

[0026] The first file receiving module is used to receive the second animation file sent by the server according to the target animation acquisition request, the second animation file is an animation file with a second compression rate matching the first terminal performance parameter among the multiple compressed animation files; when the first terminal performance parameter is better than the second terminal performance parameter, the second compression rate is not higher than the first compression rate; when the second terminal performance parameter is better than the first terminal performance parameter, the second compression rate is not lower than the first compression rate.

[0027] In some embodiments, the animation playing device further includes: a second request sending module, a second file receiving module, and a second animation playing module;

[0028] A second request sending module, configured to send an original animation acquisition request to a server corresponding to the application program when the picture format supported by the terminal device does not include the first picture format;

[0029] A second file receiving module, configured to receive the original animation file returned by the server according to the original animation acquisition request;

[0030] The second animation playing module is used to play the original animation file in the target page.

[0031] According to one aspect of an embodiment of the present application, there is provided an animation playing device, the device comprising:

[0032] a first request receiving module, configured to receive a target animation acquisition request sent by a terminal device; the target animation acquisition request is sent by the terminal device when receiving an access operation to a target page in the application, and the image format supported by the terminal device includes a first image format; the target page is a page for playing an animation file;

[0033] The first file sending module is used to return a target animation file to the terminal device according to the target animation acquisition request, so that the terminal device plays the target animation file in the target page; the target animation file is obtained by compressing the picture in the original animation file of the target page from the second picture format to the first picture format; the first picture format is different from the second picture format.

[0034] In some embodiments, the first request receiving module is used to receive the target animation acquisition request including the first terminal performance parameter sent by the terminal device; the first terminal performance parameter is used to indicate the loading performance of the terminal device;

[0035] The first file sending module is used to select the target animation file from a plurality of compressed animation files corresponding to the target page according to the first terminal performance parameter;

[0036] The first file sending module is used to send the selected target animation file to the terminal device;

[0037] The multiple compressed animation files are obtained by compressing the images in the original animation files of the corresponding pages from the second image format to the first image format according to different compression rates; and the compression rate of the target animation file matches the first terminal performance parameter.

[0038] In some embodiments, the target page is one of at least two consecutive pages;

[0039] The first request receiving module is used to receive the target animation acquisition request including the first terminal performance parameter, which is sent by the terminal device when the target page is the first page of the at least two pages;

[0040] The first file sending module is used to select, according to the first terminal performance parameter, a first animation file with a minimum compression rate that matches the first terminal performance parameter from a plurality of compressed animation files corresponding to the target page;

[0041] The first file sending module is used to send the first animation file to the terminal device.

[0042] In some embodiments, the first request receiving module is used to receive the target animation acquisition request including the first terminal performance parameter, the second terminal performance parameter and the first compression rate, which is sent by the terminal device when the target page is not the first page of the at least two pages; the second terminal performance parameter is the terminal performance parameter when the terminal device requests the previous page of the target page, and the first compression rate is the compression rate of the animation file corresponding to the previous page acquired by the terminal device;

[0043] The first file sending module is used to select an animation file with a second compression rate that matches the first terminal performance parameter from multiple compressed animation files corresponding to the target page according to the first terminal performance parameter, the second terminal performance parameter and the first compression rate; when the first terminal performance parameter is better than the second terminal performance parameter, the second compression rate is not higher than the first compression rate; when the second terminal performance parameter is better than the first terminal performance parameter, the second compression rate is not lower than the first compression rate.

[0044] In some embodiments, the animation playback device further includes: a second request receiving module, a second file sending module;

[0045] A second request receiving module is used to receive an original animation acquisition request sent by a terminal device; the original animation acquisition request is sent by the terminal device when receiving an access operation to a target page in the application, and the picture format supported by the terminal device does not include the first picture format;

[0046] The second file sending module is used to return the original animation file to the terminal device according to the original animation acquisition request, so that the terminal device plays the original animation file in the target page.

[0047] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:

[0048] The server can pre-compress the original animation file in the target page, and compress the image in the original animation file of the target page from the second image format to the first image format to obtain a target animation file with a smaller file size; before the terminal device loads the target page, it first determines whether the first image format is supported. If the first image format is supported, the terminal device obtains the target animation file from the server so as to quickly play the target animation file in the target page; this solution can obtain a target animation file with a smaller file size containing the first image format by compressing the original animation file in the target page. On the premise that the terminal device can correctly display the animation file in the first image format, the speed at which the terminal device loads the animation file in the target page is improved, thereby ensuring the smoothness of the target page. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0050] Figure 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;

[0051] Figure 2 is a flowchart of an animation playing method provided by an exemplary embodiment of the present application;

[0052] Figure 3 is a flowchart of an animation playing method provided by an exemplary embodiment of the present application;

[0053] Figure 4 is a flowchart of an animation playing method provided by an exemplary embodiment of the present application;

[0054] Figure 5 is a schematic diagram of determining a second animation file provided by an exemplary embodiment of the present application;

[0055] Figure 6 is a flowchart of an animation playing method provided by an exemplary embodiment of the present application;

[0056] Figure 7 is a schematic diagram of an animation playing method provided by an exemplary embodiment of the present application;

[0057] Figure 8 is a flow chart of an animation file compression processing method provided by an exemplary embodiment of the present application;

[0058] Fig. 9is a flow chart of an animation file loading method provided by an exemplary embodiment of the present application;

[0059] Fig.10 is a block diagram of an animation playback device provided by an exemplary embodiment of the present application;

[0060] Fig.11 is a block diagram of an animation playback device provided by an exemplary embodiment of the present application;

[0061] Fig.12 It is a structural block diagram of a computer device provided by an embodiment of the present application.

[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application. DETAILED DESCRIPTION

[0063] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0064] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0065] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0066] In the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, user behaviors such as access operations involved in this application are all obtained with full authorization.

[0067] It should be understood that although the terms first, second, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first compression rate may also be referred to as the second compression rate, and similarly, the second compression rate may also be referred to as the first compression rate. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0068] First, several terms involved in this application are introduced and explained:

[0069] 1) Application: refers to a software program designed to complete a specified task or meet a specified requirement. These programs can run on a variety of computer devices such as mobile devices and servers. Applications usually have a user interface that allows users to interact with the application. According to the operating platform classification, applications are divided into desktop applications (DesktopApplications), web applications (Web Applications), and mobile applications (MobileApplications).

[0070] 2) H5 animation: also known as Hypertext 5.0 (HTML5, H5) animation, refers to web animation made using HTML5 technology and its related front-end technologies (such as CSS3, JavaScript, etc.), which can be played on various devices and browsers that support HTML5 standards. H5 animation can provide a rich interactive experience and is compatible with multiple operating systems. H5 animation can run without installing additional plug-ins and has better performance, especially on mobile devices. In addition, H5 animation also supports responsive design, which means it can adapt to different screen sizes, thereby providing users with better visual effects and user experience.

[0071] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application. Figure 1 As shown, the implementation environment may include: a terminal device 110 and a server 120 .

[0072] The terminal device 110 and the server 120 communicate with each other through a network. Optionally, the terminal device 110 and the server 120 are directly or indirectly connected through wired or wireless communication, which is not limited in this application.

[0073] Among them, the terminal device 110 is a smart phone, a tablet computer, a laptop computer, a desktop computer, a car terminal, a game console, an e-book reader, a multimedia playback device, a wearable device, a smart TV, etc., but is not limited to this. The embodiment of the present application does not limit the specific category of the terminal device 110. The terminal device 110 can be installed with a client that runs an application, and the application can be an application with an animation playback function. The present application does not limit the form of the application, including but not limited to an application (Application, App) installed in the terminal device 110, a small program, etc., and can also be in the form of a web page.

[0074] The server 120 is used to provide background services for the client of the target application installed and running in the terminal device 110. Optionally, the server 120 is a server, or a server cluster or distributed system composed of multiple servers, or a cloud computing service center, or a cloud server, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content delivery network (CDN) that provides cloud computing services. Optionally, the server 120 provides background services for the client of the target application in multiple terminal devices 110 at the same time.

[0075] For example, the terminal device 110 is a smart phone. A client of a certain application is running in the smart phone, and the icon of the application is displayed on the display screen of the smart phone. The user clicks the icon of the application to start the application; accordingly, the display screen of the smart phone displays the user interface 101 of the application, and the user interface 101 includes an access entry 102 of the target page and other content. The user can click the access entry 102 of the target page to view the target page. Among them, an animation is played in the target page. Exemplarily, the target page can be a periodic summary page or a festive activity page.

[0076] In an animation playback method involved in the present application, the animation file corresponding to the target page contains a large number of PNG images or JEG images, which results in a large animation file. As a result, when the user views the target page, the animation in the target page loads slowly, and problems such as animation playback freeze occur, affecting the smoothness of the target page.

[0077] Based on this, the subsequent embodiments of the present application provide a new animation playback method, through which the fluency of the target page can be improved.

[0078] Exemplarily, in the new animation playback method, the server of the application program may compress the image in the original animation file of the target page from the second image format to the first image format to obtain the target animation file; that is, the file size of the target animation file is smaller than the original animation file. Accordingly, upon receiving the user's access operation to the target page in the application program, the terminal device may determine whether the terminal device supports the first image format; if the terminal device supports the first image format, the terminal device may obtain the target animation file from the server of the application program to improve the fluency of the animation playback in the target page by the terminal device.

[0079] Please refer to Figure 2 , which shows a flowchart of an animation playback method provided by an exemplary embodiment of the present application. The execution subject of each step of the method may be a terminal device, and the terminal device may be any electronic device with data storage and processing capabilities. Optionally, the terminal device is Figure 1 The terminal device 110 in the system shown. Figure 2 As shown, the method may include steps 210 to 240.

[0080] Step 210: upon receiving an access operation to a target page in the application, obtaining a picture format supported by the terminal device; the target page is a page for playing an animation file.

[0081] Step 220: When the picture formats supported by the terminal device include the first picture format, a target animation acquisition request is sent to a server corresponding to the application.

[0082] Step 230: receiving the target animation file returned by the server according to the target animation acquisition request; the target animation file is obtained by compressing the image in the original animation file of the target page from the second image format to the first image format; the first image format is different from the second image format.

[0083] Step 240: Play the target animation file in the target page.

[0084] In summary, the technical solution provided by the embodiment of the present application is that the server can pre-compress the original animation file in the target page, and compress the image in the original animation file of the target page from the second image format to the first image format to obtain a target animation file with a smaller file size; before the terminal device loads the target page, it first determines whether the first image format is supported. When the first image format is supported, the terminal device obtains the target animation file from the server so as to quickly play the target animation file in the target page; this solution can obtain a target animation file with a smaller file size containing the first image format by compressing the original animation file in the target page. On the premise that the terminal device can correctly display the animation file in the first image format, the speed at which the terminal device loads the animation file in the target page is improved, thereby ensuring the smoothness of the target page.

[0085] Please refer to Figure 3 , which shows a flowchart of an animation playback method provided by an exemplary embodiment of the present application. The execution subject of each step of the method may be a server corresponding to the application. The server may be any electronic device with data storage and processing capabilities. Optionally, the server is Figure 1 The server 120 in the system shown. Figure 2 As shown, the method may include steps 310 to 320.

[0086] Step 310: Receive a target animation acquisition request sent by the terminal device; the target animation acquisition request is sent by the terminal device when it receives an access operation to the target page in the application, and the image format supported by the terminal device includes the first image format; the target page is the page that plays the animation file.

[0087] Step 320: according to the target animation acquisition request, the target animation file is returned to the terminal device so that the terminal device plays the target animation file in the target page; the target animation file is obtained by compressing the image in the original animation file of the target page from the second image format to the first image format; the first image format is different from the second image format.

[0088] In summary, for the technical solution provided in the embodiment of the present application, the server can pre-compress the original animation file in the target page, compress the pictures in the original animation file of the target page from the second picture format to the first picture format, so as to obtain a target animation file with a smaller file size; before the terminal device loads the target page, first determine whether it supports the first picture format. If it supports the first picture format, the terminal device obtains the target animation file from the server, so as to quickly play the target animation file in the target page; through the compression process of the original animation file in the target page, this solution can obtain a target animation file containing the first picture format and having a smaller file size. On the premise that the terminal device can correctly display the animation file in the first picture format, it improves the speed of the terminal device to load the animation file in the target page and ensures the smoothness of the target page.

[0089] Please refer to Figure 4 , which shows a flowchart of an animation playing method provided by an exemplary embodiment of the present application. The execution subject of each step of this method can be a computer device, and the computer device can be any electronic device with data storage and processing capabilities. Optionally, the computer device is Figure 1 the terminal device 110 and the server 120 in the system shown in Figure 4 . As shown in

[0090] Step 410: When receiving an access operation to a target page in a corresponding application, the terminal device obtains the picture formats supported by the terminal device; the target page is a page for playing an animation file.

[0091] In the example of the present application, the above access operation to the target page in the corresponding application can be a click operation by the user on the access entry of the target page; or, it can also be a scan operation by the user on the access QR code of the target page; or, it can also be a voice access operation by the user to the target page; or, it can also be an access operation in other ways, and the present application does not limit this.

[0092] Optionally, the above access entry of the target page can be a poster, a tab, a user interface (UI) control in the application, or, it can also be an access entry in other ways, and the present application does not limit this.

[0093] Optionally, the above target page can be a periodic summary page, such as an annual report page; or, it can also be a festival activity page, such as a Spring Festival activity page, or it can also be a page in other forms, and the present application does not limit this.

[0094] Exemplarily, in the above process of obtaining the image formats supported by the terminal device, for mobile applications, the terminal device can obtain whether the version number of the terminal device's operating system is a version number that supports the first image format; for Web applications, the terminal device can determine whether the browser supports the first image format through User-Agent.

[0095] Step 420: When the picture formats supported by the terminal device include the first picture format, the terminal device sends a target animation acquisition request to the server corresponding to the application; correspondingly, the server receives the target animation acquisition request sent by the terminal device.

[0096] The first image format can be a webp format. The webP format can provide higher compression and better image quality while maintaining a smaller file size. It not only supports lossless and lossy compression, but also can handle transparency and animation effects. The webP format can significantly reduce the size of image files without affecting visual quality, thereby speeding up page loading and saving bandwidth.

[0097] The target animation acquisition request may carry identification information of the target animation file and the first image format. Optionally, when the target page is an annual report page, the target animation acquisition request may also carry user data, such as annual data of the user's use of the application, which is obtained by the terminal device with the user's authorization.

[0098] Step 430: the server returns the target animation file to the terminal device according to the target animation acquisition request; correspondingly, the terminal device receives the target animation file returned by the server according to the target animation acquisition request.

[0099] The target animation file is obtained by compressing the image in the original animation file of the target page from the second image format to the first image format by the server; the first image format is different from the second image format.

[0100] In an embodiment of the present application, the server may pre-compress the image in the original animation file of the target page from the second image format to the first image format to obtain the target animation file.

[0101] Exemplarily, taking the original animation file as a Lottie animation file, the server first extracts the PNG image from the Lottie animation file, and then compresses the PNG image into the webp format through an image compression algorithm; thereafter, the compressed image is reinserted into the Lottie animation file to obtain the above-mentioned target animation file.

[0102] Exemplarily, after the server receives the target animation acquisition request sent by the terminal device, it will perform the following steps:

[0103] Verify request legitimacy: Check whether the source of the target animation acquisition request is legitimate, and verify any authentication tokens or other security measures that may be included;

[0104] Parse request parameters: extract key information about the target animation file, including but not limited to identification information of the target animation file, first image format, etc.;

[0105] Find source file: locate the location where the target animation file is stored and read the relevant information;

[0106] Packaging response data: preparing a data packet to be returned to the terminal device, the data packet includes the target animation file, and optionally, the data packet also includes metadata (such as size, duration, etc.) and other auxiliary resources (such as font files);

[0107] Send response: Transmit the data packet back to the terminal device via HTTP / HTTPS protocol.

[0108] Step 440: The terminal device plays the target animation file in the target page.

[0109] After receiving the target animation file returned by the server, the terminal device can decode and render the image frames in the target animation file, thereby realizing the playback of the animation in the target page.

[0110] In summary, the technical solution provided by the embodiment of the present application is that the server can pre-compress the original animation file in the target page, and compress the image in the original animation file of the target page from the second image format to the first image format to obtain a target animation file with a smaller file size; before the terminal device loads the target page, it first determines whether the first image format is supported. When the first image format is supported, the terminal device obtains the target animation file from the server so as to quickly play the target animation file in the target page; this solution can obtain a target animation file with a smaller file size containing the first image format by compressing the original animation file in the target page. On the premise that the terminal device can correctly display the animation file in the first image format, the speed at which the terminal device loads the animation file in the target page is improved, thereby ensuring the smoothness of the target page.

[0111] Based on the above Figure 2 In the solution in the illustrated embodiment, in a possible implementation manner, the above step 420 can be implemented as step 420a and step 420b.

[0112] Step 420a: When the picture formats supported by the terminal device include the first picture format, the terminal device obtains a first terminal performance parameter of the terminal device.

[0113] Among them, the first terminal performance parameter is used to indicate the loading performance of the terminal device, and the first performance parameter includes at least one of the following: running memory, power status, and network connection quality.

[0114] In an embodiment of the present application, the terminal device can evaluate its current loading performance and collect relevant data as terminal performance parameters.

[0115] The above-mentioned running memory refers to the size of the physical memory currently available on the terminal device. A lower running memory means that the terminal device is running multiple applications or processing complex tasks. At this time, loading a larger animation file can easily put too much pressure on the system, resulting in slow loading speed.

[0116] The power status refers to the current power status of the terminal device. For example, the terminal device can obtain battery information, including whether it is charging, remaining power percentage, etc., by calling the application programming interface (API) provided by the operating system. When the battery is low, it is particularly important to reduce unnecessary resource consumption. Loading smaller animation files can save power.

[0117] The network connection quality refers to the quality of the current network environment of the terminal device. For example, the network connection quality includes but is not limited to Wi-Fi or mobile data, signal strength, upload / download speed, etc. Poor network conditions may cause large file download failures or playback freezes.

[0118] Step 420b: the terminal device sends a target animation acquisition request including the first terminal performance parameter to the server; correspondingly, the server receives the target animation acquisition request including the first terminal performance parameter sent by the terminal device.

[0119] The target animation acquisition request also carries the first terminal performance parameter, so that the server can select a matching target animation file according to the first terminal performance parameter and send it to the terminal device.

[0120] Exemplarily, the terminal device may perform encryption processing on the first terminal performance parameter in the target animation acquisition request; accordingly, after receiving the target animation acquisition request, the server first performs decryption processing on the target animation acquisition request to obtain the first terminal performance parameter.

[0121] The above step 430 may be implemented as step 430a and step 430b.

[0122] Step 430a: The server selects a target animation file from a plurality of compressed animation files corresponding to the target page according to the first terminal performance parameter.

[0123] The plurality of compressed animation files are obtained by compressing the images in the original animation files of the corresponding pages from the second image format to the first image format according to different compression rates; the compression rate of the target animation file matches the performance parameter of the first terminal.

[0124] In an embodiment of the present application, the server may compress the images in the original animation file of the target page from the second image format to the first image format according to different compression rates in advance, to obtain multiple compressed animation files.

[0125] Among them, the lower the compression rate of the compressed animation file, the better the effect when playing; the higher the compression rate of the compressed animation file, the worse the effect when playing.

[0126] Exemplarily, the server may create a database table or file structure for storing the correspondence between each compressed animation file and each terminal performance parameter. Accordingly, the server may query the compressed animation file matching the first terminal performance parameter from the above correspondence according to the first terminal performance parameter sent by the terminal device, and use it as the target animation file to be sent.

[0127] For example, when the first terminal performance parameter indicates that the network connection of the current terminal device is stable, the compression rate of the corresponding compressed animation file is low in order to improve the visual experience; when the first terminal performance parameter indicates that the network connection of the current terminal device is unstable, the compression rate of the corresponding compressed animation file is high in order to prioritize smooth playback rather than extreme picture clarity.

[0128] Step 430b: the server sends the selected target animation file to the terminal device; correspondingly, the terminal device receives the target animation file returned by the server according to the target animation acquisition request.

[0129] That is, the server sends the target animation file selected according to the first terminal performance parameter to the terminal device, so that the terminal device receives the target animation file and plays the target animation file in the target page.

[0130] Exemplarily, in the process of sending the target animation file to the terminal device, the server may carry the compression rate of the target animation file.

[0131] In an embodiment of the present application, the server can perform compression processing on the original animation file according to different compression rates, so as to send a target animation file that matches the performance to the terminal device based on the performance of the terminal device (such as the quality of the network connection), thereby further improving the speed at which the terminal device loads the animation file in the target page.

[0132] Based on the solutions in the above embodiments of the present application, in a possible implementation, the target page is one of at least two consecutive pages; the above step 420b can be implemented as step 420b1.

[0133] Step 420b1: When the target page is the first page among at least two pages, the terminal device sends a target animation acquisition request containing the first terminal performance parameter to the server; accordingly, the server receives the target animation acquisition request containing the first terminal performance parameter sent by the terminal device when the target page is the first page among at least two pages.

[0134] In an embodiment of the present application, the first page (also called title page, home page, cover) is often designed to be relatively concise, so the animation file size corresponding to the first page is usually smaller; and subsequent pages (i.e., non-first page) may contain richer multimedia elements, interactive functions, large amounts of text information or other information, so the animation file size corresponding to the non-first page is usually relatively large.

[0135] If the target page is the first page of at least two pages, the terminal device may carry the first terminal performance parameter in the target animation acquisition request, so as to acquire the target animation file of the first page matching the first terminal performance parameter.

[0136] The above step 430a may be implemented as follows:

[0137] According to the first terminal performance parameter, the server selects a first animation file with a minimum compression rate that matches the first terminal performance parameter from a plurality of compressed animation files corresponding to the target page.

[0138] That is to say, the first animation file is an animation file with the minimum compression rate that matches the performance parameter of the first terminal among the multiple compressed animation files.

[0139] The first animation file with the minimum compression rate means that among multiple compressed animation files matching the performance parameters of the first terminal, the first animation file has the highest picture quality and the best playback effect.

[0140] For example, the server can sort multiple compressed animation files corresponding to the same terminal performance parameter in order of compression rate from low to high, and obtain a compressed animation file sequence list corresponding to each terminal performance parameter. Accordingly, the server uses the first compressed animation file in the compressed animation file sequence list corresponding to the first terminal performance parameter as the first animation file according to the first terminal performance parameter.

[0141] The above step 430b can be implemented as follows:

[0142] The server sends the first animation file to the terminal device; correspondingly, the terminal device receives the first animation file sent by the server according to the target animation acquisition request.

[0143] That is, the server sends the first animation file of the first page selected according to the first terminal performance parameter to the terminal device, so that the terminal device receives the first animation file and plays the first animation file in the first page.

[0144] Exemplarily, in the process of sending the first animation file to the terminal device, the server may carry the compression rate of the first animation file.

[0145] In an embodiment of the present application, if the target page is the first page, the server can send the animation file with the smallest compression rate among multiple compressed animation files that match the performance of the terminal device as the first animation file to the terminal device, so that the terminal device can play the animation file with better picture quality; this solution can not only improve the speed at which the terminal device loads the animation file in the first page, but also ensure the playback effect of the first page.

[0146] Based on the solutions in the above embodiments of the present application, in a possible implementation manner, the above step 420b1 can be implemented as follows:

[0147] When the target page is not the first page among at least two pages, the terminal device sends a target animation acquisition request including the first terminal performance parameter, the second terminal performance parameter and the first compression ratio to the server; accordingly, the server receives the target animation acquisition request including the first terminal performance parameter, the second terminal performance parameter and the first compression ratio sent by the terminal device when the target page is not the first page among at least two pages.

[0148] The second terminal performance parameter is a terminal performance parameter when the terminal device requests a previous page of the target page, and the first compression ratio is a compression ratio of the animation file corresponding to the previous page obtained by the terminal device.

[0149] In the embodiment of the present application, if the target page is not the first page, the terminal device can carry the first terminal performance parameter, the second terminal performance parameter and the first compression rate in the target animation acquisition request. Among them, the first terminal performance parameter is the current terminal performance parameter of the terminal device, reflecting the key performance indicator of the current terminal device state; the second terminal performance parameter records the performance of the terminal device when the page was previously loaded, and the first compression rate records the degree to which the animation file corresponding to the previous page is compressed.

[0150] The above step 430a may be implemented as follows:

[0151] The server selects an animation file with a second compression rate that matches the first terminal performance parameter from multiple compressed animation files corresponding to the target page based on the first terminal performance parameter, the second terminal performance parameter and the first compression rate; accordingly, the terminal device receives the second animation file sent by the server according to the target animation acquisition request, and the second animation file is an animation file with a second compression rate that matches the first terminal performance parameter among the multiple compressed animation files.

[0152] Among them, when the first terminal performance parameter is better than the second terminal performance parameter, the second compression rate is not higher than the first compression rate; when the second terminal performance parameter is better than the first terminal performance parameter, the second compression rate is not lower than the first compression rate.

[0153] In an embodiment of the present application, the server can compare the first terminal performance parameter with the second terminal performance parameter to obtain the scores corresponding to the first terminal performance parameter and the second terminal performance parameter, respectively. The higher the score, the better the terminal performance parameter. Exemplarily, the server is pre-set with calculation rules for determining the score based on the running memory, power status, network connection quality and other parameters in the terminal performance parameters. For example, the server assigns different weights to each parameter and determines the score corresponding to the terminal performance parameter through a weighted scoring method.

[0154] If the current performance (first terminal performance parameter) is better than the previous performance (second terminal performance parameter), the server may select an animation file with a lower compression rate (ie, higher quality) and return it to the user to ensure the best visual experience.

[0155] On the contrary, if the current performance (first terminal performance parameter) is not as good as the previous performance (second terminal performance parameter), it may be necessary to use an animation file with a higher compression rate (i.e., smaller file size but may sacrifice some image quality) to adapt to the poor operating environment and ensure smooth playback without affecting the user experience.

[0156] For example, Figure 5 As shown, the first compression rate is 15%, and the multiple compressed animation files corresponding to the first terminal performance parameter are compressed animation file 1 with a compression rate of 18%, compressed animation file 2 with a compression rate of 15%, and compressed animation file 3 with a compression rate of 12%. After the server compares the first terminal performance parameter with the second terminal performance parameter, if the first terminal performance parameter is better than the second terminal performance parameter, then the server can use the compressed animation file 3 with a compression rate of 12% as the above-mentioned second animation file; if the second terminal performance parameter is better than the first terminal performance parameter, then the server can use the compressed animation file 1 with a compression rate of 18% as the above-mentioned second animation file.

[0157] In an embodiment of the present application, if the target page is not the first page, the terminal device can carry the current terminal performance parameters, the terminal performance parameters of the previous page, and the compression rate in the target animation acquisition request, so that the server can adjust the compression rate of the second animation file sent to the terminal device. For example, if the current terminal performance parameters are better than the terminal performance parameters of the previous page, then the compression rate of the second animation file can be lower than the compression rate of the animation file of the previous page; this solution can not only improve the speed at which the terminal device loads animation files in non-first pages, but also ensure the playback effect of non-first pages.

[0158] In a possible implementation, the above step 420b1 may be implemented as follows:

[0159] When the target page is not the first page among at least two pages, the terminal device sends a target animation acquisition request including the first terminal performance parameter, the second terminal performance parameter, the first compression rate and the fluency indication information to the server; accordingly, the server receives the target animation acquisition request including the first terminal performance parameter, the second terminal performance parameter, the first compression rate and the fluency indication information sent by the terminal device when the target page is not the first page among at least two pages.

[0160] That is to say, when the target page is not the first page among the at least two pages, the target animation acquisition request sent by the terminal device to the server also includes the fluency indication information.

[0161] The fluency indication information is used to indicate the fluency of the animation file corresponding to the previous page played by the terminal device in the previous page. The fluency indication information can be obtained by the terminal device according to the playing effect of the animation file corresponding to the previous page played in the previous page.

[0162] Exemplarily, the fluency indication information may indicate that the fluency of the animation file corresponding to the previous page played by the terminal device in the previous page is one of high and low. The higher the fluency of the animation file corresponding to the previous page played by the terminal device in the previous page, the better the playback effect of the animation file corresponding to the previous page played by the terminal device in the previous page.

[0163] The above step 430a may be implemented as follows:

[0164] The server selects an animation file with a third compression rate that matches the first terminal performance parameter from multiple compressed animation files corresponding to the target page based on the first terminal performance parameter, the second terminal performance parameter, the first compression rate, and the fluency indication information; accordingly, the terminal device receives the third animation file sent by the server based on the target animation acquisition request, and the third animation file is an animation file with a third compression rate that matches the first terminal performance parameter among the multiple compressed animation files.

[0165] Among them, when the fluency indication information indicates that the terminal device has a high fluency in playing the animation file corresponding to the previous page in the previous page, and the first terminal performance parameter is better than the second terminal performance parameter, the third compression rate is not higher than the first compression rate; when the fluency indication information indicates that the terminal device has a low fluency in playing the animation file corresponding to the previous page in the previous page, and the second terminal performance parameter is better than the first terminal performance parameter, the third compression rate is not lower than the first compression rate.

[0166] In an embodiment of the present application, the server can compare the first terminal performance parameter with the second terminal performance parameter to obtain the scores corresponding to the first terminal performance parameter and the second terminal performance parameter, respectively. The higher the score, the better the terminal performance parameter. Exemplarily, the server is pre-set with calculation rules for determining the score based on the running memory, power status, network connection quality and other parameters in the terminal performance parameters. For example, the server assigns different weights to each parameter and determines the score corresponding to the terminal performance parameter through a weighted scoring method.

[0167] If the terminal device plays the animation file corresponding to the previous page in the previous page with high fluency, and the current performance (first terminal performance parameter) is better than the previous performance (second terminal performance parameter), then the server can select an animation file with a lower compression rate (i.e., higher quality) to return to the user to ensure the best visual experience.

[0168] If the terminal device plays the animation file corresponding to the previous page in the previous page with low fluency, and the current performance (first terminal performance parameter) is not as good as the previous performance (second terminal performance parameter), it may be necessary to use an animation file with a higher compression rate (i.e., smaller file size but may sacrifice some image quality) to adapt to the poor operating environment and ensure smooth playback without affecting the user experience.

[0169] Based on the solutions in the above embodiments of the present application, in a possible implementation method, please refer to Figure 6 , which shows a flowchart of an animation playing method provided by an exemplary embodiment of the present application. Figure 6 As shown, the method may further include steps 450 to 470.

[0170] Step 450: when the picture formats supported by the terminal device do not include the first picture format, the terminal device sends an original animation acquisition request to the server corresponding to the application; correspondingly, the server receives the original animation acquisition request sent by the terminal device.

[0171] The original animation acquisition request may carry the identification information of the original animation file and the second image format. Optionally, when the target page is an annual report page, the original animation acquisition request may also carry user data, such as annual data of the user's use of the application, which is obtained by the terminal device with the user's authorization.

[0172] Step 460: the server returns the original animation file to the terminal device according to the original animation acquisition request, so that the terminal device plays the original animation file in the target page; accordingly, the terminal device receives the original animation file returned by the server according to the original animation acquisition request.

[0173] In the embodiment of the present application, after receiving the original animation acquisition request, the server parses the original animation acquisition request, and then sends the original animation file to the terminal device.

[0174] Step 470: The terminal device plays the original animation file in the target page.

[0175] After receiving the original animation file returned by the server, the terminal device can decode and render the image frames in the original animation file, thereby realizing the playback of the animation in the target page.

[0176] In an embodiment of the present application, if the terminal device does not support the first image format, the terminal device obtains the original animation file from the server so that the terminal device can play the original animation file in the target page to ensure the immediate execution of the user access operation.

[0177] Based on the solutions shown in the above embodiments, in a possible implementation method, please refer to Figure 7 , which shows a schematic diagram of an animation playing method provided by an exemplary embodiment of the present application. Figure 7 As shown, taking the example that the terminal device is a smart phone 10, the application is a music application, and the target page is an annual report page, the user can download the music application from the server 20 through the application store of the smart phone 10; then, after the music application is successfully installed, the music application is displayed on the display screen of the terminal device in the form of an icon; then, the user can start the music application by clicking on the icon of the music application.

[0178] The display screen of the smart phone 10 displays the user interface of the music application, and the user interface includes an access entry to the annual report page and other contents. The user can click on the access entry to the annual report page to view the annual report page.

[0179] The steps for the smartphone 10 to load the annual report page are as follows:

[0180] Step 701, obtaining user data:

[0181] The user data is obtained with full authorization. Exemplarily, the user data includes at least one of the following: user listening record data, usage frequency and time distribution data, music style preference data, behavior interaction data, device information, and may also include other types of data, which are not limited in this application.

[0182] Step 702, determine whether the webp format is supported:

[0183] If the webp format is supported, execute steps 703 to 709; otherwise, execute steps 710 to 711.

[0184] Step 703: if the webp format is supported, determine whether it is the first page in the annual report page:

[0185] If it is the first page in the annual report, execute steps 704 to 706 and return to step 703; otherwise, execute steps 707 to 709 and return to step 703.

[0186] Step 704, obtaining current terminal performance parameters:

[0187] Among them, the terminal performance parameters include at least one of the following: running memory, power status, and network connection quality.

[0188] Step 705, obtaining the first animation file:

[0189] The smartphone 10 sends a compressed animation acquisition request to the server 20, which includes current terminal performance parameters and user data; accordingly, the server 20 receives the compressed animation acquisition request sent by the smartphone 10, and sends the first target animation file to the smartphone 10 according to the compressed animation acquisition request.

[0190] The first animation file is a compressed animation file that matches the current terminal performance parameter among multiple compressed animation files corresponding to different compression rates in the server. The server stores the correspondence between each compressed animation file and each terminal performance parameter, so that the server can query the compressed animation file that matches the current terminal performance parameter from the correspondence between each compressed animation file and each terminal performance parameter according to the current terminal performance parameter.

[0191] The compressed animation file is an animation file obtained by the server after performing compression processing on the original animation file according to different compression rates. For example, taking the compression rate 1 as an example, the server extracts the PNG image in the original animation file, and compresses the PNG image into a webp format image according to the compression rate 1. When the size of the webp format image is smaller than the PNG image, the PNG image in the original animation file is replaced with the webp format image to obtain a compressed animation file corresponding to the compression rate 1.

[0192] Step 706, play the first animation file:

[0193] The smart phone 10 displays the first page of the annual report pages in the user interface of the music application and plays the first animation file.

[0194] Step 707, obtaining current terminal performance parameters:

[0195] If it is not the first page in the annual report page, it means that the user continues to access subsequent pages in the annual report page. At this time, the current terminal performance parameters are obtained again.

[0196] Step 708, obtaining a second animation file:

[0197] The smart phone 10 sends a compressed animation acquisition request to the server 20, which includes the current terminal performance parameters, user data, terminal performance parameters when requesting the previous page, and the compression rate of the animation file corresponding to the previous page; accordingly, the server 20 receives the compressed animation acquisition request sent by the smart phone 10, and according to the compressed animation acquisition request, sends the second target animation file to the smart phone 10.

[0198] Among them, the second target animation file is an animation file that matches the current terminal performance parameters among multiple compressed animation files corresponding to different compression rates in the server; when the current terminal performance parameters are better than the terminal performance parameters when requesting the previous page, the compression rate of the second target animation file is not higher than the compression rate of the animation file corresponding to the previous page; when the terminal performance parameters when requesting the previous page are better than the current terminal performance parameters, the compression rate of the second target animation file is not lower than the compression rate of the animation file corresponding to the previous page.

[0199] Step 709, play the second animation file:

[0200] The smart phone 10 displays the non-first page in the annual report page in the user interface of the music application and plays the second animation file.

[0201] Step 710, obtaining the original animation file:

[0202] When the webp format is not supported, the smart phone 10 sends an original animation acquisition request to the server 20; accordingly, the server 20 receives the original animation acquisition request sent by the smart phone 10, and returns the original animation file to the smart phone 10 according to the original animation acquisition request.

[0203] Step 711, play the original animation file:

[0204] The smartphone 10 displays the annual report page in the user interface of the music application and plays the original animation file.

[0205] It should be noted that the execution method of the above steps is the same as the execution method of the above embodiments of the present application, and will not be repeated here.

[0206] Based on the schemes shown in the above embodiments, the present application proposes a method for improving the loading speed of H5 animation. The present method provides a simple, easy and effective scheme for improving the loading speed of H5 animation, especially an optimization scheme for Lottie animation. The advantage is that the optimization of animation files can be achieved through an easy-to-implement image compression algorithm without complicated processing of the animation files, which has high practicality and economy and has broad application prospects.

[0207] Take Lottie animation (a common H5 animation) as an example, please refer to Figure 8 , which shows a flowchart of an animation file compression processing method provided by an exemplary embodiment of the present application. Figure 8 As shown, the above-mentioned animation file compression processing method includes the following steps:

[0208] Step 801, obtain the animation file:

[0209] The computer device obtains the original animation file lottie.json to be compressed and temporarily stores the json data;

[0210] Step 802, extracting image resources:

[0211] The computer device extracts pictures (including PNG pictures and JPG pictures) in the original animation file lottie.json to obtain a first picture set consisting of original pictures;

[0212] Step 803: compress the image using the webp compression algorithm:

[0213] The computer device compresses the pictures in the first picture set into a webp format by using a picture compression algorithm, thereby obtaining a second picture set consisting of webp pictures;

[0214] Step 804, obtain the new animation file webp / lottie.json:

[0215] The computer device compares the sizes one by one to determine whether the webp image is smaller than the original image:

[0216] If the webp image is smaller than the original image, keep the compressed webp image; otherwise, keep the original image before compression;

[0217] Exemplarily, the computer device may insert the retained webp image into the original animation file lottie.json to obtain an optimized new animation file wepp / lottie.json.

[0218] Through the above steps, the computer device can obtain two animation files: the new animation file wepp / lottie.json and the original animation file lottie.json.

[0219] Please refer to Fig. 9 , which shows a flowchart of an animation file loading method provided by an exemplary embodiment of the present application. Fig. 9 As shown, the above animation file loading method includes the following steps:

[0220] First, receive user actions:

[0221] The computer device receives a trigger operation of the user accessing the HTML animation page and loads the Javascript script;

[0222] Secondly, determine whether webp is supported:

[0223] The computer device determines whether the operating system, browser version, etc. corresponding to the user operation support webp. For example, the User-Agent is used to determine whether the browser supports the WebP format.

[0224] If webp is supported, load the new animation file wepp / lottie.json and play the loaded animation;

[0225] Otherwise, load the original animation file lottie.json and play the loaded animation.

[0226] In summary, this solution can reduce the image size in the original animation file lottie.json by about 40%, thereby significantly improving the loading speed of the animation file and significantly improving the user experience of accessing the H5 animation page.

[0227] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0228] Please refer to Fig.10 , which shows a block diagram of an animation playback device provided by an exemplary embodiment of the present application. The device has the functions of implementing the above examples, and the functions can be implemented by hardware or by hardware executing corresponding software. Fig.10 As shown, the device may include: a picture format acquisition module 1001 , a first request sending module 1002 , a first file receiving module 1003 and a first animation playing module 1004 .

[0229] The picture format acquisition module 1001 is used to acquire the picture format supported by the terminal device when receiving an access operation to a target page in the application; the target page is a page for playing animation files;

[0230] A first request sending module 1002, configured to send a target animation acquisition request to a server corresponding to the application program when the image formats supported by the terminal device include the first image format;

[0231] The first file receiving module 1003 is used to receive the target animation file returned by the server according to the target animation acquisition request; the target animation file is obtained by compressing the picture in the original animation file of the target page from the second picture format to the first picture format; the first picture format is different from the second picture format;

[0232] The first animation playing module 1004 is used to play the target animation file in the target page.

[0233] In some embodiments, the first request sending module 1002 is used to obtain a first terminal performance parameter of the terminal device when the image format supported by the terminal device includes the first image format; the first terminal performance parameter is used to indicate the loading performance of the terminal device, and the first performance parameter includes at least one of the following: running memory, power status, and network connection quality;

[0234] A first request sending module 1002 is used to send a target animation acquisition request including a first terminal performance parameter to a server;

[0235] Among them, the target animation file is selected by the server from multiple compressed animation files corresponding to the target page according to the first terminal performance parameter; the multiple compressed animation files are obtained by compressing the pictures in the original animation files of the corresponding pages from the second picture format to the first picture format according to different compression rates; the compression rate of the target animation file matches the first terminal performance parameter.

[0236] In some embodiments, the target page is one of at least two consecutive pages;

[0237] A first request sending module 1002 is used to send a target animation acquisition request including a first terminal performance parameter to a server when the target page is the first page of at least two pages;

[0238] The first file receiving module 1003 is used to receive a first animation file sent by the server according to a target animation acquisition request. The first animation file is an animation file with a minimum compression rate that matches the first terminal performance parameter among multiple compressed animation files.

[0239] In some embodiments, the first request sending module 1002 is used to send a target animation acquisition request including a first terminal performance parameter, a second terminal performance parameter, and a first compression rate to a server when the target page is not the first page of at least two pages; the second terminal performance parameter is a terminal performance parameter when the terminal device requests a previous page of the target page, and the first compression rate is a compression rate of an animation file corresponding to the previous page acquired by the terminal device;

[0240] The first file receiving module 1003 is used to receive a second animation file sent by the server according to a target animation acquisition request, where the second animation file is an animation file with a second compression rate that matches the first terminal performance parameter among multiple compressed animation files; when the first terminal performance parameter is better than the second terminal performance parameter, the second compression rate is not higher than the first compression rate; when the second terminal performance parameter is better than the first terminal performance parameter, the second compression rate is not lower than the first compression rate.

[0241] In some embodiments, the animation playing device further includes: a second request sending module, a second file receiving module, and a second animation playing module;

[0242] A second request sending module, configured to send an original animation acquisition request to a server corresponding to the application program when the image format supported by the terminal device does not include the first image format;

[0243] A second file receiving module, used for receiving the original animation file returned by the server according to the original animation acquisition request;

[0244] The second animation playing module is used to play the original animation file in the target page.

[0245] Please refer to Fig.11 , which shows a block diagram of an animation playback device provided by an exemplary embodiment of the present application. The device has the functions of implementing the above examples, and the functions can be implemented by hardware or by hardware executing corresponding software. Fig.11 As shown, the device may include: a first request receiving module 1101 and a first file sending module 1102.

[0246] The first request receiving module 1101 is used to receive a target animation acquisition request sent by a terminal device; the target animation acquisition request is sent by the terminal device when receiving an access operation to a target page in an application, and the image format supported by the terminal device includes the first image format; the target page is a page that plays an animation file;

[0247] The first file sending module 1102 is used to return the target animation file to the terminal device according to the target animation acquisition request, so that the terminal device plays the target animation file in the target page; the target animation file is obtained by compressing the image in the original animation file of the target page from the second image format to the first image format; the first image format is different from the second image format.

[0248] In some embodiments, the first request receiving module 1101 is used to receive a target animation acquisition request including a first terminal performance parameter sent by a terminal device; the first terminal performance parameter is used to indicate the loading performance of the terminal device;

[0249] The first file sending module 1102 is used to select a target animation file from a plurality of compressed animation files corresponding to the target page according to the first terminal performance parameter;

[0250] The first file sending module 1102 is used to send the selected target animation file to the terminal device;

[0251] The plurality of compressed animation files are obtained by compressing the images in the original animation files of the corresponding pages from the second image format to the first image format according to different compression rates; the compression rate of the target animation file matches the performance parameter of the first terminal.

[0252] In some embodiments, the target page is one of at least two consecutive pages;

[0253] The first request receiving module 1101 is used to receive a target animation acquisition request including a first terminal performance parameter, which is sent by a terminal device when the target page is the first page of at least two pages;

[0254] The first file sending module 1102 is used to select, according to the first terminal performance parameter, a first animation file with a minimum compression rate that matches the first terminal performance parameter from a plurality of compressed animation files corresponding to the target page;

[0255] The first file sending module 1102 is used to send the first animation file to the terminal device.

[0256] In some embodiments, the first request receiving module 1101 is used to receive a target animation acquisition request including a first terminal performance parameter, a second terminal performance parameter, and a first compression rate, which is sent by a terminal device when the target page is not the first page of at least two pages; the second terminal performance parameter is a terminal performance parameter when the terminal device requests a previous page of the target page, and the first compression rate is a compression rate of an animation file corresponding to the previous page acquired by the terminal device;

[0257] The first file sending module 1102 is used to select an animation file with a second compression rate that matches the first terminal performance parameter from multiple compressed animation files corresponding to the target page according to the first terminal performance parameter, the second terminal performance parameter and the first compression rate; when the first terminal performance parameter is better than the second terminal performance parameter, the second compression rate is not higher than the first compression rate; when the second terminal performance parameter is better than the first terminal performance parameter, the second compression rate is not lower than the first compression rate.

[0258] In some embodiments, the animation playback device further includes: a second request receiving module, a second file sending module;

[0259] A second request receiving module is used to receive an original animation acquisition request sent by a terminal device; the original animation acquisition request is sent by the terminal device when receiving an access operation to a target page in an application and the image format supported by the terminal device does not include the first image format;

[0260] The second file sending module is used to return the original animation file to the terminal device according to the original animation acquisition request, so that the terminal device plays the original animation file in the target page.

[0261] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0262] Please refer to Fig.12 , which shows a block diagram of a computer device provided in one embodiment of the present application. The computer device 1200 may be any electronic device with data calculation, processing and storage capabilities. The computer device 1200 may be used to implement the animation playback method provided in the above embodiment.

[0263] Typically, the computer device 1200 includes a processor 1201 and a memory 1202 .

[0264] The processor 1201 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1201 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1201 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1201 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1201 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0265] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory. The memory 1202 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1202 is used to store a computer program, which is configured to be executed by one or more processors to implement the above-mentioned animation playback method.

[0266] Those skilled in the art will understand that Fig.12 The structure shown in the figure does not constitute a limitation on the computer device 1200, and the computer device 1200 may include more or less components than those shown in the figure, or combine some components, or adopt a different arrangement of components.

[0267] In an exemplary embodiment, a computer-readable storage medium is also provided, in which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned animation playback method is implemented. Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random Access Memory), SSD (Solid State Drives) or optical disks, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0268] In an exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned animation playback method.

[0269] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.

[0270] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. An animation playing method, characterized in that: The method is performed by a terminal device, and the method includes: When receiving an access operation to a target page in the application, obtaining a picture format supported by the terminal device; the target page is a page for playing an animation file; In a case where the picture formats supported by the terminal device include the first picture format, sending a target animation acquisition request to a server corresponding to the application; receiving a target animation file returned by the server according to the target animation acquisition request; the target animation file is obtained by compressing a picture in an original animation file of the target page from a second picture format to the first picture format; the first picture format is different from the second picture format; The target animation file is played in the target page.

2. The method according to claim 1, characterized in that When the picture format supported by the terminal device includes the first picture format, sending a target animation acquisition request to the server corresponding to the application comprises: In a case where the picture format supported by the terminal device includes the first picture format, obtaining a first terminal performance parameter of the terminal device; the first terminal performance parameter is used to indicate the loading performance of the terminal device, and the first performance parameter includes at least one of the following: running memory, power status, and network connection quality; Sending the target animation acquisition request including the first terminal performance parameter to the server; Among them, the target animation file is selected by the server from multiple compressed animation files corresponding to the target page according to the first terminal performance parameter; the multiple compressed animation files are obtained by compressing the pictures in the original animation files of the corresponding pages from the second picture format to the first picture format according to different compression rates; the compression rate of the target animation file matches the first terminal performance parameter.

3. The method according to claim 2, characterized in that The target page is one of at least two consecutive pages; The sending the target animation acquisition request including the first terminal performance parameter to the server includes: In a case where the target page is the first page of the at least two pages, sending the target animation acquisition request including the first terminal performance parameter to the server; The receiving the target animation file returned by the server according to the target animation acquisition request comprises: The first animation file sent by the server according to the target animation acquisition request is received, where the first animation file is an animation file with a minimum compression rate that matches the first terminal performance parameter among the multiple compressed animation files.

4. The method according to claim 3, characterized in that The sending the target animation acquisition request including the first terminal performance parameter to the server includes: In the case where the target page is not the first page of the at least two pages, sending the target animation acquisition request including the first terminal performance parameter, the second terminal performance parameter and a first compression ratio to the server; the second terminal performance parameter is a terminal performance parameter when the terminal device requests a previous page of the target page, and the first compression ratio is a compression ratio of the animation file corresponding to the previous page acquired by the terminal device; The receiving the target animation file returned by the server according to the target animation acquisition request comprises: Receive the second animation file sent by the server according to the target animation acquisition request, where the second animation file is an animation file with a second compression ratio that matches the first terminal performance parameter among the multiple compressed animation files; when the first terminal performance parameter is better than the second terminal performance parameter, the second compression ratio is not higher than the first compression ratio; when the second terminal performance parameter is better than the first terminal performance parameter, the second compression ratio is not lower than the first compression ratio.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the picture format supported by the terminal device does not include the first picture format, sending an original animation acquisition request to the server corresponding to the application; Receiving the original animation file returned by the server according to the original animation acquisition request; The original animation file is played in the target page.

6. An animation playing method, characterized in that: The method is executed by a server of an application program, and the method comprises: receiving a target animation acquisition request sent by a terminal device; the target animation acquisition request is sent by the terminal device when receiving an access operation to a target page in the application, and the image format supported by the terminal device includes a first image format; the target page is a page for playing an animation file; According to the target animation acquisition request, the target animation file is returned to the terminal device so that the terminal device plays the target animation file in the target page; the target animation file is obtained by compressing the image in the original animation file of the target page from the second image format to the first image format; the first image format is different from the second image format.

7. The method according to claim 6, characterized in that The receiving terminal device sends a target animation acquisition request, including: receiving the target animation acquisition request including a first terminal performance parameter sent by the terminal device; the first terminal performance parameter is used to indicate the loading performance of the terminal device; The step of returning the target animation file to the terminal device according to the target animation acquisition request includes: Selecting the target animation file from a plurality of compressed animation files corresponding to the target page according to the first terminal performance parameter; Sending the selected target animation file to the terminal device; The multiple compressed animation files are obtained by compressing the images in the original animation files of the corresponding pages from the second image format to the first image format according to different compression rates; and the compression rate of the target animation file matches the first terminal performance parameter.

8. The method according to claim 7, characterized in that The target page is one of at least two consecutive pages; The receiving the target animation acquisition request including the first terminal performance parameter sent by the terminal device includes: receiving the target animation acquisition request including the first terminal performance parameter, which is sent by the terminal device when the target page is the first page of the at least two pages; The selecting the target animation file from a plurality of compressed animation files corresponding to the target page according to the first terminal performance parameter includes: According to the first terminal performance parameter, selecting a first animation file with a minimum compression rate matching the first terminal performance parameter from a plurality of compressed animation files corresponding to the target page; The step of sending the selected target animation file to the terminal device comprises: The first animation file is sent to the terminal device.

9. The method according to claim 8, characterized in that The receiving the target animation acquisition request including the first terminal performance parameter sent by the terminal device includes: receiving the target animation acquisition request including the first terminal performance parameter, the second terminal performance parameter, and the first compression ratio, which is sent by the terminal device when the target page is not the first page of the at least two pages; the second terminal performance parameter is the terminal performance parameter when the terminal device requests the previous page of the target page, and the first compression ratio is the compression ratio of the animation file corresponding to the previous page acquired by the terminal device; The selecting the target animation file from a plurality of compressed animation files corresponding to the target page according to the first terminal performance parameter includes: According to the first terminal performance parameter, the second terminal performance parameter and the first compression ratio, an animation file with a second compression ratio matching the first terminal performance parameter is selected from multiple compressed animation files corresponding to the target page; when the first terminal performance parameter is better than the second terminal performance parameter, the second compression ratio is not higher than the first compression ratio; when the second terminal performance parameter is better than the first terminal performance parameter, the second compression ratio is not lower than the first compression ratio.

10. The method according to any one of claims 6 to 9, characterized in that: The method further comprises: Receiving an original animation acquisition request sent by a terminal device; the original animation acquisition request is sent by the terminal device when receiving an access operation to a target page in the application, and the picture formats supported by the terminal device do not include the first picture format; According to the original animation acquisition request, the original animation file is returned to the terminal device, so that the terminal device plays the original animation file in the target page.

11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the animation playing method according to any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the animation playing method according to any one of claims 1 to 10.

13. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. The processor reads and executes the computer program from the computer-readable storage medium to implement the animation playback method according to any one of claims 1 to 10.