Method and device for creating animation

By extracting animation parameters from the preset animation library to generate multi-frame images, the problem of high CPU load caused by UIView drawing particle animation is solved, and more efficient animation creation is achieved and server performance is improved.

CN114677462BActive Publication Date: 2024-12-17TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110353933.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-31
Publication Date
2024-12-17
Estimated Expiration
2041-03-31

AI Technical Summary

Technical Problem

When drawing particle animations through UIView, the prior art causes large system resource consumption, especially the CPU load is too heavy, affecting server performance.

Method used

By loading target animation data from the preset animation library, extracting animation parameters to generate multi-frame images. When creating animations, it is based on animation parameters only, rather than calling a large number of drawing functions, reducing server load.

Benefits of technology

Effectively reduce server load, improve system resource utilization, reduce CPU consumption, and improve animation creation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114677462B_ABST
    Figure CN114677462B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for creating an animation, the method comprising: when loading target animation data from a preset animation library, extracting animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters; generating multiple frames of images according to the image frame parameters and position parameters of the at least one first element; creating an animation composed of the multiple frames of images, the animation including at least one second element, the at least one second element corresponding one-to-one with the at least one first element. The method proposed in the present application is conducive to reducing the load of the server to improve the utilization rate of the system resources of the server.
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 a method and device for creating an animation. Background Art

[0002] With the development of the times, more and more software can play particle animations. For example, taking chat software as an example, after the user enters the text "Happy Birthday" in the conversation window, the terminal device can play the animation of multiple cakes falling.

[0003] Since particle animation is usually drawn using a User Interface View (UIView), drawing particle animation through UIView will occupy a large amount of central processing unit (CPU), resulting in a large consumption of system resources. Summary of the invention

[0004] The embodiment of the present invention provides a method and device for creating an animation, which can help to reduce the load of a server and improve the utilization rate of system resources of the server.

[0005] In one aspect, an embodiment of the present invention provides a method for creating an animation, comprising:

[0006] When loading target animation data from a preset animation library, extracting animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters;

[0007] Generate multiple frames of images according to the image frame parameter and position parameter of the at least one first element;

[0008] An animation composed of the multiple frames of images is created, wherein the animation includes at least one second element, and the at least one second element corresponds to the at least one first element in a one-to-one manner.

[0009] In one embodiment, when executing the step of generating multiple frames of images according to the image frame parameters and position parameters of the at least one first element, the method includes: determining, according to the image frame parameters of each first element in the at least one first element, a target image frame in which the second element corresponding to each first element exists in the multiple frames of images, and the target image frame includes at least two frames of images; determining, according to the position parameters of each first element, the position of each second element in each target image frame; and generating the multiple frames of images according to the position of each second element in each target image frame.

[0010] In one embodiment, the image frame parameters include start key frame information, end key frame information and frame rate, and the target image frame includes a start image frame, an end image frame and an intermediate image frame;

[0011] When executing the step of determining, based on the image frame parameters of each first element in the at least one first element, that the second element corresponding to each first element exists in the target image frame in the multi-frame image, the method includes: determining, based on the starting key frame information of each first element in the at least one first element, the starting image frame in which each second element exists in the multi-frame image; determining, based on the ending key frame information of each first element, the ending image frame in which each second element exists in the multi-frame image; and determining, based on the frame rate of each first element, an intermediate image frame in which each second element exists in the multi-frame image, the intermediate image frame being located between the starting image frame and the ending image frame.

[0012] In one embodiment, the location parameters include coordinate information;

[0013] When executing the step of determining the position of each second element in each target image frame according to the position parameters of each first element, the method includes: determining the position of each second element in each target image frame according to the coordinate information of each first element and the number of the target image frames.

[0014] In one embodiment, the position parameter also includes posture information;

[0015] When executing the step of determining the position of each second element in each target image frame according to the coordinate information of each first element and the number of the target image frames, the method includes: determining the posture information of each second element in each target image frame according to the posture information of each first element and the number of the target image frames; and generating the multi-frame image according to the position and posture information of each second element in each target image frame.

[0016] In one embodiment, the multi-frame images include the respective second elements and the interactive objects corresponding to the respective second elements, and the positions of the respective second elements in the multi-frame images are the same as the positions of the interactive objects corresponding to the respective second elements in the multi-frame images;

[0017] After creating the animation composed of the multiple frames of images, the method also includes: when receiving a trigger event sent by the client, searching for an animation matching the trigger event and sending the animation to the client, the trigger event is generated by the client when detecting an operation on the user interface; receiving an operation event sent by the client, the operation event is generated when the client listens to an operation on the second element included in any image frame in the animation through an interactive object corresponding to any second element during the process of playing the animation; generating at least one frame of image corresponding to the operation event; and sending the at least one frame of image to the client so that the client displays the at least one frame of image.

[0018] In one embodiment, before generating multiple frames of images based on the image frame parameters and position parameters of the at least one first element, the method also includes: generating interactive objects corresponding to each second element in the at least one second element; generating multiple frames of images including each second element and the interactive objects corresponding to each second element based on the image frame parameters and position parameters of the at least one first element.

[0019] In one embodiment, the playback interface for playing the animation and the user interface are displayed in different layers of the client, and the display interface for displaying the at least one frame of image and the playback interface are displayed in different layers of the client.

[0020] In one embodiment, before generating at least one frame of image corresponding to the operation event, the method also includes: searching for a target interactive object from a memory, a second element corresponding to the target interactive object matching any third element contained in the at least one frame of image; determining that the interactive object corresponding to the third element is the target interactive object; and generating at least one frame of image including the third element and the target interactive object according to the operation event, a position of the third element in the at least one frame of image being the same as a position of the target interactive object in the at least one frame of image.

[0021] In one embodiment, before searching for the target interactive object from the memory, the method also includes: when element indication information sent by the client is received, storing the interactive object corresponding to the target second element indicated by the element indication information in the memory, and the element indication information is generated when the client monitors the operation of the target second element contained in any image frame of the animation through the interactive object corresponding to the target second element during the process of playing the animation.

