A design method of urban population flow visualization system

By generating flow maps and density fields in the GPU, and combining Thiessen polygon meshes and Worley noise algorithms, the problem of real-time high-performance visualization of inter-city population flow is solved. It achieves real-time rendering of millions of particles and millisecond-level response latency, and is suitable for WebGL map integration.

CN120198565BActive Publication Date: 2025-12-12BEI JING YOU NUO KE JI GU FEN YOU XIAN GONG SI
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve high-performance visualization of intercity population flow, especially with large-scale data where it is difficult to generate flow maps and dynamic particle flow in real time. Furthermore, the number of particles is limited, update latency is high, and efficient integration with WebGL maps is challenging.

Method used

By generating flow maps in the GPU, simulating the flow field using electric dipoles, and combining Thiessen polygon meshes and Worley noise algorithms, the density field and particle positions are calculated in real time. RGBA texture encoding is used to achieve adaptive particle number updates and efficient updates.

Benefits of technology

It achieves real-time, high-performance visualization of inter-city population flow, supports real-time rendering of millions of particles, millisecond-level response latency, is suitable for WebGL map integration, and improves the visualization effect of urban planning and population research.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198565B_ABST
    Figure CN120198565B_ABST
Patent Text Reader

Abstract

The application relates to a design method of a city population flow visualization system, which comprises the following steps: inputting city coordinate sample point data into a newly created point texture, and inputting the city coordinate sample point data into a fragment shader of a GPU to obtain a velocity field of the city coordinate sample point; constructing a Voronoi polygon grid in which or around which a preset feature point exists in a unit grid in the GPU with the city coordinate sample point as the center; calculating the distance and comprehensive influence intensity of any pixel point in the fragment shader to all preset feature points to generate a density field with different intensities; performing RGBA texture encoding on particle coordinates in a particle rendering system, decoding and calculating the current position of the particle in the fragment shader; generating different numbers of particles according to the density field with different intensities, and showing the net inflow of the city population by the number of the particles; and updating the particle position according to the velocity field to realize a population flow effect. The application realizes high-performance visualization display of population flow between cities.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of three-dimensional visualization, and particularly relates to a design method of a city population flow visualization system. BACKGROUND

[0002] The population flow data is analyzed through the visualization system, the industrial characteristics and metropolitan expansion trend are revealed in combination with the urban agglomeration policy and planning, the decision maker is assisted to optimize the city service and management, and data support is provided for the urban agglomeration planning and industrial structure adjustment; meanwhile, the decision scientificity is improved through multi-dimensional (spatial, time, and policy) analysis. Generally, the migration data (migrating place, migrating destination, and migration number) is used, a migration path diagram or a heat map is generated by using a map component, and economic and industrial structure is analyzed in combination with a model algorithm.

[0003] The existing visualization technology mainly includes the following four kinds:

[0004] 1. Flow direction diagram

[0005] The applicable scenarios include: population migration, logistics transportation, information flow, and other directional data. The flow direction diagram has the advantages of intuitive display of flow direction and scale and auxiliary pattern analysis. However, the absolute value is ignored and needs to be combined with other forms for display, and large-scale data needs to be optimized in performance.

[0006] 2. Particle moving diagram / line diagram: the static line diagram is easy to overlap and messy; the dynamic particle moving diagram needs direction field data.

[0007] 3. 3D map (column diagram / heat map): 3D column map: taking counties as units, the column height represents the number of people flowing in, the core city is marked with a bubble, and dynamic display is realized in combination with a time axis. 3D heat map: the color gradient (blue→red) is used to represent the number density, and is suitable for macro trend analysis.

[0008] 4. CPU scheme of traditional particle system has certain limitations, and the implementation method is as follows: the particles are drawn through Canvas 2D, and the particle moving track is calculated on the CPU side. The particles are randomly generated, the particles are moved according to the wind field data, and part of the particles is periodically reset. The particle track effect is formed by gradually hiding and superimposing between the new and old frames. Since the calculation and update are performed on the CPU side, this method has the following disadvantages: the number of particles is limited (about 5k), the data update delay is high (about 2 seconds), and it is difficult to efficiently integrate with the WebGL map.

