Animation synthesis method and device, storage medium, electronic equipment and chip

By storing and consuming animation frames in a transaction queue within SurfaceFlinger, the problem of animation frame drops caused by delays in the system's main thread was solved, resulting in smoother animations and an improved user experience.

CN121937587APending Publication Date: 2026-04-28BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING XIAOMI MOBILE SOFTWARE CO LTD
Filing Date
2024-10-28
Publication Date
2026-04-28

Smart Images

  • Figure CN121937587A_ABST
    Figure CN121937587A_ABST
Patent Text Reader

Abstract

The invention relates to an animation synthesis method and device, a storage medium, electronic equipment and a chip. The method comprises the following steps: firstly, acquiring a transaction corresponding to an animation frame; then storing the transactions in a first transaction queue; and finally, performing transaction consumption based on the first transaction queue to obtain a synthetic animation. By applying the technical scheme of the invention, the transactions corresponding to the received animation frames can be stored in the first transaction queue, and then the enqueued transactions are sequentially consumed according to the first-in first-out data processing mode of the first transaction queue, so that the situation that the transactions corresponding to a plurality of animation frames are consumed at one time is avoided, and the user experience is improved. Therefore, the situation of frame loss and jamming of the animation is reduced, the fluency of the animation is improved, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of software technology, and in particular to an animation synthesis method, apparatus, storage medium, electronic device, and chip. Background Technology

[0002] SurfaceFlinger is a core component in the Android system responsible for managing and compositing the graphics layer. It ensures that graphical content is displayed smoothly and efficiently on the screen by consuming animation frames.

[0003] Currently, in related technologies, the system's main thread is called to send animation frames to Surfaceflinger. If the main thread is delayed, Surfaceflinger may consume multiple animation frames at once, causing frame drops in the animation synthesized by Surfaceflinger, resulting in stuttering and affecting the user experience. Summary of the Invention

[0004] This disclosure provides an animation compositing method, apparatus, storage medium, electronic device, and chip. The main purpose is to improve the technical problem that currently, when the system main thread sends animation frames to Surfaceflinger, if the main thread is delayed, Surfaceflinger will consume multiple animation frames at once, resulting in frame loss in the animation composed by Surfaceflinger, causing stuttering and affecting the user experience.

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

[0006] Retrieve the transaction corresponding to the animation frame;

[0007] Store the transaction in the first transaction queue;

[0008] The synthesized animation is obtained by consuming transactions based on the first transaction queue.

[0009] Optionally, the step of consuming transactions based on the first transaction queue to obtain the synthesized animation includes:

[0010] Iterate through the preparation status of transactions in the first transaction queue;

[0011] Store the transactions that are ready to be completed in the second transaction queue;

[0012] Consume the transactions in the second transaction queue to obtain the composite animation.

[0013] Optionally, after traversing the preparation states of transactions in the first transaction queue, the method further includes:

[0014] Transactions whose readiness status is not yet complete are stored in the third transaction queue.

[0015] Optionally, the method further includes:

[0016] Iterate through the preparation status of transactions in the third transaction queue;

[0017] Transactions in the third transaction queue that are in a ready state are stored in the second transaction queue.

[0018] Optionally, the method further includes:

[0019] Generate an application token corresponding to the second transaction queue. The application token is used to record the animation frames corresponding to the transactions in the second transaction queue.

[0020] Optionally, the method further includes:

[0021] Get the latest received animation frame;

[0022] Based on the application token, the latest received animation frame is compared with the animation frame corresponding to the transaction in the second transaction queue;

[0023] Based on the comparison results, the preparation status of the latest received animation frame is determined.

[0024] Optionally, determining the preparation status of the latest received animation frame based on the comparison results includes:

[0025] If the latest received animation frame has the same name as the animation frame corresponding to the transaction in the second transaction queue, then the preparation status of the latest received animation frame is determined to be not ready.

[0026] If the name of the latest received animation frame is different from the name of the animation frame corresponding to the transaction in the second transaction queue, then the preparation status of the latest received animation frame is determined to be ready.