[0022] In one aspect, the present invention provides a device for creating an animation, the device comprising an acquisition unit and a processing unit:

[0023] The acquisition unit is used to extract animation parameters of at least one first element in the target animation data when the target animation data is loaded from the preset animation library, wherein the animation parameters include image frame parameters and position parameters;

[0024] The processing unit is used to generate multiple frames of images according to the image frame parameters and position parameters of the at least one first element;

[0025] The processing unit is further used to create an animation composed of the multiple frames of images, wherein the animation includes at least one second element, and the at least one second element corresponds one-to-one to the at least one first element.

[0026] In one embodiment, when generating multiple frames of images based on the image frame parameters and position parameters of the at least one first element, the processing unit is used to: determine, based on the image frame parameters of each first element in the at least one first element, a target image frame in which a second element corresponding to each first element exists in the multiple frames of images, and the target image frame includes at least two frames of images; determine, based on the position parameters of each first element, a position of each second element in each target image frame; and generate the multiple frames of images based on the position of each second element in each target image frame.

[0027] In one embodiment, the image frame parameters include start key frame information, end key frame information and frame rate, and the target image frame includes a start image frame, an end image frame and an intermediate image frame;

[0028] When the processing unit determines, based on the image frame parameters of each first element in the at least one first element, that the second element corresponding to each first element exists in the target image frame in the multi-frame image, the processing unit is used to: determine, based on the starting key frame information of each first element in the at least one first element, the starting image frame in which the each second element exists in the multi-frame image; determine, based on the ending key frame information of each first element, the ending image frame in which the each second element exists in the multi-frame image; and determine, based on the frame rate of each first element, the intermediate image frame in which the each second element exists in the multi-frame image, the intermediate image frame being located between the starting image frame and the ending image frame.

[0029] In one embodiment, the location parameters include coordinate information;

[0030] When determining the position of each second element in each target image frame based on the position parameters of each first element, the processing unit is used to: determine the position of each second element in each target image frame based on the coordinate information of each first element and the number of the target image frames.

[0031] In one embodiment, the position parameters also include posture information;

[0032] When the processing unit determines the position of each second element in each target image frame based on the coordinate information of each first element and the number of the target image frames, it is used to: determine the posture information of each second element in each target image frame based on the posture information of each first element and the number of the target image frames; and generate the multi-frame image based on the position and posture information of each second element in each target image frame.

[0033] In one embodiment, the multi-frame images include the respective second elements and the interactive objects corresponding to the respective second elements, and the positions of the respective second elements in the multi-frame images are the same as the positions of the interactive objects corresponding to the respective second elements in the multi-frame images;

[0034] The device also includes a communication unit: after the processing unit is used to create the animation composed of the multiple frames of images, the communication unit is also used to, when receiving a trigger event sent by the client, search for an animation matching the trigger event and send the animation to the client, wherein the trigger event is generated when the client detects an operation on the user interface; the communication unit is also used to receive an operation event sent by the client, wherein the operation event is generated when the client monitors an operation on the second element included in any image frame of the animation through an interactive object corresponding to any second element during the process of playing the animation; the processing unit is also used to generate at least one frame of image corresponding to the operation event; the processing unit is also used to send the at least one frame of image to the client so that the client displays the at least one frame of image.

[0035] In one embodiment, the processing unit is used to generate interactive objects corresponding to each second element in the at least one second element before generating multiple frames of images according to the image frame parameters and position parameters of the at least one first element; the generating multiple frames of images according to the image frame parameters and position parameters of the at least one first element includes: generating multiple frames of images including each second element and the interactive objects corresponding to each second element according to the image frame parameters and position parameters of the at least one first element.

[0036] In one embodiment, the playback interface for playing the animation and the user interface are displayed in different layers of the client, and the display interface for displaying the at least one frame of image and the playback interface are displayed in different layers of the client.

[0037] In one embodiment, before the processing unit is used to generate at least one frame of image corresponding to the operation event, the processing unit is also used to: search for a target interactive object from a memory, a second element corresponding to the target interactive object matches any third element contained in the at least one frame of image; determine that the interactive object corresponding to the third element is the target interactive object; and generate at least one frame of image including the third element and the target interactive object according to the operation event, the position of the third element in the at least one frame of image being the same as the position of the target interactive object in the at least one frame of image.

[0038] In one embodiment, before the processing unit is used to search for the target interactive object from the memory, the processing unit is also used to: upon receiving element indication information sent by the client, store the interactive object corresponding to the target second element indicated by the element indication information in the memory, wherein the element indication information is generated when the client monitors the operation of the target second element contained in any image frame of the animation through the interactive object corresponding to the target second element during the process of playing the animation.

[0039] In one aspect, an embodiment of the present invention provides a server, including:

[0040] a processor adapted to implement one or more instructions; and

[0041] A computer storage medium storing one or more instructions adapted to be loaded and executed by the processor:

[0042] When loading target animation data from a preset animation library, extract animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters; generate multiple frames of images based on the image frame parameters and position parameters of the at least one first element; create an animation composed of the multiple frames of images, wherein the animation includes at least one second element, and the at least one second element corresponds one-to-one to the at least one first element.

[0043] In one aspect, an embodiment of the present invention provides a computer storage medium, characterized in that the computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, they are used to execute:

[0044] When loading target animation data from a preset animation library, extract animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters; generate multiple frames of images based on the image frame parameters and position parameters of the at least one first element; create an animation composed of the multiple frames of images, wherein the animation includes at least one second element, and the at least one second element corresponds one-to-one to the at least one first element.

[0045] In one aspect, an embodiment of the present invention provides a computer program product or a computer program, wherein the computer program product includes a computer program, and the computer program is stored in a computer storage medium; a processor of a server reads the computer instructions from the computer storage medium, and the processor executes:

[0046] When loading target animation data from a preset animation library, extract animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters; generate multiple frames of images based on the image frame parameters and position parameters of the at least one first element; create an animation composed of the multiple frames of images, wherein the animation includes at least one second element, and the at least one second element corresponds one-to-one to the at least one first element.

