Spatial data loading method and device for WebGIS (Web Geographic Information System) end and client

By using data resource proxy tools and cache database technology on the WebGIS side, the problem of low tile data loading efficiency in WebGIS system is solved, efficient spatial data loading and rendering is achieved, and the stability and availability of the system are improved.

CN120179940AActive Publication Date: 2025-06-20ZHONGKE XINGTU YIMA (WUXI) TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510253654.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-06-20
Estimated Expiration
2045-03-05

AI Technical Summary

Technical Problem

When existing WebGIS systems load large-scale three-dimensional scene data, the loading efficiency of tile data is low, resulting in frequent network requests, especially in poor network conditions, which may lead to system fake death.

Method used

By introducing data resource proxy tools on the WebGIS side, a map data request instruction is generated, and the request is processed according to the map data matching rules, the loaded spatial data is cached in the cache database of the client browser, reducing the number of network requests.

Benefits of technology

It improves the loading and rendering efficiency of map data, reduces the number of network requests, and enhances the stability and availability of the system, especially in the case of poor network conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179940A_ABST
    Figure CN120179940A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of visual data loading, and particularly discloses a loading method and device for spatial data of a WebGIS side and a client side, and the method comprises the steps that a map data request instruction is generated according to the scene loading requirement of the spatial data of the WebGIS side; a data resource agent tool is called, the map data request instruction is sent to the data resource agent tool, and the data resource agent tool is used for taking over a data request between the client side and the server side, processing the map data request instruction according to a map data matching rule to obtain a map data request result and sending the map data request result to the server side; the map data matching rule at least comprises data geographical range matching and data precision matching; and receiving a map data request result, and returning the map data request result to the WebGIS end to realize scene loading of the spatial data. According to the spatial data loading method for the WebGIS end, provided by the invention, the loading and rendering efficiency of the map data is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of visual data loading, and in particular to a method for loading spatial data on a WebGIS end, a device for loading spatial data on a WebGIS end, and a client. Background Art

[0002] With the rapid development and widespread application of GIS (Geographic Information System) technology, the data types of current WebGIS visualization are constantly enriched, and spatial data has transitioned from traditional 4D data to new surveying and mapping data such as oblique 3D models and 3D point clouds. There are multiple data types in the same area, such as image data, terrain data, vector data, oblique 3D models, point cloud data, etc. The current acceleration of 3D real-life technology has led to an increasing amount of 3D scene data loaded on the Web end.

[0003] At present, WebGIS systems need to slice spatial data. A large-scale 3D scene data needs to be processed by layers and blocks, and LOD (Level of Detail) construction. Therefore, when the 3D client map engine loads a 3D scene, it requests map tile data. A 3D map scene often has tens of thousands of tile data, or even more. Such a large number of data network requests seriously restricts the efficiency of spatial data loading. In the case of poor network conditions, it may even cause the client map interface to be in a state of waiting for data requests, causing the system to freeze.

[0004] Therefore, how to optimize the loading efficiency of tile data in the visualization scene to achieve efficient scheduling and rendering of massive spatial data on the WebGIS side has become a technical problem that technical personnel in this field need to solve urgently. Summary of the invention

[0005] The present invention provides a method for loading spatial data on a WebGIS end, a device for loading spatial data on a WebGIS end and a client, which solve the problem in the related art that the loading efficiency of tile data in a visualization scene cannot be optimized.

[0006] As a first aspect of the present invention, a method for loading spatial data on a WebGIS terminal is provided, which comprises: Generate map data request instructions based on the scene loading requirements of spatial data on the WebGIS side; Invoke the data resource proxy tool and send the map data request instruction to the data resource proxy tool. The data resource proxy tool is used to take over the data requests between the client and the server, and process the map data request instruction according to the map data matching rules to obtain a map data request result. The map data matching rules at least include data geographical range matching and data accuracy matching; Receive the map data request result and return the map data request result to the WebGIS side to achieve the scene loading of spatial data.

[0007] Further, processing the map data request instruction according to the map data matching rules to obtain a map data request result includes: Obtain proxy configuration information; When a map data request instruction is received, determine whether the resource proxy channel is open; If the resource proxy channel is not open, send the map data request instruction to the server to obtain a map data request result; If the resource proxy channel is open, obtain the map data request result according to the map data matching rules.

[0008] Further, obtaining the map data request result according to the map data matching rules includes: Judge whether the current map data request instruction needs to cache map data according to the map matching rules; If map data needs to be cached, request the current cached data of the client according to the map data request instruction to obtain the map data request result; If map data does not need to be cached, send the map data request instruction to the server to obtain a map data request result.

