Wind field particle trajectory tracking method and system based on dynamic K-nearest neighbor geometric interpolation
Through dynamic K nearest neighbor geometric interpolation and adaptive chroma subsampling method, combined with HEVC video codec and Cesium engine, the problems of large amount of calculation and poor effect in wind field visualization are solved, and efficient and dynamic wind field particle trajectory tracking is achieved. and display.
Patent Information
- Application Number
- CN202411041861.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-01-03
AI Technical Summary
The existing wind farm visualization method based on particle systems has a large amount of calculation and severe calculation resources in complex wind farms, resulting in poor visualization results.
The wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation is adopted, and the two-dimensional regular grid data is generated through bilinear interpolation, and the adaptive chroma subsampling method is converted into two-dimensional image data, which is performed using HEVC video codec. Encoding, and dynamically adjusting particle display rate and properties, rendering based on the Cesium engine.
It reduces computing resource consumption, improves the efficiency and effect of wind farm visualization, and realizes efficient particle trajectory calculation and dynamic display in complex wind farms.
Smart Images

Figure CN119251262A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of atmospheric wind field visualization, and in particular to a wind field particle trajectory tracking method and system based on dynamic K nearest neighbor geometric interpolation. Background Art
[0002] With the continuous growth of data and the development of virtual reality, vector field visualization is widely used in meteorology, water conservancy, oceanography, medicine, geography and other fields, and is developing in the three-dimensional direction. Meteorological data has the characteristics of large data volume, complex data structure and time-varying data. It is difficult to observe the characteristics from the original data. People are better at discovering the implicit information in the data from image data. Therefore, it is of great significance to visualize meteorological data to mine the information behind the data.
[0003] Wind field data contains both wind speed information and wind direction information, and is a type of vector field data. Currently, commonly used vector field data visualization methods are mainly divided into the following categories: (1) direct visualization methods; (2) texture-based visualization methods; (3) geometry-based visualization methods; (4) feature-based visualization methods. In recent years, particle system technology has been widely used in the field of computer graphics. By simulating and rendering the motion trajectories of a large number of particles, complex phenomena such as fluids, smoke, and clouds can be intuitively displayed. Therefore, applying particle systems to wind field visualization can better show the dynamic changes and detailed characteristics of the wind field, and improve the intuitiveness and comprehensibility of data display.
[0004] However, existing wind field visualization methods based on particle systems have some major problems. In areas with high wind field complexity, the distribution of particles is prone to imbalance, affecting the visualization effect. Existing methods often use numerical integration methods to calculate particle trajectories. Although they can achieve high trajectory accuracy, the amount of calculation is very large, especially in complex wind fields, resulting in serious consumption of computing resources. Summary of the invention
[0005] In view of the above existing problems, the present invention is proposed.
[0006] Therefore, the present invention provides a wind field particle trajectory tracking method and system based on dynamic K nearest neighbor geometric interpolation to solve the problems of large calculation amount, serious consumption of computing resources and poor visualization effect in the prior art.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0008] In a first aspect, the present invention provides a method for tracking wind field particle trajectories based on dynamic K nearest neighbor geometric interpolation, comprising: obtaining wind field data of a study area and preprocessing it, generating two-dimensional regular grid data from the preprocessed data using a bilinear interpolation method; converting the two-dimensional regular grid data into two-dimensional image data using an adaptive chroma subsampling method, and encoding the two-dimensional image data into a video using a video codec; initializing a particle system according to the complexity of the video, and adjusting the dynamic particle display rate; tracking particle trajectories based on dynamic K nearest neighbor geometric interpolation, rendering on the browser side using the Cesium engine, and outputting visualization results after dynamically adjusting particle properties.
[0009] As a preferred solution of the wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation described in the present invention, wherein: the use of bilinear interpolation method to generate two-dimensional regular grid data includes:
[0010] Set the coordinates of the point to be interpolated to (x, y), and the coordinates of the four grid points around the point to be interpolated are (x 1 ,y 1 ), (x 2 ,y 1 ), (x 1 ,y 2 ), (x 2 ,y 2 ), the corresponding values are Q 11 , Q 12 , Q 21 , Q 22 ;
[0011] Perform linear interpolation in the x-axis direction and calculate two temporary interpolation values R 1 and R 2 , the formula is:
[0012]
[0013] Perform linear interpolation in the y-axis direction and calculate the final interpolation value P. The formula is:
[0014]
[0015] As a preferred solution of the wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation described in the present invention, wherein: converting the two-dimensional regular grid data into two-dimensional image data includes:
[0016] Acquire the preprocessed two-dimensional regular grid data, and normalize the zonal wind u and the meridional wind v to the interval [0,1];
[0017] The normalized two-dimensional regular grid data is converted from the scalar space to the RGB color space by using the color space transformation to generate the wind speed picture of the atmospheric wind field, wherein the value of the RGB color space is (R, G, B), R∈[0,255] is used to represent the zonal wind u, G∈[0,255] is used to represent the meridional wind v, and B represents the color component value assigned to 0;
[0018] The two-dimensional image data is converted from the RGB color space to the YUV color space, and the data is preliminarily compressed.
[0019] As a preferred solution of the wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation described in the present invention, it also includes:
[0020] Adaptive chromaticity subsampling method is introduced to divide the two-dimensional image data into 9 parts, and the wind speed variation coefficient CV of the 9 parts of the image is calculated respectively. i and the average wind direction θ i , the wind speed variation coefficient CV i It represents the ratio of the standard deviation of wind speed to the mean value, reflecting the volatility of wind speed;
[0021] The wind speed variation index and the average wind direction are weighted and summed to obtain the comprehensive wind field index WF for each part. i , the calculation formula is:
[0022] WF i =w 1 ·CV i +w 2 ·θ i
[0023] Among them, w 1 and w 2 Represents the weight coefficient, which is adjusted according to the specific application scenario. The default value is w 1 =0.8 and w 2 =0.2;
[0024] Comparing the comprehensive wind field index of each part with a plurality of preset thresholds, and subdividing the index into three levels: high, medium and low;
[0025] For high-level two-dimensional image data, the YUV 4:4:4 chroma subsampling model is used to retain the highest chroma information; for medium-level two-dimensional image data, the YUV 4:2:2 chroma subsampling model is used to ensure certain chroma information while achieving a certain compression efficiency; for low-level two-dimensional image data, the YUV 4:2:0 chroma subsampling model is used to achieve the most efficient compression.
[0026] As a preferred solution of the wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation described in the present invention, wherein: the adjustment of the dynamic particle display rate includes:
[0027] Initialize the particle display rate r and the speed adjustment factor f, wherein the speed adjustment factor f is used to dynamically adjust the particle display rate according to the wind speed;
[0028] The speed of each particle is normalized, and the dynamic particle display rate D is calculated according to the normalized particle speed v' r , the formula is:
[0029] D r =fv'+r
[0030] The dynamic particle display rate D r Compared with the normalized particle velocity v', if D r If it is greater than or equal to v', the particle is allowed to be displayed on the screen, otherwise the particle cannot be displayed on the screen;
[0031] Calculate the trajectory of all particles displayed on the screen, including the next position and velocity of the particles, according to D r The relationship between the size of v' determines whether the particle can be displayed on the screen and updates its position in the wind field;
[0032] The calculation and comparison process is repeated to continuously adjust the dynamic particle display rate.
[0033] As a preferred solution of the wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation described in the present invention, the particle trajectory tracking based on dynamic K nearest neighbor geometric interpolation includes:
[0034] At the initial moment, the positions of all particles are analyzed to construct a KD tree to spatially partition the particles, including calculating the spatial position of each particle, allocating spatial regions, constructing a tree structure according to the position distribution of the particles, and updating the KD tree at each time step to ensure that each particle can quickly find its neighboring particles;
[0035] At each time step, the updated KD tree is queried to find the k nearest neighbor particles of each particle, and the current positions of the k nearest neighbor particles are recorded for subsequent interpolation calculations;
[0036] Using dynamic K-nearest-neighbor geometric interpolation, the next position of the current particle is calculated based on the velocity and position of the current particle and the positions of the k nearest neighbor particles of the current particle. The formula is:
[0037]
[0038] Among them, P(ti+1 ) indicates the current particle at time t i+1 The next position of P(t i ) represents the particle at time t i The position of v i represents the velocity vector of the current particle, Δt represents the time step, P k represents the position of the kth neighbor particle, w k represents the weight of the kth neighbor particle, and the calculation formula is as follows:
[0039]
[0040] Among them, d(P i ,P k ) represents the straight-line distance between the current particle and the kth neighboring particle, and ε represents a constant to avoid the denominator being zero;
[0041] After calculating the next position of the current particle, update the particle's position data and rebuild and update the KD tree;
[0042] After each time step, the position information of all particles is recorded to form the motion trajectory data of the particles, and the motion trajectory data is stored and processed.
[0043] As a preferred solution of the wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation described in the present invention, the dynamic adjustment of particle properties includes:
[0044] Load the Cesium library, create a Cesium Viewer instance, and set view parameters;
[0045] Configure the particle renderer in Cesium and set the rendering properties of the particles;
[0046] According to the latest wind field data and particle system status, the properties of particles are updated, including the following dynamic adjustments: increase or decrease the number of particles according to wind field changes; update the current position of particles to ensure that the current position of the particles is synchronized with the changes in the wind field; adjust the movement speed of particles in real time according to wind speed and wind direction; dynamically change the color of particles according to wind speed; update the life cycle of particles in a timely manner according to the particle movement status and wind field dynamics.
[0047] In a second aspect, the present invention provides a wind field particle trajectory tracking system based on dynamic K nearest neighbor geometric interpolation, comprising:
[0048] A preprocessing unit, used to obtain and preprocess the wind field data of the study area, and generate two-dimensional regular grid data using a bilinear interpolation method for the preprocessed data;
[0049] A data conversion unit, configured to convert the two-dimensional regular grid data into two-dimensional image data by using an adaptive chroma subsampling method, and encode the two-dimensional image data into a video by using a video codec;
[0050] A dynamic adjustment unit, used for initializing a particle system according to the complexity of the video and adjusting a dynamic particle display rate;
[0051] The rendering output unit is used to track particle trajectories based on dynamic K-nearest neighbor geometric interpolation, render on the browser side using the Cesium engine, and output visualization results after dynamically adjusting particle properties.
[0052] In a third aspect, the present invention provides a computing device, comprising:
[0053] Memory and processor;
[0054] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method are implemented.
[0055] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions, which implement the steps of the method when executed by a processor.
[0056] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention proposes an adaptive chroma subsampling method, converts wind field data into two-dimensional image data, preliminarily compresses the data, and uses the HEVC video codec to encode it, thereby realizing efficient data compression and transmission in a network environment. The present invention proposes a method for dynamically adjusting the particle display rate, calculating the dynamic particle display rate according to the particle speed and comparing the two to determine whether the particle is allowed to be displayed on the screen, thereby improving the problem of uneven particle distribution during visualization. The present invention tracks the trajectory of particles based on dynamic K-nearest neighbor geometric interpolation, finds the k nearest neighbor particles of each particle by querying the KD tree, and calculates the next position of the particle according to the current particle's speed, position, and the position of the nearest neighbor particle, thereby more efficiently performing particle trajectory calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0058] Figure 1This is an overall flow chart of a method for tracking wind field particle trajectories based on dynamic K nearest neighbor geometric interpolation according to an embodiment of the present invention;
[0059] Figure 2 A particle system structure diagram of a wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation according to an embodiment of the present invention;
[0060] Figure 3 A comparison chart of trajectory calculation time of a wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation according to an embodiment of the present invention and a comparative method;
[0061] Figure 4 An AHTD comparison diagram of a wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation and a comparison method according to an embodiment of the present invention;
[0062] Figure 5 An AVTD comparison diagram of a wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation and a comparison method according to an embodiment of the present invention;
[0063] Figure 6 A visualization comparison diagram of a wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation and a comparison method according to an embodiment of the present invention, wherein (a) is a local visualization effect diagram of the present invention, (b) is a local visualization effect diagram of a particle trajectory tracking method based on fourth-order Runge-Kutta numerical integration, and (c) is a local visualization effect diagram of a particle trajectory tracking method based on the Euler method;
[0064] Figure 7 This is a visualization effect diagram of a wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation described in an embodiment of the present invention. DETAILED DESCRIPTION
[0065] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0066] Example 1
[0067] Reference Figure 1-2 As an embodiment of the present invention, a wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation is provided, which specifically includes the following steps:
[0068] S100: Obtain wind field data of the study area and perform preprocessing, and use bilinear interpolation method to generate two-dimensional regular grid data for the preprocessed data;
[0069] In the embodiment of the present application, the selected data is from the GFS (Global Forecast System) under NOAA, the time range is September 10, 2022, the regional range is longitude 0-360°, latitude is 90°N-90°S, and the spatial resolution is 0.5° longitude interval and 0.5° latitude interval;
[0070] In an embodiment of the present application, using bilinear interpolation to generate two-dimensional regular grid data includes:
[0071] Set the coordinates of the point to be interpolated to (x, y), and the coordinates of the four grid points around the point to be interpolated are (x 1 ,y 1 ), (x 2 ,y 1 ), (x 1 ,y 2 ), (x 2 ,y 2 ), the corresponding values are Q 11 , Q 12 , Q 21 , Q 22 ;
[0072] Perform linear interpolation in the x-axis direction and calculate two temporary interpolation values R 1 and R 2 , the formula is:
[0073]
[0074] Perform linear interpolation in the y-axis direction and calculate the final interpolation value P. The formula is:
[0075]
[0076] S200: converting the two-dimensional regular grid data into two-dimensional image data using an adaptive chroma subsampling method, and encoding the two-dimensional image data into a video using a video codec;
[0077] In the embodiment of the present application, the preprocessed two-dimensional regular grid data is obtained, and the zonal wind u and the meridional wind v are normalized to the interval [0,1]. The formulas of the normalized u component and v component are as follows:
[0078]
[0079] Among them, U norm 、V normare the normalized latitudinal wind speed and meridional wind speed, respectively. U(X,Y) and V(X,Y) represent the latitudinal wind speed and meridional wind speed at a certain location (X,Y). min 、V min Respectively represent the minimum wind speed of the zonal wind and the minimum wind speed of the meridional wind, U max 、V max Respectively represent the maximum wind speed of the zonal wind and the maximum wind speed of the meridional wind;
[0080] Furthermore, the normalized two-dimensional regular grid data is converted from the scalar space to the RGB color space using color space transformation to generate an atmospheric wind field wind speed image, where the value of the RGB color space is (R, G, B), R∈[0,255] is used to represent the zonal wind u, G∈[0,255] is used to represent the meridional wind v, and B represents the color component assigned to 0. The formula is expressed as follows:
[0081] R=Min{U norm ×256,255}
[0082] G=Min{V norm ×256,255}
[0083] Furthermore, the two-dimensional image data is converted from the RGB color space to the YUV color space, and the data is preliminarily compressed for subsequent processing. The conversion formula is:
[0084] Y=0.299R+0.587G+0.114B
[0085] U=-0.147R-0.289G+0.436B
[0086] V=0.615R-0.515G-0.100B
[0087] In the embodiment of the present application, an adaptive chromaticity subsampling method is introduced to divide the two-dimensional image data into 9 parts, and the wind speed variation coefficient CV of the 9 parts of the image is calculated respectively. i and the average wind direction θ i , wind speed variation coefficient CV i It is the ratio of the standard deviation of wind speed to the average value, reflecting the volatility of wind speed. The calculation formula is:
[0088]
[0089] in, is the standard deviation of wind speed in the ith section, μ vi is the average wind speed in the ith section;
[0090] Furthermore, the wind speed variation index and the average wind direction are weighted and summed to obtain the comprehensive wind field index WF for each part. i , the calculation formula is:
[0091] WF i =w 1 ·CV i +w 2 ·θ i
[0092] Among them, w 1 and w 2 Represents the weight coefficient, which is adjusted according to the specific application scenario. The default value is w 1 =0.8 and w 2 =0.2;
[0093] Furthermore, the comprehensive wind field index of each part is compared with multiple preset thresholds and subdivided into three levels: high, medium and low. The high-level part represents the area with drastic changes in wind speed and wind direction, the medium-level part represents the area with moderate changes, and the low-level part represents the area with small changes.
[0094] For high-level two-dimensional image data, the YUV 4:4:4 chroma subsampling model is used to retain the highest chroma information; for medium-level two-dimensional image data, the YUV 4:2:2 chroma subsampling model is used to ensure certain chroma information while achieving certain compression efficiency; for low-level two-dimensional image data, the YUV 4:2:0 chroma subsampling model is used to achieve the most efficient compression;
[0095] In an embodiment of the present application, encoding two-dimensional image data into a video using a HEVC video codec includes:
[0096] Organizing the two-dimensional image data into a frame sequence in time series;
[0097] Initialize the HEVC encoder and set encoding parameters, including bit rate, frame rate, resolution, etc.
[0098] Input the frame sequence into the HEVC encoder for video encoding;
[0099] The encoded video data is saved as a file in mp4 format and the HTTP transmission protocol is used for efficient transmission of the video file.
[0100] It should be noted that the present invention proposes an adaptive chroma subsampling method to convert wind field data into two-dimensional image data, preliminarily compress the data, and encode it using the HEVC video codec, thereby achieving efficient data compression and transmission in a network environment.
[0101] S300: Initialize the particle system according to the complexity of the video and adjust the dynamic particle display rate;
[0102] In the embodiment of the present application, the particle system is initialized according to the complexity of the video, and the number of particles, initial position, initial speed, color, life cycle and other parameters are set;
[0103] In the embodiments of the present application, Figure 2 As shown, adjusting the dynamic particle display rate includes:
[0104] Initialize the particle display rate r and the speed adjustment factor f, where the speed adjustment factor f is used to dynamically adjust the particle display rate according to the wind speed, r is between 0 and 0.1, and f is between 0.8 and 1;
[0105] The velocity of each particle is normalized and the formula is expressed as:
[0106]
[0107] Where v' is the normalized particle velocity, v max Represents the maximum velocity of all particles, v min Represents the minimum value of particle velocity among all particles;
[0108] Calculate the dynamic particle display rate D according to the normalized particle velocity v' r , the formula is:
[0109] D r =fv'+r
[0110] Set the dynamic particle display rate D r Compared with the normalized particle velocity v', if D r If it is greater than or equal to v', the particle is allowed to be displayed on the screen, otherwise the particle cannot be displayed on the screen;
[0111] Calculate the trajectory of all particles displayed on the screen, including the next position and velocity of the particles, according to D r The relationship between the size of v' determines whether the particle can be displayed on the screen and updates its position in the wind field;
[0112] The calculation and comparison process is repeated to continuously adjust the dynamic particle display rate and improve the problem of uneven particle distribution during visualization.
[0113] It should be noted that the present invention proposes a method for dynamically adjusting the particle display rate, which calculates the dynamic particle display rate according to the particle speed and compares the two to determine whether to allow the particle to be displayed on the screen, thereby improving the problem of uneven particle distribution during the visualization process.
[0114] S400: Particle trajectory tracking based on dynamic K-nearest-neighbor geometric interpolation;
[0115] In the embodiments of the present application, Figure 2 As shown, at the initial moment, by analyzing the positions of all particles, a KD tree is constructed to spatially partition the particles, including calculating the spatial position of each particle, allocating spatial regions, constructing a tree structure according to the position distribution of the particles, and updating the KD tree at each time step to ensure that each particle can quickly find its neighboring particles;
[0116] Furthermore, at each time step, the k nearest neighbor particles of each particle are found by querying the updated KD tree, and the current positions of the k nearest neighbor particles are recorded for subsequent interpolation calculations;
[0117] Furthermore, dynamic K-nearest-neighbor geometric interpolation is used to calculate the next position of the current particle based on the velocity and position of the current particle and the positions of the k nearest neighbor particles of the current particle. The formula is:
[0118]
[0119] Among them, P(t i+1 ) indicates the current particle at time t i+1 The next position of P(t i ) represents the particle at time t i The position of v i represents the velocity vector of the current particle, Δt represents the time step, P k represents the position of the kth neighbor particle, w k represents the weight of the kth neighbor particle, and the calculation formula is as follows:
[0120]
[0121] Among them, d(P i ,P k ) represents the straight-line distance between the current particle and the kth neighboring particle, and ε represents a constant to avoid the denominator being zero;
[0122] Furthermore, after calculating the next position of the current particle, the particle position data is updated and the KD tree is rebuilt and updated to ensure fast query of the particle position and neighborhood information in the new time step;
[0123] Furthermore, after each time step, the position information of all particles is recorded to form the motion trajectory data of the particles to ensure the continuity and integrity of the trajectory. The recorded trajectory data is stored and processed to facilitate subsequent visualization and analysis.
[0124] It should be noted that the present invention tracks particle trajectories based on dynamic K-nearest-neighbor geometric interpolation, finds the k nearest neighbor particles of each particle by querying the KD tree, and calculates the next position of the particle according to the speed and position of the current particle and the position of the nearest neighbor particle, which can more efficiently perform particle trajectory calculation.
[0125] S500: Use the Cesium engine to render on the browser side and dynamically adjust particle properties to output visualization results;
[0126] In an embodiment of the present application, dynamically adjusting particle properties includes:
[0127] Load the Cesium library, create a Cesium Viewer instance, and set view parameters;
[0128] Configure the particle renderer in Cesium and set the rendering properties of the particles, such as shape, size, transparency, etc.
[0129] Update the properties of particles according to the latest wind field data and particle system status, including the following dynamic adjustments: increase or decrease the number of particles according to wind field changes; update the current position of particles to ensure that the current position of particles is synchronized with wind field changes; adjust the movement speed of particles in real time according to wind speed and direction; dynamically change the color of particles according to wind speed; update the life cycle of particles in a timely manner according to particle movement status and wind field dynamics.
[0130] The above is a schematic scheme of the wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation of this embodiment. It should be noted that the technical scheme of the wind field particle trajectory tracking system based on dynamic K nearest neighbor geometric interpolation and the technical scheme of the wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation belong to the same concept. For the details not described in detail in the technical scheme of the wind field particle trajectory tracking system based on dynamic K nearest neighbor geometric interpolation in this embodiment, please refer to the description of the technical scheme of the wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation.
[0131] This embodiment also provides a wind field particle trajectory tracking system based on dynamic K nearest neighbor geometric interpolation, including:
[0132] A preprocessing unit is used to obtain and preprocess the wind field data of the study area, and to generate two-dimensional regular grid data using a bilinear interpolation method for the preprocessed data;
[0133] A data conversion unit, used for converting the two-dimensional regular grid data into two-dimensional image data by using an adaptive chroma subsampling method, and encoding the two-dimensional image data into a video by using a video codec;
[0134] A dynamic adjustment unit is used to initialize the particle system according to the complexity of the video and adjust the dynamic particle display rate;
[0135] The rendering output unit is used to track particle trajectories based on dynamic K-nearest neighbor geometric interpolation, render on the browser side using the Cesium engine, and output visualization results after dynamically adjusting particle properties.
[0136] This embodiment also provides a computing device, including:
[0137] Memory and processor;
[0138] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the method proposed in the above embodiment.
[0139] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method proposed in the above embodiment is implemented.
[0140] The storage medium proposed in this embodiment and the method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0141] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ReadOnly, Memory, ROM), random access memory (RandomAccess Memory, RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods of various embodiments of the present invention.
[0142] Example 2
[0143] Reference Figure 3 to Figure 7 Based on the previous embodiment, this embodiment provides an application example of a wind field particle trajectory tracking method and system based on dynamic K nearest neighbor geometric interpolation, in order to verify and illustrate the technical effects adopted in this method.
[0144] The data selected in the embodiment of the present invention are from the GFS (Global Forecast System) under NOAA, the time is September 10, 2022, the regional range is 0-360° longitude, 90°N-90°S latitude, and the spatial resolution is 0.5° longitude interval and 0.5° latitude interval;
[0145] In order to verify the improvement of data transmission efficiency by video compression, this embodiment conducts a comparative experiment on the data transmission volume of data in NetCDF format, data compressed by ZIP method and data based on video compression of the present invention. The resolutions of these three types of data are consistent and they are uniformly transmitted using HTTP protocol. The experimental results are shown in Table 1.
[0146] Table 1: Experimental results.
[0147] Data Format NetCDF ZIP Video The amount of data required to transmit each frame / KB 1024 174 14 Visualize the loading time per frame / ms 2114 450 51
[0148] From Table 1, it can be concluded that the video compression-based data transmission adopted by the present invention is superior to the data compressed by the ZIP method in terms of the amount of data required to transmit each frame and the loading time required for visualizing each frame, and is far superior to directly transmitting NetCDF data.
[0149] Furthermore, the accuracy of trajectory tracking is evaluated using the following metrics:
[0150]
[0151] Where AHTD represents the absolute horizontal transfer deviation, AVTD represents the absolute vertical transfer deviation, N is the total number of trajectories, X, Y, and Z are the positions of the first set of trajectories at time t, and x, y, and z are the positions of the second set of trajectories at time t.
[0152] The particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation of the present invention is compared with the particle trajectory tracking method based on Euler method (Euler) and the particle trajectory tracking method based on fourth-order Runge-Kutta numerical integration (RK4). The experimental results are shown in the attached Figure 4 , Attachment Figure 5 and attached Figure 6 By comparing the calculation time of the same trajectory length of the three methods, it can be concluded that since both compared methods use the numerical integration method to calculate the next position of the particle, the amount of calculation is large, so the trajectory calculation time of the present invention is much shorter than that of the other two methods; by comparing the AHTD and AVTD of the three methods, it can be concluded that the method of the present invention is the best in both AHTD and AVTD evaluation indicators, indicating that the trajectory tracking accuracy of the present method is higher.
[0153] The comparison of local visualization effects of the three methods is shown in the attached Figure 7The overall particle distribution of the method of the present invention is relatively uniform, while the particle density of the other two comparative methods is relatively high in some areas, which affects the visualization effect.
[0154] Therefore, it can be seen from the above that the present invention can achieve efficient, accurate and dynamic wind field visualization, which not only improves data transmission and processing efficiency, but also improves the performance of the particle system, and has broad application prospects and practical value.
[0155] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation, characterized in that: include: Obtaining wind field data of the study area and preprocessing it, and using bilinear interpolation method to generate two-dimensional regular grid data for the preprocessed data; Converting the two-dimensional regular grid data into two-dimensional image data using an adaptive chroma subsampling method, and encoding the two-dimensional image data into a video using a video codec; Initialize the particle system according to the complexity of the video and adjust the dynamic particle display rate; Particle trajectory tracking is performed based on dynamic K-nearest neighbor geometric interpolation, and the Cesium engine is used for rendering on the browser side. The particle properties are dynamically adjusted and the visualization results are output.
2. The wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation according to claim 1 is characterized in that: The method of generating two-dimensional regular grid data by using bilinear interpolation method comprises: Set the coordinates of the point to be interpolated to (x, y), and the coordinates of the four grid points around the point to be interpolated to (x1, y1), (x2, y1), (x1, y2), (x2, y2), and the corresponding values are Q 11 , Q 12 , Q 21 , Q 22 ; Perform linear interpolation in the x-axis direction and calculate two temporary interpolation values R1 and R2. The formula is: Perform linear interpolation in the y-axis direction and calculate the final interpolation value P. The formula is:
3. The wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation according to claim 2 is characterized in that: Converting the two-dimensional regular grid data into two-dimensional image data comprises: Acquire the preprocessed two-dimensional regular grid data, and normalize the zonal wind u and the meridional wind v to the interval [0,1]; The normalized two-dimensional regular grid data is converted from the scalar space to the RGB color space by using the color space transformation to generate the wind speed picture of the atmospheric wind field, wherein the value of the RGB color space is (R, G, B), R∈[0,255] is used to represent the zonal wind u, G∈[0,255] is used to represent the meridional wind v, and B represents the color component value assigned to 0; The two-dimensional image data is converted from the RGB color space to the YUV color space, and the data is preliminarily compressed.
4. The wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation as claimed in claim 3 is characterized in that: Also includes: Adaptive chromaticity subsampling method is introduced to divide the two-dimensional image data into 9 parts, and the wind speed variation coefficient CV of the 9 parts of the image is calculated respectively. i and the average wind direction θ i , the wind speed variation coefficient CV i It represents the ratio of the standard deviation of wind speed to the mean value, reflecting the volatility of wind speed; The wind speed variation index and the average wind direction are weighted and summed to obtain the comprehensive wind field index WF for each part. i , the calculation formula is: WF i =w1·CV i +w2·θ i Among them, w1 and w2 represent weight coefficients, which are adjusted according to specific application scenarios. The default values are w1=0.8 and w2=0.2; Comparing the comprehensive wind field index of each part with a plurality of preset thresholds, and subdividing the index into three levels: high, medium and low; For high-level two-dimensional image data, the YUV 4:4:4 chroma subsampling model is used, for medium-level two-dimensional image data, the YUV 4:2:2 chroma subsampling model is used, and for low-level two-dimensional image data, the YUV 4:2:0 chroma subsampling model is used.
5. The wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation as claimed in claim 4, characterized in that: The adjusting of the dynamic particle display rate comprises: Initialize the particle display rate r and the speed adjustment factor f, wherein the speed adjustment factor f is used to dynamically adjust the particle display rate according to the wind speed; The speed of each particle is normalized, and the dynamic particle display rate D is calculated according to the normalized particle speed v' r , the formula is: D r =fv'+r The dynamic particle display rate D r Compared with the normalized particle velocity v', if D r If it is greater than or equal to v', the particle is allowed to be displayed on the screen, otherwise the particle cannot be displayed on the screen; Calculate the trajectory of all particles displayed on the screen, including the next position and velocity of the particles, according to D r The relationship between the size of v' determines whether the particle can be displayed on the screen and updates its position in the wind field; The calculation and comparison process is repeated to continuously adjust the dynamic particle display rate.
6. The wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation according to claim 5, characterized in that: The particle trajectory tracking based on dynamic K nearest neighbor geometric interpolation includes: At the initial moment, the positions of all particles are analyzed to construct a KD tree to spatially partition the particles, including calculating the spatial position of each particle, allocating spatial regions, constructing a tree structure according to the position distribution of the particles, and updating the KD tree at each time step to ensure that each particle can quickly find its neighboring particles; At each time step, the updated KD tree is queried to find the k nearest neighbor particles of each particle, and the current positions of the k nearest neighbor particles are recorded for subsequent interpolation calculations; Using dynamic K-nearest-neighbor geometric interpolation, the next position of the current particle is calculated based on the velocity and position of the current particle and the positions of the k nearest neighbor particles of the current particle. The formula is: Among them, P(t i+1 ) indicates the current particle at time t i+1 The next position of P(t i ) represents the particle at time t i The position of v i represents the velocity vector of the current particle, Δt represents the time step, P k represents the position of the kth neighbor particle, w k represents the weight of the kth neighbor particle, and the calculation formula is as follows: Among them, d(P i ,P k ) represents the straight-line distance between the current particle and the kth neighboring particle, and ε represents a constant to avoid the denominator being zero; After calculating the next position of the current particle, update the particle's position data and rebuild and update the KD tree; After each time step, the position information of all particles is recorded to form the motion trajectory data of the particles, and the motion trajectory data is stored and processed.
7. The wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation according to claim 6 is characterized in that: The dynamic adjustment of particle attributes includes: Load the Cesium library, create a Cesium Viewer instance, and set view parameters; Configure the particle renderer in Cesium and set the rendering properties of the particles; According to the latest wind field data and particle system status, the properties of particles are updated, including the following dynamic adjustments: increase or decrease the number of particles according to wind field changes; update the current position of particles to ensure that the current position of the particles is synchronized with the changes in the wind field; adjust the movement speed of particles in real time according to wind speed and wind direction; dynamically change the color of particles according to wind speed; update the life cycle of particles in a timely manner according to the particle movement status and wind field dynamics.
8. A system using the wind field particle trajectory tracking method based on dynamic K nearest neighbor geometric interpolation as described in any one of claims 1 to 7, characterized in that: include: A preprocessing unit, used to obtain and preprocess the wind field data of the study area, and generate two-dimensional regular grid data using a bilinear interpolation method for the preprocessed data; A data conversion unit, configured to convert the two-dimensional regular grid data into two-dimensional image data by using an adaptive chroma subsampling method, and encode the two-dimensional image data into a video by using a video codec; A dynamic adjustment unit, used for initializing a particle system according to the complexity of the video and adjusting a dynamic particle display rate; The rendering output unit is used to track particle trajectories based on dynamic K-nearest neighbor geometric interpolation, render on the browser side using the Cesium engine, and output visualization results after dynamically adjusting particle properties.
9. An electronic device, comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having computer program instructions stored thereon, wherein the computer-executable instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Cited By
Transmission track algorithm based on flow field smoothness
CN120373217A
A transport trajectory method based on flow field smoothness
CN120373217B