[0027] According to a second aspect of the present disclosure, an animation synthesis apparatus is provided, comprising:

[0028] The acquisition module is configured to acquire transactions corresponding to animation frames.

[0029] The storage module is configured to store the transaction in a first transaction queue;

[0030] The compositing module is configured to consume transactions based on the first transaction queue to obtain a composite animation.

[0031] According to a third aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the animation synthesis method described in the first aspect.

[0032] According to a fourth aspect of the present disclosure, an electronic device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the computer program to implement the animation synthesis method described in the first aspect.

[0033] According to a fifth aspect of the present disclosure, a chip is provided, including one or more interface circuits and one or more processors; the interface circuits are configured to receive signals from a memory of an electronic device and send the signals to the processors, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs the animation synthesis method described in the first aspect.

[0034] By employing the above technical solution, this disclosure provides an animation synthesis method, apparatus, storage medium, electronic device, and chip. Specifically, firstly, the transaction corresponding to the animation frame is obtained; then, the transaction is stored in a first transaction queue; finally, the transaction is consumed based on the first transaction queue to obtain the synthesized animation. By applying the technical solution of this disclosure, the received transaction corresponding to the animation frame can be stored in the first transaction queue, and then the queued transactions are consumed sequentially according to the first-in-first-out data processing method of the first transaction queue. This avoids consuming transactions corresponding to multiple animation frames at once, thereby reducing animation frame drops and stuttering, improving animation smoothness, and enhancing the user experience.

[0035] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0036] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0037] Figure 1 This illustration shows a flowchart of an animation synthesis method provided in an embodiment of the present disclosure. Figure 1 ;

[0038] Figure 2 This illustration shows a flowchart of an animation synthesis method provided in an embodiment of the present disclosure. Figure 2 ;

[0039] Figure 3 A flowchart illustrating an example provided by an embodiment of this disclosure is shown. Figure 1;

[0040] Figure 4 A flowchart illustrating an example provided by an embodiment of this disclosure is shown. Figure 2 ;

[0041] Figure 5 A schematic diagram of the structure of an animation synthesis apparatus provided in an embodiment of this disclosure is shown. Detailed Implementation

[0042] Some embodiments of this disclosure will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. Various changes, modifications, and equivalents of the methods, apparatus, and / or systems described herein will become apparent upon understanding this disclosure. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but can be changed as will become apparent upon understanding this disclosure, except for operations that must be performed in a particular order. Furthermore, for clarity and brevity, descriptions of features known in the art may be omitted. It should be noted that, without conflict, the embodiments and features in the embodiments of this disclosure can be combined with each other.

[0043] The embodiments described in the following examples of this disclosure are not representative of all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0044] Figure 1 This is a flowchart illustrating an animation compositing method according to some embodiments of the present disclosure, i.e., a schematic flowchart of the animation compositing method. Figure 1 ,like Figure 1 As shown, it includes the following steps.

[0045] Step 101: Obtain the transaction corresponding to the animation frame.

[0046] The execution entity in this embodiment can be an animation compositing device, such as one configured on the SurfaceFlinger side, or the execution entity in this embodiment can be SurfaceFlinger, etc. SurfaceFlinger is a core component in the Android system responsible for managing and compositing the graphics layer. It ensures that the graphics content can be displayed smoothly and efficiently on the screen by consuming animation frames.

[0047] In some embodiments, such as in the Android system, animation frames are typically generated by the application or the system main thread (such as MIUIHome), and then sent to SurfaceFlinger. SurfaceFlinger then composites these animation frames and displays them on the screen. Each animation frame can contain multiple layers (Surfaces), and each layer can have different attributes, such as position, size, and transparency.

[0048] Correspondingly, the transaction corresponding to an animation frame can include various attribute settings and updates for layers, such as layer order, position, size, transparency, color, rotation, content buffer, and visibility. For example, a transaction object can be created first to manage changes to these attributes, ensuring that the update of the animation frame is an atomic operation, thereby guaranteeing display consistency and stability.

