A heat map generation method, related device, equipment and storage medium

CN122929008APending Publication Date: 2026-10-16TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510428400.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0004]本申请实施例提供了一种热力图的生成法、相关装置、设备以及存储介质,解决了现有技术中热力值计算不精确、显示性能差及视觉效果不自然的问题

Benefits of technology

[0021] This application provides a method for generating a heatmap. First, it acquires geographic information containing multiple target points, their influence radii, and factors, and constructs an initial circular region based on the target point locations. Then, it identifies and extracts overlapping initial regions to form connected regions, while retaining non-overlapping regions separately. Next, for each connected region and independent region, it calculates the grayscale value set of its internal center point, boundary points, and overlapping parts, where the grayscale values ​​are dynamically weighted by the influence radius, factors, and preset weights. Finally, based on the grayscale value set of all regions, it uses vertex coloring of the modeling region and interpolation techniques to achieve color gradient diffusion filling, generating a smooth and continuous heatmap. This application effectively avoids noise and redundant calculation problems caused by fixed grid resolution through dynamic division of the target point influence region and connected region processing. Compared to traditional methods, it significantly reduces computational complexity, especially in data-dense areas where it achieves parallel processing capabilities through overlapping region decomposition. Furthermore, through dual weight allocation of region boundary points (distance decay is used for non-overlapping edges, and multi-source influence factors are fused for overlapping edges), it overcomes the defects of color abrupt changes and excessive smoothing, making the heatmap boundary transition more consistent with the real data distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122929008A_ABST
    Figure CN122929008A_ABST
Patent Text Reader

Abstract

The application discloses a heat map generation method, which belongs to the field of Internet technology. The method comprises the following steps: constructing an initial circular area by acquiring a target point coordinate, an influence radius and an influence factor, identifying and extracting an overlapping area to form a connected area, and calculating a gray value set of a center point, a boundary point and an overlapping part for the independent area and the overlapping area respectively, wherein the gray value realizes fine calculation in combination with the influence radius, the factor and a dynamic weight, and finally color diffusion filling is completed through modeling area vertex coloring and interpolation technology. The method reduces the complexity to a linear level through overlapping area decomposition, eliminates color mutation by using double weight distribution of boundary points (single source attenuation of non-overlapping edges and multi-source weighted fusion of overlapping edges), makes the heat map boundary transition natural and fit the data distribution, ensures the visual accuracy, significantly improves the calculation efficiency, and is suitable for high-precision heat mapping requirements in a dynamic interactive scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a method for generating heatmaps, related apparatus, equipment, and storage medium. Background Technology

[0002] With the development of information technology, heatmaps, as a visualization tool that intuitively displays the distribution density of spatial data, have been widely used in fields such as urban planning, traffic flow analysis, environmental monitoring, and business decision support. Their core value lies in quickly revealing data central trends, outliers, and correlations through color gradients and density overlays, providing decision-makers with quantitative evidence.

[0003] In existing technologies, heatmap generation typically relies on two main approaches: one is a grid-based statistical aggregation method, which divides the space into fixed-size grids and calculates the number of data points or a weighted average within each grid to generate heatmap values; the other is a non-parametric method based on kernel density estimation (KDE), which uses a Gaussian kernel function to apply weighted diffusion to each data point to simulate a continuous density distribution. The former, due to its fixed grid resolution, is prone to noise interference in sparse areas or computational redundancy in dense areas due to grid intersections; the latter, while generating smooth curves, suffers from computational complexity that increases exponentially with the amount of data and is difficult to adapt to dynamic display requirements (such as real-time rendering during map zooming). Furthermore, existing methods lack fine-grained control over heatmap boundary processing, often resulting in color abrupt changes or over-smoothing, leading to discrepancies between visual representation and the actual data distribution. Therefore, an effective method is urgently needed to address these issues. Summary of the Invention

[0004] This application provides a method for generating heat maps, related devices, equipment, and storage media, which solves the problems of inaccurate heat value calculation, poor display performance, and unnatural visual effects in the prior art.

[0005] This application provides a method for generating a heatmap, comprising:

[0006] Obtain a regional map and K coordinate data, K influence radii, and K influence factors corresponding to K target points in the regional map. The influence radii and influence factors are related to the object density of the target points.

[0007] Based on the K coordinate data corresponding to the K target points and the K influence radii, K initial regions are determined, where the initial region is the region centered on the target point and with the influence radius as the radius, and K > 1;

[0008] Extract the intersecting initial regions from the K initial regions to obtain N connected regions. Each connected region is obtained by the intersection of the first and second initial regions. The connected region includes the first region, the second region, and the intersecting region. The first region is the first initial region minus the intersecting region, and the second region is the second initial region minus the intersecting region. K > N ≥ 1.

[0009] Based on K influence radii and K influence factors, calculate N sets of gray values ​​corresponding to N connected regions, and calculate M sets of gray values ​​corresponding to M initial regions. The gray value sets include the gray values ​​of the center point of the region and the gray values ​​of the region boundary. The M initial regions are the initial regions that do not intersect with the K initial regions, where K > M ≥ 1.

[0010] Based on N sets of gray values ​​and M sets of gray values, K initial regions are filled with decreasing color diffusion to generate a heatmap.

[0011] Another aspect of this application provides an apparatus for generating a heat map, comprising:

[0012] The acquisition module is used to acquire a regional map and K coordinate data, K influence radii, and K influence factors corresponding to K target points in the regional map. The influence radii and influence factors are related to the object density of the target points.

[0013] The determination module is used to determine K initial regions based on K coordinate data corresponding to K target points and K influence radii. The initial region is a region centered on the target point and with the influence radius as the radius, where K > 1.

[0014] The extraction module is used to extract intersecting initial regions from K initial regions to obtain N connected regions. The connected regions are obtained by the intersection of the first initial region and the second initial region. The connected regions include the first region, the second region and the intersecting region. The first region is the first initial region minus the intersecting region, and the second region is the second initial region minus the intersecting region. K > N ≥ 1.

[0015] The calculation module is used to calculate the N gray value sets corresponding to N connected regions based on K influence radii and K influence factors, and to calculate the M gray value sets corresponding to M initial regions. The gray value sets include the gray value of the center point of the region and the gray value of the region boundary. The M initial regions are the initial regions that do not intersect with the K initial regions, where K > M ≥ 1.

[0016] The generation module is used to fill K initial regions with decreasing color diffusion based on N sets of gray values ​​and M sets of gray values ​​to generate a heat map.

[0017] In another aspect, this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the methods described above.

[0018] Another aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the methods described above.

[0019] Another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the methods described above.

[0020] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0021] This application provides a method for generating a heatmap. First, it acquires geographic information containing multiple target points, their influence radii, and factors, and constructs an initial circular region based on the target point locations. Then, it identifies and extracts overlapping initial regions to form connected regions, while retaining non-overlapping regions separately. Next, for each connected region and independent region, it calculates the grayscale value set of its internal center point, boundary points, and overlapping parts, where the grayscale values ​​are dynamically weighted by the influence radius, factors, and preset weights. Finally, based on the grayscale value set of all regions, it uses vertex coloring of the modeling region and interpolation techniques to achieve color gradient diffusion filling, generating a smooth and continuous heatmap. This application effectively avoids noise and redundant calculation problems caused by fixed grid resolution through dynamic division of the target point influence region and connected region processing. Compared to traditional methods, it significantly reduces computational complexity, especially in data-dense areas where it achieves parallel processing capabilities through overlapping region decomposition. Furthermore, through dual weight allocation of region boundary points (distance decay is used for non-overlapping edges, and multi-source influence factors are fused for overlapping edges), it overcomes the defects of color abrupt changes and excessive smoothing, making the heatmap boundary transition more consistent with the real data distribution. Attached Figure Description

[0022] Figure 1 A schematic diagram illustrating the application of the method provided in this application to a heatmap scenario of pedestrian flow distribution in a map;

[0023] Figure 2 A schematic diagram illustrating the application of the method provided in this application to a heat map scenario for environmental monitoring and disaster early warning;

[0024] Figure 3 A scenario architecture diagram for applying the method provided in this application to a heatmap of pedestrian flow distribution in a map;

[0025] Figure 4A flowchart illustrating the method for generating a heat map as provided in this application embodiment;

[0026] Figure 5 A schematic diagram of the initial region provided in the embodiments of this application;

[0027] Figure 6 A schematic diagram of the connected regions provided in the embodiments of this application;

[0028] Figure 7 This is a schematic diagram of the grayscale values ​​of the region provided in the embodiments of this application;

[0029] Figure 8 A schematic diagram of sampling points provided in the embodiments of this application;

[0030] Figure 9 A schematic diagram of the thinning process provided in an embodiment of this application;

[0031] Figure 10 A schematic diagram illustrating the determination of target points provided in an embodiment of this application;

[0032] Figure 11 A schematic diagram of the initial region grayscale values ​​provided in the embodiments of this application;

[0033] Figure 12 This is a schematic diagram of the grayscale values ​​of the connected regions provided in an embodiment of this application;

[0034] Figure 13 A schematic diagram of the modeling process provided in the embodiments of this application;

[0035] Figure 14 A schematic diagram of the rendering process provided in an embodiment of this application;

[0036] Figure 15 This is a structural diagram of the heat map generation apparatus provided in an embodiment of this application. Detailed Implementation

[0037] This application provides a method for generating heatmaps. By dynamically dividing the grayscale values ​​of the target point's influence area and overlapping areas for refined calculation, it achieves the effects of reduced computational complexity, effective suppression of noise interference, and smooth transition of heatmap boundaries, significantly improving the efficiency and visual accuracy of heatmap generation.

[0038] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0040] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0041] Before introducing the specific methods of this application, we will first provide an illustrative example of the application scenarios for the heatmap generation method in this application. It should be understood that the following application scenarios are merely examples and are not limited to these.

[0042] Please see Figure 1 The heatmap generation method provided in this application embodiment can be applied to heatmap scenarios of pedestrian flow distribution in maps. For example... Figure 1 In (A), after the user opens the map app, map tile images are displayed on the terminal. Map tile images refer to square raster images of a map within a certain area, cut into rows and columns according to a specific size and format, zoom level, or scale. These square raster images are called map tile images. Typically, the number of map tile images varies depending on the map zoom level, generally increasing exponentially with the zoom level. Higher zoom levels result in increased physical size and detail of the displayed map. When the user clicks the "Layer" control 111, as shown... Figure 1 As shown in (B), in the layer selection interface, the user can click the "Heatmap" control 121 to enter... Figure 1 The heat map interface showing the distribution of pedestrian traffic is shown in (C).