[0009] Compared with the prior art, the static connection diagram is simple but easy to overlap, the dynamic flow field diagram requires high data, and how to obtain the dynamic flow field diagram from simple inter-city inflow and outflow data becomes a key restriction; the 3D map (columnar / thermal) is more suitable for displaying the space-time distribution, but the clarity and information amount need to be balanced, and the flow direction and scale cannot be well displayed. Therefore, at present, there is an urgent need for a method for automatically and real-timely generating a flow direction diagram, automatically generating a scale weight, combining a particle dynamic flow technology, effectively displaying the flow direction and scale of inter-city flow, and using GPU parallel computing capability for particle flow to meet the large-scale particle operation demand. SUMMARY

[0010] The technical problem to be solved by the present application is to provide a design method of a city population flow visualization system for realizing high-performance visualization display of inter-city population flow.

[0011] The technical solution of the present application for solving the above technical problem is as follows:

[0012] In a first aspect, a design method of a city population flow visualization system is provided, comprising:

[0013] City coordinate sample point data is transmitted to a newly created point texture;

[0014] The point texture is input to a fragment shader of a GPU, a vector diagram is generated based on an electric dipole, and a velocity field based on city coordinate sample points is calculated;

[0015] A Thiessen polygon grid is constructed in the GPU with the city coordinate sample points as the center, and it is ensured that there is a preset feature point in each grid unit or within a preset distance;

[0016] In the density field rendering pipeline process, the distance of any pixel point in the fragment shader of the GPU to all preset feature points and the comprehensive influence intensity of the pixel point on all preset feature points are calculated, and a density field with different intensities is generated;

[0017] The particle coordinates are encoded in RGBA texture in a particle rendering system, and the particle current position is decoded and calculated in the fragment shader of the GPU;

[0018] Different numbers of particles are generated according to different intensities of the density field, the city population net inflow is displayed by the number of particles, the particle position is updated according to the velocity field calculation, and the population flow effect is realized.

[0019] Optionally, the city coordinate sample point data stored in the array is transmitted to the newly created point texture, comprising:

[0020] A point texture is created;

[0021] According to the interpolation sample point data amount n, the texture size is calculated;

[0022] The point texture type is set as Float type;

[0023] The texture internalformat is set as RGBA32F type;

[0024] The texture format is set as RGBA type;

[0025] Each city coordinate sample point corresponds to a pixel point of the point texture, and the city coordinate sample point is stored in the corresponding pixel point of the RGBA channel component;

[0026] The maximum value and the minimum value of the interpolation sample point are calculated and are passed to the GPU in the form of uniforms;

[0027] The point texture is updated.

[0028] Optionally, the input of the point texture into the GPU fragment shader based on the electric dipole generates a vector graph, and the method comprises the following steps of:

[0029] The point texture and the colorRampTexture are input into the GPU fragment shader;

[0030] A new scene, a camera, a Flowmap geometry, and a rendering material are constructed, a rendering queue is constructed, and the camera and the Flowmap geometry are added to the new scene;

[0031] The spatial range of the interpolation sample point is passed to the fragment shader in the form of uniforms;

[0032] The uv coordinate is multiplied by the spatial range of the interpolation sample point, and the actual coordinate value fragCoord of the p pixel point to be interpolated is calculated;

[0033] All preset feature points are traversed, and the electric dipole generates a vector graph.

[0034] Optionally, the traversal of all preset feature points comprises the following steps of:

[0035] According to the point texture size, the texture coordinate uvi of the ith preset feature point p i is calculated;

[0036] The spatial coordinate and the net inflow value of the ith preset feature point are calculated by sampling, and are represented as [x, y, z, q];

[0037] The distance from the ith preset feature point to the p pixel point is calculated;

[0038] It is judged whether the spatial distance is less than the distance threshold value, and if yes, the interpolation result E is calculated;

[0039] E is normalized and denoted as normalizedE, and the initial step is returned to traverse other preset feature points.

[0040] Optionally, the interpolation result E is calculated using the following calculation formula:

[0041]

[0042] wherein q is the net inflow, r is a vector from the position of the calculation pixel point to the preset feature point, |r| is the length of the vector r, and weight is the inverse square distance weight calculation value.

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

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