[0009] Further, requesting the current cached data of the client according to the map data request instruction to obtain the map data request result includes: Calculate a map key value according to the map data resource parameters in the map data request instruction; Query the cached database of the client according to the map key value to determine whether there is map data corresponding to the map key value in the cached database; If there is map data corresponding to the map key value in the cached database, read the map data corresponding to the map key value in the cached database; If there is no map data corresponding to the map key value in the cached database, send the map data request instruction to the server to update the cached database.

[0010] Further, it also includes the following steps after reading the map data in the cache database: Determine whether the map data corresponding to the map key value in the cache database has expired; If it has not expired, determine the map data corresponding to the map key value as the map data request result; If it has expired, send the map data request instruction to the server to update the cache database.

[0011] Further, determining whether the current map data request instruction needs to cache the map data according to the map matching rule includes: Generate map data resource request information according to the current map data request instruction according to the current map data request instruction; Judge whether the map data resource domain name exists in the domain name list according to the map data resource request information; If the map data resource domain name exists in the domain name list, judge whether the map data resource type is in the data type list; If the map data resource type is in the data type list, calculate the geographical range of the map data according to the map data resource request information, and judge whether the geographical range of the map data intersects with the cache range; If the geographical range of the map data intersects with the cache range, judge whether the current tile level in the map data resource request is in the cache level; If the current tile level is in the cache level, determine that the map data needs to be cached.

[0012] Further, the method for loading spatial data for the WebGIS side also includes the following steps before the step of calling the data resource proxy tool: Determine the center point coordinates of the current view according to the scene loading requirements of the spatial data on the WebGIS side; Query the target tile data according to the preset cache geographical range parameter, and calculate the distance between the center point coordinates of the target tile data and the center point coordinates of the current view; Determine the tile data priority sorting according to the distance between the center point coordinates of the target tile data and the center point coordinates of the current view; Determine the set of map tile data to be cached under the current view according to the tile data priority sorting; Generate a map data preloading request instruction according to the set of map tile data, wherein the data resource proxy tool can preload the set of map tile data to the client according to the map data preloading request instruction.

[0013] Further, the method for loading spatial data for the WebGIS side further includes the following steps before the step of calling the data resource proxy tool: Retrieving map data according to the map range in the preset cache rule to determine target tile data; Filtering the target tile data according to the map matching rule to determine offline map data; Generating an offline map data request instruction according to the offline map data, wherein the data resource proxy tool can pre-load the offline map data to the client according to the offline map data request instruction.

[0014] As another aspect of the present invention, there is provided a device for loading spatial data for the WebGIS side, which is used to implement the method for loading spatial data for the WebGIS side described above. The device includes: A request instruction generation module, configured to generate a map data request instruction according to the scenario loading requirement of the spatial data on the WebGIS side; A resource proxy call module, configured to call the data resource proxy tool and send the map data request instruction to the data resource proxy tool. The data resource proxy tool is used to take over the data request between the client and the server side, and process the map data request instruction according to the map data matching rule to obtain a map data request result. The map data matching rule at least includes data geographical range matching and data accuracy matching; A data return module, configured to receive the map data request result and return the map data request result to the WebGIS side to implement the scenario loading of the spatial data.

[0015] As another embodiment of the present invention, there is provided a client, which includes: a WebGIS side and the device for loading spatial data for the WebGIS side described above. The device for loading spatial data for the WebGIS side is communicatively connected to the WebGIS side. The device for loading spatial data for the WebGIS side can generate a map data request instruction according to the scenario loading requirement of the spatial data on the WebGIS side, can call the data resource proxy tool to process the map data request instruction to obtain a map data request result, and return the map data request result to the WebGIS side to implement the scenario loading of the spatial data.

[0016] The spatial data loading method for the WebGIS side provided by the present invention generates a map data request instruction based on the scene loading requirements of the spatial data on the WebGIS side, calls a data resource proxy tool to process the map data request instruction to obtain a map data request result, and returns the map data request result to the WebGIS side to achieve the scene loading of the spatial data. This spatial data loading method for the WebGIS side stores the loaded spatial data in the cache database of the client browser through the data resource proxy tool. When scheduling data, the data is read from the cache database, reducing the number of network requests, and realizing the efficient retrieval of spatial data through the API of the cache database, thereby greatly improving the loading and rendering efficiency of the map data. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the specification, and are used together with the following specific embodiments to explain the present invention, but do not constitute a limitation to the present invention.

