Animation display method and device, electronic equipment and storage medium

By calling the animation library of the target control in the target application, the animation data analysis and display under different operating systems is realized, and the display problem of animation data is solved under the operating system is not adapted to, and the display efficiency of cross-platform animation effects is improved and development efficiency.

CN119027550APending Publication Date: 2024-11-26BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310595001.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-24
Publication Date
2024-11-26

Smart Images

  • Figure CN119027550A_ABST
    Figure CN119027550A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an animation display method and device, electronic equipment and a storage medium, animation data is obtained by responding to a first request sent by a target application running in a first operating system, and the animation data is analyzed based on a first function interface of a second operating system; a target control of the target application is called, the animation data is processed, at least two ordered animation image frames are generated, the target control is achieved based on a first animation library, and the first animation library is at least used for being called under the first operation system so as to achieve the function corresponding to the first function interface; and displaying the at least two ordered animation image frames in the target application. By means of the characteristic that the first animation library for achieving the target control can be called in a cross-platform mode, analysis of the animation data is achieved in the first operating system, and normal display of the animation effect in a cross-platform scene is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to an animation display method, device, electronic device, and storage medium. Background Art

[0002] In the process of developing an application, the interface designer will design various animation effects according to the needs, so as to make the interface of the application more beautiful and the interaction more friendly. In the prior art, the animation data generated by the animation generation tool needs to be associated with the application, so that during the operation of the application, the animation data can be parsed into corresponding image frames for dynamic display, thereby achieving the animation effect.

[0003] However, the solutions in the prior art, which rely on animation data generated by a third-party animation library, have the problem that the data cannot be correctly parsed under an unadapted operating system, thereby affecting the normal display of the animation effect and increasing the time consumption of application development and testing. Summary of the invention

[0004] The embodiments of the present disclosure provide an animation display method, device, electronic device and storage medium to overcome the problem that data cannot be correctly parsed under an unadapted operating system.

[0005] In a first aspect, an embodiment of the present disclosure provides an animation display method, comprising:

[0006] In response to a first request sent by a target application running under a first operating system, animation data is obtained, wherein the animation data is parsed based on a first functional interface of a second operating system; a target control of the target application is called, the animation data is processed, and at least two ordered animation image frames are generated, wherein the target control is implemented based on a first animation library, and the first animation library is at least used to be called under the first operating system to implement a function corresponding to the first functional interface; the at least two ordered animation image frames are displayed in the target application.

[0007] In a second aspect, an embodiment of the present disclosure provides an animation display device, comprising:

[0008] a response module, configured to obtain animation data in response to a first request sent by a target application running under the first operating system, wherein the animation data is parsed based on a first functional interface of the second operating system;

[0009] a processing module, configured to call a target control of the target application, process the animation data, and generate at least two ordered animation image frames, wherein the target control is implemented based on a first animation library, and the first animation library is at least used to be called under the first operating system to implement the function corresponding to the first function interface;

[0010] The display module is used to display the at least two ordered animation image frames in the target application.

[0011] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0012] A processor, and a memory communicatively connected to the processor;

[0013] The memory stores computer-executable instructions;

[0014] The processor executes the computer-executable instructions stored in the memory to implement the animation display method as described in the first aspect and various possible designs of the first aspect.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the animation display method described in the first aspect and various possible designs of the first aspect is implemented.

[0016] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the animation display method described in the first aspect and various possible designs of the first aspect.

[0017] The animation display method, device, electronic device and storage medium provided in this embodiment obtain animation data by responding to a first request sent by a target application running under a first operating system, wherein the animation data is parsed based on a first functional interface of a second operating system; calling a target control of the target application, processing the animation data, and generating at least two ordered animation image frames, wherein the target control is implemented based on a first animation library, and the first animation library is at least used to be called under the first operating system to implement the function corresponding to the first functional interface; and displaying the at least two ordered animation image frames in the target application. By calling the target control of the target application and utilizing the feature that the first animation library that implements the target control can be called across platforms, the animation data is parsed under the first operating system, and the corresponding at least two ordered animation image frames are obtained and displayed in the target application, thereby solving the problem that the first operating system that is not adapted to the animation data cannot parse the animation data, realizing the normal display of the animation effect in a cross-platform scenario, reducing the manual adaptation link, and reducing the time-consuming development and testing of the application. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 An application scenario diagram of the animation display method provided in the embodiment of the present disclosure;

[0020] Figure 2 Schematic diagram of the process of the animation display method provided in the embodiment of the present disclosure Figure 1 ;

[0021] Figure 3 for Figure 2 A flowchart of a specific implementation method of step S101 in the illustrated embodiment;