[0049] Step 102: Store the transaction in the first transaction queue.

[0050] The first transaction queue stores transactions corresponding to received animation frames, and follows a First-In-First-Out (FIFO) data structure. In some embodiments, the transaction delivery time is random, and transactions can be stored in the queue for unified processing by SurfaceFlinger to ensure orderliness and efficiency.

[0051] Step 103: Consume transactions based on the first transaction queue to obtain the composite animation.

[0052] In some embodiments, when consuming transactions based on the first transaction queue, the element that was first added to the queue will be processed first according to the data processing method of the queue. That is, the elements are dequeued sequentially from the front of the queue. The animation is synthesized by consuming the queued transactions in sequence, which ensures that the transactions are processed in the order of submission. This avoids SurfaceFlinger consuming transactions corresponding to multiple animation frames at once, reduces the occurrence of frame drops in the synthesized animation, and improves the smoothness of the screen and the user experience.

[0053] In current related technologies, delays in the UI main thread (e.g., the MIUI Home main thread) directly related to the user interface can cause two sets of animations to be consumed by SurfaceFlinger at once, resulting in one set of animations being overwritten and causing dropped frames. Compared to current related technologies, this embodiment first obtains the transaction corresponding to the animation frame; then stores the transaction in a first transaction queue; and finally consumes the transaction based on the first transaction queue to obtain the composite animation. By applying the technical solution of this disclosure, the received transaction corresponding to the animation frame can be stored in the first transaction queue, and then the queued transactions can be consumed sequentially according to the first-in-first-out data processing method of the first transaction queue. This avoids consuming multiple transactions corresponding to animation frames at once, thereby reducing dropped frames and stuttering, improving the smoothness of the animation, and enhancing the user experience.

[0054] To further illustrate, as Figure 1 The specific implementation process of the method shown in this embodiment is provided as follows: Figure 2 The specific method shown is a flowchart of the animation compositing method. Figure 2 The method includes:

[0055] Step 201: Obtain the transaction corresponding to the animation frame.

[0056] In some embodiments, SurfaceFlinger can receive animations sent by the MIUI Home main thread in real time and obtain the transactions corresponding to the animation frames. These animations may include, but are not limited to, startup animations, exit animations, transition animations, and Recents animations. A startup animation refers to the process from clicking the application icon to the first screen being fully loaded and displayed; an exit animation refers to the process of the application returning to the home screen or closing; transition animations refer to the animation effects when switching between applications; and Recents animations refer to the animation effects displayed when the user opens the recent tasks list. These animations make switching between applications smoother and more natural, enhancing the user's visual experience. Timely consumption of the transactions corresponding to the animation frames included in the animation can effectively reduce animation frame drops and stuttering, improving the user experience.

[0057] Step 202: Store the transaction in the first transaction queue.

[0058] In some embodiments, SurfaceFlinger can first create a first transaction queue, which can be named mTransactionQueue. Then, the SetTransactionState() function is called to enqueue the transaction corresponding to the obtained animation frame for later use. When enqueuing, the received transaction can be added to the end of the first transaction queue to ensure that the transaction is processed in the order of commit, and to avoid the transaction being overwritten, which would result in discontinuous animation frames.

[0059] Step 203: Traverse the preparation status of transactions in the first transaction queue.

[0060] In some embodiments, when performing a dequeue operation on a transaction in the first transaction queue, the first transaction queue can be traversed to obtain the preparation status of the transactions in the first transaction queue.

[0061] Step 204: Store transactions in the preparation state as ready to be completed into the second transaction queue.

[0062] In some embodiments, the second transaction queue can be used to store transactions that are ready to be completed. SurfaceFlinger can consume transactions according to the second transaction queue, synthesize animations, and display them on the terminal, thereby reducing the occurrence of animation frame drops and stuttering, improving the smoothness of animations, and thus improving the user's visual experience.

