Animation generation method and device, electronic equipment and storage medium

CN115345964BActive Publication Date: 2026-10-30ZHEJIANG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210794550.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-05
Publication Date
2026-10-30
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

[0004]本公开提供一种动画生成方法、装置、电子设备及存储介质,以至少解决相关技术中由于量化效率低导致的动画生成效率低的问题

Benefits of technology

[0107]本公开在需要生成动画时,确定目标动画场景对应的目标量化位数;目标量化位数是基于目标仿真梯度信息以及量化间隔参数构建的量化误差信息得到的,目标仿真梯度信息基于原始仿真对象在各个仿真状态下的原始仿真数据,以及目标函数进行反向传播得到;原始仿真数据能够表征原始仿真对象的属性在相应仿真状态下的属性数据,目标函数表征目标动画场景下的仿真基准信息;从而实现了在确定量化方案时,基于目标仿真梯度信息对原始仿真数据的自动量化,即自动确定出目标量化位数,无需人工确定量化方案,提高了数据量化效率以及量化准确性;进一步地,基于预先确定好的目标量化位数对实际仿真数据进行量化以生成相应的动画,能够提高动画的生成效率,另外,实际仿真对象的数量大于原始仿真对象的数量,从而实现基于少量原始仿真对象进行目标量化位数的确定,然后采用目标量化位数对大量实际仿真对象的实际仿真数据进行量化,能够实现在提高目标量化位数确定效率的基础上,实现高分辨率的动画仿真,提高动画视觉效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115345964B_ABST
    Figure CN115345964B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an animation generation method and device, electronic equipment and storage medium. The method comprises: determining a target quantization bit number corresponding to a target animation scene; the target quantization bit number is obtained based on quantization error information constructed based on target simulation gradient information and a quantization interval parameter; the target simulation gradient information is obtained based on original simulation data of an original simulation object in each simulation state and a target function through back propagation; actual simulation data of an actual simulation object in each simulation state is generated; the number of the actual simulation object is greater than the number of the original simulation object; the actual simulation data is quantized into quantized simulation data of the target quantization bit number; and a target animation is generated based on the quantized simulation data. The present disclosure can improve the generation efficiency of the animation and facilitate the realization of high-resolution animation simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In computer graphics, high-resolution physical simulation can achieve excellent visual effects, and higher resolution can bring richer details; quantization is a technique to achieve high-resolution physical simulation.

[0003] In related technologies, quantization requires users to manually design quantization schemes. These schemes may include determining the number of quantization bits and the quantization range, and involve continuous simulation and trial-and-error to obtain a suitable scheme. To accurately assess the impact of the quantization scheme on simulation quality, repeated simulations under different parameters are necessary during this process. Furthermore, the search space grows exponentially with the increase in quantized data. Additionally, quantizing physical properties with unclear physical meaning is difficult, leading to low quantization efficiency and inaccurate results. Consequently, when generating animations based on the quantization results, the animation generation efficiency is low. Summary of the Invention

[0004] This disclosure provides an animation generation method, apparatus, electronic device, and storage medium to at least solve the problem of low animation generation efficiency caused by low quantization efficiency in related technologies. The technical solution of this disclosure is as follows:

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

[0006] The target quantization bit depth corresponding to the target animation scene is determined; the target quantization bit depth is obtained based on the quantization error information constructed from the target simulation gradient information and the quantization interval parameter; the target simulation gradient information is obtained based on the original simulation data of the original simulation object in each simulation state and the objective function through backpropagation; the original simulation data represents the attribute data of the original simulation object in the corresponding simulation state; the objective function represents the simulation baseline information under the target animation scene;

[0007] Generate actual simulation data of the actual simulation objects under various simulation states; the number of actual simulation objects is greater than the number of original simulation objects.

[0008] The actual simulation data is quantized into quantized simulation data with the target quantization bit depth;

[0009] The target animation is generated based on the quantized simulation data.

[0010] In an exemplary embodiment, before determining the target quantization bit depth corresponding to the target animation scene, the method further includes:

[0011] When the first quantization constraint condition is that the quantization error information is less than or equal to the preset error information, a first constraint term is constructed based on the quantization error information and the preset error information.

[0012] Based on the attribute type of the original simulation object and the quantization bit depth parameter, a quantization memory consumption item is constructed; the quantization bit depth parameter is determined based on the quantization interval parameter.

[0013] Based on the first constraint term and the quantization memory consumption term, a first optimization function is constructed;

[0014] Based on the solution of the first optimization function, the target quantization interval corresponding to the quantization interval parameter is determined.

[0015] In an exemplary embodiment, before determining the target quantization bit depth corresponding to the target animation scene, the method further includes:

[0016] When the second quantization constraint is that the quantization memory consumption is less than or equal to the preset memory consumption, a second constraint term is constructed based on the quantization memory consumption and the preset memory consumption; the quantization memory consumption is determined based on the attribute type of the original simulation object and the quantization bit depth parameter; the quantization bit depth parameter is determined based on the quantization interval parameter.

[0017] Based on the quantization error information, an error information item is constructed;

[0018] Based on the error information term and the second constraint term, a second optimization function is constructed;

[0019] Based on the solution of the second optimization function, the target quantization interval corresponding to the quantization interval parameter is determined.

[0020] In one exemplary embodiment, the method further includes:

[0021] Based on the original simulation data, determine the original data range of the attributes of the original simulation object;

[0022] The original data range is expanded to obtain the target data range;

[0023] The target quantization bit depth is determined based on the target quantization interval and the target data range.

[0024] In one exemplary embodiment, the method further includes:

[0025] If the original simulation data of the original simulation object in the current simulation state is not stored, the current leaf node corresponding to the current simulation state is determined from the target simulation binary tree; the target simulation binary tree is adapted to the simulation process of the original simulation object in each simulation state;

[0026] The nearest ancestor node to the current leaf node is determined from the target simulation binary tree; the ancestor node stores the original simulation data of the original simulation object in the historical simulation states before the current simulation state;

[0027] The original simulation object is simulated from the historical simulation state to obtain the original simulation data of the original simulation object in the current simulation state;

[0028] Based on the original simulation data of the original simulation object under various simulation states, and by taking the derivative of the objective function, the target simulation gradient information is obtained.

[0029] In one exemplary embodiment, the original simulation object has attributes of multiple attribute types;

[0030] The process of obtaining the target simulation gradient information by taking the derivative of the objective function based on the original simulation data of the original simulation object under various simulation states includes:

[0031] Based on the attribute data of the various attribute types of the original simulation object in each simulation state, and the objective function, the derivative information of each attribute type in each simulation state is obtained by performing derivative processing.

[0032] For each simulation state, the derivative information corresponding to each of the various attribute types is summed to obtain the simulation gradient information corresponding to each attribute type;

[0033] The target simulation gradient information is obtained based on the simulation gradient information corresponding to each attribute type.

[0034] In one exemplary embodiment, each original simulation object has attributes of at least one attribute type, and the quantization bit parameter includes quantization bit parameters corresponding to each attribute type respectively;

[0035] The method further includes:

[0036] Determine the original simulation object corresponding to each attribute type; the original simulation object has attributes of the corresponding attribute type;

[0037] Based on the number of original simulation objects corresponding to each attribute type and the quantization bit depth parameter corresponding to each attribute type, the quantization memory consumption of each attribute type is obtained;

[0038] Based on the quantization memory consumption for each attribute type, the quantization memory consumption of the original simulation data is obtained.

[0039] In an exemplary embodiment, after quantizing the actual simulation data into quantized simulation data with the target quantization bit depth, the method further includes:

[0040] Determine the number of remaining fields in the current storage container; each storage container is used to store data of a preset number of bits.

[0041] If the number of remaining fields is less than the target quantization bit depth, the quantization simulation data is split to obtain first storage data and second storage data; the bit depth of the first storage data is the same as the number of remaining fields.

[0042] The first storage data is stored in the current storage container, and the second storage data is stored in the next storage container; the next storage container is the storage container that is adjacent to the current storage container and located after the current storage container.

[0043] In one exemplary embodiment, the method further includes:

[0044] Determine the starting position of the quantized simulation data to be read in the first storage container and the ending position in the second storage container; the first storage container and the second storage container are adjacent to each other;

[0045] A first mask is generated based on the starting position, and a second mask is generated based on the ending position;