[0022] Figure 4 for Figure 2 A flowchart of a specific implementation method of step S103 in the illustrated embodiment;

[0023] Figure 5 A schematic diagram of a process of cyclically displaying animation image frames in a target application provided by an embodiment of the present disclosure;

[0024] Figure 6 Schematic diagram of the process of the animation display method provided in the embodiment of the present disclosure Figure 2 ;

[0025] Figure 7 for Figure 6 A flowchart of a specific implementation method of step S203 in the illustrated embodiment;

[0026] Figure 8 A schematic diagram of a process of triggering a drawing method provided by an embodiment of the present disclosure;

[0027] Fig. 9 for Figure 6 A flowchart of a specific implementation method of step S204 in the illustrated embodiment;

[0028] Fig.10 A structural block diagram of an animation display device provided in an embodiment of the present disclosure;

[0029] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;

[0030] Fig.12 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0032] It should be noted that 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 disclosure 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, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0033] The application scenarios of the embodiments of the present disclosure are explained below:

[0034] Figure 1 This is an application scenario diagram of the animation display method provided in the embodiment of the present disclosure. The animation display method provided in the embodiment of the present disclosure can be applied to the application development and testing, as well as the application running application scenario. Specifically, Figure 1As shown, the method provided by the embodiment of the present disclosure can be applied to a terminal device, such as a personal computer in the figure. When the terminal device runs the target application, the terminal device obtains the animation data stored locally or on the network based on the request of the target application, and parses the animation data into corresponding multi-frame images, which are displayed in the corresponding interface of the target application, so as to achieve the purpose of displaying the animation effect in the target application.

[0035] In the prior art, animation data is usually drawn by a drawing designer using drawing software, and then exported through an animation generation tool to obtain animation data that is convenient for application programs to call. Among them, common drawing software in the prior art includes, for example, Adobe Effect (AE), and animation generation tools include, for example, the Lottie animation library. Through the Lottie animation library, the AE file generated based on Adobe Effect can be exported to an animation in Lottie format, that is, a JSON file. After that, the application program calls the JSON file to achieve the purpose of displaying the animation effect in the application program. However, open source animation libraries such as Lottie need to be associated with applications. Specifically, the animation libraries need to be adapted for different operating systems and development frameworks. Taking the Lottie animation library as an example, the Lottie animation library has an adapted version for the Android system. Therefore, applications running under Android operation (i.e., applications developed for the Android operating system) can use the Lottie animation library to realize the display of animation effects within the application; but for applications running on unadapted operating systems, such as Linux desktop applications developed based on the QT framework, it is impossible to directly call the Lottie animation library to parse the animation data in the Lottie format (JSON file) into corresponding image frames for dynamic display, that is, the solution in the prior art, with the help of animation data generated by a third-party animation library, has the problem that the data cannot be correctly parsed under an unadapted operating system, thereby affecting the normal display of the animation effect and increasing the time-consuming development and testing of the application. The disclosed embodiment provides an animation display method to solve the above problems.

[0036] refer to Figure 2 , Figure 2 Schematic diagram of the process of the animation display method provided in the embodiment of the present disclosure Figure 1 The method of this embodiment can be applied in a terminal device, and the animation display method includes:

[0037] Step S101: in response to a first request sent by a target application running under a first operating system, obtaining animation data, wherein the animation data is parsed based on a first functional interface of a second operating system.

[0038] For example, reference Figure 1 In the schematic diagram of the application scenario shown, a first operating system is run on a terminal device, and the first operating system is, for example, a Linux system. After the target application is run under the first operating system, when the target application needs to display an animation effect, it will send a first request through the corresponding processing thread to obtain animation data to trigger the subsequent steps of displaying the animation effect in the target application. Among them, in one possible implementation, the animation data may be a data set containing an animation file, and the data set contains one or more animation files, wherein the animation file is, for example, a JSON file. In another possible implementation, the animation data is data describing the storage location and storage path shown in the animation file. By accessing the animation data, the animation file used to generate animation special effects can be obtained.

[0039] Further, exemplarily, the animation data is generated based on a specific second animation library, based on a data format and parsing method that matches the second database. Specifically, for example, the second animation library is a Lottie animation library. The animation data includes data in the Lottie format, such as a JSON file, or a corresponding storage path. At the same time, the second animation library is compatible with the second operating system, that is, the animation data generated based on the second animation library can be parsed under the second operating system based on the first functional interface of the second operating system to obtain corresponding multi-frame animation image frames. In a possible case, the second animation library is not compatible with the first operating system, that is, under the first operating system, it is impossible to use the first operating system to call the second animation library to achieve parsing of the animation data.

[0040] In a possible implementation, the first request includes a data identifier corresponding to the animation data, such as Figure 3 As shown, the specific implementation of step S101 includes:

