An optimization method, system, and apparatus for a particle system

By optimizing the particle system using quantum computing and machine learning algorithms, the problems of insufficient adaptability and rendering performance in existing technologies have been solved, enabling efficient rendering and realistic visual effects of the particle system in different scenarios.

CN119672182BActive Publication Date: 2026-01-02GUANGZHOU YINGFENG NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411730683.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2026-01-02
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

Existing particle systems based on AI models and GPU acceleration are poorly adaptable to scene changes, resulting in poor rendering performance and difficulty in meeting the special effects requirements of different game scenarios.

Method used

Employing quantum computing and machine learning algorithms, the system randomly initializes particle attributes, predicts particle behavior in real time, generates dynamic effects, dynamically adjusts particle effect attributes based on the player's scene and state, tracks particle life status in real time, generates a particle reuse pool, and optimizes particle allocation strategies.

Benefits of technology

It improves the adaptability and rendering performance of the particle system, generating more realistic and vivid visual effects, and can quickly adapt to the differences in special effects across multiple scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672182B_ABST
    Figure CN119672182B_ABST
Patent Text Reader

Abstract

The application is suitable for the computer technology field, and provides an optimization method, system and device for a particle system, including: loading the particle system, randomly initializing particle attributes of particles in the particle system; based on motion and interaction rules of the particles, using quantum calculation, predicting behaviors of the particles in real time, and generating dynamic special effects of a corresponding scene; dynamically adjusting special effect attributes of the particles according to a scene and a state in which a player is located, the special effect attributes including transparency, color and texture of the particles; tracking a life state of each particle in real time, marking each particle, generating a particle reuse pool, generating a particle reuse strategy based on the particle reuse pool, and the particle reuse strategy being used for dynamic distribution of reusable particles, the application can optimize use efficiency of the particles, adapt to particle special effect differences caused by multi-scene changes, improve overall adaptability and rendering performance of the particle system, and thus more real and more vivid visual effects can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of computers, and particularly relates to an optimization method, system and device for a particle system. BACKGROUND

[0002] At present, in the field of game development, a particle system has become an indispensable tool for realizing complex special effects. By simulating the motion and interaction of particles, a particle system can generate vivid and realistic visual special effects such as flames, smoke, explosions, etc., greatly enhancing the visual experience of a game and making the game scene more realistic and engaging.

[0003] In the prior art, a particle system based on an AI model and GPU acceleration is usually adopted, and the combination of intelligentization and parallel computing effectively improves the expressiveness of particle special effects and system performance. For example, an AI model can predict the motion trajectory and interaction behavior of particles, thereby realizing more natural and realistic special effect effects, and GPU acceleration technology significantly improves the calculation and rendering speed of particles and reduces the consumption of system resources.

[0004] However, the particle system based on the AI model and GPU acceleration described above can improve the calculation and rendering speed of particles to a certain extent through intelligent parallel computing, but the system is difficult to quickly adapt to changes in the scene, and its adaptability is poor. Different game scenes have different requirements for particle special effects, resulting in a deviation between the special effect effects and actual requirements and poor rendering performance. SUMMARY

[0005] The embodiments of the present application provide an optimization method, system and device for a particle system, which can solve the problem of poor adaptability and rendering performance in the rendering process of the particle system in the prior art.

[0006] In a first aspect, the embodiments of the present application provide an optimization method for a particle system, comprising:

[0007] loading a particle system, randomly initializing particle attributes of particles in the particle system, the particle attributes including position, speed and color;

[0008] based on the motion and interaction rules of particles, using quantum computing to predict the behavior of particles in real time, and generating dynamic special effects corresponding to the scene;

[0009] dynamically adjusting special effect attributes of the particles according to the scene and state in which a player is located, the special effect attributes including the transparency, color and texture of the particles;

[0010] tracking the life state of each particle in real time, marking each particle, generating a particle reuse pool, and generating a particle reuse strategy based on the particle reuse pool, the particle reuse strategy being used for dynamic allocation of reusable particles.

[0011] Further, the loading particle system randomly initializes particle attribute in the particle system, including:

[0012] Adopting an asynchronous loading mode, loading system resources required by the particle system, the system resources including the number of particles, memory capacity, disk space and network bandwidth;

[0013] According to the number of particles, randomly generating position coordinates, velocity components, rotation components and color components for each particle in a three-dimensional space;

[0014] The position coordinates, velocity components, rotation components and color components are assigned as initial particle attribute values to corresponding particle attribute variables of each particle object.

[0015] Further, based on the motion and interaction rules of particles, quantum computing is used to predict the behavior of particles in real time, and dynamic special effects of the corresponding scene are generated, including:

[0016] Obtaining initial particle attribute values of each particle, mapping the initial particle attribute values to quantum bits to construct a quantum state space of the particle;

[0017] According to the influence of wind and terrain on particle motion, a quantum Hamiltonian model of particle motion is established, and the quantum state evolution law of particle motion is obtained by solving the Schrödinger equation, the quantum Hamiltonian model including kinetic energy term, potential energy term and external field term, the external field term for reflecting the influence of wind and terrain on particle motion;

[0018] Introducing a temperature variable in the quantum state space, simulating the influence of temperature change on the surrounding environment through quantum state superposition;

[0019] Based on the special effect requirements of different scenes, dynamically adjusting the particle attribute values of each particle through quantum gate parameters and measurement bases;

[0020] Randomly sampling in the quantum state space to obtain classical state information of the particle, inputting the classical state information into a classical rendering pipeline to generate dynamic special effects.

[0021] Further, based on the motion and interaction rules of particles, quantum computing is used to predict the behavior of particles in real time, and dynamic special effects of the corresponding scene are generated, further including:

[0022] Adopting a quantum entangled state, establishing an association model between different particles, based on the association model, constructing a particle group evolution equation, and obtaining the quantum state evolution law of collision and interaction between different particles by solving the particle group evolution equation;

[0023] The specific formula of the particle population evolution equation is as follows:

[0024]

[0025] Wherein, H represents the total Hamiltonian, H = H0 + Hint, H0 is the Hamiltonian of free particles, Hint is the Hamiltonian of interacting particles, |Ψ(t)> represents the quantum entangled state between the interacting particles.

[0026] Further, based on the motion and interaction rules of particles, quantum computing is used to predict the behavior of particles in real time, and dynamic special effects corresponding to the scene are generated, including:

[0027] Real-time acquisition of particle parameters of each particle in the dynamic special effect, the particle parameters including particle attributes and scene parameters, the scene parameters including wind, terrain, light and temperature;

[0028] Encoding the particle parameters to obtain particle encoding data;

[0029] Input the particle encoding data into the quantum neural network, and optimize the particle encoding data through the quantum neural network.

[0030] Further, the scene includes desert, volcano and forest, and the state is the life cycle of the player;

[0031] The special effect attributes of the particles are dynamically adjusted according to the scene and state of the player, and the special effect attributes include the transparency, color and texture of the particles, including:

[0032] By analyzing the scene parameters of the scene in real time, the particle parameter combination of each particle in the scene is determined, and the particle parameter combination includes the attribute values of all special effect attributes of the particles;