[0063] In some embodiments, a second transaction queue, which may be named transactions, may be created first, and then, during the process of traversing the preparation status of transactions in the first transaction queue, transactions with a preparation status of "ready to complete" may be stored in the second transaction queue.

[0064] Optionally, after step 204, this implementation method may further include: storing transactions whose preparation status is not yet complete into a third transaction queue.

[0065] In some embodiments, a third transaction queue can be used to store transactions that are not yet ready to complete, distinguishing them from the second transaction queue. Correspondingly, when a transaction in the third transaction queue is detected to be in a ready-to-complete state, the ready-to-complete transaction can be stored in the second transaction queue. Then, SurfaceFlinger consumes these transactions sequentially according to the second transaction queue to synthesize the animation. In this way, transactions are distinguished based on their ready state to consume ready-to-complete transactions, reducing animation frame drops and stuttering, improving animation smoothness, and thus enhancing the user's visual experience.

[0066] In some embodiments, a third transaction queue, which may be named mPendingTransactionQueues, may be created first. Then, during the process of traversing the preparation status of transactions in the first transaction queue, transactions with a preparation status of Not Ready are stored in the third transaction queue.

[0067] Optionally, after storing transactions in the preparation state as not yet ready to the third transaction queue, this implementation method may further include: traversing the preparation states of transactions in the third transaction queue; and storing transactions in the third transaction queue in the preparation state as ready to be completed to the second transaction queue.

[0068] In some embodiments, when the third transaction queue is detected to be non-empty, the third transaction queue can be traversed to obtain the preparation status of the transactions in the third transaction queue, and the transactions with the preparation status of "ready to complete" can be stored in the second transaction queue for consumption according to the second transaction queue, and the animation can be synthesized and displayed.

[0069] As one possible implementation method, such as Figure 3 The diagram shown is a sample flowchart. Figure 1 This diagram illustrates the queue data structure of the first transaction queue and its enqueue and dequeue methods. The first transaction queue contains a series of transaction objects, following a first-in, first-out (FIFO) principle. This means the transaction object that entered the queue earliest will be processed first, helping to maintain good order and consistency during animation frame processing. Correspondingly, transactions ready to complete can be stored in `transactions`, which can include transactions ready to complete in `mTransactionQueue` and `mPendingTransactionQueues`.

[0070] Specifically, queue operations can include enqueueing. During enqueueing, the SetTransactionState() function can be called to enqueue a transaction for later use. Specifically, when a new TransactionState object is added to the queue, it is placed at the tail of the queue. During this process, some performance tracking information may be recorded, such as the queue size, which can be represented as ATRACE_INT("TransactionQueue", mTransactionQueue.size()).

[0071] Accordingly, queue operations can include dequeueing. During the dequeueing process of `mTransactionQueue`, detection can begin from the head of the queue. When a transaction is detected to be ready in `mTransactionQueue`, it can be removed from the head of the queue, stored in `transactions`, and then applied to the corresponding layer. Similarly, some performance tracing information may be recorded during this process. For example, the dequeueing process of `mTransactionQueue` may include the following steps:

[0072] 1. Traverse mPendingTransactionQueues: If the transaction in the queue is in the Ready state, the transaction can be stored in transactions for later use;

[0073] 2. Traverse mTransactionQueue: If the transaction in the queue is in the Ready state, the transaction can be stored in transactions for later use; otherwise, the transaction is stored in mPendingTransactionQueues.

[0074] The `mPendingTransactionQueues` class stores transactions that are not yet ready for execution. Specifically, during the dequeueing process of `mTransactionQueue`, when a transaction is detected as not yet ready to complete, it can be removed from the head of `mTransactionQueue` and stored in `mPendingTransactionQueues`. Furthermore, the transaction status in `mPendingTransactionQueues` can be iterated. When a transaction is detected as ready to complete, it can be dequeued and stored in `transactions`. During this process, transactions can be associated with an application token to identify them, facilitating their movement from `mPendingTransactionQueues` to `transactions`.