[0047] Based on the above-described animation creation method, when loading target animation data from a preset animation library, the server extracts the animation parameters contained in the target animation data, generates multiple frames of images according to the animation parameters, and creates an animation composed of multiple frames of images. Therefore, the server does not need to draw multiple frames of images by calling a large number of drawing functions, but only needs to load the target animation data and create an animation based on the animation parameters of the target animation data. Such a method can help reduce the load of the server and improve the utilization rate of the system resources of the server. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0049] Figure 1 is a schematic diagram of the structure of a communication system provided by an embodiment of the present invention;

[0050] Figure 2 is a flow chart of an animation creation method provided by an embodiment of the present invention;

[0051] Figure 3 is a schematic diagram of a multi-frame image provided by an embodiment of the present invention;

[0052] Figure 4 is a flowchart of another animation creation method provided by an embodiment of the present invention;

[0053] Figure 5 is a schematic diagram of a human-computer interaction provided by an embodiment of the present invention;

[0054] Figure 6 is a schematic diagram of another human-computer interaction provided by an embodiment of the present invention;

[0055] Figure 7 is a flowchart of another animation creation method provided by an embodiment of the present invention;

[0056] Figure 8 is a structural schematic diagram of an animation creation device provided by an embodiment of the present invention;

[0057] Fig. 9 It is a structural diagram of a server provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0058] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] Cloud computing refers to the delivery and use model of IT infrastructure, which means obtaining required resources through the network in an on-demand and easily scalable manner; in a broad sense, cloud computing refers to the delivery and use model of services, which means obtaining required services through the network in an on-demand and easily scalable manner. This service can be related to IT and software, the Internet, or other services. Cloud computing is the product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing.

[0060] With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the demand for search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Different from the previous parallel distributed computing, the emergence of cloud computing will promote revolutionary changes in the entire Internet model and enterprise management model from a conceptual perspective.

[0061] The present invention proposes a method for creating an animation, which loads target animation data from a preset animation library and creates an animation based on animation parameters contained in the target animation data. This method can help reduce the load of a server and improve the utilization rate of system resources of the server.

[0062] In order to implement the method proposed in the present invention, an embodiment of the present invention provides a communication system. Figure 1 The communication system includes but is not limited to one or more clients and one or more servers. Figure 1Take a client 101 and a server 102 as an example. Among them, communication can be established between the client 101 and the server 102. Figure 1 The number and form of the devices shown are for illustrative purposes only and do not constitute a limitation on the embodiments of the present invention.

[0063] Among them, the client 101 can be a terminal device (user equipment, UE), such as a mobile phone, a computer with wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a wireless terminal in self-driving, a wireless terminal in remote medical, a wireless terminal in a smart grid, a wireless terminal in transportation safety, etc., or a wearable device such as a smart watch or a bracelet.

[0064] The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.

[0065] In a specific implementation, when loading target animation data from a preset animation library, the server 102 can extract animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters. The server 102 can then generate multiple frames of images based on the image frame parameters and position parameters of the at least one first element, and create an animation consisting of multiple frames of images, wherein the animation includes at least one second element, wherein the at least one second element corresponds one-to-one to the at least one first element.

[0066] In one embodiment, after detecting an event triggered by a user, the client 101 generates a trigger event and sends the trigger event to the server 102; after receiving the trigger event sent by the client 101, the server 102 searches for an animation matching the trigger event and sends the animation to the client 101; after receiving the animation sent by the server 102, the client plays the animation; during the animation playback process, the client detects an event in which the user operates the animation, generates an operation event and sends the operation event to the server 102; the server 102 receives the operation event sent by the client 101, generates at least one frame of image corresponding to the operation event, and sends the at least one frame of image to the client 101; after receiving the at least one frame of image, the client 101 displays the image.

[0067] Based on the above communication system, an embodiment of the present invention provides a method for creating an animation. Figure 2 , is a flowchart of a method for creating an animation provided by an embodiment of the present invention. The method for creating an animation can be applied to Figure 1 The communication system shown is executed by a server, and specifically can be executed by a processor of the server. The animation creation method includes the following steps:

[0068] S201. When loading target animation data from a preset animation library, the server extracts animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters.

[0069] In one embodiment, the preset animation library includes a large amount of animation data, the animation data includes at least one first element, each element has a corresponding animation parameter, and different elements have different corresponding animation parameters.

[0070] In one embodiment, the image frame parameters include start key frame information, end key frame information, and frame rate. The start key frame information of the first element includes the start image frame information of the second element corresponding to the first element in the animation to be created, the end key frame information of the first element includes the end image frame information of the second element corresponding to the first element in the animation to be created, and the frame rate of the first element refers to the number of frames displayed per second by the second element corresponding to the first element when the animation to be created is played.

[0071] In one embodiment, the position parameter includes coordinate information. The coordinate information of the first element includes the position information of the second element corresponding to the first element in each image frame of the animation to be created.

[0072] In one embodiment, the position parameter includes posture information, which may also include rotation parameters and scaling parameters. The posture information of the first element includes posture information corresponding to the second element corresponding to the first element in each image frame of the animation to be created.

[0073] Optionally, the animation library may be a Lottie animation library, or an animation library pre-stored locally on a server, or an animation library stored on other servers. The embodiment of the present invention does not limit the type of animation library.

[0074] Optionally, when loading the target animation data from the preset animation library, the method by which the server extracts the animation parameters of at least one first element in the target animation data may be to obtain the animation parameters of at least one first element by means of a hook.

[0075] Optionally, the target animation data may be a data (json) file, which may include frame rate, start key frame information, end key frame information, view width information, view height information, image name information, resource collection information, layer collection information, and mask collection information, etc.

[0076] Optionally, the target animation may be a particle animation, and the elements included in the target animation data may be particle elements in the particle animation. For example, a user sends "Happy Birthday" in a session window to trigger the target animation. At this time, the target animation is many birthday cakes falling on the user interface of the client, and the birthday cakes are particle elements. In addition to the particle animation described above, the target animation may also be other types of animations, and the embodiment of the present invention does not limit the type of the target animation.

[0077] S202. The server generates multiple frames of images according to the image frame parameters and position parameters of the at least one first element.