[0033] Based on the particle parameter combination, the plurality of particles are divided into multiple rendering layers for rendering;

[0034] An iterative update is performed on the particle parameter combination using a machine learning algorithm;

[0035] An image analysis-based particle special effect enhancement technology is used to dynamically adjust the motion trajectory and visual effect of the particles according to the change of the scene in which the player is located.

[0036] Further, the life state includes a visible state and an influence state, the visible state representing the proportion of the particles on the screen, and the influence state representing the contribution of the particles to the overall brightness and color of the scene;

[0037] The life state of each particle is tracked in real time, each particle is labeled, and a particle reuse pool is generated, including:

[0038] When the visible state or the influence state of the particle is lower than a preset state threshold, the particle is marked as a reusable particle, and a plurality of the reusable particles are allocated to a particle reuse pool;

[0039] A similarity analysis is performed on the special effect attributes of the reusable particles to determine a particle type of the reusable particles;

[0040] According to the number of the particle types, the particle reuse pool is divided into a plurality of sub-reuse pools, and one of the sub-reuse pools represents reusable particles of one particle type, the particle type including a flame, a smoke, and a water flow.

[0041] Further, the particle reuse strategy is generated based on the particle reuse pool, and the particle reuse strategy is used for dynamic allocation of the reusable particles, including:

[0042] The particle attributes of the reusable particles are reset and state-converted by using a particle reuse acceleration mechanism;

[0043] A preset number of reusable particle objects are set for each of the sub-reuse pools;

[0044] The life cycle states of the particles of different particle types in a scene are monitored in real time, and the number of the reusable particle objects in each of the sub-reuse pools is dynamically adjusted based on the preset number of particles, the life cycle state including generation, activity, attenuation, and death;

[0045] The reuse effect of the reusable particles is evaluated by using a gradient boosting algorithm, and the proportion of the reusable particles is dynamically adjusted based on the evaluation result.

[0046] In a second aspect, an embodiment of the present application provides an optimization system for a particle system, including:

[0047] A first processing module is configured to load a particle system, and randomly initialize particle attributes of particles in the particle system, the particle attributes including a position, a speed, and a color;

[0048] A second processing module is configured to predict behaviors of the particles in real time by using quantum computing based on motion and interaction rules of the particles, and generate dynamic special effects of a corresponding scene;

[0049] A third processing module is configured to dynamically adjust special effect attributes of the particles according to a scene and a state in which a player is located, the special effect attributes including a transparency, a color, and a texture of the particles;

[0050] The fourth processing module is configured to track a life state of each particle in real time, mark each particle, generate a particle multiplexing pool, and generate a particle multiplexing strategy based on the particle multiplexing pool, where the particle multiplexing strategy is used for dynamic allocation of multiplexable particles.

[0051] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the above-mentioned optimization method for a particle system when executing the computer program.

[0052] Compared with the prior art, the embodiment of the present application has the following beneficial effects:

[0053] The optimization method for a particle system provided by the embodiment of the present application can provide an initial state for each particle by loading a particle system and randomly initializing particle attributes, can make a real-time prediction on behaviors of the particles by using quantum computing, can make dynamic special effects adaptable to scene changes, and can effectively improve expressiveness of the special effects by dynamically adjusting special effect attributes of the particles according to a scene and a state in which a player is located. Meanwhile, the optimization method can optimize a use efficiency of the particles by tracking a life state of the particles in real time, generating a particle multiplexing pool, and formulating a multiplexing strategy, can adapt to differences in particle special effects caused by multi-scene changes, can improve overall adaptability and rendering performance of the particle system, and can thus obtain more real and more vivid visual effects. BRIEF DESCRIPTION OF DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0055] Figure 1 is a flowchart of an optimization method for a particle system provided by an embodiment of the present application;

[0056] Figure 2 is a structural diagram of an optimization system for a particle system provided by an embodiment of the present application;

[0057] Figure 3 is a structural diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0058] In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular architectures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known methods, devices, circuits, and

[0059] It is to be understood that the terminology "includes", "has", "holds", "contains" and / or "comprising", "including", "having" and their conjugates, as used herein, means "including but not limited to", and not to the exclusion of any other term or aspect.

[0060] It is also to be understood that the terminology "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items, as well as to the

[0061] As used in the description of the application and the appended claims, the term "if' can be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if it is determined" or "if [a described condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [the described condition or event]" or "in response to detecting [the described condition or event]".

[0062] In addition, the terms "first", "second", "third", etc. as used in the description of the application and the appended claims are not used to denote or imply relative importance but are used to distinguish one element from another.

[0063] Reference throughout this specification to "one embodiment", "an embodiment", or "a specific embodiment", means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, appearances of the phrases "in one embodiment", "in an embodiment", "in some embodiments", "in other embodiments", "in additional embodiments", and so on, do not necessarily all refer to the same embodiment, unless otherwise indicated. The terms "including", "containing", "comprising", "having" and variations thereof, mean "including but not limited to", unless expressly specified otherwise.

[0064] Reference is made to Figure 1 As shown in the drawings, the present application is an optimization method for a particle system, comprising the following steps:

[0065] S100, loading a particle system, randomly initializing particle attributes of particles in the particle system, the particle attributes including position, velocity and color;

[0066] In some embodiments, the above step S100 comprises:

[0067] In an asynchronous loading manner, loading system resources required by the particle system, the system resources including particle quantity, memory capacity, disk space and network bandwidth;

[0068] According to the particle quantity, randomly generating position coordinates, velocity components, rotation components and color components for each particle in a three-dimensional space;

[0069] Assigning the position coordinates, the velocity components, the rotation components and the color components as initial particle attribute values to corresponding particle attribute variables of each particle object.

[0070] In this embodiment, the particle system is loaded, and the system resources required by the particle system are obtained through the resource management module. It can be understood that the system resources of the particle system are preconfigured in the resource management module. The preconfiguration of the system resources is manually configured by the user according to the demand, or automatically configured by the resource management module based on the default mode. The resource management module can monitor the running state of the particle system in real time, dynamically adjust the allocation of system resources according to the current load and performance demand, not only improve the utilization efficiency of resources, but also ensure the stability and fluency of particle effects in different scenes. In addition, through the preconfiguration, the resource management module can reasonably control the upper limit of the resource use of the particle system, avoiding the performance bottleneck and waste caused by excessive resource occupation.

[0071] In one embodiment, the memory space of the particle system is also efficiently managed through the memory pool management module and the memory optimization algorithm, reducing memory fragmentation and improving memory utilization. Specifically, according to the preconfiguration of the particle system, the required memory space is determined, and the required memory space is applied through the memory pool management module. The memory pool management module is responsible for maintaining one or more memory pools, and the above memory pool is composed of a series of fixed-size memory blocks, which are used to meet the different memory requirements of the particle system. The memory optimization algorithm is used to merge and reallocate the memory space applied by the particle system, such as merging adjacent free memory blocks into larger memory blocks, and releasing the memory blocks that are no longer used back to the memory pool, thereby reducing memory fragmentation and improving memory utilization. Specifically, according to the running situation of the particle system, such as the change of the particle quantity, the adjustment of the special effect complexity, etc., the parameters of the memory optimization algorithm are dynamically adjusted. For example, when the particle quantity increases, the algorithm can be adjusted to perform memory merging and reallocation more frequently to ensure that there is enough memory space for the particle system to use.