[0043] When the user clicks the "Heatmap" control 121, the system constructs a heatmap layer based on pre-generated K target point data (such as pedestrian monitoring points in locations A, B, and C) and their dynamic parameters (influence radius 5-15 meters, influence factor 1.0-4.5), using the layered processing flow provided in this application: First, the L original sampling points (such as pedestrian coordinates collected by each camera) are subjected to equidistant thinning processing, dividing the dense area into Q thinning regions (such as a 500m × 500m grid), and K target points are generated through mean aggregation; then, the spatial overlap relationship between the target points is detected, for example, the area around location A... The initial areas of the commercial district and the subway station exit overlap. The system decomposes these areas into independent regions (such as pedestrian streets and the station interior) and shared overlapping areas (entrance / exit buffer zones). For each sub-region, a refined grayscale value calculation is performed—the center point uses a 70% influence factor weighted instantaneous pedestrian density, while boundary points fuse multi-source data (such as pedestrian flow trends in adjacent areas) using a 30% distance attenuation coefficient. For the overlapping area boundaries, a dual-weight fusion algorithm is further introduced (e.g., 70% weight for pedestrian flow in the main passage direction and 30% for secondary passage directions), ultimately generating a dynamic dataset containing over 20,000 grayscale values. During the rendering phase, the system maps grayscale values ​​to color gradients (red > 3 people / ㎡, yellow 1.5-3 people / ㎡, green < 1.5 people / ㎡) based on vertex shading technology for the modeled region. A smooth transition is achieved through color diffusion and decreasing fill, effectively avoiding noise misjudgments caused by traditional mesh methods in narrow passages (such as the pedestrian street in area F). Thanks to the linear complexity processing after connected component decomposition, this method still maintains a heatmap update within 1.2 seconds even with 2000+ target point data, allowing users to monitor peak traffic in real time (such as the dynamic expansion of the red area in the B subway station during the morning rush hour). At the same time, through thinning preprocessing and parallel computing optimization, it ensures efficient tile loading when scaling the map.

[0044] Please see Figure 2 The heatmap generation method provided in this application can also be applied to heatmap scenarios for environmental monitoring and disaster early warning. The method of this application, in situations such as... Figure 2 The environmental monitoring and disaster early warning scenario shown demonstrates dynamic modeling and precise early warning of pollutant diffusion. When users... Figure 2 After clicking the "Environmental Heat Map" control 211 on the industrial park map interface (A), the system generates a heat map layer based on 15 monitoring stations (each equipped with a PM2.5 / NOx sensor) deployed in the industrial plant AI and their dynamic parameters, through the following process: Each plant monitoring station uploads pollutant concentration data every hour (e.g., the PM2.5 concentration of industrial plant B is 85 μg / m³). 3 The system uses meteorological data (wind speed 3.2 m / s, wind direction southeast) and geographic coordinates to dynamically adjust the radius of influence based on standard thresholds in air pollution prevention and control standards—when the concentration exceeds the limit (e.g., PM2.5 > 75 μg / m³).3 When the influence radius is expanded from the default 1.5 km to 3 km, the influence factor is calculated using a Gaussian diffusion model. After detecting an overlap in the initial monitoring areas of industrial plants B and F (distance 800 meters < sum of influence radii 1.5 + 1.8 = 3.3 km), the system decomposes it into independent areas, shared overlapping areas, and special control areas, such as the non-overlapping area north of plant B, the buffer zone between plants B and F, and sensitive areas adjacent to residential areas. During the grayscale value calculation stage, independent areas use a center-point weighted method (weight 70% × measured concentration + 30% × historical average), while shared overlapping areas execute a multi-source fusion algorithm, with the weight of plants in the prevailing wind direction at 40%, secondary wind direction at 30%, low-lying terrain at 20%, and building density at 10%. Boundary points are dynamically decayed using an exponential decay formula. In the rendering stage, the system uses the Vulkan API to achieve GPU-accelerated rendering, generating a four-color heatmap, and... Figure 2 In section (B), black dots mark "hotspots" where concentrations exceed standards, triggering a three-tiered early warning mechanism. The dynamic update module refreshes the heatmap every 5 minutes, successfully predicting concentration increases during sandstorms. The historical data analysis module generates pollution diffusion path maps, optimizing industrial layout planning and providing a visual solution for intelligent industrial pollution control.

[0045] Please see Figure 3 , Figure 3 This illustration shows a heatmap scenario architecture diagram of the heatmap generation method provided in this application, applied to the distribution of pedestrian traffic in a map. The scenario includes a user terminal 310, a network 320, a server 330, and a database 340.

[0046] Terminal 310 includes a human-computer interaction screen, a processor, and a memory. The human-computer interaction screen displays a map interface 3101, a layer selection interface 3102, and a heatmap interface 3103; it also provides a human-computer interaction interface to receive user interaction operations on layer controls in the map interface 3101. The processor generates interaction instructions in response to the aforementioned human-computer interaction operations and sends these instructions to a server. The terminal 310 involved in this application includes, but is not limited to, mobile phones, tablets, laptops, desktop computers, intelligent voice interaction devices, virtual reality devices, smart home appliances, vehicle terminals, and aircraft.

[0047] Run client 311 on terminal 310. Taking a map client as an example, client 311 is deployed on terminal 310. Client 311 can run on terminal 310 through a browser, or as a standalone application (APP) or mini-program, etc.

[0048] Network 320 uses standard communication technologies and / or protocols, typically the Internet, but can also be any network, including but not limited to Bluetooth, local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, private network, or any combination of virtual private network. In some embodiments, custom or dedicated data communication technologies may be used to replace or supplement the aforementioned data communication technologies.

[0049] Server 330 includes a processor. The server 330 involved in this application can be a standalone physical server, a server cluster or distributed system consisting of at least one physical server, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence (AI) platforms.

[0050] Database 340 is used to store information such as map data.

[0051] After the user opens the map app, a map interface 3101 is displayed on the terminal 310, showing a regional map. Next, the user clicks the "Layer" control 3111 on the map interface, and then selects the "Heatmap" control 3112 in the layer selection interface 3102. As in step S301, the terminal 310 generates a heatmap request command based on the user's selection and sends the heatmap request command to the server 330 via network 320.

[0052] As in step S302, the server 330 obtains the regional map and the K coordinate data, K influence radii and K influence factors corresponding to the K target points in the regional map. The influence radii and influence factors are related to the object density of the target points.

[0053] As in step S303, the server 330 determines K initial regions based on the K coordinate data corresponding to the K target points and the K influence radii. The initial region is a region centered on the target point and with the influence radius as its radius, where K > 1.

[0054] As in step S304, the server 330 extracts the intersecting initial regions from the K initial regions to obtain N connected regions. Each connected region is obtained by the intersection of the first and second initial regions. The connected region includes the first region, the second region, and the intersecting region. The first region is the first initial region minus the intersecting region, and the second region is the second initial region minus the intersecting region. K > N ≥ 1.

[0055] As in step S305, the server 330 calculates the N grayscale value sets corresponding to the N connected regions based on the K influence radii and K influence factors, and calculates the M grayscale value sets corresponding to the M initial regions. The grayscale value sets include the grayscale values ​​of the center points of the regions and the grayscale values ​​of the region boundaries. The M initial regions are the initial regions that do not intersect with the K initial regions, where K > M ≥ 1.

[0056] As in step S306, the server 330 fills the K initial regions with decreasing color diffusion based on the N grayscale value sets and the M grayscale value sets to generate a heat map.

[0057] As in step S307, the server 330 sends the heat map to the terminal 310 via the network 320.

[0058] Terminal 310 displays the heat map interface 3103.

[0059] The method provided in this application overcomes the defects of color abruptness and excessive smoothing by using a dual weight allocation of regional boundary points (distance attenuation is used for non-overlapping edges, and multi-source influence factors are fused for overlapping edges), making the transition of heatmap boundaries more consistent with the actual data distribution.

[0060] Please see Figure 4 , Figure 4 A flowchart of a method for generating a heatmap is shown. It should be noted that the heatmap generation method provided in this application can be applied to a server, and this application does not impose any limitations. The method includes:

[0061] S410. Obtain the regional map and the K coordinate data, K influence radii, and K influence factors corresponding to the K target points in the regional map.

[0062] Among them, the influence radius and influence factor are related to the object density of the target point.

[0063] It is understandable that a regional map refers to the basic carrier of geospatial data, and its core function is to provide precise coordinate system positioning and spatial boundary constraints for target points and their areas of influence. This type of map can be a local area of ​​an electronic map, for example... Figure 1(A) shows a vector map used to locate subway stations in an urban traffic management system. The coordinates (latitude, longitude, or Cartesian coordinates) of target points (such as subway stations) must be strictly aligned with the map's projected coordinate system (such as WGS84) to ensure that the influence radius (such as 500 meters) is correctly mapped to the actual road network, thus defining the initial area. Furthermore, regional maps may also be industry-specific layers, such as drawings used to mark service counter locations in a shopping mall's interior floor plan. These must include details of obstacles such as shelves and pillars to prevent the initial area from penetrating impassable areas; or real-time 3D semantic maps generated by LiDAR in autonomous driving scenarios, where the coordinates of target points (such as obstacles) must be aligned with the dynamically changing 3D space, and the influence radius is adjusted in real-time based on the vehicle's braking distance. Regardless of the form, regional maps must ensure coordinate system consistency, spatial resolution adaptability, and topological integrity. For example, in a heatmap, if two target points are separated by a river, even if their coordinates are adjacent, the areal features (river boundaries) of the regional map will prevent the merging of connected areas, thus ensuring the spatial logic accuracy of the heatmap. The map display method for this area can be as follows: The terminal sends a map display request for the target area to the server. This request may include the map zoom level and the coordinates of the center point of the screen on the terminal. The server determines the target map tile images required to display the target area map based on the zoom level and the center point coordinates in the map display request, and sends the target map tile images to the terminal. The terminal stitches the target tile images sequentially to obtain and display the area map. Generally, there is a mapping relationship between the map zoom level and the map scale. The terminal can determine the map zoom level based on the scale of the map being displayed. One zoom level corresponds to one set of map tile images. Therefore, when the terminal determines the target map tile images required to display the target geographic area map based on the zoom level and the center point coordinates of the screen, it first obtains the set of map tile images corresponding to the zoom level. This set of map tile images may include multiple map tile images, and each map tile image may correspond to a position coordinate in the world coordinate system.

[0064] Target points are physical locations with density attributes (such as pedestrian monitoring points). In map data, statistical data is given as a series of sampled coordinate points. Each sample point (coordinate point) contains the following information: location (e.g., latitude and longitude), radius of influence r, and influence factor. The higher the zoom level, the greater the physical size and detail of the displayed map, and the more sample points it contains. To improve map data display speed, the number of sample points at different zoom levels is thinned to obtain target points. For example, assuming there are L sample points at the current zoom level, these L sample points are thinned to obtain K target points.

[0065] The object density of a target point indicates the concentration or distribution density of objects within a specific range around that target point, reflecting the spatial activity or resource occupancy intensity of that area. For example, in a shopping mall heat map, the density of a service counter might be characterized by a combination of indicators such as the number of people queuing and the frequency of self-checkout machine usage; in an urban traffic heat map, the density of a subway station might be calculated from data such as the density of people entering and exiting the station and the speed of vehicles on surrounding roads. Higher density indicates more interactive behavior or physical entities per unit area, requiring corresponding adjustments to the range and intensity of influence on the heat map.