[0078] In one embodiment, the server may determine, based on image frame parameters of each first element in the at least one first element, a target image frame in which a second element corresponding to each first element exists in the multiple image frames, and the target image frame includes at least two image frames.

[0079] The image frame parameters include starting key frame information, ending key frame information, and frame rate. The server can determine the starting image frame in which each second element exists in the multi-frame image based on the starting key frame information of each first element in the at least one first element, and the starting image frame refers to the image frame of the first frame in which the second element appears in the multi-frame image; the server can determine the ending image frame in which each second element exists in the multi-frame image based on the ending key frame information of each first element, and the ending image frame refers to the image frame of the last frame in which the second element appears in the multi-frame image; the server can determine the intermediate image frame in which each second element exists in the multi-frame image based on the frame rate of each first element, and the intermediate image frame refers to the image frame in which the second element appears in the middle of the multi-frame image, and the intermediate image frame is located between the starting image frame and the ending image frame. The method for determining the intermediate image frame is specifically to determine the number of frames displayed per second of the second element corresponding to the first element when the animation is played through the frame rate of the first element. According to the previously determined starting image frame, ending image frame, total number of frames between the starting image frame and the ending image frame, and the frame rate of the animation to be created, the intermediate image frame of the second element in the multiple frames of the image can be determined.

[0080] In one embodiment, the server may determine the position of each second element in each target image frame according to the position parameters of each first element; and generate the multiple frames of images according to the position of each second element in each target image frame.

[0081] The position parameter includes coordinate information and posture information, and the posture information includes scaling parameters and rotation parameters. The server can determine the position of each second element in each target image frame according to the coordinate information of each first element and the number of the target image frames; the server can determine the posture information of each second element in each target image frame according to the posture information of each first element and the number of the target image frames.

[0082] The following is an introduction using a specific example. Assume that the server needs to generate an animation of a falling cake. The target animation data is loaded into the preset animation library, and the server extracts the animation parameters of the first element contained in the target animation data. The first element corresponds to the second element in the multi-frame image, and the second element is the cake element in the animation. Assume that the animation of the falling cake is determined to be composed of three image frames according to the starting key frame information, the ending key frame information and the frame rate included in the image frame parameters of the first element. The first image frame is the starting image frame of the cake element, and the third image frame is the ending image frame of the cake element. Since the intermediate image frame is between the starting image frame and the ending image frame, and according to the frame rate, it can be determined that the second image frame is the intermediate image frame of the cake element. According to the position parameter of the first element, the position of the cake element in the three image frames can be determined. Since the animation presents the effect of a falling cake, the position of the cake element gradually decreases from the first frame to the third frame. Through the method described above, the server can generate the following Figure 3 An animation including a cake element 301 is shown.

[0083] S203: The server creates an animation composed of the multiple frames of images, where the animation includes at least one second element, and the at least one second element corresponds to the at least one first element in a one-to-one manner.

[0084] In one embodiment, the animation created by the server includes at least one second element, and the second element corresponds one-to-one to the first element contained in the target animation data loaded from the preset animation library. Therefore, the image frame information, position information and posture information of the second element in the animation can be determined based on the image frame parameters and position parameters of the first element.

[0085] See also Figure 4 , is a flow chart of a method for creating an animation provided by an embodiment of the present invention, and the method for creating an animation can be applied to Figure 1 The communication system shown.

[0086] S401. When loading target animation data from a preset animation library, the server extracts animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters.

[0087] Among them, the specific implementation method of step S401 is the same as that of the above-mentioned step S201, which will not be repeated here.

[0088] S402: The server generates an interactive object corresponding to each second element in the at least one second element.

[0089] In one embodiment, each second element has a one-to-one corresponding interactive object, and the interactive object corresponding to the second element is used to monitor the second element. Since the image frame, position and posture of the second element in the animation to be created are determined according to the image frame parameters and position parameters of the first element, the interactive object can be the same as the position of the corresponding second element in the animation, so as to be able to monitor the operation event corresponding to the second element and respond to the corresponding target event in time. For example, the user uses the client to trigger an event, and plays an animation of many cakes falling on the client interface. The second element is one of the cakes. At this time, if the user clicks on the cake, the interactive object corresponding to the second element will monitor the operation event information.

[0090] Optionally, the interaction object includes an interaction parameter, and the client can determine whether the second element corresponding to the interaction object supports interaction through the parameter.

[0091] Optionally, the interaction object also includes different gesture parameters. The client can monitor and determine the user's different operation gestures on the second element through the interaction object, and can respond to different events according to the user's different operation gestures. For example, when the client plays an animation of a falling birthday cake, the client can distinguish between two different operation events, namely, the user clicks the cake once and the user double-clicks the cake, through the interaction object. For the above two different operation events, the client can respond and play two different animations. If the user clicks the cake once, the client plays an animation of the cake flying out; if the user double-clicks the cake, the client plays an animation of the cake splitting into two cakes. In this way, the user experience can be enhanced.

[0092] S403: The server generates multiple frames of images according to the image frame parameters and position parameters of the at least one first element.

[0093] In one embodiment, the server may generate a multi-frame image including each second element and an interactive object corresponding to each second element according to the image frame parameter and position parameter of the at least one first element. The multi-frame image includes each second element and an interactive object corresponding to each second element, and the position of each second element in the multi-frame image is the same as the position of the interactive object corresponding to each second element in the multi-frame image.

[0094] S404: The server creates an animation composed of the multiple frames of images, where the animation includes at least one second element, and the at least one second element corresponds one-to-one to the at least one first element.

[0095] Among them, the specific implementation method of step S404 is the same as that of the above-mentioned step S203, which will not be repeated here.

[0096] S405: The client generates a trigger event and sends the trigger event to the server.

[0097] In one embodiment, when the client detects that the user triggers an event to play an animation in the user interface, the client generates a trigger event and sends it to the server. Figure 5 As shown, user Xiao Ming sends "Happy Birthday" to the other user Xiao Hong in the conversation window of the client, and the user interface of the client plays an animation of many cakes falling. Xiao Ming's sending of "Happy Birthday" is the user triggering the animation play event. In addition, the user may trigger the animation play event in other ways, such as pressing the client target button, etc., which is not limited in the embodiment of the present invention.

