Design method of urban population flow visualization system

Through GPU parallel computing and electric dipole model, combined with Tyson polygon mesh and Worley noise algorithm, the flow direction map and particle distribution of population flow between cities are generated in real time, solving the problems of dynamic flow field map generation and limited particle number in the existing technology, and achieving efficient and real-time visualization of urban population flow.

CN120198565AActive Publication Date: 2025-06-24BEI JING YOU NUO KE JI GU FEN YOU XIAN GONG SI
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510680356.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-06-24
Estimated Expiration
2045-05-26

AI Technical Summary

Technical Problem

The prior art is difficult to realize high-performance visual display of population flow between cities, especially the generation of dynamic flow field maps and the limited number of particles under large-scale data.

Method used

GPU parallel computing is used to generate velocity field and density field through the electric dipole model, combined with Tyson polygon mesh and Worley noise algorithm, flow direction maps and particle distributions are generated in real time, and the particle rendering system is used to display the population flow effect.

Benefits of technology

It realizes efficient and real-time visual display of population flow between cities, supports real-time rendering of millions of particles and millisecond response delay, and is suitable for various map modes, improving the performance of data updates and view transformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198565A_ABST
    Figure CN120198565A_ABST
Patent Text Reader

Abstract

The invention relates to a design method for an urban population flow visualization system, and the method comprises the steps: transmitting urban coordinate sample point data into a newly-created point texture, and inputting the data into a fragment shader of a GPU, and obtaining a velocity field of urban coordinate sample points through calculation; taking the urban coordinate sample point as a center, and constructing a Thiessen polygon grid in which a preset feature point exists in or around a unit grid in the GPU; calculating the distance from any pixel point in the fragment shader to all preset feature points and the comprehensive influence intensity, and generating density fields with different intensities; rGBA texture coding is carried out on the particle coordinates in a particle rendering system, and the current positions of the particles are decoded and calculated in a fragment shader; different numbers of particles are generated according to the density fields with different intensities, the urban population net inflow is displayed according to the number of the particles, and the positions of the particles are calculated and updated according to the velocity field to achieve the population flowing effect. According to the method and the device, high-performance visual display of population flow among cities is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of three-dimensional visualization technology, and particularly to a design method for a visualization system of urban population flow. Background Art

[0002] By analyzing population flow data through a visualization system, combining urban agglomeration policies and plans, revealing industrial characteristics and the expansion trend of metropolitan areas, assisting decision-makers in optimizing urban services and management, and providing data support for urban agglomeration planning and industrial structure adjustment; at the same time, improving the scientificity of decision-making through multi-dimensional (space, time, policy) analysis. Generally, based on migration data (place of origin, place of destination, number of migrants), map components are used to generate migration path maps or heat maps, and model algorithms are combined to analyze the economic and industrial structure.

[0003] The existing visualization technologies mainly include the following four types:

[0004] 1. Flow Chart

[0005] Applicable scenarios include: directional data such as population migration, logistics transportation, information flow, etc. It has the advantages of intuitively displaying the flow direction and scale, and assisting in pattern analysis. This solution ignores that the absolute value needs to be presented in combination with other forms, and the performance needs to be optimized for large-scale data.

[0006] 2. Particle Movement Map / Connection Map: Static connection maps are prone to overlap and clutter; the implementation of dynamic particle movement maps requires direction field quantity data.

[0007] 3. 3D Map (Bar Chart / Heat Map): 3D Bar Map: Taking districts and counties as units, the column height represents the number of inflows, and core cities are marked with bubbles. Combined with a time axis, dynamic display is achieved. 3D Heat Map: Using color gradients (blue → red) to represent population density, which is suitable for macro trend analysis.

[0008] 4. There are certain limitations in the CPU solution of the traditional particle system. Its implementation method: drawing particles through Canvas 2D, calculating the particle movement trajectory at the CPU end. Particles are randomly generated, moved according to wind field data, and some particles are reset regularly. The particle trajectory effect is formed by fading and superimposing between new and old frames. Since it is calculated and updated at the CPU end, this method has the following disadvantages: the number of particles is limited (about 5k), the data update delay is high (about 2 seconds). It is difficult to integrate efficiently with WebGL maps.

