Animation playback method, device, electronic device and storage medium

By executing animations in the order of dequeuing in the animation playback task queue, the problem of the later animation interrupting the previous animation during animation playback is solved, and the dynamic playback effect and user experience of the animation are improved.

CN113157366BActive Publication Date: 2024-10-25BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110358401.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-01
Publication Date
2024-10-25
Estimated Expiration
2041-04-01

AI Technical Summary

Technical Problem

In the existing technology, the animation playback task immediately executes the next animation when the previous animation is not completed, causing the latter animation to interrupt the playback process of the previous animation and affecting the user's viewing experience.

Method used

By detecting animation triggering events, create animation playback tasks and insert them into the task queue of the current page, and execute each animation playback task in sequence according to the dequeue order of the task queue, ensuring that the next animation is played after the previous animation is played.

Benefits of technology

It effectively avoids the interruption of animation playback, presents a sequential and orderly animation playback effect, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113157366B_ABST
    Figure CN113157366B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an animation playback method, device, electronic device, and storage medium. The method includes: detecting an animation triggering event, the animation triggering event is used to trigger the playback of an animation for a display object in the current page; creating an animation playback task according to the animation triggering event, and inserting the animation playback task into the corresponding position in the task queue corresponding to the current page according to the task type; executing each animation playback task in the task queue in sequence according to the dequeueing order of the task queue, so as to play the animations corresponding to each animation playback task in the current page in sequence according to the dequeueing order. Through this solution, the timing conflicts between the animations played by the client can be avoided, and the latter animation will not interrupt the playback process of the previous animation, which helps to improve the animation playback quality and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of animation playback, and in particular to an animation playback method, device, electronic device and storage medium. Background Art

[0002] When the client of an application displays an object on a page to the user, it usually provides an animation function, that is, when the display state of an object changes, the client plays an animation related to the object (i.e., dynamic special effects) to present the dynamic change effect of the object. For example, for an application with an instant messaging function, its session list page usually displays multiple sessions. When an animation triggering event such as a user operation to delete a session, or a new session or updating the session display position is detected due to receiving data sent by the server, a corresponding animation playback task will be created for the animation triggering event, and the corresponding animation will be displayed on the session list page.

[0003] In the related art, after creating a playback task for any animation, the client will immediately execute the task to control the playback of the corresponding animation. However, if the playback task of the next animation is started before the previous animation playback task is completed, the playback of the next animation will often interrupt the playback of the previous animation, thereby affecting the complete playback effect of the previous animation and further affecting the user's viewing experience. Summary of the invention

[0004] The present disclosure provides an animation playback method, device, electronic device, and storage medium to at least solve the technical problems in the related art. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a method for playing an animation is provided, comprising:

[0006] An animation triggering event is detected, where the animation triggering event is used to trigger the playing of an animation for a display object in the current page;

[0007] Creating an animation play task according to the animation triggering event, and inserting the animation play task into a corresponding position in the task queue corresponding to the current page according to the task type;

[0008] The animation playing tasks in the task queue are executed in sequence according to the dequeuing order of the task queue, so that the animations corresponding to the animation playing tasks are played in sequence in the current page according to the dequeuing order.

[0009] Optionally, the detecting of the animation triggering event includes:

[0010] receiving a data update message for the display object sent by the server; or,

[0011] An animation triggering operation performed by a user on the display object in the current page is detected.

[0012] Optionally, creating an animation play task according to the animation triggering event, and inserting the animation play task into a corresponding position in the task queue corresponding to the current page according to the task type, includes:

[0013] Creating an independent playback task according to the animation triggering event, and determining the animation type corresponding to the independent playback task;

[0014] When the animation type corresponding to the independent playback task is different from the animation type corresponding to the animation playback task in the task queue, the independent playback task is inserted into the tail of the task queue, which is the last one in the dequeue order at the current moment.

[0015] Optionally, executing the independent playback task includes:

[0016] The animation corresponding to the independent playback task is played in the current page.

[0017] Optionally, also include:

[0018] When the independent playback task is created, the to-be-updated data corresponding to the independent playback task is stored in an independent array.

[0019] Optionally, also include:

[0020] When the independent play task is executed, the object data of the display object corresponding to the independent play task is updated using the data to be updated in the independent array.

[0021] Optionally, creating an animation play task according to the animation triggering event, and inserting the animation play task into a corresponding position in the task queue corresponding to the current page according to the task type, includes:

[0022] Creating an independent playback task according to the animation triggering event, and determining the animation type corresponding to the independent playback task;

[0023] In the case that there is a similar playback task corresponding to the same animation type as the independent playback task in the task queue, merging the independent playback task with the similar playback task to obtain a composite playback task;

[0024] The composite playback task is used to replace the same type of playback tasks in the task queue.

[0025] Optionally, executing the composite playback task includes:

[0026] Multiple animations corresponding to the composite playback task are played simultaneously in the current page.

[0027] Optionally, also include:

[0028] When the composite playback task is obtained by merging, the independent array corresponding to the independent playback task and the task array corresponding to the same type of playback task are spliced ​​into a composite array, wherein the independent array records the data to be updated corresponding to the independent playback task, and the task array records the data to be updated corresponding to the same type of playback task.

[0029] Optionally, also include:

[0030] When the composite playback task is executed, each to-be-updated data in the composite array is used to update the object data of each display object corresponding to the composite playback task.

[0031] Optionally, the same type of playback tasks are independent playback tasks or compound playback tasks.

[0032] Optional,

[0033] The task queue is created during the generation phase of the current page; or,

[0034] The task queue is created during the startup phase of the application to which the current page belongs.

[0035] According to a second aspect of an embodiment of the present disclosure, an animation playback device is provided, comprising:

[0036] A detection unit, configured to detect an animation triggering event, wherein the animation triggering event is used to trigger the playing of an animation for a display object in a current page;

[0037] A creating unit, configured to create an animation playing task according to the animation triggering event, and insert the animation playing task into a corresponding position in the task queue corresponding to the current page according to the task type;

[0038] The playing unit is configured to execute the animation playing tasks in the task queue in sequence according to the dequeuing order of the task queue, so as to play the animations corresponding to the animation playing tasks in sequence in the current page according to the dequeuing order.

[0039] Optionally, the detection unit is further configured to:

[0040] receiving a data update message for the display object sent by the server; or,

[0041] An animation triggering operation performed by a user on the display object in the current page is detected.

[0042] Optionally, the creation unit is further configured to:

[0043] Creating an independent playback task according to the animation triggering event, and determining the animation type corresponding to the independent playback task;

[0044] When the animation type corresponding to the independent playback task is different from the animation type corresponding to the animation playback task in the task queue, the independent playback task is inserted into the tail of the task queue, which is the last one in the dequeue order at the current moment.

[0045] Optionally, the playback unit is further configured to:

[0046] The animation corresponding to the independent playback task is played in the current page.

[0047] Optionally, also include:

[0048] The independent saving unit is configured to save the to-be-updated data corresponding to the independent playing task in an independent array when the independent playing task is created.

[0049] Optionally, also include:

[0050] The independent updating unit is configured to update the object data of the display object corresponding to the independent playing task using the to-be-updated data in the independent array when executing the independent playing task.

[0051] Optionally, the creation unit is further configured to:

[0052] Creating an independent playback task according to the animation triggering event, and determining the animation type corresponding to the independent playback task;

[0053] In the case that there is a similar playback task corresponding to the same animation type as the independent playback task in the task queue, merging the independent playback task with the similar playback task to obtain a composite playback task;

[0054] The composite playback task is used to replace the same type of playback tasks in the task queue.