[0018] Figure 1 It is a flowchart of the spatial data loading method for the WebGIS side provided by the present invention.

[0019] Figure 2 It is a flowchart of processing the map data request instruction provided by the present invention.

[0020] Figure 3 It is a flowchart of obtaining the map data request result according to the map data matching rule provided by the present invention.

[0021] Figure 4 It is a specific implementation flowchart of the data proxy mechanism provided by the present invention.

[0022] Figure 5 It is an implementation flowchart of the data rule matching process provided by the present invention.

[0023] Figure 6 It is a dynamic cache implementation flowchart before the step of calling the data resource proxy tool provided by the present invention.

[0024] Figure 7 It is a dynamic cache flowchart of the map view provided by the present invention.

[0025] Figure 8 It is an offline application flowchart provided by the present invention.

[0026] Figure 9 It is a structural block diagram of the spatial data loading device for the WebGIS side provided by the present invention.

[0027] Figure 10The structural block diagram of the client provided by the present invention. Detailed implementation manners

[0028] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other. The present invention will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0029] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so as to implement the embodiments of the present invention described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0031] In this embodiment, a method for loading spatial data for the WebGIS side is provided. Figure 1 It is a flowchart of the method for loading spatial data for the WebGIS side provided by the embodiment of the present invention, as Figure 1 shown, including: S100. Generate a map data request instruction according to the scene loading requirements of the spatial data on the WebGIS side; In the embodiment of the present invention, a map data request instruction is specifically generated according to the scene loading requirements of the spatial data on the WebGIS side, that is, the scene loading of the spatial data on the WebGIS side specifically needs to request some map data, and the request for the map data can specifically generate a map data request instruction, and the returned map data is obtained based on the map data request instruction. The map data request instruction can specifically include information such as the scene type of the spatial data and the center point of the map view, etc.

[0032] S200. Invoke the data resource proxy tool and send the map data request instruction to the data resource proxy tool. The data resource proxy tool is used to take over the data requests between the client and the server, and process the map data request instruction according to the map data matching rules to obtain a map data request result. The map data matching rules at least include data geographical range matching and data accuracy matching; In the embodiment of the present invention, the data resource proxy tool can be specifically understood as designing a layer of data proxy mechanism between the client data request and the server. All data requests are taken over through the data resource proxy, and then the data requests are uniformly processed in the resource proxy according to the configured data proxy rules and update policy mechanism. Finally, the data is returned to the map engine for rendering.

[0033] S300. Receive the map data request result and return the map data request result to the WebGIS side to implement the scene loading of spatial data.

[0034] In the embodiment of the present invention, receive the map data request result returned by the data resource proxy tool and return the map data request result to the WebGIS side to implement the scene loading of spatial data.

[0035] Therefore, the method for loading spatial data for the WebGIS side provided by the present invention generates a map data request instruction based on the scene loading requirements of the spatial data on the WebGIS side, invokes the data resource proxy tool to process the map data request instruction to obtain a map data request result, and returns the map data request result to the WebGIS side to implement the scene loading of spatial data. This method for loading spatial data for the WebGIS side stores the loaded spatial data in the cache database of the client browser through the data resource proxy tool. When scheduling data, read the data from the cache database, reduce the number of network requests, and realize the efficient retrieval of spatial data through the API of the cache database, thereby greatly improving the loading and rendering efficiency of map data.

[0036] In the embodiment of the present invention, process the map data request instruction according to the map data matching rules to obtain a map data request result, as Figure 2 shown, including: S210. Obtain proxy configuration information; In the embodiment of the present invention, the data resource proxy tool is specifically implemented by using the global resource proxy ProxyManager class. After initializing the global resource proxy ProxyManager class, obtain the proxy configuration information of the global resource proxy ProxyManager class.

[0037] S220. When receiving a map data request instruction, determine whether the resource proxy channel is open; In an embodiment of the present invention, after calling the data resource proxy tool, it is also necessary to confirm whether the data resource proxy tool has been enabled, that is, the resource proxy channel can be opened only after being enabled, and then the map data request instruction can be sent based on the resource proxy channel.

[0038] S230. If the resource proxy channel is not open, send the map data request instruction to the server to obtain a map data request result; It should be understood that if the data resource proxy tool is called but not enabled, the map data request instruction still needs to be sent to the server to obtain a map data request result.

[0039] S240. If the resource proxy channel is open, obtain the map data request result according to the map data matching rule.