[0009] Comparing with the prior art, it can be obtained that: the static connection diagram is simple but prone to overlap, and the dynamic flow field diagram has high requirements for data. How to obtain the dynamic flow field diagram through simple inflow and outflow data between cities has become the key constraint; the 3D map (bar / heat) is more suitable for displaying the spatio-temporal distribution, but it is necessary to balance the clarity and the amount of information, and it cannot well display the flow direction and scale. Therefore, there is an urgent need for a method that can automatically and real-time generate the flow diagram, automatically generate the scale weight, combine the particle dynamic flow technology, effectively display the flow direction and scale between cities, and use the GPU parallel computing power for particle flow to meet the large-scale particle operation requirements. Summary of the Invention

[0010] The technical problem to be solved by this application is to provide a design method for a visualization system of urban population flow in view of the deficiencies of the prior art, so as to achieve high-performance visualization display of population flow between cities.

[0011] The technical solution of this application to solve the above technical problems is as follows:

[0012] In the first aspect, a design method for a visualization system of urban population flow is provided, including:

[0013] Transfer the urban coordinate sample point data to a newly created point texture;

[0014] Input the point texture into the fragment shader of the GPU, generate a vector diagram based on the electric dipole, and calculate the velocity field based on the urban coordinate sample points;

[0015] Taking the urban coordinate sample points as the center, construct a Thiessen polygon grid in the GPU to ensure that there is a preset feature point within each grid cell or within a preset distance;

[0016] In the process of the density field rendering pipeline, for any pixel point in the fragment shader of the GPU, calculate its distance to all preset feature points and the comprehensive influence intensity of the pixel point by all preset feature points, and generate density fields with different intensities;

[0017] Perform RGBA texture encoding on the particle coordinates in the particle rendering system, and decode and calculate the current position of the particle in the fragment shader of the GPU;

[0018] Generate different numbers of particles according to the density fields with different intensities, use the number of particles to display the net inflow of urban population, and calculate and update the particle positions according to the velocity field to achieve the population flow effect.

[0019] Optionally, the transfer of the urban coordinate sample point data stored in the array to the newly created point texture includes:

[0020] Create a point texture;

[0021] Calculate the texture size based on the number of interpolation sample points n;

[0022] Set the point texture type to Float type;

[0023] Set the texture internalformat to RGBA32F type;

[0024] Set the texture format to RGBA type;

[0025] Each urban coordinate sample point corresponds to a pixel point of the point texture, and the urban coordinate sample points are stored in the RGBA channel components of the corresponding pixel points;

[0026] Calculate the maximum and minimum values of the interpolation sample points and transfer them to the GPU in the form of uniforms;

[0027] Update the point texture.

[0028] Optionally, inputting the point texture into the fragment shader of the GPU to generate a vector map based on the electric dipole includes:

[0029] Input the point texture and colorRampTexture into the fragment shader of the GPU;

[0030] Construct a new scene, camera, Flowmap geometry, rendering material, construct a rendering queue, and add the camera and Flowmap geometry to the new scene;

[0031] Transfer the spatial range of the interpolation sample points to the fragment shader in the form of uniforms;

[0032] Multiply the uv coordinates by the spatial range of the interpolation sample points to obtain the actual coordinate value fragCoord of the p pixel point to be interpolated;

[0033] Traverse all preset feature points and generate a vector map based on the electric dipole.

[0034] Optionally, the traversing all preset feature points includes:

[0035] According to the point texture size, obtain the texture coordinate uvi of the i-th preset feature point p i ;

[0036] Sample to obtain the spatial coordinates and net inflow value of the i-th preset feature point, expressed as [x, y, z, q];

[0037] Obtain the distance from the i-th preset feature point to the p pixel point;

[0038] Judge whether the spatial distance is less than the distance threshold. If so, calculate the interpolation result E;

[0039] Normalize E, denoted as normalizedE, and return to the initial step to traverse other preset feature points.

[0040] Optionally, the calculation of the interpolation result E adopts the following calculation formula:

[0041]

[0042] Where q is the net inflow, r is the vector pointing from the position of the calculated pixel point to the preset feature point, |r| is the magnitude of the vector r, and weight is the calculated value of the inverse distance square weight.

[0043] Optionally, during the density field rendering pipeline process, for any pixel point in the fragment shader of the GPU, calculate its distance to all preset feature points, including:

[0044] For any pixel point, initialize the minimum distance minimum_dist;

[0045] Calculate the vector direction from the current pixel point to the preset feature point;

[0046] Calculate the actual distance dist = length(direction);

[0047] Take the smaller value of minimum_dist and dist, and update it to the minimum distance minimum_dist.