[0055] Optionally, the playback unit is further configured to:

[0056] Multiple animations corresponding to the composite playback task are played simultaneously in the current page.

[0057] Optionally, also include:

[0058] The array splicing unit is configured to splice the independent array corresponding to the independent playback task and the task array corresponding to the same type of playback task into a composite array when the composite playback task is merged, wherein the independent array records the data to be updated corresponding to the independent playback task, and the task array records the data to be updated corresponding to the same type of playback task.

[0059] Optionally, also include:

[0060] The composite updating unit is configured to respectively update the object data of each display object corresponding to the composite playing task using each to-be-updated data in the composite array when executing the composite playing task.

[0061] Optionally, the same type of playback tasks are independent playback tasks or compound playback tasks.

[0062] Optional,

[0063] The task queue is created during the generation phase of the current page; or,

[0064] The task queue is created during the startup phase of the application to which the current page belongs.

[0065] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including:

[0066] processor;

[0067] a memory for storing instructions executable by the processor;

[0068] Wherein, the processor is configured to execute the instructions to implement the animation playback method as described in any embodiment of the first aspect above.

[0069] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is proposed. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the animation playback method described in any embodiment of the first aspect above.

[0070] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program and / or instructions, wherein when the computer program and / or instructions are executed by a processor, the animation playback method described in any one of the embodiments of the first aspect is implemented.

[0071] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0072] According to the embodiments of the present disclosure, after creating an animation playback task corresponding to an animation triggering event, the task will be inserted into the corresponding position of the task queue corresponding to the current page according to the task type, and then the various animation playback tasks will be executed in sequence according to the inherent dequeueing order of the task queue itself, so that the corresponding animations will be displayed in sequence in the current page according to the display order. It can be seen that in this scheme, the next animation will be displayed only after the previous animation is finished, so that the next animation can be prevented from interrupting the playback process of the previous animation, presenting the playback effect of playing each animation in sequence and in an orderly manner, effectively improving the dynamic playback effect of the animation, and thus helping to improve the user experience.

[0073] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] The drawings herein are incorporated into the specification and constitute a part of the present disclosure, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0075] Figure 1 This is a schematic diagram of a conversation list page provided by an exemplary embodiment;

[0076] Figure 2 is a schematic diagram of the architecture of an animation playback system provided by an exemplary embodiment;

[0077] Figure 3 is a flow chart of an animation playing method according to an embodiment of the present disclosure;

[0078] Figure 4 is a flowchart of another animation playing method according to an embodiment of the present disclosure;

[0079] Figure 5 is a schematic diagram of a task queue according to an embodiment of the present disclosure;

[0080] Figure 6 is a schematic diagram of an animation effect in a conversation list page according to an embodiment of the present disclosure;

[0081] Figure 7 is another task queue schematic diagram according to an embodiment of the present disclosure;

[0082] Figure 8 is a schematic diagram of another animation effect in a conversation list page according to an embodiment of the present disclosure;

[0083] Fig. 9 is a schematic block diagram of an animation playback device according to an embodiment of the present disclosure;

[0084] Fig.10 is a structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0085] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0086] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0087] When the client of an application displays an object on a page to the user, it usually provides an animation function, that is, when the display state of an object changes, the client plays an animation related to the object (i.e., dynamic special effects) to present the dynamic change effect of the object. For example, for an application with an instant messaging function, its session list page usually displays multiple sessions. When an animation triggering event such as a user operation to delete a session, or receiving data sent by the server to add a session, or updating the session display position, is detected, a corresponding animation playback task will be created for the animation triggering event, and then the corresponding animation will be played on the session list page.

[0088] like Figure 1As shown, an application with an instant messaging function is running in the client, and in the session list page of the application, four sessions are displayed: session A, session B, session C, and session D. Any session includes a session name 101 (such as session name "A"), the latest session message 102 (such as the last message of session B: "I know, thank you~" sent by Xiaobai), the sending or receiving time 103 of the last session message (such as the time "just now" when the client in session A - actually the user account logged in by the client - sent the last session message), and may also include the number of unread messages 104 (such as "2" in session B). Among them, the above-mentioned sessions are displayed in the order of the sending time or receiving time corresponding to the last session message in the session: the later the time corresponding to the last message in a session, the higher the session is displayed; conversely, the earlier the time corresponding to the last message in a session, the lower the session is displayed. In addition, the "last session message" of any session involved in the present disclosure is a session message sent or received by the client in the session that is closest to the current moment, which is hereby explained.

[0089] At this time, if the user performs a deletion operation on the page such as swiping left, long pressing and clicking "delete" for session C, the client can create a deletion task in response to the operation and execute the task to delete session C. In order to make the display effect presented during the deletion process smoother and more realistic, the client will play a corresponding animation (hereinafter referred to as deletion animation) at the display position of session C when deleting session C. Alternatively, after the client receives the first session message of the new session E sent by the server, it can create a session insertion task in response to the message, so that a new session "session E" is displayed below session D when the task is executed, and a corresponding animation (hereinafter referred to as insertion animation) is played during the display process, thereby forming the effect of inserting session E in the session list, making the dynamic process of session E from nothing to something more realistic and beautiful.

[0090] In the related art, after the client creates a playback task for any animation, it will immediately execute the task to control the playback of the corresponding animation. Taking the above-mentioned deletion and insertion animation as an example, assuming that the duration of the deletion animation played by the client is 0.5s, during the playback of the animation (i.e., within 0.5s after the start of playback), if the client receives the first session message for the new session E sent by the server, it will immediately execute the task after creating the insertion task, so that the insertion animation will start to play before the deletion animation is finished. As a result, the insertion animation played later will interrupt the deletion animation being played, resulting in the inability to fully play the deletion animation, so that the display process of the animation corresponding to the deletion operation implemented by the user is forced to be interrupted, resulting in an intermittent animation playback effect, which seriously affects the user's viewing experience.

[0091] It can be seen that the above problems exist in the related technology precisely because the animation playing task is not controlled in time sequence and the task is executed immediately after it is created. To solve this problem, the present invention proposes an animation playing method, which inserts the animation playing task into the task queue corresponding to the current page, and uses the "First In First Out (FIFO)" inherent characteristic of the task queue to realize the sequential and orderly execution of each task queue, thereby ensuring that each animation is executed in the order of task creation, and effectively avoiding the situation where the latter animation in the adjacent animation interrupts the previous animation playback process.

[0092] Figure 2 FIG. 1 is a schematic diagram of the architecture of an animation playback system provided by an exemplary embodiment. Figure 2 As shown, the system may include a network 20, a server 21, and several electronic devices, such as a mobile phone 22, a mobile phone 23, and a mobile phone 24.

[0093] The server 21 may be a physical server including an independent host, or the server 21 may be a virtual server carried by a host cluster. During operation, the server 21 may run a program on the server side of a certain application to implement the relevant business functions of the application. For example, when the server 21 runs an application with an object display function, it may be implemented as a server corresponding to the application. In the technical solution of one or more embodiments of the present disclosure, the server 21 may cooperate with the client running on the mobile phones 22-24 to implement the animation playback solution during the object display process.

[0094] In this embodiment, the application with object display function can not only realize object display and animation playback functions, but also serve as an integrated functional platform for many other functions, such as generation of display pages, creation of task queues, detection of animation trigger events, creation and merging of playback tasks, determination of data to be updated, determination of animation types, updating of task data, etc. One or more embodiments of the present disclosure are not limited to this.