[0045] Calculate the vector direction of 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, the comprehensive influence strength of the pixel point on all preset feature points is calculated, and the expression is as follows:

[0049]

[0050] wherein 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 of the current pixel point to all preset feature points, expNum is the decay exponent, and e is the base of natural logarithm.

[0051] Optionally, the particle coordinates are encoded by RGBA texture, and the current position of the particle is calculated by decoding in the fragment shader of the GPU; including:

[0052] Encode to establish the X coordinate by taking the RG channel corresponding to the X coordinate;

[0053] Encode to establish the Y coordinate by taking the BA channel corresponding to the Y coordinate;

[0054] The texture storage and operation data are used, the X coordinate and the Y coordinate are combined into a texture, two sets of such textures are alternately used as input or output, the particle update rendering pipeline is updated, and the particle position is updated every frame. Optionally, different numbers of particles are generated according to different intensity density fields, the number of particles is used to show the net inflow of urban population, the particle position is updated according to the velocity field, and the population flow effect is realized; including:

[0055] The velocity field, the density field and the particle coordinate texture are input into the particle update rendering pipeline, and the particle coordinate texture is output based on the velocity field update;

[0056] The updated particle coordinate texture is input into the particle drawing rendering pipeline, and the particle point drawing frame buffer is output.

[0057] The particle point drawing frame buffer and the transparency are input into the mixing superposition rendering pipeline, and the mixed and superimposed trailing particle drawing frame buffer is output.

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

[0059] Advantages

[0060] 1. The method of the present application is based on urban coordinates and net inflow data, and generates a flow map in real time in the GPU, realizes real-time generation of flow maps at different times, simulates the use of an electric dipole method to simulate the generation of a flow field map, and realizes 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 particle distribution weight maps at different times in the GPU is realized to realize 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 influence, the exponential decay is used to make the influence range more natural, and the minimum_dist is modulated to make the boundary transition smoother:

[0062] 3. The particle position and wind field data are encoded into textures, and the high-precision texture encoding of the coordinate position is realized by using the high-efficiency processing of the GPU.

[0063] 4. The intelligentization of particle management is realized by simulating random behavior on the GPU without a native random function through a mathematical method.

[0064] 5. Double buffering exchange is used: avoid state read-write conflict, realize smooth animation.

[0065] Advantages of the additional aspects of the present application will be partially given in the following description, partially become obvious from the following description, or be learned by practice of the present application. BRIEF DESCRIPTION OF DRAWINGS

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

[0067] Figure 1 A flowchart of a design method of a city population flow visualization system according to an embodiment of the present application;

[0068] Figure 2 A flowchart of a design method of a city population flow visualization system according to an embodiment of the present application;

[0069] Figure 3 A flowchart of a design method of a city population flow visualization system according to an embodiment of the present application;

[0070] Figure 4 A flowchart of a design method of a city population flow visualization system according to an embodiment of the present application;

[0071] Figure 5 A flowchart of a design method of a city population flow visualization system according to an embodiment of the present application;

[0072] Figure 6 A flowchart of a design method of a city population flow visualization system according to an embodiment of the present application; DETAILED DESCRIPTION

[0073] The technical solutions of the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the present application.

[0074] Embodiment one

[0075] As shown in the following, a design method of a city population flow visualization system includes the following steps: Figure 1

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

[0077] ​Specifically, this step of the application is mainly data preprocessing, mainly including creating a point texture, and storing city coordinates and population net inflow in RGBA channels; the specific implementation process is as follows:

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

[0079] Step S1.2: calculating the texture size according to the data amount n of the interpolation sample points;

[0080] Specifically, the texture size is a square with equal length and width, and the width is a power of 2. Taking the square root of n and rounding up, an integer a is obtained, and then the texture width size is a square of a;

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

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

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

[0084] Step S1.6: each city coordinate sample point corresponds to a pixel point of the point texture, and the city coordinate sample point is stored in the RGBA channel component of the corresponding pixel point;

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

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

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

[0088] Step S2: inputting the point texture into the fragment shader of the GPU, generating a vector map based on an electric dipole, and obtaining a velocity field of the city coordinate sample points;