[0048] Optionally, calculate the comprehensive influence intensity of the pixel point by all preset feature points, and the expression is as follows:

[0049]

[0050] Where w i is the normalized net inflow of the i-th preset feature point, d i is the distance from the p pixel point to the i-th preset feature point p i , d min is the minimum distance minimum_dist from the current pixel point to all preset feature points, expNum is the attenuation exponent, and e is the base of the natural logarithm.

[0051] Optionally, for the RGBA texture encoding of the particle coordinates, decode and calculate the current position of the particle in the fragment shader of the GPU; including:

[0052] Use the RG channels to correspond to the X coordinate and encode to establish the X coordinate;

[0053] Use the BA channels to correspond to the Y coordinate and encode to establish the Y coordinate;

[0054] Use texture to store and operate data. The X coordinate and Y coordinate are combined into a texture, and two such textures are alternately used as input or output. Through the particle update rendering pipeline, the particle positions are updated every frame. Optionally, different numbers of particles are generated according to the density field of different intensities, and the net inflow of the urban population is shown by the number of particles. The particle positions are calculated and updated according to the velocity field to achieve the effect of population flow. It includes:

[0055] Input the velocity field, density field, and particle coordinate texture into the particle update rendering pipeline, and output the particle coordinate texture updated based on the velocity field;

[0056] Input the updated particle coordinate texture into the particle drawing rendering pipeline, and output the particle point drawing frame buffer;

[0057] Input the particle point drawing frame buffer and transparency into the blending and overlay rendering pipeline, and output the trailing particle drawing frame buffer after blending and overlay.

[0058] In a second aspect, a computer program product is provided, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps in the design method of the urban population flow visualization system described in the first aspect are implemented.

[0059] Beneficial effects

[0060] 1. The method of this application is based on urban coordinates and net inflow data, and a flow map (Flowmap) is generated in real time in the GPU, realizing the real-time generation of flow maps at different times, imitating the use of the electric dipole method to simulate the generation of the flow field map, and realizing the real-time calculation of the flow field.

[0061] 2. Adaptive density map generation: Based on urban coordinates and net inflow data, the real-time generation of the particle distribution weight map at different times is realized in the GPU to achieve the distribution of different numbers of particles on different net inflow data; the Worley Noise is used to construct the weight map, so that different preset feature points have different influences, the exponential decay is used to make the influence range more natural, and the minimum_dist modulation is used to make the boundary transition smoother:

[0062] 3. Encode the particle positions and wind field data into textures, and use the GPU to efficiently process to achieve high-precision texture encoding of coordinate positions.

[0063] 4. Simulate random behavior on the GPU without native random functions through mathematical methods to achieve intelligent particle management.

[0064] 5. Use double-buffer swapping: Avoid state read-write conflicts and achieve smooth animations.

[0065] Advantages of additional aspects of the present application will be given in part in the following description, become apparent in part from the following description, or be learned through practice of the present application. Description of the Drawings

[0066] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or the prior art. Obviously, the following described drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0067] Figure 1 Flow schematic diagram of a design method for an urban population flow visualization system according to an embodiment of the present application;

[0068] Figure 2 Schematic diagram of the flow field (velocity field) generated in an embodiment of the present application;

[0069] Figure 3 Thiessen polygon grid diagram of specific example data division in an embodiment of the present application;

[0070] Figure 4 Schematic diagram of the density field generated in an embodiment of the present application;

[0071] Figure 5 Schematic diagram of particle flow output on the terminal page in an embodiment of the present application;

[0072] Figure 6 Technical principle flow diagram of a specific example in an embodiment of the present application. Detailed Description of the Embodiments

[0073] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.

[0074] Embodiment 1

[0075] As Figure 1 shown, a design method for an urban population flow visualization system includes the following steps:

[0076] Step S1: Transmit urban coordinate sample point data to a newly created point texture;

[0077] Specifically, this step of the present application is mainly data preprocessing, mainly including creating a point texture (pointTexture) and storing the urban coordinates and net inflow of population in the RGBA channels. The specific implementation process is as follows:

[0078] Step S1.1: Create a point texture;

[0079] Step S1.2: Calculate the texture size according to the number of interpolation sample points n;

[0080] Specifically, the texture size is a square with equal length and width, and the width is a power of 2. Take the square root of n and round up to get an integer a, then the texture width size is the square of a;

[0081] Step S1.3: Set the point texture type to Float type;

[0082] Step S1.4: Set the texture internalformat to RGBA32F type;