[0095] Mobile phones 22-24 are just one type of electronic device that users can use. In fact, users can obviously also use electronic devices such as the following types: tablet devices, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc., and one or more embodiments of the present disclosure do not limit this. During operation, the electronic device can run a program on the client side of an application to implement the relevant business functions of the application. For example, when the electronic device runs an application with an object display function, it can be implemented as a client of the application. For example, mobile phone 22 can be implemented as a live broadcast client, and mobile phones 23 and 24 can be implemented as audience clients. Each of the above clients has object display and animation playback functions.

[0096] It should be pointed out that the above-mentioned client application can be pre-installed on the electronic device so that the client can be started and run on the electronic device; of course, when an online "client" such as HTML5 technology is adopted, there is no need to install the corresponding application on the electronic device to obtain and run the client.

[0097] The network 20 may include various types of wired or wireless networks.

[0098] Figure 3 FIG. 1 is a flowchart of an animation playing method shown in an exemplary embodiment of the present disclosure. Figure 3 As shown, the method is applied to the client and may include the following steps:

[0099] Step 302: An animation triggering event is detected, where the animation triggering event is used to trigger the playing of an animation for a display object in the current page.

[0100] In this embodiment, a client having an application with object display function and animation playback function may run in the terminal device, and the client may generate and display a variety of display pages, wherein the display page displayed by the client at the current moment is the current page.

[0101] In this embodiment, the client can create a task queue corresponding to the current page in a variety of ways for use in subsequent steps. As an exemplary embodiment, the client can create a task queue for the current page during the generation phase of the current page. Accordingly, when the current page is closed, the client can delete the task queue accordingly to reclaim resources such as memory space occupied by the task queue. It can be seen that the task queue corresponding to the current page has the same life cycle as the page. In fact, for any display page displayed by the client, it may contain display objects corresponding to animations such as pictures, conversations, and texts. Of course, the current page displayed by the client at any time may not contain display objects corresponding to animations, such as the default startup page of an application, and the present embodiment does not limit this. However, it should be noted that the animation playback method described in the present embodiment is only applied to pages containing the above-mentioned display objects, so the client can determine whether the page contains the above-mentioned display objects according to the page data of the page before generating any page or during the generation of any page: if it is determined to be included, further create a task queue corresponding to the display page; otherwise, if it is not included, terminate the creation of the task queue. Because for the display page that does not contain the above-mentioned task objects, the animation trigger event will not be detected (or even if the animation trigger event is detected, the corresponding animation will not be played), so pre-judgment is performed before creating the task queue, which effectively avoids the invalid creation of the task queue, which not only saves related resources, but also helps to improve the display efficiency of the display page.

[0102] As another exemplary embodiment, since the client application usually displays multiple display pages continuously during operation (i.e., switches between different display pages), in order to avoid repeated processing caused by frequent creation and destruction of task queues when display pages are switched, a task queue for the application can also be created during the startup phase of the application. The queue is used to save the animation playing tasks generated in all display pages displayed by the application client. When any display page is in the display state, the animation playing tasks generated in the display page are inserted into and executed in the task queue, and the task queue is cleared when the display page is closed. It can be seen that at this time, all display pages displayed by the client "time-share multiplex" the task queue, which improves the management efficiency of the task queue to a certain extent.

[0103] In the process of displaying the current page, the client may detect an animation triggering event, which is used to trigger the client to play an animation for a display object in the current page. The above-mentioned animation triggering event may come from the server or the user. For example, the client may determine that an animation triggering event has been detected when receiving a data update message for a display object sent by the server. The above-mentioned data update message may include a data addition message and / or a data deletion message, wherein the data addition message may be used to instruct the client to add data for a display object in the current page, and the data deletion message may be used to instruct the client to delete the existing data of the display object in the current page. Through the above-mentioned data update message, the client can play the animation corresponding to the server data update in the current page, thereby realizing the timely update of the client display content.

[0104] For another example, the client may also determine that an animation trigger event has been detected when it detects that the user has performed an animation trigger operation on a display object in the current page. The animation trigger operation may be a deletion operation performed by the user on the existing data of the display object, or may be a move operation performed on the display object. Any of the operations may be in the form of a single click, a double click, a left swipe, a two-finger slide, etc. The disclosed embodiment does not limit the specific form of the animation trigger operation performed by the user. The client responds to the animation trigger operation, which helps to display the animation in response to the user operation in the current page, improves the interactive effect of the animation playback, and further helps to improve the user's operating experience.

[0105] Step 304: Create an animation play task according to the animation triggering event, and insert the animation play task into a corresponding position in the task queue corresponding to the current page according to the task type.

[0106] Step 306 , executing the animation playing tasks in the task queue in sequence according to the dequeuing order of the task queue, so as to play the animations corresponding to the animation playing tasks in sequence in the current page in the dequeuing order.

[0107] In this embodiment, after the client detects the aforementioned animation triggering event, it creates an animation playing task according to the animation triggering event and inserts it into the aforementioned task queue that has been created. Among them, in the process of displaying the current page, the moment when the client detects the animation triggering event is random, so the client can create an animation playing task and insert it into the task queue for any animation triggering event detected. It should also be noted that "generating and inserting the animation playing task into the task queue" and "executing each animation playing task in the task queue in sequence" can be performed asynchronously, that is, while executing the animation playing task at the head of the task queue, a new animation playing task can be generated and inserted into the tail of the task queue. Moreover, "playing each animation in sequence" mentioned in this embodiment should be understood as playing the animations corresponding to each animation playing task in the task queue in sequence according to the chronological order; that is, the closer the animation playing task is to the head of the task queue (i.e., the first in the dequeueing order), the earlier the corresponding animation is played in time, so that the playing order of the animation corresponds to the arrangement order of the animation playing tasks in the queue, which is the dequeueing order determined by the FIFO characteristics of the task queue itself. Moreover, for two adjacent animations, the latter animation starts playing only after the former animation is finished playing, that is, the playing time intervals of the two animations do not overlap.

[0108] In addition, the process of the client executing each animation playback task in the task queue in sequence is the process of taking out the animation playback task at the head of the task queue in sequence and executing it, thereby ensuring that each animation playback task in the task queue is taken out from the head of the queue in sequence based on the FIFO mechanism of the queue.

[0109] The client can create different types of animation playback tasks in a variety of ways, and then insert the created animation playback tasks into the corresponding positions in the task queue according to the task type. Among them, according to the different ways of generating tasks, the task types involved in the embodiment of the present disclosure are divided into independent playback tasks and compound playback tasks: independent playback tasks are created according to one animation triggering event, while compound playback tasks are merged according to multiple independent playback tasks (which can be considered to be created according to multiple animation triggering events).

[0110] In one embodiment, the client can create an independent play task according to the detected animation trigger event, and then insert the independent play task into the tail of the task queue, wherein the above-mentioned "tail" is the last one of the above-mentioned dequeue order at the current moment. It is understandable that, since the animation play tasks inserted in the task queue will be taken out for execution, the number of tasks in the task queue is not fixed; and because the dequeue order of the task queue is determined, the position of the last animation play task inserted in the task queue at any time is also not fixed, and thus the position of the tail of the task queue is also variable. Under the above-mentioned insertion mode, the animation play tasks generated at different times (according to the animation trigger event) are all inserted into the tail of the task queue (in time order), and each animation play task in the queue will be dequeued and executed in turn according to the dequeue order of the queue, so the client can execute each corresponding animation play task in turn according to the time order of the animation trigger event, and then play each corresponding animation in turn. It can be seen that the playback order of the animations corresponding to each animation playback task is the same as the occurrence order of each animation triggering event, thereby ensuring that each animation is played in sequence according to the occurrence order of the animation triggering events, presenting the user with the effect of orderly playing animations in response to events, avoiding confusion in the animation playback timing.