[0040] In an embodiment of the present invention, obtaining the map data request result according to the map data matching rule, as Figure 3 shown, includes: S241. Determine whether the current map data request instruction needs to cache map data according to the map matching rule; It should be understood that according to the map data request instruction, it can be determined whether the currently requested map data needs to be cached. If it does not need to be cached, the map data request instruction can still be directly sent to the server when the resource proxy channel is open. If the currently requested map data is data that needs to be cached, the map data from the server can be cached to the current client, and the map data request result can be obtained by reading the cached map data later.

[0041] S242. If it is necessary to cache map data, request the current cached data of the client according to the map data request instruction to obtain the map data request result; In an embodiment of the present invention, when it is necessary to cache map data, the map data is specifically cached in the current client, and the cached data of the current client can be requested for map data.

[0042] Specifically, requesting the current cached data of the client according to the map data request instruction to obtain the map data request result includes: 1) Calculate a map key value according to the map data resource parameter in the map data request instruction; 2) Query the cache database of the client according to the map key value to determine whether there is map data corresponding to the map key value in the cache database; 3) If there is map data corresponding to the map key value in the cache database, read the map data corresponding to the map key value in the cache database; 4) If there is no map data corresponding to the map key value in the cache database, send the map data request instruction to the server to update the cache database.

[0043] S243. If it is not necessary to cache the map data, send the map data request instruction to the server to obtain the map data request result.

[0044] In the embodiment of the present invention, the specific implementation process of the data proxy mechanism is as Figure 4 shown. The present invention uniformly manages data resources through the global resource proxy ProxyManager class. First, initialize the system global proxy ProxyManager class to obtain proxy configuration information. When a data request enters the proxy, match the data resource parameters of the request according to proxy rules, such as domain name and file type rules, to determine whether to enable resource proxy. If the proxy is not enabled, return the result according to the default data request method. Otherwise, enter the proxy processing process. In the ProxyManager class, generate a unique Key value according to the requested map data block resource parameters, and then read IndexedDB according to the Key value to determine whether there is such data in the database. If the data does not exist, send the request to the backend for data resource request. After the request returns data, update the IndexedDB cache, and at the same time return the data to the map engine for rendering and drawing.

[0045] In the embodiment of the present invention, it also includes the following steps after reading the map data in the cache database: Determine whether the map data corresponding to the map key value in the cache database has expired; If it has not expired, determine the map data corresponding to the map key value as the map data request result; If it has expired, send the map data request instruction to the server to update the cache database.

[0046] It should be understood that as Figure 4 shown, if there is data in the cache database, then judge whether the data has expired according to the cache update policy configured in the ProxyManager class. If it has not expired, return the data. Otherwise, send the request to the backend. After the backend returns the data, update the IndexedDB database and return the data.

[0047] In the embodiment of the present invention, when the map data needs to be cached during the proxy mechanism, it can be implemented through a map matching rule. Specifically, judging whether the current map data request instruction needs to cache the map data according to the map matching rule includes: 1) determining, according to the current map data request instruction, that the current map data request instruction generates map data resource request information; 2) judging whether the map data resource domain name is in the domain name list according to the map data resource request information; 3) If the map data resource domain name exists in the domain name list, determine whether the map data resource type is in the data type list; 4) If the map data resource type is in the data type list, the map data geographic range is calculated according to the map data resource request information, and it is determined whether the map data geographic range intersects with the cache range; 5) If the geographic range of the map data intersects with the cache range, determine whether the current tile level in the map data resource request is in the cache level; 6) If the current tile level is in the cache level, it is determined that the map data needs to be cached.

[0048] It should be understood that in WebGIS maps, raster maps need to be sliced. The map is divided according to the map origin (upper left corner, lower left corner, etc.) according to the regular quadtree. When slicing a certain area, the fixed range is sliced ​​starting from the upper left corner (northwest corner). The first-level slice can generally use one picture. The quadtree data structure is used between subsequent maps of different levels. One slice on the nth level will become four slices at the n+1th level. Each slice is numbered in the form of "level number + row number + column number". The loading of the slice can be requested in the form of level number / column number / row number. The geographical scope of the data can be calculated by the level number and row and column number of the tile data, and the tile coordinates within the range can also be reversed by the geographical scope. A one-to-one correspondence is established between the tile data resource ID and the geographical scope. Therefore, a matching mechanism for geographical scope and data accuracy is added to the proxy matching rule, such as Figure 5 The data rule matching process is as follows: 1) First, request the data resource and pass in the resource ID; 2) Domain name matching. Determine whether the resource ID passed in is in the domain name list; 3) Data type matching: determine whether the resource data type is in the data type list; 4) Geographic range matching: obtain the level and row and column number of the tile data according to the resource ID, calculate the data geographic range according to the level row and column number, and determine whether the geographic range of the current tile data intersects with the limited range; 5) Data precision matching to determine whether the level number of the current tile is between the limited maximum and minimum level numbers; 6) Return the result.