[0083] Step S1.5: Set the texture format to RGBA type;

[0084] Each urban coordinate sample point corresponds to a pixel point of the point texture, and the urban coordinate sample points are stored in the RGBA channel components of the corresponding pixel points;

[0085] Specific to this embodiment, the urban coordinate sample point data is sorted and adapted, and stored in an array point by point in the form of x, y, z, q, and then passed to the image attribute of the point texture; where x, y, z are coordinate points and q is the net inflow of the sample point; each urban coordinate sample point corresponds to a pixel point of the point texture, and x, y, z, q correspond to the RGBA channel components of the pixel point;

[0086] Step S1.7: Calculate the maximum and minimum values of the interpolation sample points and pass them to the GPU in the form of uniforms (global variables);

[0087] Step S1.8: Update the point texture.

[0088] Step S2: Input the point texture into the fragment shader of the GPU, generate a vector map based on the electric dipole, and obtain the velocity field of the urban coordinate sample points;

[0089] The principle of generating the velocity field in this application is to simulate the flow field using an electric dipole model. The electric dipole is composed of two opposite-sign point charges. By corresponding the population inflow to the negative charge and the population outflow to the positive charge, and further controlling the electric field distribution through the urban location and net inflow, the velocity field is finally generated.

[0090] After the point texture created in the above step S1 is completed, it is passed into the GPU. The steps of this application are mainly implemented in the GPU shader, which specifically includes: an initialization stage and a flow field calculation;

[0091] In the initialization stage, an accumulator is created to store the weight accumulation value and the vector weighted value, and variables such as the position (v_Position) of the current pixel point in the actual space, the initialized flow field (flowField), and the minimum distance are calculated;

[0092] Specifically, the flow field calculation mainly includes:

[0093] Traverse the point texture data,

[0094] Sample the position and net inflow information of the preset feature points from the point texture (pointTexture),

[0095] Calculate the distance (dist) and direction (direction) from the current pixel point to the preset feature point,

[0096] When the distance (dist) from the current pixel point to the preset feature point is less than the threshold (distanceThreshold):

[0097] Use the inverse distance squared weight weight;

[0098] The specific formula (1) is as follows:

[0099] (1)

[0100] Apply the linear attenuation factor;

[0101] Using formula (2), apply the weight to the direction vector field, and at the same time accumulate the weight weight, and store the result in the corresponding variable of the accumulator;

[0102] When the accumulated weight is not 0, divide the vector weighted value by the weight accumulation value to obtain the interpolated direction vector, and the value range is [-1, 1]; otherwise, the direction vector takes (0, 0);

[0103] Calculate the interpolated direction vector mapped to [0, 1] to obtain the normalized direction vector, which is convenient for frame buffer output, and store it in flowField and output.

[0104] This calculation process is carried out in the GPU shader, making full use of the hardware acceleration performance, and can realize real-time calculation of multi-city points. The specific process is as follows:

[0105] 1) Data preparation: Input the point texture generated in S1 and colorRampTexture, where the latter is the gradient color band texture.

[0106] 2) Construct a new scene 1, camera 1, Flowmap Geometry, and rendering material 1, and construct a rendering queue 1. Add camera 1 and geometry 1 to scene 1. The Flowmap Geometry is a Plane Geometry.

[0107] 3) The rendering material uses a shader material, and parameters such as distanceThreshold, point texture size, pointsNum, dataResolution, and originPoint are passed to the shader in the form of uniforms. Among them, distanceThreshold is the search radius size (unit: meter), the point texture size and pointsNum are the size of the point texture and the number of data points respectively; dataResolution is the spatial range of the interpolation sample points; originPoint is the point at the lower left corner of the interpolation sample points (the point with the smallest spatial position).

[0108] 4) Multiply the uv coordinates by dataResolution to obtain the actual coordinate value fragCoord of the p pixel point to be interpolated.

[0109] 5) During each rendering process, traverse all preset feature points.

[0110] a) According to the point texture size, obtain the texture coordinate uvi of the i-th preset feature point p i ;

[0111] b) Sample to obtain the specific data of the i-th preset feature point, and the four components [x, y, z, q] are the spatial coordinates and the net inflow value respectively.

[0112] c) Calculate the distance from the i-th preset feature point to the p pixel point.

[0113] d) Determine whether the spatial distance is less than the distance threshold (distanceThreshold). If so, run the following formula to calculate the interpolation result E.

[0114] (2)