[0046] Based on the first mask and the second mask, the quantization simulation data is read.

[0047] In an exemplary embodiment, quantizing the actual simulation data into quantized simulation data with the target quantization bit depth includes:

[0048] Generate simulated random numbers that follow a uniform distribution;

[0049] The actual simulation data is mapped based on the actual quantization interval to obtain mapped simulation data; the actual quantization interval is determined based on the target quantization bit depth and the actual data range of the actual simulation data.

[0050] The sum of the mapped simulation data and the simulation random number is rounded down to obtain the quantized simulation data.

[0051] In one exemplary embodiment, generating the target animation based on the quantized simulation data includes:

[0052] Based on the actual quantization interval, the quantization simulation data is inversely mapped to obtain the target simulation data;

[0053] The target animation is generated based on the target simulation data.

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

[0055] The target quantization bit depth determination unit is configured to determine the target quantization bit depth corresponding to the target animation scene. The target quantization bit depth is obtained based on quantization error information constructed from target simulation gradient information and quantization interval parameters. The target simulation gradient information is obtained by backpropagation of the original simulation object's original simulation data under various simulation states and the objective function. The original simulation data represents the attribute data of the original simulation object under the corresponding simulation state. The objective function represents the simulation baseline information under the target animation scene.

[0056] The actual simulation data generation unit is configured to generate actual simulation data of actual simulation objects under various simulation states; the number of actual simulation objects is greater than the number of original simulation objects.

[0057] The data quantization unit is configured to perform quantization of the actual simulation data into quantized simulation data with the target quantization bit depth;

[0058] The first generation unit is configured to generate a target animation based on the quantized simulation data.

[0059] In one exemplary embodiment, the apparatus further includes:

[0060] The first construction unit is configured to construct a first constraint term based on the quantization error information and the preset error information when the first quantization constraint condition is that the quantization error information is less than or equal to the preset error information.

[0061] The second construction unit is configured to execute the attribute type based on the properties of the original simulation object and the quantization bit parameter to construct a quantization memory consumption item; the quantization bit parameter is determined based on the quantization interval parameter.

[0062] The third building unit is configured to execute the construction of a first optimization function based on the first constraint term and the quantized memory consumption term;

[0063] The first solution unit is configured to execute the function solution based on the first optimization function to determine the target quantization interval corresponding to the quantization interval parameter.

[0064] In one exemplary embodiment, the apparatus further includes:

[0065] The fourth construction unit is configured to construct a second constraint term based on the quantization memory consumption and the preset memory consumption when the second quantization constraint condition is that the quantization memory consumption is less than or equal to the preset memory consumption; the quantization memory consumption is determined based on the attribute type of the original simulation object's attributes and the quantization bit depth parameter; the quantization bit depth parameter is determined based on the quantization interval parameter.

[0066] The fifth construction unit is configured to construct an error information item based on the quantization error information;

[0067] The sixth construction unit is configured to construct a second optimization function based on the error information term and the second constraint term;

[0068] The second solving unit is configured to execute a function solution based on the second optimization function to determine the target quantization interval corresponding to the quantization interval parameter.

[0069] In one exemplary embodiment, the apparatus further includes:

[0070] The original data range determination unit is configured to perform the determination of the original data range of the attributes of the original simulation object based on the original simulation data;

[0071] The range expansion unit is configured to perform range expansion on the original data range to obtain the target data range;

[0072] The target quantization bit depth determination unit is configured to determine the target quantization bit depth based on the target quantization interval and the target data range.

[0073] In one exemplary embodiment, the apparatus further includes:

[0074] The leaf node determination unit is configured to determine the current leaf node corresponding to the current simulation state from the target simulation binary tree when the original simulation data of the original simulation object in the current simulation state is not stored; the target simulation binary tree is adapted to the simulation process of the original simulation object in each simulation state.

[0075] An ancestor node determination unit is configured to determine the ancestor node closest to the current leaf node from the target simulation binary tree; the ancestor node stores the original simulation data of the original simulation object in historical simulation states before the current simulation state.

[0076] The simulation unit is configured to perform a simulation of the original simulation object from the historical simulation state to obtain the original simulation data of the original simulation object in the current simulation state;

[0077] The first differentiation unit is configured to perform differentiation based on the original simulation data of the original simulation object under various simulation states and the objective function to obtain the target simulation gradient information.

[0078] In one exemplary embodiment, the original simulation object has attributes of multiple attribute types;

[0079] The first differentiation unit includes:

[0080] The second differentiation unit is configured to perform differentiation processing on the attribute data of the multiple attribute types of the original simulation object in each simulation state, as well as the objective function, to obtain the derivative information corresponding to the attributes of the multiple attribute types in each simulation state.

[0081] The summation unit is configured to sum the derivative information corresponding to each of the multiple attribute types for each simulation state to obtain the simulation gradient information corresponding to each attribute type.

[0082] The target simulation gradient determination unit is configured to execute simulation gradient information based on the corresponding simulation gradient information for each attribute type to obtain the target simulation gradient information.

[0083] In one exemplary embodiment, each original simulation object has attributes of at least one attribute type, and the quantization bit parameter includes quantization bit parameters corresponding to each attribute type respectively;

[0084] The device further includes:

[0085] The first determining unit is configured to determine the original simulation object corresponding to each attribute type; the original simulation object has attributes of the corresponding attribute type.

[0086] The second determining unit is configured to perform quantization memory consumption for each attribute type based on the number of original simulation objects corresponding to each attribute type and the quantization bit depth parameter corresponding to each attribute type.

[0087] The quantization memory consumption determination unit is configured to perform quantization memory consumption based on each attribute type to obtain the quantization memory consumption after quantizing the original simulation data.

[0088] In one exemplary embodiment, the apparatus further includes:

[0089] The remaining field count determination unit is configured to determine the remaining field count of the current storage container; each storage container is used to store data of a preset number of bits.

[0090] The data splitting unit is configured to split the quantization simulation data to obtain first storage data and second storage data when the number of remaining fields is less than the target quantization bit depth; the bit depth of the first storage data is consistent with the number of remaining fields.

[0091] The storage unit is configured to perform the operation of storing the first storage data into the current storage container and storing the second storage data into a next storage container; the next storage container is a storage container that is adjacent to the current storage container and located after the current storage container.

[0092] In one exemplary embodiment, the apparatus further includes:

[0093] A storage location unit is configured to determine the starting position of the quantized simulation data to be read in a first storage container and the ending position in a second storage container; the first storage container and the second storage container are adjacent to each other.

[0094] The mask generation unit is configured to generate a first mask based on the starting position and a second mask based on the ending position;

[0095] The reading unit is configured to read the quantization simulation data based on the first mask and the second mask.

[0096] In one exemplary embodiment, the data quantization unit includes:

[0097] The random number generation unit is configured to generate simulated random numbers that follow a uniform distribution;

[0098] The data mapping unit is configured to perform data mapping on the actual simulation data based on the actual quantization interval to obtain mapped simulation data; the actual quantization interval is determined based on the target quantization bit depth and the actual data range of the actual simulation data.

[0099] The rounding unit is configured to perform rounding processing on the sum of the mapped simulation data and the simulation random number to obtain the quantized simulation data.

[0100] In one exemplary embodiment, the first generation unit includes:

[0101] The data inverse mapping unit is configured to perform data inverse mapping on the quantized simulation data based on the actual quantization interval to obtain the target simulation data;

[0102] The second generation unit is configured to generate the target animation based on the target simulation data.

[0103] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the animation generation method described above.

[0104] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided that, when instructions in the computer-readable storage medium are executed by a processor of a server, enables the server to perform the animation generation method as described above.

[0105] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product including a computer program stored in a readable storage medium, wherein at least one processor of a computer device reads from the readable storage medium and executes the computer program, causing the device to perform the above-described animation generation method.

[0106] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:

[0107] This disclosure determines the target quantization bit depth for a target animation scene when animation generation is required. The target quantization bit depth is obtained based on quantization error information constructed from target simulation gradient information and quantization interval parameters. The target simulation gradient information is obtained by backpropagation of the original simulation data of the original simulation object in various simulation states and the objective function. The original simulation data can characterize the attribute data of the original simulation object in the corresponding simulation state, and the objective function characterizes the simulation baseline information under the target animation scene. This achieves automatic quantization of the original simulation data based on the target simulation gradient information when determining the quantization scheme, i.e., automatically determining the target quantization bit depth without manual determination of the quantization scheme, thus improving the data quantization efficiency and accuracy. Furthermore, quantizing the actual simulation data based on the pre-determined target quantization bit depth to generate the corresponding animation can improve the animation generation efficiency. In addition, the number of actual simulation objects is greater than the number of original simulation objects, thus achieving the determination of the target quantization bit depth based on a small number of original simulation objects, and then using the target quantization bit depth to quantize the actual simulation data of a large number of actual simulation objects. This can achieve high-resolution animation simulation and improve the animation visual effect while improving the efficiency of determining the target quantization bit depth.

[0108] 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

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

[0110] Figure 1 This is a schematic diagram illustrating an application scenario according to an exemplary embodiment.

[0111] Figure 2 This is a flowchart illustrating a simulation data quantization method according to an exemplary embodiment.

[0112] Figure 3 This is a flowchart illustrating a method for solving the quantization interval under error information constraints, according to an exemplary embodiment.

[0113] Figure 4 This is a flowchart illustrating a method for solving the quantization interval under the constraint of quantization consumption memory, according to an exemplary embodiment.

[0114] Figure 5 This is a flowchart illustrating a method for calculating the memory consumption of quantization after quantizing the original simulation data, according to an exemplary embodiment.

[0115] Figure 6 This is a flowchart illustrating a data range expansion method according to an exemplary embodiment.

[0116] Figure 7 This is a flowchart illustrating a method for calculating simulation gradients according to an exemplary embodiment.

[0117] Figure 8 This is a schematic diagram illustrating backpropagation based on a target simulated binary tree according to an exemplary embodiment.

[0118] Figure 9 This is a flowchart illustrating a method for calculating target simulation gradient information based on attributes of various attribute types, according to an exemplary embodiment.

[0119] Figure 10 This is a flowchart illustrating an animation generation method according to an exemplary embodiment.

[0120] Figure 11 This is a flowchart illustrating a method for storing quantized simulation data according to an exemplary embodiment.

[0121] Figure 12 This is a flowchart illustrating a method for reading quantitative simulation data according to an exemplary embodiment.

[0122] Figure 13 This is a schematic diagram illustrating data reading according to an exemplary embodiment.

[0123] Figure 14 This is a flowchart illustrating a quantization method for quantizing actual simulation data to a target quantization bit depth, according to an exemplary embodiment.

[0124] Figure 15 This is a flowchart illustrating another animation generation method according to an exemplary embodiment.

[0125] Figure 16 This is a block diagram illustrating an animation generation apparatus according to an exemplary embodiment.

[0126] Figure 17 This is a schematic diagram of an electronic device structure according to an exemplary embodiment. Detailed Implementation

[0127] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0128] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent 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.

[0129] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0130] Please see Figure 1 The illustration shows an implementation environment provided by an embodiment of the present disclosure. The implementation environment may include: an animation display terminal 110 and an animation data quantization terminal 120, which can communicate with each other via a network.

[0131] Specifically, the animation display terminal 110 can pre-determine the quantization bit depth for different animation scenes; in this embodiment, the animation scenes may include fluid animation simulation scenes, smoke animation simulation scenes, elastic body animation simulation scenes, etc. The animation data quantization terminal 120 can send an animation data acquisition request to the animation display terminal 110. The animation acquisition request may carry the target animation scene and the number of actual simulation objects; the animation data generation terminal can determine the target quantization bit depth for the corresponding scene based on the target animation scene, perform simulation based on the number of actual simulation objects, and obtain actual simulation data; quantize the actual simulation data into quantized simulation data with the target quantization bit depth, then generate the target animation based on the quantized simulation data, and send the target animation to the animation display terminal 110 so that the animation data quantization terminal 120 can display the target animation. The target animation can refer to animation data, which can be data used to support the animation display terminal 110 in displaying the animation.

[0132] In another embodiment, the target animation can also refer to the animation effect that is directly displayed. For example, the animation data quantization terminal 120 can also display the target animation based on the quantized simulation data.

[0133] The animation display terminal 110 can communicate with the animation data quantization terminal 120 based on a browser / server (B / S) mode or a client / server (C / S) mode. The animation display terminal 110 may include physical devices such as smartphones, tablets, laptops, digital assistants, smart wearable devices, in-vehicle terminals, and servers, and may also include software running on the physical device, such as applications. The operating system running on the animation display terminal 110 in this embodiment may include, but is not limited to, Android, iOS, Linux, and Windows.

[0134] The animation data quantization terminal 120 and the animation display terminal 110 can establish a communication connection via wired or wireless means. The animation data quantization terminal 120 may include an independently operating server, a distributed server, or a server cluster composed of multiple servers, wherein the server may be a cloud server.

[0135] To address the issues of low quantization efficiency and inaccuracy in simulation data quantization in related technologies, this disclosure provides a simulation data quantization method. The executing entity can be the aforementioned animation data quantization terminal. For details, please refer to... Figure 2 The method may include:

[0136] S210. Based on the original simulation data of the original simulation object in each simulation state in the target animation scene, and the objective function, backpropagation is performed to obtain the target simulation gradient information; the objective function represents the simulation benchmark information in the target animation scene.

[0137] In this embodiment, the simulation object can refer to the simulated particles or Eulerian mesh used to generate the animation. That is, by simulating the motion state of the simulated particles or the changes in the Eulerian mesh, animation can be generated based on the corresponding simulation data. The original simulation object can be the simulation object used to determine the target quantization bit depth. When determining the target quantization bit depth, a small number of simulation objects can be simulated to obtain the original simulation data.

[0138] The original simulation data can characterize the attribute data of the original simulation object in the corresponding simulation state. Taking a simulation particle as an example, the attributes of the simulation particle can include position, velocity, acceleration, etc. Therefore, when the simulation particle is simulated in each simulation state based on the simulation algorithm, the attribute data of the simulation particle's position, velocity, acceleration, etc. in the corresponding simulation state can be obtained. In this embodiment, the simulation state can be a time-based state, that is, the simulation data of the previous simulation state can be used as the starting simulation data of the current simulation state.

[0139] Furthermore, differentiable physics simulation algorithms can be used to simulate the original simulation object, and the resulting original simulation data can be full-precision simulation data. In this embodiment, the full-precision simulation data can specifically be IEEE 754 standard single-precision or double-precision floating-point numbers. The objective function in this embodiment can characterize the simulation benchmark information under the target animation scene. Substituting the full-precision simulation data into the objective function yields the full-precision objective function value, which can be used as the simulation benchmark value under the target animation scene. When simulating particles, the objective function can be determined based on the kinetic energy calculation formula of the simulated particles. Substituting the full-precision simulation data into the objective function yields the simulation benchmark value of the particle simulation under the target animation scene. Alternatively, when simulating incompressible fluids, the objective function can be determined based on the volume calculation formula of incompressible fluids. Substituting the full-precision simulation data into the objective function yields the simulation benchmark value of the fluid simulation under the target animation scene. In this embodiment, the objective function value corresponding to the full-precision simulation data can be used as the benchmark value for subsequent quantization data. That is, the objective function value corresponding to the full-precision simulation data can be compared with the objective function value corresponding to the quantized data to determine the corresponding quantization error information. The quantization error information can measure the degree of distortion of the quantization simulation.

[0140] When calculating the target simulation gradient information based on the original simulation data and the objective function, the partial derivative of the objective function with respect to the original simulation data under each simulation state can be calculated, thereby obtaining the target simulation gradient information of the properties of the original simulation object.

[0141] S220. Construct quantization error information based on the target simulation gradient information and quantization interval parameters.

[0142] S230. Determine the target quantization bit depth based on the quantization error information.

[0143] In this embodiment, the quantization interval parameter can be an unknown variable, which can be used together with the target simulation gradient information to construct quantization error information. That is, the quantization error information contains the unknown variable of the quantization interval parameter. Therefore, when determining the target quantization bit depth based on the quantization error information, the quantization interval corresponding to the quantization interval parameter can be solved first, and then the target quantization bit depth can be determined based on the quantization interval.

[0144] Specifically, the quantization error information can be represented by the expectation of the quantization error. Based on the uncertainty propagation principle, the quantization error information can be constructed as shown in equation (1):

[0145]