[0049] In the embodiment of the present invention, in order to improve the loading efficiency, for networked users, data can be pre-loaded according to the visualization area specifically.

[0050] Specifically, as Figure 6 shown, the method for loading spatial data for the WebGIS side further includes the following steps before the step of calling the data resource proxy tool: S10. Determine the center point coordinates of the current view according to the scene loading requirements of the spatial data on the WebGIS side; S20. Query the target tile data according to the preset cached geographical range parameter, and calculate the distance between the center point coordinates of the target tile data and the center point coordinates of the current view; S30. Determine the tile data priority sorting according to the distance between the center point coordinates of the target tile data and the center point coordinates of the current view; S40. Determine the set of map tile data to be cached under the current view according to the tile data priority sorting; S50. Generate a map data pre-loading request instruction according to the set of map tile data, where the data resource proxy tool can pre-load the set of map tile data to the client according to the map data pre-loading request instruction.

[0051] In the embodiment of the present invention, in combination with Figure 7 the dynamic cache flow chart of the map view shown, after the map initialization is completed, it enters the message loop of map rendering. When operations such as map zooming in, zooming out, panning, and rotating are performed, a view change event will be triggered. After detecting the current view change, first obtain the center point coordinate position of the current view, query the eligible tile data according to the cached geographical range parameter configured by the user, then calculate the distance between the center point coordinates of each tile and the center point coordinates of the current view, sort the tile priorities according to the distance, so as to obtain the set of map tile data to be cached under the current view, and finally perform request caching processing on the map data to be cached. Through the above process, the map data within a certain area range around the center of the view point can be automatically calculated and pre-loaded according to the user's view position. When the user browses and pans, the data can be directly read from the cached data, realizing efficient browsing of the map.

[0052] In the embodiment of the present invention, for the data loaded into the client cache, offline applications can also be realized.

[0053] Specifically, the method for loading spatial data for the WebGIS side further includes the following steps before the step of calling the data resource proxy tool: (1) Retrieving map data according to the map range in the preset cache rule to determine target tile data; (2) Filtering the target tile data according to the map matching rule to determine offline map data; (3) Generating an offline map data request instruction according to the offline map data, wherein the data resource proxy tool can pre-load the offline map data to the client according to the offline map data request instruction.

[0054] In the embodiment of the present invention, specifically, the offline application process is as Figure 8 shown. First, initialize the system, generate a map cache ID according to the system configuration information, then load the cache rule set by the system, retrieve the map data within the map range set by the cache rule, query out the qualified tile data, then filter the data according to the set matching rule, and finally perform the request and storage process on the data. Through the above process, the map data within the user-specified range can be uniformly stored offline. Thus, the local storage of massive spatial data and the offline browsing of data are realized. The usability of spatial data in the offline environment is enhanced.

[0055] Next, taking the Web3DGIS map engine as an example, the specific implementation process of the method for loading spatial data for the WebGIS side in the embodiment of the present invention will be described in detail.

[0056] Cesium is specifically a WebGL-based map engine written in JavaScript, which is specifically an open-source product for three-dimensional earth and maps in JavaScript. This map engine provides a development package based on the JavaScript language, which is convenient for users to quickly build a virtual earth Web application without plugins, and has high-quality guarantees in terms of performance, accuracy, rendering quality, multi-platform, and usability, provides good touch support, and supports the vast majority of browsers and mobile terminals.

[0057] IndexedDB is a low-level API for storing large amounts of structured data (including files / binary large objects) on the client side. This API uses indexes to achieve high-performance search of data. IndexedDB is a transactional database system similar to an SQL-based RDBMS. It has the following application scenarios: 1) Easy access. IndexedDB is a JavaScript-based object-oriented database. IndexedDB can store and retrieve objects indexed by keys; it can store any object supported by the structured cloning algorithm.

[0058] 2) Offline applications. Use IndexedDB to store user data and application status. Even when there is no network connection, users can continue to operate, and the data will be automatically synchronized when the network connection is restored. For example, offline note-taking applications, offline task managers, etc.