[0098] S406: The server searches for an animation that matches the trigger event, and sends the animation to the client.

[0099] Optionally, the animation may be an animation created in advance by the server, or may be an animation created by the server based on the triggering event, which is not limited in the embodiment of the present invention.

[0100] S407: The client plays the animation.

[0101] In one embodiment, the playback interface for playing the animation and the user interface are displayed in different layers of the client. Since the playback interface for playing the animation and the user interface are displayed in different layers of the client, and the interactive object is on the playback interface for playing the animation, the interaction range between the user and the animation is only related to the size of the animation playback interface, and has nothing to do with the size of the user interface. Figure 5 As shown, Figure 5 The user interface 502 is on the layer where Xiao Ming and Xiao Hong's conversation window is located, and the animation of the falling cake is played on the layer where the playing interface 501 is located. It can be seen that the scope of the user interface 502 is smaller than the animation playing interface 501. Since the interaction scope between the user and the animation is only related to the size of the animation playing interface, the user can click on the animation elements outside the user interface 502. For example, the user can click on the cake 5011 that is beyond the user interface 502 but on the playing interface 501. This method is conducive to expanding the interaction scope between the user and the animation and improving the user experience.

[0102] A specific example is used to describe steps S405 to S407. Figure 5As shown, when user Xiao Ming sends "Happy Birthday" to the other user Xiao Hong in the client's session window and triggers the animation playback event, the client will generate a trigger event, which also includes the text content of "Xiao Hong, happy birthday". The server will extract the keyword "Happy Birthday" based on the text content, find the animation of the birthday cake falling, and send the animation to the client. At this time, the client will play the animation of the birthday cake falling.

[0103] S408: The client generates an operation event and sends the operation event to the server. S409: The server generates at least one frame of image corresponding to the operation event and sends the at least one frame of image to the client.

[0104] Optionally, after receiving the operation event, in addition to generating a frame of image, the server may also have other response events, such as obtaining user information, recording the operation event corresponding to the user, and obtaining the corresponding web page based on the operation time and sending it to the client so that the client jumps to the web page interface.

[0105] Optionally, at least one frame of image generated by the server includes at least one third element and an interactive object corresponding to the at least one third element, and the third element can interact with the user. In this way, the user's interactive experience can be enhanced.

[0106] S410: The client displays the at least one frame of image.

[0107] In one embodiment, after receiving the at least one frame of image, the client will display the at least one frame of image. Figure 6 As shown, when the user clicks on the cake in the client interface, the client will display the animation of the cake flying out. The animation of the cake flying out is the at least one frame of image sent by the server. The server generates multiple frames of images of the cake flying out of the user interface based on the user clicking the cake event, and sends the multiple frames of images to the client. The client can now play the multiple frames of images of the cake flying out. Among them, the display interface for displaying the at least one frame of image and the playback interface are displayed in different layers of the client.

[0108] See also Figure 7 , is a flow chart of a method for creating an animation provided by an embodiment of the present invention, and the method for creating an animation can be applied to Figure 1 The communication system shown.

[0109] S701. When loading target animation data from a preset animation library, the server extracts animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters.

[0110] S702: The server generates an interactive object corresponding to each second element in the at least one second element.

[0111] S703: The server generates multiple frames of images according to the image frame parameters and position parameters of the at least one first element.

[0112] S704: The server creates an animation composed of the multiple frames of images, where the animation includes at least one second element, and the at least one second element corresponds one-to-one to the at least one first element.

[0113] S705: The client generates a trigger event and sends the trigger event to the server.

[0114] S706: After receiving the trigger event sent by the client, the server searches for an animation matching the trigger event and sends the animation to the client.

[0115] S707: The client plays the animation.

[0116] S708: The client generates an operation event and sends the operation event to the server.

[0117] Among them, the specific implementation method of steps S701 to S708 is the same as that of the above steps S401 to S408, which will not be repeated here.

[0118] S709. The server stores the interactive object corresponding to the target second element indicated by the element indication information in a memory.

[0119] In one embodiment, when the client sends an operation event, it carries the element indication information and sends it to the server. The element indication information is generated when the client listens to the operation of the target second element contained in any image frame of the animation through the interactive object corresponding to the target second element during the process of playing the animation. The server will generate a multi-frame image animation that does not contain the second element based on the time frame corresponding to the triggering operation event and the corresponding second element, and send the animation to the client, so that the client can subsequently play the multi-frame animation that does not contain the second element. At this time, since the animation played by the client does not contain the second element, the interactive object corresponding to the second element will not listen to the corresponding operation event, so the interactive object can be stored in the memory so that subsequent elements can be used, which is conducive to reducing the burden on the server.

[0120] Optionally, the memory may be a cache of the client, which only temporarily stores the interactive objects. The embodiment of the present invention does not limit the type of the memory.

[0121] Optionally, the element indication information may be generated by the client after the end image frame in which the target second element exists in the multi-frame image is played. The embodiment of the present invention does not limit the generation time of the element indication information.

[0122] S710. The server searches for a target interactive object from a memory, and a second element corresponding to the target interactive object matches any third element included in the at least one frame of image.

[0123] In one embodiment, the frame rate of the third element is the same as that of the second element. Since the user performs an operation event on the second element in the animation, any third element contained in the at least one frame of the generated image also has a corresponding relationship with the second element. In this case, the frame rates of the third element and the second element are consistent. Therefore. Since elements with different frame rates cannot use the same interactive object. The interactive object corresponding to the second element is generated based on the frame rate of the second element, and the frame rate of the third element and the second element is the same, the third element can select the interactive object of the second element.

[0124] Optionally, the interaction object corresponding to the third element may also be directly generated by the server without being obtained from the cache.

[0125] S711. The server determines that the interaction object corresponding to the third element is the target interaction object.

[0126] In one embodiment, at least one frame of image including the third element and the target interactive object is generated according to the operation event, and the position of the third element in the at least one frame of image is the same as the position of the target interactive object in the at least one frame of image. In this way, it is helpful to reduce the load of the server.

