Simulation method and device
Through the user-defined energy constraint relationship between energy expressions and particles, the problem of insufficient accuracy of simulation results in multi-particle systems in the prior art is solved, and higher simulation accuracy and resource utilization efficiency are achieved.
Patent Information
- Application Number
- CN202311433058.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-07-13
- Filing Date
- 2023-10-31
- Publication Date
- 2025-01-14
AI Technical Summary
The prior art relies on experience to determine the stress conditions between multiple particles in physical simulation, which makes it difficult to ensure the accuracy of the simulation results, especially in multi-particle systems, which is difficult to fully consider the energy influence between particles.
A simulation method is provided, through the configuration interface user-defined energy expression, describe the energy constraint relationship between multiple particles in the scene to be simulated, and determine the global variable of each particle based on the energy expression, and then obtain the simulation result. This method considers the inertial potential energy term and interaction potential energy term of the particle, enhancing the accuracy and flexibility of the simulation.
It improves simulation accuracy and flexibility, can more comprehensively cover the energy impact between particles, provide more realistic simulation results, and improves the resource utilization rate of the simulation system by automatically scheduling resources.
Smart Images

Figure CN119313781A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on July 13, 2023, with application number 202310861254.1 and application name “A physical simulation method, device and computing device cluster”, all contents of which are incorporated by reference in this application. Technical Field
[0003] The present application relates to the field of simulation technology, and in particular to a simulation method and device. Background Art
[0004] If simulation technology is introduced into media such as games or film and television production, the visual effects of the media can be improved. For example, using simulation technology to simulate certain scenes in a movie can make the special effects of the movie reach the point of "being indistinguishable from the real thing", giving the audience an immersive and shocking feeling. With the continuous development of hardware, simulation technology is applied to more scenes. For example, simulation technology can be used to simulate the hair and cloth of objects (such as digital humans) with high fidelity, which improves the user experience of using digital humans. The core of physical simulation is to simulate the force conditions of particles in the object under different environments and determine the positions of particles at different times. Physical simulation involves multiple particles, and the movement of any particle will be restricted by the movement of other particles. There are more processing involved in the physical simulation process, and the number of particles involved is also relatively large.
[0005] At present, the force conditions between multiple particles are generally determined based on experience, and based on the force conditions, the positions of the particles of the object at different times are analyzed. Relying on experience to perform physical simulation can simplify the physical simulation process, but this method is difficult to guarantee the accuracy of the simulation results. Summary of the invention
[0006] The embodiments of the present application provide a simulation method and device for improving the accuracy of simulation results.
[0007] In a first aspect, an embodiment of the present application provides a simulation method. The method can be performed by a simulation system. The simulation system can be implemented by one or more devices, such as a server, or a component in a server, such as a graphics processing unit (GPU) or a central processing unit (CPU). The method includes: providing a configuration interface, the configuration interface is used to configure an energy expression, the energy expression is used to describe the energy constraint relationship between multiple particles in a scene to be simulated; based on the energy expression, determining the global variables of each particle at the first moment, the global variables of each particle indicating the position information or velocity information of the corresponding particle under the action of other particles in the multiple particles; according to the global variables of each particle at the first moment, obtaining the simulation result of the scene to be simulated at the first moment.
[0008] It should be understood that the scene to be simulated may include at least one object, and the object may include at least one of an object (such as a vehicle or a building, etc.), a person or an animal (such as a rabbit), and the at least one object may include at least one of a fluid, a soft body or a rigid body, and no specific limitation is made thereto. The parameter set may be determined, for example, by differentiating and / or deriving the energy expression.
[0009] In the embodiment of the present application, the global variables such as the position of the particles are determined based on the energy expression between the particles, and then the simulation can be performed based on the global variables, rather than relying on the force conditions based on experience, which can help improve the accuracy of the simulation and enhance the simulation effect. In addition, the user can flexibly define the energy expression to increase the flexibility of the simulation.
[0010] In a possible implementation, the energy expression includes an inertial potential energy term of each particle and an interaction potential energy term between each particle and neighboring particles, where the neighboring particles are at least one particle among the multiple particles that is located in the neighborhood of each particle.
[0011] In the above implementation, the energy expression not only takes into account the inertial potential energy term of the particles, but also takes into account the interaction potential energy term between particles, so that the energy influence between particles can be fully covered, which is closer to the actual energy influence between particles. Therefore, the accuracy of the simulation can be improved, and the simulation results can be made more realistic.
[0012] In a possible implementation manner, the interaction potential energy term between each particle and neighboring particles includes at least one of the following:
[0013] If the scene to be simulated includes a soft body, the interaction potential energy term between each particle and its neighboring particles includes a collision potential energy term and an elastic potential energy term; if the scene to be simulated includes a fluid, the interaction potential energy term between each particle and its neighboring particles includes a collision potential energy term, and incompressible and viscous potential energy terms; or, if the scene to be simulated includes a rigid body, the interaction potential energy term between each particle and its neighboring particles includes a collision potential energy term.
[0014] It should be understood that the neighboring particles corresponding to a certain particle may be at least one of a soft body, a fluid, or a rigid body, and no specific limitation is made to this.
[0015] In the above implementation, based on the type of object to which the particle belongs, the specific type of interaction potential energy between the particle and other particles is considered, so that the first energy expression can be determined more specifically, which is also conducive to obtaining a more realistic simulation result.
[0016] In a possible implementation, based on an energy expression, determining a global variable of each particle at a first moment includes: processing the energy expression to obtain a parameter set, wherein the parameter set represents an energy influence relationship between the multiple particles; determining a local variable of each particle at a first moment based on the global variable of each particle at a second moment, wherein the local variable of each particle at the first moment indicates position information or velocity information of each particle under the action of neighboring particles, the second moment is before the first moment, and the neighboring particle is at least one particle among the multiple particles that is located in a neighboring area of each particle; determining the global variable of each particle based on the local variable and the parameter set of each particle at the second moment.
[0017] In the above implementation, the task of determining the global variables of the particles can be split into determining the local variables of the particles and determining the parameter set, so that the local variables of multiple particles can be determined separately, thereby improving the efficiency of the simulation. In addition, the above implementation takes into account the energy influence relationship between multiple particles and the local variables of the particles, and relatively comprehensively considers the influencing factors of the particles, which can also improve the accuracy of the simulation.
[0018] In a possible implementation, the method further includes: receiving a target frame rate of a simulation result input by a user; and determining a number of resources required for the simulation based on the target frame rate and a number of particles included in the scene to be simulated.
[0019] In the above implementation, the resources required for the simulation can be determined based on the target frame rate set by the user and the number of particles included in the scene to be simulated. This makes it easier for the simulation system to reasonably allocate simulation tasks for particles, and also allows the simulation system to flexibly and accurately schedule resources, which is beneficial to improving the resource utilization of the simulation system.
[0020] In a possible implementation, the number of resources required for the simulation is determined based on the frame rate of the simulation results and the number of particles included in the simulation scene, including: determining a reference number of resources required for the simulation according to the number of particles included in the scene to be simulated; determining a reference frame rate corresponding to the reference number, wherein the reference frame rate is the frame rate of the simulation result obtained by simulating using the reference number of resources; adjusting the reference number until the ratio of the corresponding reference frame rate to the target frame rate is within a first value range, and determining the adjusted reference number as the number of resources required for the simulation.
[0021] In the above possible implementation, the reference number of resources required for simulation can be determined based on the number of particles included in the scene to be simulated, and simulation can be performed based on the reference number to obtain a real-time frame rate, and the reference number of resources can be adjusted based on the real-time frame rate, providing a way to quantify resources. In addition, there is no need to manually adjust the number of resources, which is conducive to reducing user operations and improving user experience.
[0022] In a possible implementation, the number of resources required for simulation includes the number of at least one device required to simulate the scene to be simulated; the method further includes: determining at least one task corresponding to the scene to be simulated based on the energy expression and the plurality of particles; and determining that each device in the at least one device corresponds to executing a portion of the at least one task. It should be understood that the at least one device may be a device with computing capabilities, such as a server or a terminal device.
[0023] In the above possible implementations, the simulation system can also split the simulation scenarios into multiple categories of tasks, and use different devices to perform different categories of tasks, thereby improving the parallel execution level of the simulation system, improving the resource utilization efficiency of the simulation system, and will not excessively increase the data interaction between simulation systems.
[0024] In a possible implementation, at least one device includes N first-category devices and M second-category devices, where N and M are both positive integers, and at least one task includes first-category tasks and second-category tasks, wherein the first-category tasks are used to determine local variables of each particle, and the second-category tasks are used to determine global variables of each particle; wherein the local variables of each particle are determined by the N first-category devices, and the global variables of each particle are determined by the M second-category devices.
[0025] In the above possible implementations, the simulation system can also assign the first type of tasks to some devices for execution, and assign the second type of tasks to some devices for execution, so that multiple devices can execute multiple first type tasks in parallel, which is conducive to improving the efficiency of simulation.
[0026] In a second aspect, an embodiment of the present application provides a simulation device, which can be the simulation system in the above-mentioned first aspect, or a software or hardware module configured in the simulation system. The simulation device includes corresponding means (means) or modules for executing the above-mentioned first aspect or any optional implementation. For example, the simulation device includes a configuration module (also referred to as a configuration unit), a determination module (also referred to as a determination unit) and an acquisition module (also referred to as a simulation unit).
[0027] For example, a configuration module is used to provide a configuration interface, wherein the configuration interface is used to configure an energy expression, wherein the energy expression is used to describe the energy constraint relationship between multiple particles in the scene to be simulated; a determination module is used to determine the global variables of each particle at the first moment based on the energy expression, wherein the global variables of each particle indicate the position information or velocity information of the corresponding particle under the influence of other particles among the multiple particles; and an acquisition module is used to obtain the simulation result of the scene to be simulated at the first moment based on the global variables of each particle at the first moment.
[0028] The above-mentioned simulation device can also implement the method in any possible implementation manner of the first aspect above, which will not be listed one by one here.
[0029] In a third aspect, an embodiment of the present application provides a simulation device, comprising: a processor and a memory; the memory is used to store one or more computer programs, and the one or more computer programs include computer execution instructions. When the simulation device is running, the processor executes the one or more computer programs stored in the memory, so that the simulation device performs a method as described in any one of the first aspect and possible implementation methods.
[0030] Optionally, the simulation device also includes other components, such as an antenna, an input / output module, an interface, etc. These components may be hardware, software, or a combination of software and hardware.
[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which is used to store computer programs or instructions. When the computer-readable storage medium is executed, it implements the method described in any one of the above-mentioned first aspect and possible implementation methods.
[0032] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, implements the method described in any one of the first aspect and possible implementation modes.
[0033] Regarding the beneficial effects of any technical solution in the second to fifth aspects above, reference can be made to the beneficial effects discussion of the corresponding technical solution in the first aspect, and the repeated parts will not be listed here. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of a scenario applicable to an embodiment of the present application;
[0035] Figure 2 A schematic diagram of the structure of a simulation system provided in an embodiment of the present application;
[0036] Figure 3 A schematic diagram of a simulation method provided in an embodiment of the present application;
[0037] Figure 4 A schematic diagram of particles of an object provided in an embodiment of the present application;
[0038] Figure 5 A schematic diagram of a process for obtaining an energy expression provided in an embodiment of the present application;
[0039] Figure 6 A schematic diagram of a process for determining a global variable of a particle provided in an embodiment of the present application;
[0040] Figure 7 A schematic diagram of a task scheduling provided in an embodiment of the present application;
[0041] Figure 8 A schematic diagram of the structure of a simulation device provided in an embodiment of the present application;
[0042] Fig. 9 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0043] Fig.10 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0045] In the embodiments of the present application, the number of nouns, unless otherwise specified, means "singular noun or plural noun", that is, "one or more". "At least one" means one or more, and "plural" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. For example, A / B means: A or B. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c means: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0046] As discussed in the background art, the force conditions between multiple particles are determined based on experience, and the accuracy of simulation based on such force conditions is low.
[0047] In view of this, an embodiment of the present application provides a simulation method, in which a configuration interface can be provided, and a user can configure an energy expression based on the configuration interface. The energy expression represents the energy constraint relationship of the position of each particle among multiple particles in the scene to be simulated. The simulation system can determine the global variable of each particle (indicating the position information or speed information of each particle under the action of other particles at a certain moment (such as the first moment)) based on the energy expression, thereby simulating the scene to be simulated corresponding to the first moment based on the global variable of each particle. Since the method determines the global variables of multiple particles based on the energy expression configured by the user, rather than using experience for calculation, the accuracy and flexibility of the simulation can be improved, and the energy expression can fully reflect the mutual influence between particles, which is also conducive to improving the accuracy of the simulation.
[0048] The simulation method provided in the embodiment of the present application can be applied to any simulation scenario, for example, digital human simulation, film and television special effects, or game simulation, etc. The following describes the applicable scenarios of the simulation method in conjunction with the accompanying drawings.
[0049] Figure 1 A schematic diagram of a scenario applicable to an embodiment of the present application is illustrated. The scenario includes a user equipment (UE) and a simulation system. The simulation system can be implemented by one or more devices. The device can be a device with processing capabilities, such as a server, a chip, a CPU, a GPU, or a software module. Figure 1 In the figure, one or more devices are represented as device 1 to device n, but the number of devices is not actually limited. Figure 1One user device is used for illustration, but the number of user devices is not actually limited.
[0050] The user can access the simulation service provided by the simulation system through the user device. The user device is, for example, a terminal device, which is a device with wireless transceiver function, which can be a fixed device, a mobile device, a handheld device, a wearable device, a vehicle-mounted device, or a wireless device built into the above device (for example, a communication module or a chip system, etc.). The terminal device is used to connect people, objects, machines, etc., and can be widely used in various scenarios, such as but not limited to the following scenarios: cellular communication, device-to-device communication (device-to-device, D2D), vehicle to everything (vehicle to everything, V2X), machine-to-machine / machine-type communications (machine-to-machine / machine-type communications, M2M / MTC), Internet of Things (Internet of Things, IoT), virtual reality (virtual reality, VR), augmented reality (augmented reality, AR), industrial control (industrial control), self-driving, remote medical, smart grid (smart grid), smart furniture, smart office, smart wear, smart transportation, smart city (smart city), drone, robot and other scenarios of terminal devices. The terminal device may sometimes be referred to as user equipment, terminal, access station, UE station, remote station, wireless communication device, or user device, etc.
[0051] In a possible implementation, the user device may run a client, and the user device accesses the simulation system through the client. In this case, the simulation system can be regarded as a background service of the client. The client is, for example, a pre-installed application, a small program or a light application, etc., which is not limited in the embodiments of the present application.
[0052] Combine the following Figure 2 The structure diagram of a simulation system shown in FIG. 1 introduces the structure of the simulation system. The simulation system includes a configuration interface and a physical solver. Optionally, the simulation system also includes an ecological layer, an application layer, an engine layer, and a renderer. Each part is introduced below.
[0053] 1. The ecological layer includes digital content production lines. The digital content production line can provide platform capabilities such as simulation (such as 3D model production (creator)), asset management (store), content editing (editor), cloud rendering (rendering), etc., and work with partners to create production lines such as digital human production, virtual live broadcast, enterprise 3D space, virtual and real integration, etc., to achieve seamless integration of the virtual world and the real world.
[0054] 2. The application layer can be used to provide services or applications to users. Services include digital human services, virtual fitting, and film and television special effects.
[0055] 3. The engine layer can be used to provide service interfaces to other layers (such as the application layer and / or the ecological layer). The engine layer can be used to provide service interfaces such as service simulation, modeling, and rendering.
[0056] 4. Configuration interface, which can be used to configure energy expressions and target simulation indicators. The interface for configuring energy expressions can also be called a physical simulation user interface. The energy expression can be customized by the user, or the user can select it from pre-stored expressions in the simulation system. The target simulation indicator refers to the indicator that needs to be achieved in the simulation. If the target simulation indicator is related to the computing power of the simulation system, then configuring the target simulation indicator can be regarded as selecting computing power. The target simulation indicator may, for example, include the target frame rate required for the simulation and / or the number of devices required for the simulation. The target frame rate is a metric used to measure the number of displayed frames, and can also be understood as the number of frames played per unit time of the simulated content. The unit of the target frame rate can be the number of displayed frames per second (frame per second, FPS).
[0057] 5. Physical solver, also called distributed physical solver. Physical solver includes parameter solver and optimization solver.
[0058] The parameter solver can be used, for example, to perform differentiation and / or derivation on the energy expression. The parameter solver can also include a symbolic differentiator and a matrix assembler. The symbolic differentiator is used for differential operations. The matrix assembler can be used to assemble matrices.
[0059] The optimization solver includes a local optimizer and a global optimizer. The simulation system in the embodiment of the present application includes one or more devices, some of which (i.e., local optimizers, specifically including one or more first-class devices) perform local optimization, such as solving local variables of particles, and some of which (i.e., global optimizers, specifically including one or more second-class devices) perform global optimization, such as solving global variables of particles based on energy expressions.
[0060] The particles in the embodiments of the present application can be the basic components of the objects in the scene to be simulated. The scene to be simulated can be understood as the overall model to be simulated, and the scene to be simulated can include at least one object. For example, if a digital human scene is simulated, the digital human can be regarded as a scene or an object. For another example, if a digital human office scene is simulated, the scene includes at least two objects: the digital human and the office.
[0061] An object can be a modeled result of an entity. An object can also be called a model. For example, an object is a 3D model of an entity. An entity can be at least one of a person, an animal, and an object. For example, an object can be a model of a vehicle or a model of a digital human. According to the characteristics of the entity, objects can be divided into three types, such as rigid bodies, soft bodies, and fluids. Fluids include water and smoke, soft bodies include hair and cloth, and rigid bodies include robots.
[0062] Part or all of an object can be represented by multiple points, and a particle can be one of the multiple points; part or all of an object can also be represented by a triangular patch, and a particle can be a vertex of the triangular patch; part or all of an object can also be represented by a tetrahedron, and a particle can be a vertex of the tetrahedron, etc. For example, if the object includes hair or smoke, the hair or smoke can be represented by multiple points; if the object includes cloth, the cloth can be represented by a triangular patch; if the object includes a building, the building can be represented by a tetrahedron.
[0063] 6. Renderer, which can be used to render the scene to be simulated based on the global variables of particles, so as to present the final simulation results.
[0064] The following describes the method provided by the embodiments of the present application in conjunction with the accompanying drawings. In the accompanying drawings corresponding to the various embodiments of the present application, all steps indicated by dotted lines are optional steps. Also, the simulation system involved in the various embodiments of the present application is, for example, Figure 1 or Figure 2 The simulation system involved, the configuration interface is for example Figure 2 The configuration interface involved, the parameter solver is Figure 2 The parameter solver involved, the global optimizer is Figure 2 The global optimizer involved, the local optimizer is for example Figure 2 The local optimizer and renderer involved are Figure 2 If the various embodiments of the present application are applied to other similar scenarios, the names of the systems, devices or components may change, and the embodiments of the present application do not specifically limit this.
[0065] Please refer to Figure 3 , which is a schematic diagram of a simulation method provided in an embodiment of the present application. Figure 3Steps S301 to S313 are illustrated and are described below.
[0066] S301. Obtain energy expression in a configuration interface of a simulation system.
[0067] For example, when a user needs to perform a simulation, the user can set (or construct) a scene to be simulated on the simulation system. For example, the engine layer in the simulation system can construct the scene to be simulated based on the user's input. In this way, the simulation system can obtain information about the scene to be simulated. The scene to be simulated includes at least one object, and at least one object includes multiple particles. The information about the scene to be simulated includes the number of multiple particles (hereinafter referred to as the first number). Optionally, the information about the scene to be simulated also includes the type of at least one object and the number of at least one object. The meaning of the object can be referred to in Figure 2 The contents of the objects in the scene are not listed here. Alternatively, the user can input the information of the scene to be simulated into the simulation system, so that the simulation system can directly determine the information of the scene to be simulated. Optionally, the information of the scene to be simulated also includes information of the type of at least one object, and the type of at least one object includes, for example, at least one of software, rigid body and fluid.
[0068] In addition to obtaining information about the scene to be simulated, the simulation system can also obtain the initial position of particles included in each object in at least one object according to user input, and can also obtain the initial velocity of particles included in each object.
[0069] After obtaining the information of the scene to be simulated, the simulation system can provide the user with a configuration interface, which is used to configure (or obtain) the energy expression corresponding to the scene to be simulated. The energy expression represents the energy constraint relationship of each particle in the multiple particles, or it can be understood that the energy expression can represent the energy constraint of each particle in the multiple particles, or it can be understood that the energy constraint of each particle in the multiple particles conforms to the energy expression. The energy expression can be in the form of a formula. The energy expression can be expressed by an energy relationship. For example, the energy expression includes an inertial potential energy term between each particle and neighboring particles. Optionally, the energy expression can also include an interaction potential energy term between each particle and neighboring particles. For example, the energy expression is the sum of the inertial potential energy term and the interaction potential energy term.
[0070] A neighboring particle refers to at least one particle in the neighborhood of the particle in the scene to be simulated. The size of the neighborhood may be pre-stored in the simulation system, or may be manually set by the user, and the shape of the neighborhood may be, for example, spherical, circular, rectangular, or cuboid, etc., without specific limitation. It should be understood that the sizes of the neighborhoods of different particles may be the same, or may be different, without specific limitation.
[0071] For example, see Figure 4 , which is a schematic diagram of particles of an object provided in an embodiment of the present application. Figure 4 The left side of FIG shows a rabbit model (i.e., an example of an object), which includes multiple particles. For illustration, Figure 4 A local schematic diagram of the object is shown on the right. Figure 4 The right side shows particles a, b, c, d, e and f. Figure 4 In the example, the size of the neighborhood is a circle with a radius of R. Figure 4 As shown, particles b, c, d, e and f are located in the neighborhood of particle a, so particles b, c, d, e and f can all be used as neighboring particles of particle a.
[0072] Among them, if the type of at least one object in the scene to be simulated is different, then the interaction potential energy terms between each particle and the neighboring particles are different, and the three cases A1 to A7 are introduced below.
[0073] A1. At least one object includes software.
[0074] Under A1, the interaction potential energy term between each particle and its neighboring particles includes the collision potential energy term and the elastic potential energy term between each particle and its neighboring particles.
[0075] A2. At least one object includes a fluid.
[0076] Under A3, the interaction potential energy term between each particle and neighboring particles includes the collision potential energy term between each particle and the neighboring particles, as well as the incompressible and viscous potential energy terms.
[0077] A3. At least one object includes a rigid body.
[0078] Under A3, the interaction potential energy term between each particle and its neighboring particles includes the collision potential energy term between each particle and its neighboring particles.
[0079] A4. At least one object includes a soft body and a fluid.
[0080] Under A4, the interaction potential energy term between each particle and neighboring particles includes the collision potential energy term, elastic potential energy term, and incompressible and viscous potential energy term between each particle and the neighboring particles.
[0081] A5. At least one object includes a soft body and a rigid body.
[0082] Under A5, the interaction potential energy term between each particle and neighboring particles includes a collision potential energy term and an elastic potential energy term between each particle and the neighboring particles.
[0083] A6. At least one object includes a fluid and a rigid body.
[0084] Under A6, the interaction potential energy term between each particle and its neighboring particles includes the collision potential energy term between each particle and its neighboring particles and the incompressible and viscous potential energy terms.
[0085] A7. At least one object includes a fluid, a soft body, and a rigid body.
[0086] Under A7, the interaction potential energy term between each particle and neighboring particles includes the collision potential energy term, elastic potential energy term, and incompressible and viscous potential energy term between each particle and the neighboring particles.
[0087] For example, taking at least one object including a soft body, a fluid and a rigid body as an example, an example of an energy expression can refer to the following formula (1).
[0088]
[0089] Among them, X can represent the position of the particle, It can be expressed as the inertial potential energy of the particle, P(X) represents the incompressible and viscous potential energy terms between the particle and its neighboring particles, represents the elastic potential energy between a particle and its neighboring particles, and C(X) represents the collision potential energy term between a particle and its neighboring particles.
[0090] The following is an introduction to how the simulation system obtains the energy expression.
[0091] Exemplarily, the simulation system obtains the target implementation form of the inertia potential energy term and the target implementation form of the interaction potential energy term through a configuration interface, and obtains an energy expression based on the target implementation form of the inertia potential energy term and the target implementation form of the interaction potential energy term.
[0092] For example, the configuration interface may provide (or display) multiple implementation forms of the inertia potential energy term and multiple implementation forms of the interaction potential energy term. The user may select one of the multiple implementation forms of the inertia potential energy term, and the simulation system may determine an expression selected by the user as the target expression of the inertia potential energy term. Similarly, the user may select one of the multiple implementation forms of the interaction potential energy term, and the simulation system may determine one of the implementation forms of the interaction potential energy term selected by the user as the target implementation form of the interaction potential energy term. Among them, the multiple implementation forms of the interaction potential energy term may be the target implementation forms of the interaction potential energy term that match the scenario to be simulated.
[0093] Alternatively, the configuration interface may provide (or display) the target implementation form of the inertia potential energy term and the target implementation form of the interaction potential energy term, and the simulation system determines the target implementation form of the inertia potential energy term and the target implementation form of the interaction potential energy term based on the user's confirmation operation on the target implementation form of the inertia potential energy term and the target implementation form of the interaction potential energy term.
[0094] Alternatively, the simulation system may also obtain the target realization form of the inertia potential energy term and the target realization form of the interaction potential energy term input by the user according to the user's input on the configuration interface, so as to meet the needs of different users.
[0095] For example, see Figure 5 , is a schematic diagram of a process for obtaining an energy expression provided in an embodiment of the present application. Figure 5 As shown, the simulation system can provide the following based on the user's input: Figure 5 The modeling interface shown in (1) shows the objects included in the scene to be simulated, such as Figure 5 The simulation system can analyze the scene to be simulated, determine the number of particles included in the scene to be simulated, and provide the following information: Figure 5 The parameter setting interface shown in (2) can support users to set the initial speed and initial position of the objects in the scene to be simulated. The simulation system can provide configuration Figure 5 The energy expression interface shown in (3) (i.e., an example of a configuration interface) can have built-in item controls and custom controls. When a user operates the built-in item controls, the simulation system can provide multiple implementation forms of the pre-stored inertial potential energy items and multiple implementation forms of the interaction potential energy items for the user to choose from. Alternatively, when a user operates the custom controls, the simulation system can support obtaining the target implementation form of the inertial potential energy items and the target implementation form of the interaction potential energy items based on the user's input.
[0096] In addition to obtaining the energy expression, in a possible implementation, the simulation system may obtain a target simulation index. The target simulation index represents the index required to be achieved in simulating the scenario to be simulated, or may be understood as the index expected to be achieved in simulating the scenario to be simulated. Optionally, the configuration interface may also support the user to set the target simulation index, and the simulation system determines the target simulation index based on the user's input. Figure 3 The example of obtaining the target simulation index in the configuration interface is used as an example. The target simulation index includes, for example, a target frame rate (for example, 30 FPS) of simulating the scene to be simulated or the number of devices required to simulate the scene to be simulated.
[0097] When users use this service, they can choose a billing method based on their needs. For example, users can choose the number of devices, and the simulation system charges based on the time used for the simulation. However, as a real-time media-oriented scenario, users may not know how many computing resources are needed to meet the frame rate requirements of the simulation. Therefore, in the embodiment of the present application, the simulation system can support users to set a target frame rate, and the simulation system can adjust the information of the resources required for the simulation to meet the target frame rate, which can also simplify the user's work.
[0098] S302: The configuration interface sends the energy expression to the parameter solver. Correspondingly, the parameter solver receives the energy expression from the configuration interface.
[0099] S303. The parameter solver determines a parameter set based on the energy expression.
[0100] The parameter set is used to represent the energy influence relationship between multiple particles, or to understand the position influence relationship between the positions of multiple particles. The parameter set can be in the form of a vector or a matrix, etc., which is not limited.
[0101] Exemplarily, the parameter solver may differentiate and / or derive the energy expression to obtain a parameter set.
[0102] For example, the parameter solver can be used to derive the energy expression and determine the Jacobian matrix (Jacobian matrix, Jacobi). For example, the symbolic differentiator in the parameter solver can be used to derive (or differentiate) the energy expression. The parameter solver can also perform a second-order derivative (or differentiation) on the energy expression to determine the Hessian matrix (Hessian matrix), which can also be called a Hessian matrix, a Hessian matrix or a Hessian matrix, etc., which is used to describe the curvature of the energy expression. For example, the symbolic differentiator in the parameter solver performs a second-order derivative (or differentiation) on the energy expression. The parameter solver can assemble the Jacobian matrix and the Hessian matrix. For example, the matrix assembler in the parameter solver can combine all elements in the Jacobian matrix and the Hessian matrix, and the matrix obtained by the combination is the parameter set. Alternatively, the parameter solver can also use the Hessian matrix directly as a parameter set. Of course, there are many implementation forms of the parameter set, and the embodiment of the present application does not limit this.
[0103] S304: The parameter solver sends a parameter set to the global optimizer. Correspondingly, the global optimizer receives the parameter set from the parameter solver.
[0104] S305: The configuration interface sends the target simulation index to the global optimizer. Correspondingly, the global optimizer receives the target simulation index from the parameter solver.
[0105] S306: The global optimizer determines information about resources required to simulate the scenario to be simulated.
[0106] The simulation system may determine information about resources required to simulate the scenario to be simulated based on the target simulation index and the plurality of particles, wherein the information about resources includes the quantity of resources.
[0107] Exemplarily, the simulation system may determine a reference number of resources required to simulate the scene to be simulated based on the number of multiple particles. The simulation system simulates the scene to be simulated based on the reference number of resources, and adjusts the reference number according to the measured reference simulation index of the scene to be simulated, until the ratio of the reference simulation index of the scene to be simulated to the target simulation index is within a first value range, and the final adjusted reference number is determined as the number of resources required to simulate the scene to be simulated. The first value range may be existing in the simulation system, or may be set by the user, and the first value range is, for example, [0.9, 1.1].
[0108] For example, the simulation system may pre-store a second number x of particles that can be simulated by a single device, determine a first number P of particles (i.e., a plurality of particles) required to simulate the scene to be simulated, and the simulation system may determine a reference number based on a ratio of the first number to the second number, for example, the reference number is in, Indicates that the result of (P / x)*1.2 is rounded up. The simulation system can perform simulation of the scenario to be simulated based on the reference quantity. If during the simulation process, the ratio of the simulation index of the scenario to be simulated (i.e., the reference simulation index) to the target simulation index actually measured is not within the first value range, indicating that the difference is large, the simulation system can adjust the reference quantity of resources required to simulate the scenario to be simulated until the difference between the reference simulation index and the target simulation index is within the first value range, indicating that the difference is small. In this way, the adjusted reference quantity can be determined as the quantity of resources required to simulate the scenario to be simulated.
[0109] For example, the target simulation index includes a target frame rate. The simulation system performs simulation based on a reference quantity, and determines that the ratio of the measured reference frame rate to the target frame rate in the target simulation index is greater than 1.1, then the simulation system can adjust the number required to simulate the scene to be simulated in the direction of reducing the reference quantity. Alternatively, if the ratio of the measured reference frame rate to the target frame rate in the target simulation index is less than 0.9, then the simulation system can adjust the number required to simulate the scene to be simulated in the direction of increasing the reference quantity. Alternatively, if the ratio of the measured reference frame rate to the target frame rate in the target simulation index is 0.95, there is no need to adjust the reference quantity.
[0110] The number of resources required to simulate the scenario to be simulated may include the number of at least one device required to simulate the scenario to be simulated, or may specifically include the number of computing resources and / or the number of storage resources required to simulate the scenario to be simulated.
[0111] In one possible implementation, the simulation system can determine at least one task corresponding to the simulation scene to be simulated based on the energy expression and multiple particles, and can also determine the device used for each task in at least one task from at least one device, which is equivalent to realizing the task scheduling process.
[0112] Exemplarily, the simulation system may divide at least one task into two categories, such as a first category of tasks and a second category of tasks, wherein the first category of tasks may be regarded as a local step task or a local optimization task, and the second category of tasks may be regarded as a global step task or a local optimization task. The first category of tasks is used to determine the local variables of the particle. The second category of tasks is used to determine the global variables of the particle.
[0113] Among them, the local variable of a particle indicates the position information or velocity information of a particle under the influence of neighboring particles at the first moment, or can be understood as the local position or local velocity of a particle when the force of neighboring particles is taken into account. The local variable of a particle may also include the dual variable u. The global variable of a particle indicates the position information or velocity information of a particle under the influence of multiple particles at the first moment, or can be understood as the global variable of a particle when the force of neighboring particles is taken into account. The global variable of a particle may include the global velocity or global position of a particle at the first moment.
[0114] Accordingly, the simulation system may divide at least one device into a first type of device (specifically including N devices) and a second type of device (specifically including M devices), where N and M are both positive integers. The simulation system may determine that the first type of device is used to perform the first type of task, and the second type of device is used to perform the second type of task. The first type of device is a device in the global optimizer, and the second type of device can be regarded as a device in the local optimizer.
[0115] For example, the simulation system determines that the first type of tasks is K1 and the second type of tasks is K2, then the simulation system can determine that each of the N devices executes K1 / N tasks, and each of the M devices executes K2 / N tasks. This can help achieve load balancing of the simulation system.
[0116] It should be understood that S305 to S306 are an example of determining information of resources required for simulation provided in an embodiment of the present application. In fact, the resources required for simulation may also be set by the user, or the simulation system may be pre-configured with information of resources required for simulation. In these cases, the simulation system may not need to perform steps S305 to S306, that is, S305 to S306 are optional steps. Figure 3 Indicated by dotted line.
[0117] S307, the global optimizer sends first indication information to the local optimizer. Accordingly, the local optimizer receives the first indication information from the global optimizer. The first indication information may indicate that the second type of task is performed by M devices in the local optimizer. The first indication information may also include the position of each particle at the second moment. The second moment is earlier than the first moment. For example, the initial position may be regarded as an example of the position at the second moment.
[0118] S308. The local optimizer determines a local variable of each particle of the plurality of particles at a first moment.
[0119] The content of the local variables can refer to the content of the local variables in S306 above. The following takes determining the local variables of a particle as an example to introduce the content of determining the local variables of a particle.
[0120] Exemplarily, the local optimizer can determine the local position of the particle under the action of neighboring particles based on the position of the particle at the second moment. Optionally, the dual variable corresponding to the particle can also be obtained. For example, the local optimizer can solve the local position and dual variable of the particle based on the alternating direction method of multipliers (ADMM), the position of the particle at the second moment, and the external force exerted on the particle. The M devices in the local optimizer can respectively determine the local variables corresponding to different particles in the multiple particles. Among them, the external force exerted on the particle can be determined by the simulation system according to the needs of the scene to be simulated, or set by the user during the simulation process, which is not limited.
[0121] By analogy, the M devices in the local optimizer can respectively determine the local variables corresponding to the multiple particles at the first moment.
[0122] Optionally, the local position of the particle under the influence of neighboring particles may include the position or velocity of the particle under the influence of each neighboring particle among the neighboring particles, and the position or velocity of the particle under the influence of any two neighboring particles among the neighboring particles can be solved by two different devices among the M devices.
[0123] For example, see Figure 6 , which is a schematic diagram of a process for determining a global variable of a particle provided in an embodiment of the present application. Figure 6 Take an object composed of four particles a, b, c, and d as an example. The particles can be regarded as connected by springs. The neighboring particles of particle a include particles b and d; the neighboring particles of particle b include particles a and c; the neighboring particles of particle c include particles b and d; the neighboring particles of particle d include particles a and c.
[0124] In the initial state, particles a, b, c, and d are distributed in a square, and then particle d is subjected to a pulling force from the upper right. When solving local variables, the simulation system can solve the four spring constraints of particle a-particle b, particle b-particle c, particle c-particle d, and particle d-particle a respectively, which can be regarded as four independent tasks. Therefore, the simulation system can distribute these four tasks to four devices among the M devices in the local optimizer for processing.
[0125] S309: The local optimizer sends local variables to the global optimizer. Correspondingly, the global optimizer receives the local variables from the local optimizer.
[0126] After determining the local variables of at least one particle among the multiple particles, each of the M devices may send the local variables of the at least one particle to the global optimizer. In this way, the global optimizer may obtain the local variables of each particle among the multiple particles.
[0127] S310: The global optimizer determines the global variable of each particle at the first moment based on the parameter set and the local variable of each particle in the plurality of particles at the first moment.
[0128] The parameter set represents the energy influence relationship between multiple particles. By modifying the local variables of the particles based on the parameter set, the global variables of the particles at the first moment can be determined.
[0129] For example, a formula for a particle's global variable can be referred to as the following formula (2).
[0130] Ax=b (2)
[0131] Wherein, x may represent the global position of multiple particles at the first moment (ie, an example of a global variable of a particle), A represents a parameter set, and b represents the local variables of multiple particles at the first moment.
[0132] Optionally, in the process of solving the global variables of multiple particles using the above formula (1), the simulation system can solve x using an iterative algorithm such as a preconditioned conjugate gradient method (PCG).
[0133] In a possible implementation, if the local variable of each particle indicates the position of the particle under the action of neighboring particles, and the local variable of each particle indicates the speed of the particle in the neighboring particles, then the simulation system can determine the position of the particle under the action of multiple particles based on the above formula (2), and differentiate the position of the particle under the action of multiple particles to obtain the speed of the particle in the neighboring particles indicated by the local variable of each particle. Alternatively, if the local variable of each particle indicates the speed of the particle under the action of neighboring particles, and the local variable of each particle indicates the position of the particle in the neighboring particles, then the simulation system can determine the speed of the particle under the action of multiple particles based on the above formula (2), and differentiate the speed of the particle under the action of multiple particles to obtain the position of the particle in the neighboring particles indicated by the local variable of each particle.
[0134] It should be understood that the above S303, S308 and S310 are a specific implementation method for determining the global variables of each particle at the first moment based on the energy expression provided in the embodiment of the present application. In fact, there may be multiple ways to determine the global variables of each particle at the first moment based on the energy expression, and the embodiment of the present application does not make specific limitations on this.
[0135] S311, the global optimizer sends the global variables of multiple particles to the local optimizer. Correspondingly, the local optimizer receives the global variables of multiple particles from the global optimizer.
[0136] In this way, the local optimizer can determine the global variables of the multiple particles at subsequent moments based on the global variables of the multiple particles at the first moment.
[0137] For example, continue to refer to Figure 6 In the example shown, the simulation system can determine the local variables of particles a, b, c, and d. The simulation system determines the global variables of the object, and thus based on all the variables, the final state of the object can be determined.
[0138] For example, see Figure 7 , is a schematic diagram of a task scheduling provided in an embodiment of the present application. Figure 7 As shown, the local optimizer includes 4 servers and the global optimizer includes 4 devices. The four servers in the local optimizer can respectively determine the positions of particle d and particle a under the interaction between particle d and particle a, the positions of particle a and particle b under the interaction between particle a and particle b, the positions of particle b and particle c under the interaction between particle b and particle c, and the positions of particle c and particle d under the interaction between particle c and particle d. The four servers in the global optimizer can respectively determine global variables based on particle a, particle b, particle c, and particle d.
[0139] S312: The global optimizer sends global variables to the renderer. Correspondingly, the renderer can receive global variables from the global optimizer. The global variables here are global variables of multiple particles.
[0140] S313: The renderer determines the simulation result of the scene to be simulated at the first moment based on the global variable.
[0141] Exemplarily, the renderer renders the scene to be simulated at the first moment based on the global variables of the multiple particles at the first moment to obtain a simulation result of the scene to be simulated at the first moment.
[0142] It should be understood that if the simulation system does not distinguish (or does not include) the configuration interface, parameter solver, global optimizer, local optimizer and renderer, then there is no need to perform the above Figure 3 The interaction process between the various parts involved, for example, may not require the execution of steps S302, S304, S307, S309, S311 and S312, that is, steps S302, S304, S307, S309, S311 and S312 may be optional steps, and the embodiments of the present application do not specifically limit this.
[0143] In an embodiment of the present application, the user can flexibly define an energy expression to increase the flexibility of the simulation. Since the positions of multiple particles are determined based on the energy expression and the interaction between multiple particles, the simulation accuracy is higher. In addition, in an embodiment of the present application, the simulation system can determine the resources required to simulate the scene to be simulated according to the target simulation index set by the user, so that the simulation system can flexibly and accurately schedule resources, which is conducive to improving the resource utilization of the simulation system. In addition, the simulation system can also divide the task of simulating the scene to be simulated into multiple categories of tasks, and use different devices to perform different categories of tasks, thereby improving the parallel execution degree of the simulation system, improving the resource utilization efficiency of the simulation system, and not excessively increasing the data interaction between the simulation systems.
[0144] It is understandable that, in order to realize the functions in the above-mentioned embodiments, the simulation system includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.
[0145] This application embodiment provides a simulation device. Figure 8 , is a schematic diagram of a structure of a simulation device provided in an embodiment of the present application. The simulation device 800 may be, for example, Figure 1 or Figure 2 The simulation system shown in the previous Figure 1 or Figure 2 The functions of the simulation system shown in the previous Figure 1 or Figure 2 In the simulation system shown in FIG. 8 , the simulation device 800 can also be used to implement the functions of any of the simulation systems described above, and accordingly, can also execute the steps executed by the simulation system described above.
[0146] like Figure 8 As shown, the simulation device 800 includes a configuration module 801, a determination module 802 and an acquisition module 803. Among them, the configuration module 801, the determination module 802 and the acquisition module 803 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the determination module 802 is introduced by taking the determination module 802 as an example. Similarly, the implementation of the configuration module 801 and the acquisition module 803 can be the implementation of the determination module 802.
[0147] As an example of a software functional unit, the module 802 can include code running on a computing instance. Among them, the computing instance can include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance can be one or more. For example, the module 802 can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region can include multiple AZs.
[0148] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0149] As an example of a hardware functional unit, the determination module 802 may include at least one computing device, such as a server, etc. Alternatively, the determination module 802 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0150] The multiple computing devices included in the determination module 802 may be distributed in the same region or in different regions. The multiple computing devices included in the determination module 802 may be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the determination module 802 may be distributed in the same VPC or in multiple VPCs. The multiple computing devices may be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0151] Exemplarily, the configuration module 801 can be used to execute S301, the determination module 802 can be used to determine the global variables of the particle at the first moment based on the energy expression, for example, executing steps S303, S308 and S310, and the acquisition module 803 can be used to execute S313. Optionally, the determination module 802 can also be used to execute S306. For the specific contents of the energy expression and each step, please refer to the above Figure 3 The contents discussed will not be repeated here.
[0152] This application embodiment provides a computing device. Fig. 9 , is a schematic diagram of a computing device 900 provided in an embodiment of the present application. Fig. 9 As shown, the computing device 900 includes a processor 901 and a memory 902. Optionally, the computing device 900 also includes a communication interface 903.
[0153] The processor 901, the memory 902 and the communication interface 903 can communicate with each other via a bus. The computing device 900 can be a server or a terminal device. It should be understood that the embodiment of the present application does not limit the number of processors and memories in the computing device 900.
[0154] The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The bus 904 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 904 may include a path for transmitting information between various components of the computing device 900 (for example, the processor 901, the memory 902, and the communication interface 903).
[0155] The processor 901 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP) or a digital signal processor (DSP).
[0156] The memory 902 may include a volatile memory, such as a random access memory (RAM). The memory 902 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0157] The memory 902 stores executable program codes, and the processor 901 executes the executable program codes to respectively implement the aforementioned Figure 8 The functions of the configuration module 801, the determination module 802 and the acquisition module 803 in the above embodiment are implemented to realize any of the methods for adjusting resources described above. That is, the memory 902 stores instructions for executing any of the simulation methods. The functions of the configuration module 801, the determination module 802 and the acquisition module 803 can be referred to in the above embodiment. Figure 8 The content of the discussion.
[0158] Alternatively, the memory 902 stores executable codes, and the processor 901 executes the executable codes to respectively implement the functions of the aforementioned simulation system, thereby implementing any of the aforementioned simulation methods. That is, the memory 902 stores instructions for executing any of the aforementioned simulation methods.
[0159] The communication interface 903 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or a communication network.
[0160] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. Each computing device in the at least one computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop, a laptop, or a smart phone.
[0161] Please refer to Fig.10 , is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application. Fig.10 As shown, the computing device cluster includes at least one computing device 1000. Each computing device 1000 in the computing device cluster may include a processor 1001 and a memory 1002. Optionally, each computing device 1000 in the computing device cluster also includes a communication interface 1003. The processor 1001, the memory 1002, and the communication interface 1003 may be connected via a bus. The implementation of the processor 1001 may refer to the above Fig. 9 The implementation of the processor 901 and the implementation of the memory 1002 can refer to the above Fig. 9 The implementation of the memory 902 and the implementation of the communication interface 1003 can refer to the above Fig. 9 The implementation method of the communication interface 903 in FIG.
[0162] In a possible implementation, the memory 1002 in each computing device 1000 in the computing device cluster may store the same instructions for executing any of the above simulation methods.
[0163] In another possible implementation, the memory 1002 of at least one computing device 1000 in the computing device cluster may also store a method for executing any of the above simulation methods (for example, Figure 3 In other words, the combination of at least one computing device 1000 can jointly execute instructions for executing any of the above simulation methods, executing Figure 3 Instructions for the simulation method are shown.
[0164] Optionally, the memory 1002 in different computing devices 1000 in the computing device cluster may store different instructions, respectively used to execute Figure 8That is, the instructions stored in the memory 1002 in different computing devices 1000 can implement the functions of one or more modules in the configuration module 801, the determination module 802 and the acquisition module 803. The functions of the configuration module 801, the determination module 802 and the acquisition module 803 can be referred to in the previous text. Figure 8 The content of the discussion.
[0165] In some possible implementations, at least one computing device 1000 in the computing device cluster may be connected via a network. The network may be a wide area network or a local area network, etc. Specifically, the network is connected via a communication interface 1003 in each computing device 1000. In this type of possible implementation, at least one computing device 1000 in the computing device cluster may jointly execute any of the above-mentioned simulation methods, for example Figure 3 The simulation method shown.
[0166] The present application provides a chip system, which includes: a processor and an interface. The processor is used to call and run instructions from the interface. When the processor executes the instructions, any of the above-mentioned simulation methods is implemented, such as Figure 3 The simulation method shown.
[0167] The embodiment of the present application provides a computer-readable storage medium, which is used to store computer programs or instructions. When the computer-readable storage medium is executed, any of the above simulation methods is implemented, such as Figure 3 The simulation method shown. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive), etc.
[0168] The embodiment of the present application provides a computer program product including instructions, which, when executed on a computer, implements any of the above-mentioned simulation methods, such as Figure 3 The simulation method shown. The computer program product may be a software or program product containing instructions that can be run on a computing device or stored in any available medium.
[0169] The method steps in the embodiments of the present application can be implemented by hardware, or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, a register, a hard disk, a mobile hard disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a base station or a terminal. Of course, the processor and the storage medium can also be present in a base station or a terminal as discrete components.
[0170] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc; it may also be a semiconductor medium, for example, a solid-state hard disk. The computer-readable storage medium may be a volatile or nonvolatile storage medium, or may include both volatile and nonvolatile types of storage media.
[0171] In the various embodiments of the present application, unless otherwise specified or provided for in any logical conflict, the terms and / or descriptions between the different embodiments are consistent and may be referenced to each other, and the technical features in the different embodiments may be combined to form new embodiments according to their inherent logical relationships.
[0172] It is understood that the various numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic.
Claims
1. A simulation method, characterized in that: include: Providing a configuration interface, wherein the configuration interface is used to configure an energy expression, wherein the energy expression is used to describe an energy constraint relationship between multiple particles in a scene to be simulated; Based on the energy expression, determining a global variable of each particle at a first moment, wherein the global variable of each particle indicates position information or velocity information of the corresponding particle under the action of other particles in the plurality of particles; According to the global variables of each particle at the first moment, a simulation result of the scene to be simulated at the first moment is obtained.
2. The method according to claim 1, characterized in that The energy expression includes an inertial potential energy term of each particle and an interaction potential energy term between each particle and neighboring particles, wherein the neighboring particles are at least one particle among the multiple particles located in the neighborhood of each particle.
3. The method according to claim 2, characterized in that The interaction potential energy term between each particle and the neighboring particles includes at least one of the following: If the scene to be simulated includes a software body, the interaction potential energy term between each particle and the neighboring particles includes a collision potential energy term and an elastic potential energy term; If the scene to be simulated includes a fluid, the interaction potential energy term between each particle and the neighboring particles includes a collision potential energy term, and an incompressible and viscous potential energy term; or, If the scene to be simulated includes a rigid body, the interaction potential energy term between each particle and the neighboring particles includes a collision potential energy term.
4. The method according to any one of claims 1 to 3, characterized in that: Based on the energy expression, the global variables of each particle at the first moment are determined, including: Processing the energy expression to obtain a parameter set, wherein the parameter set represents an energy influence relationship between the plurality of particles; Determine a local variable of each particle at a first moment according to a global variable of each particle at a second moment, wherein the local variable of each particle at the first moment indicates position information or speed information of each particle under the action of neighboring particles, the second moment is before the first moment, and the neighboring particle is at least one particle of the multiple particles located in a neighboring area of each particle; The global variables of each particle are determined according to the local variables of each particle at the second moment and the parameter set.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Receive a target frame rate of the simulation result input by a user; The number of resources required for simulation is determined based on the target frame rate and the number of particles included in the scene to be simulated.
6. The method according to claim 5, characterized in that Determining the number of resources required for the simulation based on the frame rate of the simulation result and the number of particles included in the scene to be simulated includes: Determining a reference number of resources required for simulation according to the number of particles included in the scene to be simulated; Determine a reference frame rate corresponding to the reference quantity, wherein the reference frame rate is a frame rate of a simulation result obtained by simulating using the reference quantity of resources; The reference quantity is adjusted until a ratio of a corresponding reference frame rate to the target frame rate is within a first value range, and the adjusted reference quantity is determined as the quantity of resources required for the simulation.
7. A simulation device, characterized in that: include: A configuration module, used for providing a configuration interface, wherein the configuration interface is used for configuring an energy expression, wherein the energy expression is used for describing an energy constraint relationship between multiple particles in a scene to be simulated; A determination module, configured to determine a global variable of each particle at a first moment based on the energy expression, wherein the global variable of each particle indicates position information or velocity information of the corresponding particle under the action of other particles in the plurality of particles; The obtaining module is used to obtain the simulation result of the scene to be simulated at the first moment according to the global variable of each particle at the first moment.
8. The device according to claim 7, characterized in that The energy expression includes an inertial potential energy term of each particle and an interaction potential energy term between each particle and neighboring particles, wherein the neighboring particles are at least one particle among the multiple particles located in the neighborhood of each particle.
9. The device according to claim 8, characterized in that The interaction potential energy term between each particle and the neighboring particles includes at least one of the following: If the scene to be simulated includes a software body, the interaction potential energy term between each particle and the neighboring particles includes a collision potential energy term and an elastic potential energy term; If the scene to be simulated includes a fluid, the interaction potential energy term between each particle and the neighboring particles includes a collision potential energy term, and an incompressible and viscous potential energy term; or, If the scene to be simulated includes a rigid body, the interaction potential energy term between each particle and the neighboring particles includes a collision potential energy term.
10. The device according to any one of claims 7 to 9, characterized in that: Determine the module specifically for: Processing the energy expression to obtain a parameter set, wherein the parameter set represents an energy influence relationship between the plurality of particles; Determine a local variable of each particle at a first moment according to a global variable of each particle at a second moment, wherein the local variable of each particle at the first moment indicates position information or speed information of each particle under the action of neighboring particles, the second moment is before the first moment, and the neighboring particle is at least one particle of the multiple particles located in a neighboring area of each particle; The global variables of each particle are determined according to the local variables of each particle at the second moment and the parameter set.
11. The device according to any one of claims 7 to 10, characterized in that: The configuration module is further used to receive a target frame rate of the simulation result input by a user; The determination module is further used to determine the number of resources required for the simulation based on the target frame rate and the number of particles included in the simulation scene.
12. The device according to claim 11, characterized in that The determination module is specifically used for: Determining a reference number of resources required for simulation according to the number of particles included in the simulation scenario; Determine a reference frame rate corresponding to the reference quantity, wherein the reference frame rate is a frame rate of a simulation result obtained by simulating using the reference quantity of resources; The reference quantity is adjusted until a ratio of a corresponding reference frame rate to the target frame rate is within a first value range, and the adjusted reference quantity is determined as the quantity of resources required for the simulation.
13. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 6.
14. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 6.
15. A computer-readable storage medium, characterized in that: The storage medium stores a computer program or instruction, and when the computer program or instruction is executed by the communication device, the method according to any one of claims 1 to 6 is implemented.