[0111] There are many possibilities for the animation type corresponding to any independent playback task. For example, the animation type can be newly created, such as Figure 1 In the example, a new session E can be created under session D. The animation to be played at this time is the dynamic special effect of session E during the process of inserting session E under session D. The animation type can also be selected. For example, when it is detected that the user selects at least one image displayed in the image display page, the animation to be played at this time is the dynamic display effect before and after the image is selected. The animation type can also be moving, such as in Figure 1 In the case of receiving the latest session message of session C sent by the server, the display position of session C can be moved up, so that session C is displayed above session A. At this time, the animation to be played is the dynamic movement effect corresponding to the movement of session C. The animation type can also be deleted, such as in Figure 1 In the case where a deletion operation is detected for session B by the user, session B can be deleted from the session list. At this time, the animation that needs to be played is the dynamic display effect of session B before and after being deleted. Of course, in the practice of the solution, the animation type of the animation (needed to be played) corresponding to any of the above-mentioned independent playback tasks can also be other types, and the embodiments of the present disclosure do not limit this. Through the above-mentioned multiple animation types, the client can present multiple forms of dynamic effects to the user in the current page, enhance the display effect of the display object of the current page during the change process, and improve the page feel.

[0112] Further, the client can determine the data to be updated corresponding to the created independent playback task when creating the above-mentioned independent playback task, and save the data to be updated in an independent array. Among them, the above-mentioned data to be updated is the data that needs to be updated corresponding to the animation triggering event. For example, in the case of receiving a data addition message sent by the server, the client can determine the new data indicated by the data addition message as the data to be updated corresponding to the independent playback task created according to the data addition message. Or, in the case of receiving a data deletion message sent by the server, the client can determine the existing data (to be deleted) indicated by the data deletion message as the data to be updated corresponding to the independent playback task created according to the data deletion message. Or, in the case of detecting that the user has implemented a deletion operation on the display object with existing data in the current page, the client can determine the existing data as the data to be updated corresponding to the independent playback task created according to the deletion operation. Or, any independent playback task may not have corresponding data to be updated. For example, the drag operation implemented by the user on a certain picture in the current page only controls the change of the display position of the picture, so the client can display the corresponding moving animation of the drag operation accordingly, and does not need to update the data corresponding to the picture.

[0113] Furthermore, when executing an independent playback task, the client can perform a corresponding data update process. For example, when executing an independent playback task, the client can use the to-be-updated data in the independent array corresponding to the independent playback task to update the object data of the display object corresponding to the independent playback task, thereby updating the data of the display object corresponding to the animation to ensure the consistency of the display content and the object data.

[0114] However, when the above embodiment is used, when multiple animation triggering events of the same type are detected in a short period of time, the client will play multiple animations with the same effect in sequence according to the order in which the events are detected. Therefore, because the number of tasks is large, the client needs to frequently call the animation playback function to play multiple animations with the same effect, which makes the animation playback process lengthy, resulting in a large load on the terminal device and more power consumption. Moreover, because the animation corresponding to the animation playback task closer to the end of the team is played later, when the number of animation playback tasks is large (that is, more animations need to be played), the animation playback corresponding to the animation playback task near the end of the team will be delayed. For example, after the user has performed the animation triggering operation for a long time, the animation corresponding to the operation is played in the current page, which may cause the client to freeze, which is not conducive to the user experience.

[0115] To further solve the above problem, the client can merge the generated independent playback tasks according to the animation type. For example, the client can create an animation playback task based on the detected animation trigger event, and determine the animation type corresponding to the animation playback task, and then determine whether the animation type corresponding to the independent playback task is the same as the animation type corresponding to each animation playback task in the task queue (already inserted), and perform corresponding processing according to the judgment result: in the case where the animation type corresponding to the independent playback task is different from the animation type corresponding to each animation playback task in the task queue, the client can directly insert the above independent playback task into the end of the task queue; otherwise, in the case where the animation type corresponding to the independent playback task is the same as the animation type corresponding to the same type of playback task in the task queue, the client can merge the above independent playback task with the same type of playback task to obtain a composite playback task, and use the obtained composite playback task to replace the same type of playback task in the task queue (that is, insert the composite playback task into the position where the same type of playback task in the task queue is located). Among them, there can be at least one of the above-mentioned similar playback tasks: in the case where there is only one similar playback task, the above-mentioned matching playback task is obtained by merging the independent playback task with the similar playback task, and the client can use the composite playback task to replace the similar playback task in the task queue; and in the case where there are multiple similar playback tasks (multiple similar playback tasks and the above-mentioned independent playback task all correspond to the same animation type), the above-mentioned composite playback task is obtained by merging the independent playback task with the above-mentioned multiple similar playback tasks, and the client can use the composite playback task to replace any one of the above-mentioned multiple similar playback tasks, such as replacing the task at the front of the queue order (i.e., the task closest to the head of the team). Under the above-mentioned task merging and insertion method, multiple animation playback tasks corresponding to the same animation type (i.e., corresponding to the same type of dynamic special effects) can be merged into a composite playback task, and the composite playback task can be used to replace the original similar playback tasks in the task queue, thereby greatly reducing the number of tasks in the task queue (the number of tasks will not exceed the number of animation types) on the basis of ensuring that there is no conflict in the adjacent animation playback process, thereby reducing the number of tasks that the client needs to maintain and execute, and simplifying the playback process of the animation playback task, which helps to improve the animation playback efficiency.

[0116] Corresponding to the data update of the aforementioned independent playback task, when the above-mentioned independent playback task is merged with the specific playback task to obtain a composite playback task, the client can splice the above-mentioned independent array corresponding to the independent playback task and the task data corresponding to the same type of playback task into composite data, and the task array corresponding to the above-mentioned same type of playback task records the data to be updated corresponding to the same type of playback task. The composite array obtained by splicing the above-mentioned arrays records the data to be updated corresponding to the independent playback task and the same type of playback task respectively (that is, the data to be updated corresponding to multiple independent playback tasks respectively), and then the client can centrally manage the data to be updated corresponding to the above-mentioned independent playback tasks respectively, which helps to improve the data update efficiency corresponding to the animation.

[0117] After the task queue is processed in the above manner, there may be both independent play tasks and composite play tasks. Therefore, for the animation play task taken from the head of the queue, the client can determine whether the task is an independent play task or a composite play task, and then perform corresponding play processing according to the judgment result. For example, for a certain animation play task, if the task is an independent play task, the client can play the animation corresponding to the independent play task in the current page; and if the task is a composite play task, the client can simultaneously play multiple animations corresponding to the composite play task in the current page. In this way, for the composite play task obtained by combining the independent play task and the same type of play task, the client can simultaneously play the above-mentioned independent play task and the same type of play task corresponding to the same type of animation when executing the composite play task, so that these animations can be played by the client at the same time. Because the play duration of the same type of animation is usually the same, the scheme can play multiple animations of the same type simultaneously within one animation play duration, which greatly reduces the animation play time, improves the animation play efficiency, reduces the play delay of the animation corresponding to the task at the end of the queue, and significantly improves the user's animation viewing experience.

[0118] Corresponding to the aforementioned composite data, when executing a composite playback task, the client can use each to-be-updated data in the composite array corresponding to the composite playback task to respectively update the object data of each display object corresponding to the composite playback task. In this way, the client can simultaneously implement centralized updates of multiple to-be-updated data when executing a composite playback task, thereby improving the efficiency of data updating.

