Efficient rendering method and system for dynamically updating millions of coordinate points
Through the combination of message queue and memory database, vector tile data is processed in blocks and rendered on the client, which solves the performance bottleneck problem of millions of dynamic coordinate points in traditional rendering methods and achieves efficient rendering and smooth map interaction. Especially at small scales, rendering performance is significantly improved.
Patent Information
- Application Number
- CN202410985309.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-23
AI Technical Summary
Traditional rendering methods have serious performance bottlenecks when processing millions of dynamic coordinate points, resulting in slow rendering speed and interactive delay, especially at small scales, making it difficult to meet the smoothness requirements of map interaction.
Using the point data update and rendering method, the data to be updated is received through the message queue and stored in the memory database of the cluster server. The vector tile data is processed in blocks, RTree is used to quickly query, and the tile data is rendered on the client, combined with nginx Proxy and PostgreSQL persistent storage for efficient data updating and rendering.
It improves the rendering efficiency and system scalability of millions of dynamic coordinate points, reduces the server burden, ensures the reliability and integrity of data, and significantly improves rendering performance especially at small scales.
Smart Images

Figure CN118521694B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of map rendering, and in particular to an efficient rendering method and system for dynamically updating coordinate points at the million level. Background Art
[0002] With the rapid development of big data and geographic information technology, more and more application scenarios need to process and display massive amounts of coordinate point data. Especially in real-time monitoring systems, logistics tracking, and instant display of patrol locations, dynamic updating and efficient rendering of coordinate points have become key technical challenges. Traditional rendering methods often encounter performance bottlenecks when processing millions or even higher numbers of dynamic coordinate points, such as slow rendering speed and interactive delays. Therefore, how to effectively process and render these large amounts of dynamic data has become a technical problem that needs to be solved urgently.
[0003] In existing technologies, the solutions for processing millions of dynamically updated coordinate points mainly include the following:
[0004] Server-side aggregation processing: Before sending data to the client, the server first aggregates the coordinate points, merges multiple similar points into one aggregate point, and calculates its attributes (such as quantity, average value, etc.). The client only renders these aggregate points, thereby reducing the complexity of rendering. However, this method requires the server to have strong computing power for processing large amounts of data, and the computing pressure is particularly prominent for small-scale rendering.
[0005] Block rendering: Divide the map or view into multiple areas or levels, and render only the coordinate points in the area visible to the user according to the current viewing angle and zoom level. This method can effectively reduce the amount of data to be rendered and improve rendering efficiency, but there may be a short delay when switching areas or zooming, especially at small scales. The rendering delay will be very serious. In addition, the division by level will further increase the complexity of the work and reduce the availability of data. Summary of the invention
[0006] In response to the problems existing in the above-mentioned prior art, the present invention provides an efficient rendering method and system for dynamically updating coordinate points at the million level, which can take into account the problems of storing large amounts of data points and updating real-time point data, so that users can use these data for data analysis and decision-making more quickly, and render a large number of points updated in real time through algorithm decisions and display them on a map, thus meeting the requirements for smooth map interaction. This advantage is particularly obvious at a small scale, which effectively helps users analyze and understand the spatial relationships and trends of large-scale geographic data.
[0007] The present invention discloses an efficient rendering method for dynamically updating coordinate points at the level of millions, including: point data updating and point rendering, wherein the step of updating the point data includes:
[0008] The message queue receives the point data to be updated sent by the client;
[0009] The data management service of the cluster server is used to store the point data in the memory database of the cluster server in the operating system memory mode;
[0010] The point data received by the message queue is stored in a persistent database to provide initialization data for the memory database;
[0011] The step of point rendering includes:
[0012] The client determines the level and row and column numbers of each required vector tile based on the current range and scale;
[0013] The proxy server receives the request from the client and evenly sends the generation task of each vector tile to each generation vector tile service in the cluster server;
[0014] Generate vector tile service to request coordinate data corresponding to a single vector tile through data management service;
[0015] The point data of a single vector tile is divided into several blocks through the data management service, and the coordinate data of each block is queried in the memory database;
[0016] Generate vector tile service will obtain the coordinate data corresponding to a single vector tile, combine the range and scale to generate the corresponding vector tile;
[0017] The client determines the point rendering style according to the user settings, renders all vector tiles returned by the cluster server, and draws the rendered vector tiles to the client screen according to the corresponding range based on the level and row and column numbers of each vector tile.
[0018] Furthermore, the data management service of the cluster server stores the point data in the memory database of the cluster server in the operating system memory, including:
[0019] The message queue is monitored through the data management service. If point data to be updated is found, the memory database is called and the point data is stored in the operating system memory mode.
[0020] Furthermore, the step of updating the point data finally includes: removing the update message from the message queue.
[0021] Furthermore, the persistent database is a PostgreSQL database.
[0022] Furthermore, the proxy server is an nginx proxy server; and the vector tile generation service is a vector tile generation mvt service.
[0023] Furthermore, the point data of a single vector tile is processed into a plurality of blocks by the data management service, and the coordinate data of each block is queried in the memory database, including:
[0024] Through the data management service, the point data of a single vector tile is evenly divided into several blocks according to the specification of n*n, where n is a natural number greater than 1. Rtree is used in the memory database to quickly query the coordinate data of each block. Each block has a maximum query limit of a specified number.
[0025] The present invention also discloses an efficient rendering system for dynamically updating coordinate points at the level of millions, including: a client, a proxy server, a cluster server, and a persistent storage node, wherein:
[0026] The client is used to send the point data to be updated to the message queue;
[0027] The cluster server is used to store the point data in the memory database of the cluster server in the operating system memory through the data management service;
[0028] The persistent storage node is used to store the point data received by the message queue and to provide initialization data for the memory database;
[0029] The client is further used to: determine the level and row and column numbers of each required vector tile according to the current range and scale;
[0030] The proxy server is used to receive the request from the client and evenly send the generation task of each vector tile to each generation vector tile service in the cluster server;
[0031] The cluster server is further used to request the coordinate data corresponding to a single vector tile through the data management service by generating a vector tile service; to obtain a plurality of blocks by dividing the point data of the single vector tile through the data management service, and to query the coordinate data of each block in the memory database; to generate tile data of the corresponding vector tile by combining the range and scale with the coordinate data corresponding to the single vector tile obtained by the vector tile generation service;
[0032] The client is also used to determine the point rendering style according to the user settings, render all vector tiles returned by the cluster server, and draw the rendered vector tiles to the client screen according to the corresponding range based on the level and row and column numbers of each vector tile.
[0033] The present invention has at least the following beneficial effects:
[0034] 1. Memory storage technology: Use the operating system memory to store point data to achieve efficient data update and query.
[0035] 2. Application of message queues: Message queues not only serve as a cache mechanism to reduce the pressure on the memory database, but are also used for persistent storage of data to ensure that data will not be lost under any circumstances.
[0036] 3. Design of persistent storage repository: Use a database such as PostgreSQL as a persistent storage repository to provide initialization data for the in-memory database to ensure system reliability and data integrity.
[0037] 4. Clustered deployment strategy: Improve the system's processing power and scalability through clustered deployment and load balancing (such as using Nginx) to cope with rendering requests from a large number of users.
[0038] 5. Tile-level data request processing: Split the user's geographic scope and scale size requests into tile levels to improve the response efficiency of a single user request.
[0039] 6. Block request technology: Block requests are made for the point data of a single tile, and RTree is used in the memory database for efficient query, which optimizes the efficiency of obtaining data to be rendered at a small scale.
[0040] 7. Client-side rendering: The server only generates tile data, and the rendering process of the points (such as color selection, size value, etc.) is completed on the client, which reduces the burden on the server and increases the flexibility of users to set the rendering style.
[0041] Other beneficial effects of the present invention will be described in detail in the specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1It is a technical architecture diagram of an efficient rendering method for dynamically updating millions of coordinate points disclosed in a preferred embodiment of the present invention.
[0044] Figure 2 It is a data storage structure diagram of an efficient rendering method for dynamically updating millions of coordinate points disclosed in a preferred embodiment of the present invention.
[0045] Figure 3 It is a rendering point range query flow chart of an efficient rendering method for dynamically updating coordinate points at the million level disclosed in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0046] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0047] First, the technical means in the art involved in the present invention are explained:
[0048] Vector Tiles is a method of slicing geospatial data and storing it in a vector format, which provides efficient data transmission and rendering.
[0049] MVT (Mapbox VectorTiles) is an open vector tile standard proposed by Mapbox and widely supported. MVT uses Protocol Buffers (protobuf) as the data serialization format, supporting compression and efficient transmission of vector data.
[0050] Nginx refers to a lightweight, high-performance web server and reverse proxy server.
[0051] Message Queue is a common software architecture pattern and technology. Its main function is to transmit messages between different components, systems or processes to achieve asynchronous communication and task decoupling.
[0052] like Figures 1 to 3 As shown, the present invention discloses an efficient rendering method for dynamically updating coordinate points at the level of millions, including: point data updating and point rendering, wherein the step of updating the point data includes:
[0053] The message queue receives the point data to be updated sent by the client;
[0054] The data management service of the cluster server is used to store the point data in the memory database of the cluster server in the operating system memory mode;
[0055] The point data received by the message queue is stored in a persistent database to provide initialization data for the memory database;
[0056] The step of point rendering includes:
[0057] The client determines the level and row and column numbers of each required vector tile based on the current range and scale;
[0058] The proxy server receives the request from the client and evenly sends the generation task of each vector tile to each generation vector tile service in the cluster server;
[0059] Generate vector tile service to request coordinate data corresponding to a single vector tile through data management service;
[0060] The point data of a single vector tile is divided into several blocks through the data management service, and the coordinate data of each block is queried in the memory database;
[0061] Generate vector tile service will obtain the coordinate data corresponding to a single vector tile, combine the range and scale to generate the corresponding vector tile;
[0062] The client determines the point rendering style according to the user settings, renders all vector tiles returned by the cluster server, and draws the rendered vector tiles to the client screen according to the corresponding range based on the level and row and column numbers of each vector tile.
[0063] The technical solution is described in detail below in conjunction with embodiments.
[0064] Embodiment 1
[0065] The point data update process disclosed in this embodiment can handle the problem of storing and updating points with a large amount of data (millions of points) in real time, fully consider timeliness, and prevent data loss. The specific steps include:
[0066] ① When point data needs to be recorded, the user sends the point data to be updated to the message queue through the client. Preferably, the client pushes the user's updated location or attribute information (including the primary key) to the message queue.
[0067] ② After the data management service that has been monitoring the message queue finds that there is point data to be updated in the message queue, it calls the memory database to store this point data. This embodiment uses the operating system memory method to store point data. This storage method facilitates efficient update and query of data and improves the timeliness of user query data. This embodiment uses the message queue to push data to the memory database. The message queue plays a certain caching role here, reducing the impact of the peak stage of updating data on the memory database.
[0068] See also Figure 2 The database is stored in memory, and the data supports multiple tables. Each table includes a series of records consisting of primary keys, point coordinates and attributes, as well as RTree and BTree indexes that can speed up query efficiency.
[0069] ③Persistent storage is used to initialize memory. The principle is similar to the above steps. The message queue is used to push data to the persistent database. The persistent database can avoid the loss of updated point data. In this embodiment, the message queue is used to push data to the persistent storage library (which can be stored in a database such as PostgreSQL). The data in the persistent storage library is used for initialization of the memory database.
[0070] Furthermore, when the point data to be updated in the message queue has been stored in the corresponding database, the update message (point data) is removed from the message queue.
[0071] Embodiment 2
[0072] This embodiment solves the problem of low rendering efficiency for large amounts of data, and especially improves rendering efficiency for small scales. Figure 3 As shown in the figure, the rendering point range query process includes: calculating the required tile level and row and column numbers according to the current display range and scale; dividing a single tile into a block range evenly according to the specified number of blocks, obtaining data from the database by block, and terminating each block with the maximum number of records; generating a vector tile for all points in the single tile range according to the single tile range and scale; and returning all vector tiles in the range to the client.
[0073] Preferably, the point rendering process disclosed in this embodiment specifically includes:
[0074] ① The client that needs to display point data calculates the level and row and column numbers of all vector tiles based on the requested range and the current scale. In this embodiment, the range rendering task for a single user is split into tile-level granularity based on the requested geographic range and scale, and the data request for each tile range is sent to the cluster server for processing, so that the point data range request of a single user will be efficiently responded to.
[0075] ② The client sends the generation task of each vector tile to the vector tile generation mvt service evenly through the nginx proxy server. This embodiment supports clustered deployment strategy. When there are many users who request to query data for rendering, nginx can be used as a proxy service for load balancing, and the request tasks can be evenly distributed to each processing server / single machine in the cluster.
[0076] ③ Generate vector tile mvt service and request the corresponding coordinate data of a single vector tile through the data management service.
[0077] ④The data management service further divides the single tile range into blocks, evenly divided into n*n=block blocks, and uses Rtree in the memory database to quickly query the coordinate data of each block (which can also include attribute data). Each block can query at most the specified maxNum records.
[0078] This embodiment uses in-memory database storage to greatly improve the reading efficiency of point data.
[0079] This embodiment further makes a block request for the point data of a single tile, and this block request is completed on a single machine. The range of a single tile is evenly divided according to the number of blocks n*n, and each block range is efficiently queried in the memory database using RTree. Each block specifies a maximum number of points to be queried to save query time. This can not only efficiently obtain, but also display query results with a better point distribution, and the effect is very obvious at a small scale.
[0080] ⑤ Generate vector tiles The mvt service obtains the coordinate data corresponding to a single tile, combines the tile range and scale to generate a vector tile.
[0081] ⑥ The client obtains all vector tile data returned by the server according to the point rendering style set by the user, and draws it on the client screen according to the tile corresponding range. At this point, a complete point data rendering process is completed. In this embodiment, the server only generates tile data, and the rendering of points, such as point color selection, size value, etc., is completed on the client, which effectively reduces the pressure on the server. At the same time, the rendering process is placed on the client, and the user setting the rendering style process will be more flexible.
[0082] Embodiment 3
[0083] This embodiment discloses an efficient rendering system for dynamically updating millions of coordinate points, which is implemented based on the efficient rendering method for dynamically updating millions of coordinate points disclosed in the present invention. Figure 1, including: a client that updates coordinate data (the client at the top), a push middleware message queue that acts as a buffer, a point data processing service that supports cluster horizontal expansion, a point data persistence storage node, and a client that sends point request ranges and renders vector tile results (the client at the bottom). The point data processing service (cluster server) includes: a point data storage database (memory database), a data update and management server, and a vector tile mvt server.
[0084] Preferably, in an efficient rendering system with millions of dynamically updated coordinate points:
[0085] The client is used to send the point data to be updated to the message queue;
[0086] The cluster server is used to store the point data in the memory database of the cluster server in the operating system memory through the data management service;
[0087] The persistent storage node is used to store the point data received by the message queue and to provide initialization data for the memory database;
[0088] The client is further used to: determine the level and row and column numbers of each required vector tile according to the current range and scale;
[0089] The proxy server is used to receive the request from the client and evenly send the generation task of each vector tile to each generation vector tile service in the cluster server;
[0090] The cluster server is also used to generate a vector tile service to request coordinate data corresponding to a single vector tile through a data management service; divide the range of a single vector tile into blocks through the data management service, and query the coordinate data of each block in the memory database; generate tile data corresponding to the vector tile obtained by the vector tile service, and combine the range and scale to generate tile data of the corresponding vector tile;
[0091] The client is also used to receive tile data of all vector tiles returned by the cluster server according to the point rendering style set by the user, and draw the data on the client screen according to the range corresponding to the vector tiles.
[0092] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. An efficient rendering method for dynamically updating coordinate points at the million level, characterized in that: include: Point data updating and point rendering, wherein the step of updating the point data includes: The message queue receives the point data to be updated sent by the client; The point data to be updated is stored in the memory database of the cluster server in the operating system memory through the data management service of the cluster server; The point data to be updated received by the message queue is stored in a persistent database to provide initialization data for the memory database; The step of point rendering includes: The client determines the level and row and column numbers of each required vector tile based on the current range and scale; The proxy server receives the request from the client and evenly sends the generation task of each vector tile to each generation vector tile service in the cluster server; Generate vector tile service to request coordinate data corresponding to a single vector tile through data management service; The point data of a single vector tile is divided into several blocks through the data management service, and the coordinate data of each block is queried in the memory database; Generate vector tile service will obtain the coordinate data corresponding to a single vector tile, combine the range and scale to generate the corresponding vector tile; The client determines the point rendering style according to the user settings, renders all vector tiles returned by the cluster server, and draws the rendered vector tiles to the client screen according to the corresponding range based on the level and row and column numbers of each vector tile.
2. The efficient rendering method for dynamically updating coordinate points at the million level according to claim 1 is characterized in that: The data management service of the cluster server stores the point data in the memory database of the cluster server in the operating system memory, including: The message queue is monitored through the data management service. If point data to be updated is found, the memory database is called and the operating system memory is used to store the point data.
3. The efficient rendering method for millions of dynamically updated coordinate points according to claim 1 is characterized in that: The step of updating the point data finally includes: removing the update message from the message queue.
4. The efficient rendering method for dynamically updating coordinate points at the million level according to claim 1 is characterized in that: The persistent database is a PostgreSQL database.
5. The efficient rendering method for dynamically updating coordinate points at the million level according to claim 1 is characterized in that: The proxy server is an nginx proxy server; the vector tile generation service is a vector tile generation mvt service.
6. The efficient rendering method for dynamically updating coordinate points at the million level according to claim 1 is characterized in that: The data management service is used to process the point data of a single vector tile into blocks to obtain a plurality of blocks, and the coordinate data of each block is queried in the memory database, including: Through the data management service, the point data of a single vector tile is evenly divided into several blocks according to the specification of n*n, where n is a natural number greater than 1. Rtree is used in the memory database to quickly query the coordinate data of each block. Each block has a maximum query limit of a specified number.
7. An efficient rendering system with millions of dynamically updated coordinate points, characterized in that: include: Client, proxy server, cluster server, persistent storage node, where: The client is used to send the point data to be updated to the message queue; The cluster server is used to store the point data to be updated in the memory database of the cluster server in the operating system memory through the data management service; The persistent storage node is used to provide initialization data for the memory database by storing the point data to be updated received by the message queue; The client is further used to: determine the level and row and column numbers of each required vector tile according to the current range and scale; The proxy server is used to receive the request from the client and evenly send the generation task of each vector tile to each generation vector tile service in the cluster server; The cluster server is further used for requesting coordinate data corresponding to a single vector tile through a data management service by a vector tile generation service; performing block processing on the point data of a single vector tile through a data management service to obtain a plurality of blocks, and querying the coordinate data of each block in a memory database; generating tile data corresponding to a single vector tile by combining the coordinate data corresponding to the acquired single vector tile with a range and a scale through a vector tile generation service; The client is also used to determine the point rendering style according to the user settings, render all vector tiles returned by the cluster server, and draw the rendered vector tiles to the client screen according to the corresponding range based on the level and row and column numbers of each vector tile.