[0072] In the embodiment, the asynchronous loading mode is used in the process of loading system resources, which can improve the efficiency of resource loading. In addition, in some embodiments, a callback function is provided to determine whether all system resources of the particle system are loaded. Specifically, when the resource management module loads the required system resources, the callback function is triggered to determine whether all required system resources are loaded. If all required system resources are loaded, the particle attributes of the particles in the particle system are initialized.

[0073] In the embodiment, the initial position coordinates of each particle are generated by using a Gaussian distribution algorithm according to a preset particle quantity, and the position coordinates are in a preset three-dimensional space. The initial velocity components of each particle are generated by using a uniform distribution algorithm according to a preset velocity distribution range, and the velocity components include x, y, and z directions. The initial RGB color components of each particle are generated by using a random function according to a preset color value range, and the color range is between 0 and 255. For each particle, a random function is used to generate its initial rotation components in a preset range, including rotation angles around the x-axis, the y-axis, and the z-axis, and the rotation range is between 0 and 2π.

[0074] S200, based on the motion and interaction rules of the particles, using quantum computing to predict the behavior of the particles in real time, and generating dynamic special effects corresponding to the scene;

[0075] In the embodiment, the parallel computing capability of quantum computing is used to predict the motion trajectories, collisions, and interactions of a large number of particles in real time, so as to quickly generate more realistic dynamic effects, such as simulating the rolling and collision of sand particles in a sandstorm, the diffusion and settlement of volcanic ash in a volcanic eruption, etc. In addition, through quantum computing, the particles can be controlled in detail, such as simulating the rotation and deformation of sand particles in a sandstorm, or the influence of temperature changes of volcanic ash on the surrounding environment in a volcanic eruption, thereby improving the realism of the special effects.

[0076] In some embodiments, the above step S200 includes:

[0077] Obtaining initial particle attribute values of each particle, mapping the initial particle attribute values to quantum bits, and constructing a quantum state space of the particle;

[0078] According to the influence of wind and terrain on the motion of the particles, a quantum Hamiltonian model of the motion of the particles is established, the quantum state evolution law of the motion of the particles is obtained by solving the Schrodinger equation, the quantum Hamiltonian model includes a kinetic energy term, a potential energy term, and an external field term, and the external field term is used to reflect the influence of wind and terrain on the motion of the particles;

[0079] A temperature variable is introduced into the quantum state space, and the influence of temperature changes on the surrounding environment is simulated through quantum state superposition.

[0080] A correlation model between different particles is established by using quantum entangled states, and quantum state evolution rules of collision and interaction between different particles are obtained by using Schrodinger equation.

[0081] Based on the special effect requirements of different scenes, the particle attribute values of each particle are dynamically adjusted through quantum gate parameters and measurement bases.

[0082] Random sampling is performed in the quantum state space to obtain the classical state information of the particle, and the classical state information is input into the classical rendering pipeline to generate dynamic special effects.

[0083] In this embodiment, by mapping the motion and interaction rules of particles to quantum bits, quantum computing can complete the behavior prediction and simulation calculation of a large number of particles in a very short time. At the same time, quantum computing can also realize the interaction and correlation calculation between particles through superposition state and entangled state, improve the adaptability of particles between different scenes, and generate more realistic and natural particle effects.

[0084] Specifically, the position coordinates, velocity components, and rotation components of each particle are obtained, and the above particle attribute values are mapped to quantum bits to construct a quantum state space of the particle. Specifically, the position coordinates are mapped to spatial quantum bits, the velocity components are mapped to momentum quantum bits, and the rotation components are mapped to spin quantum bits, thereby generating a quantum state space. In one embodiment, the initial coordinates of the particle (x, y, z) = (2, 4, 6), the velocity components (v x , v y , v z ) = (3, 4, 5), and the rotation component θ = π / 6. The above position coordinates (x, y, z) are mapped to 3 spatial quantum bits. Specifically, the position parameters are converted to binary representation: x = 2 → 010, y = 4 → 100, and z = 6 → 110. Therefore, the spatial quantum state |ψs> of the above particle can be represented as: which is simplified as |ψs> = |010100110>. For the momentum quantum state |ψp>, the velocity parameters are also converted to binary representation: v x = 3 → 011; v y = 4 → 100; v z = 5 → 101. Therefore, the momentum quantum state |ψp> can be represented as: Simplify the expression as: | ψp > = | 011100101 > For the spin quantum state | ψr >, the rotation angle θ = π / 6 is mapped to 1 spin quantum bit. Since θ is continuous, the encoding method is used to map the rotation angle parameter to the ground state | 0 > and | 1 > of the spin quantum bit. Specifically, if θ is less than 2π, the spin quantum bit is | 0 >, otherwise it is | 1 >. Therefore: The above | ψr > = | 0 >, and finally the spatial quantum state, momentum quantum state and spin quantum state are tensor product to obtain the comprehensive quantum state of the particle: On this basis, each quantum state is regarded as an independent system, and is combined when needed to simulate the motion and rotation behavior of the particle in space. Specifically, the unitary transformation is performed on the comprehensive quantum state space of the particle Where H is the Hamiltonian of the particle, is the reduced Planck constant, and t is the time parameter. The Hamiltonian H usually includes the kinetic energy term and the potential energy term, and the unitary transformation U(t) changes the quantum state | ψ > according to the Hamiltonian H and the time t.

[0085] In this embodiment, when constructing the quantum Hamiltonian model, the kinetic energy term and the potential energy term of the particle are obtained through physical modeling. The kinetic energy term represents the motion state of the particle, and the potential energy term is related to the height of the terrain where the particle is located. For the modeling of the external field term, the wind force is added to the above physical model as a vector field to simulate the actual influence of the wind force on the particle path. In the above manner, the external field term can accurately reflect the comprehensive effect of the wind force and the terrain on the particle motion. The Schrödinger equation is solved by using a numerical method, so as to obtain the evolution of the quantum state of the particle with time. Specifically, the kinetic energy term of the particle is calculated by the mass m and the velocity v of the particle. In quantum mechanics, the kinetic energy term T = \frac{p^2}{2m}, where p is the momentum operator and m is the mass of the particle. For the potential energy term: in the simple harmonic oscillator model, it is represented as V(x) = \frac{1}{2}kx^2, where k is the elastic constant and x is the position of the particle in the potential well. For the external field term: the wind force is taken as a vector field F(x,y,z) into the model, specifically, Where U is the wind potential function, which is related to the terrain and wind speed. Therefore, the external field term can accurately reflect the influence of the wind force and the terrain on the particle motion.

