Aggregated display method, system, electronic device and storage medium of map data
By dynamically adjusting the aggregation radius and clustering algorithm of map data, the problem of uneven map data aggregation is solved, enabling refined display at different zoom levels and user-friendly map display effects, thereby improving the visualization efficiency and user experience of map data.
Patent Information
- Application Number
- CN202510499607.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-04-18
AI Technical Summary
Existing map data aggregation methods cannot accurately reflect the true data distribution, especially in areas with uneven aggregation between high-density and low-density regions. This results in information overload and visual confusion.
A dynamic aggregation radius adjustment method based on scaling level and regional point density is adopted. The target aggregation radius is obtained through exponential and logarithmic operations. Combined with DBSCAN and K-means clustering algorithms, the aggregation radius is dynamically adjusted to adapt to different scaling levels and user operations. The centroid position and weight factor calculation are optimized to achieve reasonable aggregation and display of photos.
It enables fine-grained aggregation of map data at different zoom levels, improves user experience, ensures clear display of data distribution and visual effects, reduces computational complexity, and improves rendering efficiency and user interactivity.
Smart Images

Figure CN120492553B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of map data processing technology, and in particular to methods, systems, electronic devices, and storage media for the aggregation and display of map data. Background Technology
[0002] Map data typically contains a large amount of geographic location information. Displaying all data points directly on a map can lead to information overload and visual clutter. Data aggregation can combine a large number of data points into fewer clusters, thereby reducing the amount of data and improving visualization efficiency.
[0003] Fixed-grid aggregation is a common data aggregation method that divides the map display area into fixed-size rectangular grid cells, forcibly merging all markers within each grid into a single cluster. Due to the pre-defined grid division, high-density areas may be over-aggregated, while low-density areas may be under-aggregated, failing to accurately reflect the true data distribution.
[0004] When multiple photos have the exact same geographical location, the only way to represent the number of photos is to simply overlay a numerical label on the corresponding coordinate point; aggregation is not possible. Summary of the Invention
[0005] This invention provides a method, system, electronic device, and storage medium for aggregating and displaying map data, in order to solve the problems in the prior art that it cannot accurately reflect the real data distribution and cannot aggregate photos.
[0006] This invention discloses a method for aggregating and displaying map data, applied to an electronic device with a target application installed. The electronic device is communicatively connected to a network-attached storage device (NAT). The electronic device can access target data in the NAT through the target application. The target data includes target photos and corresponding geographic information, including:
[0007] Obtain a zoom level request for the target data, the zoom level request including the current zoom level, and obtain the regional point density corresponding to the target data based on the geographic information;
[0008] Based on the current scaling level, the maximum scaling level, and the minimum scaling level, the scaling adjustment factor is obtained through exponential operation. Based on the region point density, the density adjustment factor is obtained through logarithmic operation. The target aggregation radius is obtained by multiplying the preset base radius by the scaling adjustment factor and the density adjustment factor.
[0009] The target image is displayed based on the target aggregation radius.
[0010] Optionally, the step of multiplying the preset base radius by the scaling adjustment factor and the density adjustment factor to obtain the target aggregation radius includes:
[0011] The target aggregation radius is obtained according to the following formula:
[0012]
[0013] Where R is the target aggregation radius, R base Based on radius, zoom current For the current zoom level, zoom min Minimum scaling level, zoom max The maximum scaling level is denoted by density, which is the point density of the region.
[0014] Optionally, the step of obtaining the target aggregation radius by multiplying the preset base radius by the scaling adjustment factor and the density adjustment factor includes:
[0015] Obtain the number of target data to be aggregated, and determine whether the number of data to be aggregated exceeds a preset threshold;
[0016] If so, then perform the step of obtaining the target aggregation radius based on the scaling level and the region point density;
[0017] If not, then the base radius shall be used as the target aggregation radius.
[0018] Optionally, the step of displaying the target image based on the target aggregation radius includes:
[0019] Based on the target aggregation radius, the target data is initially clustered to obtain initial cluster points;
[0020] The weight factor of each data point is obtained based on the initial cluster points, and the target centroid is obtained by iterative calculation based on the weight factor.
[0021] Optionally, the step of obtaining the weight factor for each data point includes:
[0022] Take any one of the data points as the current data point, obtain the distance between the current data point and the current centroid, and obtain the weight factor of the current data point based on the distance.
[0023] Optionally, the step of iteratively calculating the weighting factors to obtain the target centroid includes:
[0024] The iterative centroid of the current centroid is obtained using the following formula;
[0025]
[0026] Where, x c Let x be the centroid of the iteration. i Let d be the current coordinates of the i-th data point. i w is the distance between the i-th data point and the current centroid. i Let be the weight factor for the i-th data point.
[0027] Optionally, the step of obtaining the weight factor of the current data point based on the distance includes:
[0028] The attribute weight of the current data point is obtained based on its attributes, the distribution weight of the current data point is obtained based on the distance, and the weight factor is obtained based on the attribute weight and the distribution weight.
[0029] Optionally, before the step of displaying the target image based on the target aggregation radius, the method further includes:
[0030] Obtain user operation information on the target map data, and obtain the operation area and non-operation area in the target map data;
[0031] The aggregation region is obtained based on the target aggregation radius;
[0032] When the aggregation region is located within the operating region, the target aggregation radius is reduced;
[0033] When the aggregation region is located in the non-operational region, the target aggregation radius is increased.
[0034] Optionally, the step of reducing the target aggregation radius includes:
[0035] The reduction ratio can be obtained using the following formula:
[0036] B1 = max(0.3, 1 - (UIF × TDF))
[0037] The step of increasing the target aggregation radius includes:
[0038] The magnification ratio can be obtained using the following formula:
[0039] B2 = 1 + (2 × (1 - TDF) × (1 - UIF))
[0040] Wherein, B1 is the reduction ratio, B2 is the magnification ratio, UIF is the user operation frequency, and TDF is the time decay since the last operation.
[0041] Optionally, the step of displaying the target image based on the target aggregation radius includes:
[0042] Based on the target aggregation radius and the geographic information, multiple aggregation points are obtained, and each aggregation point corresponds to at least one target photo;
[0043] The number of aggregated target photos corresponding to each aggregation point is counted, a target display image is obtained based on the at least one target photo, and the target display image and the number of aggregated photos are displayed.
[0044] Optionally, the step of obtaining a target display image based on the at least one target photograph includes:
[0045] Select multiple target photos and display them together; or
[0046] Select one of the target photos to display.
[0047] Optionally, the step of obtaining a scaling level request for the target data includes:
[0048] The system acquires real-time swiping information from the user's screen on the electronic device and obtains the zoom level request based on the swiping information.
[0049] This invention also discloses a map data aggregation and display system, comprising:
[0050] The acquisition module is used to acquire a zoom level request for the target data. The zoom level request includes the current zoom level and the density of regional points corresponding to the target data based on the geographic information.
[0051] The aggregation module is used to obtain a scaling adjustment factor through exponential operation based on the current scaling level, the maximum scaling level, and the minimum scaling level; to obtain a density adjustment factor through logarithmic operation based on the region point density; and to obtain a target aggregation radius by multiplying a preset base radius by the scaling adjustment factor and the density adjustment factor.
[0052] The display module is used to display the target photo based on the target aggregation radius.
[0053] The present invention also discloses an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps described above.
[0054] The present invention also discloses a map data aggregation and display system, comprising: a network-attached storage device and an electronic device as described above, wherein the electronic device is equipped with an application program capable of performing the steps of the method described above;
[0055] or,
[0056] The system includes a network-attached storage device and a map data aggregation device as described above, the map data aggregation device being used to perform the steps of the method described above.
[0057] The present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps described above.
[0058] Compared with existing technologies, the map data aggregation and display method provided in this invention has the following advantages: it obtains the regional point density based on the target map data and zoom level request; it obtains the target aggregation radius based on the zoom level and regional point density, where the target aggregation radius has an exponential relationship with the zoom level and a logarithmic relationship with the regional point density, making the aggregation effect more refined and consistent with reality. Under different zoom levels, the aggregation radius is dynamically adjusted, allowing users to see the distribution of map data more clearly at different levels, thus improving the user experience. Attached Figure Description
[0059] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. In the accompanying drawings:
[0060] Figure 1 This is a flowchart illustrating an embodiment of the map data aggregation and display method provided by the present invention;
[0061] Figure 2 This is a schematic diagram illustrating an application scenario of the map data aggregation and display method provided by the present invention;
[0062] Figure 3 This is a schematic diagram illustrating the aggregation effect of map data in one embodiment provided in this application;
[0063] Figure 4 This is a schematic diagram illustrating the aggregation effect of map data in another embodiment provided in this application;
[0064] Figure 5 This is a schematic diagram of an embodiment of the map data aggregation and display system provided by the present invention;
[0065] Figure 6 This is a schematic diagram of the internal structure of an embodiment of the electronic device provided by the present invention;
[0066] Figure 7 This is a schematic diagram of another embodiment of the map data aggregation and display system provided by the present invention. Detailed Implementation
[0067] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0068] Please refer to the following: Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating an embodiment of the map data aggregation and display method provided by the present invention. Figure 2 This is a schematic diagram illustrating an application scenario of the map data aggregation and display method provided by the present invention. An electronic device 1 and a network attached storage device 2 are communicatively connected. The electronic device 1 has a target application installed, and the network attached storage device 2 stores target data. The electronic device 1 can access the target data in the network attached storage device 2 through the target application, thereby aggregating and displaying the target data. The target data may include target photos and corresponding geographic information, or other data related to geographic location.
[0069] The method for aggregating and displaying map data provided by this invention specifically includes the following steps:
[0070] S101: Obtain a zoom level request for the target data, and obtain the regional point density of the target map data based on the target data.
[0071] In a specific implementation scenario, target data and its corresponding map data are acquired. The map data includes the map coordinate system and basic map information. The target data includes the target data content and corresponding geographic information. The target data content is the data to be aggregated and displayed, such as population data, traffic data, etc. In this embodiment, it is the target image. Coordinate transformation and spatial index construction are performed on the target data. The target data content is transformed based on the map coordinate system, and then imported into the R language. The corresponding libraries or extension packages in R (such as spatialindex) are used to construct an R-tree spatial index. R-tree is a multidimensional index structure suitable for fast spatial data queries. Using the constructed R-tree spatial index can accelerate spatial query operations, such as range queries and nearest neighbor queries. The R-tree data structure can effectively reduce the amount of data to be searched and improve query efficiency.
[0072] The system tracks user zoom operations on target data to obtain zoom level requests, which include the specific zoom level. Based on the accessed target data, it statistically analyzes the distribution of corresponding data points and then calculates the regional point density based on this distribution.
[0073] S102: Obtain the scaling adjustment factor through exponential operation based on the current scaling level, the maximum scaling level, and the minimum scaling level; obtain the density adjustment factor through logarithmic operation based on the region point density; and obtain the target aggregation radius by multiplying the preset base radius by the scaling adjustment factor and the density adjustment factor.
[0074] In a specific implementation scenario, the actual data changes during aggregation may not be linear. Therefore, a nonlinear variation strategy is employed based on a preset baseline radius, combined with the current scaling level and region point density, to obtain the target scaling radius. Adopting a nonlinear variation strategy can better capture the complex relationships and characteristics between data, and this strategy can be flexibly adjusted according to different input conditions, allowing the system to better adapt to changes under different circumstances, thereby improving the system's adaptability and flexibility. For example, the nonlinear variation strategy can be a nonlinear function with scaling level and region point density as parameters; the nonlinear function can include exponential functions, logarithmic functions, etc. Furthermore, it is necessary to ensure that the calculated target aggregation radius is within a reasonable range and to consider boundary conditions, such as limiting it through minimum and maximum aggregation radii.
[0075] In one embodiment, a scaling adjustment factor is obtained based on the current scaling level, the maximum scaling level, and the minimum scaling level. A density adjustment factor is obtained based on the region point density. The target aggregation radius is obtained by multiplying the preset base radius by the scaling adjustment factor and the density adjustment factor. Therefore, the size of the target aggregation radius will be positively affected by the scaling adjustment factor and the density adjustment factor.
[0076] Specifically, the scaling adjustment factor is obtained through exponential operation based on the current scaling level, the maximum scaling level, and the minimum scaling level. At low scaling levels (shrinking the view), the scaling adjustment factor grows slowly, which can maintain strong aggregation and avoid the scatter points being too dense. At high scaling levels (zooming in the view), the scaling adjustment factor will expand rapidly, thereby quickly de-aggregating to display details.
[0077] The density adjustment factor is obtained by logarithmic operation based on the region point density. When the region point density is high, the density adjustment factor increases significantly, which can avoid excessive overlap. When the region point density is extremely high, the growth rate of the density adjustment factor will be suppressed by the logarithmic function to prevent the target aggregation radius from getting out of control.
[0078] In one embodiment, the target aggregation radius is obtained according to the following formula:
[0079]
[0080] Where R is the target aggregation radius, R base Based on radius, zoom current For the current zoom level, zoommin Minimum scaling level, zoom max This represents the maximum scaling level, and density represents the density of points in the region.
[0081] R base The initial scale for aggregation is determined by the baseline value. This can be the radius at the maximum scaling level or the radius at the minimum scaling level. In this embodiment, R... base The default aggregation radius is 10km. R base The value can be determined according to
[0082] This scaling factor is close to 1 (1+0=1) when the current scaling level is close to the minimum scaling level. As the scaling level increases, this scaling factor increases. The square operation in this scaling factor makes the change in the target aggregation radius more significant when the scaling level changes. Specifically, when the scaling level increases, the target aggregation radius increases rapidly, quickly reducing aggregation intensity and displaying more detail. When the scaling level decreases, the target aggregation radius decreases slowly, maintaining a high degree of aggregation to avoid scatter point explosion.
[0083] log 10 (density) is a density adjustment factor. Linear processing of high-density regions leads to excessively large radii, while logarithmic calculations can compress extreme values. Therefore, logarithmic calculations are used to determine the density adjustment factor. The higher the density of region points, the larger the logarithmic value, thus increasing the target aggregation radius. This allows for adjusting the target aggregation radius of each marker point based on the density of different regions. This results in a larger target aggregation radius for marker points in regions with higher point density, maintaining good visualization and ensuring that the aggregated shape of the marker points is clear and distinct, avoiding information loss or visual confusion due to over-aggregation.
[0084] In summary, the square relationship in the formula makes the radius change more drastically at the detail level (high zoom), which aligns with the user's mental model of expecting rapid de-clustering when zooming in. The logarithmic function prevents the radius from growing uncontrollably in a few hot spots. It can prevent the radius from being too small and causing cluttered scattering points when the zoom level is low, and prevent the radius from being too large and losing local features when the zoom level is high.
[0085] In other implementation scenarios, the quantity of target data to be aggregated is first obtained. For example, the target data can be filtered based on the target map data to obtain the target data that meets the aggregation requirements, and the quantity of these target data is counted as the quantity to be aggregated. For example, if the target map data is map data of Jiangsu Province, the target data can be filtered to select target data whose geographic information is within Jiangsu Province as the target data to be aggregated.
[0086] Determine whether the number of units to be aggregated exceeds a preset threshold. If so, proceed to step S102 to obtain the target aggregation radius based on the scaling level and the density of points in the region. If not, directly use the base radius as the target aggregation radius. The size of the base radius can be set according to the user's actual needs, for example, 10km. The preset threshold can be set according to the user's actual needs, for example, 1000.
[0087] Preset thresholds can be used to control algorithm performance. By setting a preset threshold, the amount of data processed by the algorithm can be limited, thereby controlling the algorithm's computational complexity and running time. The preset threshold can be set according to the computing capabilities of the electronic device to avoid system crashes caused by the electronic device overloading due to an excessively high preset threshold.
[0088] S103: Display target map data based on target aggregation radius.
[0089] In a specific implementation scenario, clustering algorithms (such as DBSCAN (Density-Based Spatial Clustering of Applications with Noise) and K-means) are used to divide the target map data into multiple cluster data groups based on the target aggregation radius. The number of data points and centroid of each cluster data group are calculated, and the marker points corresponding to each cluster data group are displayed on the map based on the centroid and the number of data points.
[0090] Furthermore, the centroid positions of the marker points are optimized to more reasonably reflect the original distribution characteristics of the data points. Initial clustering of the target data is performed using a clustering algorithm such as DBSCAN. The DBSCAN algorithm clusters based on two parameters: ε (epsilon, neighborhood radius) and MinPts (minimum number of data points). The target aggregation radius is used as the value of ε, and MinPts can be set according to the data density; for example, a single point can be allowed to form its own cluster.
[0091] For each initial cluster point, a weight factor for each data point is obtained based on the initial cluster point, and iterative calculations are performed to adjust the centroid position using the weight factor. Iterative optimization distinguishes between primary and secondary points, eliminates noise interference, and ensures that the centroid position simultaneously satisfies mathematical optimality and visual reasonableness. It performs well in fields requiring high-precision spatial representation (such as smart cities, emergency dispatch, and business analysis), making the machine-generated aggregation results highly consistent with human spatial cognitive expectations.
[0092] In one implementation scenario, the magnitude of the weight factor is related to the distance between the data point and the current centroid. The greater the distance, the smaller the weight. Points that are far away (such as outliers) have extremely low weights and have a negligible impact on the centroid's position. This causes the centroid to shift towards areas with high data point density, better showing the clustering and density distribution of data points, thus providing a more intuitive and meaningful data visualization effect.
[0093] Specifically, the iterative centroid of the current centroid can be obtained using the following formula:
[0094]
[0095] Where, x c For the iterative centroid, x i Let d be the current coordinates of the i-th data point. i w is the distance between the i-th data point and the current centroid. i Let be the weight factor for the i-th data point.
[0096] By iterating a preset number of times, or if the coordinate offset of two adjacent centroids is less than a preset threshold (0.1 pixels), the last obtained centroid is taken as the target centroid. This scheme, through inverse squared distance weighting and small step-size iterations, avoids centroid jumps, ensures visual stability, and avoids meaningless calculations.
[0097] In one embodiment, Newton's iteration method is used for iteration:
[0098] In the k-th iteration, the centroid position is obtained as x. c (k) The formula for iterative updates is:
[0099]
[0100] Where α is the learning rate control step size (usually taken as 0.1 to 0.5), which can be dynamically adjusted to balance speed and stability. The objective function is f(x) c The gradient of the centroid is used to update the centroid along the direction of the steepest descent of the function. The iteration termination condition is set to ||x|. c (k+1) -x c (k) Iteration stops when || < 0.1.
[0101] Newton's method, utilizing second-order derivative information (if the Hessian matrix is introduced), approximates the optimal solution faster than first-order methods (such as gradient descent). Furthermore, α can be dynamically adjusted via line search to avoid oscillations.
[0102] In other implementation scenarios, data points can be categorized based on their attributes, with different categories having different weights. For example, based on the target requirements to be displayed, the importance of each data point can be obtained, and weights can be assigned to each data point based on its importance. Alternatively, weights can be assigned based on the category of each data point. For instance, in a population education statistics scenario, data points corresponding to people with a bachelor's degree or above can be assigned more weight, while those corresponding to people with lower education levels can be assigned less weight. The magnitude of attribute weights can be customized by the user or automatically assigned based on preset fixed allocation standards.
[0103] The distribution weights of data points are obtained based on distance. This step is basically the same as the content described above and will not be repeated here. The attribute weights and distribution weights are combined to obtain the weight factors that represent the overall weight.
[0104] For example, the weighting factor can be obtained using the following formula:
[0105] W i =β×D i +γ×w i
[0106] Among them, W i D is the weighting factor. i For attribute weight, w i Distance weights β is the attribute weight coefficient, and γ is the distance weight coefficient. The specific values of β and γ can be customized by the user.
[0107] After obtaining the weighting factors, based on The process is iterated until a preset stopping condition is met, and the centroid obtained in the last iteration is taken as the target centroid. The specific iterative process is basically the same as described above, and will not be repeated here.
[0108] By combining attribute weights and distribution weights, the weighting factor calculation comprehensively considers both the attribute importance and spatial distribution density of data points. This allows for a more comprehensive consideration of the differences between data points when calculating the weighted centroid, thus more accurately determining the centroid's location. The weighting factor calculation ensures that the centroid's location better aligns with the overall characteristics of the data points, resulting in clusters that better reflect the actual data situation and meet the user's personalized needs.
[0109] In other implementation scenarios, when displaying target map data, in order to better meet the user's browsing needs, improve the user experience, and respond to the user's interactive behavior on the map in real time, the target aggregation radius of different areas is intelligently adjusted. This ensures global visualization while prioritizing the display of detailed information in areas of interest to the user.
[0110] It's necessary to obtain user interaction information regarding the target map data. This information can include actions such as clicking, double-clicking, dragging, and zooming. This information reflects the user's specific actions and their focus on the map data. Based on this information, the map area can be divided into interactive and non-interactive areas. Interactive areas are those where the user frequently performs actions (e.g., multiple clicks, multiple views, multiple zooms), while non-interactive areas are those where the user performs fewer actions. Alternatively, eye-tracking and other technologies can be used to identify the user's focus areas, designating the visible areas as interactive areas and the unvisited areas as non-interactive areas.
[0111] Different operations are performed in different areas based on the acquired target aggregation radius. Reducing the aggregation radius in frequently accessed areas preserves more detail, allowing users to see the data points more clearly and improving their understanding and perception of the data. In less active areas, increasing the aggregation radius reduces the number of data points to be displayed, thus improving rendering efficiency. This saves computing resources and speeds up map data loading. By dynamically adjusting the target aggregation radius in different areas, resources can be allocated rationally based on user behavior and focus, improving the user experience. Users will find the map data more aligned with their needs, the operation more intuitive, and the response more timely. Simultaneously, improved rendering efficiency in inactive areas achieves intelligent resource allocation and utilization.
[0112] The above methods can be used to construct an adaptive map system centered on the user's visual focus. By dynamically adjusting the target aggregation radius, an intelligent balance is achieved between "global overview" and "local details", "rendering performance" and "information richness".
[0113] In one embodiment, when it is necessary to reduce the target aggregation radius, the reduction ratio can be obtained according to the following formula:
[0114] B1 = max(0.3, 1 - (UIF × TDF))
[0115] When it is necessary to increase the target aggregation radius, the expansion ratio can be obtained according to the following formula:
[0116] B2 = 1 + (2 × (1 - TDF) × (1 - UIF))
[0117] Where B1 is the scaling factor, B2 is the scaling factor, UIF is the user operation frequency, and TDF is the time decay since the last operation.
[0118] When users interact frequently (UIF→1), at least 30% of the original details (lower limit 0.3) are forcibly retained to prevent over-aggregation from causing operation failure. When there is no operation for a long time (TDF→0), the default aggregation is automatically restored to save resources. However, when there is low operation frequency (UIF→0) and long-term idle time (TDF→0), the aggregation can be increased to a maximum of 300% (B=3.0). Furthermore, the product term can prevent sudden over-aggregation in edge areas.
[0119] The aggregation radius is dynamically adjusted based on user operation frequency and time decay, making map data display more personalized and adaptable to user operating habits. Users will see more details in frequently used areas, while receiving higher rendering efficiency in inactive areas. This also better balances resource allocation and user experience, improving map data display while meeting personalized user needs, optimizing data visualization, and enhancing user interaction.
[0120] Furthermore, overlaying dynamic statistical information onto cluster points can display information such as the number of data points corresponding to that cluster point and the percentage of categories. This information can be dynamically updated based on the actual data at each cluster point (different cluster points at different scaling levels), providing users with a richer data display. This information can be displayed on the cluster points in the form of text, charts, etc.
[0121] When users zoom in on the map or click on cluster points, a hierarchical expansion animation can smoothly transition the cluster points to the original data points. This allows users to more intuitively see the process of cluster points expanding into data points, improving the user experience.
[0122] When a user clicks on a cluster point, a detailed information pop-up window appears, displaying detailed information about the data points contained in that cluster. This allows users to load detailed information as needed, balancing interface simplicity with data accessibility.
[0123] In other implementation scenarios, when the current zoom level is higher than a preset zoom level threshold (e.g., level 18), the previously aggregated markers will be restored to their individual display state. This can be achieved by canceling aggregation or adjusting the display method of the markers. At high zoom levels, displaying markers as individual points allows users to more clearly view the detailed information of each data point.
[0124] When processing large-scale data, the front-end computational load can become excessive, leading to page lag or crashes and impacting user experience. To address this, Web Workers can be used to perform clustering calculations in background threads, avoiding blocking the main thread and ensuring page responsiveness. The main thread can focus on rendering and user interaction, while computational tasks are performed in background threads, improving overall performance. Deploying aggregation calculation logic on the server-side leverages server-side computing resources. The server-side's distributed processing capabilities support handling large-scale data, avoiding issues of insufficient front-end processing power and ensuring system stability and performance.
[0125] In one embodiment, please refer to [reference needed]. Figure 3 and Figure 4 , Figure 3 and Figure 4 A schematic diagram illustrating the aggregation effect of the map data provided in this application. Figure 4 Is Figure 3 The result is achieved by increasing the scaling level (aggregation) based on this. Figure 3 and Figure 4 In the scenario shown, the target data includes the target photograph and its corresponding geographic information. When capturing the image, geographic information can be automatically or manually collected as the geographic information for the target photograph, or it can be manually added later to assign corresponding geographic information to the image. For example, the geographic information can be GPS coordinates in EXIF (Exchangeable image file format).
[0126] After obtaining the target aggregation radius based on the steps above, corresponding data points are generated on the map data based on the geographic information of each target photo. These data points are then aggregated according to the target aggregation radius to obtain multiple aggregation points. Each aggregation point contains all data points within the target aggregation radius and corresponds to at least one image data.
[0127] Count the target photos associated with each aggregation point, and tally the number of target photos corresponding to that point. For each aggregation point, obtain the target display image from the selected target photos; this can be a thumbnail or the original image. One or more of the most representative or relevant image data can be selected as the target display images. Display the target display images and the number of aggregations.
[0128] In one implementation scenario, if the number of target photos corresponding to an aggregation point is less than a preset number (e.g., 4), two or more target photos can be selected and displayed together. This can be achieved through image stitching, overlay, or other compositing techniques. If the number of target photos corresponding to an aggregation point is greater than or equal to the preset number, a representative or relevant target photo is selected based on requirements and algorithms. Selection can be based on factors such as image quality, timestamp, and tags. For example, the most recently taken photo or the photo with the highest resolution can be selected, or an image similarity algorithm can be used to select the photo with the greatest / minimum difference.
[0129] In one embodiment, a user can input a zoom level request by swiping their finger on the screen of an electronic device. For example, a target swipe direction can be preset; swiping along the target swipe direction increases the zoom level, while swiping against the target swipe direction decreases the zoom level. As another example, a user can swipe on the screen with two or more fingers; when the distance between the corresponding touch points of each finger on the screen increases, the zoom level increases, and when the distance decreases, the zoom level decreases.
[0130] The system acquires real-time swipe information from the user's electronic device screen, generates corresponding zoom level requests based on this information, obtains the current target aggregation radius based on these requests, aggregates data points on the map based on this target aggregation radius, and displays the corresponding aggregation results. Animation effects or gradual transitions can be used to present the aggregation results, enhancing the user experience.
[0131] Based on the results of the aggregation (increasing the scaling level) and dispersion (decreasing the scaling level) operations, the positions of the aggregation points are re-rendered. Animation effects or transitions can be used to make the aggregation and dispersion processes smoother and more natural. When dispersion is needed, the aggregation points can be redistributed to reveal more details. For example, when the aggregation point is dispersed into multiple sub-points (or reversed aggregation) during a dispersion operation, linear interpolation is used to calculate the intermediate coordinates, and the positions are updated frame by frame. Displaying the aggregation and dispersion effects allows users to clearly see the aggregation and dispersion changes of data points, enabling high-frequency interaction with the user.
[0132] In one embodiment, a Web Worker thread is created to perform clustering calculations. The clustering algorithm code is placed in the Web Worker's script file, and the calculation task is triggered by the main thread sending a message to the Web Worker. In the main thread, the data to be clustered is sent to the Web Worker thread. After performing the calculation, the Web Worker thread returns the result to the main thread. Upon receiving the clustering result from the Web Worker, the main thread is responsible for rendering scheduling based on the result. This includes operations such as updating the positions of data points on the map and displaying aggregation effects. Using Web Workers avoids performing time-consuming clustering calculations in the main thread, thereby improving page responsiveness. This separation of calculation and rendering tasks helps maintain page smoothness. This invention can also reduce the rendering pressure on the main thread by controlling the number of aggregation points, ensuring smooth rendering even with large-scale data.
[0133] The distributed processing architecture employed in this invention allows for parallel processing of large-scale data across multiple servers. Complex and time-consuming aggregation calculation logic is deployed on the server side, leveraging server computing resources to support real-time aggregation of millions of data points. Furthermore, the server side can implement preprocessing and caching mechanisms to process data and store calculation results in advance, reducing response latency and improving system performance.
[0134] As described above, in this embodiment, the area point density is obtained based on the target map data and zoom level request; the target aggregation radius is obtained based on the zoom level and area point density. The target aggregation radius has an exponential relationship with the zoom level and a logarithmic relationship with the area point density, which makes the aggregation effect more refined and consistent with reality. The aggregation radius is dynamically adjusted at different zoom levels, allowing users to see the distribution of map data more clearly at different levels, thus improving the user experience.
[0135] Please see Figure 5 , Figure 5 This is a schematic diagram of an embodiment of the map data aggregation and display system provided by the present invention. The map data aggregation and display system 10 is applied to... Figure 2 The application scenarios shown include: acquisition module 11, aggregation module 12, and display module 13.
[0136] The acquisition module 11 is used to acquire a zoom level request for the target data, the zoom level request including the current zoom level and the area point density corresponding to the target data based on the geographic information; the aggregation module 12 is used to acquire a zoom adjustment factor through exponential operation based on the current zoom level, the maximum zoom level, and the minimum zoom level, acquire a density adjustment factor through logarithmic operation based on the area point density, and acquire a target aggregation radius by multiplying a preset base radius by the zoom adjustment factor and the density adjustment factor; the display module 13 is used to display the target photo based on the target aggregation radius.
[0137] Aggregation module 12 is also used to obtain the target aggregation radius according to the following formula:
[0138]
[0139] Where R is the target aggregation radius, R base Based on radius, zoom current For the current zoom level, zoom min Minimum scaling level, zoom max This represents the maximum scaling level, and density represents the density of points in the region.
[0140] The aggregation module 12 is also used to obtain the number of target data to be aggregated, and determine whether the number of data to be aggregated exceeds a preset threshold; if so, the step of obtaining the target aggregation radius based on the scaling level and the regional point density is executed; if not, the base radius is used as the target aggregation radius.
[0141] The display module 13 is also used to perform initial clustering of the target data based on the target aggregation radius to obtain initial cluster points; obtain the weight factor of each data point according to the initial cluster points; and perform iterative calculation based on the weight factor to obtain the target centroid.
[0142] The display module 13 is also used to take any one of the data points as the current data point, obtain the distance between the current data point and the current centroid, and obtain the weight factor of the current data point based on the distance.
[0143] The display module 13 is also used to obtain the iterative centroid of the current centroid according to the following formula;
[0144]
[0145] Where, x c For the iterative centroid, x i Let d be the current coordinates of the i-th data point. i w is the distance between the i-th data point and the current centroid. i Let be the weight factor for the i-th data point.
[0146] The display module 13 is also used to obtain the attribute weight of the current data point based on its attributes, obtain the distribution weight of the current data point based on its distance, and obtain the weight factor based on the attribute weight and the distribution weight.
[0147] The display module 13 is also used to obtain user operation information on the target map data, obtain the operation area and non-operation area in the target map data; obtain the aggregation area based on the target aggregation radius; when the aggregation area is located in the operation area, reduce the target aggregation radius; when the aggregation area is located in the non-operation area, increase the target aggregation radius.
[0148] Display module 13 is also used to obtain the scaling ratio according to the following formula:
[0149] B1 = max(0.3, 1 - (UIF × TDF))
[0150] The magnification ratio can be obtained using the following formula:
[0151] B2 = 1 + (2 × (1 - TDF) × (1 - UIF))
[0152] Where B1 is the scaling factor, B2 is the scaling factor, UIF is the user operation frequency, and TDF is the time decay since the last operation.
[0153] The display module 13 is further configured to obtain multiple aggregation points based on the target aggregation radius and the geographic information, with each aggregation point corresponding to at least one target photo; count the number of aggregations of the target photos corresponding to each aggregation point; obtain a target display image based on the at least one target photo; and display the target display image and the number of aggregations.
[0154] The display module 13 is also used to select multiple target photos for combined display; or to select one target photo for display.
[0155] The acquisition module 11 is also used to acquire the user's swiping information on the screen of the electronic device in real time, and to acquire the zoom level request based on the swiping information.
[0156] As described above, in this embodiment, the area point density is obtained based on the target map data and zoom level request; the target aggregation radius is obtained based on the zoom level and area point density. The target aggregation radius has an exponential relationship with the zoom level and a logarithmic relationship with the area point density, which makes the aggregation effect more refined and consistent with reality. The aggregation radius is dynamically adjusted at different zoom levels, allowing users to see the distribution of map data more clearly at different levels, thus improving the user experience.
[0157] Figure 6A schematic diagram of the internal structure of an electronic device in one embodiment is shown. This electronic device can specifically be a terminal or a server. Figure 6 As shown, the electronic device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a method for aggregating and displaying map data. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement the method for aggregating and displaying map data. Those skilled in the art will understand that… Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0158] In one embodiment, an electronic device is provided, including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps described above.
[0159] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the steps described above.
[0160] Please refer to the following: Figure 7 , Figure 7 This is a schematic diagram of another embodiment of the map data aggregation and display system provided by the present invention.
[0161] The map data aggregation and display system 20 includes the electronic device 21 described above and the network-attached storage device 22. The electronic device 21 has an application program installed that can perform the steps of the method described above.
[0162] In other implementation scenarios, the map data aggregation and display system 20 includes the electronic device 21 described above and the map data aggregation device 10, which is capable of performing the steps of the method described above.
[0163] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0164] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0165] It should be understood that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Those skilled in the art can modify the technical solutions described in the above embodiments, or make equivalent substitutions for some of the technical features; and all such modifications and substitutions should fall within the protection scope of the appended claims of the present invention.
Claims
1. A method for aggregating and displaying map data, applied to an electronic device with a target application installed, wherein the electronic device is communicatively connected to a network-attached storage device, and the electronic device can access target data in the network-attached storage device through the target application, the target data including target photos and geographic information corresponding to the target photos, characterized in that, include: Obtain a zoom level request for the target data, the zoom level request including the current zoom level, and obtain the regional point density corresponding to the target data based on the geographic information; Based on the current scaling level, the maximum scaling level, and the minimum scaling level, the scaling adjustment factor is obtained through exponential operation. Based on the region point density, the density adjustment factor is obtained through logarithmic operation. The target aggregation radius is obtained by multiplying the preset base radius by the scaling adjustment factor and the density adjustment factor. Based on the target aggregation radius and the geographic information, multiple aggregation points are obtained, each aggregation point corresponds to at least one target photo, and at least one target photo is aggregated and displayed. The step of obtaining the target aggregation radius by multiplying the preset base radius by the scaling adjustment factor and the density adjustment factor includes: The target aggregation radius is obtained according to the following formula: in, The target aggregation radius, Based on the radius, For the current scaling level, Minimum scaling level For maximum scaling level, The point density of the region, The scaling adjustment factor, This refers to the density adjustment factor.
2. The method for aggregating and displaying map data according to claim 1, characterized in that, The step of obtaining the target aggregation radius by multiplying the preset base radius by the scaling adjustment factor and the density adjustment factor includes: Obtain the number of target data to be aggregated, and determine whether the number of data to be aggregated exceeds a preset threshold; If so, then perform the step of obtaining the target aggregation radius based on the scaling level and the region point density; If not, then the base radius shall be used as the target aggregation radius.
3. The method for aggregating and displaying map data according to claim 1, characterized in that, The step of displaying the target image based on the target aggregation radius includes: Based on the target aggregation radius, the target data is initially clustered to obtain initial cluster points; The weight factor of each data point is obtained based on the initial cluster points, and the target centroid is obtained by iterative calculation based on the weight factor.
4. The method for aggregating and displaying map data according to claim 3, characterized in that, The step of obtaining the weight factor for each data point includes: Take any one of the data points as the current data point, obtain the distance between the current data point and the current centroid, and obtain the weight factor of the current data point based on the distance.
5. The method for aggregating and displaying map data according to claim 4, characterized in that, The step of iteratively calculating the weight factors to obtain the target centroid includes: The iterative centroid of the current centroid is obtained using the following formula; in, Let the iterative centroid be... Let i be the current coordinates of the i-th data point. Let be the distance between the i-th data point and the current centroid. Let be the weight factor for the i-th data point.
6. The method for aggregating and displaying map data according to claim 4, characterized in that, The step of obtaining the weight factor of the current data point based on the distance includes: The attribute weight of the current data point is obtained based on its attributes, the distribution weight of the current data point is obtained based on the distance, and the weight factor is obtained based on the attribute weight and the distribution weight.
7. The method for aggregating and displaying map data according to claim 1, characterized in that, Before the step of displaying the target image based on the target aggregation radius, the method further includes: Obtain user operation information on the target map data, and obtain the operation area and non-operation area in the target map data; The aggregation region is obtained based on the target aggregation radius; When the aggregation region is located within the operating region, the target aggregation radius is reduced; When the aggregation region is located in the non-operational region, the target aggregation radius is increased.
8. The method for aggregating and displaying map data according to claim 7, characterized in that, The step of reducing the target aggregation radius includes: The reduction ratio can be obtained using the following formula: The step of increasing the target aggregation radius includes: The magnification ratio can be obtained using the following formula: in, The reduction ratio is... The magnification ratio is... For user operation frequency, This represents the time decay since the last operation.
9. The method for aggregating and displaying map data according to claim 1, characterized in that, The step of aggregating and displaying at least one of the target photos includes: The number of aggregated target photos corresponding to each aggregation point is counted, a target display image is obtained based on the at least one target photo, and the target display image and the number of aggregated photos are displayed.
10. The method for aggregating and displaying map data according to claim 9, characterized in that, The step of obtaining a target display image based on at least one of the target photographs includes: Select multiple target photos and display them together; or Select one of the target photos to display.
11. The method for aggregating and displaying map data according to claim 1, characterized in that, The step of obtaining the scaling level request for the target data includes: The system acquires real-time swiping information from the user's screen on the electronic device and obtains the zoom level request based on the swiping information.
12. A map data aggregation device, characterized in that, The device includes: The acquisition module is used to acquire a zoom level request for the target data. The zoom level request includes the current zoom level and the density of regional points corresponding to the target data based on the geographic information. The aggregation module is used to obtain a scaling adjustment factor through exponential operation based on the current scaling level, the maximum scaling level, and the minimum scaling level; to obtain a density adjustment factor through logarithmic operation based on the region point density; and to obtain a target aggregation radius by multiplying a preset base radius by the scaling adjustment factor and the density adjustment factor. The display module is used to obtain multiple aggregation points based on the target aggregation radius and the geographic information, each aggregation point corresponding to at least one target photo, and to aggregate and display at least one target photo. The aggregation module is used to obtain the target aggregation radius according to the following formula: in, The target aggregation radius, Based on the radius, For the current scaling level, Minimum scaling level For maximum scaling level, The point density of the region, The scaling adjustment factor, This refers to the density adjustment factor.
13. An electronic device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as claimed in any one of claims 1 to 11.
14. A map data aggregation and display system, characterized in that, include: A network-attached storage device and an electronic device as claimed in claim 13, wherein the electronic device is equipped with an application program capable of performing the steps of the method according to any one of claims 1 to 11; or, The system includes a network-attached storage device and a map data aggregation device as described in claim 12, the map data aggregation device being used to perform the steps of the method as described in any one of claims 1 to 11.
15. A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method as claimed in any one of claims 1 to 11.
Citation Information
Patent Citations
Communication service package determination method and device, storage medium and electronic device
CN117093886A
Map display method and device, electronic equipment and readable storage medium
CN117909008A