[0066] The radius of influence characterizes the spatial extent of data influence, while the influence factor reflects the importance weight of the target point. Both the radius of influence and the influence factor are related to the density of objects at the target point. Preferably, density is positively correlated with the radius of influence; dense areas require a larger radius of influence to cover more related objects. When the density of entities represented by the target point (such as pedestrian traffic, pollution sources, etc.) increases, the system automatically expands the radius of influence of that target point and enhances its influence factor, thereby creating a more significant diffusion effect on the heatmap. For example, if the pedestrian density in a certain area exceeds a threshold (e.g., 2 people per square meter), the radius of influence of the target point increases linearly from a base value (e.g., 5 meters) to a maximum value (e.g., 10 meters); conversely, in sparse areas, the influence range is reduced and the weight is decreased to avoid noise interference. Specifically:

[0067] First, define a statistical window (e.g., a 10m x 10m grid) centered on the target point. Denote the number of objects within the statistical window (e.g., pedestrian traffic, vehicle count) as C, and calculate the standardized density value d.

[0068] Among them, C all The maximum number of objects at all target points. Next, calculate the influence radius r:

[0069] Where, r base The base radius, for example, the radius of the inscribed circle in a 10m x 10m grid of a statistical window. d is the radius increment coefficient. threshold This is the density threshold (e.g., 0.5). When d < d threshold When d > d, the radius of influence remains at the base value; when d > d threshold When the density increases linearly, the radius increases linearly.

[0070] Then, calculate the impact factor f:

[0071] f = f base ·e β·d , where f baseThe basic factor can be calculated experimentally, for example, 1.5, where β is the density sensitivity coefficient. For example, when β = 0.5 and d = 0.8, f = 1.5·e 1.5·0.8 ≈4.95 indicates that the influence factor of high-density areas is significantly amplified.

[0072] For example, in Figure 1 In (A), the density of the area is calculated by counting the number of people in real time using cameras. If the number of people in area E reaches 80% of the maximum capacity of the area (d = 0.8) at a certain time, its influence radius expands from the default 3 meters to 3 + 0.5 × (0.8 - 0.5) = 3.15 meters, and the influence factor increases from 1.0 to 1.0 × e^(1.2 × 0.8) ≈ 2.46. Figure 1 (C) in the heat map makes the color diffusion range of this area wider and the color gradient steeper, intuitively reflecting the heat aggregation effect of high-density crowds.

[0073] Real-time data collection of target points can be achieved through IoT device networking (such as 5G base stations + Bluetooth beacons), and the geographical location of target points can be retrieved using a spatial index structure. The dynamic parameter adjustment mechanism relies on density threshold algorithms (e.g., when the number of pedestrians entering a target point within a 50-meter radius exceeds 300 within 15 minutes, the influence radius expands to 1.5 times) and machine learning models (e.g., LSTM predicts the density trend for the next hour) to ensure the scientific nature of parameter settings.

[0074] S420. Based on the K coordinate data corresponding to the K target points and the K influence radii, determine the K initial regions.

[0075] The initial region is the region centered on the target point and with the radius of influence as its radius, where K ≥ 1.

[0076] It is understandable that the initial region is a two-dimensional circular space or a three-dimensional spherical space centered on the target point. For example, the region can be divided using a planar scanning algorithm, and adjacent target points can be quickly located using a grid index structure.

[0077] For easier understanding, please refer to Figure 5 Suppose there are 5 target points: A, B, C, D, and E. Using these 5 target points as centers and the influence radius corresponding to each target point (the influence radius of target point A is 6m, the influence radius of target point B is 10m, the influence radius of target point C is 12m, the influence radius of target point D is 14m, and the influence radius of target point E is 18m), 5 initial regions are determined.

[0078] S430. Extract the intersecting initial regions from the K initial regions to obtain N connected regions.

[0079] The connected region is obtained by the intersection of the first initial region and the second initial region in the initial region. The connected region includes the first region, the second region and the intersecting region. The first region is the first initial region minus the intersecting region, and the second region is the second initial region minus the intersecting region. K > N ≥ 1.