[0086] In this embodiment, the values of the wave function on a discrete time and space grid are obtained by solving the Schrödinger equation, and then the behavior of the particle in the quantum system is understood. Specifically, when numerically solving the Schrödinger equation, a time-dependent method such as the Crank-Nicolson algorithm can be used. A discrete time and space grid is constructed, and a finite difference method is used to approximately solve the partial differential equation. When constructing the discrete grid, the time step is set to Δt and the space step is set to Δx. At this time, the wave function ψ(x, t) of the particle will evolve over time. Then, the wave function is updated using an iterative formula, and the specific formula is:

[0087]

[0088] In the above formula, is used to represent the kinetic energy term, is used to represent the potential energy term, and the time evolution process is embodied by iterating the above formula.

[0089] In this embodiment, the particle temperature is introduced as a variable into the above quantum state space to simulate the influence of temperature changes on the particle system environment. Specifically, the temperature of each particle is randomly initialized, and the temperature quantum state of each particle is represented using a density matrix based on the temperature distribution of each particle. The influence of particles at different temperatures on the surrounding environment is simulated using the principle of quantum state superposition, and the probability of the environment being affected is obtained by calculating the trace of the density matrix. In some embodiments, the introduction of the temperature variable can simulate a volcanic scenario. On this basis, the Schrödinger equation is used to simulate the process of volcanic ash diffusion. Specifically, a Hamiltonian operator is constructed, which includes gravitational potential energy, air resistance dissipation term, and potential energy change caused by thermal convection. The parameters in the Hamiltonian operator are set according to the actual situation. If the temperature changes drastically, a temperature-related correction term is added to the Hamiltonian. The quantum state of the volcanic ash particle evolves over time by solving the time-dependent Schrödinger equation. According to the quantum state evolution result, the probability density distribution of the volcanic ash particle in space is calculated, which describes the diffusion process of the volcanic ash in the air. In addition, the Monte Carlo method is used to simulate the process of volcanic ash settling. Specifically, the initial position, velocity, and temperature of the volcanic ash particle are obtained. For each particle, the influence of gravity, air resistance, and thermal convection is calculated to obtain its motion trajectory. If the particle temperature is higher than the environmental temperature, the thermal convection is upward and the air resistance decreases. If the particle temperature is lower than the environmental temperature, the thermal convection is downward and the air resistance increases. By simulating the motion trajectories of a large number of particles, the spatial distribution of the volcanic ash particles at different time points is obtained, and the settling area and settling rate are determined.

[0090] In this embodiment, according to the special effect requirements of different scenes, the particle attribute values of each particle are dynamically adjusted through quantum gate parameters and measurement bases, thereby improving the adaptability of different particles in different scenes. Specifically, for the particle attribute values that need to be adjusted, the corresponding quantum gate parameters are selected for setting, such as adjusting the particle direction through a rotation gate and adjusting the particle speed through a phase gate. After completing the particle attribute adjustment, according to the observation requirements, a suitable measurement base is selected, such as selecting a position observation measurement base for observing the position distribution of particles, and selecting a momentum observation measurement base for observing the momentum distribution of particles. According to the measurement results and the adjustment of the particle attributes, a quantum machine learning algorithm such as a quantum support vector machine or a quantum neural network is used to model and optimize the relationship between the particle attributes and the special effect requirements of different scenes, thereby realizing intelligent control of the particle attributes. Specifically, a quantum support vector machine algorithm is used to model the relationship between the particle attributes and the scene requirements, and a support vector machine model is constructed through a training sample set {(x1, y1), (x2, y2), …, (x n , y n )} , where x i represents the particle attribute parameters, y i represents the scene requirement parameters, and the support vector machine model is constructed as follows: where a i is the Lagrange multiplier, b is the bias term, <x i , x> represents the inner product between x i and x. By training the above support vector machine model, intelligent mapping of the particle attribute parameters to the scene requirement parameters is realized, and according to the mapping results, the particle attribute values of the particles are adjusted to meet specific scene requirements, thereby realizing intelligent control.

[0091] In this embodiment, a Monte Carlo quantum algorithm is used to randomly sample the particle quantum state space to obtain sample values, which are converted into classical state information through quantum state mapping. These classical state information is input into a pre-set classical rendering pipeline to determine the parameter configuration of the rendering pipeline and generate the initial state of the particle system. The classical state information refers to the state description of the particles under the framework of classical physics, including position, velocity, momentum, energy, and other attributes. The above attributes are key information for describing the motion and state of particles in space and are also basic data for generating particle special effect animations. Specifically, for a sandstorm special effect animation, the randomness parameters of particle motion are set according to the initial state of the particle system to simulate the dynamic effect of the sandstorm. For a volcanic eruption special effect animation, the burst force and diffusion range parameters of particle motion are set according to the initial state of the particle system to simulate the dynamic effect of the volcanic eruption. The particle system is rendered in real time through the rendering pipeline to obtain the animation generation result and output the sandstorm and volcanic eruption particle special effect animations. If the generated animation effect does not meet the pre-set threshold, the rendering pipeline parameters are adjusted and re-rendered until the pre-set threshold requirement is met.

[0092] In this embodiment, the classical state information is input into the classical rendering pipeline to generate dynamic effects, which generate particle dynamic effects such as sandstorms and volcanic eruptions, and play a basic and key role in the whole scheme. To some extent, it provides basic data for physical reality and guiding effect generation, and finally improves the quality of effects and user experience.

[0093] In some embodiments, the above step S200 further includes:

[0094] A quantum entangled state is used to establish a correlation model between different particles, and based on the correlation model, a particle group evolution equation is constructed, and by solving the particle group evolution equation, a quantum state evolution law of collision and interaction between different particles is obtained.

[0095] The specific formula of the particle group evolution equation is as follows:

[0096]

[0097] Where H represents the total Hamiltonian, H=H0+Hint, H0 is the Hamiltonian of a free particle, Hint is the Hamiltonian of interacting particles, and |Ψ(t)> represents the quantum entangled state between interacting particles.

[0098] In this embodiment, according to quantum mechanics theory, quantum entangled state is used to describe the interaction between particles, and quantum correlation model of collision, attraction and repulsion between particles is established. For the established quantum correlation model of particles, by solving the many-body Schrödinger equation, a quantum state evolution equation describing the motion of particle group is obtained. The initial state of the particle is input into the quantum state evolution equation, and the collision and interaction process between particles is simulated by iterative solution, and the quantum state evolution result of the particle group motion is obtained. According to the quantum state evolution result, the position, velocity and other information of the particle are extracted, and the motion trajectory and interaction of the particle group in three-dimensional space are reconstructed. Using the Monte Carlo method, on the basis of the particle motion trajectory, random disturbance is introduced to simulate the randomness and uncertainty of particle motion in the real environment, and the fidelity of the particle group motion effect is improved. For the calculation bottleneck in the simulation process, the parallelism of quantum computing is used to accelerate the solution of the many-body Schrödinger equation, and the calculation efficiency of the particle group motion simulation is improved. The simulation results are visualized and rendered to generate realistic particle group motion animation, which intuitively displays the interaction effects such as collision, attraction and repulsion between particles, and provides reference for scientific research and application in related fields.