[0041] Step S1011: Read the first attribute of the target control to obtain the data storage address.

[0042] Step S1012: Obtain animation data according to the data storage address and the data identifier.

[0043] Exemplarily, the target control can be regarded as a custom control developed to implement parsing of animation data generated by a second animation library (not compatible with the first operating system) under a first operating system. The target control has corresponding control properties, including a first property, which represents a data storage address. The first property of the target control can be a preset value, that is, set before the target application is compiled; it can also be set based on a setting instruction input by a user, and no specific restrictions are made here. By reading the first property of the target control, the corresponding data storage address can be obtained according to the corresponding property value.

[0044] Furthermore, the first request sent by the target application includes a data identifier of the animation data corresponding to the animation effect to be displayed, such as a data name of the animation data. The terminal device obtains the animation data by splicing the data based on the data identifier and the data storage address obtained in the above steps. In one possible implementation method, the animation data includes an animation file in bodymovin JSON format, or an access path corresponding to the animation file.

[0045] Step S102: calling a target control of a target application, processing animation data, and generating at least two ordered animation image frames, wherein the target control is implemented based on a first animation library, and the first animation library is at least used to be called under a first operating system to implement a function corresponding to a first functional interface.

[0046] Exemplarily, further, in order to realize the parsing of animation data, in the steps of this embodiment, the target control of the target application is called to process the animation data, wherein the target control can be a built-in control in the target application, which is written during the development process of the target application and compiled into the target application together, wherein the target control is implemented based on the first animation library, that is, the function in the first animation library is referenced when writing the target control, and when the target control is called, the corresponding function is implemented through the functional interface provided by the first animation library. Further, the first animation library can be a library developed based on a general programming language, so that the first animation library can be called under different operating systems and has the ability to process animation data, that is, the function corresponding to the first functional interface can be implemented under the first operating system. Specifically, the first animation library is, for example, an rLottie animation library developed based on C++ (programming language). The workflow of the rLottie animation library is consistent with that of the Lottie animation library, but the implementation of the animation library's Software Development Kit (SDK) is different. The rLottie animation library does not use a platform-specific implementation, but is implemented based on C++. Therefore, it has the ability to call across platforms and can support Lottie output JSON files as materials.

[0047] Furthermore, after the animation data is processed based on the target control, the target control utilizes the capabilities of the first animation library in its implementation, so that the animation data generated based on the second animation library can be parsed under the first operating system to generate at least two ordered animation image frames. The animation image frames can be an argb array stored in a buffer, and the animation image frames are arranged in order. The frame number corresponding to each animation image frame can be represented based on the index of the argb array. Afterwards, the subsequent drawing steps are performed based on the argb array in the buffer to realize the dynamic display of the animation effect.

[0048] Step S103: display at least two ordered animation image frames in the target application.

[0049] For example, after obtaining at least two ordered animation image frames, the frames are sequentially displayed in the target application based on the frame numbers corresponding to the animation image frames, so that the purpose of displaying the animation effect in the target application running under the first operating system can be achieved. In one possible implementation, the target control is set in the target application, and the target control has a display area for displaying the animation effect. Figure 4 As shown, the specific implementation of step S103 includes:

[0050] Step S1031: Obtain the frame number corresponding to the animation image frame.

[0051] Step S1032: Based on the frame sequence numbers, the corresponding animation image frames are displayed in order in the display area corresponding to the target control.

[0052] Exemplarily, after generating the animation image frame, each animation image frame has a corresponding frame number, and the frame number can be obtained, for example, by the array index of the argb array stored in the cache. Based on the order represented by the frame number, the animation image frames are drawn in the display area corresponding to the target control in the target application in sequence, so that each animation image frame and the preset order are displayed, thereby forming a meaningful animation effect. Among them, in one possible implementation method, the target application is developed based on the QT development framework, and the specific implementation of drawing in the display area can be achieved by calling the draw() method of painter (the brush in QT). The specific implementation method is a prior art and will not be repeated here.

[0053] Furthermore, the method further includes: reading a second attribute of the target control, the second attribute representing the number of times the animation image frame is cyclically displayed in the target application. The specific implementation of step S1032 includes: based on the second attribute, cyclically displaying the animation image frames corresponding to the frame numbers in an orderly manner in the display area corresponding to the target control.