[0075] Step 205: Consume the transactions in the second transaction queue to obtain the composite animation.

[0076] In some embodiments, a separate thread can be created to continuously retrieve transactions from the second transaction queue, apply the retrieved transactions to the corresponding layers, and then synthesize the animation according to a preset frame rate.

[0077] Optionally, the method in this embodiment may further include: generating an application token corresponding to the second transaction queue, wherein the application token is used to record the animation frame corresponding to the transaction in the second transaction queue.

[0078] In some embodiments, a unique application token can be assigned to each transaction in the second transaction queue, and the application token corresponding to the transaction can be stored in a set, for example, by creating an unordered set (std::unordered_set) named applyTokensWithAnimationReady. Accordingly, the application token can be a unique identifier for the transaction, used to identify the animation frame corresponding to the transaction.

[0079] Optionally, the method in this embodiment may further include: obtaining the latest received animation frame; comparing the latest received animation frame with the animation frame corresponding to the transaction in the second transaction queue based on the application token; and determining the preparation status of the latest received animation frame based on the comparison result.

[0080] Optionally, based on the comparison results, the preparation status of the latest received animation frame can be determined. Specifically, it may include: if the latest received animation frame has the same name as the animation frame corresponding to the transaction in the second transaction queue, then the preparation status of the latest received animation frame is determined to be not yet ready; if the latest received animation frame has a different name than the animation frame corresponding to the transaction in the second transaction queue, then the preparation status of the latest received animation frame is determined to be ready.

[0081] In some embodiments, after obtaining the latest received animation frame, it can be determined whether there is an animation frame with the same name in the second transaction queue by comparing the animation frame with the animation frame identified by the application token corresponding to the transaction in the second transaction queue.

[0082] As one possible implementation, if the newly received animation frame has the same name as the animation frame corresponding to a transaction in the second transaction queue, the preparation status of the newly received animation frame can be determined to be "not ready." After the animation frames with the same name in the second transaction queue have been executed, the preparation status of the newly received animation frame is checked. If the preparation status of the newly received animation frame is "ready," then the transaction corresponding to the newly received animation frame is processed. In this way, the newly received animation frame can be consumed after the animation frames in the second transaction queue, so that the newly received animation frame will not be consumed together with the animation frames in the second transaction queue. This reduces the possibility of animation frames with the same name being consumed at once, thereby reducing the occurrence of dropped frames and stuttering in the synthesized animation and improving the smoothness of the animation.

[0083] As one possible implementation, if the newly received animation frame has a different name than the animation frame corresponding to the transaction in the second transaction queue, the preparation status of the newly received animation frame can be determined to be ready. An application token corresponding to the animation frame is then generated and recorded in the set corresponding to the application token to mark the newly received animation frame. This facilitates the same-name judgment of subsequent received animation frames, helps reduce frame drops and stuttering in the synthesized animation, and improves the smoothness of the animation.

[0084] For example, such as Figure 4 The diagram shown is a sample flowchart. Figure 2 First, `applyTokensWithAnimationReady` is generated by iterating through `transactions`. `applyTokensWithAnimationReady(std::unordered_set)` records the animation frames present in the current `transactions`. This is used to determine if the `transactions` already contain an animation frame with the same name as the current transaction. If the `transactions` contain an animation frame with the same name as the current transaction (the transaction corresponding to the new animation frame), the preparation state of the current transaction can be set to NotReady and stored in `mPendingTransactionQueues`. If the `transactions` do not contain an animation frame with the same name as the current transaction, the animation frame in the current transaction is recorded in `applyTokensWithAnimationReady`. Correspondingly, `applyTokensWithAnimationReady` can be cleared after the `flushTransactions()` logic finishes. `flushTransactions()` can be used to process all transactions in the transaction queue and apply these transactions to the corresponding layers, i.e., to the screen. After processing all transactions, the transaction queue and the corresponding application tokens can be cleared to ensure that all transactions and tokens are processed correctly, reducing animation stuttering.