[0099] Specifically, for two interacting particles, a Bell state is taken as a quantum entangled state, such as |Ψ>=(|00>+|11>) / √2, and a quantum correlation model of collision, attraction and repulsion between particles is established by introducing an interaction Hamiltonian Hint=J(σ1xσ2x+σ1yσ2y+σ1zσ2z), where J is the coupling strength, and σ1 and σ2 represent the Pauli matrices of the two interacting particles. On this basis, a quantum state evolution equation for describing the motion of a particle group, i.e., a particle group evolution equation, is constructed, and the quantum state evolution law of collision and interaction between different particles is obtained:

[0100]

[0101] where H represents the total Hamiltonian, H=H0+Hint, H0 is the Hamiltonian of a free particle, Hint is the interaction Hamiltonian, and |Ψ(t)> represents the quantum entangled state between the interacting particles.

[0102] In this embodiment, when solving the above particle group evolution equation, the initial state of the particle is substituted into the above evolution equation, and a numerical simulation method such as the Runge-Kutta method is used to iteratively solve the collision and interaction process between particles. Specifically, the initial state of the particle is For the evolved state |Ψ(t)>, the position, velocity and other information of the particle can be extracted, and the motion trajectory and interaction of the particle group in three-dimensional space can be reconstructed according to the extracted information.

[0103] In some embodiments, after the above step S200, the following steps are included:

[0104] Real-time acquisition of particle parameters of each particle in the dynamic special effect, the particle parameters including particle attributes and scene parameters, the scene parameters including wind, terrain, light and temperature;

[0105] Encoding the particle parameters to obtain particle encoding data;

[0106] Inputting the particle encoding data into a quantum neural network, and optimizing the particle encoding data through the quantum neural network.

[0107] In this embodiment, the real-time acquired particle parameters are data cleaned to remove invalid or redundant data, ensuring the accuracy and consistency of the input data, and missing values are filled or interpolated to ensure the integrity of the data. Then, the above processed data is normalized, which helps to reduce the gradient disappearance or gradient explosion problem in the training process of the quantum neural network, so as to better process the quantum neural network.

[0108] In this embodiment, the data input into the quantum neural network needs to be encoded into a form that the quantum neural network can process, such as mapping classical data to qubits, specifically, the method for encoding particle parameters includes amplitude encoding, ground state encoding and angle encoding, wherein amplitude encoding is used to encode classical data as the amplitude of a quantum state. For example, for one-dimensional data x, a quantum state |ψ> can be constructed with an amplitude of √p(x), where p(x) is a probability distribution related to x, and this method is suitable for data representing probability distribution or probability density function. Ground state encoding is used to map each bit or each feature of classical data to a ground state of a qubit. For example, for binary data, 0 can be mapped to the |0> state and 1 can be mapped to the |1> state, and this method is suitable for representing discrete or binary data. Angle encoding is used to encode classical data as the angle of rotation of a qubit. For example, input data can be used as a parameter of a rotation angle using a rotation gate such as an RY gate or an RZ gate, and this method is suitable for representing continuous variables and the accuracy of encoding can be controlled by adjusting the accuracy of the rotation angle.

[0109] In this embodiment, the encoded particle encoding data is input into the input layer of the quantum neural network, the input layer is composed of multiple qubits, each qubit represents a feature of the input data, after the input layer, the data undergoes quantum state evolution in the hidden layer of the quantum neural network, which is used to capture the interaction and dynamic change between particles and their interaction with scene parameters, after the quantum state evolution, the data is output through the output layer, the output layer contains multiple qubits, each qubit represents a feature of the output data, by measuring the qubits of the output layer, the optimized particle parameters such as adjusted position, velocity, color, etc. are obtained, and by optimizing the particle parameters, a more realistic and more lively visual effect can be obtained.

[0110] S300, dynamically adjusting the special effect attributes of the particles according to the scene and the state of the player, the special effect attributes including the transparency, color and texture of the particles;

[0111] In some embodiments, the scene includes a desert, a volcano and a forest, and the state is the life cycle of the player;

[0112] wherein the step S300 comprises:

[0113] by analyzing the scene parameters of the scene in real time, determining the particle parameter combination of each particle in the scene, the particle parameter combination including the attribute values of all special effect attributes of the particles;

[0114] based on the particle parameter combination, dividing a plurality of the particles into a plurality of rendering layers for rendering;

[0115] adopting machine learning algorithm, iteratively updating the particle parameter combination;

[0116] adopting image analysis-based particle special effect enhancement technology, dynamically adjusting the motion trajectory and visual effect of the particle according to the change of the scene where the player is located.

[0117] In this embodiment, according to the illumination intensity, weather condition and terrain complexity of the scene where the player is located, a mapping model between scene characteristics and special effect attributes is established by adopting machine learning algorithm. By obtaining the real-time illumination, weather and terrain data of the scene around the player, the data is input into the established mapping model to obtain the attribute values of the transparency, color and texture of each particle in the current scene, which are encapsulated as particle parameter combination. Based on the above particle parameter combination, the particles in the above scene are divided into different levels, and different rendering strategies and effect control methods are adopted for each layer of particles to achieve more delicate and natural visual performance. Specifically, when rendering the particle special effect, the transparency, color and texture of the particle are dynamically adjusted so that they can be coordinated with the illumination and weather condition of the scene, and the fusion degree of the particle special effect and the scene is improved. By smoothing the motion trajectory of the particle, the abruptness and discontinuity caused by parameter change are eliminated, and the particle special effect is more natural and coherent in vision. According to the change and moving speed of the player's perspective, the rendering range and number of the particle are dynamically adjusted to reduce unnecessary performance overhead while ensuring the visual effect.

[0118] In this embodiment, scene depth information is used to classify each particle in the scene into near, mid, or far levels. The visual influence of each particle is predicted by a deep learning model to determine the level of detail for its rendering. If the particle has a large influence, high-precision rendering is used; if the influence is small, a simplified model is used. In this way, the rendering strategy is dynamically adjusted to optimize the rendering process. All particle data in the scene is obtained, and based on its position information and pre-set visual level thresholds, hierarchical classification is performed. After classification, different rendering parameters are applied to particles in each level: high-precision parameters are used for near particles, simplified parameters are used for far particles, and mid-range particles have their parameters dynamically adjusted according to their visual importance. Through machine learning algorithms, a model is trained to predict the visual importance of particles. The model takes the size, color, brightness, and position of the particle as input and outputs a visual importance score. Based on the score, the rendering strategy of the particle is dynamically adjusted: high-score particles use high-precision rendering, and low-score particles use simplified rendering. For mid-range particles, their rendering strategy is dynamically determined based on their visual importance score and the interaction of other elements in the scene. If the mid-range particle has more interaction or coverage with important visual elements, its rendering precision is increased; otherwise, the rendering precision is appropriately reduced to save computing resources. Using the classified particle data, the rendering engine is optimized to automatically adjust the rendering load based on the level and visual importance of the particles, which can dynamically allocate computing resources in different rendering stages to optimize overall rendering efficiency. By monitoring the rendering effect and system performance in real time, the rendering parameters are adjusted to ensure the best balance between visual effect and system performance.