[0080] It is understandable that there are two possible positions between the initial regions: intersecting (e.g., ... Figure 5 The initial regions of target point B and target point C in the image are not intersecting (e.g., ...). Figure 5 The initial region of target point E is not tangent to or intersects with the region of any other target point, and the tangent positions of the initial regions of target point A and target point D are also considered.

[0081] A connected region refers to the area encompassed by intersecting initial regions, such as... Figure 6 As shown, the connected region is obtained by the intersection of the initial region of target point B and the initial region of target point C. The intersecting region is decomposed into independent sub-regions (i.e., the first region and the second region) and a shared overlapping region (i.e., the intersecting region).

[0082] S440. Based on the K influence radii and K influence factors, calculate the N gray value sets corresponding to the N connected regions, and calculate the M gray value sets corresponding to the M initial regions.

[0083] The gray value set includes the gray value of the center point of the region and the gray value of the region boundary. The M initial regions are the initial regions that do not intersect with the K initial regions, where K > M ≥ 1.

[0084] It is understandable that for a connected region, the first region, the second region, and the third region within the connected region each correspond to a set of gray values.

[0085] Please see Figure 7 In (A), for the first region within the connected region, the first region corresponds to a set of grayscale values, which includes: the grayscale value of the center point (target point B), X grayscale values ​​corresponding to X boundary points (e.g., point B1) on the boundary of the first region that does not overlap with the intersecting region, and Y grayscale values ​​corresponding to Y boundary points (e.g., point B2) on the boundary of the first region that overlaps with the intersecting region. Specifically:

[0086] The gray value of the center point (target point B) is calculated using the first weight and the influence factor corresponding to the center point (the influence factor of target point B).

[0087] For the X gray values ​​corresponding to the X boundary points (e.g., point B1) on the boundary of the first region that do not overlap with the intersecting region, the gray values ​​are calculated using the second weight value, the influence radius and influence factor corresponding to the center point (the influence radius and influence factor of the target point B).

[0088] For the Y gray values ​​corresponding to the Y boundary points (e.g., point B2) on the boundary of the first region and the intersecting region, the values ​​are calculated using the first weight value, the coordinate data corresponding to the center point of the first initial region (coordinate data of target point B), the Y coordinate data corresponding to the Y boundary points (e.g., coordinate data of point B2), and the influence radius and influence factor corresponding to the center point of the first initial region (influence radius and influence factor of target point B).

[0089] Please see Figure 7 In (B), for the second region within the connected region, the second region corresponds to a set of grayscale values, which includes: the grayscale value of the center point (target point C), X grayscale values ​​corresponding to X boundary points (e.g., point C1) on the boundary of the second region that does not overlap with the intersecting region, and Y grayscale values ​​corresponding to Y boundary points (e.g., point C2) on the boundary of the second region that overlaps with the intersecting region. Specifically:

[0090] The gray value of the center point (target point C) is calculated using the first weight and the influence factor corresponding to the center point (the influence factor of target point C).

[0091] For the X gray values ​​corresponding to the X boundary points (e.g., point C1) on the boundary of the second region that do not overlap with the intersecting region, the gray values ​​are calculated using the second weight value, the influence radius and influence factor corresponding to the center point (the influence radius and influence factor of the target point C).

[0092] For the Y gray values ​​corresponding to the Y boundary points (e.g., point C2) on the boundary of the second region that overlaps with the intersecting region, the values ​​are calculated using the first weight value, the coordinate data corresponding to the center point of the second initial region (the coordinate data of the target point C), the Y coordinate data corresponding to the Y boundary points (e.g., the coordinate data of point C2), and the influence radius and influence factor corresponding to the center point of the second initial region (the influence radius and influence factor of the target point C).

[0093] Please see Figure 7 In (C), for intersecting regions in a connected region, the intersecting region corresponds to a set of gray values, which includes: the gray value of the center point (geometric coordinate center point F), and 2Y gray values ​​corresponding to 2Y boundary points (e.g., points B2 and C2) on the boundary of the intersecting region.

[0094] The grayscale value of the center point (geometric coordinate center point F) of the intersecting region is calculated using the first weight value, the coordinate data corresponding to the center point of the first initial region (coordinate data of target point B), the coordinate data corresponding to the center point of the intersecting region (coordinate data of target point F), the influence radius corresponding to the center point of the first initial region (influence radius of target point B), the influence factor corresponding to the center point of the first initial region (influence factor of target point B), the coordinate data corresponding to the center point of the second initial region (coordinate data of target point C), the influence radius corresponding to the center point of the second initial region, and the influence factor corresponding to the center point of the second initial region (influence radius and influence factor of target point C).

[0095] The calculation method for the 2Y gray values ​​corresponding to the 2Y boundary points (e.g., points B2 and C2) on the boundary of the intersecting region is the same as the calculation method for the Y gray values ​​corresponding to the Y boundary points (e.g., point B2) on the boundary of the first region that coincides with the intersecting region, and the Y gray values ​​corresponding to the Y boundary points (e.g., point C2) on the boundary of the second region that coincides with the intersecting region, and will not be repeated here.

[0096] For non-overlapping initial regions, each initial region corresponds to a set of grayscale values. (See also...) Figure 7 In (D), the set of gray values ​​corresponding to the initial region includes: the gray value of the center point (target point A) and the P gray values ​​corresponding to the P boundary points (e.g., point A1) on the region boundary. Specifically:

[0097] The gray value of the center point (target point A) is calculated using the first weight and the influence factor corresponding to the center point (the influence factor of target point A).

[0098] For each of the P boundary points (e.g., point A1) on the region boundary, the corresponding P gray values ​​are calculated using the second weight value, the influence radius of the center point, and the influence factor (influence radius and influence factor of target point A).

[0099] S450. Based on N sets of gray values ​​and M sets of gray values, perform color diffusion decreasing filling on K initial regions to generate a heat map.

[0100] Understandably, color diffusion reduction refers to using an inverse weighting function from the center point, causing the color intensity to decrease exponentially with distance from the center; filling refers to mapping the calculated grayscale values ​​to a color gradient (such as red-yellow-green) and covering the entire initial area.

[0101] Rendering is achieved through the parallel computing architecture of the GPU. For example, the OpenGL shader is used to determine the corresponding color for the gray values ​​of the center point and the boundary point in each region. Then, the color inside the region is automatically interpolated based on the color of the center point and the color of the boundary point to achieve color filling for all regions and uniform color transition.

[0102] The method provided in this application effectively avoids noise and redundant computation problems caused by fixed grid resolution through dynamic partitioning of the target point's influence region and processing of connected regions. Compared with traditional methods, it significantly reduces computational complexity, especially in data-dense areas where it achieves parallel processing capabilities through overlapping region decomposition. Furthermore, by using dual weight allocation for region boundary points (distance attenuation at non-overlapping edges and fusion of multi-source influence factors at overlapping edges), it overcomes the defects of color abrupt changes and excessive smoothing, making the heatmap boundary transitions more consistent with the actual data distribution.

[0103] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, obtaining K coordinate data, K influence radii, and K influence factors corresponding to K target points in the regional map includes:

[0104] Obtain L sampling points from the regional map, where the L sampling points correspond to L coordinate data, L influence radii, and L influence factors, where L > K > 1;

[0105] The L sampling points are thinned out to obtain K target points;

[0106] Based on the L coordinate data, L influence radii, and L influence factors corresponding to the L sampling points, we obtain the K coordinate data, K influence radii, and K influence factors corresponding to the K target points.

[0107] It is understandable that sampling points refer to the original data acquisition units (such as people density sensors, GPS trajectory points), and each point contains three-dimensional parameters (x, y coordinates, radius of influence r, and influence factor f).

[0108] Thinning refers to selecting K representative points (L > K ≥ 1) from L original points using spatial clustering or regular sampling algorithms. The target points are the cluster centers or key nodes retained after thinning, and their parameters inherit the statistical characteristics (such as mean and maximum) of the original samples. First, Q anchor points are generated using an equidistant grid. Sampling points falling into the same grid are clustered into an initial group. Then, principal component analysis (PCA) is used to calculate the parameter vector (x, r, f) within the group. The sample with the largest eigenvalue corresponding to the principal component with a variance contribution rate > 85% is selected as the target point, ensuring the complete preservation of key parameters.

[0109] Preferably, grid partitioning and clustering can be completed through a spatial index structure, maintaining real-time processing capabilities even for millions of sample points (such as city-level pedestrian flow data). The dynamic parameter inheritance mechanism adopts a weighted fusion strategy—the target point coordinates are taken as the centroid of the group, the influence radius is taken as the 90th quantile within the group (to avoid interference from extreme values), and the influence factor is calculated using the entropy method to determine the dispersion of the group parameter distribution (the smaller the entropy value, the more concentrated the distribution, and the higher the factor value).

[0110] Please see Figure 8 Based on the area map corresponding to the current zoom level, such as Figure 8 In (A), obtain L sampling points from the map. For example... Figure 8 In (B), the L sampling points are thinned to obtain K target points.

[0111] The method provided in this application reduces the computational complexity of subsequent calculations and improves real-time rendering efficiency through data compression; it significantly reduces noise interference by removing redundant samples (such as repeated monitoring points in high-density areas) through a thinning mechanism; and thirdly, the parameter fusion strategy enhances the representation ability of target points.

[0112] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, L sampling points are thinned to obtain K target points, including:

[0113] Perform equidistant sampling on the regional map to obtain Q anchor points, where Q > 1;

[0114] Define Q thinning regions centered at Q anchor points and with a preset distance as the radius;

[0115] Extract the sampling points belonging to the same thinning region from the L sampling points to obtain Q sampling point sets, where each sampling point set includes at least one sampling point;

[0116] Based on the positions of all sampling points in each sampling point set, determine Q sparse points;

[0117] The L sampling points that were not thinned and the Q thinned points are identified as K target points.

[0118] As can be understood, equidistant sampling refers to generating regular grid anchor points on a regional map at fixed intervals. The thinning region is a circular area defined by a preset radius centered on an anchor point. The sampling point set is a group of original data points falling within the same thinning region. The thinning point is a representative point obtained by calculating the geometric center or weighted averaging of the sampling points within the group.

[0119] First, the region is divided into Q regular units (Q≥100) using the grid indexing method. Then, cluster analysis is performed on the L sampling points (such as pedestrian flow sensor data) in each unit. The DBSCAN algorithm (neighborhood radius 200 meters, minimum number of samples 5) is used to extract core points as thinning points. Finally, edge sampling points not covered by any unit are directly included in the target point set.

[0120] Please see Figure 9 ,like Figure 9 In step (A), firstly, obtain L sampling points from the map. Then, perform equidistant sampling on the region map to obtain Q anchor points, such as... Figure 9 In step (B), Q thinning regions are determined with Q anchor points as centers and a preset distance as the radius. Sampling points belonging to the same thinning region are extracted to obtain Q sampling point sets. Based on the positions of all sampling points in each sampling point set, Q thinning points are determined, such as... Figure 9 In (C), the un-thinned sampling points and Q thinned points among the L sampling points are determined as K target points.

[0121] The method provided in this application reduces the computational complexity of subsequent calculations through data compression, making real-time heatmap rendering hardware feasible; regular grid partitioning avoids local overfitting caused by data aggregation; and the edge sampling point retention mechanism enhances the global integrity of the heatmap. Overall, through spatial regularization and intelligent clustering, both computational efficiency and heatmap accuracy are optimized, making it particularly suitable for real-time data processing scenarios involving millions of IoT devices in smart cities.

[0122] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, K coordinate data, K influence radii, and K influence factors corresponding to K target points are obtained based on L coordinate data, L influence radii, and L influence factors corresponding to L sampling points, including:

[0123] The mean of the coordinate data of all sampling points belonging to the same thinning region is used to determine the coordinate data of the corresponding thinning point in the thinning region.

[0124] The mean of the influence radii of all sampling points belonging to the same thinning region is determined as the influence radius of the corresponding thinning point in the thinning region.

[0125] The mean of the influence factors of all sampling points belonging to the same thinning region is determined as the influence factor of the corresponding thinning point in the thinning region.

[0126] The coordinate data corresponding to the un-thinned sampling points out of the L sampling points and the Q coordinate data corresponding to the Q thinned points are determined as the K coordinate data corresponding to the K target points.

[0127] The influence radius corresponding to the L sampling points that were not thinned and the Q influence radii corresponding to the Q thinned points are determined as the K influence radii corresponding to the K target points.

[0128] The influence factors corresponding to the L sampling points that were not thinned and the Q influence factors corresponding to the Q thinned points are determined as the K influence factors corresponding to the K target points.

[0129] Understandably, the thinning point parameters based on mean aggregation achieve an optimal balance between data compression and key information preservation. Mean aggregation refers to calculating the arithmetic mean of the coordinates, influence radius, and influence factor of all sampling points within the thinned region. Unthinned sampling points refer to data points in edge areas not covered by the regular grid, as well as sampling points in the thinned region that have only one sampling point and do not require thinning. The target point parameters are the final feature set composed of thinned and unthinned points, containing three-dimensional attributes (coordinate data, influence radius, and influence factor).

[0130] First, the mean of the sampling points in the Q thinned regions is calculated to generate Q statistical feature points. Second, the original sampling points not covered by any thinned regions are directly included in the target point set. Finally, the parameters of the two types of points are integrated to form a complete parameter library of K target points.

[0131] Please see Figure 10 ,like Figure 10 In section (A), the thinning region 1001 includes 5 sampling points. Based on the average coordinate data (x1, y1), (x2, y2), (x3, y3), (x4, y4), and (x5, y5) of these five sampling points, the coordinate data of the thinning point is calculated as (X, Y): X = (x1 + x2 + x3 + x4 + x5) / 5, Y = (y1 + y2 + y3 + y4 + y5) / 5. Based on the average influence radii r1, r2, r3, r4, and r5 of these five sampling points, the influence radius R of the thinning point is calculated as R = (r1 + r2 + r3 + r4 + r5) / 5. Based on the average influence factors factor1, factor2, factor3, factor4, and factor5 of these five sampling points, the influence factor FACTOR of the thinning point is calculated as FACTOR = (factor1 + factor2 + factor3 + factor4 + factor5) / 5. The thinning region 1002 includes one sampling point.

[0132] like Figure 10In (B), the coordinate data corresponding to the sampling points in the thinning region 1002 and the coordinate data of the thinning point are determined as the two coordinate data corresponding to the two target points; the influence radius corresponding to the sampling points in the thinning region 1002 and the influence radius of the thinning point are determined as the two influence radii corresponding to the two target points; the influence factor corresponding to the sampling points in the thinning region 1002 and the influence factor of the thinning point are determined as the two influence factors corresponding to the two target points.

[0133] The method provided in this application reduces the computational complexity of subsequent calculations through data compression, providing hardware feasibility for real-time heatmap rendering; mean aggregation effectively suppresses noise interference; and the fusion mechanism between un-thinned and thinned points enhances the global integrity of the heatmap.

[0134] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, calculating the M grayscale value sets corresponding to the M initial regions includes:

[0135] Based on K influence radii and K influence factors, calculate the gray values ​​of the center point and boundary points of M initial regions to obtain M gray value sets. Each gray value set includes the gray value of the center point of the initial region and at least one gray value corresponding to at least one boundary point of the region.

[0136] Understandably, the initial region is a circular space centered on the target point and bounded by the radius of influence. The grayscale value of the center point reflects the weighted value of the core density of that region. The grayscale values ​​of the boundary points are distributed along the gradient of the region edge through a distance decay function, with P boundary points evenly distributed around the circumference (e.g., sampling once every 15°, for a total of 24 points). The grayscale value set is a multi-dimensional feature array containing the center point and boundary points, used for subsequent color mapping and interpolation rendering.

[0137] By calculating the gray value of the center point of each initial region and the gray value of the boundary point of each initial region, a complete dataset containing P+1 gray values ​​is finally formed.

[0138] Please see Figure 11 The initial region is a circular space centered on the target point A, with the radius of influence as its boundary. The circle includes P boundary points (taking P=8 as an example).

[0139] The method provided in this application has a dual feature preservation mechanism for center points and boundary points, which not only captures the core density peak of the region, but also reflects the density distribution trend in a true manner through gradient decay, thus solving the oversmoothing problem of the traditional KDE method in complex scenes; the parameterized decay function supports dynamic adjustment; thirdly, the combination of boundary point discretization sampling and interpolation rendering reduces computational complexity and thus reduces rendering time.

[0140] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, based on K influence radii and K influence factors, the gray values ​​of the center points and boundary points of M initial regions are calculated to obtain M sets of gray values, including:

[0141] For each of the M initial regions:

[0142] Determine the influence radius and influence factor corresponding to the center point of the initial region;

[0143] Based on the first weight value and the influence factor, calculate the gray value of the center point to obtain the first gray value;

[0144] Based on the second weight value, the radius of influence, and the influence factor, calculate the gray value of at least one boundary point of the initial region to obtain at least one second gray value;

[0145] The first gray value and at least one second gray value are determined as the set of gray values ​​corresponding to the initial region.

[0146] Understandably, the weight values ​​are coefficients used to adjust the contributions of the center and the boundaries. First, center point parameters are extracted for each initial region, then at least one boundary point is sampled uniformly along the circumference, and a grayscale value sequence is generated through linear interpolation.

[0147] like Figure 11 The center point is calculated using scalar multiplication (α×f): the gray value of the center point (first gray value) = first weight value × influence factor of the center point. For example, the first gray value of point A = 1×factor_A.

[0148] like Figure 11 The optimal value of the boundary point attenuation coefficient β was determined experimentally (e.g., β = 0.15 / r, where r is the radius of influence). This ensures that the grayscale value attenuates by more than 80% within 3 meters of the region's edge, effectively suppressing the obvious color level abrupt changes produced by the traditional grid method in narrow channels. It is worth noting that when β = 0, the grayscale value of the boundary point will be completely ignored, which may result in sharp edges in the heatmap at the region boundaries. The grayscale value of the region boundary point (second grayscale value) = second weight value × influence factor of the center point × influence radius of the center point. For example, the second grayscale value of point A1 = 0 × r_A × factor_A.

[0149] The method provided in this application, with its dual feature preservation mechanism of center point and boundary point, captures the core density peak of the region and reflects the density distribution trend in a true manner through gradient decay. This solves the problem of oversmoothing in complex scenes by the traditional KDE method and ensures the visual accuracy of the heat map.

[0150] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, calculating the N grayscale value sets corresponding to N connected regions includes:

[0151] Based on K influence radii and K influence factors, calculate the gray values ​​of the center point and boundary point of each first region, the center point and boundary point of each second region, and the center point and boundary point of each third region in the N connected regions, to obtain the N sets of gray values ​​corresponding to the N connected regions.

[0152] It is understandable that a connected region refers to a composite space formed by the overlap of two or more initial regions, which is divided into a first region (the non-overlapping part of the original region), a second region (the non-overlapping part of another original region), and a third region (the overlapping part). The gray value set contains the center point and boundary point parameters of the three sub-regions, such as the gray value of the center point of the first region, the gray value of the boundary point of the second region, and the gray value of the center of the overlap of the third region.

[0153] First, each connected region is spatially segmented, and independent sub-regions are extracted using geometric Boolean operations (such as the Union-Find algorithm). Second, grayscale values ​​are calculated for each sub-region—the center point is weighted by an influence factor (G = α × f), and the boundary points generate gradient values ​​using a distance decay function (G = β × f × e^(-k × d)). Finally, a dual-weight fusion algorithm (G3 = γ × (G1_center × w1 + G2_center × w2)) is introduced for the third region, where w1 + w2 = 1 is the fusion weight.

[0154] Please see Figure 12 ,like Figure 12 In (A), the connected region is obtained by the intersection of the initial region B and the initial region C. The connected region includes the first region, the second region and the intersecting region.

[0155] like Figure 12 In (B), for the first region:

[0156] The gray value of the center point of the first region = the first weight value × the influence factor of the center point. For example, the gray value of the center point B = 1 × factor_B.

[0157] For the gray value of the boundary point of the region that does not overlap with the first region and the intersecting region, the gray value is equal to the second weight value × the influence factor of the center point × the influence radius of the center point. For example, the gray value of the boundary point B1 is equal to 0 × r_B × factor_B.

[0158] For the gray value of the boundary point of the region that coincides with the first region and the intersecting region, the value is calculated as follows: (First weight value - dist(coordinate data corresponding to the center point of the first initial region, coordinate data corresponding to the boundary point) / influence radius corresponding to the center point of the first initial region) × influence factor corresponding to the center point of the first initial region. For example, the gray value of the boundary point B2 is calculated as follows: (1.0 - dist(B,B2) / r_B) × factor_B.

[0159] like Figure 12 In (C), for the second region:

[0160] The gray value of the center point of the second region = the first weight value × the influence factor of the center point. For example, the gray value of the center point C = 1 × factor_C.

[0161] For the gray value of the boundary point of the region that does not overlap with the intersecting region, the gray value is equal to the second weight value × the influence factor of the center point × the influence radius of the center point. For example, the gray value of the boundary point C1 is equal to 0 × r_C × factor_C.

[0162] For the gray value of the boundary point of the region that overlaps with the second region, the gray value is calculated as follows: (First weight value - dist(coordinate data corresponding to the center point of the second initial region, coordinate data corresponding to the boundary point) / influence radius corresponding to the center point of the second initial region) × influence factor corresponding to the center point of the second initial region. For example, the gray value of the boundary point C2 is calculated as follows: (1.0 - dist(C,C2) / r_C) × factor_C.

[0163] like Figure 12 In (D), for intersecting regions:

[0164] The gray value of the center point of the intersecting region is calculated as follows: [(First weight value - dist(coordinate data corresponding to the center point of the first initial region, coordinate data corresponding to the boundary point of the region) / influence radius corresponding to the center point of the first initial region) × influence factor corresponding to the center point of the first initial region] + [(First weight value - dist(coordinate data corresponding to the center point of the second initial region, coordinate data corresponding to the boundary point of the region) / influence radius corresponding to the center point of the second initial region) × influence factor corresponding to the center point of the second initial region]. For example, the gray value of the center point F of the intersecting region is calculated as follows: [(1.0 - dist(B,B2) / r_B) × factor_B] + [(1.0 - dist(C,C2) / r_C) × factor_C].

[0165] The method provided in this application embodiment solves the problem of contradictory gray values ​​in overlapping areas through a multi-source data fusion strategy, making the color transition of the heatmap natural; the boundary point gradient decay algorithm adapts to different scene requirements through configurable parameters, achieves accurate rendering, and reduces heatmap noise.

[0166] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, based on K influence radii and K influence factors, the grayscale values ​​of the center point and boundary point of each first region, the center point and boundary point of each second region, and the center point and boundary point of each third region in N connected regions are calculated to obtain N sets of grayscale values ​​corresponding to the N connected regions, including:

[0167] For each of the N connected regions:

[0168] Determine the influence radius and influence factor corresponding to the center point of the first initial region in the connected region, and determine the influence radius and influence factor corresponding to the center point of the second initial region in the connected region;

[0169] Based on the influence radius and influence factor corresponding to the center point of the first initial region, calculate the gray value of the center point of the first region in the connected region and the gray value of at least one region boundary to obtain at least two gray values ​​corresponding to the first region;

[0170] Based on the influence radius and influence factor corresponding to the center point of the second initial region, calculate the gray value of the center point of the second region in the connected region and the gray value of at least one region boundary to obtain at least two gray values ​​corresponding to the second region;

[0171] Calculate the gray value of the center point of the intersecting region based on the influence radius and influence factor corresponding to the center point of the first initial region and the influence radius and influence factor corresponding to the center point of the second initial region;

[0172] The set of gray values ​​corresponding to the connected region is determined by taking at least two gray values ​​corresponding to the first region, at least two gray values ​​corresponding to the second region, and the gray value of the center point of the intersecting region.

[0173] Understandably, the scanline algorithm is first used to detect the intersection boundaries of the regions. Then, geometric clipping technology is used to divide the original region into non-overlapping independent sub-regions (first region and second region) and a shared intersection region (intersecting region). Finally, multi-source parameter weighted fusion is performed on the shared region.

[0174] The intersection detection algorithm can determine the intersection of N regions using a spatial index structure (such as an R-tree). Geometric clipping employs the Sutherland-Hodgman algorithm, generating 200 detection points for each region's boundary points through linear interpolation. The shared region fusion mechanism effectively balances conflicts between multi-source data through dynamic weight allocation. Notably, when the intersection region involves more than three initial regions, this application uses a recursive segmentation algorithm to ensure the termination of the computation process and the consistency of the results.

[0175] The method provided in this application embodiment solves the problem of contradictory gray values ​​in overlapping areas through a multi-source data fusion strategy, making the color transition of the heatmap natural; the boundary point gradient decay algorithm adapts to different scene requirements through configurable parameters, achieves accurate rendering, and reduces heatmap noise.

[0176] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, based on the influence radius and influence factor corresponding to the center point of the first initial region, the gray value of the center point of the first region in the connected region and the gray value of at least one region boundary are calculated to obtain at least two gray values ​​corresponding to the first region, including:

[0177] Calculate the gray value of the center point of the first region based on the first weight value and the influence factor corresponding to the center point of the first initial region;

[0178] For at least one boundary point on the boundary of a region that does not overlap with the intersecting region in the first region, the gray value of at least one boundary point in the first region is calculated based on the second weight value, the influence radius, and the influence factor.

[0179] For at least one region boundary point on the boundary of the region that overlaps with the intersecting region, the gray value of at least one region boundary point of the first region is calculated based on the first weight value, the coordinate data corresponding to the center point of the first initial region, the at least one coordinate data corresponding to at least one region boundary point, the influence radius and influence factor corresponding to the center point of the first initial region.

[0180] The gray values ​​of the center point of the first region, the gray values ​​of at least one boundary point of the first region, and the gray values ​​of at least one boundary point of the first region are determined as at least two gray values ​​corresponding to the first region.

[0181] Understandably, the first weight value is used to adjust the influence of the center point, the second weight value controls the boundary attenuation intensity, the influence radius represents the range of data influence, and the boundary point of the overlapping region refers to the sampling point located at the edge of the intersection of multiple regions.

[0182] First, the grayscale value of the center point is calculated using scalar multiplication (G_center = α × f). Then, radial attenuation is calculated for non-overlapping boundary points (G_boundary = β × f × r). Finally, a geometric distance correction term is introduced for overlapping boundary points (G_overlap = (1 - dist / d) × α × f), where d is the distance between the boundary point and the center point. The center point calculation is accelerated using GPU parallel processing (e.g., CUDA cores). The optimal value of the boundary point attenuation coefficient β is determined experimentally (e.g., β = 0.15 / r), ensuring that the grayscale value attenuates by more than 80% within 3 meters of the region edge, effectively suppressing the obvious color level abrupt changes produced by traditional mesh methods in narrow channels.

[0183] like Figure 12 In (B), for the first region:

[0184] The gray value of the center point of the first region = the first weight value × the influence factor of the center point. For example, the gray value of the center point B = 1 × factor_B.

[0185] For the gray value of the boundary point of the region that does not overlap with the first region and the intersecting region, the gray value is equal to the second weight value × the influence factor of the center point × the influence radius of the center point. For example, the gray value of the boundary point B1 is equal to 0 × r_B × factor_B.

[0186] For the gray value of the boundary point of the region that coincides with the first region and the intersecting region, the value is calculated as follows: (First weight value - dist(coordinate data corresponding to the center point of the first initial region, coordinate data corresponding to the boundary point) / influence radius corresponding to the center point of the first initial region) × influence factor corresponding to the center point of the first initial region. For example, the gray value of the boundary point B2 is calculated as follows: (1.0 - dist(B,B2) / r_B) × factor_B.

[0187] The method provided in this application embodiment uses a dynamic weight allocation mechanism that, through the synergistic effect of absolute weighting of the center point and distance decay of the boundary points, highlights the density peak of the core area and reflects the density distribution trend in a true manner through gradient decay, thus solving the oversmoothing problem of the traditional KDE method in complex scenarios; the hierarchical computing architecture reduces the overall complexity; and the geometric correction algorithm for overlapping boundary points reduces the standard deviation of thermal values ​​in the overlapping area and improves the accuracy of boundary recognition by fusing multi-source spatial parameters.

[0188] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, based on the influence radius and influence factor corresponding to the center point of the second initial region, the gray value of the center point of the second region in the connected region and the gray value of at least one region boundary are calculated to obtain at least two gray values ​​corresponding to the second region, including:

[0189] Calculate the gray value of the center point of the second region based on the first weight value and the influence factor corresponding to the center point of the second initial region;

[0190] For at least one boundary point on the boundary of a region that does not overlap with the intersecting region, calculate the gray value of at least one boundary point of the second region based on the second weight value, the influence radius, and the influence factor.

[0191] For at least one boundary point on the boundary of the region that overlaps with the intersecting region, the gray value of at least one boundary point of the second region is calculated based on the first weight value, the coordinate data corresponding to the center point of the second initial region, the coordinate data corresponding to at least one boundary point of the second region, the influence radius and influence factor corresponding to the center point of the second initial region.

[0192] The gray values ​​of the center point of the second region, the gray values ​​of at least one boundary point of the second region, and the gray values ​​of at least one boundary point of the second region are determined as at least two gray values ​​corresponding to the second region.

[0193] Understandably, the first weight value is used to adjust the influence of the center point, the second weight value controls the boundary attenuation intensity, the influence radius represents the range of data influence, and the boundary point of the overlapping region refers to the sampling point located at the edge of the intersection of multiple regions.

[0194] First, the grayscale value of the center point is calculated using scalar multiplication (G_center = α × f). Then, radial attenuation is calculated for non-overlapping boundary points (G_boundary = β × f × r). Finally, a geometric distance correction term is introduced for overlapping boundary points (G_overlap = (1 - dist / d) × α × f), where d is the distance between the boundary point and the center point. The center point calculation is accelerated using GPU parallel processing (e.g., CUDA cores). The optimal value of the boundary point attenuation coefficient β is determined experimentally (e.g., β = 0.15 / r), ensuring that the grayscale value attenuates by more than 80% within 3 meters of the region edge, effectively suppressing the obvious color level abrupt changes produced by traditional mesh methods in narrow channels.

[0195] like Figure 12 In (C), for the second region:

[0196] The gray value of the center point of the second region = the first weight value × the influence factor of the center point. For example, the gray value of the center point C = 1 × factor_C.

[0197] For the gray value of the boundary point of the region that does not overlap with the intersecting region, the gray value is equal to the second weight value × the influence factor of the center point × the influence radius of the center point. For example, the gray value of the boundary point C1 is equal to 0 × r_C × factor_C.

[0198] For the gray value of the boundary point of the region that overlaps with the second region, the gray value is calculated as follows: (First weight value - dist(coordinate data corresponding to the center point of the second initial region, coordinate data corresponding to the boundary point) / influence radius corresponding to the center point of the second initial region) × influence factor corresponding to the center point of the second initial region. For example, the gray value of the boundary point C2 is calculated as follows: (1.0 - dist(C,C2) / r_C) × factor_C.

[0199] The method provided in this application embodiment uses a dynamic weight allocation mechanism that, through the synergistic effect of absolute weighting of the center point and distance decay of the boundary points, highlights the density peak of the core area and reflects the density distribution trend in a true manner through gradient decay, thus solving the oversmoothing problem of the traditional KDE method in complex scenarios; the hierarchical computing architecture reduces the overall complexity; and the geometric correction algorithm for overlapping boundary points reduces the standard deviation of thermal values ​​in the overlapping area and improves the accuracy of boundary recognition by fusing multi-source spatial parameters.

[0200] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, the grayscale value of the center point of the intersecting region is calculated based on the influence radius and influence factor corresponding to the center point of the first initial region and the influence radius and influence factor corresponding to the center point of the second initial region, including:

[0201] Based on the first weight value, the coordinate data corresponding to the center point of the first initial region, the coordinate data corresponding to the center point of the intersecting region, the influence radius corresponding to the center point of the first initial region, the influence factor corresponding to the center point of the first initial region, the coordinate data corresponding to the center point of the second initial region, the coordinate data corresponding to the center point of the intersecting region, the influence radius corresponding to the center point of the second initial region, and the influence factor corresponding to the center point of the second initial region, calculate the gray value of the center point of the intersecting region.

[0202] Understandably, the first weight value is used to adjust the influence of the first initial region, the center point of the intersecting region refers to the geometric center of the overlapping part of the two regions, the influence radius represents the range of data influence, and the influence factor reflects the importance weight of the target point.

[0203] First, calculate the spatial distance between the center points of the two regions (d = √[(x2 - x1)]). 2 +(y2-y1) 2The grayscale value is then generated using a weighted fusion formula (G = F1 × w1 × (1 - d / (r1)) + F2 × w2 × (1 - d / (r2))), where w1 + w2 = 1 is the fusion weight, and d / (r) is the distance normalization coefficient. Spatial distance calculation is accelerated using GPU parallel processing. The optimal weight ratio of the weighted fusion formula was determined experimentally (e.g., w1 = 0.7 in the main channel direction and w2 = 0.3 in the secondary channel direction), which reduced the standard deviation of the thermal values ​​in the intersection area from 25.6 to 6.8, improving the boundary recognition accuracy by 74%. In a field test at a transportation hub in Beijing, this method reduced the calculation time for thermal values ​​in the intersection area from 0.3 seconds to 0.05 seconds and successfully captured instantaneous changes in pedestrian flow (e.g., a train entering the station causing a 300% increase in density within 5 seconds). It is worth noting that the effective range of the distance normalization coefficient d / (r) is set to [0,1], and the limit value of 1 is taken when it exceeds this range, avoiding weight distortion caused by excessive overlap of regions.

[0204] like Figure 12 In (D), for intersecting regions:

[0205] The gray value of the center point of the intersecting region is calculated as follows: [(First weight value - dist(coordinate data corresponding to the center point of the first initial region, coordinate data corresponding to the boundary point of the region) / influence radius corresponding to the center point of the first initial region) × influence factor corresponding to the center point of the first initial region] + [(First weight value - dist(coordinate data corresponding to the center point of the second initial region, coordinate data corresponding to the boundary point of the region) / influence radius corresponding to the center point of the second initial region) × influence factor corresponding to the center point of the second initial region]. For example, the gray value of the center point F of the intersecting region is calculated as follows: [(1.0 - dist(B,B2) / r_B) × factor_B] + [(1.0 - dist(C,C2) / r_C) × factor_C].

[0206] The method provided in this application embodiment effectively balances data conflicts in multiple regions through dynamic weight allocation, making the thermal values ​​of intersecting areas closer to the real density distribution; the computational complexity is reduced; the spatial coordinate system modeling ensures geometric accuracy, and can still maintain high resolution in complex terrains such as curved channels, reducing the noise in the thermal map.

[0207] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, based on K influence radii and K influence factors, the grayscale values ​​of the center point and boundary point of each first region, the center point and boundary point of each second region, and the center point and boundary point of each third region in N connected regions are calculated to obtain N sets of grayscale values ​​corresponding to the N connected regions, including:

[0208] Based on K influence radii and K influence factors, calculate the gray values ​​of the center point and boundary point of each first region, the center point and boundary point of each second region, and the center point and boundary point of each third region in N connected regions, and normalize all the calculated gray values.

[0209] The gray values ​​obtained after normalization are used as the set of N gray values ​​corresponding to the N connected regions.

[0210] It is understandable that grayscale value normalization refers to the standardization process of mapping the original grayscale value to the [0,1] interval; the region point includes feature samples such as the center point of the first region, the boundary point of the second region, and the center point of the intersection of the third region.

[0211] First, statistics are calculated by traversing all region points. Then, a linear transformation is performed on each grayscale value, ultimately forming a normalized set of grayscale values. After thermal region division, the grayscale values ​​of all region points are obtained. The maximum value (max) and minimum value (min) of the grayscale values ​​of all region points are calculated. For any grayscale value 'a' of a region point, the following processing is performed: a = (a - min) / (max - min) to obtain the normalized grayscale value. The normalization calculation uses parallel vector operations to improve computational efficiency. The dynamic range compression mechanism avoids division by zero errors by introducing an exponential relaxation coefficient (e.g., ε = 0.01). When max = min, the grayscale value is automatically set to 0.5.

[0212] The method provided in this application eliminates the dimensional imbalance of grayscale values ​​caused by differences in the radius of influence between regions through data standardization, making color mapping more consistent with human visual perception; the dynamic range compression mechanism effectively suppresses noise interference and reduces grayscale noise interference through the exponential relaxation algorithm (a'=(a-min) / (max-min+ε)); the normalized grayscale value set has strong compatibility and can be directly input into the GPU shader for texture mapping, reducing rendering time.

[0213] In an optional embodiment of the heatmap generation method provided in the above embodiments of this application, a heatmap is generated by performing color diffusion decreasing filling on K initial regions based on N grayscale value sets and M grayscale value sets, including:

[0214] Based on the K center points corresponding to the K initial regions and the K boundary points of the initial regions, modeling is performed to obtain W modeling regions, where each modeling region has a center point and at least two adjacent boundary points as its vertices, and W≥K>1;

[0215] The vertex colors of W modeling regions are determined by N sets of gray values ​​and M sets of gray values.

[0216] Based on the vertex colors of the W modeling regions, the internal colors of the W modeling regions are interpolated to obtain a uniform color transition for the K initial regions, generating a heatmap.

[0217] Understandably, the modeling region refers to a sector, triangle, or polygonal mesh formed by a center point and boundary points. A triangulation algorithm is used to divide K initial regions into W non-overlapping modeling regions. For example, a thermal region consists of a center point and its corresponding boundary points. Triangles are created by dividing the center point into triangles with any two adjacent boundary points, and all triangles serve as the final modeling data.

[0218] Please see Figure 13 ,like Figure 13 In (A), for the initial region, modeling is performed using the center point and two adjacent region boundary points, resulting in 8 modeling regions corresponding to the initial region. For example... Figure 13 In (B), for the first region within a connected region, modeling is performed using the center point and two adjacent region boundary points, resulting in 15 modeling regions corresponding to the first region. For example... Figure 13 In (C), for the second region within a connected region, modeling is performed using the center point and two adjacent region boundary points, resulting in 18 modeling regions corresponding to the second region. For example... Figure 13 In (D), for intersecting regions, the center point and two adjacent boundary points of the regions are used to model the region, resulting in 10 modeling regions corresponding to the intersecting region.

[0219] Vertex color is an RGB color value mapped from a set of grayscale values ​​(e.g., a grayscale value of 0.8 at the center point corresponds to red #FF0000). Interpolation refers to generating a continuous color transition within a region using a bilinear interpolation algorithm.

[0220] By performing a color lookup for each vertex (e.g., matching grayscale values ​​to a color map using a lookup table), pixel-level interpolation rendering is finally performed on the region using the GPU fragment shader. For example, to ensure natural color transitions on the heatmap, color textures are used to fill the heatmap regions. After transferring the region modeling data to the GPU using rendering technologies such as OpenGL, the shader, for example... Figure 14 In this example, for any sector of the thermal region, the texture coordinates of the boundary points (points A1, A2, A) are set to [grayscale value, 0.5]. The color (composed of RGB) of the corresponding position is obtained from the texture image based on the texture coordinates. [RGB, grayscale value] is used as the color of the corresponding boundary point (color format is RGBA). The color of the overlay point (A3) inside the triangle is obtained by the GPU through automatic interpolation based on the boundary point color, thus achieving a uniform color transition throughout the thermal region.

[0221] The method provided in this application uses a spatial discretization mechanism to transform a continuous thermal field into a discrete vertex network, thereby reducing computational complexity and providing hardware feasibility for real-time rendering; the vertex color lookup table method reduces color mapping time through memory preloading; and adaptive vertex density adjustment reduces the time required to update the heatmap while maintaining accurate positional precision.

[0222] This application also provides an apparatus for generating a heat map; please refer to [link to relevant documentation]. Figure 15 In (A), the heat map generating apparatus 1500 includes:

[0223] The acquisition module 1501 is used to acquire a regional map and K coordinate data, K influence radii and K influence factors corresponding to K target points in the regional map. The influence radii and influence factors are related to the object density of the target points.

[0224] The determination module 1502 is used to determine K initial regions based on K coordinate data corresponding to K target points and K influence radii, wherein the initial region is a region with the target point as the center and the influence radius as the radius, and K > 1;

[0225] Extraction module 1503 is used to extract intersecting initial regions from K initial regions to obtain N connected regions. The connected regions are obtained by the intersection of the first initial region and the second initial region in the initial regions. The connected regions include the first region, the second region and the intersecting region. The first region is the first initial region minus the intersecting region, and the second region is the second initial region minus the intersecting region. K > N ≥ 1.

[0226] The calculation module 1504 is used to calculate the N gray value sets corresponding to the N connected regions based on the K influence radii and K influence factors, and to calculate the M gray value sets corresponding to the M initial regions. The gray value sets include the gray value of the center point of the region and the gray value of the region boundary. The M initial regions are the initial regions that do not intersect with the K initial regions, where K > M ≥ 1.

[0227] The generation module 1505 is used to fill K initial regions with decreasing color diffusion based on N sets of gray values ​​and M sets of gray values ​​to generate a heat map.

[0228] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application, please refer to... Figure 15 In section (B), the heat map generating apparatus 1500 further includes:

[0229] The acquisition module 1501 is also used to acquire L sampling points in the regional map, wherein the L sampling points correspond to L coordinate data, L influence radii and L influence factors, and L > K > 1;

[0230] The thinning module 1506 is used to thin out L sampling points to obtain K target points;

[0231] The determination module 1502 is also used to obtain K coordinate data, K influence radii and K influence factors corresponding to K target points based on L coordinate data, L influence radii and L influence factors corresponding to L sampling points.

[0232] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application, please refer to... Figure 15 In section (C), the heat map generating apparatus 1500 further includes:

[0233] The sampling module 1507 is used to perform equidistant sampling on the regional map to obtain Q anchor points, where Q > 1;

[0234] The module 1502 is also used to determine Q thinning regions with Q anchor points as centers and a preset distance as a radius;

[0235] The extraction module 1503 is also used to extract sampling points belonging to the same thinning region from L sampling points to obtain Q sampling point sets, wherein each sampling point set includes at least one sampling point;

[0236] The determination module 1502 is also used to determine Q sparse points based on the positions of all sampling points in each sampling point set;

[0237] The determination module 1502 is also used to determine the un-thinned sampling points and Q thinned points from the L sampling points as K target points.

[0238] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application,

[0239] The determination module 1502 is also used to determine the mean of the coordinate data of all sampling points belonging to the same thinning region as the coordinate data of the corresponding thinning point in the thinning region.

[0240] The determination module 1502 is also used to determine the mean of the influence radii of all sampling points belonging to the same thinning region as the influence radius of the corresponding thinning point in the thinning region;

[0241] The determination module 1502 is also used to determine the mean of the influence factors of all sampling points belonging to the same thinning region as the influence factor of the corresponding thinning point in the thinning region.

[0242] The determination module 1502 is also used to determine the coordinate data corresponding to the un-thinned sampling points among the L sampling points and the Q coordinate data corresponding to the Q thinned points as the K coordinate data corresponding to the K target points.

[0243] The determination module 1502 is also used to determine the influence radius corresponding to the sampling points that have not been thinned out among the L sampling points and the Q influence radii corresponding to the Q thinned points as the K influence radii corresponding to the K target points;

[0244] The determination module 1502 is also used to determine the influence factors corresponding to the un-thinned sampling points among the L sampling points and the Q influence factors corresponding to the Q thinned points as the K influence factors corresponding to the K target points.

[0245] In an optional embodiment of the heat map generation apparatus provided in the above embodiments of this application, the calculation module 1504 is further configured to calculate the gray values ​​of the center points and boundary points of M initial regions based on K influence radii and K influence factors, thereby obtaining M gray value sets, wherein each gray value set includes the gray value of the center point of the initial region and at least one gray value corresponding to at least one boundary point of the region.

[0246] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application,

[0247] The determination module 1502 is also used to determine the influence radius and influence factor corresponding to the center point of the initial region;

[0248] The calculation module 1504 is also used to calculate the gray value of the center point based on the first weight value and the influence factor, and obtain the first gray value.

[0249] The calculation module 1504 is also used to calculate the gray value of at least one region boundary point of the initial region based on the second weight value, the influence radius and the influence factor, so as to obtain at least one second gray value;

[0250] The calculation module 1504 is also used to determine the first gray value and at least one second gray value as the set of gray values ​​corresponding to the initial region.

[0251] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application,

[0252] The calculation module 1504 is also used to calculate the gray values ​​of the center point and boundary point of each first region, the center point and boundary point of each second region, and the center point and boundary point of each third region in N connected regions based on the K influence radii and K influence factors, so as to obtain the N gray value sets corresponding to the N connected regions.

[0253] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application,

[0254] The determining module 1502 is also used to determine the influence radius and influence factor corresponding to the center point of the first initial region in the connected region, and to determine the influence radius and influence factor corresponding to the center point of the second initial region in the connected region;

[0255] The calculation module 1504 is also used to calculate the gray value of the center point of the first region in the connected region and the gray value of at least one region boundary based on the influence radius and influence factor corresponding to the center point of the first initial region, so as to obtain at least two gray values ​​corresponding to the first region.

[0256] The calculation module 1504 is also used to calculate the gray value of the center point of the second region in the connected region and the gray value of at least one region boundary based on the influence radius and influence factor corresponding to the center point of the second initial region, so as to obtain at least two gray values ​​corresponding to the second region.

[0257] The calculation module 1504 is also used to calculate the gray value of the center point of the intersecting region based on the influence radius and influence factor corresponding to the center point of the first initial region and the influence radius and influence factor corresponding to the center point of the second initial region.

[0258] The calculation module 1504 is also used to determine the gray value set corresponding to the connected region by at least two gray values ​​corresponding to the first region, at least two gray values ​​corresponding to the second region, and the gray value of the center point of the intersecting region.

[0259] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application,

[0260] The calculation module 1504 is also used to calculate the gray value of the center point of the first region based on the first weight value and the influence factor corresponding to the center point of the first initial region.

[0261] The calculation module 1504 is further configured to calculate the grayscale value of at least one boundary point of the first region on the boundary of a region that does not overlap with the intersecting region, based on the second weight value, the influence radius, and the influence factor.

[0262] The calculation module 1504 is also used to calculate the gray value of at least one regional boundary point of the first region on the boundary of the region where the first region and the intersecting region coincide, based on the first weight value, the coordinate data corresponding to the center point of the first initial region, at least one coordinate data corresponding to at least one regional boundary point, the influence radius and influence factor corresponding to the center point of the first initial region.

[0263] The determining module 1502 is further configured to determine the gray value of the center point of the first region, the gray value of at least one boundary point of the first region, and the gray value of at least one boundary point of the first region as at least two gray values ​​corresponding to the first region.

[0264] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application,

[0265] The calculation module 1504 is also used to calculate the gray value of the center point of the second region based on the first weight value and the influence factor corresponding to the center point of the second initial region.

[0266] The calculation module 1504 is further configured to calculate the grayscale value of at least one boundary point of the second region on the boundary of a region that does not overlap with the intersecting region, based on the second weight value, the influence radius, and the influence factor.

[0267] The calculation module 1504 is also used to calculate the gray value of at least one regional boundary point of the second region on the boundary of the region that overlaps with the intersecting region, based on the first weight value, the coordinate data corresponding to the center point of the second initial region, at least one coordinate data corresponding to at least one regional boundary point, the influence radius and influence factor corresponding to the center point of the second initial region.

[0268] The determining module 1502 is further configured to determine the gray value of the center point of the second region, the gray value of at least one boundary point of the second region, and the gray value of at least one boundary point of the second region as at least two gray values ​​corresponding to the second region.

[0269] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application,

[0270] The calculation module 1504 is also used to calculate the gray value of the center point of the intersecting region based on the first weight value, the coordinate data corresponding to the center point of the first initial region, the coordinate data corresponding to the center point of the intersecting region, the influence radius corresponding to the center point of the first initial region, the influence factor corresponding to the center point of the first initial region, the coordinate data corresponding to the center point of the second initial region, the influence radius corresponding to the center point of the second initial region, and the influence factor corresponding to the center point of the second initial region.

[0271] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application, please refer to... Figure 15 In section (D), the heatmap generating apparatus 1500 further includes:

[0272] The normalization module 1508 is used to calculate the gray values ​​of the center point and boundary point of each first region, the center point and boundary point of each second region, and the center point and boundary point of each third region in N connected regions based on K influence radii and K influence factors, and to normalize all the calculated gray values.

[0273] The determination module 1502 is also used to take the gray values ​​obtained after normalization as the set of N gray values ​​corresponding to the N connected regions.

[0274] In an optional embodiment of the heatmap generation apparatus provided in the above embodiments of this application, please refer to... Figure 15 In section (E), the heat map generating apparatus 1500 further includes:

[0275] Modeling module 1509 is used to perform modeling processing based on K center points corresponding to K initial regions and K region boundary points of the initial regions to obtain W modeling regions, wherein each modeling region has a center point and at least two adjacent region boundary points as its vertices, and W≥K>1;

[0276] The determination module 1502 is also used to determine the vertex colors of W modeling regions using N sets of gray values ​​and M sets of gray values;

[0277] The rendering module 1510 is used to interpolate the internal colors of the W modeling regions based on the vertex colors of the W modeling regions, so as to uniformly transition the colors of the K initial regions and generate a heat map.

[0278] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0279] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0280] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0281] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0282] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0283] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a server or terminal device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing computer programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0284] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for generating a heatmap, characterized in that, include: Obtain a regional map and K coordinate data, K influence radii, and K influence factors corresponding to K target points in the regional map, wherein the influence radii and the influence factors are related to the object density of the target points; Based on the K coordinate data corresponding to the K target points and the K influence radii, K initial regions are determined, wherein the initial region is a region centered on the target point and with the influence radius as the radius, and K > 1; Extract the intersecting initial regions from the K initial regions to obtain N connected regions. Each connected region is obtained by the intersection of the first initial region and the second initial region. Each connected region includes a first region, a second region, and an intersecting region. The first region is the first initial region minus the intersecting region, and the second region is the second initial region minus the intersecting region. K > N ≥ 1. Based on the K influence radii and K influence factors, calculate the N gray value sets corresponding to the N connected regions, and calculate the M gray value sets corresponding to the M initial regions. The gray value sets include the gray value of the center point of the region and the gray value of the region boundary. The M initial regions are the initial regions that do not intersect with the K initial regions, where K > M ≥ 1. Based on the N sets of gray values ​​and the M sets of gray values, the K initial regions are filled with decreasing color diffusion to generate a heatmap.