[0119] It should also be noted that the same type of playback tasks to be merged with independent playback tasks can be either independent playback tasks or composite playback tasks. In other words, two independent playback tasks of the same type can be merged into one composite playback task, and independent playback tasks of the same type can also be merged with composite playback tasks of the same type (the composite playback task is obtained by merging multiple independent playback tasks of the same type) to obtain a new composite playback task, thereby achieving the merging effect of multiple independent playback tasks into one composite playback task. It can be understood that because the multiple independent playback tasks used to merge any composite playback task correspond to the same animation type, the animation type can be used as the animation type corresponding to the composite playback task obtained by the merger.

[0120] According to the embodiments of the present disclosure, after creating an animation playback task corresponding to an animation triggering event, the task will be inserted into the task queue corresponding to the current page, and then each animation playback task will be executed in sequence according to the inherent dequeueing order of the task queue itself, so that each animation will be played in sequence in the current page according to the dequeueing order. Therefore, for each animation triggering event that occurs successively, each corresponding animation playback task can be executed in sequence and in an orderly manner, and then each animation is played in sequence - the next animation will be played only after the previous animation is finished, avoiding the situation where the next animation interrupts the previous animation, presenting a dynamic playback effect of playing each animation in sequence and in an orderly manner, effectively improving the dynamic playback effect of the animation, and thus improving the user experience.

[0121] Figure 4 is a flowchart of another animation playing method shown in an exemplary embodiment of the present disclosure, such as Figure 4 As shown, this method is applied to the client. Figure 1 Take the session list page shown in the figure as an example, combined with Figure 4 The animation playing process corresponding to the method described in the embodiment of the present disclosure is described in detail, and the process may include the following steps 402-426.

[0122] Step 402, generate and display the current page.

[0123] In this embodiment, the client of the live broadcast platform running in the terminal device is taken as an example. The client has instant messaging function, session display function and animation playback function. After the user operates the terminal device to control the client to display the session list, the client goes through the process of obtaining page data, rendering page elements, displaying page elements, etc., and finally displays the following. Figure 1 The session list page (ie, the current page) shown, the specific display process of this page can be found in the records in the relevant technology, and will not be repeated here.

[0124] like Figure 1The current page shown contains four display objects: session A, session B, session C and session D. The following steps illustrate the animation playback process of each display object when the content or position changes.

[0125] Step 404: Create a task queue corresponding to the current page.

[0126] During the generation phase of the current page, the client can create a task queue for the page to sequentially save the animation playback tasks generated by the client in the subsequent steps. Correspondingly, when the current page is closed, the client can delete the task queue accordingly to reclaim the memory space and other resources occupied by the task queue. It can be seen that the task queue corresponding to the current page has the same life cycle as the page.

[0127] In fact, before displaying the above current page, the client does not know whether the page contains display objects that can trigger the animation playback (such as the above sessions, hereinafter referred to as triggerable objects). It is understandable that if the display page does not contain triggerable objects, even if a task queue is created, the task queue is useless. Therefore, in order to avoid creating a task queue for a display page that does not contain a triggerable object, the client can make a judgment based on the page data before creating a task queue: if it is determined that the page to be generated contains a triggerable object, then further create a task queue for the page to reduce invalid creation of task queues.

[0128] For example, the client may pre-record the format, type, parameters and other object characteristics of the triggerable object, so as to judge whether each display object in the to-be-generated page is a triggerable object by using the object characteristics: if there is at least one object characteristic of a display object in each display object corresponding to the page data of the to-be-generated page, which matches the object characteristics of the triggerable object that has been recorded, then it is judged that the to-be-generated page contains a triggerable object; otherwise, if the object characteristics of all display objects corresponding to the page data of the to-be-generated page do not match the object characteristics of the triggerable object that has been recorded, then it is judged that the to-be-generated page does not contain a triggerable object. The above judgment process may be performed before the to-be-generated page is displayed, for example, all display objects contained in the to-be-generated page may be obtained from the DOM (Document Object Model) tree of the page, which will not be described in detail.

[0129] Of course, for Figure 1The session display page shown in the figure meets the above conditions because the position changes of each session may trigger the client to play the corresponding animation in the page, so the client can generate a task queue for the session display page. Of course, when the client of the above live broadcast platform is started in the terminal device, the client can generate its own corresponding task queue. The specific process can be referred to the above records.

[0130] Step 406: Detect an animation triggering event for the display object.

[0131] During the process of displaying the current page, the client may detect an animation triggering event, which is used to trigger the client to play the animation for the display object in the current page. Figure 1 Taking the session display page shown as an example, as mentioned above, because the display position of the session is related to the time when the latest session message in the session is sent or received, the client can adjust the display position of the session accordingly after receiving the message sent by the server or detecting the user operation, and play the corresponding type of animation during the adjustment process to present the dynamic effect of the position change process.

[0132] For example, when a client logged in with a user account receives a conversation message sent by other users for the first time, or when the current user deletes the historical conversation with the other user in the conversation display page and receives a conversation message sent by the other user to the current user again, the server will send the conversation message to the client, so that the client can create and display a new conversation corresponding to the conversation message in the conversation display page. For example, when the client receives two new messages sent by the server, it can create and display two new conversations: conversation E and conversation F, and insert and display the conversation in the existing conversation list. Play the corresponding insertion animation during the process. Alternatively, if the conversation with the other user is already displayed in the conversation display page when the two conversation messages are received (such as the user has sent a historical message to the current user), the client can display the two received conversation messages in the two conversations respectively, and adjust the display positions of the two conversations to the top of the conversation list. For example, when the client receives two new messages sent by the server, it can move the display positions of the two new conversations: conversation C and conversation D, and play the corresponding moving animation during the moving process. Alternatively, when the user performs a deletion operation on session B, the client may delete session B from the session list and play a corresponding deletion animation during the deletion process.

[0133] Of course, the animation played in the process of inserting a new session, moving an existing session, and deleting an existing session will be played in the subsequent step 422, and will not be played in this step. In fact, it is during the process of playing the animation that the dynamic effects of inserting a session, moving a session, and deleting a session are presented in the session list page, so that the user can perceive the corresponding animation triggering event.

[0134] Step 408: Create an independent play task according to the animation triggering event, and save the corresponding data to be updated in an independent array.

[0135] Step 140: Determine the animation type corresponding to the independent play task.

[0136] Following the above embodiment, the client can generate independent playback tasks for each playback triggering event accordingly. For example, an insert playback task is generated for session E and session F, a move playback task is generated for session C and session D, and a delete playback task is generated for session B. At the same time, the data to be updated corresponding to each task can also be determined, such as the latest message data corresponding to session E, session F, session C and session D, and the entire session message data corresponding to session B (that is, the message data of all session messages published in session B will be deleted from the session window of session B), and then the above data to be updated can be saved in the independent array corresponding to the animation playback task. Among them, the latest message data of session E, session F, session C and session D can be directly saved in the independent array, and for all session message data of session B, in order to avoid repeated writing, only the preset mark corresponding to the "delete all" operation can be recorded in the independent array.

[0137] Correspondingly, the insert play tasks for session E and session F correspond to the animation of inserting session E and the animation of inserting session F, respectively, so the corresponding animation types are insert. The move play tasks for session C and session D correspond to the animation of moving session C and the animation of moving session D, respectively, so the corresponding animation types are move. The delete play task for session B corresponds to the animation of deleting session B, so its corresponding animation type is delete.

[0138] It should be noted that steps 406-416 are the operation flow for any animation triggering event, that is, for any animation triggering event detected, the client will sequentially execute steps 406-416. Of course, the client can also execute steps 406-416 corresponding to multiple animation triggering events simultaneously.