[0119] In this embodiment, the genetic algorithm is used to initialize the parameter search of the particle special effect attribute, and the initial population is determined based on the pre-set thresholds of visual fidelity, rendering performance, and memory occupation. The particle swarm optimization algorithm is used to fine-tune the results of the genetic algorithm, and the information sharing mechanism in the particle swarm is used to quickly converge to the optimal solution. In each iteration, the fitness function is adjusted according to the requirements of multi-objective optimization to ensure the balance between visual fidelity and system performance. Through the automatic optimization process, the particle special effect attributes are constantly updated until the pre-set optimization target is reached. During the optimization process, the parameter optimization record module records the parameter settings and corresponding effect evaluation of each iteration to provide data support for subsequent optimization iterations. Finally, the particle parameter combination with the best effect is output as the final particle special effect configuration for further rendering and use.

[0120] In the embodiment, a video sequence of a scene in which a player is located is acquired, each frame image in the video sequence is analyzed and processed, a motion vector field information of an object in the image is obtained by using an optical flow method to perform motion estimation on the image, a depth map information of the image is acquired by using a depth estimation technology to perform depth analysis on the image, a three-dimensional scene model is constructed according to the motion vector field information and the depth map information, a particle object is added in the three-dimensional scene model, and a position and a motion speed of the particle are initialized according to the motion vector field information; based on an image analysis result, a motion trajectory of an object in the scene is tracked in real time, a motion direction and a speed of the particle are dynamically adjusted, and a realistic particle special effect picture is generated by comprehensively considering parameters such as a position, a speed and a motion trajectory of the particle and by combining a preset rendering algorithm.

[0121] S400, tracking a life state of each particle in real time, marking each particle, generating a particle reuse pool, and generating a particle reuse strategy based on the particle reuse pool, the particle reuse strategy being used for dynamic allocation of reusable particles.

[0122] In some embodiments, the life state includes a visible state and an influence state, the visible state representing a proportion of the particle on a screen, and the influence state representing a contribution of the particle to overall brightness and color of the scene.

[0123] The tracking of the life state of each particle in real time and the marking of each particle include:

[0124] When the visible state or the influence state of the particle is lower than a preset state threshold, the particle is marked as a reusable particle, and a plurality of the reusable particles are allocated to the particle reuse pool.

[0125] The special effect attributes of the reusable particles are analyzed for similarity, and a particle type of the reusable particles is determined.

[0126] According to a number of the particle types, the particle reuse pool is divided into a plurality of sub-reuse pools, one of the sub-reuse pools representing reusable particles of one particle type, and the particle types including fire, smoke and water flow.

[0127] In the embodiment, the visible state and the influence state of each particle are tracked in real time, and a particle life cycle is dynamically adjusted according to a preset state threshold, the visible state being calculated by a proportion of the particle on a screen, the influence state being quantified according to a contribution of the particle to overall brightness and color of the scene, the particle being marked as a reusable state when the visible state or the influence state of the particle is reduced or weakened to the preset state threshold, instead of being directly destroyed, so that calculation and memory consumption are reduced, and game performance is improved.

[0128] In this embodiment, if the pixel proportion of a particle on the screen is lower than the visible threshold, or the color saturation and brightness value thereof is lower than the influence threshold, the particle is marked as reusable. For particles marked as reusable, the consumption of their life cycle is suspended, and they are added to the particle reuse pool. When a new particle needs to be generated, a particle is preferentially taken from the reusable particle pool, and its attributes and life state are reset, thereby reducing the overhead of creating and destroying particles.

[0129] In one embodiment, the visible threshold and the influence threshold are dynamically adjusted according to real-time changes in the scene to balance the number of particles and rendering performance. When the scene complexity increases, the visible threshold and the influence threshold are increased to reduce the number of active particles; when the scene is simple, the visible threshold and the influence threshold are reduced to enhance the particle effect.

[0130] In this embodiment, for the judgment of the visible state, a spatial division algorithm such as octree or BSP tree is used to organize particles according to spatial position and accelerate the visibility judgment of particles. It can be understood that in this embodiment, only particles that may be visible are subjected to visibility calculation to reduce unnecessary calculation amount. For complex particle effects, particle simplification techniques such as merging adjacent particles are used to reduce the number of particles and improve rendering performance under the premise of meeting visual effects. At the same time, the simplification level is dynamically adjusted according to the importance of the particles to ensure the fineness of key particles.

[0131] In this embodiment, by using a feature extraction algorithm, feature data of special effect attributes of each reusable particle in the particle reuse pool is extracted, and the similarity between the special effect attributes of each reusable particle and the particles in each sub-reuse pool is calculated using a weighted Euclidean distance method. For reusable particles with a similarity exceeding a preset similarity threshold, they are classified into the corresponding sub-reuse pool. In the special effect switching process, reusable particles with high similarity in the corresponding sub-reuse pool are queried and called to improve resource utilization efficiency. It can be understood that in order to optimize the selection process, a quicksort algorithm is used to sort the particles in each sub-reuse pool to ensure that the required particles can be quickly found during special effect switching. By this method, not only the reuse rate of particles is improved, but also the response time of special effect switching is optimized, thereby improving the overall visual effect and system performance.

[0132] In this embodiment, different sub-reuse pools correspond to different particle types, including fire, smoke, and water flow. Specifically, each reusable particle is classified by similarity calculation with special effect attributes of different particle types, thereby improving the calling efficiency of reusable particles.

[0133] In some embodiments, the particle reuse strategy is generated based on the particle reuse pool, and the particle reuse strategy is used for dynamic allocation of reusable particles, including:

[0134] The particle attributes of the reusable particles are reset and state-converted by using a particle reuse acceleration mechanism.

[0135] A preset number of reusable particle objects are set for each of the sub-reuse pools.

[0136] The life cycle states of the particles of different particle types in the scene are monitored in real time, and the number of reusable particle objects in each of the sub-reuse pools is dynamically adjusted based on the preset number of particles, the life cycle states including generation, activity, attenuation, and death.

[0137] The reuse effect of the reusable particles is evaluated by using a gradient boosting algorithm, and the number of reusable particle objects in each of the sub-reuse pools is dynamically adjusted based on the evaluation result.

[0138] In this application, the particle attributes of the reusable particles need to be reset and state-converted before the reusable particles are added to the particle reuse pool, thereby improving the reuse efficiency of the particles. Specifically, the reusable particles are stored by using an idle particle linked list, an idle particle linked list is pre-established to store the current unused particle data, when a new particle is needed, the particle data is obtained from the head of the idle particle linked list, and if the idle particle linked list is empty, a new particle memory is allocated.

