Map data rendering method and device, electronic equipment, storage medium and product
By clustering and rendering map data multiple times, the slow loading and lag issues in traditional map rendering technologies have been resolved, enabling fast and smooth map display and improving the user experience.
Patent Information
- Application Number
- CN202511695223.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-24
AI Technical Summary
Traditional map rendering technologies suffer from slow loading, page lag, and even crashes when processing massive amounts of map data, impacting user experience.
The map data to be rendered is clustered to obtain clustering results. Based on the clustering results, a preset map rendering and loading strategy is used to render the data multiple times, reducing the number of rendered elements and avoiding lag and crashes caused by rendering all the data at once.
By clustering and multiple rendering, loading time was significantly reduced, map data loading speed and page smoothness were improved, and user experience was enhanced.
Smart Images

Figure CN121560434A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of map data processing technology, and in particular to a map data rendering method, apparatus, electronic device, storage medium and product. Background Technology
[0002] In the era of the Internet of Things (IoT), where everything is interconnected, business scenarios such as freight monitoring platforms, IoT device management platforms, and vehicle networking systems require platforms to monitor and display the geographical distribution information of massive numbers of devices in real time. For example, a freight monitoring platform needs to track the real-time location of millions of transport vehicles simultaneously. These business scenarios place high demands on the real-time performance, completeness, and smooth visualization of map data.
[0003] Currently, traditional map rendering technology uses a direct rendering method when processing map data, drawing all map point data one by one on the map and achieving visualization through a graphics library. However, the direct rendering method suffers from slow loading, page lag, and even crashes, affecting the user experience. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, storage medium, and product for rendering map data, in order to solve the problems of slow loading, page lag, or even crashes, and improve the user experience.
[0005] In a first aspect, embodiments of this application provide a method for rendering map data, comprising: acquiring map data to be rendered; clustering the map data to be rendered to obtain clustering results; based on the clustering results, using a preset map rendering loading strategy, rendering the map data to be rendered multiple times to obtain a rendered map page; and displaying the rendered map page on a front-end page.
[0006] In one possible implementation, the clustering result includes multiple map data clusters and multiple noisy map data. Accordingly, clustering the map data to be rendered to obtain the clustering result includes: obtaining the business scenario to which the map data to be rendered belongs based on the map data to be rendered; obtaining a pre-trained clustering algorithm corresponding to the business scenario; wherein the clustering parameters of the pre-trained clustering algorithm corresponding to different business scenarios are different; and using the pre-trained clustering algorithm based on the clustering parameters to cluster the map data to be rendered to obtain multiple map data clusters and multiple noisy map data.
[0007] In one possible implementation, the clustering parameters include a neighborhood radius parameter and a minimum number of points parameter. Accordingly, based on the clustering parameters, a trained clustering algorithm is used to cluster the map data to be rendered, resulting in multiple map data clusters and multiple noisy map data. This includes: obtaining the spherical distance between map data points in the map data to be rendered; wherein the map data to be rendered includes multiple map data points; using a trained clustering algorithm, based on the spherical distance between map data points, the neighborhood radius parameter, and the minimum number of points parameter, the map data to be rendered is clustered to obtain multiple core map data points and multiple initial map data clusters; one core map data point corresponds to one initial map data cluster; if any initial map data cluster corresponding to a core map data point contains at least one core map data point, it is merged with the initial map data cluster corresponding to at least one core map data point to obtain the final multiple map data clusters; at least one map data point in the map data to be rendered that is not clustered into multiple map data clusters is identified as multiple noisy map data.
[0008] In one possible implementation, the clustering parameters include a neighborhood radius parameter, a minimum number of points parameter, and a cluster sensitivity coefficient. Accordingly, based on the clustering parameters, a trained clustering algorithm is used to cluster the map data to be rendered, resulting in multiple map data clusters and multiple noisy map data. This includes: obtaining the spherical distance between map data points in the map data to be rendered; wherein the map data to be rendered includes multiple map data points; using the trained clustering algorithm, calculating the reachable distance of each map data point based on the spherical distance between them, the neighborhood radius parameter, and the minimum number of points parameter; determining multiple reachable distance descent points and multiple reachable distance ascent points based on the reachable distance of each map data point and the cluster sensitivity coefficient; designating any reachable distance descent point as the start of a map data cluster and the reachable distance ascent point adjacent to any reachable distance descent point as the end of a map data cluster, thus obtaining multiple map data clusters; and identifying multiple map data points in the map data to be rendered that are not clustered into multiple map data clusters as multiple noisy map data.
[0009] In one possible implementation, the preset map rendering loading strategy is a fixed-point loading strategy; the fixed-point loading strategy includes a fixed number of map data points loaded; the clustering result includes multiple map data clusters and multiple noisy map data; accordingly, based on the clustering result, the preset map rendering loading strategy is used to render the map data to be rendered multiple times to obtain a rendered map page, including: obtaining the total number of map data points in the map data to be rendered; obtaining the number of first map data points in each map data cluster; obtaining the number of second map data points in multiple noisy map data; determining a first ratio of the number of first map data points in each map data cluster to the total number of map data points based on the number of first map data points and the total number of map data points; determining a second ratio of the number of second map data points in multiple noisy map data to the total number of map data points based on the number of second map data points and the total number of map data points; and performing multiple renderings based on the fixed number of map data points loaded, the first ratio, and the second ratio to complete the rendering of the map data to be rendered and obtain a rendered map page.
[0010] In one possible implementation, multiple renderings are performed based on a fixed number of map data points loaded, a first ratio, and a second ratio to complete the rendering of the map data to be rendered and obtain a rendered map page. This includes: determining the number of map data points loaded by each map data cluster during each rendering based on the fixed number of map data points loaded and the first ratio; determining the number of map data points loaded by multiple noisy map data clusters during each rendering based on the fixed number of map data points loaded and the second ratio; and during the multiple renderings of the map data to be rendered, rendering is performed each time based on the number of map data points loaded by each map data cluster and the number of map data points loaded by multiple noisy map data clusters to complete the rendering of the map data to be rendered and obtain a rendered map page.
[0011] In one possible implementation, the preset map rendering loading strategy is a fixed-number loading strategy; the fixed-number loading strategy includes a fixed number of loadings; accordingly, based on the clustering results, the preset map rendering loading strategy is used to render the map data to be rendered multiple times to obtain a rendered map page, including: determining a fixed number of map data points to be loaded based on the total number of map data points and the fixed number of loadings; determining the number of map data points loaded by each map data cluster during each rendering based on the fixed number of map data points loaded and a first ratio; determining the number of map data points loaded by multiple noisy map data clusters during each rendering based on the fixed number of map data points loaded and a second ratio; during the process of rendering the map data to be rendered multiple times, during each rendering, rendering is performed based on the number of map data points loaded by each map data cluster and the number of map data points loaded by multiple noisy map data clusters to complete the rendering of the map data to be rendered and obtain a rendered map page.
[0012] In one possible implementation, the preset map rendering loading strategy is a dynamically adjusted loading strategy; wherein the dynamically adjusted loading strategy includes dynamically loading the number of map data points; the clustering result includes multiple map data clusters and multiple noisy map data; accordingly, based on the clustering result, the preset map rendering loading strategy is used to render the map data to be rendered multiple times to obtain a rendered map page, including: obtaining the total number of map data points in the map data to be rendered; obtaining the number of first map data points in each map data cluster; obtaining the number of second map data points in multiple noisy map data; determining a first ratio of the number of first map data points in each map data cluster to the total number of map data points based on the number of first map data points and the total number of map data points; determining a second ratio of the number of second map data points in multiple noisy map data to the total number of map data points based on the number of second map data points and the total number of map data points; and performing multiple renderings based on the dynamically loaded number of map data points, the first ratio, and the second ratio to complete the rendering of the map data to be rendered and obtain a rendered map page.
[0013] In one possible implementation, multiple renderings are performed based on the dynamically loaded number of map data points, a first ratio, and a second ratio to complete the rendering of the map data to be rendered and obtain a rendered map page. This includes: determining the number of map data points loaded by each map data cluster during each rendering based on the dynamically loaded number of map data points and the first ratio; determining the number of map data points loaded by multiple noisy map data clusters during each rendering based on the dynamically loaded number of map data points and the second ratio; and during the multiple renderings of the map data to be rendered, rendering is performed each time based on the number of map data points loaded by each map data cluster and the number of map data points loaded by multiple noisy map data clusters to complete the rendering of the map data to be rendered and obtain a rendered map page.
[0014] In one possible implementation, the preset map rendering loading strategy is a center-point radial loading strategy; wherein the center-point radial loading strategy includes a center map data point; the clustering result includes multiple map data clusters and multiple noisy map data; accordingly, based on the clustering result, the preset map rendering loading strategy is used to render the map data to be rendered multiple times to obtain a rendered map page, including: calculating the first step length between each map data point in each map data cluster and the center map data point; calculating the second step length between each map data point in multiple noisy map data and the center map data point; dividing the map data to be rendered into multiple map data layers with the center map data point as the center and different preset step lengths as radii; and rendering the map data to be rendered multiple times based on the first step length, the second step length, and the multiple map data layers to complete the rendering of the map data to be rendered and obtain a rendered map page.
[0015] In one possible implementation, before acquiring the map data to be rendered, the method further includes: acquiring a map historical data sample set corresponding to multiple business scenarios; performing the following operations on the map historical data sample set corresponding to each business scenario to obtain a trained clustering algorithm for each business scenario; acquiring the spherical distance between each map data point in the map historical data sample set; dividing the map historical data sample set to obtain multiple map historical data sub-sample sets; and training based on the multiple map historical data sub-sample sets and the spherical distance between each map data point to obtain a trained clustering algorithm and clustering parameters.
[0016] Secondly, embodiments of this application provide a map data rendering apparatus, comprising: an acquisition module for acquiring map data to be rendered; a clustering module for clustering the map data to be rendered to obtain clustering results; a rendering module for rendering the map data to be rendered multiple times based on the clustering results and using a preset map rendering loading strategy to obtain a rendered map page; and a display module for displaying the rendered map page on a front-end page.
[0017] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0018] The memory stores computer-executed instructions;
[0019] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0020] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0021] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0022] The map data rendering method, apparatus, electronic device, storage medium, and product provided in this application cluster the map data to be rendered, obtain clustering results, and render based on the clustering results. This significantly reduces the number of elements that need to be rendered, avoiding slow loading issues. Based on the clustering results, a preset map rendering loading strategy is used for multiple renderings, avoiding page lag and crashes caused by rendering all map data at once. Therefore, the problems of slow map data loading, page lag, and even crashes are solved, improving the user experience. Furthermore, the business scenario to which the map data to be rendered belongs is obtained, and pre-trained clustering algorithms corresponding to different business scenarios are used. The clustering parameters of the pre-trained clustering algorithms for different business scenarios are different. Based on the clustering parameters, the pre-trained clustering algorithms are used to cluster the map data to be rendered, obtaining multiple map data clusters and multiple noisy map data. This makes the clustering results more consistent with the distribution characteristics of different business scenarios, improving the accuracy of map data clustering in different business scenarios and further enhancing the user experience. Attached Figure Description
[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0024] Figure 1 A schematic diagram of a scenario for a map data rendering method provided in an embodiment of this application;
[0025] Figure 2 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 1 ;
[0026] Figure 3 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 2 ;
[0027] Figure 4 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 3 ;
[0028] Figure 5 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 4 ;
[0029] Figure 6 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 5 ;
[0030] Figure 7 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 6 ;
[0031] Figure 8 A schematic diagram of the structure of the map data rendering apparatus provided in the embodiments of this application;
[0032] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0033] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0034] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0035] Figure 1 This is a scene illustration of the map data rendering method provided in the embodiments of this application, such as... Figure 1 As shown, it includes: a receiving device 101, a processing device 102, and a display device 103.
[0036] It is understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the method of rendering map data. In other feasible embodiments of this application, the above architecture may include more or fewer components than illustrated, or combine some components, or split some components, or arrange different components, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of both.
[0037] In the specific implementation process, the receiving device 101 can be an input / output interface or a communication interface, and can receive and acquire map data to be rendered.
[0038] The processing device 102 can perform a series of processes on the map data to be rendered to obtain a rendered map page.
[0039] The display device 103 can be used to display the rendered map page.
[0040] It should be understood that the aforementioned processor can be implemented by reading instructions from memory and executing those instructions, or it can be implemented through chip circuitry.
[0041] Furthermore, the network architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0042] In the era of the Internet of Things (IoT), where everything is interconnected, business scenarios such as freight monitoring platforms, IoT device management platforms, and vehicle-to-everything (V2X) systems require platforms to monitor and display the geographical distribution information of massive amounts of devices in real time. For example, a freight monitoring platform needs to track the real-time location of millions of transport vehicles simultaneously. These business scenarios place high demands on the real-time performance, completeness, and smooth visualization of map data. Currently, traditional map rendering technology processes map data using a direct rendering method, drawing all map point data one by one onto the map and achieving visualization through a graphics library. However, this results in slow loading, page lag, and even crashes, impacting the user experience.
[0043] To address the aforementioned technical problems, this application proposes the following technical concept: Clustering the map data to be rendered yields clustering results; rendering is then performed based on these results, significantly reducing the number of elements that need to be rendered and avoiding slow loading. Furthermore, based on the clustering results, a preset map rendering and loading strategy is used for multiple rendering runs, preventing page lag and crashes caused by rendering the entire map data at once. Therefore, the problems of slow map data loading, page lag, and even crashes are solved, improving the user experience.
[0044] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0045] Figure 2 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 1 ,like Figure 2 As shown, the method includes:
[0046] S201: Obtain the map data to be rendered.
[0047] In this embodiment, when a user triggers a global map view or device distribution display rendering operation on a front-end page, such as a vehicle network monitoring platform or an IoT device management platform, the system responds to the map rendering operation triggered by the front-end page by retrieving the map data to be rendered from the database or data platform. The data format is latitude and longitude coordinates.
[0048] S202: Cluster the map data to be rendered to obtain the clustering results.
[0049] The clustering results include multiple map data clusters and multiple noisy map data.
[0050] Specifically, step S202 includes S2021 to S2023:
[0051] S2021: Based on the map data to be rendered, obtain the business scenario to which the map data to be rendered belongs.
[0052] In this embodiment, the business scenario to which the map data to be rendered belongs is determined by the business attribute tags or data source identifiers of the map data to be rendered, including vehicle networking scenarios, such as the national freight supervision platform and the Beidou vehicle transportation system; smart building scenarios, such as the smart building equipment management platform; and logistics transportation scenarios, such as the national logistics freight platform.
[0053] In this embodiment, different business scenarios have different tolerances for noise points. For example, in the vehicle-to-everything (V2X) scenario, there is no particularly obvious clustering because vehicles are constantly changing dynamically, so the tolerance for noise should be relatively high. However, in the smart building scenario, each building and portal is fixed, and the location of the equipment hardly changes, so clustering is more obvious, and the tolerance for noise should be relatively low.
[0054] S2022: Obtain the pre-trained clustering algorithm corresponding to the business scenario; the clustering parameters of the pre-trained clustering algorithm are different for different business scenarios.
[0055] In this embodiment, the trained clustering algorithms include the HDBSCAN algorithm and the OPTICS algorithm. The clustering parameters include the neighborhood radius parameter, the minimum number of points parameter, and the cluster sensitivity coefficient. Specifically, the HDBSCAN algorithm involves the neighborhood radius parameter and the minimum number of points parameter; the OPTICS algorithm involves the neighborhood radius parameter, the minimum number of points parameter, and the cluster sensitivity coefficient.
[0056] For example, the OPTICS algorithm is used for the connected vehicle and logistics transportation scenarios; the HDBSCAN algorithm is used for the smart building scenario. The clustering parameters for the connected vehicle scenario are: a neighborhood radius of 25 kilometers, a minimum number of points of 5, and a cluster sensitivity coefficient of 0.1; the clustering parameters for the logistics transportation scenario are: a neighborhood radius of 30 kilometers, a minimum number of points of 4, and a cluster sensitivity coefficient of 0.08; the clustering parameters for the smart building scenario are: a neighborhood radius of 10 kilometers and a minimum number of points of 4.
[0057] S2023: Based on clustering parameters, a trained clustering algorithm is used to cluster the map data to be rendered, resulting in multiple map data clusters and multiple noisy map data.
[0058] In this embodiment, if the trained clustering algorithm is the HDBSCAN algorithm, the following steps are performed, including steps S20231~S20234:
[0059] The clustering parameters include the neighborhood radius parameter and the minimum number of points parameter.
[0060] S20231: Obtain the spherical distance between each map data point in the map data to be rendered; wherein the map data to be rendered includes multiple map data points.
[0061] In this embodiment, all map data points are extracted from the map data to be rendered. Each map data point contains geographic information such as latitude and longitude coordinates. Then, the spherical distance between any two map data points is calculated. The calculation of spherical distance must be based on the curvature of the Earth's surface, distinct from planar Euclidean distance, to ensure that the distance result accurately reflects the actual positional relationship of the map data points in geographic space. For example, if two latitude and longitude coordinates are (39.9°N, 116.3°E) and (39.8°N, 116.4°E), the straight-line distance between them on the Earth's surface must be calculated using the spherical distance formula, rather than a simple calculation of coordinate differences.
[0062] S20232: Using a trained clustering algorithm, the map data to be rendered is clustered based on the spherical distance between each map data point, the neighborhood radius parameter, and the minimum number of points parameter, resulting in multiple core map data points and multiple initial map data clusters; one core map data point corresponds to one initial map data cluster.
[0063] The neighborhood radius parameter refers to the neighborhood range of any map data point. Centered on the map data point, all map data points within the spherical area defined by the neighborhood radius parameter at a spherical distance from the center point are considered as neighborhood points of the map data point.
[0064] The minimum number of points parameter refers to the minimum number of neighboring points required to determine a core map data point. If the number of other map data points within the neighborhood of a map data point is greater than or equal to the minimum number of points parameter, then that map data point is determined to be a core map data point.
[0065] Specifically, the process iterates through all map data points in the map data to be rendered. For each map data point P, based on the neighborhood radius parameter, all other map data points within P's neighborhood are selected, and their count is recorded as the neighborhood point count. If the neighborhood point count is greater than or equal to the minimum point count parameter, P is determined to be a core map data point, and P and all map data points within its neighborhood are grouped into an initial map data cluster; that is, one core map data point corresponds to one initial map data cluster. If the neighborhood point count is less than the minimum point count parameter, P is a non-core data point and is not initially included in the generation of the initial map data cluster. It may later be assigned to the initial map data cluster of other core map data points, or ultimately be determined as noisy map data.
[0066] S20233: If any initial map data cluster corresponding to a core map data point contains at least one core map data point, then it is merged with the initial map data cluster corresponding to at least one core map data point to obtain multiple final map data clusters.
[0067] In this embodiment, the composition of each initial map data cluster is examined. If an initial map data cluster A contains other core map data points besides its corresponding core map data point A, such as core map data point B, and core map data point B corresponds to initial map data cluster B, it is determined that initial map data cluster A and initial map data cluster B are related. Since core map data point B belongs to both initial map data cluster A and initial map data cluster B, it indicates that the two initial map data clusters overlap or are adjacent in geographic space; therefore, initial map data cluster A and initial map data cluster B are merged into a final map data cluster.
[0068] S20234: Identify at least one map data point in the map data to be rendered that has not been clustered into multiple map data clusters as multiple noisy map data.
[0069] In this embodiment, all map data points in the map data points to be rendered are traversed, and map data points that are not included in any final map data cluster are selected and identified as noisy map data.
[0070] In this embodiment, if the trained clustering algorithm is the OPTICS algorithm, the following steps are performed, including steps S20235~S20239:
[0071] The clustering parameters include the neighborhood radius parameter, the minimum number of points parameter, and the cluster sensitivity coefficient.
[0072] S20235: Obtain the spherical distance between each map data point in the map data to be rendered; wherein the map data to be rendered includes multiple map data points.
[0073] S20236: Using a trained clustering algorithm, calculate the reachable distance of each map data point based on the spherical distance between each map data point, the neighborhood radius parameter, and the minimum number of points parameter.
[0074] The neighborhood radius parameter refers to the neighborhood range of any map data point. Centered on the map data point, all other map data points within the spherical area of the neighborhood radius parameter are considered neighborhood points of the map data point.
[0075] The minimum number of points parameter refers to the minimum number of neighboring points required to determine a core map data point. If the number of other map data points within the neighborhood of a map data point is greater than or equal to the minimum number of points parameter, then the map data point is determined to be a core map data point; otherwise, it is a non-core map data point.
[0076] In this embodiment, for a core map data point m, the spherical distances from all map data points within its neighborhood radius parameter to m are first sorted in ascending order. The distance from the smallest number of map data points after sorting to m is taken as the core distance of m. Then, the reachability of m is initially set to its own core distance. If there are other core map data points m', and m is within the neighborhood radius parameter of m', and the spherical distance from m to m' is less than the core distance of m, then the reachability of m is updated to the spherical distance from m to m'.
[0077] In this embodiment, for non-core map data point n, all core map data points that can cover n are selected, that is, n is in the neighborhood of core map data points. The spherical distance from n to each core map data point is calculated, and the minimum value is taken as the reachable distance of n. If there is no core map data point covering n, the reachable distance is not calculated for the time being, and it may be classified as noisy map data later.
[0078] S20237: Based on the reachability of each map data point and the cluster sensitivity coefficient, determine multiple reachability drop points and multiple reachability rise points.
[0079] In this embodiment, the reachability distance of each map data point is output as an ordered list.
[0080] In this embodiment, the cluster sensitivity coefficient is denoted as ξ. The cluster sensitivity coefficient is a key parameter for controlling the sensitivity of determining the reachability drop point and the reachability rise point.
[0081] In this embodiment, if the reachable distance of the i-th map data point in the ordered list is d i Compared to the reachable distance d of the (i-1)th map data point i-1 Satisfy d i-1 -d i If d > (1-ξ), then the i-th map data point is a point where the reachable distance drops sharply. If ξ = 0.05, that is, 1-ξ = 0.95, d i-1 =2.0, d i =0.8, then d i-1 -d i =1.2>0.95.
[0082] Among them, the point where the reachable distance drops sharply represents the boundary point from non-map data cluster area or noisy map data to the core area of map data cluster. The sudden decrease in reachable distance indicates that subsequent map data points begin to approach the core of map data cluster.
[0083] In this embodiment, if the reachable distance d of the j-th point in the ordered list is... j Compared to the reachable distance d of the (j-1)th point j-1 Satisfy d j -d j-1If d > (1+ξ), then the j-th point is the point where the reachable distance increases sharply. If ξ = 0.05, that is, 1+ξ = 1.05, if d j-1 =0.7, d j =1.8, then d j -d j-1 =1.1>1.05. The point where the reachable distance increases sharply represents the boundary between the core area of the map data cluster and the non-map data cluster area or noisy map data. A sudden increase in reachable distance indicates that subsequent map data points have left the core of the map data cluster.
[0084] S20238: Determine any reachable distance descent point as the start of a map data cluster, and determine the reachable distance ascent point adjacent to any reachable distance descent point as the end of a map data cluster, thus obtaining multiple map data clusters.
[0085] In this embodiment, the output ordered list is plotted as a reachability distance map. The horizontal axis represents the index of the map data points in the list, and the vertical axis represents the reachability distance.
[0086] In this embodiment, the reachability distances of each map data point are traversed. When the first reachability distance descent point is encountered, it is marked as the start of a map data cluster. Traversal continues from this map data point until the first reachability distance ascent point is encountered, which is marked as the end of the map data cluster. At this point, all map data points from the map data descent point to the map data ascent point constitute a complete map data cluster. Traversal continues until multiple reachability distance descent points and multiple reachability distance ascent points are traversed, resulting in multiple map data clusters.
[0087] S20239: Identify multiple map data points in the map data to be rendered that are not clustered into multiple map data clusters as multiple noisy map data.
[0088] In this embodiment, all map data points in the map data to be rendered are traversed, and map data points that are not included in any map data cluster are selected and identified as noisy map data.
[0089] S203: Based on the clustering results, a preset map rendering and loading strategy is adopted to render the map data to be rendered multiple times to obtain the rendered map page.
[0090] In this embodiment, the preset map rendering loading strategies include a fixed number of points loading strategy, a fixed number of loading times loading strategy, a dynamically adjusted loading strategy, and a center point radial loading strategy. Step S203 will be described in subsequent embodiments.
[0091] Optionally, the preset map rendering and loading strategy can be comprehensively considered based on factors such as the performance of the front-end browser, the server configuration, and the map rendering functions used. After clustering and multiple renderings, the page can display millions of map data points in real time without lag, and the map data points on the map increase rapidly and gradually, resulting in a smooth overall page experience. Among these, the fixed-point loading strategy, the fixed-time loading strategy, and the dynamically adjusted loading strategy are suitable for most scenarios. The center-point radial loading strategy is suitable for map data that is expanded based on a central coordinate point, such as public transportation and logistics companies and chain stores.
[0092] S204: Display the rendered map page on the front-end page.
[0093] In this embodiment, the rendered map page is transmitted to the front end and displayed on the page where the user triggers the rendering operation.
[0094] In this embodiment, the map data-based rendering method can construct a massive map data optimization system. The following details the architecture design and deployment: Select a server with appropriate configuration based on the business data volume and performance requirements. Install necessary middleware on the server, such as Python / Java, Nginx, and message queue (MQ). For example, Python is used for algorithm implementation, Java for the microservice architecture, Nginx for load balancing and static resource services, and MQ for handling asynchronous rendering tasks. Based on a B / S separation architecture, the map data rendering method is encapsulated as a microservice. A corresponding web platform page should also be built and deployed to the server. The web platform can provide an access API, with different pricing standards based on different data volumes and rendering strategies, and real-time display of rendering effects. For large models, for data security reasons, 2-3 separate servers should be used to deploy the large model locally, with load balancing and backup implemented.
[0095] In summary, clustering the map data to be rendered and then rendering based on these clustering results significantly reduces the number of elements that need to be rendered, avoiding slow loading. Furthermore, by employing a pre-defined map rendering and loading strategy based on the clustering results, multiple renderings are performed, preventing page lag and crashes caused by rendering the entire map data at once. Therefore, the problems of slow map data loading, page lag, and even crashes are solved, improving the user experience. In addition, the business scenario to which the map data to be rendered belongs is determined, and pre-trained clustering algorithms corresponding to different business scenarios are used. The clustering parameters of these pre-trained clustering algorithms differ for different business scenarios. Based on these parameters, the pre-trained clustering algorithms are used to cluster the map data to be rendered, resulting in multiple map data clusters and multiple noisy map data clusters. This makes the clustering results more consistent with the distribution characteristics of different business scenarios, improving the accuracy of map data clustering under different business scenarios and further enhancing the user experience.
[0096] refer to Figure 3 , Figure 3 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 2 .like Figure 3 As shown, based on the above embodiments, the rendering process when the preset map rendering loading strategy is a fixed-point loading strategy is described. The fixed-point loading strategy includes loading a fixed number of map data points, and the clustering results include multiple map data clusters and multiple noisy map data. The core of the fixed-point loading strategy is to split the map data to be rendered into multiple renderings, loading a fixed number of map data points each time, avoiding page lag caused by loading the entire amount of data at once. Details are as follows:
[0097] S301: Get the total number of map data points in the map data to be rendered.
[0098] In this embodiment, all map data points are extracted from the map data to be rendered, and their total number is counted and denoted as N.
[0099] S302: Get the number of first map data points in each map data cluster.
[0100] In this embodiment, multiple map data clusters, such as A1, A2, and A3, are traversed. The number of map data points contained in each map data cluster, such as N1, N2, and N3, is counted.
[0101] S303: Obtain the number of second map data points in multiple noisy map data.
[0102] In this embodiment, the number of second map data points in multiple noisy map data is denoted as LN.
[0103] S304: Based on the number of first map data points and the total number of map data points, determine the first ratio of the number of first map data points to the total number of map data points in each map data cluster.
[0104] In this embodiment, for map data cluster A1, the first ratio of the number of first map data points N1 in map data cluster A1 to the total number of map data points N is N1 / N; for map data cluster A2, the first ratio of the number of first map data points N2 in map data cluster A2 to the total number of map data points N is N2 / N; for map data cluster A3, the first ratio of the number of first map data points N3 in map data cluster A3 to the total number of map data points N is N3 / N.
[0105] S305: Determine a second ratio of the number of second map data points to the total number of map data points in multiple noisy map data based on the number of second map data points and the total number of map data points.
[0106] In this embodiment, the second ratio of the number of second map data points LN in multiple noisy map data to the total number of map data points N is LN / N.
[0107] S306: Based on the number of fixed map data points loaded, the first ratio, and the second ratio, perform multiple renderings to complete the rendering of the map data to be rendered and obtain the rendered map page.
[0108] Specifically, step S306 includes S3061 to S3063:
[0109] S3061: Determine the number of map data points loaded for each map data cluster during each rendering based on the fixed number of map data points loaded and the first ratio.
[0110] In this embodiment, the number of fixed map data points loaded is X.
[0111] In this embodiment, for the first ratio N1 / N of map data cluster A1, the number of map data points loaded during each rendering is: For map data cluster A2 with a first scale of N2 / N, the number of map data points loaded during each rendering is: For map data cluster A3, the first ratio is N3 / N, and the number of map data points loaded during each rendering is... .
[0112] S3062: Determine the number of map data points loaded from multiple noisy map data during each rendering based on the fixed number of map data points loaded and the second ratio.
[0113] In this embodiment, the second ratio of the number of map data points LN in multiple noisy map data sets to the total number of map data points N is LN / N, and the number of map data points loaded each time rendering is... .
[0114] S3063: During the process of rendering the map data to be rendered multiple times, each rendering is performed based on the number of map data points loaded in each map data cluster and the number of map data points loaded in multiple noisy map data clusters, so as to complete the rendering of the map data to be rendered and obtain the rendered map page.
[0115] In this embodiment, the rendering process is repeated multiple times, based on the number of map data points loaded in each map data cluster during each rendering, and the number of map data points loaded from multiple noisy map data clusters, until all map data points in each map data cluster are loaded. After each rendering, the loaded map data points are marked as loaded. During the next rendering, map data points are selected from the unloaded map data points in each map data cluster for loading. During the final loading, if the number of unloaded map data points in each map data cluster is less than X, all remaining unloaded map data points are loaded directly. This completes the rendering of the map data to be rendered, resulting in a rendered map page.
[0116] In summary, the fixed-point loading strategy includes setting a fixed number of map data points to load, ensuring the number of map data points loaded in each rendering. It determines the number of map data points loaded for each map data cluster during each rendering by determining a first ratio of the number of first map data points in each cluster to the total number of map data points. Furthermore, it determines the number of map data points loaded for multiple noisy map data clusters by determining a second ratio of the number of second map data points in multiple noisy map data clusters to the total number of map data points, thus avoiding stuttering caused by loading too many map data points at once. Simultaneously, performing multiple rendering operations on the map data to be rendered avoids page stuttering and crashes caused by rendering all map data at once, improving the user experience. In addition, the first and second ratios ensure the integrity of the map data display, preventing the omission of noisy map data due to prioritizing map data cluster loading, and preventing excessive noisy map data from obscuring map data clusters. Ultimately, it accurately presents the spatial distribution patterns of the map data while ensuring rendering performance.
[0117] refer to Figure 4 , Figure 4 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 3 .like Figure 4As shown, based on the above embodiments, a fixed-number loading strategy for map rendering is introduced. This strategy includes a fixed number of loading operations, and the clustering results include multiple map data clusters and multiple noisy map data. The core is to calculate the fixed number of map data points to be loaded each time based on the fixed number of loading operations and the total number of map data points in the map data to be rendered. Then, multiple rendering operations are performed based on this fixed number of map data points. Details are as follows:
[0118] S401: Determine the number of fixed map data points to load based on the total number of map data points and the fixed number of loads.
[0119] In this embodiment, all map data points are extracted from the map data to be rendered, and their total number is counted and denoted as N.
[0120] In this embodiment, the fixed number of loads is Y. The fixed number of loads is the total number of rendering operations preset by business requirements or front-end performance; for example, if the rendering is completed in 1000 loads, then Y = 1000.
[0121] In this embodiment, the number of fixed map data points loaded is calculated according to the formula = N / Y, rounded down to ensure that the loading amount is an integer each time.
[0122] S402: Determine the number of map data points loaded for each map data cluster during each rendering based on the fixed number of map data points loaded and the first ratio.
[0123] In this embodiment, the first ratio is the first ratio calculated in step S304. The implementation process of step S402 is the same as that of step S3061, and will not be described again here.
[0124] S403: Determine the number of map data points loaded from multiple noisy map data during each rendering based on the fixed number of map data points loaded and the second ratio.
[0125] In this embodiment, the second ratio is the first ratio calculated in step S305. The implementation process of step S403 is the same as that of step S3062, and will not be described again here.
[0126] S404: During the process of rendering the map data to be rendered multiple times, each rendering is performed based on the number of map data points loaded in each map data cluster and the number of map data points loaded in multiple noisy map data clusters, so as to complete the rendering of the map data to be rendered and obtain the rendered map page.
[0127] In this embodiment, the implementation process of step S404 is the same as that of step S3063, and will not be described again here.
[0128] In summary, by using a fixed number of loads to deduce the fixed number of map data points loaded each time, the map data to be rendered is ensured to be evenly distributed within the fixed number of loads. By determining the number of map data points loaded for each map data cluster and the number of map data points loaded for multiple noisy map data clusters in each rendering, stuttering caused by loading too many map data points at once can be avoided. At the same time, performing multiple rendering operations on the map data to be rendered avoids page stuttering and crashes caused by rendering all map data at once, thus improving the user experience. In addition, the first and second ratios ensure the integrity of the map data display, preventing noisy map data from being missed due to prioritizing the loading of map data clusters, and preventing excessive noisy map data from obscuring map data clusters. Ultimately, while ensuring rendering performance, the spatial distribution pattern of the map data is accurately presented.
[0129] refer to Figure 5 , Figure 5 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 4 .like Figure 5 As shown, based on the above embodiments, a dynamically adjusted loading strategy for map rendering is introduced. This dynamically adjusted loading strategy includes dynamically loading the number of map data points, and the clustering results include multiple map data clusters and multiple noisy map data. The core is that the dynamically loaded number of map data points replaces the fixed number of map data points loaded, flexibly adjusting the number of map data points rendered each time based on the front-end page performance or the real-time data rendering status. Details are as follows:
[0130] S501: Get the total number of map data points in the map data to be rendered.
[0131] S502: Get the number of first map data points in each map data cluster.
[0132] S503: Obtain the number of second map data points in multiple noisy map data.
[0133] S504: Based on the number of first map data points and the total number of map data points, determine the first ratio of the number of first map data points to the total number of map data points in each map data cluster.
[0134] S505: Determine a second ratio of the number of second map data points to the total number of map data points in multiple noisy map data based on the number of second map data points and the total number of map data points.
[0135] In this embodiment, the implementation process of steps S501 to S505 is the same as that of steps S301 to S305, and will not be described again here.
[0136] S506: Based on the dynamic loading quantity of map data points, the first ratio, and the second ratio, perform multiple renderings to complete the rendering of the map data to be rendered and obtain the rendered map page.
[0137] In this embodiment, this stage is the core of dynamically adjusting the loading strategy. The key lies in the flexible adaptation of the number of map data points dynamically loaded, and then, in combination with the first ratio and the second ratio, the amount of map data loaded each time is allocated.
[0138] In this embodiment, the number of map data points dynamically loaded is denoted as X', which is not a fixed value but is dynamically determined based on real-time performance. Specifically, it is necessary to test and compile the time required to load several levels of map data, such as thousands and tens of thousands, in a single operation; and, without exceeding the human eye refresh rate by K times and the page response time, dynamically select the number of map data points loaded each time to determine the required combination of loading times.
[0139] Specifically, first test the actual time taken to load map data of different scales, such as 1000, 5000, and 10000 points. For example, if the test shows 2ms for 1000 map data points, 8ms for 5000, and 20ms for 10000, record the data volume-time comparison table. Define two upper limits: the maximum allowable time corresponding to K times the human eye refresh rate (calculated based on approximately 33ms per frame perceived by the human eye), the upper limit is 3.3ms when K=10 and 1.65ms when K=20; and the upper limit for page response time (e.g., in business scenarios where the page must not freeze, the response time must be less than or equal to 100ms). The upper limit is much greater than the former and is mainly constrained by it. From the comparison table, select the minimum value between the two upper limits. For example, when K=10, the selected time is 3.3ms. The time taken for 1000 map data points is 2ms, which is acceptable. The time taken for 5000 map data points is 8ms, which exceeds the limit. Therefore, the number of map data points loaded each time is 1000 map data points, which determines the number of times to load.
[0140] Specifically, step S506 includes S5061 to S5063:
[0141] S5061: Determine the number of map data points loaded for each map data cluster during each rendering based on the dynamically loaded number of map data points and the first ratio.
[0142] In this embodiment, the number of map data points loaded dynamically is replaced by the number of map data points loaded at a fixed rate. The implementation process of step S5061 is the same as that of step S3061, and will not be described again here.
[0143] S5062: Determine the number of map data points loaded from multiple noisy map data during each rendering based on the dynamic loading quantity of map data points and the second ratio.
[0144] In this embodiment, the number of map data points loaded dynamically is replaced by the number of map data points loaded at a fixed rate. The implementation process of step S5062 is the same as that of step S3062, and will not be described again here.
[0145] S5063: During the process of rendering the map data to be rendered multiple times, each rendering is performed based on the number of map data points loaded in each map data cluster and the number of map data points loaded in multiple noisy map data clusters, so as to complete the rendering of the map data to be rendered and obtain the rendered map page.
[0146] In this embodiment, the implementation process of step S5063 is the same as that of step S3061, and will not be described again here.
[0147] In summary, by dynamically adjusting the number of map data points loaded in the loading strategy, the slow loading when performance is sufficient or the stuttering when performance is insufficient can be avoided due to a fixed number of map data points. This adapts to different user device configurations and network conditions, further improving the user experience.
[0148] refer to Figure 6 , Figure 6 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 5 .like Figure 6 As shown, based on the above embodiments, a preset map rendering and loading strategy, namely the center-point radial loading strategy, is introduced. The center-point radial loading strategy includes a central map data point, and the clustering results include multiple map data clusters and multiple noisy map data. The core principle is to use the central map data point as a reference, calculate the step size of all map data points relative to the central map data point, and render the data in a hierarchical order from near to far. Details are as follows:
[0149] S601: Calculate the first step length between each map data point in each map data cluster and the central map data point.
[0150] In this embodiment, the latitude and longitude coordinates of the central map data point are (a, b). The coordinates of each map data point (a, b) are calculated. i b i The first step length between the central map data point (a, b) and the central map data point (a, b) is equal to |a|. i -a|+|b i -b|. Latitude and longitude coordinates are calculated using rounding.
[0151] In this embodiment, the first step is a quantitative indicator that measures the degree of spatial distance correlation between each map data point in each map data cluster and the central map data point.
[0152] S602: Calculate the second step length between each map data point and the center map data point in multiple noisy map data.
[0153] In this embodiment, the latitude and longitude coordinates of the central map data point are (a, b). The coordinates of each map data point (a, b) in multiple noisy map data sets are calculated. j b j The second step size between the central map data point (a, b) and the central map data point (a, b) is |a|. j -a|+|b j -b|. Latitude and longitude coordinates are calculated using rounding.
[0154] In this embodiment, the second step length is a quantitative indicator that measures the degree of spatial distance correlation between each map data point in multiple noisy map data and the central map data point.
[0155] S603: Using the central map data point as the center and different preset step sizes as the radius, the map data to be rendered is divided into multiple map data layers.
[0156] In this embodiment, different preset step sizes can be 1, 2, 3, ..., Z. In the map data to be rendered, a circular area centered on the central map data point and covered by a preset step size of 1 is divided into a map data layer L1; an annular area centered on the central map data point and covered by preset step sizes of 1-2 is divided into a map data layer L2; an annular area centered on the central map data point and covered by preset step sizes of 2-3 is divided into a map data layer L3, ..., and an annular area centered on the central map data point and covered by preset step sizes of Z-1 to Z is divided into a map data layer LZ. The map data to be rendered is divided into Z map data layers, namely L1, L2, L3, ..., LZ.
[0157] S604: Based on the first step length, the second step length, and multiple map data layers, the map data to be rendered is rendered multiple times to complete the rendering of the map data to be rendered and obtain the rendered map page.
[0158] In this embodiment, the map data layer in which each map data point in each map data cluster is located is determined based on the first step length between each map data point in each map data cluster and the central map data point; the map data layer in which each map data point in multiple noisy map data is located is determined based on the second step length between each map data point in multiple noisy map data and the central map data point.
[0159] In this embodiment, starting from map data layer L1, which is closest to the center map data point, L2, L3, ..., are rendered sequentially until the outermost layer LZ. For each map data layer, a first proportion of each map data cluster within that layer and a second proportion of multiple noisy data points are calculated. Referring to the above embodiment, the first proportion for map data cluster A1 is N1 / N, for map data cluster A2 is N2 / N, and for map data cluster A3 is N3 / N; the second proportion of the number of second map data points LN in the multiple noisy map data points to the total number of map data points N is LN / N. For map data cluster A1, each rendering step selects... One map data point; for map data cluster A2, select [a specific number of points] during each rendering. One map data point; for map data cluster A3, select [a specific number of points] during each rendering. The number of map data points; for the second ratio LN / N of multiple noisy map data, the number of map data points loaded during each rendering is... .
[0160] In this implementation, rendering is performed multiple times, based on the number of map data points loaded in each map data layer during each rendering of each map data cluster, as well as the number of map data points loaded from multiple noisy map data sets, until all map data points in each map data cluster are loaded. After each rendering, the loaded map data points are marked as loaded. During the next rendering, map data points are selected from the unloaded map data points in each map data cluster and loaded directly, thus completing the rendering of the map data to be rendered and obtaining the rendered map page.
[0161] In this embodiment, layers with higher map data point density will be rendered multiple times until all data within that layer has been rendered.
[0162] In summary, by using the central map data point as the center and different preset step sizes as the radii, the map data to be rendered is divided into multiple map data layers. Based on the first step size of each map data point in each map data cluster relative to the central map data point, and the second step size of each map data point in multiple noisy map data relative to the central map data point, the map data layers can be rendered from near to far according to the center point radial loading strategy, prioritizing the display of map domain data in the core area, further improving the user experience.
[0163] refer to Figure 7 , Figure 7 A flowchart illustrating the map data rendering method provided in the embodiments of this application. Figure 6 .like Figure 7 As shown, based on the above embodiments, the training process of the clustering algorithm is described in detail below:
[0164] S701: Obtain historical map data sample sets corresponding to multiple business scenarios.
[0165] In this embodiment, historical map data sample sets are collected according to business scenarios, such as smart building scenarios, connected vehicle scenarios, and logistics and transportation scenarios. Each historical map data sample set contains a large number of historical map data points under different business scenarios.
[0166] S702: For the map historical data sample set corresponding to each business scenario, perform the following operations to obtain the trained clustering algorithm corresponding to each business scenario.
[0167] Specifically, step S702 includes S7021~S7023:
[0168] S7021: Obtain the spherical distance between map data points in the historical map data sample set.
[0169] In this embodiment, all historical map data points in the historical map data sample set are traversed, and the spherical distance between any two map data points is calculated based on the Haversine formula, adapting to the characteristics of the Earth's surface.
[0170] S7022: Divide the historical map data sample set into multiple historical map data sub-sample sets.
[0171] In this embodiment, the Geohash algorithm is used to divide the historical map data sample set into rectangular grids of different precision, i.e., multiple historical map data subsets. The number of map data points contained in each grid is counted, i.e., the grid density. Grids with a density higher than a density threshold are marked as high-density grids. The spherical distance between any two high-density grids is calculated, and the maximum value is selected from all high-density grid spherical distances. This value reflects the spatial span between the two farthest dense regions in the current data distribution. The maximum spherical distance is used as a reference value for the neighborhood radius parameter in subsequent clustering algorithms, ensuring that the core radius can cover dense region associations within a reasonable range.
[0172] The density threshold is dynamically adjusted according to the business scenario; a higher value can be set for data-intensive areas, and a lower value can be set for sparse areas.
[0173] S7023: The clustering algorithm and clustering parameters are trained by training multiple historical map data subsets and the spherical distances between map data points.
[0174] In this embodiment, the clustering algorithms include the HDBSCAN algorithm and the OPTICS algorithm. The clustering parameters include the neighborhood radius parameter, the minimum number of points parameter, and the cluster sensitivity coefficient. Specifically, the HDBSCAN algorithm involves the neighborhood radius parameter and the minimum number of points parameter; the OPTICS algorithm involves the neighborhood radius parameter, the minimum number of points parameter, and the cluster sensitivity coefficient.
[0175] In this embodiment, the HDBSCAN algorithm is an improvement on the DBSCAN algorithm and is suitable for map data with uneven density; the OPTICS algorithm is similar in principle to the DBSCAN algorithm and analyzes clusters of different densities through reachability distance.
[0176] In this embodiment, the training process using the HDBSCAN algorithm is as follows: Initial parameters for the HDBSCAN algorithm are set, including the neighborhood radius parameter and the minimum number of points parameter. The neighborhood radius parameter uses the reference value from step S7022; geographic data is typically represented by latitude and longitude, i.e., two-dimensional coordinates. Therefore, the minimum number of points parameter is generally calculated using dimension × 2, i.e., 4.
[0177] In this embodiment, after setting the initial parameters, the data training process combines large-scale model training with tools such as Deepseek or Qwen. Multiple historical map data subsets are fed to the large model in batches for training. The large model is then corrected based on the actual results, and the parameters are adjusted to continue training. This process is repeated until a well-trained clustering algorithm and clustering parameters are obtained. The clustering parameters are the adjusted neighborhood radius and minimum number of points.
[0178] In this embodiment, the training process using the OPTICS algorithm is as follows: Initial parameters for the OPTICS algorithm are set, including the neighborhood radius parameter, the minimum number of points parameter, and the cluster sensitivity coefficient. The initial values for the neighborhood radius parameter and the minimum number of points parameter are the same as those for the HDBSCAN algorithm. The cluster sensitivity coefficient is set to ξ = 0.05 by default and can be adjusted according to actual conditions. The formula for setting the cluster sensitivity coefficient is: ξ = descent amplitude / ascent amplitude, where the descent amplitude refers to the maximum rate of change during the descent of the reachable distance, and the ascent amplitude is the maximum rate of change during the ascent of the reachable distance.
[0179] In this embodiment, after setting the initial parameters, the data training process combines large-scale model training with tools such as Deepseek or Qwen. Multiple historical map data subsets are fed to the large model in batches for training. The large model is then corrected based on the actual results, and the parameters are adjusted to continue training. This process is repeated until a well-trained clustering algorithm and clustering parameters are obtained. The clustering parameters include the adjusted neighborhood radius, minimum number of points, and cluster sensitivity coefficients.
[0180] In summary, by using historical map data sample sets corresponding to multiple business scenarios and training the algorithm separately for each scenario, the clustering algorithm can be adapted to the data characteristics of different business scenarios. Spherical distance calculation provides a quantitative basis that conforms to geospatial characteristics, ensuring that the clustering results accurately reflect the spatial relationships of data points. To make the clustering results more accurate, the historical map data sample set is divided into coarse-grained sub-sample sets. Based on this coarse-grained division, fine-grained clustering training is performed using multiple historical map data sub-sample sets and the spherical distances between map data points. This results in a well-trained clustering algorithm and clustering parameters, improving the accuracy of the clustering results.
[0181] Figure 8 This is a schematic diagram of the structure of the map data rendering apparatus provided in the embodiments of this application, as shown below. Figure 8 As shown, the map data rendering device provided in this embodiment includes: an acquisition module 801, a clustering module 802, a rendering module 803, and a display module 804.
[0182] The acquisition module 801 is used to acquire the map data to be rendered.
[0183] Clustering module 802 is used to cluster the map data to be rendered and obtain the clustering results.
[0184] The rendering module 803 is used to render the map data to be rendered multiple times based on the clustering results and a preset map rendering loading strategy to obtain the rendered map page.
[0185] The display module 804 is used to display the rendered map page on the front-end page.
[0186] In one possible implementation, the clustering result includes multiple map data clusters and multiple noisy map data; correspondingly, the clustering module 802 is specifically used for: obtaining the business scenario to which the map data to be rendered belongs based on the map data to be rendered; obtaining the pre-trained clustering algorithm corresponding to the business scenario; wherein the clustering parameters of the pre-trained clustering algorithm corresponding to different business scenarios are different; and using the pre-trained clustering algorithm based on the clustering parameters to cluster the map data to be rendered, thereby obtaining multiple map data clusters and multiple noisy map data.
[0187] In one possible implementation, the clustering parameters include a neighborhood radius parameter and a minimum number of points parameter. Accordingly, the clustering module 802 is specifically used to: obtain the spherical distance between map data points in the map data to be rendered; wherein the map data to be rendered includes multiple map data points; using a trained clustering algorithm, clustering the map data to be rendered according to the spherical distance between map data points, the neighborhood radius parameter, and the minimum number of points parameter, to obtain multiple core map data points and multiple initial map data clusters; one core map data point corresponds to one initial map data cluster; if there is at least one core map data point in the initial map data cluster corresponding to any core map data point, then merge it with the initial map data cluster corresponding to at least one core map data point to obtain the final multiple map data clusters; and determine at least one map data point in the map data to be rendered that has not been clustered into multiple map data clusters as multiple noisy map data points.
[0188] In one possible implementation, the clustering parameters include a neighborhood radius parameter, a minimum number of points parameter, and a cluster sensitivity coefficient. Correspondingly, the clustering module 802 is further configured to: obtain the spherical distance between map data points in the map data to be rendered; wherein the map data to be rendered includes multiple map data points; using a trained clustering algorithm, calculate the reachability distance of each map data point based on the spherical distance between them, the neighborhood radius parameter, and the minimum number of points parameter; determine multiple reachability descent points and multiple reachability ascent points based on the reachability distance of each map data point and the cluster sensitivity coefficient; determine any reachability descent point as the start of a map data cluster, and determine the reachability ascent point adjacent to any reachability descent point as the end of a map data cluster, thus obtaining multiple map data clusters; and determine multiple map data points in the map data to be rendered that are not clustered into multiple map data clusters as multiple noisy map data points.
[0189] In one possible implementation, the preset map rendering loading strategy is a fixed-point loading strategy; the fixed-point loading strategy includes a fixed number of map data points loaded; the clustering result includes multiple map data clusters and multiple noisy map data; correspondingly, the rendering module 803 is specifically used to: obtain the total number of map data points in the map data to be rendered; obtain the number of first map data points in each map data cluster; obtain the number of second map data points in the multiple noisy map data; determine a first ratio of the number of first map data points in each map data cluster to the total number of map data points based on the number of first map data points and the total number of map data points; determine a second ratio of the number of second map data points in the multiple noisy map data to the total number of map data points based on the number of second map data points and the total number of map data points; and perform multiple renderings based on the fixed number of map data points loaded, the first ratio, and the second ratio to complete the rendering of the map data to be rendered and obtain a rendered map page.
[0190] In one possible implementation, the rendering module 803 is further configured to determine the number of map data points loaded by each map data cluster during each rendering based on the fixed number of map data points loaded and a first ratio; determine the number of map data points loaded by multiple noisy map data clusters during each rendering based on the fixed number of map data points loaded and a second ratio; and during the process of rendering the map data to be rendered multiple times, rendering is performed each time based on the number of map data points loaded by each map data cluster and the number of map data points loaded by multiple noisy map data clusters, so as to complete the rendering of the map data to be rendered and obtain the rendered map page.
[0191] In one possible implementation, the preset map rendering loading strategy is a fixed-number loading strategy; the fixed-number loading strategy includes a fixed number of loadings; accordingly, the rendering module 803 is further configured to: determine a fixed number of map data points to be loaded based on the total number of map data points and the fixed number of loadings; determine the number of map data points loaded by each map data cluster during each rendering based on the fixed number of map data points loaded and a first ratio; determine the number of map data points loaded by multiple noisy map data clusters during each rendering based on the fixed number of map data points loaded and a second ratio; during the process of rendering the map data to be rendered multiple times, during each rendering, rendering is performed based on the number of map data points loaded by each map data cluster and the number of map data points loaded by multiple noisy map data clusters, so as to complete the rendering of the map data to be rendered and obtain the rendered map page.
[0192] In one possible implementation, the preset map rendering loading strategy is a dynamically adjusted loading strategy; wherein the dynamically adjusted loading strategy includes dynamically loading the number of map data points; the clustering result includes multiple map data clusters and multiple noisy map data; accordingly, the rendering module 803 is further configured to: obtain the total number of map data points in the map data to be rendered; obtain the number of first map data points in each map data cluster; obtain the number of second map data points in the multiple noisy map data; determine a first ratio of the number of first map data points in each map data cluster to the total number of map data points based on the number of first map data points and the total number of map data points; determine a second ratio of the number of second map data points in the multiple noisy map data to the total number of map data points based on the number of second map data points and the total number of map data points; and perform multiple renderings based on the dynamically loaded number of map data points, the first ratio, and the second ratio to complete the rendering of the map data to be rendered and obtain a rendered map page.
[0193] In one possible implementation, the rendering module 803 is further configured to determine the number of map data points loaded by each map data cluster during each rendering based on the dynamically loaded number of map data points and a first ratio; determine the number of map data points loaded by multiple noisy map data during each rendering based on the dynamically loaded number of map data points and a second ratio; and during the process of rendering the map data to be rendered multiple times, render the map data to be rendered by considering the number of map data points loaded by each map data cluster and the number of map data points loaded by multiple noisy map data during each rendering, thereby completing the rendering of the map data to be rendered and obtaining a rendered map page.
[0194] In one possible implementation, the preset map rendering loading strategy is a center-point radial loading strategy; wherein the center-point radial loading strategy includes a center map data point; the clustering result includes multiple map data clusters and multiple noisy map data; accordingly, the rendering module 803 is further configured to: calculate the first step length between each map data point in each map data cluster and the center map data point; calculate the second step length between each map data point in the multiple noisy map data and the center map data point; divide the map data to be rendered into multiple map data layers with the center map data point as the center and different preset step lengths as the radii; and perform multiple renderings on the map data to be rendered according to the first step length, the second step length, and the multiple map data layers to complete the rendering of the map data to be rendered and obtain the rendered map page.
[0195] In one possible implementation, the map data rendering device further includes a training module for acquiring map historical data sample sets corresponding to multiple business scenarios; performing the following operations on the map historical data sample sets corresponding to each business scenario to obtain a trained clustering algorithm for each business scenario; acquiring the spherical distance between each map data point in the map historical data sample set; dividing the map historical data sample set to obtain multiple map historical data sub-sample sets; and training based on the multiple map historical data sub-sample sets and the spherical distance between each map data point to obtain a trained clustering algorithm and clustering parameters.
[0196] The map data rendering device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0197] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 9 As shown, the electronic device provided in this embodiment includes at least one processor 901 and a memory 902. Optionally, the electronic device further includes a communication component 903. The processor 901, memory 902, and communication component 903 are connected via a bus.
[0198] In a specific implementation, at least one processor 901 executes computer execution instructions stored in memory 902, causing at least one processor 901 to perform the above-described method.
[0199] The specific implementation process of processor 901 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0200] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0201] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0202] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0203] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0204] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0205] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0206] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0207] The division of units is merely a logical functional division; 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 indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0208] 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.
[0209] In addition, the functional units in the various embodiments of the present invention 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.
[0210] If a function 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 invention, or the part that contributes to the prior art, or a 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 personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0211] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0212] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for rendering map data, characterized in that, Applied to electronic devices, including: Obtain the map data to be rendered; Cluster the map data to be rendered to obtain clustering results; Based on the clustering results, a preset map rendering and loading strategy is used to render the map data to be rendered multiple times to obtain a rendered map page. The rendered map page is then displayed on the front-end page.
2. The method according to claim 1, characterized in that, The clustering results include multiple map data clusters and multiple noisy map data; Accordingly, the clustering of the map data to be rendered to obtain clustering results includes: Based on the map data to be rendered, obtain the business scenario to which the map data to be rendered belongs; Obtain the pre-trained clustering algorithm corresponding to the business scenario; wherein the clustering parameters of the pre-trained clustering algorithm are different for different business scenarios; Based on the clustering parameters, the trained clustering algorithm is used to cluster the map data to be rendered, resulting in multiple map data clusters and multiple noisy map data.
3. The method according to claim 2, characterized in that, The clustering parameters include a neighborhood radius parameter and a minimum number of points parameter; Accordingly, based on the clustering parameters, the trained clustering algorithm is used to cluster the map data to be rendered, resulting in multiple map data clusters and multiple noisy map data, including: Obtain the spherical distance between each map data point in the map data to be rendered; wherein the map data to be rendered includes multiple map data points; Using the trained clustering algorithm, the map data to be rendered is clustered according to the spherical distance between each map data point, the neighborhood radius parameter, and the minimum number of points parameter, to obtain multiple core map data points and multiple initial map data clusters; one core map data point corresponds to one initial map data cluster. If any initial map data cluster corresponding to a core map data point contains at least one core map data point, then it is merged with the initial map data cluster corresponding to the at least one core map data point to obtain multiple final map data clusters. At least one map data point in the map data to be rendered that is not clustered into multiple map data clusters is identified as multiple noisy map data.
4. The method according to claim 2, characterized in that, The clustering parameters include the neighborhood radius parameter, the minimum number of points parameter, and the cluster sensitivity coefficient; Accordingly, based on the clustering parameters, the trained clustering algorithm is used to cluster the map data to be rendered, resulting in multiple map data clusters and multiple noisy map data, including: Obtain the spherical distance between each map data point in the map data to be rendered; wherein the map data to be rendered includes multiple map data points; Using the trained clustering algorithm, the reachable distance of each map data point is calculated based on the spherical distance between each map data point, the neighborhood radius parameter, and the minimum number of points parameter; Based on the reachability of each map data point and the sensitivity coefficient of the cluster, multiple reachability drop points and multiple reachability rise points are determined; Any reachable distance descent point is determined as the start of a map data cluster, and the reachable distance ascent point adjacent to the any reachable distance descent point is determined as the end of a map data cluster, thus obtaining multiple map data clusters; Multiple map data points in the map data to be rendered that are not clustered into multiple map data clusters are identified as multiple noisy map data.
5. The method according to claim 1, characterized in that, The preset map rendering and loading strategy is a fixed-point loading strategy; the fixed-point loading strategy includes a fixed number of map data points loaded; the clustering result includes multiple map data clusters and multiple noisy map data. Accordingly, the step of rendering the map data to be rendered multiple times based on the clustering results and using a preset map rendering and loading strategy to obtain a rendered map page includes: Obtain the total number of map data points in the map data to be rendered; Get the number of first map data points in each map data cluster; Obtain the number of second map data points in the plurality of noisy map data; Based on the number of the first map data points and the total number of map data points, a first ratio is determined between the number of the first map data points and the total number of map data points in each map data cluster; Based on the number of the second map data points and the total number of map data points, a second ratio is determined between the number of the second map data points and the total number of map data points in the plurality of noisy map data. Based on the number of fixed map data points loaded, the first ratio, and the second ratio, multiple renderings are performed to complete the rendering of the map data to be rendered, resulting in a rendered map page.
6. The method according to claim 5, characterized in that, The step of performing multiple renderings based on the fixed number of map data points loaded, the first ratio, and the second ratio to complete the rendering of the map data to be rendered and obtain a rendered map page includes: Based on the fixed number of map data points loaded and the first ratio, the number of map data points loaded for each map data cluster during each rendering is determined. The number of map data points loaded by the multiple noisy map data is determined for each rendering based on the number of fixed map data points loaded and the second ratio. During the process of rendering the map data to be rendered multiple times, each rendering is performed based on the number of map data points loaded in each map data cluster and the number of map data points loaded in the multiple noisy map data clusters, so as to complete the rendering of the map data to be rendered and obtain the rendered map page.
7. The method according to claim 6, characterized in that, The preset map rendering loading strategy is a fixed-number loading strategy; the fixed-number loading strategy includes a fixed number of loading times; Accordingly, the step of rendering the map data to be rendered multiple times based on the clustering results and using a preset map rendering and loading strategy to obtain a rendered map page includes: The number of fixed map data points to load is determined based on the total number of map data points and the fixed number of loads. Based on the fixed number of map data points loaded and the first ratio, the number of map data points loaded for each map data cluster during each rendering is determined. The number of map data points loaded by the multiple noisy map data is determined for each rendering based on the number of fixed map data points loaded and the second ratio. During the process of rendering the map data to be rendered multiple times, each rendering is performed based on the number of map data points loaded in each map data cluster and the number of map data points loaded in the multiple noisy map data clusters, so as to complete the rendering of the map data to be rendered and obtain the rendered map page.
8. The method according to claim 1, characterized in that, The preset map rendering and loading strategy is a dynamically adjusted loading strategy; wherein the dynamically adjusted loading strategy includes dynamically loading the number of map data points; the clustering result includes multiple map data clusters and multiple noisy map data. Accordingly, the step of rendering the map data to be rendered multiple times based on the clustering results and using a preset map rendering and loading strategy to obtain a rendered map page includes: Obtain the total number of map data points in the map data to be rendered; Get the number of first map data points in each map data cluster; Obtain the number of second map data points in the plurality of noisy map data; Based on the number of the first map data points and the total number of map data points, a first ratio is determined between the number of the first map data points and the total number of map data points in each map data cluster; Based on the number of the second map data points and the total number of map data points, a second ratio is determined between the number of the second map data points and the total number of map data points in the plurality of noisy map data. Based on the dynamically loaded number of map data points, the first ratio, and the second ratio, multiple renderings are performed to complete the rendering of the map data to be rendered, resulting in a rendered map page.
9. The method according to claim 8, characterized in that, The step of dynamically loading the number of map data points, the first ratio, and the second ratio, and performing multiple renderings to complete the rendering of the map data to be rendered, and obtaining a rendered map page, includes: Based on the dynamically loaded number of map data points and the first ratio, determine the number of map data points loaded for each map data cluster during each rendering. Based on the dynamically loaded number of map data points and the second ratio, the number of map data points loaded by the multiple noisy map data during each rendering is determined; During the process of rendering the map data to be rendered multiple times, each rendering is performed based on the number of map data points loaded in each map data cluster and the number of map data points loaded in the multiple noisy map data clusters, so as to complete the rendering of the map data to be rendered and obtain the rendered map page.
10. The method according to claim 1, characterized in that, The preset map rendering and loading strategy is a center-point radial loading strategy; The center point radial loading strategy includes a center map data point; the clustering result includes multiple map data clusters and multiple noisy map data. Accordingly, the step of rendering the map data to be rendered multiple times based on the clustering results and using a preset map rendering and loading strategy to obtain a rendered map page includes: Calculate the first step length between each map data point in each map data cluster and the central map data point; Calculate the second step length between each map data point in multiple noisy map data sets and the central map data point; Using the central map data point as the center and different preset step sizes as the radius, the map data to be rendered is divided into multiple map data layers; Based on the first step length, the second step length, and the multiple map data layers, the map data to be rendered is rendered multiple times to complete the rendering of the map data to be rendered and obtain the rendered map page.
11. The method according to claim 2, characterized in that, Before obtaining the map data to be rendered, the process also includes: Obtain historical map data sample sets corresponding to multiple business scenarios; For each business scenario, perform the following operations to obtain the trained clustering algorithm for each business scenario; Obtain the spherical distances between map data points in the historical map data sample set; The historical map data sample set is divided into multiple historical map data sub-sample sets; The clustering algorithm and clustering parameters are trained by using multiple historical map data subsets and the spherical distances between the map data points.
12. A map data rendering apparatus, characterized in that, Applied to electronic devices, including: The acquisition module is used to acquire the map data to be rendered; The clustering module is used to cluster the map data to be rendered and obtain the clustering results; The rendering module is used to render the map data to be rendered multiple times based on the clustering results and a preset map rendering and loading strategy to obtain a rendered map page. The display module is used to display the rendered map page on the front-end page.
13. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the method as described in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-11.
15. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-11.