2. The generation method as described in claim 1, characterized in that, The process of obtaining K coordinate data, K influence radii, and K influence factors corresponding to K target points in the regional map includes: Obtain L sampling points from the area map, wherein the L sampling points correspond to L coordinate data, L influence radii, and L influence factors, where L > K > 1; The L sampling points are thinned to obtain K target points; Based on the L coordinate data, L influence radii, and L influence factors corresponding to the L sampling points, the K coordinate data, K influence radii, and K influence factors corresponding to the K target points are obtained.

3. The generation method as described in claim 2, characterized in that, The process of thinning the L sampling points to obtain K target points includes: The area map is sampled at equal intervals to obtain Q anchor points, where Q > 1; With the Q anchor points as centers and a preset distance as the radius, Q thinning regions are determined; Extracting sampling points belonging to the same thinning region from the L sampling points yields Q sets of sampling points, where each set of sampling points includes at least one sampling point; Based on the positions of all sampling points in each set of sampling points, determine Q sparse points; The sampling points that have not been thinned out from the L sampling points and the Q thinned points are determined as the K target points.

4. The generation method as described in claim 3, characterized in that, The step of obtaining K coordinate data, K influence radii, and K influence factors corresponding to the K target points based on L coordinate data, L influence radii, and L influence factors corresponding to L sampling points includes: The mean value of the coordinate data of all sampling points belonging to the same thinning region is determined as the coordinate data of the corresponding thinning point in the thinning region. The mean of the influence radii of all sampling points belonging to the same thinning region is determined as the influence radius of the corresponding thinning point in the thinning region. The mean of the influence factors of all sampling points belonging to the same thinning region is determined as the influence factor of the corresponding thinning point in the thinning region. The coordinate data corresponding to the un-thinned sampling points among the L sampling points and the Q coordinate data corresponding to the Q thinned points are determined as the K coordinate data corresponding to the K target points; The influence radius corresponding to the sampling points that have not been thinned out among the L sampling points and the Q influence radii corresponding to the Q thinned points are determined as the K influence radii corresponding to the K target points; The influence factors corresponding to the L sampling points that were not thinned and the Q influence factors corresponding to the Q thinned points are determined as the K influence factors corresponding to the K target points.