[0139] In this embodiment, a preset number of reusable particle objects are configured for each sub-reuse pool in advance to balance the memory occupation and performance. Specifically, the particle effect types required by the player in the scene are determined, such as smoke, flame, water flow, etc., the particle number, density, speed, color, etc. required by each effect are analyzed, and the hardware resources of the target platform, such as CPU and memory, etc. are evaluated to determine the maximum number of particles that the system can bear under the premise of ensuring smooth rendering. According to the above effect requirements and performance requirements, the number of particles required by each sub-reuse pool is preliminarily estimated, a preliminary test is performed on the target platform to observe whether the particle effect meets the requirements, and the system performance is monitored to ensure that the system can stably run and maintain good rendering performance under the preset number of particles. According to the test result, the preset number of particles is adjusted. If the number of particles is too large, the performance is reduced, and the number of particles can be appropriately reduced; if the number of particles is too small, the effect is not good, and the number of particles can be appropriately increased. In actual application, the number of particles of the sub-reuse pool is dynamically adjusted according to the actual running load. For example, when the load is high, the number of particles is increased to meet the effect requirement; when the load is low, the number of particles is reduced to save resources. According to the finally determined preset number of particles, the corresponding parameters are set for each sub-reuse pool.

[0140] In the embodiment, real-time generation and death data of particles corresponding to each particle type in the scene are obtained, and for each particle type, the generation quantity and the death quantity in a unit time are counted; the counted generation and death data of each type of particle are compared with a preset quantity threshold value, if the generation quantity of a certain type of particle is continuously higher than the threshold value, it is judged that the demand quantity of the type of particle is large, and the quantity of the type of particle in the particle reuse pool needs to be increased; according to the adjustment demand of each type of particle in the particle reuse pool, the idle particle resources are dynamically allocated, which are converted into the particle type with large demand quantity, and the redundant particles of other types are recycled, so that the total particle quantity of the particle reuse pool is relatively stable.

[0141] In the embodiment, particle data of the current frame of the special effect rendering interface is obtained, including particle position, velocity, color and size information, and according to the obtained particle data, feature vectors such as particle quantity, particle average velocity and particle distribution range are extracted, if the dimension of the extracted feature vector is too high, principal component analysis (PCA) is used to reduce the dimension of the feature vector, to reduce the calculation complexity, and the reduced feature vector is obtained; the reduced feature vector is predicted by using the pre-trained XGBoost model, to obtain the predicted value of the rendering performance under different reuse strategies, the predicted value representing the influence degree of different reuse strategies on the rendering performance; according to the predicted value, it is judged whether the current rendering performance meets the preset performance threshold value; if the preset threshold value is met, the current reuse strategy is kept unchanged; if the predicted rendering performance does not meet the preset threshold value, the reuse strategy is dynamically adjusted according to the output result of the XGBoost model, and then the reuse particle proportion is adjusted, the reuse particle proportion being the proportion of the reusable particles in the total particle quantity in the current frame of the special effect rendering interface; particle rendering is performed by using the adjusted reuse particle proportion, to obtain a rendered image; an image quality evaluation index and a rendering frame rate are obtained; according to the image quality evaluation index and the rendering frame rate, it is judged whether the balance of visual effect and performance is reached; if the balance is not reached, the evaluation is repeated until the best reuse strategy is found, so as to improve the rendering performance of the particle system.

[0142] In some embodiments, in the process of dynamically adjusting the particle strategy, a visual balance evaluation algorithm is adopted to judge whether the current particle distribution meets the preset visual balance degree requirement by analyzing the visual features such as color, brightness and contrast of the scene; real-time rendering performance data including frame rate and delay are obtained, which are compared with the performance data before and after particle multiplexing to evaluate the influence of particle multiplexing mechanism on rendering performance; if particle multiplexing leads to a decrease in rendering performance, a preset performance optimization strategy is triggered to reduce the number of particles and simplify particle effects, etc., to improve the rendering performance to the target level while ensuring the visual effect; based on the above analysis process, a closed-loop particle multiplexing optimization system is constructed to connect the real-time monitoring, dynamic adjustment and performance evaluation links to form an adaptive particle management mechanism to continuously monitor and optimize the process of particle multiplexing, ensuring the visual balance and stability of the rendering performance of the scene.

[0143] Referring to Figure 2 The application also provides an optimization system for a particle system, which comprises:

[0144] The first processing module 201 is configured to load the particle system, and randomly initialize particle attributes of particles in the particle system, wherein the particle attributes include position, speed and color.

[0145] The second processing module 202 is configured to use quantum computing to predict behaviors of the particles in real time based on motion and interaction rules of the particles, and generate dynamic special effects of a corresponding scene.

[0146] The third processing module 203 is configured to dynamically adjust special effect attributes of the particles according to a scene and a state in which a player is located, wherein the special effect attributes include transparency, color and texture of the particles.

[0147] The fourth processing module 204 is configured to track life states of each particle in real time, mark each particle, generate a particle multiplexing pool, and generate a particle multiplexing strategy based on the particle multiplexing pool, wherein the particle multiplexing strategy is used for dynamic allocation of multiplexable particles.

[0148] It can be understood that the contents in the optimization method for a particle system as shown in the embodiments are all applicable to the optimization system for a particle system, the optimization system for a particle system specifically realizes the same functions as the optimization method for a particle system as shown in the embodiments, and achieves the same beneficial effects as the optimization method for a particle system as shown in the embodiments. Figure 1 Figure 1 Figure 1

[0149] ​​​It should be noted that the information interaction between the above systems, the execution process and the like, since based on the same concept as the method embodiments of the present application, the specific functions and the technical effects brought by them can be specifically referred to the method embodiments part, and will not be repeated here.

[0150] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the system is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific name of each functional unit and module is only for convenient distinction, and does not limit the protection scope of the present application. The specific working process of the unit and module in the system can refer to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0151] Please refer to Figure 3 The embodiment of the present application also provides a computer device 3, comprising a memory 302 and a processor 301 and a computer program 303 stored in the memory 302, when the computer program 303 is executed on the processor 301, the optimization method for particle system is realized as any one of the above methods.

[0152] The computer device 3 can be a desktop computer, a notebook computer, a palm computer and a cloud server and the like. The computer device 3 can include, but is not limited to, a processor 301, a memory 302. Those skilled in the art can understand that, Figure 3 It is only an example of the computer device 3, and does not constitute a limitation on the computer device 3, and can include more or fewer components than the illustrated, or combine certain components, or different components, for example, it can also include input and output devices, network access devices and the like.

[0153] The processor 301 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0154] The memory 302 can be an internal storage unit of the computer device 3 in some embodiments, for example, a hard disk or a memory of the computer device 3. The memory 302 can also be an external storage device of the computer device 3 in other embodiments, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 302 can include both the internal storage unit and the external storage device of the computer device 3. The memory 302 is used to store an operating system, an application program, a boot loader, data, and other programs, for example, program codes of the computer program, etc. The memory 302 can also be used to temporarily store data that has been output or is to be output.

[0155] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. When the computer program is run by a processor, the optimization method for a particle system is implemented, as described in any of the above methods.

[0156] In this embodiment, the integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the photographing device / computer equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium can not be an electrical carrier signal and a telecommunication signal.

