Visualization method, device and server for digital twin watershed animation
By extracting keyframes in digital twin river basin animation and interpolated rendering, the problems of high network load and low image quality are solved, high-definition and high frame rate animation display are achieved, and accurate decision-making support is provided.
Patent Information
- Application Number
- CN202510661601.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-05-22
AI Technical Summary
The existing digital twin watershed and flood systems have problems with high network load and low image quality during animation rendering. Especially when showing the rapid spread of floods and changes in water flow velocity, the animation is stuck, making it difficult to accurately reflect the dynamic characteristics of flood disasters.
By obtaining the results of hydrodynamic simulation, preprocessing is performed to determine the target keyframe, and interpolation is performed using inverse distance weight linear interpolation method or spline interpolation algorithm for interpolation processing, combined with the physical quantity rendering color information table for chip rendering, generating high-definition, high-frame rate digital twin river basin animation.
It significantly reduces the network load of digital twin river basin animation during visualization, improves image quality, makes the animation transition natural, and can present water flow changes and flood evolution with high definition and high frame rate, providing an accurate basis for decision-making.
Smart Images

Figure CN120182450B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual simulation, and in particular to a visualization method, device and server for digital twin watershed animation. Background Art
[0002] The digital twin watershed and flood system uses advanced digital technology to construct a virtual mapping system of the physical watershed and flood-related scenes. Since the digital twin watershed and flood system is associated with a wide geographical range, it is necessary to integrate multiple types of data for comprehensive presentation. Therefore, its animation rendering and data processing engines have high requirements. At present, relevant technologies have proposed that important features of the watershed can be manually extracted to reduce the network load during visualization, but this solution will cause the acquired images to be visually incoherent and the image quality to be low. If the key frame extraction parameters are set and the key frames are extracted at fixed intervals, when the interval setting is small, it will result in a large amount of data. When the interval setting is large, the number of frames in the key feature part of the watershed animation will be low, thereby affecting the image quality of the animation. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a visualization method, device and server for digital twin watershed animation, which can significantly reduce the network load during visualization of digital twin watershed animation and significantly improve image quality.
[0004] In a first aspect, an embodiment of the present invention provides a method for visualizing a digital twin watershed animation, the method comprising: obtaining hydrodynamic simulation result data, and determining target key frames by preprocessing the hydrodynamic simulation result data to perform dimensionality reduction processing on the hydrodynamic simulation result data, wherein the hydrodynamic simulation result data comprises: maximum value data, simulation model data, and simulation physical quantity data at each moment, the maximum value data comprises: the maximum value and minimum value of each physical quantity within a simulation time period, the simulation model data comprises: position data and vertex physical quantity data contained in the attributes of each triangle vertex in a simulation triangle network, and the simulation physical quantity data at each moment comprises: physical quantity data and time data contained in each frame of simulation data; According to the proportion of target key frames in the total number of frames, the target interpolation algorithm is determined from the preset inverse distance weighted linear interpolation method and the preset spline interpolation algorithm, and based on the target key frames and the target interpolation algorithm, the frames at each moment in the digital twin watershed animation are interpolated to determine the physical quantity interpolation results; the physical quantity interpolation results are normalized to determine the physical quantity normalization factors corresponding to the frames to be rendered for generating the watershed animation, and the physical quantity normalization factors are mapped to the preset physical quantity rendering color information table to use the corresponding color values in the preset physical quantity rendering color information table for fragment rendering processing, to determine the target rendering images corresponding to the frames to be rendered, and the target digital twin watershed animation composed of the target rendering images.
[0005] In one embodiment, the step of determining the target key frame by preprocessing the hydrodynamic simulation result data includes: performing statistical calculations on the data of each time step in the hydrodynamic simulation result data to determine the change in physical quantity and the average change in the physical quantity in each time step data, and based on the average change in the physical quantity, determining the root mean square change and the first-order derivative of the root mean square change of the physical quantity; and determining the target key frame by performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change.
[0006] In one embodiment, the step of determining the target key frame by performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change includes: performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change based on a preset weighted weight value to determine the degree of change of the physical quantity; eliminating the time steps with a degree of change lower than the average change, and determining the simulation start time step, the simulation end time step and the time step with a degree of change higher than a preset degree of change threshold as the target key frame.
[0007] In one embodiment, before the step of determining the target interpolation algorithm from the preset inverse distance weighted linear interpolation method and the preset spline interpolation algorithm based on the proportion of the target key frames to the total number of frames, it includes: obtaining an animation frame list, and through a preset moment calculation model, determining the moment corresponding to the current frame based on the simulation start time step, the simulation end time step, and the index and total number of frames in the animation frame list.
[0008] In one embodiment, the step of determining a target interpolation algorithm from a preset inverse distance weighted linear interpolation method and a preset spline interpolation algorithm based on the proportion of target key frames to the total number of frames includes: when the proportion of target key frames to the total number of frames is greater than a preset proportion threshold, determining the preset inverse distance weighted linear interpolation method as the target interpolation algorithm; when the proportion of target key frames to the total number of frames is not greater than the preset proportion threshold, determining the preset spline interpolation algorithm as the target interpolation algorithm.
[0009] In one embodiment, based on the target key frame and the target interpolation algorithm, the frames at each moment in the digital twin watershed animation are interpolated to determine the interpolation result of the physical quantity, including: when the target interpolation algorithm is the preset inverse distance weighted linear interpolation method, each frame in the target key frame is used as the current frame, so as to determine the corresponding moment of the two adjacent reference frames according to the moment corresponding to the current frame, and use the time relationship between the current frame and the two adjacent reference frames to determine the weights corresponding to the two reference frames; use the physical quantity corresponding to the two reference frames and the sum of the products of the weights to interpolate the current frame and determine the physical quantity interpolation result of the current frame.
[0010] In one embodiment, based on the target key frame and the target interpolation algorithm, the frames at each moment in the digital twin watershed animation are interpolated to determine the physical quantity interpolation result, which also includes: when the target interpolation algorithm is a preset spline interpolation algorithm, based on the preset curve distortion degree, generating an interpolation curve segment between adjacent frames; taking each frame in the target key frame as the current frame, normalizing the current frame time according to the moment corresponding to the current frame, determining the time normalization result, and substituting the time normalization result into the interpolation curve segment to determine the physical quantity interpolation result of the current frame.
[0011] In the second aspect, an embodiment of the present invention further provides a visualization device for digital twin watershed animation, the device comprising: a key frame extraction module for obtaining hydrodynamic simulation result data, and determining target key frames by pre-processing the hydrodynamic simulation result data to perform dimensionality reduction processing on the hydrodynamic simulation result data, wherein the hydrodynamic simulation result data comprises: maximum value data, simulation model data and simulation physical quantity data at each moment, the maximum value data comprises: the maximum value and minimum value of each physical quantity within the simulation time period, the simulation model data comprises: the position data and vertex physical quantity data contained in the attributes of each triangle vertex in the simulation triangle network, the simulation physical quantity data at each moment comprises: the physical quantity data and time data contained in each frame of simulation data; the key frame insertion module comprises: the physical quantity data and time data contained in each frame of simulation data; the key frame insertion module comprises: the maximum value data, simulation model data and simulation physical quantity data at each moment, the maximum value data comprises: the maximum value and minimum value of each physical quantity within the simulation time period, the simulation model data comprises: the position data and vertex physical quantity data contained in the attributes of each triangle vertex in the simulation triangle network, the simulation physical quantity data at each moment comprises: the physical quantity data and time data contained in each frame of simulation data; the key frame insertion module comprises: the maximum value data, simulation model data and simulation physical quantity data at each moment The frame module determines the target interpolation algorithm from the preset inverse distance weighted linear interpolation method and the preset spline interpolation algorithm according to the proportion of the target key frames in the total number of frames, and interpolates the frames at each moment in the digital twin watershed animation based on the target key frames and the target interpolation algorithm to determine the physical quantity interpolation results; the physical quantity rendering module performs normalization processing on the physical quantity interpolation results, determines the physical quantity normalization factors corresponding to the various frames to be rendered for generating the watershed animation, and maps the physical quantity normalization factors to the preset physical quantity rendering color information table, so as to use the corresponding color values in the preset physical quantity rendering color information table to perform fragment rendering processing, determine the target rendering images corresponding to the various frames to be rendered, and the target digital twin watershed animation composed of the various target rendering images.
[0012] In a third aspect, an embodiment of the present invention further provides a server, comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement any one of the methods provided in the first aspect.
[0013] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement any one of the methods provided in the first aspect.
[0014] The embodiments of the present invention bring the following beneficial effects:
[0015] An embodiment of the present invention provides a visualization method, device and server for digital twin watershed animation. After obtaining the hydrodynamic simulation result data, the method pre-processes the hydrodynamic simulation result data to determine the target key frame to perform dimensionality reduction processing on the hydrodynamic simulation result data. Then, according to the proportion of the target key frame to the total number of frames, the target interpolation algorithm is determined from the preset inverse distance weighted linear interpolation method and the preset spline interpolation algorithm. Based on the target key frame and the target interpolation algorithm, the frames at each moment in the digital twin watershed animation are interpolated to determine the physical quantity interpolation result. Finally, the physical quantity interpolation result is normalized to determine the physical quantity normalization factor corresponding to each frame to be rendered for generating the watershed animation, and the physical quantity normalization factor is converted into the physical quantity normalization factor. The quantity normalization factor is mapped to the preset physical quantity rendering color information table, so as to use the corresponding color value in the preset physical quantity rendering color information table to perform fragment rendering processing, determine the target rendering image corresponding to each frame to be rendered, and the target digital twin watershed animation composed of each target rendering image. The embodiment of the present invention can accurately extract key frames through preprocessing, and only needs to load the key frame data for rendering without loading all the simulation result data, thereby significantly reducing the network load of the digital twin watershed animation during visualization and ensuring the smoothness of the system. In addition, through intelligent algorithm interpolation, the animation transition can be made natural, whether it is water flow changes or flood evolution, it can be presented in high definition and high frame rate, providing accurate and intuitive basis for decision-making.
[0016] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purposes and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A schematic diagram of a flow chart of a method for visualizing a digital twin watershed animation provided by an embodiment of the present invention;
[0020] Figure 2A schematic diagram of a specific process of a method for visualizing a digital twin watershed animation provided by an embodiment of the present invention;
[0021] Figure 3 A schematic diagram of defining an interpolation curve segment between consecutive control points provided by an embodiment of the present invention;
[0022] Figure 4 A schematic diagram of the structure of a digital twin watershed animation visualization device provided by an embodiment of the present invention;
[0023] Figure 5 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0025] At present, the digital twin river basin and flood system is a virtual mapping system of the physical river basin and flood-related scenes constructed with the help of advanced digital technology. It can simulate and analyze various conditions within the river basin, such as water flow movement, water level fluctuation, flood formation and spread, thereby providing strong support for the rational allocation of water resources in the river basin, accurate early warning and effective prevention and control of flood disasters. Since the digital twin river basin and flood system are related to a wide geographical range, involving massive amounts of hydrological, geographical, meteorological and other data as well as complex hydrodynamic and disaster evolution models, it is often necessary to integrate multiple types of data for comprehensive presentation, so its animation rendering and data processing engine requirements are extremely high.
[0026] Relevant technologies have proposed that the existing digital twin watershed and flood systems have many deficiencies when dealing with animation displays such as the water depth and flow velocity visualization of the watershed, the evolution path of floods in complex terrain, and the regulation process of water conservancy facilities during floods. For example, when presenting a scene of rapid flood spread, the animation may be stuck and unable to smoothly show the continuous process of floods gradually inundating the downstream area. The expression of water flow velocity changes and water level fluctuations in different sections of the watershed is not delicate enough, making it difficult to accurately reflect the actual dynamic characteristics of flood disasters. It is also difficult to show the impact of floods on the watershed ecology. The dynamic changes of the response also lack sufficient vividness and accuracy. Based on this, the visualization method, device and server of the digital twin watershed animation provided by the present invention can accurately extract key frames through preprocessing, and only need to load key frame data for rendering without loading all simulation result data, thereby significantly reducing the network load of the digital twin watershed animation during visualization and ensuring the smoothness of the system. In addition, through intelligent algorithm interpolation, the animation transition can be made natural, whether it is water flow changes or flood evolution, it can be presented with high definition and high frame rate, providing accurate and intuitive basis for decision-making.
[0027] See also Figure 1 The flowchart of a method for visualizing a digital twin watershed animation is shown, and the method mainly includes the following steps S102 to S106:
[0028] Step S102, obtain hydrodynamic simulation result data, and determine the target key frame by pre-processing the hydrodynamic simulation result data to perform dimensionality reduction processing on the hydrodynamic simulation result data, wherein the hydrodynamic simulation result data includes: maximum value data, simulation model data and simulation physical quantity data at each moment, the maximum value data includes: the maximum and minimum values of each physical quantity within the simulation time period, the simulation model data includes: the position data and vertex physical quantity data contained in the attributes of each triangle vertex in the simulation triangle network, the simulation physical quantity data at each moment includes: the physical quantity data and time data contained in each frame of simulation data, in one embodiment, after obtaining the hydrodynamic simulation result data, it is necessary to perform statistical calculations on the data of each time step to obtain the key frame rendering data required for rendering, the simulation result data is two-dimensional hydrodynamics, composed of several irregular triangular grids, each grid point contains the geographic projection coordinate system coordinates X, Y, and result physical quantities, and the result physical quantities include water level, water flow velocity, water flow, water flow direction, and pollutant concentration.
[0029] In practical applications, hydrodynamic simulations typically include simulation result data for the next few days, resulting in a very large amount of data, typically tens to hundreds of GB. This places a heavy burden on the rendering engine, both from a loading and rendering perspective. Therefore, the data needs to be simplified before being transferred to the rendering engine. In combination with the characteristics of two-dimensional hydrodynamic simulations, the maximum change, root mean square change, and average change of the simulation result data are calculated to extract the key time steps of the result data, thereby reducing the data volume and improving rendering efficiency.
[0030] Step S104, according to the proportion of the target key frame in the total number of frames, determine the target interpolation algorithm from the preset inverse distance weighted linear interpolation method and the preset spline interpolation algorithm, and based on the target key frame and the target interpolation algorithm, interpolate the frames at each moment in the digital twin watershed animation to determine the physical quantity interpolation result. In one embodiment, after obtaining the simulation result data of a certain watershed, it is necessary to correctly map the physical quantity of the simulation result to the attributes of each vertex of the simulation model, normalize the physical quantity data, and obtain the corresponding color value of each vertex according to the color band for rendering. The watershed simulation data obtained by the present invention through the above-mentioned key frame extraction and interpolation technology are key frames that have been extracted. Therefore, it is necessary to interpolate the frames at each moment in the animation, obtain a complete frame list, and finally display the animation.
[0031] Step S106, normalize the physical quantity interpolation results, determine the physical quantity normalization factors corresponding to the frames to be rendered for generating the watershed animation, and map the physical quantity normalization factors to the preset physical quantity rendering color information table, so as to use the corresponding color values in the preset physical quantity rendering color information table to perform fragment rendering processing, determine the target rendering images corresponding to the frames to be rendered, and the target digital twin watershed animation composed of the target rendering images. In one embodiment, for each frame of the watershed animation, it is necessary to repeatedly obtain the time of the current frame, obtain the physical quantity by interpolation, normalize the physical quantity, and look up the color value of the corresponding color band for rendering to generate the target rendering image, and finally form a complete animation.
[0032] Referring to the above-mentioned digital twin watershed animation visualization method provided in the embodiment of the present invention, the network load of the digital twin watershed animation during visualization can be significantly reduced, and the image quality can be significantly improved.
[0033] See also Figure 2 The figure shows a specific flow chart of a method for visualizing a digital twin watershed animation. The embodiment of the present invention also provides an implementation method for key frame extraction, key frame insertion, and physical quantity rendering. For details, see (A) to (C) below:
[0034] (A) Extract key frames from the multi-time simulation result data according to the degree of change of its physical quantity, and transmit the extracted key frame data and latitude and longitude calibration data to the animation rendering system. The implementation method of key frame extraction is specifically as follows (1) to (2):
[0035] (1) By performing statistical calculations on the data of each time step in the hydrodynamic simulation results, the changes in the physical quantities and the average changes in the physical quantities in each time step are determined. Based on the average changes in the physical quantities, the root mean square changes and the first-order derivatives of the root mean square changes of the physical quantities are determined. The extraction of key frames needs to consider the degree of drastic changes of each grid point. For details, see (a) to (d) below:
[0036] (a) The change in physical quantity is used to represent the change in simulation results at each time step, which can reflect the change in that time step:
[0037]
[0038] Where i represents the index of the grid point, N represents the total number of grid points, t represents the time step, and x represents the physical quantity. Indicates the average change value of the current time step.
[0039] (b) Average change is used to represent the average value of the change in simulation results for all time steps, which can quickly distinguish time steps with large changes:
[0040]
[0041] Among them, t represents the time step, T represents the total time step, Indicates the average change value of the current time step.
[0042] (c) The root mean square change reflects the overall change in the simulation results. For example, for the physical quantity of water depth, the root mean square change can reflect the degree of water depth change during the entire simulation process:
[0043]
[0044] Where i represents the index of the grid point, N represents the total number of grid points, t represents the time step, and x represents the physical quantity. Represents the RMS change at time step t.
[0045] (d) The first-order derivative of the root mean square change is used to reflect the speed of change of the physical quantity and can identify the time step with drastic change:
[0046]
[0047] Where i represents the index of the grid point, N represents the total number of grid points, and t represents the time step. The time unit for each time step of simulation calculation is seconds, and x represents the physical quantity. Represents the first derivative of the RMS change at time step t.
[0048] (2) Determine the target key frame by performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change. Specifically, the root mean square change and the first-order derivative of the root mean square change can be weighted based on a preset weighted value to determine the degree of change of the physical quantity. Then, the time step with a degree of change lower than the average change is eliminated, and the simulation start time step, the simulation end time step, and the time step with a degree of change higher than a preset degree of change threshold are determined as the target key frame. The degree of change threshold can be dynamically adjusted according to the ratio of the number of selected key frames and the actual degree of change. In one embodiment, the root mean square change and the first-order derivative of the root mean square change of the physical quantity can be weighted to obtain the degree of change:
[0049]
[0050] in, Indicates the degree of change in time step t. A larger value indicates a greater degree of change. Indicates the time step The index is sorted from small to large, Shows the time step The index is sorted from smallest to largest. and The preset weight values are 0.6 and 0.4 respectively after a lot of actual tests and comparisons.
[0051] Finally, the time steps with lower than average change are eliminated, and the first 10% of the time steps and the first and last time steps are taken as key frames.
[0052] (B) Display the basin map tiles through Mapbox. According to the latitude and longitude calibration file (used for the latitude and longitude coordinates of each vertex in the simulation result model grid), obtain the elevation of each vertex through the API provided by Mapbox. After obtaining the latitude and longitude data and coordinate data of each vertex, calibrate the coordinates of the simulation result model to ensure that the hydrodynamic cloud map can be bound to the correct geographical location and fit the terrain, so that the simulation model can be displayed in combination with the GIS map. Then, dynamically obtain the interpolated physical quantity of each grid vertex according to the animation playback time. The specific implementation method of key frame interpolation is as follows (3) to (5):
[0053] (3) Obtain the animation frame list and determine the time corresponding to the current frame based on the simulation start time step, simulation end time step, and the index and total number of frames in the animation frame list through the preset moment calculation model. In one embodiment, it is necessary to obtain the time corresponding to the current frame, and then interpolate based on the reference frames before and after the moment to obtain physical quantity data. The time corresponding to the i-th frame of the animation is:
[0054]
[0055] in, and They represent the start time and end time of the simulation process respectively, i represents the index in the animation frame list, and N represents the total number of frames in the animation frame list.
[0056] (4) When the proportion of the target key frame to the total number of frames is greater than the preset proportion threshold, the preset inverse distance weighted linear interpolation method is determined as the target interpolation algorithm. Specifically, when the target interpolation algorithm is the preset inverse distance weighted linear interpolation method, each frame in the target key frame is used as the current frame, so as to determine the corresponding moments of the two adjacent reference frames according to the moment corresponding to the current frame, and use the time relationship between the current frame and the two adjacent reference frames to determine the weights corresponding to the two reference frames. Then, the current frame is interpolated using the sum of the products of the physical quantities corresponding to the two reference frames and the weights to determine the physical quantity interpolation result of the current frame.
[0057] In one embodiment, a weight w can be assigned to each of the two frames, and the physical quantities corresponding to the two moments are multiplied by their respective weights and then added to obtain the physical quantity at the corresponding position of the intermediate frame. The two weights are values in the interval [0, 1], and the sum of the two equals 1. The weight can be calculated using the temporal distance relationship between the intermediate frame and its left and right adjacent reference frames. That is, the longer the temporal distance, the greater the weight ratio. The weight calculation model is:
[0058]
[0059] Wherein, W is the weight, t1 and t2 represent the corresponding simulation time of the two previous and next reference frames respectively, and d1 and d2 represent the simulation physical quantity data of the two previous and next reference frames respectively.
[0060] The interpolation result data is:
[0061] .
[0062] (5) When the proportion of the target key frame to the total number of frames is not greater than the preset proportion threshold, the preset spline interpolation algorithm is determined as the target interpolation algorithm. Specifically, when the target interpolation algorithm is the preset spline interpolation algorithm, based on the preset curve distortion degree, an interpolation curve segment is generated between adjacent frames, and then each frame in the target key frame is used as the current frame, and the current frame time is normalized according to the moment corresponding to the current frame to determine the time normalization result, and the time normalization result is substituted into the interpolation curve segment to determine the physical quantity interpolation result of the current frame. Among them, the preset spline interpolation algorithm used is specifically the Catmull-Rom interpolation algorithm, which is a type of spline interpolation. It can generate a smooth curve based on given control points, so that the curve passes through these control points in sequence. For each interpolation curve segment, it is only related to four adjacent control points, and the generated curve has first-order continuity at the control points.
[0063] In one embodiment, the Katram-Rohm interpolation algorithm is used to interpolate the four consecutive control points. 、 、 、 The interpolation curve segment defined between the two is given by the following interpolation formula:
[0064]
[0065] Among them, see Figure 3 The diagram shown is a schematic diagram of defining an interpolation curve segment between consecutive control points. At t = 0, P(0) = ; When t = 1, P(1) = ;in, Indicates the degree of distortion of the curve, which can be appropriately set according to the situation. = 0.5 as an example.
[0066] Furthermore, for each vertex in the grid, the physical quantity and simulation time of the corresponding position are obtained in the four adjacent key frames: (v0, t0), (v1, t1), (v2, t2), (v3, t3), where v0, v1, v2, v3 represent the recorded physical quantities, and t0, t1, t2, t3 represent the time of the four key frames. .
[0067] Map the interpolation time of the target frame to the (0,1) interval and calculate the normalization parameter. The formula is as follows:
[0068]
[0069] in, Indicates the moment corresponding to the current frame of the animation. Indicates the normalized result of the current frame time.
[0070] Will Substitute the value of into the P(t) formula to obtain the physical quantity interpolation result:
[0071]
[0072] (C) Based on the obtained interpolated physical quantity and the set color band, the color value of each vertex is obtained for rendering, and the above process is repeated until all frames of the animation are played. The specific implementation method of physical quantity rendering is as follows: According to the maximum and minimum values of the corresponding physical quantity in the extreme value data, the interpolated physical quantity is normalized:
[0073]
[0074] Among them, factor represents the normalization factor of the physical quantity, max represents the maximum value of the corresponding physical quantity in the extreme value data, and min represents the minimum value of the corresponding physical quantity in the extreme value data. Indicates the interpolation result of the current frame.
[0075] In one embodiment, the physical quantity rendering color information table contains 4 columns and n rows of data. The 4 columns of data are four color channels: red, green, blue, and opacity. The indexes of the n rows of data correspond to the colors of the physical quantities from small to large. In practical applications, if the color to be displayed is a gradient of red, orange, and yellow, the data of each row are as follows: the first row represents red, and the data of each column is 255, 0, 0, 255; the middle row represents orange, and the data of each column is 255, 127, 0, 255; the last row represents yellow, and the data of each column is 255, 255, 0, 255. Finally, the normalized physical quantity factor is used. Find the corresponding color value in the color band, perform fragment rendering, and determine the target rendered image and target digital twin watershed animation.
[0076] To sum up, the present invention can accurately screen out the most critical frames that best reflect animation changes from a large number of animation frame data through the key frame extraction function and load them first, thereby greatly reducing the pressure on network resource transmission and effectively improving the smoothness of system operation. Moreover, based on these extracted key frames, interpolation operations are performed with the help of intelligent algorithms, and frame data at other times are generated through interpolation calculations, so as to ensure smooth animation playback while taking into account the accuracy and integrity of the overall animation effect. Through key frame extraction and interpolation technology, the hydrological dynamics and flood development process in the basin are clearly and vividly presented to users with high-definition, high-frame-rate excellent animation effects, providing a more intuitive, accurate and trustworthy decision-making basis for comprehensive basin management and flood disaster prevention and control work. This has irreplaceable key value and far-reaching significance for improving the application effectiveness of digital twin basins and flood systems in water resources management, disaster prevention and other aspects.
[0077] Regarding the visualization method of the digital twin watershed animation provided in the above embodiment, the embodiment of the present invention provides a visualization device of the digital twin watershed animation, see Figure 4 The structure diagram of a digital twin watershed animation visualization device shown in FIG. 1 includes the following parts:
[0078] The key frame extraction module 402 obtains hydrodynamic simulation result data and determines target key frames by pre-processing the hydrodynamic simulation result data to perform dimensionality reduction processing on the hydrodynamic simulation result data. The hydrodynamic simulation result data includes: maximum value data, simulation model data, and simulation physical quantity data at each moment. The maximum value data includes: the maximum and minimum values of each physical quantity within the simulation time period. The simulation model data includes: the position data and vertex physical quantity data contained in the attributes of each triangle vertex in the simulation triangle network. The simulation physical quantity data at each moment includes: the physical quantity data and time data contained in each frame of simulation data.
[0079] The key frame interpolation module 404 determines a target interpolation algorithm from a preset inverse distance weighted linear interpolation method and a preset spline interpolation algorithm based on the proportion of the target key frames in the total number of frames, and interpolates the frames at each moment in the digital twin watershed animation based on the target key frames and the target interpolation algorithm to determine the physical quantity interpolation result;
[0080] The physical quantity rendering module 406 performs normalization processing on the physical quantity interpolation results, determines the physical quantity normalization factors corresponding to the frames to be rendered for generating the watershed animation, and maps the physical quantity normalization factors to the preset physical quantity rendering color information table, so as to use the corresponding color values in the preset physical quantity rendering color information table to perform fragment rendering processing, determine the target rendering images corresponding to the frames to be rendered, and the target digital twin watershed animation composed of the target rendering images.
[0081] The above-mentioned digital twin watershed animation visualization device provided in the embodiment of the present application can significantly reduce the network load during the visualization of the digital twin watershed animation and significantly improve the image quality.
[0082] In one embodiment, when performing the step of determining the target key frame by preprocessing the hydrodynamic simulation result data, the above-mentioned key frame extraction module 402 is also used to: determine the physical quantity change and the average change of the physical quantity in each time step data by performing statistical calculations on the hydrodynamic simulation result data, and determine the root mean square change and the first-order derivative of the root mean square change of the physical quantity based on the average change of the physical quantity; determine the target key frame by performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change.
[0083] In one embodiment, when performing the step of determining the target key frame by performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change, the key frame extraction module 402 is further used to: perform weighted calculation on the root mean square change and the first-order derivative of the root mean square change based on a preset weighted weight value to determine the degree of change of the physical quantity; eliminate the time steps with a degree of change lower than the average change, and determine the simulation start time step, the simulation end time step and the time step with a degree of change higher than a preset degree of change threshold as the target key frame.
[0084] In one embodiment, before performing the step of determining a target interpolation algorithm from a preset inverse distance weighted linear interpolation method and a preset spline interpolation algorithm based on the proportion of the target key frames to the total number of frames, the key frame interpolation module 404 is further used to: obtain an animation frame list, and determine the moment corresponding to the current frame based on a preset moment calculation model, a simulation start time step, a simulation end time step, and an index and a total number of frames in the animation frame list.
[0085] In one embodiment, when determining the target interpolation algorithm from a preset inverse distance weighted linear interpolation method and a preset spline interpolation algorithm based on the proportion of the target key frames in the total number of frames, the key frame interpolation module 404 is further used to: when the proportion of the target key frames in the total number of frames is greater than a preset proportion threshold, determine the preset inverse distance weighted linear interpolation method as the target interpolation algorithm; when the proportion of the target key frames in the total number of frames is not greater than the preset proportion threshold, determine the preset spline interpolation algorithm as the target interpolation algorithm.
[0086] In one embodiment, when performing interpolation processing on frames at each moment in the digital twin watershed animation based on the target key frame and the target interpolation algorithm to determine the physical quantity interpolation result, the above-mentioned key frame interpolation module 404 is also used to: when the target interpolation algorithm is the preset inverse distance weighted linear interpolation method, each frame in the target key frame is used as the current frame, so as to determine the corresponding moment of the two adjacent reference frames according to the moment corresponding to the current frame, and use the time relationship between the current frame and the two adjacent reference frames to determine the weights corresponding to the two reference frames; use the sum of the physical quantities corresponding to the two reference frames and the product of the weights to interpolate the current frame and determine the physical quantity interpolation result of the current frame.
[0087] In one embodiment, when performing interpolation processing on frames at each moment in the digital twin watershed animation based on the target key frame and the target interpolation algorithm to determine the physical quantity interpolation result, the above-mentioned key frame interpolation module 404 is also used to: when the target interpolation algorithm is a preset spline interpolation algorithm, generate an interpolation curve segment between adjacent frames based on the preset curve distortion degree; take each frame in the target key frame as the current frame, normalize the current frame time according to the moment corresponding to the current frame, determine the time normalization result, and substitute the time normalization result into the interpolation curve segment to determine the physical quantity interpolation result of the current frame.
[0088] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding content in the aforementioned method embodiment.
[0089] An embodiment of the present invention provides a server. Specifically, the server includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes the method described in any one of the above-mentioned embodiments.
[0090] Figure 5 A structural diagram of a server provided in an embodiment of the present invention, wherein the server 100 includes: a processor 50, a memory 51, a bus 52 and a communication interface 53, wherein the processor 50, the communication interface 53 and the memory 51 are connected via the bus 52; the processor 50 is used to execute an executable module stored in the memory 51, such as a computer program.
[0091] The memory 51 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage. The system network element communicates with at least one other network element via at least one communication interface 53 (which may be wired or wireless), and may utilize the Internet, a wide area network, a local area network, a metropolitan area network, or the like.
[0092] The bus 52 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0093] Among them, the memory 51 is used to store programs, and the processor 50 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 50 or implemented by the processor 50.
[0094] The processor 50 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method may be completed by hardware integrated logic circuits or software instructions in the processor 50. The processor 50 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It may implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present invention may be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or the like. The storage medium is located in the memory 51 , and the processor 50 reads the information in the memory 51 and completes the steps of the above method in combination with its hardware.
[0095] The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be referred to the previous method embodiment and will not be repeated here.
[0096] If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0097] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A visualization method for digital twin watershed animation, characterized in that: The method comprises: Acquire hydrodynamic simulation result data, and determine target key frames by preprocessing the hydrodynamic simulation result data to perform dimensionality reduction processing on the hydrodynamic simulation result data, wherein the hydrodynamic simulation result data includes: maximum value data, simulation model data, and simulation physical quantity data at each moment, the maximum value data includes: maximum and minimum values of each physical quantity within a simulation time period, the simulation model data includes: position data and vertex physical quantity data contained in attributes of each triangle vertex in a simulation triangle network, and the simulation physical quantity data at each moment includes: physical quantity data and time data contained in each frame of simulation data; According to the proportion of the target key frames in the total number of frames, a target interpolation algorithm is determined from a preset inverse distance weighted linear interpolation method and a preset spline interpolation algorithm, and based on the target key frames and the target interpolation algorithm, the frames at each moment in the digital twin watershed animation are interpolated to determine the physical quantity interpolation result; Normalization processing is performed on the physical quantity interpolation results to determine the physical quantity normalization factors corresponding to the frames to be rendered for generating the watershed animation, and the physical quantity normalization factors are mapped to a preset physical quantity rendering color information table to perform fragment rendering processing using the corresponding color values in the preset physical quantity rendering color information table, thereby determining the target rendered images corresponding to the frames to be rendered, and the target digital twin watershed animation composed of the target rendered images; The step of determining the target key frame by preprocessing the hydrodynamic simulation result data includes: performing statistical calculations on each time step data in the hydrodynamic simulation result data to determine the change in physical quantity and the average change in physical quantity in each time step data, and determining the root mean square change and the first-order derivative of the root mean square change of the physical quantity based on the average change in the physical quantity; and determining the target key frame by performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change; Among them, the step of determining the target key frame by performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change includes: performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change based on a preset weighted weight value to determine the degree of change of the physical quantity; eliminating the time steps whose degree of change is lower than the average change, and determining the simulation start time step, the simulation end time step and the time step whose degree of change is higher than a preset degree of change threshold as the target key frame.
2. The method for visualizing digital twin watershed animation according to claim 1, characterized in that: Before the step of determining a target interpolation algorithm from a preset inverse distance weighted linear interpolation method and a preset spline interpolation algorithm according to the proportion of the target key frames to the total number of frames, the method includes: Obtain an animation frame list, and determine the moment corresponding to the current frame based on a preset moment calculation model, a simulation start time step, a simulation end time step, and the index and total number of frames in the animation frame list.
3. The method for visualizing digital twin watershed animation according to claim 1, characterized in that: The step of determining a target interpolation algorithm from a preset inverse distance weighted linear interpolation method and a preset spline interpolation algorithm according to the proportion of the target key frames to the total number of frames includes: When the ratio of the target key frames to the total number of frames is greater than a preset ratio threshold, determining the preset inverse distance weighted linear interpolation method as the target interpolation algorithm; When the proportion of the target key frames to the total number of frames is not greater than a preset proportion threshold, the preset spline interpolation algorithm is determined as the target interpolation algorithm.
4. The method for visualizing digital twin watershed animation according to claim 1, characterized in that: The step of performing interpolation processing on frames at each moment in the digital twin watershed animation based on the target key frame and the target interpolation algorithm to determine the interpolation result of the physical quantity includes: When the target interpolation algorithm is a preset inverse distance weighted linear interpolation method, each frame in the target key frame is used as the current frame, so as to determine the corresponding moments of the two adjacent reference frames according to the moment corresponding to the current frame, and to determine the corresponding weights of the two adjacent reference frames using the time relationship between the current frame and the two adjacent reference frames; The current frame is interpolated using the sum of the products of the physical quantities corresponding to the two previous and next reference frames and the weights to determine the interpolation result of the physical quantity of the current frame.
5. The method for visualizing digital twin watershed animation according to claim 1, characterized in that: The step of performing interpolation processing on frames at each moment in the digital twin watershed animation based on the target key frame and the target interpolation algorithm to determine the interpolation result of the physical quantity further includes: When the target interpolation algorithm is a preset spline interpolation algorithm, generating interpolation curve segments between adjacent frames based on a preset curve distortion degree; Each frame in the target key frame is taken as the current frame, and the current frame time is normalized according to the moment corresponding to the current frame to determine the time normalization result, and the time normalization result is substituted into the interpolation curve segment to determine the physical quantity interpolation result of the current frame.
6. A visualization device for digital twin watershed animation, characterized in that: The device comprises: a key frame extraction module, which obtains hydrodynamic simulation result data and determines target key frames by preprocessing the hydrodynamic simulation result data to perform dimensionality reduction processing on the hydrodynamic simulation result data, wherein the hydrodynamic simulation result data includes: maximum value data, simulation model data, and simulation physical quantity data at each moment; the maximum value data includes: the maximum value and minimum value of each physical quantity within the simulation time period; the simulation model data includes: position data and vertex physical quantity data contained in the attributes of each triangle vertex in the simulation triangle network; the simulation physical quantity data at each moment includes: physical quantity data and time data contained in each frame of simulation data; A key frame interpolation module determines a target interpolation algorithm from a preset inverse distance weighted linear interpolation method and a preset spline interpolation algorithm according to the proportion of the target key frame in the total number of frames, and interpolates the frames at each moment in the digital twin watershed animation based on the target key frame and the target interpolation algorithm to determine the physical quantity interpolation result; A physical quantity rendering module performs normalization processing on the physical quantity interpolation results, determines the physical quantity normalization factors corresponding to the frames to be rendered for generating the watershed animation, and maps the physical quantity normalization factors to a preset physical quantity rendering color information table, so as to perform fragment rendering processing using the corresponding color values in the preset physical quantity rendering color information table, determine the target rendered images corresponding to the frames to be rendered, and the target digital twin watershed animation composed of the target rendered images; The step of determining the target key frame by preprocessing the hydrodynamic simulation result data includes: performing statistical calculations on each time step data in the hydrodynamic simulation result data to determine the change in physical quantity and the average change in physical quantity in each time step data, and determining the root mean square change and the first-order derivative of the root mean square change of the physical quantity based on the average change in the physical quantity; and determining the target key frame by performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change; Among them, the step of determining the target key frame by performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change includes: performing weighted calculation on the root mean square change and the first-order derivative of the root mean square change based on a preset weighted weight value to determine the degree of change of the physical quantity; eliminating the time steps whose degree of change is lower than the average change, and determining the simulation start time step, the simulation end time step and the time step whose degree of change is higher than a preset degree of change threshold as the target key frame.
7. A server, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method, action simulation method, device, equipment and medium
CN113392163A
Visual SLAM (Simultaneous Localization and Mapping) back-end optimization method based on data adaptive iterative reweighted robust kernel
CN119803439A