[0127] S712: The server generates at least one frame of image corresponding to the operation event, and sends the at least one frame of image to the client.

[0128] S713: The client displays the at least one frame of image.

[0129] Among them, the specific implementation methods of step S711 and step S712 are the same as those of the above-mentioned step S409 and step S410, and are not repeated here.

[0130] Based on the above animation creation method, the embodiment of the present invention provides a device for the animation creation method. Figure 8 , Figure 8 80 is a schematic diagram of the structure of an animation creation device provided by an embodiment of the present invention. The device 80 includes an acquisition unit 801 and a processing unit 802.

[0131] The acquisition unit 801 is used to extract animation parameters of at least one first element in the target animation data when the target animation data is loaded from the preset animation library, wherein the animation parameters include image frame parameters and position parameters;

[0132] The processing unit 802 is used to generate multiple frames of images according to the image frame parameters and position parameters of the at least one first element;

[0133] The processing unit 802 is further configured to create an animation composed of the multiple frames of images, wherein the animation includes at least one second element, and the at least one second element corresponds one-to-one to the at least one first element.

[0134] In one embodiment, when generating multiple frames of images based on the image frame parameters and position parameters of the at least one first element, the processing unit 802 is used to: determine, based on the image frame parameters of each first element in the at least one first element, a target image frame in which a second element corresponding to each first element exists in the multiple frames of images, and the target image frame includes at least two frames of images; determine, based on the position parameters of each first element, a position of each second element in each target image frame; and generate the multiple frames of images based on the position of each second element in each target image frame.

[0135] In one embodiment, the image frame parameters include start key frame information, end key frame information and frame rate, and the target image frame includes a start image frame, an end image frame and an intermediate image frame;

[0136] When determining, based on the image frame parameters of each first element in the at least one first element, that the second element corresponding to each first element exists in the target image frame in the multi-frame image, the processing unit 802 is used to: determine, based on the starting key frame information of each first element in the at least one first element, the starting image frame in which the each second element exists in the multi-frame image; determine, based on the ending key frame information of each first element, the ending image frame in which the each second element exists in the multi-frame image; and determine, based on the frame rate of each first element, an intermediate image frame in which the each second element exists in the multi-frame image, the intermediate image frame being located between the starting image frame and the ending image frame.

[0137] In one embodiment, the location parameters include coordinate information;

[0138] When determining the position of each second element in each target image frame based on the position parameters of each first element, the processing unit 802 is used to: determine the position of each second element in each target image frame based on the coordinate information of each first element and the number of the target image frames.

[0139] In one embodiment, the position parameters also include posture information;

[0140] When determining the positions of the second elements in each target image frame based on the coordinate information of the first elements and the number of the target image frames, the processing unit 802 is used to: determine the posture information of the second elements in each target image frame based on the posture information of the first elements and the number of the target image frames; and generate the multi-frame image based on the positions and posture information of the second elements in each target image frame.

[0141] In one embodiment, the multi-frame images include the respective second elements and the interactive objects corresponding to the respective second elements, and the positions of the respective second elements in the multi-frame images are the same as the positions of the interactive objects corresponding to the respective second elements in the multi-frame images;

[0142] The device also includes a communication unit 803: the communication unit 803 is used to, after the processing unit 802 creates the animation composed of the multiple frames of images, when receiving a trigger event sent by the client, search for an animation matching the trigger event and send the animation to the client, the trigger event being generated when the client detects an operation on the user interface; the communication unit 803 is used to, after the processing unit 802 is used to create the animation composed of the multiple frames of images, receive an operation event sent by the client, the operation event being generated when the client listens to an operation on the second element included in any image frame in the animation through an interactive object corresponding to any second element during the process of playing the animation; the processing unit 802 is also used to generate at least one frame of image corresponding to the operation event; the processing unit 802 is used to, after the processing unit 802 is used to create the animation composed of the multiple frames of images, send the at least one frame of image to the client so that the client displays the at least one frame of image.

[0143] In one embodiment, the processing unit 802 is also used to: generate interactive objects corresponding to each second element in the at least one second element before generating multiple frames of images based on the image frame parameters and position parameters of the at least one first element; and generate multiple frames of images including the each second element and the interactive objects corresponding to the each second element based on the image frame parameters and position parameters of the at least one first element.

[0144] In one embodiment, the playback interface for playing the animation and the user interface are displayed in different layers of the client, and the display interface for displaying the at least one frame of image and the playback interface are displayed in different layers of the client.

[0145] In one embodiment, the processing unit 802 is further used to: before generating at least one frame of image corresponding to the operation event, search for a target interactive object from a memory, wherein a second element corresponding to the target interactive object matches any third element contained in the at least one frame of image; determine that the interactive object corresponding to the third element is the target interactive object; and generate at least one frame of image including the third element and the target interactive object according to the operation event, wherein a position of the third element in the at least one frame of image is the same as a position of the target interactive object in the at least one frame of image.

[0146] In one embodiment, the processing unit 802 is also used to: before searching for the target interactive object from the memory, upon receiving element indication information sent by the client, store the interactive object corresponding to the target second element indicated by the element indication information in the memory, wherein the element indication information is generated when the client monitors the operation of the target second element contained in any image frame of the animation through the interactive object corresponding to the target second element during the process of playing the animation.

[0147] According to one embodiment of the present invention, Figure 2 , Figure 4 and Figure 7 The steps involved in the animation creation method shown in the figure can be performed by the server as the execution subject. Figure 8 The various units in the device 80 shown are executed. For example, Figure 2 The step S201 can be performed by Figure 8 The acquisition unit 801 in the device 80 shown in FIG. 8 is executed, and steps S202 and S203 can be performed by Figure 8 The processing unit 802 in the device 80 shown is executed.

[0148] According to another embodiment of the present invention, Figure 8 The various units in the device 80 shown can be separately or all combined into one or several other units to form, or one (some) of the units can be further divided into multiple smaller units in function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present invention, the device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0149] According to another embodiment of the present invention, the program can be executed by running a program on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 , Figure 4 and Figure 7 A computer program (including program code) for each step involved in the corresponding method shown in FIG. Figure 8 The computer program can be recorded on a computer storage medium, for example, and loaded into the computing device through the computer storage medium, and run therein.