[0054] Exemplarily, the second attribute is another control attribute of the target control, and the second attribute represents the number of times multiple animation image frames are displayed in a loop in the target application, wherein, specifically, all dynamic image frames are displayed in sequence on one side based on the animation data, which is a loop, and the attribute value of the second attribute is the corresponding number of loop displays. The second attribute of the target control can be a preset value, that is, it is set before the target application is compiled; it can also be set based on a setting instruction input by the user, and no specific restrictions are made here. Figure 5 A schematic diagram of a process of cyclically displaying animation image frames in a target application provided by an embodiment of the present disclosure, such as Figure 5As shown, the animation image frames obtained by parsing the animation data include animation image frame P1, animation image frame P2, animation image frame P3 and animation image frame P4. Among them, the frame numbers of animation image frame P1, animation image frame P2, animation image frame P3 and animation image frame P4 are P1, P2, P3 and P4 respectively. Based on the frame numbers of the above-mentioned dynamic image frames, animation image frame P1, animation image frame P2, animation image frame P3 and animation image frame P4 are displayed in the display area of ​​the target application in sequence. When animation image frame P1, animation image frame P2, animation image frame P3 and animation image frame P4 are all displayed once, it is a cycle. Based on the second attribute of the target control, the above-mentioned animation effect ends after animation image frame P1, animation image frame P2, animation image frame P3 and animation image frame P4 are displayed in a loop for N cycles.

[0055] In another possible implementation, when the attribute value corresponding to the second attribute is the target value, such as 0, it indicates that at least two animation image frames are always displayed in a loop in the display area. The implementation is similar to the above method and will not be repeated here.

[0056] In this embodiment, by responding to a first request sent by a target application running under a first operating system, animation data is obtained, wherein the animation data is parsed based on a first functional interface of a second operating system; a target control of the target application is called, the animation data is processed, and at least two ordered animation image frames are generated, wherein the target control is implemented based on a first animation library, and the first animation library is at least used to be called under the first operating system to implement the function corresponding to the first functional interface; at least two ordered animation image frames are displayed in the target application. By calling the target control of the target application, and utilizing the feature that the first animation library that implements the target control can be called across platforms, the parsing of the animation data is implemented under the first operating system, and the corresponding at least two ordered animation image frames are obtained and displayed in the target application, which solves the problem that the first operating system that is not adapted to the animation data cannot parse the animation data, and realizes the normal display of the animation effect in a cross-platform scenario, reduces the manual adaptation link, and reduces the time-consuming development and testing of the application.

[0057] refer to Figure 6 , Figure 6 Schematic diagram of the process of the animation display method provided in the embodiment of the present disclosure Figure 2 In this embodiment Figure 2 Based on the illustrated embodiment, step S102 is further refined, and the animation display method includes:

[0058] Step S201: in response to a first request sent by a target application running under a first operating system, obtaining animation data, wherein the animation data is parsed based on a first functional interface of a second operating system.

[0059] Step S202: Initialize the target control and create a timer.

[0060] Step S203: In response to the running of the timer, trigger the drawing method of the target control.

[0061] Exemplarily, after receiving the first request sent by the target application, the terminal device (processing thread) initializes the target control used to draw the animation effect in the target application, creates a timer (for example, QTimer implemented based on QT), and initializes the corresponding trigger interval, for example, 1000 milliseconds, that is, triggers once every 1000 milliseconds. Through the timer, and in combination with the subsequent steps, the effect of drawing an animation image frame every 1000 milliseconds can be achieved, thereby realizing the animation effect display. Further, after the timer is created, the timer runs, and sends a trigger signal based on the trigger interval set in the previous step to trigger the drawing method (paint() method) of the target control. Further, the drawing method is implemented by calling the method provided by the first animation library, that is, the drawing method is implemented based on the first animation library, so that the drawing method has the capabilities provided by the first animation library (for example, the rLottie animation library). Therefore, the drawing method can implement the function corresponding to the first functional interface, thereby achieving the purpose of obtaining animation image frames and drawing.

[0062] For example, Figure 7 As shown, the specific implementation of step S203 includes:

[0063] Step S2031: After the timer is triggered, a trigger signal is sent to the target slot function.

[0064] Step S2032: Use the frame number corresponding to the trigger signal as an input parameter to trigger the target slot function.

[0065] Step S2033: In response to the triggering of the target slot function, call the second function interface corresponding to the first operating system to trigger the drawing method of the target control, wherein the second function interface is rewritten based on the drawing method.

[0066] Exemplarily, after the timer is triggered, the timer sends a trigger signal based on the trigger interval. When the processing thread obtains the trigger signal, a corresponding function is used to respond to the trigger signal. The corresponding function is the target slot function. In a possible implementation, the target slot function is, for example, a renderNextFrame() method that can be called in the first operating system. The slot function is similar to the general function usage, but the slot function is associated with the corresponding trigger signal and can be automatically executed. The specific implementation principle of the slot function is a prior art and will not be repeated here.