[0146] In the case where the original simulation object has attributes of multiple attribute types, Δh is the quantization interval of the h-th attribute type, and g h Let H be the simulation gradient information of the attribute of the h-th attribute type, where H is the number of attribute types, and E[·] represents the mathematical expectation.

[0147] Therefore, the simulation data quantization method described above can realize the automatic quantization of the original simulation data based on the target simulation gradient information, that is, automatically determine the target quantization bit depth without the need for manual determination of the quantization scheme, thereby improving the data quantization efficiency and accuracy.

[0148] As can be seen from the above content of this embodiment, the quantization interval can be solved based on the quantization error information, and then the target quantization bit depth can be calculated based on the solved quantization interval. In actual quantization scenarios, two aspects of quantization constraints can be considered: one is the error information constraint after quantization of the simulation data, and the other is the storage memory consumption of the quantized simulation data. Therefore, the quantization interval can be solved separately under the corresponding constraints, that is, the quantization interval obtained under different constraints may be different.

[0149] Please see Figure 3 It illustrates a method for solving the quantization interval under error information constraints, which may include:

[0150] S310. When the first quantization constraint condition is that the quantization error information is less than or equal to the preset error information, a first constraint term is constructed based on the quantization error information and the preset error information.

[0151] S320. Based on the attribute type of the original simulation object and the quantization bit depth parameter, construct a quantization memory consumption item; the quantization bit depth parameter is determined based on the quantization interval parameter.

[0152] S330. Based on the first constraint term and the quantization memory consumption term, construct a first optimization function.

[0153] S340. Based on the function solution of the first optimization function, determine the target quantization interval corresponding to the quantization interval parameter.

[0154] Under the constraint of error information, the memory consumption for storing the quantized data can be minimized, and the constraint relationship is shown in equation (2):

[0155]

[0156] Where, in the case that the original simulation object has attributes of multiple attribute types, H is the number of attribute types, and P is the number of attribute types. h Let b be the number of original objects with attributes of the h-th attribute type, which is also the number of attributes of the h-th attribute type. h The number of quantization bits for the h-th attribute type. Where R h For the quantized target data range, since Δh can be an unknown variable, in R h Given that, b h It can also be an unknown variable, z = Z(s0,s1,…,s T ) is the objective function value corresponding to the full-precision simulation data, s i Representing the i-th simulation state, it can be used To measure quantization error information, ε represents the quantized i-th simulation state. err This is the preset target error.

[0157] The first constraint term is E[δz]<(ε) err ·z) 2 The quantified memory consumption item is The first optimization function can be constructed based on the Lagrange multiplier method, as shown in equation (3):

[0158]

[0159] Equation (3) includes the unknown variable Δh. Solving for the extreme values ​​of equation (3) yields the following results.

[0160]

[0161] in, This indicates rounding up to the nearest integer.

[0162] In this embodiment, the first optimization function is constructed based on the Lagrange multiplier method. In the specific implementation process, other methods can also be used to construct the first optimization function, as long as it can achieve the extremum of Δh, such as the elimination method.

[0163] Thus, the above method achieves the goal of minimizing the memory consumption for storing quantized data under the constraint that the quantization error information does not exceed the preset upper limit of error information, thereby improving memory utilization.

[0164] Please see Figure 4 It illustrates a method for solving the quantization interval under the constraint of quantization consumption memory, which may include:

[0165] S410. When the second quantization constraint condition is that the quantization memory consumption is less than or equal to the preset memory consumption, a second constraint term is constructed based on the quantization memory consumption and the preset memory consumption; the quantization memory consumption is determined based on the attribute type of the original simulation object and the quantization bit depth parameter; the quantization bit depth parameter is determined based on the quantization interval parameter.

[0166] S420. Based on the quantization error information, construct an error information item.

[0167] S430. Based on the error information term and the second constraint term, construct a second optimization function.

[0168] S440. Based on the function solution of the second optimization function, determine the target quantization interval corresponding to the quantization interval parameter.

[0169] Under the constraint of quantization memory consumption, the quantization error information can be minimized, and the constraint relationship is shown in equation (4):

[0170]

[0171] Where M is the memory consumption when using single-precision floating-point numbers as the base, and ε mem This is the preset target compression ratio. The second constraint term is P. h b h <ε mem ·M, the error information term is E[δz], and the corresponding second optimization function can be constructed based on the Lagrange multiplier method, as shown in equation (5):

[0172]

[0173] Equation (5) contains the unknown variable Δh. Solving for the extreme values ​​of equation (5) yields the following results.

[0174]

[0175] in, This indicates rounding down to the nearest integer.

[0176] In this embodiment, a second optimization function is constructed based on the Lagrange multiplier method. In the specific implementation process, other methods can also be used to construct the second optimization function, as long as it can achieve the extremum of Δh, such as the elimination method.

[0177] Thus, the above method enables the quantization interval obtained to minimize quantization error information under the constraint that the quantization memory consumption does not exceed the preset memory consumption, thereby improving the accuracy of simulation data quantization.

[0178] This disclosure provides two modes for solving quantization schemes: error bound constraints and memory consumption constraints. Users can flexibly choose the solution mode according to different requirements for simulation error or memory consumption in actual applications to obtain a usable quantization scheme.

[0179] When each original simulation object has at least one attribute type, and the quantization bit depth parameter includes quantization bit depth parameters corresponding to each attribute type, the method for calculating the memory consumption of quantization after quantizing the original simulation data can be found in [reference needed]. Figure 5 The method may include:

[0180] S510. Determine the original simulation object corresponding to each attribute type; the original simulation object has attributes of the corresponding attribute type.

[0181] S520. Based on the number of original simulation objects corresponding to each attribute type and the quantization bit depth parameter corresponding to each attribute type, the quantization memory consumption of each attribute type is obtained.

[0182] S530. Based on the quantization memory consumption of each attribute type, obtain the quantization memory consumption of the original simulation data after quantization.

[0183] Quantization memory consumption represents the memory consumed in storing the quantized data from the original simulation data. When the specific value of the quantization bit depth is not determined, a quantization bit depth parameter can be used to represent it. This parameter can be an unknown variable, and its solution is constrained by quantization error information or quantization memory consumption. The quantization bit depth may be the same or different for different attribute types.

[0184] The attribute types of each original simulation object may be the same or different. For example, original object A has attributes of type 1, type 2, and type 3; original object B has attributes of type 1 and type 3; and original object C has attributes of type 1, type 2, and type 3. This allows us to determine the original simulation object corresponding to each attribute type. Then, based on the number of original simulation objects corresponding to each attribute type and the quantization bit depth parameter corresponding to each attribute type, we can obtain the quantization memory consumption for each attribute type. In other words, the quantization memory consumption for each attribute type needs to be calculated separately.

[0185] When determining the quantization memory consumption after quantizing the original simulation data, the quantization memory consumption of each attribute type can be directly summed; alternatively, a weighted summation of the quantization memory consumption of each attribute type can be performed. The weight of each attribute type can be determined based on the number of original simulation objects corresponding to that attribute type. For example, the larger the number of original simulation objects, the larger the weight of the corresponding attribute type, and vice versa.

[0186] Specifically, the memory consumption of the quantization after quantization of the original simulation data can be calculated using equation (6):

[0187]

[0188] Among them, P h Let b be the number of original objects with attributes of the h-th attribute type, which is also the number of attributes of the h-th attribute type. h The quantization bit depth of the h-th attribute type.

[0189] Since the number of original objects and the quantization bit depth parameters are different for each attribute type, the quantization memory consumption for each attribute type is calculated separately, and then the quantization memory consumption for each attribute type is combined to obtain the quantization memory consumption after quantizing the original simulation data, which improves the accuracy of quantization memory consumption calculation.

[0190] Based on the full-precision original simulation data, the corresponding original data range can be determined. However, the quantized data may overflow the data range, so it is necessary to process the original data range; please refer to [link / reference needed] for details. Figure 6 It illustrates a data range extension method, which may include:

[0191] S610. Based on the original simulation data, determine the original data range of the attributes of the original simulation object.

[0192] S620. Extend the original data range to obtain the target data range.

[0193] The original data range can be determined based on the data range of the original simulation data. It can traverse the attribute data of the attribute under multiple simulation states, update the maximum value of the absolute value of the attribute data based on the attribute data of the currently accessed attribute, and finally determine the target maximum value of the absolute value of the attribute data. Then, the target maximum value is expanded by a preset multiplier to obtain the expanded value. Thus, the determined target data range can be from the negative expanded value to the positive expanded value.