[0085] In specific application scenarios, the method of this embodiment can be used to conduct 30 rounds of testing on the startup animation and exit animation of 20 apps. The test results are shown in Table 1, which shows the comparison data before and after optimization using the method of this embodiment. Specifically, it can include data such as the number of dropped frames, the number of objective dropped frames, and the number of severe dropped frames. It can be seen that the method of this embodiment can effectively optimize the situation of continuous frame drops in animation and reduce the fluctuation of animation effects.

[0086] Table 1

[0087] Before optimization After optimization Comparison value promote(%) Frame drops 0.7 0.52 -0.18 25.71% Objective frame drops 0.06 0.02 -0.04 66.67% Severe frame drops 0.04 0.01 -0.03 75.00%

[0088] Compared with current related technologies, this embodiment can distinguish transactions according to their preparation status, store completed transactions in a second transaction queue, and obtain synthesized animation by consuming transactions in the second transaction queue. The application token is used to identify the animation frames corresponding to the transactions in the second transaction queue, so as to compare the latest received animation frames with the same name. If there is an animation frame with the same name in the second transaction queue, the preparation status of the latest received animation frame is determined to be not completed. Thus, after consuming the animation frames in the second transaction queue, the latest received animation frame is consumed, avoiding the situation of consuming animation frames with the same name. This reduces the occurrence of frame drops and stuttering in the synthesized animation, improves the smoothness of the animation and the user experience.

[0089] Figure 5 This is a block diagram illustrating an animation synthesis apparatus according to some embodiments of the present disclosure. (Refer to...) Figure 5 The device includes: an acquisition module 31, a storage module 32, and a synthesis module 33.

[0090] Module 31 is configured to retrieve the transaction corresponding to the animation frame;

[0091] Storage module 32 is configured to store transactions into the first transaction queue;

[0092] The compositing module 33 is configured to consume transactions based on the first transaction queue to obtain the composite animation.

[0093] In some embodiments, the compositing module 33 is specifically configured to traverse the preparation states of transactions in the first transaction queue; store transactions in the preparation state as completed into the second transaction queue; and consume the transactions in the second transaction queue to obtain the composite animation.

[0094] In some embodiments, the synthesis module 33 is further configured to store transactions in a ready state that are not ready to be completed into a third transaction queue.

[0095] In some embodiments, the storage module 32 is further configured to traverse the preparation status of transactions in the third transaction queue and store transactions in the third transaction queue whose preparation status is ready to be completed into the second transaction queue.

[0096] In some embodiments, the storage module 32 is further configured to generate an application token corresponding to the second transaction queue, the application token being used to record the animation frames corresponding to the transactions in the second transaction queue.

[0097] In some embodiments, the acquisition module 31 is further configured to acquire the latest received animation frame; compare the latest received animation frame with the animation frame corresponding to the transaction in the second transaction queue based on the application token; and determine the preparation status of the latest received animation frame based on the comparison result.

[0098] In some embodiments, the acquisition module 31 is specifically configured to determine that the preparation status of the latest received animation frame is not yet complete if the latest received animation frame has the same name as the animation frame corresponding to the transaction in the second transaction queue; and to determine that the preparation status of the latest received animation frame is complete if the latest received animation frame has a different name than the animation frame corresponding to the transaction in the second transaction queue.

[0099] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0100] It should be noted that other corresponding descriptions of the functional units involved in the terminal control device provided in this embodiment can be found in [reference]. Figures 1 to 2 The corresponding descriptions in [the document] will not be repeated here.

[0101] Based on the above, Figures 1 to 2 Accordingly, this embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. Figures 1 to 2 The method shown.

[0102] Based on this understanding, the technical solution of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive) and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods of various implementation scenarios of this disclosure.

