Method for dynamically loading three-dimensional entity by considering local offline cache
Through local offline cache processing and dynamic loading of three-dimensional entities, the dynamic loading and offline cache problems of three-dimensional entities in large space are solved, and the efficient and convenient use of three-dimensional entities is achieved.
Patent Information
- Application Number
- CN202411796036.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The prior art is difficult to effectively solve the problems of dynamic loading and offline caching of three-dimensional entities in large space range, especially in three-dimensional entities in the form of vector tile, which leads to serious fragmentation problems and inconvenient offline access.
By setting the geospatial range and map display level of the research area, performing local offline cache processing, dynamically loading three-dimensional entities, merging and generating the merged three-dimensional entities and index files, automatically publishing to the server, and providing a network access service interface.
It realizes dynamic loading of three-dimensional entities in space range after pre-local offline cache processing, enhances the efficiency and convenience of three-dimensional entities, and solves the problems of fragmentation and offline access inconvenience.
Smart Images

Figure CN119645529A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of urban planning, smart city, geographic information system and the like, and in particular to a method for dynamically loading three-dimensional entities taking into account local offline caching. Background Art
[0002] Three-dimensional entities play an important role in various current map application services, such as map navigation, various types of smart city information systems, urban lifeline systems, and national space information systems. At present, there are still the following potential important needs and problems in practical applications, namely: for a three-dimensional entity with a large spatial range, it is generally published in the form of vector map tiles. If these vector map tiles are to be loaded according to the actual spatial range of each project, a large number of vector tiles need to be loaded dynamically, and the fragmentation problem is relatively serious. At the same time, in some practical applications, since the three-dimensional entity needs to be accessed offline, the client needs to download a lot of online three-dimensional entities in the form of vector tiles in advance. For a large number of three-dimensional entities in the form of vector tiles, a large number of small files will make copying and distribution inconvenient in the application. For this reason, it is currently necessary to provide a technology that can cache the three-dimensional entities originally organized in the form of vector tiles offline, and can dynamically generate a local and overall three-dimensional entity according to the actual project spatial range. Summary of the invention
[0003] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a method for dynamically loading three-dimensional entities taking into account local offline caching. Based on the vector tile composition characteristics of three-dimensional entities, the present invention can realize dynamic loading of three-dimensional entities according to spatial range after pre-local offline caching processing.
[0004] The present invention adopts the following technical solutions to solve the above technical problems:
[0005] In a first aspect, a method for dynamically loading a three-dimensional entity considering a local offline cache is provided according to the present invention, comprising the following steps:
[0006] Step 1, set the geographic space range a of the study area and the first map display level v1, download the first three-dimensional entity offline, and obtain the local offline cached data, which is recorded as the first data set A;
[0007] Step 2, dynamically load the first three-dimensional entity, set conditions, the conditions refer to the study area b and the second map display level v2, calculate the second three-dimensional entities that meet the conditions in the first data set A, and all the second three-dimensional entities are recorded as the second data set B;
[0008] Step 3: merge all second three-dimensional entities in the second data set B to generate a merged third three-dimensional entity W and an index file I;
[0009] Step 4: automatically publish the third three-dimensional entity W and the index file I to the server, and provide a network access service interface;
[0010] Step 5: The client dynamically loads the third three-dimensional entity W generated in step 3 through the network access service interface in step 4;
[0011] Step 6: If the time for loading the third three-dimensional solid W generated in step 3 is greater than a specified threshold, execute step 7;
[0012] If the time for loading the third three-dimensional solid W generated in step 3 is not greater than the specified threshold, step 7 is not performed;
[0013] Step 7: Divide the study area b into multiple sub-study areas in equal proportion, traverse the multiple sub-study areas, set the study area b as the sub-study area, and execute steps 2 to 6.
[0014] As a further optimization scheme of the method for dynamically loading three-dimensional entities considering local offline caching according to the present invention, step 1 includes:
[0015] Step 1.1, according to the geographic space range a of the study area and the first map display level v1, determine all the numbers of the downloaded map vector tiles of the first three-dimensional entity;
[0016] Step 1.2, traverse all the numbers of the map vector tiles obtained in step 1.1 in sequence, and calculate the map vector tile coordinate values of the four vertices of the circumscribed rectangle of each map vector tile in each traversal process;
[0017] Step 1.3, according to the map vector tile coordinate values of the four vertices of the circumscribed rectangle of each map vector tile in step 1.2, capture the first three-dimensional entity and store it in the local offline cache location; after the traversal is completed, all local offline cached data is recorded as the first data set A.
[0018] As a further optimization scheme of the method for dynamically loading three-dimensional entities taking into account local offline caching described in the present invention, the scope of the study area b in step 2 is within the geographic space scope a.
[0019] As a further optimization scheme of the method for dynamically loading three-dimensional entities considering local offline caching according to the present invention, step 3 includes:
[0020] Step 3.1, merging all three-dimensional entities in the second data set B into a third three-dimensional entity W in b3dm format;
[0021] Step 3.2: Calculate the index file I of the third three-dimensional entity W.
[0022] As a further optimization scheme of the method for dynamically loading three-dimensional entities considering local offline caching described in the present invention, in step 3.2, the format of the index file of the third three-dimensional entity W is tileset.json.
[0023] As a further optimization scheme of the method for dynamically loading three-dimensional entities considering local offline caching described in the present invention, step 4 automatically publishes the third three-dimensional entity W and the index file I to the nginx server.
[0024] As a further optimization scheme of the method for dynamically loading three-dimensional entities considering local offline caching described in the present invention, the network access service interface provided by the nginx server in step 4 is the access address of index file I.
[0025] As a further optimization scheme of the method for dynamically loading three-dimensional entities considering local offline caching described in the present invention, step 5 is to load the network access service interface in step 4 through the Cesium map library to realize dynamic access to the third three-dimensional entity W generated in step 3.
[0026] In a second aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein when the processor executes the computer program, the steps of the method for dynamically loading three-dimensional entities taking into account local offline caching as described in the first aspect above or any corresponding embodiment thereof are implemented.
[0027] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for dynamically loading three-dimensional entities considering local offline caching as described in the first aspect above or any corresponding embodiment thereof are implemented.
[0028] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:
[0029] (1) The present invention provides a method for dynamically loading three-dimensional entities taking into account local offline caching, which can realize dynamic loading of three-dimensional entities according to spatial range after local offline caching processing in advance, thereby enhancing the efficiency and convenience of on-demand use of three-dimensional entities;
[0030] (2) Based on the vector tile composition characteristics of three-dimensional entities, the present invention proposes a method for dynamically loading three-dimensional entities taking into account local offline caching. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic diagram of an overall process of the present invention;
[0032] Figure 2 It is a schematic diagram of the coordinate distribution of the four vertices of the three-dimensional vector tile;
[0033] Figure 3 It is a schematic diagram of range relationship;
[0034] Figure 4 It is a schematic diagram of the process of dynamically loading three-dimensional entities. DETAILED DESCRIPTION
[0035] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings:
[0036] Step 1: See attached Figure 1 , set the geographic space range a of the study area and the first map display level v1, download the first three-dimensional entity offline, and obtain the local offline cached data, which is recorded as the first data set A;
[0037] Step 1.1, according to the geographic space range a of the study area and the first map display level v1, determine all the numbers of the downloaded map vector tiles of the first three-dimensional entity;
[0038] Step 1.2, traverse all the numbers of the map vector tiles obtained in step 1.1 in sequence, and calculate the map vector tile coordinate values of the four vertices of the circumscribed rectangle of each map vector tile in each traversal process;
[0039] Step 1.3, according to the map vector tile coordinate values of the four vertices of the circumscribed rectangle of each map vector tile in step 1.2, capture the first three-dimensional entity and store it in the local offline cache location; after the traversal is completed, all local offline cached data is recorded as the first data set A.
[0040] See attached Figure 2 , download the 3D entity data through the 4 vertices of the circumscribed rectangle of each map vector tile, thereby ensuring that the offline cache data is standardized. When further calls are needed later, they can be quickly retrieved.
[0041] Step 2, dynamically load the first three-dimensional entity, set conditions, the conditions refer to the study area b and the second map display level v2, calculate the second three-dimensional entities that meet the conditions in the first data set A, and all the second three-dimensional entities are recorded as the second data set B;
[0042] See attached Figure 3 In this step, the scope of the study area b is within the geographic space scope a.
[0043] Step 3, see attached Figure 4, merge all second three-dimensional entities in the second data set B to generate a merged third three-dimensional entity W and an index file I;
[0044] Step 3.1, merging all three-dimensional entities in the second data set B into a third three-dimensional entity W in b3dm format;
[0045] Step 3.2: Calculate the index file I of the third three-dimensional entity W, where the format of the index file of the third three-dimensional entity W is tileset.json.
[0046] Step 4, see attached Figure 4 , automatically publish the third three-dimensional entity W and the index file I to the server, and provide a network access service interface; wherein, the third three-dimensional entity W and the index file I can be automatically published to the nginx server.
[0047] The network access service interface provided by the nginx server is the access address of the index file I.
[0048] Step 5: The client dynamically loads the third three-dimensional entity W generated in step 3 through the network access service interface in step 4.
[0049] Step 5 is to load the network access service interface in step 4 through the Cesium map library to dynamically access the third three-dimensional entity W generated in step 3.
[0050] Step 6: If the time for loading the third three-dimensional solid W generated in step 3 is greater than a specified threshold, execute step 7;
[0051] If the time for loading the third three-dimensional solid W generated in step 3 is not greater than the specified threshold, step 7 is not performed;
[0052] The specified threshold here refers to the tolerance value of the time consumed by the client to load the third 3D entity W generated in step 3. Generally speaking, a large range will lead to a large amount of data and a longer loading time. Therefore, a loading time tolerance value can be set. If the value exceeds this value, the area to be loaded can be further divided so that the speed of data loading in each divided area can be within the tolerance value range.
[0053] Step 7: Divide the study area b into multiple sub-study areas in equal proportion, traverse the multiple sub-study areas, set the study area b as the sub-study area, and execute steps 2 to 6.
[0054] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the steps of the method for dynamically loading three-dimensional entities taking into account local offline cache when executing the computer program.
[0055] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for dynamically loading three-dimensional entities taking into account local offline cache as described above.
[0056] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0057] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0058] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0059] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0060] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0061] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for dynamically loading three-dimensional entities considering local offline caching, characterized in that: The following steps are involved: Step 1, set the geographic space range a of the study area and the first map display level v1, download the first three-dimensional entity offline, and obtain the local offline cached data, which is recorded as the first data set A; Step 2, dynamically load the first three-dimensional entity, set conditions, the conditions refer to the study area b and the second map display level v2, calculate the second three-dimensional entities that meet the conditions in the first data set A, and all the second three-dimensional entities are recorded as the second data set B; Step 3: merge all second three-dimensional entities in the second data set B to generate a merged third three-dimensional entity W and an index file I; Step 4: automatically publish the third three-dimensional entity W and the index file I to the server, and provide a network access service interface; Step 5: The client dynamically loads the third three-dimensional entity W generated in step 3 through the network access service interface in step 4; Step 6: If the time for loading the third three-dimensional solid W generated in step 3 is greater than a specified threshold, execute step 7; If the time for loading the third three-dimensional solid W generated in step 3 is not greater than the specified threshold, step 7 is not performed; Step 7: Divide the study area b into multiple sub-study areas in equal proportion, traverse the multiple sub-study areas, set the study area b as the sub-study area, and execute steps 2 to 6.
2. A method for dynamically loading three-dimensional entities considering local offline cache according to claim 1, characterized in that: Step 1 includes: Step 1.1, according to the geographic space range a of the study area and the first map display level v1, determine all the numbers of the downloaded map vector tiles of the first three-dimensional entity; Step 1.2, traverse all the numbers of the map vector tiles obtained in step 1.1 in sequence, and calculate the map vector tile coordinate values of the four vertices of the circumscribed rectangle of each map vector tile in each traversal process; Step 1.3, according to the map vector tile coordinate values of the four vertices of the circumscribed rectangle of each map vector tile in step 1.2, capture the first three-dimensional entity and store it in the local offline cache location; after the traversal is completed, all local offline cached data is recorded as the first data set A.
3. The method for dynamically loading three-dimensional entities considering local offline cache according to claim 1, characterized in that: In step 2, the scope of the study area b is within the geographic spatial scope a.
4. The method for dynamically loading three-dimensional entities considering local offline cache according to claim 1, characterized in that: Step 3 includes: Step 3.1, merging all three-dimensional entities in the second data set B into a third three-dimensional entity W in b3dm format; Step 3.2: Calculate the index file I of the third three-dimensional entity W.
5. The method for dynamically loading three-dimensional entities considering local offline cache according to claim 4, characterized in that: In step 3.2, the format of the index file of the third three-dimensional entity W is tileset.json.
6. The method for dynamically loading three-dimensional entities considering local offline cache according to claim 1, characterized in that: Step 4: Automatically publish the third three-dimensional entity W and the index file I to the nginx server.
7. The method for dynamically loading three-dimensional entities considering local offline cache according to claim 6, characterized in that: In step 4, the network access service interface provided by the nginx server is the access address of the index file I.
8. The method for dynamically loading three-dimensional entities considering local offline cache according to claim 1, characterized in that: Step 5 is to load the network access service interface in step 4 through the Cesium map library to dynamically access the third three-dimensional entity W generated in step 3.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the computer program, the steps of the method for dynamically loading three-dimensional entities considering local offline cache as described in any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for dynamically loading three-dimensional entities considering local offline caching as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Network geographic information service system based on three-dimensional model tiles
CN111354084A
Display method and system for two-dimensional / three-dimensional geographic space
CN111581323A
Vector tile loading method in three-dimensional scene
CN112256897A
3D Tiles data access method based on SQLite
CN116541394A
Map data processing method, computer device and storage medium
WO2019029252A1