[0194] Specifically, the target maximum value is a (a>0), the preset multiplier is b (b>1), thus expanding the value to a*b, and the target data range is -a*b to a*b, where the preset internal rate b can be any value from 1.5 to 2.0.

[0195] By expanding the original data range, the resulting target data range is made compatible with the quantized data, preventing data overflow and improving the accuracy of the quantized data. Once the target data range is determined, the target quantization bit depth can be determined based on the target quantization interval and the target data range. This means that while improving the accuracy of the quantized data, the target quantization bit depth is also determined, further enhancing the accuracy of the quantization bit depth determination.

[0196] In one optional embodiment, during the simulation of the original simulation object, the original simulation data of the original simulation object in various simulation states can be obtained. Storing all the simulation data would consume a large amount of memory; therefore, only the original simulation data in some simulation states can be stored. When the original simulation data in the unstored simulation states is needed, the simulation can be recalculated based on the stored original simulation data to obtain the original simulation data in the unstored simulation states. Specifically, when calculating the target simulation gradient information, the original simulation data in each simulation state is required; please refer to the relevant documentation. Figure 7 It illustrates a method for calculating the simulation gradient when the original simulation data for the current simulation state is not stored. This method may include:

[0197] S710. If the original simulation data of the original simulation object in the current simulation state is not stored, determine the current leaf node corresponding to the current simulation state from the target simulation binary tree; the target simulation binary tree is adapted to the simulation process of the original simulation object in each simulation state.

[0198] S720. Determine the ancestor node closest to the current leaf node from the target simulation binary tree; the ancestor node stores the original simulation data of the original simulation object in the historical simulation states before the current simulation state.

[0199] S730. Simulate the original simulation object from the historical simulation state to obtain the original simulation data of the original simulation object in the current simulation state.

[0200] S740. Based on the original simulation data of the original simulation object under various simulation states and the derivative of the objective function, the target simulation gradient information is obtained.

[0201] The target simulation binary tree is adapted to the simulation process of the original simulation object under various simulation states. Specifically, it can be determined based on the relationships between the simulation states. For example, the root node of the target simulation binary tree corresponds to the initial simulation state, and the leaf nodes correspond to each simulation state, with the leaf nodes arranged in the same chronological order as the simulation states. For instance, the leaf nodes of the target simulation binary tree, from left to right, correspond to simulation state 0, simulation state 1, simulation state 2, and so on. For original simulation data in some stored states, the corresponding node in the target simulation binary tree can be determined, and this node can be marked as stored.

[0202] Specifically, in the process of calculating the target simulation gradient information through backpropagation, from the simulation state s t+1 Backpropagation to simulation state s t At that time, find the state s from the target simulation binary tree. t The leaf node that is closest to the ancestor node is identified and marked as a stored ancestor node. The simulation is then re-performed based on the original simulation data corresponding to the ancestor node until state s is reached. t Thus, the simulation state s can be obtained. t The original simulation data below.

[0203] In another alternative embodiment, for the simulation state s obtained through resimulation... t The original simulation data can be stored and deleted from memory after the target simulation gradient information is calculated.

[0204] In this embodiment, the amount of original simulation data stored under certain simulation states can be determined based on actual conditions. For example, the amount of original simulation data to be stored can be determined based on the actual memory usage. A target memory space can be allocated from the available memory space to store the original simulation data under certain simulation states. For example, if the available memory space is MEM, then the corresponding target memory space can be MEM*c (0 < c < 1). Therefore, the larger the available memory space, the larger the corresponding target memory space, and the larger the amount of original simulation data that can be stored; conversely, the smaller the available memory space, the smaller the corresponding target memory space, and the smaller the amount of original simulation data that can be stored. Thus, the determination of the target memory space is based on the available memory space, which can avoid excessive memory occupation by the storage of original simulation data, improve memory usage efficiency, and ensure the rationality of memory allocation.

[0205] In one example, for state s t+1 The derivative can be calculated using equation (7):

[0206]

[0207] Where z is the objective function, for simulation state s t and simulation state s t+1 If the original simulation data has been stored, it can be retrieved directly from memory. If it has not been stored, it can be obtained by resimulating using the methods described above. When performing specific derivative calculations, the objective function value and the original simulation data under each simulation state can be directly substituted into the calculation.

[0208] Please see Figure 8 The diagram illustrates backpropagation based on a target simulation binary tree. Taking backpropagation from the fourth time step state to the third time step state as an example, the nearest ancestor node marked as stored in the target simulation binary tree for the third time step state is found to be the node corresponding to the zero time step state. Therefore, the original simulation data of the zero time step state can be read and re-simulated based on the original simulation data of the zero time step state. When calculating the original simulation data of the second time step state, since it is the ancestor node of the third time step state, the original simulation data of the second time step state is stored, and the node corresponding to the second time step state is marked as stored. Then, the original simulation data of the third time step state is calculated based on the original simulation data of the second time step state. Thus, the derivative value of the third time step state can be calculated through backpropagation.

[0209] By storing the original simulation data under some simulation states, and then calculating the original simulation data under the unstored simulation states based on the stored original simulation data and the target simulation binary tree when the unstored original simulation data is needed, the calculation of the unstored original simulation data is achieved while saving memory space, thereby improving the calculation efficiency of the target simulation gradient information.

[0210] In one optional embodiment, the original simulation object has attributes of multiple attribute types, so that when calculating the target simulation gradient information, the target simulation gradient information can be determined based on the derivative information corresponding to the attributes of multiple attribute types; please refer to [link / reference] for details. Figure 9 The starting point proposes a method for calculating target simulation gradient information based on attributes of various attribute types. This method may include:

[0211] S910. Based on the attribute data of the various attribute types of the original simulation object in each simulation state, and the objective function, perform derivative processing to obtain the derivative information corresponding to each of the various attribute types in each simulation state.

[0212] S920. For each simulation state, sum the derivative information corresponding to the attributes of the various attribute types to obtain the simulation gradient information corresponding to each attribute type;

[0213] S930. Based on the simulation gradient information corresponding to each attribute type, the target simulation gradient information is obtained.

[0214] For the attribute of the h-th attribute type, in simulation state s t The corresponding derivative information can be Among them, P h This represents the number of original objects with attributes of type h, which is also the number of attributes of type h. For the sth t In the simulation state, the i-th attribute of the h-th attribute type; the simulation gradient information corresponding to each attribute type can be... That is, the target simulation gradient information can include simulation gradient information corresponding to various attribute types.

[0215] By calculating the corresponding simulation gradient information for each attribute type separately, it is convenient to calculate the quantization interval corresponding to each attribute type based on the simulation gradient information corresponding to each attribute type. This enables independent calculation of the quantization interval for different attribute types, making the quantization interval corresponding to each attribute type match the actual attribute and improving the accuracy of quantization interval calculation.

[0216] By using the simulation data quantization method described above, the target quantization bit depth in each simulation scene can be determined. Therefore, when simulating a target animation scene, data quantization can be performed based on the target quantization bit depth, and corresponding quantized simulation data can be generated. To address the problem of low animation generation efficiency caused by low quantization efficiency in related technologies, this disclosure proposes an animation generation method, for details of which please refer to [link / reference]. Figure 10 The execution entity of this method can be the animation data quantization end, and the method may specifically include:

[0217] S1010. Determine the target quantization bit depth corresponding to the target animation scene; the target quantization bit depth is obtained based on the quantization error information constructed from the target simulation gradient information and the quantization interval parameter; the target simulation gradient information is obtained based on the original simulation data of the original simulation object in each simulation state and the objective function through backpropagation; the original simulation data represents the attribute data of the original simulation object in the corresponding simulation state; the objective function represents the simulation reference information under the target animation scene.

[0218] For determining the target quantization bit depth corresponding to the target animation scene in this embodiment, please refer to the simulation data quantization method described above in this embodiment, which will not be repeated here.

[0219] S1020. Generate actual simulation data of the actual simulation objects under various simulation states; the number of actual simulation objects is greater than the number of original simulation objects.