[0139] In the following embodiment, it is assumed that the client sequentially receives a new message for session E, receives a new message for session D, receives a new message for session F, detects a deletion action for session B, and receives a new message for session C; accordingly, the client can sequentially generate an insert play task for session E, a move play task for session D, an insert play task for session F, a delete play task for session B, and a move play task for session C.

[0140] Table 1

[0141] For details, please refer to Table 1. From the "Time" column in Table 1, it can be seen that the animation triggering events for each session occur in chronological order. For example, when there are independent playback tasks for sessions E, D, B, and C in the task queue, and the client inserts the independent playback task for session B into the task queue, please refer to Figure 5 .like Figure 5 As shown in (a), there are currently four independent playback tasks saved in the task queue: insert1 corresponding to the insert animation, move1 corresponding to the move animation, insert2 corresponding to the insert animation, and delete1 corresponding to the delete animation, where the head of the queue is insert1 and the tail of the queue is delete1.

[0142] In one embodiment, the process can directly proceed to step 416 at this time, that is, insert the independent playback task move2 for session B into the end of the task queue. Figure 5 (b) shows, wherein the inserted move2 is used as the new tail. In fact, because this embodiment does not need to use the animation type, step 410 may not be performed. In other words, steps 402-408 and steps 416-426 may be used as a complete embodiment.

[0143] At this time, you can Figure 1 In the session list page shown, the session display status of the displayed sessions A, B, C, and D is simplified to Figure 6 The conversation sequence of "ABCD" shown on the far left. Figure 5The task queue shown in (b) executes each task in sequence: after executing task insert1, a new session E is inserted at the top of the session list; after executing task move1, session D at the bottom of the session list is moved to the top of the list; after executing task insert2, a new session F is inserted at the top of the session list; after executing task delete1, session B in the session list is deleted; after executing task move2, session C at the bottom of the session list is moved to the top of the list. The execution order of each task in the above process and the session order at each stage can be seen in Figure 6 .

[0144] In this embodiment, the independent play tasks corresponding to the animation triggering events are sequentially saved in the task queue and then sequentially executed, so that the display effects of the animations and the changed session list are sequentially presented in the session list.

[0145] It can be seen that multiple animations of the same type in the above embodiment are still displayed in sequence, so that the client plays the animation for session C only after playing the animations for session E, session D, session F and session B in sequence, which may cause a large delay in the animation playback for session C (that is, the client starts to play the animation for session C a long time after receiving the new message for session C). For example, when the playback duration of each of the above animations is 0.3s, the maximum delay in playing the animation for session C may reach 4*0.3s=1.2s, so that the display effect of the client will have an obvious sense of lag. To solve this problem, the client can execute in sequence Figure 4 Steps 402-426 in the above-mentioned tasks of the same type are combined. The following is a detailed description of the execution process of subsequent steps 412-426.

[0146] Step 412, determining whether there is a similar playback task corresponding to the same type of animation as the independent playback task in the task queue.

[0147] When inserting any independent play task into the task queue, it is possible to first check whether the animation type corresponding to the animation play task already inserted in the task queue is the same as the animation type corresponding to the independent play task, that is, whether there is a similar play task in the task queue (that is, an animation play task whose corresponding animation type is the same as the animation type corresponding to the independent play task). If the same play type exists in the task queue, the process proceeds to step 414; otherwise, if the same play task does not exist in the task queue, the process proceeds to step 416.

[0148] Step 414: Generate a composite playback task based on the independent playback task and the similar playback task, and use the composite playback task to replace the similar playback task in the task queue.

[0149] like Figure 7 As shown in Figure 7(a), taking the independent playback task move2 as an example, when inserting the independent playback task move2 into the task queue, you can first check whether there is an animation playback task of the same type as the independent playback task move2 in the task queue. It can be seen that among the three animation playback tasks in the current task queue: insert12, move1, and delete1, move1 and move2 belong to the same type (that is, the current similar playback task is the independent playback task move1), so move1 and move2 can be merged into a composite playback task move12. Furthermore, the merged composite playback task move12 can be used to replace the similar playback task move1 in the task queue, so that move12 can be inserted into the task queue. The queue after insertion is as follows. Figure 7 (b) as shown.

[0150] Of course, the current similar playback task can also be a composite playback task. For example, after the above replacement is completed, if move12 has not been executed, and there is a mobile playback task move3 corresponding to a new mobile trigger event that needs to be inserted into the task queue, the client can determine move12 as a similar playback task, thereby merging move12 with move3 to obtain a composite playback task move123. At this time, the composite playback task move123 can also be regarded as a composite playback task obtained by merging independent playback tasks move1, move2 and move3.

[0151] In fact, the above-mentioned insert12 is also a composite playback task obtained by merging the independent playback task insert1 and the independent playback task insert2.

[0152] When the above-mentioned composite playback task is obtained by merging, the arrays of the data to be merged corresponding to the independent playback task move2 and the similar playback task move3 can also be spliced ​​to obtain a composite array. For example, when the independent data array corresponding to the independent playback task move2 contains A2[d2d2d2], and the task array corresponding to the similar playback task move1 contains A1[d1d1d1], the two arrays can be spliced ​​to obtain A12[d1d1d1; d2d2d2]. Of course, other splicing rules can also be used, and the embodiments of the present disclosure do not limit the specific splicing rules.

[0153] Step 416: insert the independent playback task into the end of the task queue.

[0154] Still Figure 7For example, if the user selects a session at the current moment, the client can generate a corresponding selected playback task select1 and insert it into the task queue (not shown in the figure). It can be understood that during the insertion process, the client can determine that there is no similar playback task corresponding to the same type of animation as the task in the current task queue, so the independent playback task select1 can be inserted into the tail of the task queue, that is, select1 is inserted to the position above select1, and the inserted select1 is used as the new tail of the task queue.

[0155] So far, the generation and insertion process for the animation playing task has been completed, and each animation playing task has been inserted into the corresponding position of the task queue. The execution process of each animation playing task in the task queue is described in detail below. First of all, it should be clear that the task execution process of the following steps 418-426 does not conflict with the processing process of the aforementioned steps 402-416, and the two can be processed simultaneously, that is, the client can generate and insert a new animation playing task into the task queue while executing each animation playing task in the task queue, so that the number of animation playing tasks in the task queue is in a dynamic change process, so the number of tasks in the task queue at any time can be 0, 1 or more. Wherein, when there is an animation playing task in the task queue, the head of the team is located at the queue exit of the task queue, and the position of the tail of the team changes with the number of tasks in the queue.

[0156] Step 418, determine whether there is an animation playing task currently being executed.

[0157] After the number of tasks in the task queue changes, the judgment step 418 is executed. If the client is currently executing the animation playing task, the judgment can be made again after the execution is completed; otherwise, if the client is not currently executing the animation playing task, the process can proceed to step 420.

[0158] Step 420, taking out the animation playing task at the head of the queue.

[0159] Because the task queue has the FIFO feature, the client can take out the animation playback task from the head of the team and execute it. Because the animation playback task is taken out from the head of the team and executed each time, it is guaranteed that each animation playback task in the task queue is executed in the order of dequeueing. It should be noted that in order to avoid playback conflicts between adjacent animations, the client can execute the next animation playback task after completing any animation playback task. Among them, the process of executing any animation playback task taken out from the head of the team is the process of executing the following steps 422 and 424 simultaneously or successively.

[0160] Step 422: Play the animation corresponding to the animation playing task.

[0161] On the one hand, the client can play the animation corresponding to the animation playback task. Among them, because the animation playback task may be an independent playback task or a composite playback task, the above can be performed in a targeted manner according to the task type. In the case where the task is an independent playback task, the client can play the animation corresponding to the independent playback task in the current page; and in the case where the task is a composite playback task, the client can simultaneously play multiple animations corresponding to the composite playback task in the current page.