[0059] 3) High-frequency data updates. IndexedDB supports high-frequency data writing and reading operations, suitable for storing and updating real-time data. For example, message storage in social networks, historical message storage in online chat applications, etc. IndexedDB is a low-level API provided in the browser for storing large amounts of structured data, including files / Binary Large OBjects (BLOBs). It is persistent and asynchronous, suitable for storing and querying large amounts of data.

[0060] 4) Client-side data caching. After obtaining data from the server, cache it in IndexedDB. Subsequent access can directly obtain it from the local database, reducing network latency. For example, news applications, blog platforms, caching of product data on e-commerce websites, etc.

[0061] 5) Storage of user personal settings. Web applications need to save user settings and preferences. Use IndexedDB to store user personal configurations (such as theme colors, layout selections, language preferences, etc.), and these settings can be restored when the user logs in again or changes devices. For example, dashboards, personalized news feeds, online editors, etc.

[0062] 6) Large file storage. There is a need to store and access a large number of files or binary data on the browser side. IndexedDB can store large files such as pictures, videos, and audio, and allows users to directly access and operate these files without downloading them to the local hard drive. For example, online video editors, image processing tools, audio editing tools, etc.

[0063] The present invention uses Cesium as the Web - end map rendering engine and IndexedDB as the Web - end spatial data cache database. The Cesium map engine supports OGC standard map service data, including types such as WMS service, WMTS service, TMS service, 3DTiles model service, I3S map service, etc. A resource management class Cesium.Resource is encapsulated in the Cesium framework, and all requests for spatial data resources are completed through the Cesium.Resource class. Therefore, through the cache management class ProxyManager, the cache management class is integrated into the Cesium.Resource class, so that all request resource parameters can be obtained when Cesium requests resource data, and the requests are uniformly processed through ProxyManager. A set of cache management mechanisms is designed in the ProxyManager class, and IndexedDB is used as the cache database to perform persistent storage management on various types of spatial data.

[0064] The embodiment of the present invention uses the oblique three - dimensional model of a certain area as the spatial data for testing, and the data situation is shown in Table 1.

[0065] Table 1 Test Data

[0066] Under the same environment, the data before and after enabling the cache is tested and statistically analyzed from four aspects: loading time, response time, storage occupancy, and memory occupancy. The test results are shown in Table 2.

[0067] Table 2 Experimental Results

[0068] It can be seen from the experiment that after enabling the cache, the response time, loading time, and memory usage for loading data from the same perspective are much smaller than those before enabling the cache. Therefore, it can be concluded that the client - side cache mechanism designed by the present invention can greatly reduce the data request response time and memory usage, thereby effectively improving the loading efficiency of massive spatial data.

[0069] In summary, the spatial data loading method for the WebGIS side provided by the embodiments of the present invention is based on the Web client caching technology. Utilizing the advantages of asynchronous data access, large data volume storage support, and efficient query and retrieval of the IndexedDB database, a client caching management mechanism for massive spatial data is designed. The data loaded by the system is uniformly stored and managed through the client cache, which can effectively reduce network requests and greatly improve the loading and rendering efficiency of spatial data. In addition, the client caching technology of the present invention can pre-cache the spatial data within a specified area, and realize the local storage and offline browsing of massive spatial data in an offline environment, enhancing the availability of spatial data in the offline environment. The dynamic caching mechanism based on the map perspective of the present invention can perform dynamic calculation and automatic caching of map data according to the perspective position, realize pre-loading of map data, and enhance the user experience. The client caching technology of the present invention supports the storage capacity of large data volumes and can realize the storage of GB-level client spatial data. At the same time, a flexible API is provided to facilitate the management of cached data, greatly increasing the usability, scalability, and flexibility of the system.

[0070] As another embodiment of the present invention, there is provided a spatial data loading device 100 for the WebGIS side, which is used to implement the spatial data loading method for the WebGIS side described above. Among them, as Figure 9 shown, it includes: A request instruction generation module 110, which is used to generate a map data request instruction according to the scene loading requirements of the spatial data on the WebGIS side; A resource proxy call module 120, which is used to call a data resource proxy tool and send the map data request instruction to the data resource proxy tool. Among them, the data resource proxy tool is used to take over the data request between the client and the server, and process the map data request instruction according to the map data matching rules to obtain a map data request result. The map data matching rules at least include data geographical range matching and data accuracy matching; A data return module 130, which is used to receive the map data request result and return the map data request result to the WebGIS side to realize the scene loading of spatial data.