5. The generation method as described in claim 1, characterized in that, The calculation of the M grayscale value sets corresponding to the M initial regions includes: Based on the K influence radii and K influence factors, the gray values ​​of the center points and boundary points of the M initial regions are calculated to obtain M gray value sets, wherein each gray value set includes the gray value of the center point of the initial region and at least one gray value corresponding to at least one boundary point of the region.

6. The generation method as described in claim 5, characterized in that, The gray values ​​of the center points and boundary points of M initial regions are calculated based on the K influence radii and K influence factors, resulting in M ​​sets of gray values, including: For each of the M initial regions: Determine the influence radius and influence factor corresponding to the center point of the initial region; Based on the first weight value and the influence factor, the gray value of the center point is calculated to obtain the first gray value; Based on the second weight value, the influence radius, and the influence factor, calculate the gray value of at least one region boundary point of the initial region to obtain at least one second gray value; The first gray value and the at least one second gray value are determined as the set of gray values ​​corresponding to the initial region.

7. The generation method as described in claim 1, characterized in that, The calculation of the N grayscale value sets corresponding to the N connected regions includes: Based on the K influence radii and K influence factors, calculate the gray values ​​of the center point and boundary point of each of the first region, the center point and boundary point of each of the second region, and the center point and boundary point of each of the third region in the N connected regions, to obtain the N gray value sets corresponding to the N connected regions.