[0067] Furthermore, the trigger signal sent by the timer has a one-to-one correspondence with the subsequently generated animation image frame, that is, one trigger signal generates one animation image frame. Therefore, according to the signal identification identifier of the trigger signal, it can be mapped to the frame number of the corresponding animation image frame. When the target slot function is triggered, the frame number obtained by the signal identification identifier is used as the input parameter of the target slot function, and it is triggered to determine the object to be processed, that is, the dynamic image frame corresponding to the frame number. Afterwards, after the target slot function with the frame number as the input parameter is triggered, the second functional interface corresponding to the first operating system is called, and the second functional interface allows being called under the first operating system. In a possible implementation method, the second functional interface is the update() method of QQuickPaintedItem. Among them, QQuickPaintedItem is a class in the QT development framework, and its specific implementation principle will not be repeated. Furthermore, the update() method of QQuickPaintedItem is implemented based on the above-mentioned drawing method, that is, the update() method is rewritten, and the drawing method (that is, the paint() method) is called in its internal implementation. Therefore, when the target application developed for the first operating system (such as the Linux system) through the QT development framework is run under the first operating system, the second function interface can be called to trigger the drawing method of the target control, thereby achieving the purpose of obtaining the animation image frame corresponding to the frame number and performing subsequent drawing.

[0068] Step S204: in response to the triggering of the drawing method, calling the target interface of the first animation library to parse the animation data and obtain the corresponding animation image frame.

[0069] For example, after the drawing method is triggered, the implementation of the drawing method includes the step of calling the target interface provided by the first animation library, and the target interface provided by the first animation library has the ability to parse animation data and generate corresponding animation image frames. Therefore, by calling the target interface to parse the animation data with the frame number as a parameter, the corresponding animation image frame can be obtained.

[0070] Figure 8 A process diagram of a triggering drawing method provided by an embodiment of the present disclosure is shown in FIG. Figure 8As shown, taking the case where the target application is generated based on the QT development framework as an example, the target control inherits from the QQuickPaintedItem class. In the target control, based on the operation of the timer QTimer, the update() method (corresponding to the second functional interface) under the first operating system is called. After that, in the process of executing update(), the paint() method (corresponding to the drawing method) is continued to be called. In the implementation of the paint() method, the getFrameBuffer() method provided by the first animation library rLottie is called, and the ability of the first animation library is used to achieve the purpose of parsing animation data. In this process, the frame number is passed layer by layer as a parameter, and finally the animation image frame corresponding to the frame number is obtained.

[0071] Exemplarily, the animation data includes a storage path corresponding to the animation file, such as Fig. 9 As shown, the specific implementation of step S204 includes:

[0072] Step S2041: Obtain a first input parameter, where the first input parameter represents a target size of a display area corresponding to a target control.

[0073] Step S2042: Based on the first input parameter and the storage path, the target interface of the first animation library is called to parse the animation file in the target format to obtain a target animation image frame with a target size corresponding to the animation file.

[0074] Exemplarily, the first input parameter can be a fixed value preset in the target application, or a parameter value included in the first request sent by the target application. After obtaining the first input parameter, the terminal device can obtain the target size of the display area corresponding to the target control based on the first input parameter. Since the animation effect generated subsequently is displayed in the display area, the first input parameter is equivalent to the display size that characterizes the animation effect. In a possible implementation, the first input parameter includes an array of length 2, in which the length dimension and the width dimension are stored respectively. Afterwards, in the process of drawing the animation image frame, the display size of the animation image frame is cropped or scaled to match the target size of the display area corresponding to the target control, thereby finally adjusting the display size of the animation effect.

[0075] Furthermore, on the other hand, the storage path corresponding to the animation file (such as a JSON file) included in the animation data is read, and the storage path is used as the second input parameter. The target interface is called with the first input parameter and the second input parameter obtained in the above steps to execute the corresponding execution method, such as the getFrameBuffer() method. During the execution of the execution method, the animation file with the target format (such as the JSON format) is parsed to obtain a target animation image frame with a target size corresponding to the animation file. The specific implementation capability is provided by the first animation library and will not be described in detail here.

[0076] Step S205: display at least two ordered animation image frames in the target application.

[0077] In this embodiment, step S201 and step S205 are Figure 2 The implementation methods of steps S101 and S103 in the illustrated embodiment are consistent. For detailed discussion, please refer to Figure 2 The relevant discussion in the illustrated embodiment will not be repeated here.

[0078] Corresponding to the animation display method of the above embodiment, Fig.10 This is a structural block diagram of an animation display device provided by an embodiment of the present disclosure. For ease of description, only the parts related to the embodiment of the present disclosure are shown.

[0079] Reference Fig.10 , the animation display device 3 comprises:

[0080] A response module 31, configured to obtain animation data in response to a first request sent by a target application running under the first operating system, wherein the animation data is parsed based on a first functional interface of the second operating system;

[0081] The processing module 32 is used to call the target control of the target application, process the animation data, and generate at least two ordered animation image frames, wherein the target control is implemented based on the first animation library, and the first animation library is at least used to be called under the first operating system to implement the function corresponding to the first function interface;

[0082] The display module 33 is used to display at least two sequential animation image frames in the target application.

[0083] In one embodiment of the present disclosure, the processing module 32 is specifically used to: initialize the target control and create a timer; in response to the running of the timer, trigger the drawing method of the target control; in response to the triggering of the drawing method, call the target interface of the first animation library to parse the animation data and obtain the corresponding animation image frame.

[0084] In one embodiment of the present disclosure, when the processing module 32 triggers the drawing method of the target control in response to the running of the timer, it is specifically used to: send a trigger signal to the target slot function after the timer is triggered; trigger the target slot function with the frame number corresponding to the trigger signal as an input parameter; in response to the triggering of the target slot function, call the second function interface corresponding to the first operating system to trigger the drawing method of the target control, wherein the second function interface is rewritten based on the drawing method.

[0085] In one embodiment of the present disclosure, the animation data includes a storage path corresponding to the animation file; when the processing module 32 calls the target interface of the first animation library to parse the animation data in response to the triggering of the drawing method to obtain the corresponding animation image frame, it is specifically used to: obtain a first input parameter, the first input parameter represents the target size of the display area corresponding to the target control; based on the first input parameter and the storage path, call the target interface of the first animation library to parse the animation file having a target format, and obtain a target animation image frame having a target size corresponding to the animation file.

[0086] In one embodiment of the present disclosure, the first request includes a data identifier corresponding to the animation data, and the response module 31 is specifically used to: read the first attribute of the target control to obtain the data storage address; and obtain the animation data according to the data storage address and the data identifier.

[0087] In one embodiment of the present disclosure, the target control is set in the target application, and the display module 33 is specifically used to: obtain the frame number corresponding to the animation image frame; based on the frame number, display the corresponding animation image frame in order in the display area corresponding to the target control.

[0088] In one embodiment of the present disclosure, the display module 33 is further used to: read a second attribute of the target control, the second attribute representing the number of times the animation image frame is cyclically displayed in the target application; when the display module 33 displays the corresponding animation image frames in an orderly manner in the display area corresponding to the target control based on the frame number, it is specifically used to: based on the second attribute, cyclically display the animation image frames corresponding to the frame number in an orderly manner in the display area corresponding to the target control.

[0089] In one embodiment of the present disclosure, at least one of the following items is also included: the animation data is generated based on the second animation library, the second animation library includes the Lottie animation library; the first operating system includes the Linux system; the first animation library includes the rLottie animation library.

[0090] The response module 31, the processing module 32 and the display module 33 are connected in sequence. The animation display device 3 provided in this embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0091] Fig.11 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown in FIG. Fig.11 As shown, the electronic device 4 includes:

[0092] A processor 41, and a memory 42 communicatively connected to the processor 41;

[0093] The memory 42 stores computer executable instructions;

[0094] The processor 41 executes the computer execution instructions stored in the memory 42 to implement the following Figure 2-Figure 9 The animation display method in the illustrated embodiment.

[0095] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .

[0096] For related instructions, please refer to Figure 2-Figure 9 The relevant descriptions and effects corresponding to the steps in the corresponding embodiments can be understood, and no further elaboration is made here.

[0097] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which are used to implement the present invention when executed by a processor. Figure 2-Figure 9 The animation display method provided by any one of the corresponding embodiments.

[0098] The present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements Figure 2-Figure 9 The animation display method in the illustrated embodiment,

[0099] refer to Fig.12 , which shows a schematic diagram of the structure of an electronic device 900 suitable for implementing the embodiment of the present disclosure, and the electronic device 900 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.12 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0100] like Fig.12As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 to a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0101] Typically, the following devices may be connected to the I / O interface 905: input devices 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.12 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0102] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0103] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0104] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0105] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0106] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0107] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0108] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0109] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0110] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0111] In a first aspect, according to one or more embodiments of the present disclosure, there is provided an animation display method, comprising:

[0112] In response to a first request sent by a target application running under a first operating system, animation data is obtained, wherein the animation data is parsed based on a first functional interface of a second operating system; a target control of the target application is called, the animation data is processed, and at least two ordered animation image frames are generated, wherein the target control is implemented based on a first animation library, and the first animation library is at least used to be called under the first operating system to implement a function corresponding to the first functional interface; the at least two ordered animation image frames are displayed in the target application.