[0089] The principle of generating the velocity field in the application is to simulate the flow field by using an electric dipole model, wherein the electric dipole is composed of two point charges with opposite signs. By corresponding the population inflow to a negative charge and the population outflow to a positive charge, the electric field distribution is further controlled by the city location and the net inflow, and finally the velocity field is generated.

[0090] The point texture created by the above step S1 is transmitted to the GPU after completion, and the step of the present application is mainly implemented in the GPU shader; specifically including: an initialization stage and flow field calculation;

[0091] In the initialization stage, an accumulator is created for storing weight accumulation values and vector weighting values, and variables such as the position (v_Position) of the current pixel point in the actual space, the initial flow field (flowField), and the minimum distance are calculated;

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

[0093] traversing the point texture data,

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

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

[0096] when the distance (dist) of the current pixel point to the preset feature point is less than a threshold value (distanceThreshold):

[0097] using an inverse distance power weight;

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

[0099] (1)

[0100] applying a linear decay factor;

[0101] Using formula (2), the weight is applied to the direction vector field, and the weight weight is accumulated, and the result is stored in the corresponding variable of the accumulator;

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

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

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

[0105] 1) Data preparation: input the point texture generated by S1 and colorRampTexture, the latter being a gradient color band texture.

[0106] 2) Build a new scene 1, camera 1, Flowmap geometry (FlowmapGeometry), render material 1, build render queue 1, add camera 1, geometry 1 to scene 1; the Flowmap geometry is a plane geometry (PlaneGeometry)

[0107] 3) The rendering material uses a shader material, and parameters such as distanceThreshold, point texture size, pointsNum, dataResolution, originPoint are passed to the shader through uniforms; distanceThreshold is the search radius size (unit: meter), point texture size, 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 minimum point in space).

[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) In each rendering process, traverse all preset feature points;

[0110] a) According to the point texture size, the texture coordinates uvi of the ith preset feature point p i are calculated;

[0111] b) Sampling to obtain the specific data of the ith preset feature point, the four components [x, y, z, q] are respectively the spatial coordinates and net inflow value;

[0112] c) Calculate the distance from the ith preset feature point to the p pixel point;

[0113] d) Judge whether the spatial distance is less than the distance threshold (distanceThreshold), if yes, run the following formula to calculate the interpolation result E;

[0114] (2)

[0115] Where q is the net inflow of population; r is the vector from the calculated pixel point position to the preset feature point, i.e. direction; |r| is the modulus of vector r; weight is the inverse distance square weight calculation value;

[0116] e) Normalize E as normalizedE;

[0117] 6) Output the calculated vector diagram.

[0118] The draw mode of the flowchart rendering pipeline process uses a triangle draw mode; the camera uses an orthogonal 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 geometric body, with coordinates (0, 1, 0); the fragment shader outputs the final processing result to the frame buffer and then to the texture memory, in preparation for the next rendering pipeline.

[0119] In the velocity field generation process, the essence is to calculate the comprehensive influence of each pixel point on multiple dipoles, while paying attention to the following aspects:

[0120] - Distance attenuation: attenuation using inverse distance weighting;

[0121] - Directional influence: considering the direction of each pixel point;

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

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

[0124] Those skilled in the art can understand that there are also post-processing optimization processes (belonging to the prior art and not described here) such as normalized vector field and threshold control, to output the final flow field / velocity field (see Figure 2 ), and the velocity field is stored in the texture memory.

[0125] The population density field calculation of the embodiment is mainly realized by the Worley noise algorithm, mainly including: S3 space division and S4 comprehensive influence intensity calculation based on distributed preset feature points, and the specific implementation process is as follows:

[0126] Step S3: Taking the city coordinate sample point as the center, a Voronoi polygon grid is constructed in the GPU to ensure that there is a preset feature point in each grid element or within a preset distance;

[0127] Specifically, the space division is mainly a meshing process, taking the input city point as the center, a Voronoi polygon grid is constructed in the GPU, and there is a preset feature point in each element or nearby; Figure 3 is an example of data division Voronoi polygon grid, as shown in the figure, the boundary of the Voronoi polygon is relatively harsh, and cannot be well transitioned, and 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, the distance from the pixel point to all preset feature points and the comprehensive influence intensity of the pixel point on all preset feature points are calculated, and a density field with different intensities is generated.