8. The generation method as described in claim 7, characterized in that, The grayscale values ​​of the center point and boundary point of each of the first region, the center point and boundary point of each of the second region, and the center point and boundary point of each of the third region are calculated based on the K influence radii and K influence factors in the N connected regions, resulting in N sets of grayscale values ​​corresponding to the N connected regions, including: For each of the N connected regions: Determine the influence radius and influence factor corresponding to the center point of the first initial region in the connected region, and determine the influence radius and influence factor corresponding to the center point of the second initial region in the connected region; Based on the influence radius and influence factor corresponding to the center point of the first initial region, calculate the gray value of the center point of the first region in the connected region and the gray value of at least one region boundary to obtain at least two gray values ​​corresponding to the first region; Based on the influence radius and influence factor corresponding to the center point of the second initial region, calculate the gray value of the center point of the second region in the connected region and the gray value of at least one region boundary to obtain at least two gray values ​​corresponding to the second region; Based on the influence radius and influence factor corresponding to the center point of the first initial region and the influence radius and influence factor corresponding to the center point of the second initial region, calculate the gray value of the center point of the intersecting region; The gray values ​​corresponding to at least two regions, the gray values ​​corresponding to at least two regions, and the gray value of the center point of the intersecting regions are determined as the set of gray values ​​corresponding to the connected regions.