[0113] According to one or more embodiments of the present disclosure, calling the target control of the target application, processing the animation data, and generating at least two ordered animation image frames include: initializing the target control and creating a timer; in response to the running of the timer, triggering the drawing method of the target control; in response to the triggering of the drawing method, calling the target interface of the first animation library to parse the animation data and obtain corresponding animation image frames.

[0114] According to one or more embodiments of the present disclosure, in response to the running of the timer, triggering the drawing method of the target control includes: after the timer is triggered, sending a trigger signal to the target slot function; using the frame number corresponding to the trigger signal as an input parameter to trigger the target slot function; in response to the triggering of the target slot function, calling the second function interface corresponding to the first operating system to trigger the drawing method of the target control, wherein the second function interface is rewritten based on the drawing method.

[0115] According to one or more embodiments of the present disclosure, the animation data includes a storage path corresponding to an animation file; in response to the triggering of the drawing method, calling a target interface of the first animation library to parse the animation data to obtain a corresponding animation image frame, including: obtaining a first input parameter, the first input parameter representing a target size of a display area corresponding to the target control; based on the first input parameter and the storage path, calling a target interface of the first animation library to parse an animation file having a target format to obtain a target animation image frame having the target size corresponding to the animation file.

[0116] According to one or more embodiments of the present disclosure, the first request includes a data identifier representing the animation data, and the animation data is obtained in response to the first request sent by the target application running under the first operating system, including: reading the first property of the target control to obtain the data storage address; and obtaining the animation data according to the data storage address and the data identifier.

[0117] According to one or more embodiments of the present disclosure, the target control is set in the target application, and the displaying of the at least two ordered animation image frames in the target application includes: obtaining frame numbers corresponding to the animation image frames; based on the frame numbers, displaying the corresponding animation image frames in order in the display area corresponding to the target control.

[0118] According to one or more embodiments of the present disclosure, the method further includes: reading a second attribute of the target control, the second attribute representing the number of times the animation image frame is cyclically displayed within the target application; and displaying the corresponding animation image frames in order within the display area corresponding to the target control based on the frame sequence number, including: based on the second attribute, cyclically displaying the animation image frames corresponding to the frame sequence number in order within the display area corresponding to the target control.

[0119] According to one or more embodiments of the present disclosure, at least one of the following items is also included: the animation data is generated based on a second animation library, the second animation library includes a Lottie animation library; the first operating system includes a Linux system; the first animation library includes an rLottie animation library.

[0120] In a second aspect, according to one or more embodiments of the present disclosure, there is provided an animation display device, comprising:

[0121] a response module, configured to obtain animation data in response to a first request sent by a target application running under the first operating system, wherein the animation data is parsed based on a first functional interface of the second operating system;

[0122] a processing module, configured to call a target control of the target application, process the animation data, and generate at least two ordered animation image frames, wherein the target control is implemented based on a first animation library, and the first animation library is at least used to be called under the first operating system to implement the function corresponding to the first function interface;

[0123] The display module is used to display the at least two ordered animation image frames in the target application.

[0124] According to one or more embodiments of the present disclosure, the processing module is specifically used to: initialize the target control and create a timer; in response to the running of the timer, trigger the drawing method of the target control; in response to the triggering of the drawing method, call the target interface of the first animation library to parse the animation data and obtain the corresponding animation image frame.

[0125] According to one or more embodiments of the present disclosure, when the processing module triggers the drawing method of the target control in response to the running of the timer, it is specifically used to: send a trigger signal to the target slot function after the timer is triggered; trigger the target slot function with the frame number corresponding to the trigger signal as an input parameter; in response to the triggering of the target slot function, call the second function interface corresponding to the first operating system to trigger the drawing method of the target control, wherein the second function interface is rewritten based on the drawing method.

[0126] According to one or more embodiments of the present disclosure, the animation data includes a storage path corresponding to the animation file; when the processing module, in response to the triggering of the drawing method, calls the target interface of the first animation library to parse the animation data and obtains the corresponding animation image frame, it is specifically used to: obtain a first input parameter, the first input parameter characterizing a target size of a display area corresponding to the target control; based on the first input parameter and the storage path, call the target interface of the first animation library to parse the animation file having a target format, and obtain a target animation image frame having the target size corresponding to the animation file.

[0127] According to one or more embodiments of the present disclosure, the first request includes a data identifier representing the animation data, and the response module is specifically used to: read the first property of the target control to obtain a data storage address; and obtain the animation data according to the data storage address and the data identifier.

[0128] According to one or more embodiments of the present disclosure, the target control is set in the target application, and the display module is specifically used to: obtain the frame sequence number corresponding to the animation image frame; based on the frame sequence number, display the corresponding animation image frame in order in the display area corresponding to the target control.