[0129] In this embodiment, the preset feature points are selected based on the city point position;

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

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

[0132] In this embodiment, minimum_dist = 1.0;

[0133] Step S4.2: calculate the vector direction of 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 the above steps are completed, step S4.1 is returned, and the distance calculation of the next pixel point is continued until all preset feature points are calculated. In the process of calculating the comprehensive influence intensity of the pixel point on all preset feature points, this embodiment mainly uses exponential decay: exp(-dist * expNum), expNum is 2.5; combined with the preset feature point normalized net inflow w i and uses the power function of (1-minimum_dist) to modulate the edge transition;

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

[0138] (3)

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

[0140] In this embodiment

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

[0142] where q_i, min_q, max_q are the net inflow of each i city point, the minimum net inflow of all city points, and the maximum net inflow, respectively.

[0143] The physical meaning of this formula is:

[0144] 1. e (-di * expNum) : Exponential decay of distance, so that the influence decreases rapidly with increasing distance;

[0145] 2. (1-d min ) expNum : Boundary transition term, so that the area between the preset feature points has a smoother transition;

[0146] 3. w i : Normalized net inflow of the preset feature point;

[0147] 4. ∑: The influence of all preset feature points is superimposed.

[0148] The final sumWeight represents the comprehensive influence intensity of the pixel point on all preset feature points.

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

[0150] Adaptive weight system, add weight system, so that different preset feature points have different influence;

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

[0152] Edge transition optimization, through minimum_dist modulation, the boundary transition is smoother.

[0153] Step S5: In the particle rendering system, the particle coordinates are encoded in RGBA texture, and the texture is decoded in the fragment shader of the GPU to calculate the current position of the particle.

[0154] In a possible implementation, the particle coordinates are encoded in RGBA texture, and the texture is decoded in the fragment shader of the GPU to calculate the current position of the particle; including the following steps:

[0155] Step S5.1: Encode the X coordinate by corresponding the X coordinate to the RG channel;

[0156] Step S5.2: Encode the Y coordinate by corresponding the Y coordinate to the BA channel;

[0157] Step S5.3: Using texture to store and operate data, X coordinate and Y coordinate are combined into a texture, two sets of such textures are alternately used as input or output, and particle position is updated by particle update rendering pipeline.

[0158] In the implementation process, texture is used to store and operate data (such as particle position and wind field data), two textures are alternately used as input / output, and particle position is updated every frame.

[0159] Step S6: Different numbers of particles are generated according to different intensity density fields, the net inflow of urban population is shown by the number of particles, the particle position is updated according to the speed field, and the population flow effect is realized.

[0160] The particle behavior control is mainly realized by the following technologies:

[0161] In the fragment shader calculation, the current position of the particle is decoded from the texture to update the position.

[0162] Specifically, the speed field wind speed is obtained by querying the speed field texture, the position is updated, the polar distortion (longitude distance changes with latitude) is considered, and the position is re-encoded into the output texture.

[0163] Random reset of particles is generated by pseudo-random numbers: a random value is generated based on the particle position and the frame random seed by using the GLSL (OpenGL Shading Language) function; the reset probability is dynamically adjusted (particles in high-speed areas are reset more frequently to balance the particle density).

[0164] Finally, the particles are distributed according to the weight, mainly combined with the density map generated in step S4, different numbers of particles are generated according to different intensity density fields, the net inflow of urban population is shown by the number of particles, the particle position is updated according to the speed field, and the population flow effect is realized, and the final effect is as shown in Figure 5 .

[0165] In one specific example in the embodiment, the population flow visualization system is designed to be implemented in the particle rendering system (see the middle part of the Figure 6 technical flowchart), which is composed of three parts: particle update rendering pipeline, particle drawing rendering pipeline and mixed superposition rendering pipeline.

[0166] Particle update rendering pipeline: input speed field, density field, particle coordinate texture, and other setting parameters; output particle coordinate texture updated based on the speed field. The particle coordinate exists in the form of texture, and the random particle is initialized.

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