[0150] Based on the above-mentioned embodiment of the animation creation method, the embodiment of the present invention provides a server. Fig. 9 , is a structural diagram of a server provided by an embodiment of the present invention.

[0151] The server 90 includes at least one processor 901, which is used to implement the animation creation method of the server in the method provided in the embodiment of the present application. The processor 901 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, operations and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The operation of the method disclosed in the embodiment of the present application can be directly embodied as a hardware processor execution, or it can be executed by a combination of hardware and software modules in the processor.

[0152] The server 90 may also include an input interface 902 and an output interface 903, which are used to implement the sending and receiving operations of the server in the method provided in the embodiment of the present application. In the embodiment of the present application, the input interface 902 and the output interface 903 may be a transceiver, circuit, bus, module or other type of communication interface, which is used to communicate with other devices through a transmission medium. The processor 901 uses the input interface 902 and the output interface 903 to send and receive data, and is used to implement the above method embodiment. Figure 2 , Figure 4 and Figure 7 The method described.

[0153] The server 90 may also include at least one memory 905 for storing program instructions and / or data. The processor 901 may operate in conjunction with the memory 905. The processor 901 may execute program instructions stored in the memory 905. At least one of the at least one memory may be included in the processor. In one embodiment, the computer storage medium 904 may be loaded by the processor 901 and execute one or more instructions stored in the computer storage medium to implement the above-mentioned related Figure 2 , Figure 4 and Figure 7 The corresponding steps in the animation creation method shown in FIG. 1 are performed by the server. In a specific implementation, one or more instructions in the computer storage medium are loaded by the processor 901 and the following steps are performed:

[0154] When loading target animation data from a preset animation library, extract animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters; generate multiple frames of images based on the image frame parameters and position parameters of the at least one first element; create an animation composed of the multiple frames of images, wherein the animation includes at least one second element, and the at least one second element corresponds one-to-one to the at least one first element.

[0155] In one embodiment, when the processor 901 generates multiple frames of images based on the image frame parameters and position parameters of the at least one first element, it is specifically used to perform the following steps: according to the image frame parameters of each first element in the at least one first element, determine the target image frame in which the second element corresponding to each first element exists in the multiple frames of images, and the target image frame includes at least two frames of images; the processor 901 determines the position of each second element in each target image frame based on the position parameters of each first element; the processor 901 generates the multiple frames of images based on the position of each second element in each target image frame.

[0156] In one embodiment, the image frame parameters include start key frame information, end key frame information and frame rate, and the target image frame includes a start image frame, an end image frame and an intermediate image frame;

[0157] When the processor 901 determines, based on the image frame parameters of each first element in the at least one first element, that the second element corresponding to each first element exists in the target image frame in the multi-frame image, the processor 901 is specifically used to perform the following steps: determining, based on the starting key frame information of each first element in the at least one first element, the starting image frame in the multi-frame image in which the second element exists; the processor 901 determines, based on the ending key frame information of each first element, the ending image frame in which the second element exists in the multi-frame image; the processor 901 determines, based on the frame rate of each first element, an intermediate image frame in the multi-frame image in which the second element exists, and the intermediate image frame is located between the starting image frame and the ending image frame.

[0158] In one embodiment, the location parameters also include coordinate information;

[0159] When the processor 901 determines the position of each second element in each target image frame based on the position parameters of each first element, it is specifically used to perform the following steps: determine the position of each second element in each target image frame based on the coordinate information of each first element and the number of the target image frames.

[0160] In one embodiment, the position parameters also include posture information;

[0161] When the processor 901 determines the position of each second element in each target image frame based on the coordinate information of each first element and the number of the target image frames, it is specifically used to perform the following steps: determine the posture information of each second element in each target image frame based on the posture information of each first element and the number of the target image frames; the processor 901 generates the multi-frame image based on the position and posture information of each second element in each target image frame.

[0162] In one embodiment, the multi-frame images include the respective second elements and the interactive objects corresponding to the respective second elements, and the positions of the respective second elements in the multi-frame images are the same as the positions of the interactive objects corresponding to the respective second elements in the multi-frame images;

[0163] After creating the animation composed of the multiple frames of images, the processor 901 is further used to perform the following steps: when receiving a trigger event sent by the client, searching for an animation matching the trigger event and sending the animation to the client, the trigger event is generated by the client when detecting an operation on the user interface; the processor 901 receives an operation event sent by the client, the operation event is generated when the client listens to an operation on the second element included in any image frame of the animation through an interactive object corresponding to any second element during the process of playing the animation; the processor 901 generates at least one frame of image corresponding to the operation event; the processor 901 sends the at least one frame of image to the client so that the client displays the at least one frame of image.

[0164] In one embodiment, before generating multiple frames of images based on the image frame parameters and position parameters of the at least one first element, the processor 901 is also used to perform the following steps: generating interactive objects corresponding to each second element in the at least one second element; the processor 901 generates multiple frames of images including each second element and the interactive objects corresponding to each second element based on the image frame parameters and position parameters of the at least one first element.

[0165] In one embodiment, the playback interface for playing the animation and the user interface are displayed in different layers of the client, and the display interface for displaying the at least one frame of image and the playback interface are displayed in different layers of the client.

[0166] In one embodiment, before generating at least one frame of image corresponding to the operation event, the processor 901 is further used to perform the following steps: searching for a target interactive object from a memory, wherein a second element corresponding to the target interactive object matches any third element contained in the at least one frame of image; determining that the interactive object corresponding to the third element is the target interactive object; and the processor 901 generates, based on the operation event, at least one frame of image including the third element and the target interactive object, wherein a position of the third element in the at least one frame of image is the same as a position of the target interactive object in the at least one frame of image.

[0167] In one embodiment, before searching for the target interactive object from the memory, the processor 901 is further used to perform the following steps: when element indication information sent by the client is received, the interactive object corresponding to the target second element indicated by the element indication information is stored in the memory, and the element indication information is generated when the client monitors the operation of the target second element contained in any image frame of the animation through the interactive object corresponding to the target second element during the process of playing the animation.