[0115] Among them, q is the net inflow of the population; r is the vector pointing from the calculated pixel point position to the preset feature point, that is, direction; |r| is the modulus of the vector r; weight is the calculated value of the inverse distance square weight.

[0116] e) Normalize E and denote it as normalizedE.

[0117] 6) Output the calculated vector map.

[0118] In the rendering pipeline process of this flow map, the draw mode uses the triangle draw mode; the camera uses an orthographic camera, and the left, right, bottom, top, near, and far parameters are set to -1, 1, -1, 1, 0.01, and 10 respectively; the camera position is placed directly above the geometry, with coordinates (0, 1, 0); the fragment shader outputs the final processing result to the frame buffer and then to the texture memory, preparing for use in the next rendering pipeline.

[0119] In the process of generating the velocity field in this embodiment, essentially, the comprehensive influence of multiple dipoles on each pixel point is calculated, and the following aspects are also concerned:

[0120] - Distance attenuation: Use inverse distance weighting for attenuation;

[0121] - Direction influence: Consider the direction of each pixel point;

[0122] - Weight influence: Consider the weight value of each pixel point;

[0123] - Threshold control: Control the influence range through the distance threshold.

[0124] Those skilled in the art can understand that post-processing optimization processes such as normalizing the vector field and applying threshold control (which belong to the prior art and will not be elaborated here) are also carried out to output the final flow field / velocity field (see Figure 2 ), and the velocity field is stored in the texture memory.

[0125] The calculation of the population density field in this embodiment is mainly realized through the Worley noise algorithm, which mainly includes: step S3 of space division and step S4 of calculating the comprehensive influence intensity based on the preset feature points of the distribution. The specific implementation process is as follows:

[0126] Step S3: Centering on the urban coordinate sample points, construct a Thiessen polygon grid in the GPU to ensure that there is a preset feature point within each grid cell or within a preset distance;

[0127] Specifically, the space division is mainly grid processing. Centering on the input urban points, a Thiessen polygon grid is constructed in the GPU, and there is a preset feature point within or near each cell; Figure 3 This is an example of the Thiessen polygon grid of data division. As shown in the figure, the boundary of the Thiessen polygon is relatively rigid and cannot perform good edge transition. In the specific implementation process, the boundary also needs to be softened;

[0128] Step S4: In the density field rendering pipeline process, for any pixel point in the fragment shader of the GPU, calculate its distance to all preset feature points and the comprehensive influence intensity of the pixel point by all preset feature points, and generate a density field with different intensities;

[0129] In this embodiment, preset feature points are selected based on the positions of urban points;

[0130] The distance calculation mainly involves multi-level weight superposition. For each point in space, calculate the distance from this point to all preset feature points and find the closest distance. The specific implementation process is as follows:

[0131] Step S4.1: For any pixel point, initialize the minimum distance minimum_dist;

[0132] Specifically in this embodiment, minimum_dist = 1.0;

[0133] Step S4.2: Calculate the vector direction from the current pixel point to the preset feature point;

[0134] Step S4.3: Calculate the actual distance dist = length(direction);

[0135] Step S4.4: Take the smaller value of minimum_dist and dist and update it to the minimum distance minimum_dist.

[0136] In the specific implementation process, after completing the above steps, it will return to step S4.1 to continue calculating the distance of the next pixel point until all preset feature points are calculated. In the process of calculating the comprehensive influence intensity of the pixel point by all preset feature points, this embodiment mainly uses exponential decay: exp(-dist * expNum), where expNum is 2.5; combined with the normalized net inflow w of the preset feature point i And use the power function of (1 - minimum_dist) to modulate the edge transition;

[0137] Specifically, it is mainly calculated through the following expression (3):

[0138] (3)

[0139] Among them, w i is the normalized net inflow of the i-th preset feature point, d i is the distance from the p pixel point to the i-th preset feature point p i d min is the minimum distance minimum_dist from the current pixel point to all preset feature points, expNum is the decay exponent, and e is the base of the natural logarithm.

[0140] In this embodiment

[0141] w i=(q_i - min_q) / (max_q- min_q),

[0142] where \(q_i\), \(min_q\), and \(max_q\) are the net inflow of the \(i\)-th urban point, the minimum net inflow of all urban points, and the maximum net inflow respectively;

[0143] The physical meaning of this formula is:

[0144] 1. \(e\) (-di * expNum) : exponential decay of distance, making the influence weaken rapidly with the increase of distance;