[0220] When simulating a target animation scene, the number of actual simulated objects included in the generated target animation can be preset. For example, in a smoke animation simulation scene, the number of simulated particles can be set; in a fluid simulation scene, the number of Euler meshes can be set, etc. Through a physical simulation algorithm corresponding to the target animation scene, the actual simulation data of the simulated objects under various simulation states is obtained. In this embodiment, the number of actual simulated objects is greater than the number of original simulated objects to improve the resolution of the generated target animation and enhance its visual effect.

[0221] It should be noted that the original simulation object in this disclosure can refer to the simulation object involved in determining the optimal quantization bit depth in the target animation scene; the actual simulation object can refer to the simulation object determined during the actual simulation process for generating the target animation. The original simulation object and the actual simulation object are not directly related. Having fewer original simulation objects than actual simulation objects allows for determining the optimal quantization bit depth within a smaller range of simulation objects, and then applying this optimal quantization bit depth to a larger range of simulation objects to generate the target animation.

[0222] S1030. Quantize the actual simulation data into quantized simulation data with the target quantization bit depth.

[0223] S1040. Generate the target animation based on the quantized simulation data.

[0224] In one alternative embodiment, given a target quantization bit depth, the actual simulation data can be quantized into quantized simulation data with the target quantization bit depth. The quantized simulation data can be integers, facilitating its storage and transmission.

[0225] In one example, the target animation can be the animation data supporting the animation display. This involves encapsulating and packaging quantized simulation data to obtain the animation data used to display the target animation. Specifically, the animation data can be in the form of data packets, thus establishing a correspondence between the target animation simulation scene and the animation data packets. The target animation can then be displayed based on the animation data in the animation data packets. Alternatively, the target animation can also be the animation data obtained after converting the quantized simulation data for actual animation display. When the target animation needs to be displayed, the animation data quantization end can display the animation based on the animation data packets, and the animation data quantization end can also send the animation data packets to the animation display end, allowing the animation display end to display the animation based on the animation data packets. In another example, the target animation can be the displayed animation effect; that is, generating the target animation can refer to the process of displaying the target animation based on quantized simulation data.

[0226] Therefore, quantizing the actual simulation data based on a pre-determined target quantization bit depth to generate the corresponding animation can improve the animation generation efficiency. In addition, since the number of actual simulation objects is greater than the number of original simulation objects, the target quantization bit depth can be determined based on a small number of original simulation objects. Then, the target quantization bit depth can be used to quantize the actual simulation data of a large number of actual simulation objects. This can achieve high-resolution animation simulation and improve the visual effect of the animation while improving the efficiency of determining the target quantization bit depth.

[0227] After quantizing the actual simulation data to the target quantization bit depth, the quantized simulation data can be stored. This allows for direct generation of the target animation based on the stored quantized simulation data when animation simulation of the target scene is needed, achieving one-time simulation and repeated use. For methods on storing quantized simulation data, please refer to [link to relevant documentation]. Figure 11 The method may include:

[0228] S1110. Determine the number of remaining fields in the current storage container; each storage container is used to store data with a preset number of bits.

[0229] S1120. If the number of remaining fields is less than the target quantization bit depth, the quantization simulation data is split to obtain first storage data and second storage data; the bit depth of the first storage data is consistent with the number of remaining fields.

[0230] S1130. The first storage data is stored in the current storage container, and the second storage data is stored in the next storage container; the next storage container is a storage container that is adjacent to the current storage container and located after the current storage container.

[0231] Each storage container can be used to store data with a preset number of bits. The target number of bits for the quantization simulation data can be greater than or less than the preset number of bits, which may result in the number of remaining fields in the current storage container being less than the target number of bits. In this embodiment, the number of remaining fields in the current storage container can be the number of fields in the current storage container that have not been stored. When the number of remaining fields is less than the target number of bits, the quantization simulation data is split to obtain first storage data and second storage data. The number of bits in the first storage data is consistent with the number of remaining fields. The first storage data is stored in the current storage container, and the second storage data is stored in the next storage container. That is, the remaining fields in the current storage container are filled first, and then the split data is stored in the next storage container.

[0232] Specifically, the quantization simulation data can be split based on masking and shifting operations, and the differential data can be stored in adjacent storage containers.

[0233] Therefore, when the target quantization bit depth is inconsistent with the preset bit depth of the storage container, the quantization simulation data with the target quantization bit depth can be split and the split data can be stored in different storage containers, thereby realizing cross-container storage of quantization simulation data and improving the flexibility of quantization simulation data storage.

[0234] The animation generation method disclosed herein can be encapsulated in a quantization compiler. During implementation, a target resolution can be set, which can be determined by the number of actual simulation objects. The corresponding quantization simulation data can be packaged and arranged in memory, typically using 32-bit or 64-bit physical fields as storage containers. This allows the quantization simulation data to be arranged sequentially and continuously in memory without being limited by the length of the physical field. When generating code to read the quantization simulation data, if the quantization compiler detects that a certain data spans two physical fields (i.e., some bits are arranged at the end of the first 32-bit physical field and other bits are arranged at the beginning of the second 32-bit physical field), the quantization compiler will generate code to continuously read the two physical fields and combine the bits belonging to the quantization simulation data in the two fields through masking and bit shifting operations to obtain the target data.

[0235] Specifically, please refer to Figure 12 It illustrates a method for reading quantized simulation data, which may include:

[0236] S1210. Determine the starting position of the quantization simulation data to be read in the first storage container and the ending position in the second storage container; the first storage container and the second storage container are adjacent.

[0237] S1220. Generate a first mask based on the starting position, and generate a second mask based on the ending position.

[0238] S1230. Based on the first mask and the second mask, read the quantization simulation data.

[0239] If the quantization simulation data is stored across multiple storage containers, the starting position of the quantization simulation data to be read in the first storage container and the ending position in the second storage container can be determined. The starting position can represent the field identifier of the first digit of the quantization simulation data to be read in the first storage container, and the ending position can represent the field identifier of the last digit of the quantization simulation data to be read in the second storage container.

[0240] When generating the first mask, the field corresponding to the starting position and the subsequent fields in the first mask can be assigned a value of 1, and the other fields of the first mask can be assigned a value of 0; when generating the second mask, the field corresponding to the ending position and the preceding fields in the second mask can be assigned a value of 1, and the other fields of the second mask can be assigned a value of 0.

[0241] When reading the quantization simulation data based on the first mask and the second mask, a bitwise AND operation can be performed on the first mask and the data in the first storage container to obtain first processed data; a bitwise AND operation can be performed on the second mask and the data in the second storage container to obtain second processed data; a left shift operation can be performed on the first processed data based on the starting position to obtain first data to be read; a right shift operation can be performed on the second processed data based on the ending position to obtain second data to be read; and an OR operation can be performed on the first data to be read and the second data to be read to obtain the quantization simulation data to be read. The process of storing quantization simulation data is the reverse of the process of reading quantization simulation data, and will not be described in detail here.

[0242] In one example, see Figure 13 An 8-bit physical field is used as the storage container. The data in the box in the first row of the diagram is the target data to be read. During reading, the first field is read first, and then the second field is read (as shown in the second row of the diagram). Then, a mask operation is used to obtain the data containing the target data (as shown in the third and fourth rows of the diagram). Finally, the final target data is obtained through two bitwise shift and OR operations (as shown in the fifth and sixth rows of the diagram).

[0243] Therefore, when reading quantization simulation data across storage containers, the quantization simulation data can be extracted based on the corresponding mask operation, realizing cross-container reading of quantization simulation data and improving the flexibility of quantization simulation data reading.

[0244] When quantizing actual simulation data to quantized simulation data with a target quantization bit depth, please refer to the quantization methods that can be used. Figure 14 The method may include:

[0245] S1410. Generate simulated random numbers that follow a uniform distribution.

[0246] S1420. Map the actual simulation data based on the actual quantization interval to obtain mapped simulation data. The actual quantization interval is determined based on the target quantization bit depth and the actual data range of the actual simulation data.

[0247] S1430. The sum of the mapped simulation data and the simulation random number is rounded down to obtain the quantized simulation data.

[0248] For simulated random numbers, they follow a uniform distribution. ζ represents the interval The random variable follows a uniform distribution.

[0249] The actual quantization interval can be calculated based on equation (8):

[0250]

[0251] Where x represents the target quantization bit depth, Δy represents the actual quantization interval, and R represents the actual data range.

[0252] In one example, the actual data range can also be obtained by expanding the actual simulation data range, thereby avoiding the overflow problem of quantized data. When rounding the sum of the mapped simulation data and the simulation random number, rounding can be performed using methods such as rounding to the nearest integer, rounding up, or rounding down.