[0162] by Figure 7 Taking the task queue shown in (b) as an example, when the client executes the composite playback task insert12, the insertion animation for session E and session F can be played simultaneously, so that session F and session E are inserted above session A in sequence - because the creation time of insert1 is earlier than that of insert2, although the animations are played at the same time, session F is still located above session E. Similarly, when executing the composite playback task move12, the moving animation for session C and session D can be played simultaneously, so that session D and session C are moved above session F in sequence - because the creation time of move1 is earlier than that of move2, although the animations are played at the same time, session C is still located above session D. Of course, session F can also be located below session E, or session D and session C can be moved below session F. The present disclosure does not limit the determination rules of the specific display positions, and can be flexibly set according to the application scenario when the solution is implemented.

[0163] Finally, when executing the independent playback task delete1, the deletion animation for session B can be played, thereby deleting session B from the session list. The above process can be seen in Figure 8 .

[0164] Step 424, updating the data corresponding to the animation playing task.

[0165] On the other hand, the client can update the data corresponding to the animation playback task. For example, when executing a certain independent playback task, the client can use the to-be-updated data in the independent array corresponding to the independent playback task to update the object data of the display object corresponding to the task; and when executing a certain composite playback task, the client can use the various to-be-updated data in the composite array corresponding to the composite playback task to respectively update the object data of various display objects corresponding to the composite playback task.

[0166] Still Figure 7(b) as an example, when the client plays the insertion animation for session E and session F at the same time, the latest session message of session E can be saved in the session data storage space of the newly created session E, and the latest session message of session F can be saved in the session data storage space of the newly created session F. When the client plays the deletion animation for session B, all session data of session B can be deleted from the storage space corresponding to the session list. Of course, all session data and backup data of session B saved locally can also be deleted. The embodiments of the present disclosure do not limit the specific content of the deletion. Among them, the above storage space can be a memory or a local disk, etc., and the embodiments of the present disclosure do not limit this.

[0167] Step 426, determining whether there are any unexecuted animation playing tasks in the task queue.

[0168] If there is an animation playing task in the current task queue that has not been executed, the client can return to step 420, continue to take out the animation playing task at the head of the queue at the current moment and execute it. If all the animation playing tasks in the current task queue have been executed, it can return to step 406 and continue to start detecting animation triggering events. Of course, the animation triggering event can also be detected by interrupt triggering or event subscription, and the disclosed embodiment does not limit this.

[0169] Corresponding to the above-mentioned embodiment of the animation playing method, the present disclosure also proposes an embodiment of an animation playing device.

[0170] Fig. 9 It is a schematic block diagram of an animation playback device according to an embodiment of the present disclosure. The animation playback device shown in this embodiment can be applicable to an animation playback application, and the application is applicable to a terminal device, and the terminal includes but is not limited to electronic devices such as mobile phones, tablet computers, wearable devices, and personal computers. The animation playback application can be an application installed in the terminal, or it can be a web version application integrated in the browser. Users can play animations, display objects, etc. through the animation playback application.

[0171] like Fig. 9 As shown, the animation playing device may include:

[0172] A detection unit 901 is configured to detect an animation triggering event, where the animation triggering event is used to trigger playing of an animation for a display object in a current page;

[0173] The creation unit 902 is configured to create an animation play task according to the animation triggering event, and insert the animation play task into a corresponding position in the task queue corresponding to the current page according to the task type;

[0174] The playing unit 903 is configured to execute the animation playing tasks in the task queue in sequence according to the dequeuing order of the task queue, so as to play the animations corresponding to the animation playing tasks in sequence in the current page according to the dequeuing order.

[0175] Optionally, the detection unit 901 is further configured to:

[0176] receiving a data update message for the display object sent by the server; or,

[0177] An animation triggering operation performed by a user on the display object in the current page is detected.

[0178] Optionally, the creating unit 902 is further configured to:

[0179] Creating an independent playback task according to the animation triggering event, and determining the animation type corresponding to the independent playback task;

[0180] When the animation type corresponding to the independent playback task is different from the animation type corresponding to the animation playback task in the task queue, the independent playback task is inserted into the tail of the task queue, which is the last one in the dequeue order at the current moment.

[0181] Optionally, the playing unit 903 is further configured to:

[0182] The animation corresponding to the independent playback task is played in the current page.

[0183] Optionally, also include:

[0184] The independent saving unit 904 is configured to save the to-be-updated data corresponding to the independent playing task in an independent array when the independent playing task is created.

[0185] Optionally, also include:

[0186] The independent updating unit 905 is configured to update the object data of the display object corresponding to the independent playing task using the to-be-updated data in the independent array when executing the independent playing task.

[0187] Optionally, the creating unit 902 is further configured to:

[0188] Creating an independent playback task according to the animation triggering event, and determining the animation type corresponding to the independent playback task;

[0189] In the case that there is a similar playback task corresponding to the same animation type as the independent playback task in the task queue, merging the independent playback task with the similar playback task to obtain a composite playback task;

[0190] The composite playback task is used to replace the same type of playback tasks in the task queue.

[0191] Optionally, the playing unit 903 is further configured to:

[0192] Multiple animations corresponding to the composite playback task are played simultaneously in the current page.

[0193] Optionally, also include:

[0194] The array splicing unit 906 is configured to splice the independent array corresponding to the independent playback task and the task array corresponding to the same type of playback task into a composite array when the composite playback task is merged to obtain the composite playback task, wherein the independent array records the data to be updated corresponding to the independent playback task, and the task array records the data to be updated corresponding to the same type of playback task.

[0195] Optionally, also include:

[0196] The composite updating unit 907 is configured to respectively update the object data of each display object corresponding to the composite playing task using each to-be-updated data in the composite array when executing the composite playing task.

[0197] Optionally, the same type of playback tasks are independent playback tasks or compound playback tasks.

[0198] Optionally, the task queue is created during the generation phase of the current page; or,

[0199] The task queue is created during the startup phase of the application to which the current page belongs.

[0200] Optionally, the same type of playback tasks are independent playback tasks or compound playback tasks.

[0201] Optionally, the task queue is created during the generation phase of the current page; or,

[0202] The task queue is created during the startup phase of the application to which the current page belongs.

[0203] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0204] The embodiment of the present disclosure further provides an electronic device, including:

[0205] processor;

[0206] a memory for storing instructions executable by the processor;

[0207] Wherein, the processor is configured to execute the instructions to implement the animation playing method as described in any of the above embodiments.

[0208] An embodiment of the present disclosure further provides a storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the animation playback method described in any of the above embodiments.

[0209] An embodiment of the present disclosure further provides a computer program product, including a computer program and / or instructions, which implement the animation playback method described in any of the above embodiments when executed by a processor.

[0210] Fig.10 1 is a schematic block diagram of an electronic device according to an embodiment of the present disclosure. For example, the electronic device 1000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0211] Reference Fig.10 , the electronic device 1000 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output (I / O) interface 1012 , a sensor component 1014 , and a communication component 1018 .

[0212] The processing component 1002 generally controls the overall operation of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above-mentioned animation playback method. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.

[0213] The memory 1004 is configured to store various types of data to support operations on the electronic device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0214] The power supply component 1006 provides power to various components of the electronic device 1000. The power supply component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1000.

[0215] The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 1000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0216] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), and when the electronic device 1000 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1004 or sent via the communication component 1018. In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.