[0145] 2. \((1 - d\) min ) expNum : boundary transition term, making the transition smoother in the area between the preset feature points;

[0146] 3. \(w\) i : normalized net inflow of the preset feature point;

[0147] 4. \(\sum\): superposition of the influences of all preset feature points.

[0148] The finally obtained \(sumWeight\) represents the comprehensive influence intensity of this pixel point by all preset feature points.

[0149] Obviously, before outputting the final density field (as shown in Figure 4 ), those skilled in the art will also perform the following optimization strategies:

[0150] Adaptive weight system, adding a weight system to make different preset feature points have different influences;

[0151] Exponential decay smoothing, using exponential decay to make the influence range more natural;

[0152] Edge transition optimization, making the boundary transition smoother through \(minimum\_dist\) modulation.

[0153] Step S5: In the particle rendering system, perform RGBA texture encoding on the particle coordinates, decode the texture in the fragment shader of the GPU, and calculate the current position of the particle;

[0154] In a feasible implementation, the performing RGBA texture encoding on the particle coordinates, decoding the texture in the fragment shader of the GPU, and calculating the current position of the particle; includes the following steps:

[0155] Step S5.1: Establish the X coordinate by encoding with the RG channels corresponding to the X coordinate;

[0156] Step S5.2: Establish the Y coordinate by encoding with the BA channels corresponding to the Y coordinate;

[0157] Step S5.3: Use texture to store and operate data. The X coordinate and the Y coordinate are combined into a texture, and two such textures are alternately used as input or output. Through the particle update rendering pipeline, the particle positions are updated for each frame.

[0158] In the specific implementation process, use texture (Texture) to store and operate data (such as particle positions, wind field data). Two textures are alternately used as input / output, and the particle positions are updated for each frame.

[0159] Step S6: Generate different numbers of particles according to density fields of different intensities, use the number of particles to display the net inflow of urban population, calculate and update the particle positions according to the velocity field, and achieve the effect of population movement.

[0160] The control of particle behavior is mainly achieved through the following technologies:

[0161] Calculate in the fragment shader: Decode the current particle position from the texture to update the position;

[0162] Specifically, query the velocity field texture to obtain the wind speed of the velocity field, update the position; and consider polar distortion (the longitude distance changes with latitude); re-encode the position to the output texture.

[0163] Generate randomly reset particles through pseudo-random numbers: Generate random values based on the particle position and the frame random seed through GLSL (OpenGL Shading Language) functions; Dynamically adjust the reset probability (particles in high-speed areas are reset more frequently to balance the particle density).

[0164] Finally, distribute particles according to weights, mainly by combining the density map generated in step S4, generate different numbers of particles according to density fields of different intensities, use the number of particles to display the net inflow of urban population, calculate and update the particle positions according to the velocity field, and achieve the effect of population movement. The final effect is as Figure 5 shown.

[0165] In a specific example of this embodiment, the design of the population movement visualization system is implemented in the particle rendering system (specifically see the middle part of the Figure 6 technical flow chart), and it is specifically composed of three parts: the particle update rendering pipeline, the particle drawing rendering pipeline, and the blending and overlay rendering pipeline.

[0166] Particle update rendering pipeline: Input the velocity field, density field, particle coordinate texture, and other setting parameters; Output the particle coordinate texture updated based on the velocity field. The particle coordinates exist in the form of texture, and random particles are initialized.

[0167] Particle drawing rendering pipeline: Input the updated particle coordinate texture and other setting parameters, and output the particle point drawing frame buffer.

[0168] Blending and overlay rendering pipeline: Input the particle point drawing frame buffer and transparency, and output the trailing particle drawing frame buffer after blending and overlay.

[0169] Rendering pipeline process: Vertex shader processes geometric transformation → Rasterization generates fragments → Fragment shader calculates pixel colors → Output to the screen or frame buffer. Among them: Vertex shader: Processes vertex data (coordinates, normals, UVs, etc.) of 3D models and performs coordinate transformation. Primitive assembly & Rasterization: Assembles vertices into triangles (or other primitives) and converts them into pixel fragments (fragments) on the screen. Fragment shader: Calculates the final color of each fragment (texture sampling, lighting calculation, etc.) and processes transparency, depth testing, etc. Output merging: Blends the fragment colors with the frame buffer and finally generates a 2D image or frame buffer.

[0170] Finally, parameters such as point textures are passed to the fragment shader in the form of uniforms.

[0171] The specific implementation process steps are as follows:

[0172] Step S6.1: Input the velocity field, density field, and particle coordinate texture into the particle update rendering pipeline, and output the particle coordinate texture updated based on the velocity field;

[0173] Step S6.2: Input the updated particle coordinate texture into the particle drawing rendering pipeline, and output the particle point drawing frame buffer;

[0174] Step S6.3: Input the particle point drawing frame buffer and transparency (opacity) into the blending and overlay rendering pipeline, and output the trailing particle drawing frame buffer after blending and overlay.

[0175] During the GPU acceleration process, it can be understood that those skilled in the art can perform adaptive reset, density balancing, and filtering speed threshold to achieve dynamic optimization. The above-mentioned particle positions, particle points, and trailing particles are all stored in the texture memory during the process of entering the next rendering pipeline;

[0176] Specifically in this example, during the filtering speed threshold process, for particles with too low speed, they are not displayed on the canvas, so as to reduce the distribution of dense and scattered points in the area caused by too low speed. By setting u_minDiscardSpeed, when the speed is less than this value, a discard operation is performed on the points;

[0177] Furthermore, the following operations can be performed to achieve visual enhancement:

[0178] Render in the form of points, and implement color band mapping according to the wind speed by mapping to the colorRampTexture color band;

[0179] Draw particles into the texture memory every frame, and slightly fade the historical texture during overlay to achieve trajectory rendering;

[0180] Manually perform bilinear interpolation on the wind field data and perform anti-aliasing processing, which can effectively avoid blocky artifacts caused by texture scaling;

[0181] For different national boundaries and provincial boundaries, filter the boundaries by inputting the corresponding geojson data, and complete the particle display within the boundaries to integrate the geographical boundaries.

[0182] During the process of displaying the rendering pipeline on the terminal, this example is based on the output result of the particle rendering system. The steps of constructing rendering resources on the terminal are: constructing a scene, a camera, a geometry, and a rendering material, constructing a rendering queue, adding the camera and the geometry to the scene, and outputting the final result to the terminal page.

[0183] The system designed by the method of this application has the following performance advantages:

[0184] - Real-time rendering of millions of particles: Benefiting from the parallel processing ability of the GPU, the number of particles in this solution far exceeds that of the CPU solution.

[0185] - Millisecond-level response delay: There is no significant delay in data update and view transformation.

[0186] - Seamless map integration: The textured output can be directly used for WebGL map rendering, adapting to various modes of maps such as 2D, 2.5D, and 3D.

[0187] By breaking through the limitations of the traditional CPU solution through the method designed by this application, real-time rendering of high-resolution and large-scale particles has been achieved, providing an efficient and intuitive solution for visualizing urban population flow. The system performance has been significantly improved compared with the traditional solution and can be widely applied in fields such as urban planning and population research.

[0188] Example Two

[0189] This application provides a computer program product, including a computer program or instruction, which when executed by a processor implements the steps in the design method of the urban population flow visualization system described in the first aspect.

[0190] Based on such understanding, all or part of the processes in the above-described embodiment methods of this application can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or system, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0191] The above-described embodiments are only used to illustrate the technical solutions of this application, rather than to limit it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of this application, and should all be included in the protection scope of this application.

[0192] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of various equivalent modifications or replacements, and these modifications or replacements should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims

1. A design method for a visualization system of urban population flow, characterized in that, Including: Transferring the urban coordinate sample point data to a newly created point texture; Inputting the point texture into the fragment shader of the GPU, generating a vector map based on the electric dipole, and calculating the velocity field based on the urban coordinate sample points; Constructing a Thiessen polygon grid centered on the urban coordinate sample points in the GPU to ensure that there is a preset feature point within each grid cell or within a preset distance; During the density field rendering pipeline process, for any pixel point in the fragment shader of the GPU, calculating the distance from it to all preset feature points and the comprehensive influence intensity of the pixel point by all preset feature points, and generating density fields with different intensities; Performing RGBA texture encoding on the particle coordinates in the particle rendering system and decoding and calculating the current position of the particle in the fragment shader of the GPU; Generating different numbers of particles according to the density fields with different intensities, displaying the net inflow of the urban population by the number of particles, and calculating and updating the particle positions according to the velocity field to achieve the effect of population flow.