[0168] Blending and superimposition rendering pipeline: input particle point draw frame buffer, opacity, output blended and superimposed trail particle draw frame buffer.

[0169] Rendering pipeline process: vertex shader handles geometric transformation → rasterization generates fragments → fragment shader calculates pixel color → output to screen or frame buffer. Among them: vertex shader: process vertex data (coordinates, normals, UV, etc.) of 3D model, perform coordinate transformation. Primitive assembly & rasterization: assemble vertices into triangles (or other primitives), and convert into pixel fragments (fragments) on the screen. Fragment shader: calculate the final color of each fragment (texture sampling, lighting calculation, etc.), and handle transparency, depth test, etc. Output merging: blend fragment colors with frame buffer, finally generate 2D image or frame buffer.

[0170] Finally, pass the point texture and other parameters to the fragment shader in the form of uniforms.

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

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

[0173] Step S6.2: input updated particle coordinate texture into particle draw rendering pipeline, output particle point draw frame buffer;

[0174] Step S6.3: input particle point draw frame buffer, opacity into blending and superimposition rendering pipeline, output blended and superimposed trail particle draw frame buffer.

[0175] In the GPU acceleration process, it can be understood that those skilled in the art can perform adaptive resetting, balanced density and filtering speed threshold to realize dynamic optimization, and the above particle position, particle point and trail particle are saved in texture memory during entering the next rendering pipeline;

[0176] Specifically, in the filtering speed threshold process, for particles with too small speed, no display is performed on the canvas, thereby reducing the distribution of scattered points in the region caused by too small speed, by setting u_minDiscardSpeed, when the speed is less than this value, the point is discarded.

[0177] Further, the following operations can also be performed to realize visual enhancement:

[0178] Rendered in Point form, color ramp mapping is implemented according to the wind speed mapping to colorRampTexture color band;

[0179] Each frame draws particles into texture memory, superimposes slightly faded history textures to achieve trajectory rendering;

[0180] Manual bilinear interpolation of wind field data, anti-aliasing processing can effectively avoid block artifacts caused by texture scaling;

[0181] For different national boundaries, provincial boundaries, by inputting the corresponding geojson data, the boundary filtering is realized, and the particle display is completed in the boundary to fuse the geographical boundary.

[0182] In the terminal display rendering pipeline process, the present example is based on the particle rendering system output result, and in the terminal rendering resource construction step: constructing a scene, a camera, a geometric body, a rendering material, constructing a rendering queue, adding the camera and the geometric body to the scene, and outputting the final result to the terminal page.

[0183] The method design system has the following performance advantages:

[0184] - Real-time rendering of millions of particles: thanks to the GPU parallel processing capability, the number of particles of the present solution is much larger than that of the CPU solution.

[0185] - Millisecond response delay: data update and view transformation have no significant delay.

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

[0187] The present method design system breaks through the limitations of traditional CPU solutions and realizes real-time rendering of high-resolution and large-scale particles, providing an efficient and intuitive solution for urban population flow visualization. The system performance is significantly improved compared with traditional solutions, and can be widely applied in the fields of urban planning and population research.

[0188] Embodiment two

[0189] The present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, realizes the steps in the design method of the urban population flow visualization system of the first aspect.

[0190] Based on such understanding, all or part of the processes in the above-mentioned embodiment methods are implemented, and the computer program can also instruct the relevant hardware to complete. The computer program can be stored in a computer readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable medium can include any entity or system, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code. 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 electric carrier signal and telecommunication signal.

[0191] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

[0192] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited to this, any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A design method of a city population flow visualization system, characterized by, The application relates to a method for rendering a population flow effect in a city, comprising the following steps: transferring city coordinate sample point data to a newly created point texture; inputting the point texture into a fragment shader of a GPU to generate a vector map based on an electric dipole, and calculating a velocity field based on the city coordinate sample point; constructing a Thiessen polygon grid in the GPU with the city coordinate sample point as the center, and ensuring that each grid unit contains a preset feature point or is within a preset distance from the preset feature point; in the process of density field rendering pipeline, calculating the distance of any pixel point in the fragment shader of the GPU to all preset feature points and the comprehensive influence intensity of the pixel point on all preset feature points, and generating a density field with different intensities; encoding particle coordinates in RGBA texture in a 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 field with different intensities, and showing the net population inflow of the city by the number of particles, and updating the position of the particle according to the velocity field to realize the population flow effect; calculating the comprehensive influence intensity of the pixel point on all preset feature points, and the expression is as follows: wherein w i is the normalized net inflow of the i-th preset feature point, d i is the distance from the p-th 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 an attenuation exponent, and e is the base of the natural logarithm.