[0253] Taking a target quantization bit depth of 8 bits as an example, the corresponding quantization range is -127 to 127, the actual data range is -3 to 3, and the corresponding actual quantization interval is 127 / 3. Mapping the value 1.5 to the data yields a mapped simulation data of 1.5 × 127 / 3 = 63.5. If the generated simulation random number is 0.5, the corresponding quantized simulation data after rounding is 64; if the generated simulation random number is -0.5, the corresponding quantized simulation data after rounding is 63; if the generated simulation random number is 0, the corresponding quantized simulation data after rounding is 64.

[0254] In other words, by introducing simulation random numbers that follow a uniform distribution and rounding them up or down with a certain probability, the dependence of simulation errors in each simulation state can be reduced, making the simulation errors in each simulation state independent of each other, reducing quantization errors, and thus improving the accuracy of quantization data.

[0255] In animation simulation scenarios, the stored quantized simulation data is typically in integer form. Therefore, when generating the target animation based on the quantized simulation data, it is necessary to perform a data inverse mapping to convert the integers into data specific to the actual simulation scenario. Please refer to [link to relevant documentation] for details. Figure 15 It illustrates another method for generating animations, which may include:

[0256] S1510. Perform data inverse mapping on the quantization simulation data based on the actual quantization interval to obtain the target simulation data.

[0257] S1520. Generate the target animation based on the target simulation data.

[0258] The data inverse mapping in this embodiment is the data processing process opposite to the data mapping described above. Specifically, taking the quantized simulation data of 64 as an example, the target simulation data is 64 / (127 / 3)≈1.51, which differs from the original actual simulation data of 1.5 by 0.01. Therefore, the target simulation data of 1.51 can be used to generate the target animation.

[0259] By inversely mapping the quantized simulation data through the actual quantization interval, the target simulation data used for actual animation generation can be recovered, thereby improving the convenience and accuracy of target animation generation.

[0260] In a specific example, such as a fluid animation simulation scenario, the user can first set the number N of actual simulation objects (simulation particles) required to achieve the fluid animation. The animation data quantization end can determine the target quantization bit depth x corresponding to the fluid animation scenario, and perform motion simulation on the N actual simulation objects based on the simulation algorithm corresponding to the fluid animation simulation scenario to obtain the actual simulation data of the N actual simulation objects. The actual simulation data of the N actual simulation objects is then quantized into x-bit quantized simulation data, which is stored. When fluid animation needs to be generated, the x-bit quantized simulation data can be read out and converted into target simulation data for actual animation generation. The target simulation data can be used to support the display of the fluid animation.

[0261] The methods described above in this embodiment can be combined based on actual implementation conditions and have corresponding beneficial effects, which will not be elaborated here.

[0262] Figure 16 This is a block diagram illustrating an animation generation apparatus according to an exemplary embodiment. (Refer to...) Figure 16 The device includes:

[0263] The target quantization bit depth determination unit 1610 is configured to determine the target quantization bit depth corresponding to the target animation scene. The target quantization bit depth is obtained based on quantization error information constructed from target simulation gradient information and quantization interval parameters. The target simulation gradient information is obtained by backpropagation of the original simulation object's original simulation data under various simulation states and the objective function. The original simulation data represents the attribute data of the original simulation object under the corresponding simulation state. The objective function represents the simulation baseline information under the target animation scene.

[0264] The actual simulation data generation unit 1620 is configured to generate actual simulation data of actual simulation objects under various simulation states; the number of actual simulation objects is greater than the number of original simulation objects.

[0265] The data quantization unit 1630 is configured to perform quantization of the actual simulation data into quantized simulation data with the target quantization bit depth;

[0266] The first generation unit 1640 is configured to generate a target animation based on the quantized simulation data.

[0267] In one exemplary embodiment, the apparatus further includes:

[0268] The first construction unit is configured to construct a first constraint term based on the quantization error information and the preset error information when the first quantization constraint condition is that the quantization error information is less than or equal to the preset error information.

[0269] The second construction unit is configured to execute the attribute type based on the properties of the original simulation object and the quantization bit parameter to construct a quantization memory consumption item; the quantization bit parameter is determined based on the quantization interval parameter.

[0270] The third building unit is configured to execute the construction of a first optimization function based on the first constraint term and the quantized memory consumption term;

[0271] The first solution unit is configured to execute the function solution based on the first optimization function to determine the target quantization interval corresponding to the quantization interval parameter.

[0272] In one exemplary embodiment, the apparatus further includes:

[0273] The fourth construction unit is configured to construct a second constraint term based on the quantization memory consumption and the preset memory consumption when the second quantization constraint condition is that the quantization memory consumption is less than or equal to the preset memory consumption; the quantization memory consumption is determined based on the attribute type of the original simulation object's attributes and the quantization bit depth parameter; the quantization bit depth parameter is determined based on the quantization interval parameter.

[0274] The fifth construction unit is configured to construct an error information item based on the quantization error information;

[0275] The sixth construction unit is configured to construct a second optimization function based on the error information term and the second constraint term;

[0276] The second solving unit is configured to execute a function solution based on the second optimization function to determine the target quantization interval corresponding to the quantization interval parameter.

[0277] In one exemplary embodiment, the apparatus further includes:

[0278] The original data range determination unit is configured to perform the determination of the original data range of the attributes of the original simulation object based on the original simulation data;

[0279] The range expansion unit is configured to perform range expansion on the original data range to obtain the target data range;

[0280] The target quantization bit depth determination unit is configured to determine the target quantization bit depth based on the target quantization interval and the target data range.

[0281] In one exemplary embodiment, the apparatus further includes:

[0282] The leaf node determination unit is configured to determine the current leaf node corresponding to the current simulation state from the target simulation binary tree when the original simulation data of the original simulation object in the current simulation state is not stored; the target simulation binary tree is adapted to the simulation process of the original simulation object in each simulation state.

[0283] An ancestor node determination unit is configured to determine the ancestor node closest to the current leaf node from the target simulation binary tree; the ancestor node stores the original simulation data of the original simulation object in historical simulation states before the current simulation state.

[0284] The simulation unit is configured to perform a simulation of the original simulation object from the historical simulation state to obtain the original simulation data of the original simulation object in the current simulation state;

[0285] The first differentiation unit is configured to perform differentiation based on the original simulation data of the original simulation object under various simulation states and the objective function to obtain the target simulation gradient information.

[0286] In one exemplary embodiment, the original simulation object has attributes of multiple attribute types;

[0287] The first differentiation unit includes:

[0288] The second differentiation unit is configured to perform differentiation processing on the attribute data of the multiple attribute types of the original simulation object in each simulation state, as well as the objective function, to obtain the derivative information corresponding to the multiple attribute types in each simulation state.

[0289] The summation unit is configured to sum the derivative information corresponding to each of the multiple attribute types for each simulation state to obtain the simulation gradient information corresponding to each attribute type.

[0290] The target simulation gradient determination unit is configured to execute simulation gradient information based on the simulation gradient information corresponding to each attribute type to obtain the target simulation gradient information.

[0291] In one exemplary embodiment, each original simulation object has attributes of at least one attribute type, and the quantization bit parameter includes quantization bit parameters corresponding to each attribute type respectively;

[0292] The device further includes:

[0293] The first determining unit is configured to determine the original simulation object corresponding to each attribute type; the original simulation object has attributes of the corresponding attribute type.

[0294] The second determining unit is configured to perform quantization memory consumption for each attribute type based on the number of original simulation objects corresponding to each attribute type and the quantization bit depth parameter corresponding to each attribute type.

[0295] The quantization memory consumption determination unit is configured to perform quantization memory consumption based on each attribute type to obtain the quantization memory consumption after quantizing the original simulation data.

[0296] In one exemplary embodiment, the apparatus further includes:

[0297] The remaining field count determination unit is configured to determine the remaining field count of the current storage container; each storage container is used to store data of a preset number of bits.

[0298] The data splitting unit is configured to split the quantization simulation data to obtain first storage data and second storage data when the number of remaining fields is less than the target quantization bit depth; the bit depth of the first storage data is consistent with the number of remaining fields.

[0299] The storage unit is configured to perform the operation of storing the first storage data into the current storage container and storing the second storage data into a next storage container; the next storage container is a storage container that is adjacent to the current storage container and located after the current storage container.