2. The design method of the urban population flow visualization system according to claim 1, characterized in that, The transferring the urban coordinate sample point data stored in the array to the newly created point texture includes: Creating a point texture; Calculating the texture size according to the interpolation sample point data volume n; Setting the point texture type to Float type; Setting the texture internalformat to RGBA32F type; Setting the texture format to RGBA type; Each urban coordinate sample point corresponds to a pixel point of the point texture, and the urban coordinate sample points are stored in the RGBA channel components of the corresponding pixel points; Calculating the maximum and minimum values of the interpolation sample points and transferring them to the GPU in the form of uniforms; Updating the point texture.

3. The design method of the urban population flow visualization system according to claim 2, characterized in that, The inputting the point texture into the fragment shader of the GPU and generating a vector map based on the electric dipole includes: Inputting the point texture and the colorRampTexture into the fragment shader of the GPU; Constructing a new scene, camera, Flowmap geometry, rendering material, constructing a rendering queue, and adding the camera and Flowmap geometry to the new scene; Transferring the spatial range of the interpolation sample points to the fragment shader in the form of uniforms; Multiplying the uv coordinates by the spatial range of the interpolation sample points to obtain the actual coordinate value fragCoord of the p pixel point to be interpolated and calculated; Traversing all preset feature points and generating a vector map based on the electric dipole.

4. The design method of the urban population flow visualization system according to claim 3, characterized in that The traversing all preset feature points includes: According to the dot texture size, calculate the texture coordinates uvi of the i-th preset feature point p i ; Sampling to obtain the spatial coordinates and net inflow value of the i-th preset feature point, denoted as [x, y, z, q]; Calculating the distance from the i-th preset feature point to the p pixel point; Judging whether the spatial distance is less than the distance threshold. If so, calculating the interpolation result E; Normalizing E, denoted as normalizedE, and returning to the initial step to traverse other preset feature points.

5. The design method of the urban population flow visualization system according to claim 4, characterized in that, The calculating the interpolation result E adopts the following calculation formula: where q is the net inflow, r is the vector pointing from the calculated pixel point position to the preset feature point, |r| is the modulus of the vector r, and weight is the calculated value of the inverse distance square weight.

6. The design method of the urban population flow visualization system according to claim 1, characterized in that, During the density field rendering pipeline process, for any pixel point in the fragment shader of the GPU, calculate its distances to all preset feature points, including: For any pixel point, initialize the minimum distance minimum_dist; Calculate the vector direction from the current pixel point to the preset feature point; Calculate the actual distance dist = length(direction); Take the smaller value of minimum_dist and dist, and update it to the minimum distance minimum_dist.

7. The design method of the urban population flow visualization system according to claim 1, characterized in that Calculate the comprehensive influence intensity of the pixel point by all preset feature points, and the expression is as follows: Among them, w i is the normalized net inflow of the i-th preset feature point, d i is the distance from the p pixel point to the i-th preset feature point p i , d min is the minimum distance minimum_dist from the current pixel point to all preset feature points, expNum is the attenuation exponent, and e is the base of the natural logarithm.

8. The design method of the urban population flow visualization system according to claim 1, characterized in that In the particle rendering system, perform RGBA texture encoding on the particle coordinates and decode and calculate the current position of the particle in the fragment shader of the GPU; including: Use the RG channels to correspond to the X coordinate and encode to establish the X coordinate; Use the BA channels to correspond to the Y coordinate and encode to establish the Y coordinate; Utilize texture to store and operate data. Combine the X coordinate and the Y coordinate into a texture. Two groups of such textures are alternately used as input or output. Through the particle update rendering pipeline, update the particle position for each frame.

9. The design method of the urban population flow visualization system according to claim 1, characterized in that Generate different numbers of particles according to density fields of different intensities, display the net inflow of urban population by the number of particles, and calculate and update the particle positions according to the velocity field to achieve the effect of population flow; including: Input the velocity field, density field, and particle coordinate texture into the particle update rendering pipeline, and output the particle coordinate texture updated based on the velocity field; Input the updated particle coordinate texture into the particle drawing rendering pipeline, and output the particle point drawing frame buffer; Input the particle point drawing frame buffer and transparency into the blending and overlay rendering pipeline, and output the trailing particle drawing frame buffer after blending and overlay.

10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by the processor, it implements the steps in the design method of the urban population flow visualization system described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Interactive ink simulation method based on fluid mechanics and GPU optimization rendering

    CN110322540A

  • GPU-based inverse distance interpolation rendering method and device, medium and equipment

    CN115937385A

  • GPU-driven interactive large-range three-dimensional flow field visualization method

    CN119693516A

  • Image rendering method and related apparatus

    US20230298252A1