[0129] According to one or more embodiments of the present disclosure, the display module is further used to: read a second attribute of the target control, the second attribute representing the number of times the animation image frame is cyclically displayed within the target application; when the display module displays the corresponding animation image frames in order within the display area corresponding to the target control based on the frame sequence number, the display module is specifically used to: based on the second attribute, cyclically display the animation image frames corresponding to the frame sequence number in order within the display area corresponding to the target control.

[0130] According to one or more embodiments of the present disclosure, at least one of the following items is also included: the animation data is generated based on a second animation library, the second animation library includes a Lottie animation library; the first operating system includes a Linux system; the first animation library includes an rLottie animation library.

[0131] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0132] The memory stores computer-executable instructions;

[0133] The processor executes the computer-executable instructions stored in the memory to implement the animation display method as described in the first aspect and various possible designs of the first aspect.

[0134] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the animation display method described in the first aspect and various possible designs of the first aspect is implemented.

[0135] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the animation display method described in the first aspect and various possible designs of the first aspect.

[0136] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0137] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0138] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. An animation display method, characterized in that: include: In response to a first request sent by a target application running under the first operating system, acquiring animation data, wherein the animation data is parsed based on a first functional interface of the second operating system; Calling a target control of the target application, processing the animation data, and generating at least two ordered animation image frames, wherein the target control is implemented based on a first animation library, and the first animation library is at least used to be called under the first operating system to implement the function corresponding to the first function interface; The at least two sequential animation image frames are displayed in the target application.

2. The method according to claim 1, characterized in that: The calling of the target control of the target application, processing the animation data, and generating at least two ordered animation image frames includes: Initialize the target control and create a timer; In response to the running of the timer, triggering a drawing method of the target control; In response to the triggering of the drawing method, the target interface of the first animation library is called to parse the animation data to obtain corresponding animation image frames.

3. The method according to claim 2, characterized in that The triggering of the drawing method of the target control in response to the running of the timer includes: After the timer is triggered, a trigger signal is sent to the target slot function; Using the frame number corresponding to the trigger signal as an input parameter, triggering the target slot function; In response to the triggering of the target slot function, the second function interface corresponding to the first operating system is called to trigger the drawing method of the target control, wherein the second function interface is rewritten based on the drawing method.

4. The method according to claim 2, characterized in that: The animation data includes a storage path corresponding to the animation file; In response to the triggering of the drawing method, calling the target interface of the first animation library to parse the animation data and obtain the corresponding animation image frame includes: Obtaining a first input parameter, where the first input parameter represents a target size of a display area corresponding to the target control; Based on the first input parameter and the storage path, a target interface of a first animation library is called to parse the animation file having a target format, and a target animation image frame having the target size corresponding to the animation file is obtained.

5. The method according to claim 1, characterized in that The first request includes a data identifier corresponding to the animation data, and the obtaining of the animation data in response to the first request sent by the target application running under the first operating system includes: Read the first attribute of the target control to obtain the data storage address; The animation data is obtained according to the data storage address and the data identifier.

6. The method according to claim 1, characterized in that The target control is set in the target application, and the at least two ordered animation image frames are displayed in the target application, including: Obtaining a frame sequence number corresponding to the animation image frame; Based on the frame sequence numbers, the corresponding animation image frames are sequentially displayed in a display area corresponding to the target control.

7. The method according to claim 6, characterized in that The method further comprises: Reading a second attribute of the target control, where the second attribute represents the number of times the animation image frame is displayed in a loop within the target application; The step of displaying the corresponding animation image frames in order in the display area corresponding to the target control based on the frame sequence number includes: Based on the second attribute, the animation image frames corresponding to the frame numbers are cyclically displayed in order in the display area corresponding to the target control.

8. The method according to claim 1, characterized in that: Also includes at least one of the following: The animation data is generated based on a second animation library, wherein the second animation library includes a Lottie animation library; The first operating system includes a Linux system; The first animation library includes the rLottie animation library.

9. An animation display device, characterized in that: include: a response module, configured to obtain animation data in response to a first request sent by a target application running under the first operating system, wherein the animation data is parsed based on a first functional interface of the second operating system; a processing module, configured to call a target control of the target application, process the animation data, and generate at least two ordered animation image frames, wherein the target control is implemented based on a first animation library, and the first animation library is at least used to be called under the first operating system to implement the function corresponding to the first function interface; The display module is used to display the at least two ordered animation image frames in the target application.

10. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the animation display method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the animation display method according to any one of claims 1 to 8 is implemented.

12. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the animation display method according to any one of claims 1 to 8.