[0217] I / O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0218] The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 1014 can detect the open / closed state of the electronic device 1000, the relative positioning of components, such as the display and keypad of the electronic device 1000, and the sensor assembly 1014 can also detect the position change of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of user contact with the electronic device 1000, the orientation or acceleration / deceleration of the electronic device 1000, and the temperature change of the electronic device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0219] The image acquisition component 1016 can be used to collect image data of the subject to form an image of the subject, and can perform necessary processing on the image. The image acquisition component 1016 can include a camera module, and the image sensor (Sensor) in the camera module senses the light from the subject through the lens, and provides the obtained photosensitive data to the image signal processor (ISP, Image Signal Processing), which generates an image corresponding to the subject according to the photosensitive data. Among them, the above-mentioned image sensor can be a CMOS sensor or a CCD sensor, of course, it can also be an infrared sensor, a depth sensor, etc.; the camera module can be built-in in the electronic device 1000, or it can be an external module of the electronic device 1000; the above-mentioned ISP can be built-in in the camera module, or it can be externally mounted in the above-mentioned electronic device (not in the camera module).

[0220] The communication component 1018 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 1018 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1018 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0221] In one embodiment of the present disclosure, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned animation playback method.

[0222] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, and the above instructions can be executed by the processor 1020 of the electronic device 1000 to complete the above method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0223] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0224] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

[0225] It should be noted that, in the present disclosure, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprises one..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0226] The method and device provided in the embodiments of the present disclosure are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present disclosure, there will be changes in the specific implementation methods and application scopes. In summary, the content of the present disclosure should not be understood as a limitation on the present disclosure.

Claims

1. An animation playing method, characterized in that: include: An animation triggering event is detected, where the animation triggering event is used to trigger the playing of an animation for a display object in the current page; Creating an animation play task according to the animation triggering event, and inserting the animation play task into a corresponding position in the task queue corresponding to the current page according to the task type; Execute the animation playing tasks in the task queue in sequence according to the order in which the task queue is dequeued, so as to play the animations corresponding to the animation playing tasks respectively in the current page according to the order in which the animation playing tasks are dequeued; there is no intersection between the playing time intervals of the animations corresponding to two adjacent animation playing tasks; The step of creating an animation playing task according to the animation triggering event and inserting the animation playing task into a corresponding position in the task queue corresponding to the current page according to the task type includes: Creating an independent playback task according to the animation triggering event, and determining the animation type corresponding to the independent playback task; In the case where the animation type corresponding to the independent playback task is the same as the animation type corresponding to the similar playback task in the task queue, the independent playback task and the similar playback task are merged to obtain a composite playback task; wherein, when the composite playback task is executed, multiple animations of the same type corresponding to the independent playback task and the similar playback task are simultaneously played; The composite playback task is used to replace the same type of playback tasks in the task queue.

2. The method according to claim 1, characterized in that The detecting of the animation triggering event includes: receiving a data update message for the display object sent by the server; or, An animation triggering operation performed by a user on the display object in the current page is detected.

3. The method according to claim 1, characterized in that The step of creating an animation playing task according to the animation triggering event and inserting the animation playing task into a corresponding position in the task queue corresponding to the current page according to the task type includes: Creating an independent playback task according to the animation triggering event, and determining the animation type corresponding to the independent playback task; When the animation type corresponding to the independent playback task is different from the animation type corresponding to the animation playback task in the task queue, the independent playback task is inserted into the tail of the task queue, which is the last one in the dequeue order at the current moment.

4. The method according to claim 3, characterized in that Executing the independent playback task includes: The animation corresponding to the independent playback task is played in the current page.

5. The method according to claim 3, characterized in that: Also includes: When the independent playback task is created, the to-be-updated data corresponding to the independent playback task is stored in an independent array.

6. The method according to claim 5, characterized in that Also includes: When the independent play task is executed, the object data of the display object corresponding to the independent play task is updated using the data to be updated in the independent array.

7. The method according to claim 1, characterized in that Also includes: When the composite playback task is obtained by merging, the independent array corresponding to the independent playback task and the task array corresponding to the same type of playback task are spliced ​​into a composite array, wherein the independent array records the data to be updated corresponding to the independent playback task, and the task array records the data to be updated corresponding to the same type of playback task.

8. The method according to claim 7, characterized in that Also includes: When the composite playback task is executed, each to-be-updated data in the composite array is used to update the object data of each display object corresponding to the composite playback task.

9. The method according to any one of claims 3 to 8, characterized in that The same type of playback tasks are independent playback tasks or compound playback tasks.

10. The method according to claim 1, characterized in that The task queue is created during the generation phase of the current page; or, The task queue is created during the startup phase of the application to which the current page belongs.

11. An animation playback device, characterized in that: include: A detection unit, configured to detect an animation triggering event, wherein the animation triggering event is used to trigger the playing of an animation for a display object in a current page; A creating unit, configured to create an animation playing task according to the animation triggering event, and insert the animation playing task into a corresponding position in the task queue corresponding to the current page according to the task type; The creation unit is further configured to create an independent playback task according to the animation triggering event, and determine the animation type corresponding to the independent playback task; if there is a similar playback task corresponding to the same animation type as the independent playback task in the task queue, merge the independent playback task with the similar playback task to obtain a composite playback task; wherein, when the composite playback task is executed, multiple animations of the same type corresponding to the independent playback task and the similar playback task will be played simultaneously; and the composite playback task is used to replace the similar playback task in the task queue; The playback unit is configured to execute the animation playback tasks in the task queue in sequence according to the order in which the task queue is dequeued, so as to play the animations corresponding to the animation playback tasks in the current page in sequence according to the order in which the task queue is dequeued; there is no intersection in the playback time intervals of the animations corresponding to two adjacent animation playback tasks.

12. The device according to claim 11, characterized in that The detection unit is further configured to: receiving a data update message for the display object sent by the server; or, An animation triggering operation performed by a user on the display object in the current page is detected.

13. The device according to claim 11, characterized in that The creation unit is further configured to: Creating an independent playback task according to the animation triggering event, and determining the animation type corresponding to the independent playback task; When the animation type corresponding to the independent playback task is different from the animation type corresponding to the animation playback task in the task queue, the independent playback task is inserted into the tail of the task queue, which is the last one in the dequeue order at the current moment.

14. The device according to claim 13, characterized in that The playback unit is further configured to: The animation corresponding to the independent playback task is played in the current page.

15. The device according to claim 13, characterized in that Also includes: The independent saving unit is configured to save the to-be-updated data corresponding to the independent playing task in an independent array when the independent playing task is created.

16. The device according to claim 15, characterized in that Also includes: The independent updating unit is configured to update the object data of the display object corresponding to the independent playing task using the to-be-updated data in the independent array when executing the independent playing task.

17. The device according to claim 16, characterized in that Also includes: The array splicing unit is configured to splice the independent array corresponding to the independent playback task and the task array corresponding to the same type of playback task into a composite array when the composite playback task is merged, wherein the independent array records the data to be updated corresponding to the independent playback task, and the task array records the data to be updated corresponding to the same type of playback task.

18. The device according to claim 17, characterized in that Also includes: The composite updating unit is configured to respectively update the object data of each display object corresponding to the composite playing task using each to-be-updated data in the composite array when executing the composite playing task.

19. The device according to any one of claims 13 to 18, characterized in that The same type of playback tasks are independent playback tasks or compound playback tasks.

20. The device according to claim 11, characterized in that The task queue is created during the generation phase of the current page; or, The task queue is created during the startup phase of the application to which the current page belongs.

21. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the animation playing method according to any one of claims 1 to 10.

22. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the animation playing method as described in any one of claims 1 to 10.

23. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or instruction is executed by a processor, the animation playing method according to any one of claims 1 to 10 is implemented.