Map application system and method of massive real-time data loading mode
By cutting and storing massive map data on the server and sending requests to obtain the required area data according to the client's scaling level, the problems of long response time, high processing pressure and poor real-time performance when processing 1000W or higher order of magnitude data in the prior art are solved, and faster data loading and rendering are achieved.
Patent Information
- Application Number
- CN202411372060.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art cannot effectively process data of 1000W or higher, resulting in long response time for data processing flow, high processing pressure on map engines and poor real-time performance.
By storing data greater than the threshold value on the server to a preset memory and cutting it into a two-dimensional array area based on the latitude and longitude, the client detects the map zoom level, sends corresponding data requests to obtain the required area data, and reduces network data transmission.
It realizes reducing network data transmission under massive data conditions, reducing client rendering pressure, and improving data real-time and response speed.
Smart Images

Figure CN119537497A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic technology applications, and in particular to a map application system and method for loading massive real-time data. Background Art
[0002] When modern WEB-GIS (Web Geographic Information System) / mobile GIS (Geographic Information System) map applications process massive business data rendering, developers usually request all data from the backend, and then centralize all data in the GIS map engine for rendering and display.
[0003] The defect is that when the data volume is small <= 10W, the client initiates a data request to the server for response, the server returns the data to the client, and the client parses the business data from the data returned by the server, and finally notifies the GIS engine to render the point data in the layer. The response speed of the entire process is short because of the small data volume. Client A initiates an http request from the client to the server response and then to the front-end GIS map engine to parse and display the point data. The response time is short, and the overall rendering process speed can meet user needs.
[0004] However, when the data changes, for example, if 1000W or more data needs to be rendered, when the client requests data, the server needs to read the data and then return the data to the client through the http link. The entire link takes a long time. Therefore, when the data increases exponentially, the existing pure client request data, post-rendering solution will have the following problems:
[0005] 1. The client requests 10 million or more data, resulting in a longer response time for the entire process:
[0006] The traditional way is that the client first initiates a business request, carrying request parameters to obtain all business point data from the server. When the data volume is small, for example, there are only 100,000 ships, these data are compressed by the server and gzip transmission compression. When they reach the client, they have been compressed to about 3M. The entire network transmission link has a low occupancy rate and a fast response, and the client renders faster after parsing the data.
[0007] However, when querying the data of 10 million ships, it is converted into 300M data, which means that if the traditional transmission method is still used, user A enters the web page and wants to view ships all over the world, user A will need to wait for several minutes.
[0008] 2. The map engine has high processing pressure:
[0009] 300M of data, 10 million points, densely traversed on the map, may be possible on high-end PCs and mobile devices, but definitely not on mid- and low-end devices.
[0010] 3. Poor data real-time performance:
[0011] Regarding the second problem, the excessive amount of data leads to a very long transmission time. The resulting phenomenon is that the client map has not yet obtained the data of the previous time period, but the data of the next time period has already been requested, and the effectiveness of the data is very poor.
[0012] Currently, no effective solution has been proposed to address the problems of long response time in data processing flow, high processing pressure on map engines and poor real-time performance, as existing technologies cannot meet data processing requirements of 1000W or higher. Summary of the invention
[0013] In order to solve the above technical problems, the embodiments of the present invention hope to provide a map application system and method for massive real-time data loading, so as to at least solve the problem that the data processing process has a long response time, the map engine has a high processing pressure and poor real-time performance due to the inability of the prior art to meet the data processing requirements of 1000W or higher.
[0014] The technical solution of the present invention is achieved in this way:
[0015] The embodiment of the present invention provides a map application system in a massive real-time data loading mode, comprising: a client and a server, wherein the server is used to store data greater than a threshold value in a preset memory, and cut the data into two-dimensional array areas according to longitude and latitude; the client is used to detect whether the map zoom level is greater than the preset level, and if the detection result is no, display the specified point; if the detection result is yes, send a first data request to the server, wherein the first data request includes a request for a value of longitude and latitude greater than a preset multiple of the display screen window; the server is also used to obtain corresponding regional data in the two-dimensional array area according to the first data request, and return the regional data to the client; the client is also used to receive the regional data returned by the server, and detect whether the current display range exceeds the range of the regional data according to a drag or zoom operation; if the current display range does not exceed the range of the regional data, perform data processing according to the drag or zoom operation; if the current display range exceeds the range of the regional data, send a second data request to the server, so that the server obtains the corresponding regional data in the two-dimensional array area according to the second data request, and returns the regional data corresponding to the second data request to the client.
[0016] Optionally, the server is also used to perform calculations based on the updated data when data is updated, determine the location of the updated data in the two-dimensional array area, and add the updated data to the two-dimensional array area based on the location.
[0017] An embodiment of the present invention provides a map optimization method in a massive real-time data loading mode, including: storing data greater than a threshold value in a preset memory, and cutting the data into two-dimensional array areas based on longitude and latitude; receiving a first data request sent by a client; obtaining corresponding regional data in the two-dimensional array area based on the first data request; returning the regional data to the client; when the client detects that the current display range exceeds the range of the regional data based on a drag or zoom operation, receiving a second data request sent by the client; obtaining corresponding regional data in the two-dimensional array area based on the second data request, and returning the regional data corresponding to the second data request to the client.
[0018] Optionally, the method further includes: when data update occurs, performing calculations based on the updated data, determining the position of the updated data in the two-dimensional array region, and adding the updated data to the two-dimensional array region based on the position.
[0019] An embodiment of the present invention provides a map optimization method in a massive real-time data loading mode, including: detecting whether the map zoom level is greater than a preset level; if the detection result is no, displaying a specified point; if the detection result is yes, sending a first data request to a server, wherein the first data request includes a request for a latitude and longitude value that is greater than a preset multiple of a display screen window; receiving regional data returned by the server; detecting whether the current display range exceeds the range of the regional data based on a dragging or zooming operation; if the current display range does not exceed the range of the regional data, performing data processing based on the dragging or zooming operation; if the current display range exceeds the range of the regional data, sending a second data request to the server.
[0020] The embodiment of the present invention provides a map application system and method in a massive real-time data loading mode, wherein a server is used to store data greater than a threshold value in a preset memory, and the data is cut into a two-dimensional array area according to longitude and latitude; a client is used to detect whether the map zoom level is greater than the preset level, and if the detection result is no, the specified point is displayed; if the detection result is yes, a first data request is sent to the server, wherein the first data request includes a request for a value of longitude and latitude greater than a preset multiple of the display screen window; the server is also used to obtain corresponding regional data in the two-dimensional array area according to the first data request, and return the regional data to the client; the client is also used to receive the regional data returned by the server, and detect whether the current display range exceeds the range of the regional data according to a drag or zoom operation; if the current display range does not exceed the range of the regional data, data processing is performed according to the drag or zoom operation; if the current display range exceeds the range of the regional data, a second data request is sent to the server, so that the server obtains the corresponding regional data in the two-dimensional array area according to the second data request, and returns the regional data corresponding to the second data request to the client, thereby reducing network data transmission and alleviating the technical effect of client rendering pressure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0022] Figure 1 A schematic diagram of a map application system for loading massive real-time data provided by an embodiment of the present invention;
[0023] Figure 2 A schematic diagram of dividing a two-dimensional array area in a map application system in a massive real-time data loading mode provided by an embodiment of the present invention;
[0024] Figure 3 A schematic diagram of data updating in a map application system in a massive real-time data loading mode provided by an embodiment of the present invention;
[0025] Figure 4 A schematic diagram of a process flow of map loading optimization in a map application system in a massive real-time data loading mode provided by an embodiment of the present invention;
[0026] Figure 5 A flowchart of a map optimization method for loading massive real-time data on a server side provided by an embodiment of the present invention;
[0027] Figure 6A schematic diagram of the process flow on the client side of a map optimization method for loading massive real-time data provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second" and the like in the specification, claims and drawings of the present invention are used to distinguish different objects rather than to limit a specific order.
[0030] It should also be noted that the following embodiments of the present invention may be executed separately, or in combination with each other, and the embodiments of the present invention do not impose any specific limitations on this.
[0031] The embodiment of the present invention provides a map application system with a massive real-time data loading method. Figure 1 A schematic diagram of a map application system for loading massive real-time data provided by an embodiment of the present invention; Figure 1 As shown, the map application system for loading massive real-time data provided by the embodiment of the present application includes:
[0032] The client 12 and the server 14 are configured to store data greater than a threshold value in a preset memory and cut the data into two-dimensional array regions according to longitude and latitude. The client 12 is configured to detect whether the zoom level of the map is greater than the preset level, and display the specified point if the detection result is no. If the detection result is yes, a first data request is sent to the server 14, wherein the first data request includes a request for a value of longitude and latitude greater than a preset multiple of the display screen window. The server 14 is further configured to obtain corresponding regional data in the two-dimensional array region according to the first data request, and return the regional data to the client 12. The client 12 is further configured to receive the regional data returned by the server 14, and detect whether the current display range exceeds the range of the regional data according to a dragging or zooming operation. If the current display range does not exceed the range of the regional data, data processing is performed according to the dragging or zooming operation. If the current display range exceeds the range of the regional data, a second data request is sent to the server 14, so that the server 14 obtains corresponding regional data in the two-dimensional array region according to the second data request, and returns the regional data corresponding to the second data request to the client 12.
[0033] Optionally, the server 14 is further configured to perform calculations based on the updated data when data is updated, determine the location of the updated data in the two-dimensional array region, and add the updated data to the two-dimensional array region based on the location.
[0034] Specifically, in the embodiment of the present application, the data greater than the threshold may be 1000w data, or data greater than 1000w. In the embodiment of the present application, the data greater than the threshold may be massive data. Only 1000W data is taken as an example for illustration. The map application system that implements the massive real-time data loading method provided in the embodiment of the present application shall prevail, and no specific limitation shall be made.
[0035] The preset storage in the embodiment of the present application may be a memory. In the prior art, the data of the server 14 are all stored in a hard disk, and the data response speed of the memory is much higher than that of the hard disk. The preset storage in the embodiment of the present application is described using the memory as an example, and is based on the map application system that implements the massive real-time data loading method provided in the embodiment of the present application, without specific limitation.
[0036] In the embodiment of the present application, the data can be cut into two-dimensional array areas according to longitude and latitude:
[0037] Figure 2 A schematic diagram of dividing a two-dimensional array area in a map application system for loading massive real-time data provided by an embodiment of the present invention; Figure 2 As shown, according to the longitude and latitude of the map, the map is cut into 360*90 regional viewports in the manner of 1 longitude and 1 latitude: N region = 360×180 = 648,00 (region);
[0038] When stored in memory, it is actually a two-dimensional data. Each time the client 12 initiates a request, the server 14 can calculate which array areas the user's map viewport spans from the viewport longitude and latitude carried in the request. For example, the latitude and longitude viewports of the lower left corner and the upper right corner such as 120, 10-121, 11 can calculate that the subscripts of the two-dimensional array to be taken are from 119 to 122, and the subscripts of the internal array taken out are from 99 to 101, so that a total of 9 divided viewports are obtained.
[0039] Index calculation formula:
[0040] Longitude index range: [floor(lonmin)+180,ceil(lonmax)+180];
[0041] Latitude index range: [ceil(latmin)+90,floor(latmax)+90];
[0042] Among them, floor is rounded down, ceil is rounded up, lonmin is the longitude of the lower left corner of the screen, lonmax is the longitude of the upper right corner of the screen, latmin is the latitude of the lower left corner of the screen, and latmax is the latitude of the upper right corner of the screen;
[0043] If the latitude and longitude of the lower left and upper right of the current screen are [120,30][121,31], the calculated array index range is [300,301],[120,121]. When traversing the two-dimensional array, get the one-dimensional array from subscript 300 to 301, and take the data from subscript 120 to 121 from the one-dimensional array respectively.
[0044] Because the server 14 pre-processes the data, the time spent on calculating the data is only spent on the index calculation formula.
[0045] In addition, after obtaining the two-dimensional array area, the server 14 performs a rough aggregation operation on the 10 million data, for example, 10 million points can be aggregated into 100,000 points.
[0046] Figure 3 A schematic diagram of data updating in a map application system in a massive real-time data loading mode provided by an embodiment of the present invention; Figure 3 As shown, every time new data needs to be updated, the new data is divided into 360 longitude areas and 180 latitude areas by cutting the world into 1 precision and 1 latitude. That is, a subscript starts from 0, and each subitem is an array of 180 lengths, to a two-dimensional array with a subscript of 360. The position in the two-dimensional array area is obtained by calculation, and then the data is added to the corresponding position of the two-dimensional array area.
[0047] Based on the above, on the client 12 side, when entering the page for the first time, before the map zoom level reaches a preset level such as level 8 (i.e., the preset level in the embodiment of the present application), only 100,000 points roughly aggregated by the server 14 are displayed on the map.
[0048] After the map level reaches level 8, each time the server 14 zooms or drags the map, the current value that is twice the longitude and latitude of the current screen window (that is, the longitude and latitude value that is greater than the preset multiple of the display screen window in the embodiment of the present application) is carried in the request (that is, the first data request in the embodiment of the present application) and transmitted to the server 14.
[0049] After obtaining the longitude and latitude, the server 14 calculates the area in the first data request that is located in the 360*180 areas according to the two-dimensional array area, and returns the area data to the client 12;
[0050] After the client 12 receives the data of twice the longitude and latitude of the viewport (i.e., the regional data in the embodiment of the present application), it cuts the current longitude and latitude time of twice the current screen window according to the longitude and latitude in the same way as the server 14, and can also divide it into a two-dimensional array of size N*M.
[0051] The longitude and latitude of the current screen window are calculated on the client 12 according to the longitude and latitude of the current viewport and the above index calculation formula, and the data twice the longitude and latitude of the viewport is rendered into the current screen window.
[0052] Each time the map is dragged and zoomed, it is calculated whether the current viewport exceeds the double viewport area recorded last time. If it exceeds, a request is sent to the server (i.e., the second data request in the embodiment of the present application). If it does not exceed, the client performs data processing based on the dragging or zooming operation, that is, the client renders / optimizes the map based on the regional data.
[0053] For example, when a user drags the map, every time the dragging time exceeds 0.5s, a request with the longitude and latitude of the current screen viewport is sent to the server. If the viewport data calculated by the server based on the longitude and latitude is the same each time, the map reuses the last business data each time. If it is different, the map business data is re-rendered.
[0054] In a preferred example, each time the client sends a request, the longitude and latitude sent to the server are twice the longitude and latitude of the client's current viewport. At this time, this twice viewport is recorded, and when the user drags and zooms the viewport of the map, as long as the screen viewport does not exceed this twice viewport, there is no need to re-initiate a request to obtain data;
[0055] Based on the above, the user experience will be improved. A thread can be started on the client to calculate the business data rendered in the client's current viewport within 2 times the viewport, which improves the response speed. At the same time, it also greatly reduces the data request pressure on the server, so that 10 million data does not need to be transmitted to the client, and it can be smoothly loaded and used on the map. And when new data appears, the server only needs to calculate the latest data and partition the latest data according to the previously defined method. The front end does not need to be changed, and the effectiveness of the data can be guaranteed. The map application system with massive real-time data loading method provided by the embodiment of the present invention calculates the business data in the real-time viewport based on the cache of massive data cut according to longitude and latitude, and ensures efficient and high-speed rendering efficiency.
[0056] In summary, Figure 4 A flowchart of map loading optimization in a map application system in a massive real-time data loading mode provided by an embodiment of the present invention; Figure 4As shown, on the client side, when there is a drag or zoom operation, that is, the user has more data browsing needs for the map, so in an embodiment of the present application, the client sends a data request that is twice the longitude and latitude of the client's current viewport to the server, and the server calculates the data subscript within the longitude and latitude range (within the two-dimensional array area) based on the longitude and latitude, and returns the area data to the client. On the client, the area data is cut according to one longitude and one latitude, and the cut area data is cached on the client, and the cut area data is used to display on the display screen viewport; when the client detects a user drag or zoom operation, it determines whether the drag or zoom operation exceeds the range of the area data. If the judgment result is yes, the client continues to send a data request that is twice the longitude and latitude of the client's current viewport to the server; if the judgment result is no, the client displays the corresponding data from the area data based on the drag or zoom operation.
[0057] The embodiment of the present invention provides a map application system in a massive real-time data loading mode, wherein a server is used to store data greater than a threshold value in a preset memory, and the data is cut into a two-dimensional array area according to longitude and latitude; a client is used to detect whether the map zoom level is greater than the preset level, and if the detection result is no, the specified point is displayed; if the detection result is yes, a first data request is sent to the server, wherein the first data request includes a request for a value of longitude and latitude greater than a preset multiple of the display screen window; the server is also used to obtain corresponding area data in the two-dimensional array area according to the first data request, and return the area data to the client; the client is also used to receive the area data returned by the server, and detect whether the current display range exceeds the range of the area data according to a drag or zoom operation; if the current display range does not exceed the range of the area data, data processing is performed according to the drag or zoom operation; if the current display range exceeds the range of the area data, a second data request is sent to the server, so that the server obtains the corresponding area data in the two-dimensional array area according to the second data request, and returns the area data corresponding to the second data request to the client, thereby reducing network data transmission and alleviating the technical effect of client rendering pressure.
[0058] The embodiment of the present invention provides a map optimization method in a massive real-time data loading mode, which is applied to the map application system in the massive real-time data loading mode. Figure 5 A flow chart of a map optimization method for massive real-time data loading on the server side provided by an embodiment of the present invention; Figure 5 As shown, on the server side, the map optimization method for massive real-time data loading provided by the embodiment of the present application includes:
[0059] Step S500, storing data greater than a threshold value in a preset memory, and cutting the data into two-dimensional array regions according to longitude and latitude;
[0060] Step S502, receiving a first data request sent by a client;
[0061] Step S504, acquiring corresponding area data in the two-dimensional array area according to the first data request;
[0062] Step S506, returning the region data to the client;
[0063] Step S508, when the client detects that the current display range exceeds the range of the regional data according to the dragging or zooming operation, receiving a second data request sent by the client;
[0064] Step S510, obtaining corresponding regional data in the two-dimensional array region according to the second data request, and returning the regional data corresponding to the second data request to the client.
[0065] Optionally, the map optimization method for massive real-time data loading provided in an embodiment of the present application also includes: when a data update occurs, calculations are performed based on the updated data to determine the position of the updated data in the two-dimensional array area, and the updated data is added to the two-dimensional array area based on the position.
[0066] The embodiment of the present invention provides a map optimization method in a massive real-time data loading mode, which stores data greater than a threshold value in a preset memory, and cuts the data into two-dimensional array areas according to longitude and latitude; receives a first data request sent by a client; obtains corresponding area data in the two-dimensional array area according to the first data request; returns the area data to the client; when the client detects that the current display range exceeds the range of the area data according to a dragging or zooming operation, receives a second data request sent by the client; obtains corresponding area data in the two-dimensional array area according to the second data request, and returns the area data corresponding to the second data request to the client, thereby reducing network data transmission and alleviating the rendering pressure on the client.
[0067] The embodiment of the present invention provides a map optimization method in a massive real-time data loading mode, which is applied to the map application system in the massive real-time data loading mode. Figure 6 A flowchart of a map optimization method for massive real-time data loading on the client side provided by an embodiment of the present invention; Figure 6 As shown, on the client side, the map optimization method for massive real-time data loading provided by the embodiment of the present application includes:
[0068] Step S600, detecting whether the map zoom level is greater than a preset level;
[0069] Step S602, when the detection result is negative, display the designated point;
[0070] Step S604, if the detection result is yes, sending a first data request to the server, wherein the first data request includes a request for a latitude and longitude value greater than a preset multiple of the display screen window;
[0071] Step S606, receiving the region data returned by the server;
[0072] Step S608, detecting whether the current display range exceeds the range of the regional data according to the dragging or zooming operation;
[0073] Step S610, if the current display range does not exceed the range of the regional data, data processing is performed according to the dragging or zooming operation;
[0074] Step S612: If the current display range exceeds the range of the regional data, a second data request is sent to the server.
[0075] The embodiment of the present invention provides a map optimization method in a massive real-time data loading mode, which detects whether the map zoom level is greater than the preset level; if the detection result is no, the specified point is displayed; if the detection result is yes, a first data request is sent to a server, wherein the first data request includes a request for a latitude and longitude value that is greater than a preset multiple of the display screen window; regional data returned by the server is received; based on a drag or zoom operation, whether the current display range exceeds the range of the regional data is detected; if the current display range does not exceed the range of the regional data, data processing is performed based on the drag or zoom operation; if the current display range exceeds the range of the regional data, a second data request is sent to the server, thereby reducing network data transmission and alleviating the client rendering pressure. Technical effect.
[0076] The above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention.
Claims
1. A map application system with massive real-time data loading, characterized in that: include: Client and server, where The server is used to store data greater than a threshold value in a preset memory, and cut the data into two-dimensional array regions according to longitude and latitude; The client is used to detect whether the map zoom level is greater than a preset level, and if the detection result is no, display the specified point; if the detection result is yes, send a first data request to the server, wherein the first data request includes a request for a latitude and longitude value greater than a preset multiple of the display screen window; The server is further configured to obtain corresponding region data in the two-dimensional array region according to the first data request, and return the region data to the client; The client is also used to receive the regional data returned by the server, and detect whether the current display range exceeds the range of the regional data based on a dragging or zooming operation; if the current display range does not exceed the range of the regional data, perform data processing based on the dragging or zooming operation; if the current display range exceeds the range of the regional data, send a second data request to the server, so that the server obtains the corresponding regional data in the two-dimensional array area based on the second data request, and returns the regional data corresponding to the second data request to the client.
2. The map application system of massive real-time data loading method according to claim 1 is characterized in that: The server is also used to perform calculations based on the updated data when data is updated, determine the position of the updated data in the two-dimensional array area, and add the updated data to the two-dimensional array area based on the position.
3. A map optimization method for massive real-time data loading, characterized in that: include: The data greater than the threshold value is stored in a preset memory, and the data is cut into two-dimensional array areas according to longitude and latitude; Receiving a first data request sent by a client; Acquire corresponding area data in the two-dimensional array area according to the first data request; Returning the region data to the client; When the client detects that the current display range exceeds the range of the regional data according to the dragging or zooming operation, receiving the second data request sent by the client; The corresponding area data in the two-dimensional array area is obtained according to the second data request, and the area data corresponding to the second data request is returned to the client.
4. The map optimization method of massive real-time data loading method according to claim 3 is characterized in that: The method further comprises: When data update occurs, calculation is performed based on the updated data to determine the position of the updated data in the two-dimensional array region, and the updated data is added to the two-dimensional array region based on the position.
5. A map optimization method for massive real-time data loading, characterized in that: include: Check whether the map zoom level is greater than the preset level; If the test result is negative, the specified point is displayed; If the detection result is yes, a first data request is sent to the server, wherein the first data request includes a request for a latitude and longitude value greater than a preset multiple of the display screen window; Receiving the region data returned by the server; Detecting whether the current display range exceeds the range of the regional data according to the dragging or zooming operation; If the current display range does not exceed the range of the regional data, data processing is performed according to the zoom operation; If the current display range exceeds the range of the regional data, a second data request is sent to the server.