[0168] The embodiment of the present invention also provides a computer storage medium (Memory), which is a memory device in the server for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the server and the extended storage medium supported by the server. The computer storage medium provides a storage space, which stores the operating system of the server. In addition, one or more instructions suitable for being loaded and executed by the processor 901 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.

[0169] Those of ordinary skill in the art will appreciate that the units and steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0170] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer storage medium or transmitted through a computer storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0171] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for creating an animation, characterized in that: The method comprises: When loading target animation data from a preset animation library, extracting animation parameters of at least one first element in the target animation data, wherein the animation parameters include image frame parameters and position parameters; Generate multiple frames of images according to the image frame parameters and position parameters of the at least one first element; Creating an animation composed of the multiple frames of images, the animation comprising at least one second element, the at least one second element corresponding one-to-one to the at least one first element; The position parameter includes coordinate information and posture information, and the step of generating multiple frames of images according to the image frame parameter and the position parameter of the at least one first element includes: According to the image frame parameters of each first element in the at least one first element, determining a target image frame in the multiple image frames where a second element corresponding to each first element exists, the target image frame including at least two image frames; Determining the position of each of the second elements in each of the target image frames according to the coordinate information of each of the first elements and the number of the target image frames; Determining, according to the posture information of each first element and the number of the target image frames, the posture information of each second element in each target image frame; The multiple frames of images are generated according to the position and posture information of each second element in each target image frame.

2. The method according to claim 1, characterized in that: The image frame parameters include starting key frame information, ending key frame information and frame rate, and the target image frame includes starting image frame, ending image frame and intermediate image frame; The step of determining, based on the image frame parameters of each first element in the at least one first element, that the second element corresponding to each first element exists in the target image frame in the multiple image frames comprises: Determine, according to the starting key frame information of each first element in the at least one first element, a starting image frame in which each second element exists in the multiple image frames; Determining, according to the ending key frame information of each first element, an ending image frame in which each second element exists in the multiple image frames; According to the frame rates of the first elements, it is determined that the second elements exist in intermediate image frames in the multiple image frames, and the intermediate image frames are located between the start image frame and the end image frame.

3. The method according to claim 1, characterized in that The multiple frames of images include the respective second elements and the interactive objects corresponding to the respective second elements, and the positions of the respective second elements in the multiple frames of images are the same as the positions of the interactive objects corresponding to the respective second elements in the multiple frames of images; After creating the animation composed of the multiple frames of images, the method further includes: Upon receiving a trigger event sent by a client, searching for an animation matching the trigger event and sending the animation to the client, wherein the trigger event is generated by the client when an operation on a user interface is detected; receiving an operation event sent by the client, where the operation event is generated when the client monitors an operation on the second element included in any image frame in the animation through an interactive object corresponding to any second element during the process of playing the animation; Generating at least one frame of image corresponding to the operation event; The at least one frame of image is sent to the client, so that the client displays the at least one frame of image.

4. The method according to claim 3, characterized in that Before generating multiple frames of images according to the image frame parameters and position parameters of the at least one first element, the method further includes: generating an interactive object corresponding to each second element in the at least one second element; The step of generating multiple frames of images according to the image frame parameters and position parameters of the at least one first element comprises: A plurality of frames of images including the respective second elements and the interactive objects corresponding to the respective second elements are generated according to the image frame parameters and the position parameters of the at least one first element.

5. The method according to claim 3, characterized in that: The playback interface for playing the animation and the user interface are displayed in different layers of the client, and the display interface for displaying the at least one frame of image and the playback interface are displayed in different layers of the client.

6. The method according to claim 3, characterized in that Before generating at least one frame of image corresponding to the operation event, the method further includes: Searching for a target interactive object from a memory, wherein a second element corresponding to the target interactive object matches any third element included in the at least one frame of image; Determining the interaction object corresponding to the third element as the target interaction object; The generating at least one frame of image corresponding to the operation event includes: At least one frame of image including the third element and the target interactive object is generated according to the operation event, and a position of the third element in the at least one frame of image is the same as a position of the target interactive object in the at least one frame of image.

7. The method according to claim 6, characterized in that Before searching the target interactive object from the memory, the method further includes: When element indication information sent by the client is received, the interactive object corresponding to the target second element indicated by the element indication information is stored in the memory. The element indication information is generated when the client monitors the operation of the target second element contained in any image frame in the animation through the interactive object corresponding to the target second element during the process of playing the animation.

8. A device for creating animation, characterized in that: The device comprises an acquisition unit and a processing unit: The acquisition unit is used to extract animation parameters of at least one first element in the target animation data when the target animation data is loaded from the preset animation library, wherein the animation parameters include image frame parameters and position parameters; The processing unit is used to generate multiple frames of images according to the image frame parameters and position parameters of the at least one first element; The processing unit is further used to create an animation composed of the multiple frames of images, wherein the animation includes at least one second element, and the at least one second element corresponds to the at least one first element in a one-to-one manner; Wherein, when generating multiple frames of images according to the image frame parameters and position parameters of the at least one first element, the processing unit is used to: determine, according to the image frame parameters of each first element in the at least one first element, a target image frame in which a second element corresponding to each first element exists in the multiple frames of images, wherein the target image frame includes at least two frames of images; determine, according to the position parameters of each first element, a position of each second element in each target image frame; and generate the multiple frames of images according to the position of each second element in each target image frame; Wherein, the position parameters include coordinate information and posture information; when the processing unit determines the position of each second element in each target image frame according to the position parameters of each first element, it is used to: determine the position of each second element in each target image frame according to the coordinate information of each first element and the number of the target image frames, and determine the posture information of each second element in each target image frame according to the posture information of each first element and the number of the target image frames; generate the multi-frame image according to the position and posture information of each second element in each target image frame.

9. A computer storage medium, characterized in that The computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded and executed by a processor to implement the steps of the method according to any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • An animation resource configuration method and device

    CN109725948A

  • Resource data display method and device, storage medium and terminal

    CN111198676A