[0103] Based on the above, Figures 1 to 2 The method shown, and Figure 5 To achieve the above objectives, this disclosure also provides an electronic device, such as a smartphone, smartwatch, smart bracelet, tablet computer, drone, intelligent robot, or other smart terminal. This device includes a storage medium and a processor; the storage medium stores a computer program; the processor executes the computer program to implement the above-described virtual device embodiments. Figures 1 to 2 The method shown.

[0104] Optionally, the aforementioned physical devices may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.

[0105] Those skilled in the art will understand that the physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.

[0106] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the aforementioned physical device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software in the information processing physical device.

[0107] Based on the above, Figures 1 to 2 The method shown, and Figure 5 The virtual device embodiment shown also provides a chip including one or more interface circuits and one or more processors; the interface circuits are used to receive signals from the memory of an electronic device and send the signals to the processors, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, it causes the electronic device to perform the above-described... Figures 1 to 2 The method shown.

[0108] Through the above description of the embodiments, those skilled in the art can clearly understand that this disclosure can be implemented using software plus necessary general-purpose hardware platforms, or it can be implemented in hardware. By applying the scheme of this embodiment, transactions can be distinguished according to their preparation status, and transactions that have completed preparation can be stored in a second transaction queue. By consuming transactions in the second transaction queue, a composite animation is obtained, and the animation frames corresponding to the transactions in the second transaction queue are identified using application tokens. This allows for a comparison with the latest received animation frame for the same name. If an animation frame with the same name exists in the second transaction queue, the preparation status of the latest received animation frame is determined to be incomplete. Thus, after consuming the animation frames in the second transaction queue, the latest received animation frame is consumed, avoiding the consumption of animation frames with the same name. This reduces the occurrence of frame drops and stuttering in the composite animation, improves the smoothness of the animation, and enhances the user experience.

[0109] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0110] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. An animation synthesis method, characterized in that, include: Retrieve the transaction corresponding to the animation frame; Store the transaction in the first transaction queue; The synthesized animation is obtained by consuming transactions based on the first transaction queue.

2. The method according to claim 1, characterized in that, The process of consuming transactions based on the first transaction queue to obtain a composite animation includes: Iterate through the preparation status of transactions in the first transaction queue; Store the transactions that are ready to be completed in the second transaction queue; Consume the transactions in the second transaction queue to obtain the composite animation.

3. The method according to claim 2, characterized in that, After traversing the preparation states of transactions in the first transaction queue, the method further includes: Transactions whose readiness status is not yet complete are stored in the third transaction queue.

4. The method according to claim 3, characterized in that, The method further includes: Iterate through the preparation status of transactions in the third transaction queue; Transactions in the third transaction queue that are ready to be completed are stored in the second transaction queue.

5. The method according to any one of claims 2 to 4, characterized in that, The method further includes: Generate an application token corresponding to the second transaction queue. The application token is used to record the animation frames corresponding to the transactions in the second transaction queue.

6. The method according to claim 5, characterized in that, The method further includes: Get the latest received animation frame; Based on the application token, the latest received animation frame is compared with the animation frame corresponding to the transaction in the second transaction queue; Based on the comparison results, the preparation status of the latest received animation frame is determined.

7. The method according to claim 6, characterized in that, Determining the preparation status of the latest received animation frame based on the comparison results includes: If the latest received animation frame has the same name as the animation frame corresponding to the transaction in the second transaction queue, then the preparation status of the latest received animation frame is determined to be not ready. If the name of the latest received animation frame is different from the name of the animation frame corresponding to the transaction in the second transaction queue, then the preparation status of the latest received animation frame is determined to be ready.

8. An animation synthesis device, characterized in that, include: The acquisition module is configured to acquire transactions corresponding to animation frames. The storage module is configured to store the transaction into a first transaction queue; The compositing module is configured to consume transactions based on the first transaction queue to obtain a composite animation.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.

10. An electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.

11. A chip, characterized in that, The device includes one or more interface circuits and one or more processors; the interface circuits are configured to receive signals from the memory of an electronic device and send the signals to the processors, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs the method according to any one of claims 1 to 7.