[0071] The spatial data loading device for the WebGIS side provided by the present invention generates a map data request instruction based on the scene loading requirements of the spatial data on the WebGIS side, calls a data resource proxy tool to process the map data request instruction to obtain a map data request result, and returns the map data request result to the WebGIS side to achieve the scene loading of spatial data. Such a spatial data loading device for the WebGIS side stores the loaded spatial data in the cache database of the client browser through the data resource proxy tool. When scheduling data, it reads data from the cache database, reduces the number of network requests, and realizes the efficient retrieval of spatial data through the API of the cache database, thereby greatly improving the loading and rendering efficiency of map data.

[0072] For the specific working principle of the spatial data loading device for the WebGIS side provided by the present invention, reference can be made to the description of the spatial data loading method for the WebGIS side in the previous text, and details will not be elaborated here.

[0073] As another embodiment of the present invention, a client 10 is provided, wherein, as Figure 10 shown, it includes: a WebGIS side 200 and the aforementioned spatial data loading device 100 for the WebGIS side. The spatial data loading device 100 for the WebGIS side is communicatively connected to the WebGIS side 200. The spatial data loading device 100 for the WebGIS side can generate a map data request instruction according to the scene loading requirements of the spatial data on the WebGIS side, can call a data resource proxy tool to process the map data request instruction to obtain a map data request result, and return the map data request result to the WebGIS side to achieve the scene loading of spatial data.

[0074] The client provided by the present invention generates a map data request instruction based on the scene loading requirements of the spatial data on the WebGIS side, calls a data resource proxy tool to process the map data request instruction to obtain a map data request result, and returns the map data request result to the WebGIS side to achieve the scene loading of spatial data. Such a client stores the loaded spatial data in the cache database of the client browser through the data resource proxy tool. When scheduling data, it reads data from the cache database, reduces the number of network requests, and realizes the efficient retrieval of spatial data through the API of the cache database, thereby greatly improving the loading and rendering efficiency of map data.

[0075] For the specific working principle of the client provided by the present invention, reference can be made to the description of the spatial data loading method for the WebGIS side in the previous text, and details will not be elaborated here.

[0076] As another embodiment of the present invention, a spatial data loading system for the WebGIS side is provided, which specifically includes a server side and the client side described above, and the server side is communicatively connected to the client side. The spatial data loading system for the WebGIS side generates a map data request instruction based on the scene loading requirements of the spatial data on the WebGIS side, calls a data resource proxy tool to process the map data request instruction to obtain a map data request result, and returns the map data request result to the WebGIS side to implement the scene loading of the spatial data. This spatial data loading system for the WebGIS side stores the loaded spatial data in the cache database of the client browser through the data resource proxy tool. When scheduling data, it reads the data from the cache database, reduces the number of network requests, and realizes the efficient retrieval of spatial data through the API of the cache database, thereby greatly improving the loading and rendering efficiency of map data.

[0077] Regarding the specific working principle of the spatial data loading system for the WebGIS side, reference can be made to the description of the spatial data loading method for the WebGIS side above, and details will not be elaborated here.

[0078] It can be understood that the above embodiments are merely exemplary embodiments adopted to illustrate the principle of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also regarded as the protection scope of the present invention.

Claims

1. A method for loading spatial data on a WebGIS terminal, characterized in that: include: Generate map data request instructions based on the scene loading requirements of spatial data on the WebGIS side; Calling a data resource proxy tool and sending the map data request instruction to the data resource proxy tool, wherein the data resource proxy tool is used to take over the data request between the client and the server, and process the map data request instruction according to a map data matching rule to obtain a map data request result, wherein the map data matching rule at least includes data geographic range matching and data accuracy matching; The map data request result is received, and the map data request result is returned to the WebGIS end to realize scene loading of spatial data.

2. The method for loading spatial data for a WebGIS terminal according to claim 1, characterized in that: Processing the map data request instruction according to the map data matching rule to obtain a map data request result includes: Get proxy configuration information; When receiving a map data request instruction, determining whether the resource proxy channel is open; If the resource proxy channel is not open, sending the map data request instruction to the server to obtain the map data request result; If the resource proxy channel is opened, the map data request result is obtained according to the map data matching rule.

3. The method for loading spatial data for a WebGIS terminal according to claim 2, characterized in that: Obtaining the map data request result according to the map data matching rule includes: Determine whether the current map data request instruction needs to cache the map data according to the map matching rule; If the map data needs to be cached, a request is made to the current cached data of the client according to the map data request instruction to obtain the map data request result; If the map data does not need to be cached, the map data request instruction is sent to the server to obtain a map data request result.