[0300] In one exemplary embodiment, the apparatus further includes:

[0301] A storage location unit is configured to determine the starting position of the quantized simulation data to be read in a first storage container and the ending position in a second storage container; the first storage container and the second storage container are adjacent to each other.

[0302] The mask generation unit is configured to generate a first mask based on the starting position and a second mask based on the ending position;

[0303] The reading unit is configured to read the quantization simulation data based on the first mask and the second mask.

[0304] In one exemplary embodiment, the data quantization unit 1630 includes:

[0305] The random number generation unit is configured to generate simulated random numbers that follow a uniform distribution;

[0306] The data mapping unit is configured to perform data mapping on the actual simulation data based on the actual quantization interval to obtain mapped simulation data; the actual quantization interval is determined based on the target quantization bit depth and the actual data range of the actual simulation data.

[0307] The rounding unit is configured to perform rounding processing on the sum of the mapped simulation data and the simulation random number to obtain the quantized simulation data.

[0308] In one exemplary embodiment, the first generation unit 1640 includes:

[0309] The data inverse mapping unit is configured to perform data inverse mapping on the quantized simulation data based on the actual quantization interval to obtain the target simulation data;

[0310] The second generation unit is configured to generate the target animation based on the target simulation data.

[0311] 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.

[0312] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is able to perform any of the methods described above.

[0313] In an exemplary embodiment, a computer program product is also provided, the computer program product including a computer program stored in a readable storage medium, wherein at least one processor of a computer device reads from the readable storage medium and executes the computer program, causing the device to perform any of the methods described above.

[0314] Figure 17 A block diagram of an electronic device for generating animation is shown according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 17The electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an animation generation method.

[0315] Those skilled in the art will understand that Figure 17 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0316] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0317] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. An animation generation method, characterized in that, include: Determine the target quantization bit depth corresponding to the target animation scene; The target quantization bit depth is obtained based on the quantization error information constructed from the target simulation gradient information and the quantization interval parameter; The target simulation gradient information is obtained by backpropagation of the original simulation data of the original simulation object under various simulation states and the objective function. The original simulation data represents the attribute data of the original simulation object under the corresponding simulation state; The objective function characterizes the simulation baseline information under the target animation scene; Generate actual simulation data of the actual simulation object under various simulation states; The number of actual simulation objects is greater than the number of original simulation objects; The actual simulation data is quantized into quantized simulation data with the target quantization bit depth; The target animation is generated based on the quantized simulation data.

2. The method according to claim 1, characterized in that, Before determining the target quantization bit depth corresponding to the target animation scene, the method further includes: When the first quantization constraint condition is that the quantization error information is less than or equal to the preset error information, a first constraint term is constructed based on the quantization error information and the preset error information. Based on the attribute type of the original simulation object and the quantization bit depth parameter, a quantization memory consumption item is constructed; the quantization bit depth parameter is determined based on the quantization interval parameter. Based on the first constraint term and the quantization memory consumption term, a first optimization function is constructed; Based on the solution of the first optimization function, the target quantization interval corresponding to the quantization interval parameter is determined.

3. The method according to claim 1, characterized in that, Before determining the target quantization bit depth corresponding to the target animation scene, the method further includes: When the second quantization constraint is that the quantization memory consumption is less than or equal to the preset memory consumption, a second constraint term is constructed based on the quantization memory consumption and the preset memory consumption; the quantization memory consumption is determined based on the attribute type of the original simulation object and the quantization bit depth parameter; the quantization bit depth parameter is determined based on the quantization interval parameter. Based on the quantization error information, an error information item is constructed; Based on the error information term and the second constraint term, a second optimization function is constructed; Based on the solution of the second optimization function, the target quantization interval corresponding to the quantization interval parameter is determined.

4. The method according to claim 2 or 3, characterized in that, The method further includes: Based on the original simulation data, determine the original data range of the attributes of the original simulation object; The original data range is expanded to obtain the target data range; The target quantization bit depth is determined based on the target quantization interval and the target data range.

5. The method according to claim 1, characterized in that, The method further includes: If the original simulation data of the original simulation object in the current simulation state is not stored, the current leaf node corresponding to the current simulation state is determined from the target simulation binary tree; the target simulation binary tree is adapted to the simulation process of the original simulation object in each simulation state; The nearest ancestor node to the current leaf node is determined from the target simulation binary tree; the ancestor node stores the original simulation data of the original simulation object in the historical simulation states before the current simulation state; The original simulation object is simulated from the historical simulation state to obtain the original simulation data of the original simulation object in the current simulation state; Based on the original simulation data of the original simulation object under various simulation states, and by taking the derivative of the objective function, the target simulation gradient information is obtained.

6. The method according to claim 5, characterized in that, The original simulation object has attributes of multiple attribute types; The process of obtaining the target simulation gradient information by taking the derivative of the objective function based on the original simulation data of the original simulation object under various simulation states includes: Based on the attribute data of the various attribute types of the original simulation object in each simulation state, and the objective function, the derivative information of each attribute type in each simulation state is obtained by performing derivative processing. For each simulation state, the derivative information corresponding to each of the various attribute types is summed to obtain the simulation gradient information corresponding to each attribute type; The target simulation gradient information is obtained based on the simulation gradient information corresponding to each attribute type.

7. The method according to claim 2 or 3, characterized in that, Each original simulation object has at least one attribute type, and the quantization bit parameter includes a quantization bit parameter corresponding to each attribute type; The method further includes: Determine the original simulation object corresponding to each attribute type; the original simulation object has attributes of the corresponding attribute type; Based on the number of original simulation objects corresponding to each attribute type and the quantization bit depth parameter corresponding to each attribute type, the quantization memory consumption of each attribute type is obtained; Based on the quantization memory consumption for each attribute type, the quantization memory consumption of the original simulation data is obtained.

8. The method according to claim 2, characterized in that, After quantizing the actual simulation data into quantized simulation data with the target quantization bit depth, the method further includes: Determine the number of remaining fields in the current storage container; each storage container is used to store data of a preset number of bits. If the number of remaining fields is less than the target quantization bit depth, the quantization simulation data is split to obtain first storage data and second storage data; the bit depth of the first storage data is the same as the number of remaining fields. The first storage data is stored in the current storage container, and the second storage data is stored in the next storage container; the next storage container is the storage container that is adjacent to the current storage container and located after the current storage container.

9. The method according to claim 8, characterized in that, The method further includes: Determine the starting position of the quantized simulation data to be read in the first storage container and the ending position in the second storage container; the first storage container and the second storage container are adjacent to each other; A first mask is generated based on the starting position, and a second mask is generated based on the ending position; Based on the first mask and the second mask, the quantization simulation data is read.

10. The method according to claim 4, characterized in that, The quantization of the actual simulation data to the target quantization bit depth includes: Generate simulated random numbers that follow a uniform distribution; The actual simulation data is mapped based on the actual quantization interval to obtain mapped simulation data; the actual quantization interval is determined based on the target quantization bit depth and the actual data range of the actual simulation data. The sum of the mapped simulation data and the simulation random number is rounded down to obtain the quantized simulation data.

11. The method according to claim 10, characterized in that, The generation of the target animation based on the quantized simulation data includes: Based on the actual quantization interval, the quantization simulation data is inversely mapped to obtain the target simulation data; The target animation is generated based on the target simulation data.

12. An animation generation device, characterized in that, include: The target quantization bit depth determination unit is configured to determine the target quantization bit depth corresponding to the target animation scene; The target quantization bit depth is obtained based on the quantization error information constructed from the target simulation gradient information and the quantization interval parameter; The target simulation gradient information is obtained by backpropagation of the original simulation data of the original simulation object under various simulation states and the objective function. The original simulation data represents the attribute data of the original simulation object under the corresponding simulation state; The objective function characterizes the simulation baseline information under the target animation scene; The actual simulation data generation unit is configured to generate actual simulation data of the actual simulation object under various simulation states. The number of actual simulation objects is greater than the number of original simulation objects; The data quantization unit is configured to perform quantization of the actual simulation data into quantized simulation data with the target quantization bit depth; The first generation unit is configured to generate a target animation based on the quantized simulation data.

13. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the animation generation method as described in any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the animation generation method as described in any one of claims 1 to 11.

15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the animation generation method according to any one of claims 1 to 11.