A method for dynamically loading three-dimensional entities considering local offline caching
By performing offline caching and dynamic loading of 3D entities in the research area, the problems of fragmented loading and inconvenient downloading of 3D entities were solved, and efficient utilization of 3D entities was achieved.
Patent Information
- Application Number
- CN202411796036.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-12-09
AI Technical Summary
In existing technologies, vector tiles of three-dimensional entities suffer from fragmentation when loaded over large spatial areas, and are inconvenient to download and distribute when accessed offline, making it difficult to achieve on-demand dynamic loading.
By setting the geospatial extent and map display level of the study area, 3D entity data is downloaded offline and cached locally. The merged 3D entities are dynamically loaded, and network access services are provided using index files. The client uses the Cesium map library to achieve dynamic loading.
It enables on-demand, convenient local offline caching and dynamic loading of 3D entities, improving the efficiency and convenience of 3D entity utilization.
Smart Images

Figure CN119645529B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical fields of urban planning, smart city, geographic information system, and particularly relates to a method for dynamically loading three-dimensional entities considering local offline caching. BACKGROUND
[0002] Three-dimensional entities play an important role in current various map application services, such as map navigation, various types of smart city information systems, urban lifeline systems, and national space information systems. Currently, there are potential important needs and problems in actual applications, that is, for a large spatial range of three-dimensional entities, which are generally published in the form of vector map tiles, if the vector map tiles are loaded according to the spatial range of each actual project, a large number of vector tiles need to be dynamically loaded, and the fragmentation problem is serious. Meanwhile, in some actual applications, three-dimensional entities need to be accessed offline, so the client needs to download a large number of 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 very inconvenient in applications. Therefore, a technology is needed to cache the originally online three-dimensional entities in the form of vector tiles offline, and to dynamically generate a local three-dimensional entity as a whole according to the actual project spatial range. SUMMARY
[0003] The present application solves the technical problems of overcoming the deficiencies of the prior art and providing a method for dynamically loading three-dimensional entities considering local offline caching. Based on the vector tile composition characteristics of three-dimensional entities, the present application can realize the pre-local offline caching and dynamic loading of three-dimensional entities according to the spatial range.
[0004] The present application adopts the following technical solutions to solve the above technical problems:
[0005] In a first aspect, the present application provides a method for dynamically loading three-dimensional entities considering local offline caching, comprising the following steps:
[0006] Step 1, set the geographic spatial range a of the study area and the first map display level v1, offline download the first three-dimensional entity, and obtain the local offline caching data, which is denoted as the first data set A;
[0007] Step 2, dynamically load the first three-dimensional entity, set the condition, which is the study area b and the second map display level v2, calculate the second three-dimensional entity in the first data set A that meets the condition, and all the second three-dimensional entities are denoted 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 of loading the third three-dimensional entity W generated in step 3 is greater than a specified threshold, step 7 is executed;
[0012] If the time of loading the third three-dimensional entity W generated in step 3 is not greater than the specified threshold, step 7 is not executed;
[0013] Step 7, the study area b is equally divided into multiple sub-study areas, and the multiple sub-study areas are traversed, and the study area b is a sub-study area, and steps 2 to 6 are executed.
[0014] As a further optimization scheme of the method for dynamically loading a three-dimensional entity considering local offline caching according to the application, step 1 comprises:
[0015] Step 1.1, determining all numbers of map vector tiles of the downloaded first three-dimensional entity according to the geographic spatial range a of the study area and the first map display level v1;
[0016] Step 1.2, sequentially traversing all numbers of map vector tiles obtained in step 1.1, and calculating map vector tile coordinate values of 4 vertices of each map vector tile in each traversal process;
[0017] Step 1.3, according to the map vector tile coordinate values of 4 vertices of each map vector tile in step 1.2, the first three-dimensional entity is captured and stored 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 a three-dimensional entity considering local offline caching according to the application, the range of the study area b in step 2 is inside the geographic spatial range a.
[0019] As a further optimization scheme of the method for dynamically loading a three-dimensional entity considering local offline caching according to the application, step 3 comprises:
[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, the index file I of the third three-dimensional entity W is calculated again.
[0022] As a further optimization of the method for dynamically loading a three-dimensional entity considering local offline caching according to the present application, 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 of the method for dynamically loading a three-dimensional entity considering local offline caching according to the present application, in step 4, the third three-dimensional entity W and the index file I are automatically published to an nginx server.
[0024] As a further optimization of the method for dynamically loading a three-dimensional entity considering local offline caching according to the present application, in step 4, the network access service interface provided by the nginx server is the access address of the index file I.
[0025] As a further optimization of the method for dynamically loading a three-dimensional entity considering local offline caching according to the present application, step 5 is to load the network access service interface in step 4 to realize dynamic access to the third three-dimensional entity W generated in step 3 through a cesium map library.
[0026] In a second aspect, an embodiment of the present application also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the method for dynamically loading a three-dimensional entity considering local offline caching according to the first aspect or any corresponding implementation manner thereof when executing the computer program.
[0027] In a third aspect, an embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the method for dynamically loading a three-dimensional entity considering local offline caching according to the first aspect or any corresponding implementation manner thereof.
[0028] Compared with the prior art, the above technical solution of the present application has the following technical effects:
[0029] (1) The present application provides a method for dynamically loading a three-dimensional entity considering local offline caching, which can realize pre-local offline caching and dynamic loading of a three-dimensional entity according to a spatial range, thereby enhancing the efficiency and convenience of on-demand use of a three-dimensional entity.
[0030] (2) The present application proposes a method for dynamically loading a three-dimensional entity considering local offline caching based on the vector tile composition characteristics of a three-dimensional entity. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is a whole flow schematic diagram of the present application;
[0032] Figure 2 is a schematic diagram of the distribution of the 4 vertex coordinates of a three-dimensional vector tile;
[0033] Figure 3 is a schematic diagram of the range relationship;
[0034] Figure 4 is a schematic diagram of the process of dynamically loading a three-dimensional entity. DETAILED DESCRIPTION
[0035] The technical solutions of the present application will be further described in detail below in combination with the drawings:
[0036] Step 1, refer to the attached Figure 1 , set the geographic spatial range a and the first map display level v1 of the study area, offline download the first three-dimensional entity, and obtain the local offline cached data, which is denoted as the first data set A;
[0037] Step 1.1, according to the geographic spatial range a and the first map display level v1 of the study area, determine all the numbers of the map vector tiles of the downloaded first three-dimensional entity;
[0038] Step 1.2, sequentially traverse all the numbers of the map vector tiles obtained in step 1.1, and calculate the map vector tile coordinate values of the 4 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 4 vertices of the circumscribed rectangle of each map vector tile in step 1.2, the first three-dimensional entity is obtained by grabbing, and is stored to the local offline cache location; after the traversal is completed, all the local offline cached data is denoted as the first data set A.
[0040] Refer to the attached Figure 2 , the three-dimensional entity data is downloaded through the 4 vertices of the circumscribed rectangle of each map vector tile, thereby ensuring that the offline cached data is a standardized result. When further calling is needed, it can be quickly searched.
[0041] Step 2, dynamically load the first three-dimensional entity, set the condition, which is the study area b and the second map display level v2, calculate the second three-dimensional entity in the first data set A that meets the condition, and all the second three-dimensional entities are denoted as the second data set B;
[0042] Refer to the attached Figure 3 , the range of the study area b is inside the geographic spatial range a in this step.
[0043] Step 3, refer to the attached Figure 4merge all the 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, merge all the 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 again, wherein the format of the index file of the third three-dimensional entity W is tileset.json.
[0046] Step 4, refer to the attached Figure 4 publish the third three-dimensional entity W and the index file I to the server automatically and provide a network access service interface; wherein the third three-dimensional entity W and the index file I can be published to the nginx server automatically.
[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 can be achieved by loading the third three-dimensional entity W generated in step 3 through the network access service interface in step 4 by using the cesium map library.
[0050] Step 6, if the time for loading the third three-dimensional entity W generated in step 3 is greater than a specified threshold, execute step 7;
[0051] If the time for loading the third three-dimensional entity W generated in step 3 is not greater than the specified threshold, do not execute step 7;
[0052] The specified threshold here refers to the tolerance value of the time consumed by the client for loading the third three-dimensional entity W generated in step 3. Generally, a too large range will result in a large amount of data and a longer loading time. Therefore, a tolerance value of loading time can be set, and if this value is exceeded, the area to be loaded can be further divided, so that the data loading speed of each divided area can be within the tolerance value.
[0053] Step 7, divide the study area b into multiple sub-study areas in equal proportions, traverse the multiple sub-study areas, let the study area b be a sub-study area, and execute steps 2 to 6.
[0054] The embodiment of the present application 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, and the processor implements the steps of the method for dynamically loading a three-dimensional entity considering a local offline cache when executing the computer program.
[0055] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the method for dynamically loading a three-dimensional entity considering a local offline cache when executed by a processor.
[0056] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product implemented on one or more computer readable storage media containing computer usable program code (including but not limited to disk memory, CD-ROM, optical memory, etc.). The solutions in the embodiments of the present application can be implemented in various computer languages, such as an object-oriented programming language Java and an interpreted scripting language JavaScript.
[0057] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices generate a device implemented in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flow(s) or block(s).
[0058] These computer program instructions can also be stored in a computer readable memory capable of guiding the computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product comprising instruction apparatus, which implements the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flow(s) or block(s).
[0059] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks.
[0060] While the preferred embodiments of the application have been described, it should be apparent that further modifications and improvements can be made by those skilled in the art without departing from the scope of the application. Therefore, the scope of the application should be determined by the following claims, including any equivalents thereto.
[0061] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A method for dynamic loading of three-dimensional entities considering local offline caching, characterized in that, The method comprises the following steps: Step 1: setting a geographical spatial range a and a first map display level v1 of a study area, offline downloading a first three-dimensional entity, and obtaining locally cached data, which is denoted as a first data set A; Step 2: dynamically loading the first three-dimensional entity, setting a condition, wherein the condition refers to the study area b and a second map display level v2, calculating a second three-dimensional entity in the first data set A that meets the condition, and denoting all the second three-dimensional entities as a second data set B; Step 3: merging all the 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 publishing the third three-dimensional entity W and the index file I to a server and providing a network access service interface; Step 5: dynamically loading the third three-dimensional entity W generated in step 3 by the network access service interface in step 4 through a client; Step 6: if the time for loading the third three-dimensional entity W generated in step 3 is greater than a specified threshold, performing step 7; if the time for loading the third three-dimensional entity W generated in step 3 is not greater than the specified threshold, not performing step 7; Step 7: equally dividing the study area b into a plurality of sub-study areas, traversing the plurality of sub-study areas, taking the study area b as a sub-study area, and performing steps 2 to 6.
2. The method for dynamically loading three-dimensional entities considering local offline cache according to claim 1, wherein, Step 1 comprises: Step 1.1: determining all numbers of map vector tiles of the downloaded first three-dimensional entity according to the geographical spatial range a and the first map display level v1 of the study area; Step 1.2: sequentially traversing all numbers of the map vector tiles obtained in step 1.1, and calculating map vector tile coordinate values of 4 vertices of an external rectangle of each map vector tile in each traversal process; Step 1.3: grabbing the first three-dimensional entity according to the map vector tile coordinate values of 4 vertices of an external rectangle of each map vector tile in step 1.2, and storing the first three-dimensional entity to a local offline cache location; after the traversal is completed, all the locally cached data is denoted as the first data set A.
3. The method for dynamic loading of three-dimensional entities considering local offline cache according to claim 1, wherein, The range of the study area b in step 2 is inside the geographical spatial range a.
4. The method for dynamically loading three-dimensional entities considering local offline cache according to claim 1, wherein, Step 3 comprises: Step 3.1: merging all the three-dimensional entities in the second data set B into a third three-dimensional entity W in a b3dm format; Step 3.2: calculating an 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, wherein, 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, wherein, Step 4: automatically publishing the third three-dimensional entity W and the index file I to an nginx server.
7. The method for dynamically loading three-dimensional entities considering local offline cache according to claim 6, wherein, The network access service interface provided by the nginx server in step 4 is an access address of the index file I.
8. The method for dynamically loading three-dimensional entities considering local offline cache according to claim 1, wherein, Step 5 is to dynamically access the third three-dimensional entity W generated in step 3 by loading the network access service interface in step 4 through a cesium map library.
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, The processor executes the computer program to realize the steps of the method for dynamically loading a three-dimensional entity considering local offline caching according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program, which is executed by a processor, implements the steps of the method of dynamically loading a three-dimensional entity taking into account a local offline cache according to any one of claims 1 to 8.
Citation Information
Patent Citations
Network geographic information service system based on three-dimensional model tiles
CN111354084A
Map data processing method, computer device and storage medium
WO2019029252A1