[0157] The above-described embodiments are merely intended to illustrate the technical solutions of the present application, but not to limit them; even though the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method for optimization of a particle system, characterized by, The method comprises the following steps: loading a particle system, randomly initializing particle attributes of particles in the particle system, the particle attributes including position, velocity and color; based on the motion and interaction rules of particles, using quantum computing to predict the behavior of particles in real time, and generating dynamic special effects corresponding to the scene; according to the scene and state of the player, dynamically adjusting the special effect attributes of the particles, the special effect attributes including the transparency, color and texture of the particles; tracking the life state of each particle in real time, marking each particle, generating a particle reuse pool, and generating a particle reuse strategy based on the particle reuse pool, the particle reuse strategy being used for dynamic allocation of reusable particles; wherein, based on the motion and interaction rules of particles, using quantum computing to predict the behavior of particles in real time, and generating dynamic special effects corresponding to the scene, comprises: obtaining the initial particle attribute values of each particle, mapping the initial particle attribute values to quantum bits, and constructing the quantum state space of the particles; establishing a quantum Hamiltonian model of particle motion according to the influence of wind and terrain on particle motion, and obtaining the quantum state evolution law of particle motion by solving the Schrödinger equation; introducing a temperature variable into the quantum state space, simulating the influence of temperature change on the surrounding environment through quantum state superposition; based on the special effect requirements of different scenes, dynamically adjusting the particle attribute values of each particle through quantum gate parameters and measurement bases; randomly sampling in the quantum state space to obtain the classical state information of the particles, inputting the classical state information into a classical rendering pipeline to generate dynamic special effects.

2. The method of claim 1, wherein, The method of loading a particle system and randomly initializing particle attributes in the particle system comprises: loading system resources required by the particle system in an asynchronous loading mode, the system resources including the number of particles, memory capacity, disk space and network bandwidth; according to the number of particles, randomly generating position coordinates, velocity components, rotation components and color components for each particle in a three-dimensional space; assigning the position coordinates, velocity components, rotation components and color components as initial particle attribute values to the corresponding particle attribute variables of each particle object.

3. The method of claim 2, wherein, The quantum Hamiltonian model includes kinetic energy terms, potential energy terms and external field terms, and the external field terms are used to reflect the influence of wind and terrain on particle motion.

4. The method of claim 3, wherein, Based on the motion and interaction rules of particles, using quantum computing to predict the behavior of particles in real time, and generating dynamic special effects corresponding to the scene, further comprises: using quantum entangled states to establish an association model between different particles, constructing a particle group evolution equation based on the association model, and obtaining the quantum state evolution law of collision and interaction between different particles by solving the particle group evolution equation; The specific formula of the particle group evolution equation is as follows: ; where i denotes the imaginary unit, where h is the reduced Planck constant, H denotes the total Hamiltonian, H = H0+ Hint, H0is the Hamiltonian of free particles, and Hintis the Hamiltonian of interacting particles, denotes the quantum entangled state between the interacting particles.

5. The method of claim 3, wherein, After generating dynamic special effects corresponding to the scene based on the motion and interaction rules of particles, using quantum computing to predict the behavior of particles in real time, comprises: obtaining the particle parameters of each particle in the dynamic special effects in real time, the particle parameters including particle attributes and scene parameters, the scene parameters including wind, terrain, light and temperature; encoding the particle parameters to obtain particle encoding data; Input the particle coding data into a quantum neural network, and optimize the particle coding data through the quantum neural network.

6. The method of claim 1, wherein, The scene includes a desert, a volcano, and a forest, and the state is the life cycle of the player; The particle effect attribute is dynamically adjusted according to the scene and the state of the player, and the particle effect attribute includes the transparency, color, and texture of the particle. By analyzing the scene parameters of the scene in real time, the particle parameter combination of each particle in the scene is determined, and the particle parameter combination includes the attribute values of all the particle effect attributes of the particle. Based on the particle parameter combination, the plurality of particles are divided into multiple rendering layers for rendering; A machine learning algorithm is used to iteratively update the particle parameter combination; An image analysis-based particle effect enhancement technique is used to dynamically adjust the motion trajectory and visual effect of the particle according to the change of the scene in which the player is located.

7. The method of claim 1, wherein, The life state includes a visible state and an influence state, and the visible state represents the proportion of the particle on the screen, and the influence state represents the contribution of the particle to the overall brightness and color of the scene; The life state of each particle is tracked in real time, and each particle is labeled to generate a particle reuse pool, including: When the visible state or the influence state of the particle is lower than a preset state threshold, the particle is labeled as a reusable particle, and a plurality of the reusable particles are distributed into the particle reuse pool; The particle effect attribute of the reusable particle is analyzed for similarity to determine the particle type of the reusable particle; According to the number of particle types, the particle reuse pool is divided into a plurality of sub-reuse pools, and one sub-reuse pool represents the reusable particles of one particle type, and the particle type includes flame, smoke, and water flow.

8. The method of claim 7, wherein, Based on the particle reuse pool, a particle reuse strategy is generated, and the particle reuse strategy is used for dynamic distribution of the reusable particles, including: A particle reuse acceleration mechanism is used to reset and convert the particle attributes of the reusable particles; A preset number of reusable particle objects are set for each sub-reuse pool; The life cycle state of the particles of different particle types in the scene is monitored in real time, and the number of reusable particle objects in each sub-reuse pool is dynamically adjusted based on the preset number of particles, and the life cycle state includes generation, activity, decay, and extinction. A gradient boosting algorithm is used to evaluate the reuse effect of the reusable particles, and the proportion of the reusable particles is dynamically adjusted based on the evaluation result.

9. An optimization system for a particle system, characterized by, Including: A first processing module for loading a particle system and randomly initializing particle attributes of particles in the particle system, the particle attributes including position, velocity, and color; A second processing module for predicting the behavior of the particle in real time based on the motion and interaction rules of the particle using quantum computing to generate dynamic effects for the corresponding scene; A third processing module for dynamically adjusting the particle effect attribute according to the scene and the state of the player, the particle effect attribute including the transparency, color, and texture of the particle. The fourth processing module is configured to track a life state of each particle in real time, mark each particle, generate a particle multiplexing pool, and generate a particle multiplexing strategy based on the particle multiplexing pool, where the particle multiplexing strategy is used for dynamic allocation of multiplexable particles. The particle motion and interaction rules are used to generate a dynamic special effect of a corresponding scene by means of quantum computing and real-time prediction of particle behavior, including: An initial particle attribute value of each particle is obtained, the initial particle attribute value is mapped to a quantum bit, and a quantum state space of the particle is constructed; A quantum Hamiltonian model of particle motion is established according to the influence of wind and terrain on particle motion, and a quantum state evolution rule of particle motion is obtained by solving a Schrödinger equation; A temperature variable is introduced into the quantum state space, and the influence of temperature change on the surrounding environment is simulated through quantum state superposition; Particle attribute values of each particle are dynamically adjusted through quantum gate parameters and measurement bases based on special effect requirements of different scenes; Random sampling is performed in the quantum state space to obtain classical state information of the particle, and the classical state information is input into a classical rendering pipeline to generate a dynamic special effect.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method of any one of claims 1 to 8.

Citation Information

Patent Citations

  • Mobile terminal simulation particle system method

    CN106056660A

  • Method and device for constructing three-dimensional scene animation in GIS system based on particle system

    CN111292399A