2. The method of designing a system for visualizing urban population flows according to claim 1, characterized in that, the step of transferring the city coordinate sample point data stored in the array to the newly created point texture comprises the following steps: creating a point texture; calculating the texture size according to the amount n of interpolation sample points; setting the point texture type as Float type; setting the texture internalformat as RGBA32F type; setting the texture format as RGBA type; each city coordinate sample point corresponds to a pixel point of the point texture, and the city coordinate sample point is stored in the RGBA channel component of the corresponding pixel point; 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 method of designing a system for visualizing urban population flows according to claim 2, characterized in that, the step of inputting the point texture into the fragment shader of the GPU to generate a vector map based on an electric dipole comprises the following steps: inputting the point texture and colorRampTexture into the fragment shader of the GPU; constructing a new scene, a camera, a Flowmap geometry, a rendering material, and a rendering queue, and adding the camera and the 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 and 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 to generate a vector map based on an electric dipole.

4. The method of designing a system for visualizing urban population flows according to claim 3, characterized in that, the step of traversing all preset feature points comprises the following steps: According to the dot texture size, the texture coordinate uvi of the i-th preset feature point p is obtained. i of the i-th preset feature point p sampling to obtain the spatial coordinates and net inflow value of the ith preset feature point, which is expressed as [x, y, z, q]; obtaining the distance from the ith preset feature point to the p pixel point; judging whether the spatial distance is smaller than the distance threshold value, and if yes, calculating an interpolation result E; normalizing E and recording it as normalizedE, and returning to the initial step to traverse other preset feature points.

5. The method of designing a system for visualizing urban population flows according to claim 4, characterized in that, the step of calculating the interpolation result E adopts the following calculation formula: wherein q is the net inflow, r is a vector from the calculated pixel point position to the preset feature point, |r| is the length of the vector r, and weight is a reverse distance square weight calculation value.

6. The method of designing a system for visualizing urban population flows according to claim 1, wherein, The distance from any pixel in the fragment shader of the GPU to all preset feature points is calculated during the density field rendering pipeline, including: Initializing the minimum distance minimum_dist for any pixel; Calculating the vector direction from the current pixel to the preset feature point; Calculating the actual distance dist = length(direction); Taking the smaller value of minimum_dist and dist, and updating it to the minimum distance minimum_dist.

7. The method of designing a system for visualizing urban population flows according to claim 1, wherein, The particle coordinates are encoded in RGBA texture in the particle rendering system, and the current position of the particle is calculated by decoding in the fragment shader of the GPU, including: Encoding the X coordinate by using the RG channel to correspond to the X coordinate; Encoding the Y coordinate by using the BA channel to correspond to the Y coordinate; Using texture storage and operation data, the X coordinate and the Y coordinate are combined into a texture, and two sets of such textures are alternately used as input or output, through the particle update rendering pipeline, the particle position is updated every frame.

8. The method of designing a system for visualizing urban population flows according to claim 1, wherein, Different numbers of particles are generated according to different intensities of the density field, and the population net inflow of the city is displayed by the number of particles, the particle position is updated according to the velocity field, and the population flow effect is realized; including: Inputting the velocity field, the density field and the particle coordinate texture into the particle update rendering pipeline, and outputting the particle coordinate texture updated based on the velocity field; Inputting the updated particle coordinate texture into the particle drawing rendering pipeline, and outputting the particle point drawing frame buffer; Inputting the particle point drawing frame buffer and the transparency into the mixing superposition rendering pipeline, and outputting the mixed and superimposed trailing particle drawing frame buffer.

9. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions are executed by the processor to realize the steps in the design method of the city population flow visualization system in any one of claims 1-8.

Citation Information

Patent Citations

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

    CN115937385A