9. The generation method as described in claim 8, characterized in that, The step involves calculating the grayscale value of the center point of the first region and the grayscale value of at least one region boundary in the connected region based on the influence radius and influence factor corresponding to the center point of the first initial region, thereby obtaining at least two grayscale values ​​corresponding to the first region, including: Calculate the gray value of the center point of the first region based on the first weight value and the influence factor corresponding to the center point of the first initial region; For at least one region boundary point on the boundary of a region that does not overlap with the intersecting region, the gray value of at least one region boundary point in the first region is calculated based on the second weight value, the influence radius, and the influence factor. For at least one region boundary point on the boundary of the region where the first region and the intersecting region coincide, the gray value of at least one region boundary point of the first region is calculated based on the first weight value, the coordinate data corresponding to the center point of the first initial region, at least one coordinate data corresponding to at least one region boundary point, the influence radius and influence factor corresponding to the center point of the first initial region. The gray values ​​of the center point of the first region, the gray values ​​of at least one boundary point of the first region, and the gray values ​​of at least one boundary point of the first region are determined as at least two gray values ​​corresponding to the first region.

10. The generation method as described in claim 8, characterized in that, The step of calculating the gray value of the center point of the second region and the gray value of at least one region boundary in the connected region based on the influence radius and influence factor corresponding to the center point of the second initial region, to obtain at least two gray values ​​corresponding to the second region, includes: Calculate the gray value of the center point of the second region based on the first weight value and the influence factor corresponding to the center point of the second initial region; For at least one boundary point on the boundary of the second region that does not coincide with the intersecting region, the gray value of at least one boundary point of the second region is calculated based on the second weight value, the influence radius, and the influence factor. For at least one region boundary point on the boundary of the region where the second region coincides with the intersecting region, the gray value of at least one region boundary point of the second region is calculated based on the first weight value, the coordinate data corresponding to the center point of the second initial region, the coordinate data corresponding to at least one region boundary point, the influence radius and influence factor corresponding to the center point of the second initial region. The gray values ​​of the center point of the second region, the gray values ​​of at least one boundary point of the second region, and the gray values ​​of at least one boundary point of the second region are determined as at least two gray values ​​corresponding to the second region.

11. The generation method as described in claim 8, characterized in that, The step of calculating the gray value of the center point of the intersecting region based on the influence radius and influence factor corresponding to the center point of the first initial region and the influence radius and influence factor corresponding to the center point of the second initial region includes: Based on the first weight value, the coordinate data corresponding to the center point of the first initial region, the coordinate data corresponding to the center point of the intersecting region, the influence radius corresponding to the center point of the first initial region, the influence factor corresponding to the center point of the first initial region, the coordinate data corresponding to the center point of the second initial region, the influence radius corresponding to the center point of the second initial region, and the influence factor corresponding to the center point of the second initial region, the gray value of the center point of the intersecting region is calculated.

12. The generation method as described in claim 8, characterized in that, The grayscale values ​​of the center point and boundary point of each of the first region, the center point and boundary point of each of the second region, and the center point and boundary point of each of the third region are calculated based on the K influence radii and K influence factors in the N connected regions, resulting in N sets of grayscale values ​​corresponding to the N connected regions, including: Based on the K influence radii and K influence factors, calculate the gray values ​​of the center point and boundary point of each of the first region, the center point and boundary point of each of the second region, and the center point and boundary point of each of the third region in the N connected regions, and normalize all the calculated gray values. The gray values ​​obtained after normalization are used as the set of N gray values ​​corresponding to the N connected regions.

13. The generation method as described in claim 8, characterized in that, The step of filling the K initial regions with decreasing color diffusion based on the N grayscale value sets and the M grayscale value sets to generate a heatmap includes: Based on the K center points corresponding to the K initial regions and the region boundary points of the K initial regions, modeling processing is performed to obtain W modeling regions, wherein the vertex of each modeling region is one center point and at least two adjacent region boundary points, and W≥K>1; The vertex colors of the W modeling regions are determined using the N sets of gray values ​​and the M sets of gray values. Based on the vertex colors of the W modeling regions, the internal colors of the W modeling regions are interpolated to obtain a uniform color transition for the K initial regions, thereby generating a heatmap.

14. A device for generating a heat map, characterized in that, include: The acquisition module is used to acquire a regional map and acquire K coordinate data, K influence radii and K influence factors corresponding to K target points in the regional map, wherein the influence radii and the influence factors are related to the object density of the target points; The determination module is used to determine K initial regions based on K coordinate data corresponding to the K target points and K influence radii, wherein the initial region is a region centered on the target point and with the influence radius as the radius, and K > 1; An extraction module is used to extract intersecting initial regions from the K initial regions to obtain N connected regions. The connected regions are obtained by the intersection of the first initial region and the second initial region. The connected regions include a first region, a second region, and an intersecting region. The first region is the first initial region minus the intersecting region, and the second region is the second initial region minus the intersecting region. K > N ≥ 1. The calculation module is used to calculate the N gray value sets corresponding to the N connected regions based on the K influence radii and K influence factors, and to calculate the M gray value sets corresponding to the M initial regions. The gray value sets include the gray value of the center point of the region and the gray value of the region boundary. The M initial regions are the initial regions that do not intersect with the K initial regions, where K > M ≥ 1. The generation module is used to fill the K initial regions with decreasing color diffusion based on the N gray value sets and the M gray value sets to generate a heat map.

15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the generation method according to any one of claims 1 to 13.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the generation method according to any one of claims 1 to 13.

17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the generation method according to any one of claims 1 to 13.