4. The method for loading spatial data for a WebGIS terminal according to claim 2, characterized in that: Requesting the current cache data of the client according to the map data request instruction to obtain the map data request result, including: Calculating a map key value according to the map data resource parameter in the map data request instruction; Querying a cache database of a client according to the map key value to determine whether there is map data corresponding to the map key value in the cache database; If the map data corresponding to the map key value exists in the cache database, reading the map data corresponding to the map key value in the cache database; If the map data corresponding to the map key value does not exist in the cache database, the map data request instruction is sent to the server to update the cache database.

5. The method for loading spatial data for a WebGIS terminal according to claim 4, characterized in that: The method further includes the following steps after reading the map data in the cache database: Determine whether the map data corresponding to the map key value in the cache database is expired; If it is not expired, the map data corresponding to the map key value is determined as the map data request result; If it is expired, the map data request instruction is sent to the server to update the cache database.

6. The method for loading spatial data for a WebGIS terminal according to claim 3, characterized in that: Determine whether the current map data request instruction needs to cache the map data according to the map matching rule, including: determining, according to the current map data request instruction, that the current map data request instruction generates map data resource request information; Determining whether a map data resource domain name exists in a domain name list according to the map data resource request information; If the map data resource domain name exists in the domain name list, determining whether the map data resource type is in the data type list; If the map data resource type is in the data type list, calculating the map data geographic range according to the map data resource request information, and determining whether the map data geographic range intersects with the cache range; If the geographic range of the map data intersects with the cache range, it is determined whether the current tile level in the map data resource request is in the cache level; If the current tile level is in the cache level, it is determined that the map data needs to be cached.

7. The method for loading spatial data for a WebGIS terminal according to any one of claims 1 to 6, characterized in that: The method for loading spatial data on the WebGIS terminal further includes the following steps before calling the data resource proxy tool: Determine the center point coordinates of the current viewing angle according to the scene loading requirements of the spatial data on the WebGIS end; Query the target tile data according to the preset cache geographic range parameters, and calculate the distance between the center point coordinates of the target tile data and the center point coordinates of the current viewing angle; Determine the priority sorting of tile data according to the distance between the center point coordinates of the target tile data and the center point coordinates of the current viewing angle; Determining a set of map tile data that needs to be cached at a current viewing angle according to the tile data priority ranking; A map data pre-loading request instruction is generated according to the map tile data set, wherein the data resource proxy tool can pre-load the map tile data set to the client according to the map data pre-loading request instruction.

8. The method for loading spatial data for a WebGIS terminal according to any one of claims 1 to 6, characterized in that: The method for loading spatial data on the WebGIS terminal further includes the following steps before calling the data resource proxy tool: Retrieving the map data according to the map range in the preset cache rule to determine the target tile data; Matching the target tile data according to a map matching rule to determine offline map data; An offline map data request instruction is generated according to the offline map data, wherein the data resource agent tool can preload the offline map data to the client according to the offline map data request instruction.

9. A device for loading spatial data on a WebGIS terminal, used to implement the method for loading spatial data on a WebGIS terminal as claimed in any one of claims 1 to 8, characterized in that: include: The request instruction generation module is used to generate map data request instructions according to the scene loading requirements of the spatial data on the WebGIS end; A resource agent calling module, used for calling a data resource agent tool and sending the map data request instruction to the data resource agent tool, wherein the data resource agent tool is used for taking over the data request between the client and the server, and processing the map data request instruction according to the map data matching rule to obtain the map data request result, wherein the map data matching rule at least includes data geographic range matching and data accuracy matching; The data return module is used to receive the map data request result and return the map data request result to the WebGIS end to realize the scene loading of spatial data.

10. A client, characterized in that: include: A WebGIS end and a spatial data loading device for the WebGIS end as described in claim 9, wherein the spatial data loading device for the WebGIS end is communicatively connected to the WebGIS end, and the spatial data loading device for the WebGIS end can generate a map data request instruction according to the scene loading requirements of the spatial data of the WebGIS end, can call a data resource proxy tool to process the map data request instruction to obtain a map data request result, and return the map data request result to the WebGIS end to realize the scene loading of the spatial data.

Citation Information

Patent Citations

  • EnersunWebCache based method for dynamically generating cached power grid map tiles

    CN105608191A

  • Map data loading method based on GIS platform

    CN118132662A

  • A method for optimizing resource loading at mobile browsers based on cloud-client cooperation

    US20180287960A1