Map data loading method and device and electronic equipment

By using a virtual camera on the browser side to highly determine the data type and viewing angle range, obtaining matching map data from the server side, and using WebGL and three.js for multi-thread rendering, the problem of low efficiency in high-precision map rendering is solved and achieved Fast rendering and efficient operation.

CN118537487APending Publication Date: 2024-08-23CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410597684.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The rendering efficiency of high-precision maps in the existing technology is low and cannot be rendered quickly and accurately, resulting in a poor operating experience.

Method used

The virtual camera on the browser side is used to highly determine the matching data type, the corresponding map data is obtained from the server side, and rendered on demand on the browser side. WebGL and three.js technology frameworks are used to build a high-precision map visualization solution. Through multi-threading Off-screen rendering and vertex merging improve rendering efficiency.

Benefits of technology

It improves the rendering efficiency of map data, improves the operating experience and system response speed, and can quickly render high-precision maps on the browser side to meet the needs of high-precision maps such as autonomous driving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537487A
    Figure CN118537487A
Patent Text Reader

Abstract

The embodiment of the invention provides a map data loading method and device and electronic device.The method comprises the steps that a first data type matched with a first camera height is determined based on the first camera height of a virtual camera, and the virtual camera is a camera matched with a three-dimensional scene of a browser side; acquiring first map data matched with the first data type and the first visual angle range of the virtual camera in a preset three-dimensional map from a server; and loading the first map data into the three-dimensional scene so as to display the first map data at a browser end, and through the method and the device, the problem of relatively low rendering efficiency of a map data loading method in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of high-precision map technology, and more specifically, to a method and device for loading map data, and an electronic device. Background Art

[0002] High-precision maps used for autonomous driving contain map elements such as road shapes, road markings, traffic signs and obstacles. The map accuracy can be down to the centimeter level. It has the characteristics of high precision, large data volume and complete elements.

[0003] However, in related technologies, high-precision maps are mostly rendered through desktop products. Due to the limitations of device performance and operating system, the operating experience is poor, and high-precision maps cannot be rendered quickly and finely, resulting in low rendering efficiency.

[0004] It can be seen that the map data loading method in the related art has the problem of low rendering efficiency. Summary of the invention

[0005] The embodiments of the present application provide a method and device for loading map data, and an electronic device, so as to at least solve the problem of low rendering efficiency in the method for loading map data in the related art.

[0006] According to one embodiment of the present application, a method for loading map data is provided, including: determining a first data type that matches a first camera height of a virtual camera based on the first camera height, wherein the virtual camera is a camera that matches a three-dimensional scene on a browser side; obtaining first map data that matches the first data type and a first viewing angle range of the virtual camera in a preset three-dimensional map from a server side; and loading the first map data into the three-dimensional scene for display on the browser side.

[0007] According to another embodiment of the present application, a map data loading device is provided, including: a first determination unit, used to determine a first data type matching the first camera height based on a first camera height of a virtual camera, wherein the virtual camera is a camera matching the three-dimensional scene on the browser side; a first acquisition unit, used to acquire first map data matching the first data type and the first viewing angle range of the virtual camera in a preset three-dimensional map from a server side; and a loading unit, used to load the first map data into the three-dimensional scene for display on the browser side.

[0008] According to another aspect of the embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for loading map data when running.

[0009] According to another aspect of the embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for loading map data through the computer program.

[0010] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any of the above-mentioned map data loading methods is implemented.

[0011] Through the embodiments of the present application, an on-demand rendering method of high-precision maps is adopted on the browser side, the data type of the matching map data to be displayed is determined based on the camera height of the virtual camera, the corresponding map data is obtained from the server side based on the determined data type and the viewing angle of the virtual camera, and the obtained map data is loaded into the three-dimensional scene displayed on the browser side. Since on-demand rendering of map data can be realized on the browser side, the technical effect of improving the rendering efficiency of map data is achieved, and the problem of low rendering efficiency due to the use of desktop products in the map data loading method in the related technology can be solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a hardware structure block diagram of an optional method for loading map data in an embodiment of the present application;

[0013] Figure 2 is a flowchart of an optional method for loading map data according to an embodiment of the present application;

[0014] Figure 3 is a flowchart of another optional method for loading map data according to an embodiment of the present application;

[0015] Figure 4 is a structural block diagram of an optional map data loading device according to an embodiment of the present application;

[0016] Figure 5 It is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0017] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0018] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0019] According to one aspect of an embodiment of the present application, a method for loading map data is provided. Optionally, in this embodiment, the method for loading map data can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0020] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI, Bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, or other devices.

[0021] The method for loading map data in the embodiment of the present application can be executed by the terminal device 102, or can be executed by the server 104 and the terminal device 102 together. Taking the method for loading map data in the embodiment executed by the terminal device 102 as an example, Figure 2 is a flow chart of an optional method for loading map data according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include the following steps:

[0022] Step S202: determining a first data type that matches the first camera height based on the first camera height of the virtual camera, wherein the virtual camera is a camera that matches the three-dimensional scene on the browser side.

[0023] The method for loading map data in this embodiment can be applied to the scene of rendering high-precision maps on the browser side. High-precision maps are high-precision maps for autonomous driving, which contain map elements such as road shapes, road markings, traffic signs and obstacles, and the map accuracy can be down to the centimeter level. High-precision maps have the characteristics of high precision, large data volume, and complete elements. Complex and abstract massive high-precision map geographic data require efficient visualization solutions because they need to meet the requirements of refined rendering, editing and production. At present, most of the related technologies are desktop products with poor rendering capabilities and low rendering efficiency.

[0024] Here, the difference between desktop and browser lies in their application scenarios and functional features. Desktop usually refers to applications running on devices such as personal computers or laptops. These applications can be directly opened and run through the operating system interface; while browser refers to applications running in web browsers. These applications are usually presented in the form of web pages and users can access and use them through browsers. In addition, desktop applications usually require users to install and run them locally, while browser applications are based on the Internet and users can access and use them through browsers without installation.

[0025] In order to at least partially solve the above problems, in this embodiment, the three.js technology framework based on WebGL (WebGraphics Library) on the browser side is adopted to obtain map data from the service side (i.e., the server side) and render the obtained map data into the three-dimensional scene on the browser side, thereby constructing a set of high-precision map visualization solutions based on WebGL.

[0026] Here, WebGL is a JavaScript API (Application Programming Interface) that can render high-performance interactive 3D and 2D graphics in any compatible web browser without the use of plug-ins. WebGL is currently a relatively complete browser-side 3D data rendering API. Three.js is a cross-browser JavaScript library and API for creating and displaying animated 3D computer graphics in web browsers using WebGL. It is an upper-level encapsulation API based on WebGL.

[0027] Considering the high precision of high-precision maps, and at the same time, in scenes with very high viewing angles, some details such as poles and signs are difficult to see even if they are loaded, which affects the display. In this embodiment, the first data type that matches the first camera height can be determined based on the first camera height of the virtual camera. Here, the virtual camera is a camera that matches the three-dimensional scene on the browser side, that is, the three-dimensional scene screen displayed on the browser side screen corresponds to the imaging screen of the virtual camera. In other words, in this embodiment, the data type of the map data to be displayed can be determined based on the camera height of the virtual camera. It can be understood that the higher the height, the fewer data types need to be displayed.

[0028] Optionally, before determining the first data type matching the first camera height based on the first camera height of the virtual camera, the method further includes: using three.js, an upper-level framework of WebGL, to construct a three-dimensional space scene, construct basic environments such as virtual camera lighting, define a data coordinate system, set a perspective projection mode and a default virtual camera positioning position, and set a camera controller to control the translation, scaling, rotation, etc. of the virtual camera.

[0029] Step S204: obtaining first map data in a preset three-dimensional map that matches the first data type and the first viewing angle range of the virtual camera from the server.

[0030] The server can fully store the map data in the preset three-dimensional map (high-precision map) through the database. When the browser has determined the first data type and the first viewing angle range of the virtual camera, the browser can obtain the first map data that matches the first data type and the first viewing angle range of the virtual camera from the high-precision map data stored on the server.

[0031] Optionally, the database may store the correspondence between the map data in the high-precision map data and the indication information of the data type and the indication information of the spatial position, or the high-precision map data in the database may be stored in tables according to the data type, or there may be other ways to determine the corresponding map data based on the data type and the spatial position, which is not limited in the present embodiment.

[0032] Step S206: loading the first map data into the three-dimensional scene for display on the browser side.

[0033] Loading map data into a three-dimensional scene may refer to presenting various elements of the map (such as roads, buildings, terrain, etc.) in the three-dimensional map so that users can browse and interact in the three-dimensional scene displayed on the browser side.

[0034] Through the above steps S202 to S206, based on the first camera height of the virtual camera, a first data type matching the first camera height is determined, wherein the virtual camera is a camera matching the three-dimensional scene on the browser side; first map data matching the first data type and the first viewing angle range of the virtual camera in a preset three-dimensional map is obtained from the server side; the first map data is loaded into the three-dimensional scene to be displayed on the browser side, thereby solving the problem of low rendering efficiency in the map data loading method in the related art.

[0035] In an exemplary embodiment, loading first map data into a three-dimensional scene includes:

[0036] S11, comparing the loaded map data in the three-dimensional scene of the browser with the first map data to obtain data to be loaded, wherein the data to be loaded is missing data of the loaded map data compared with the first map data;

[0037] S12, loading the data to be loaded into the three-dimensional scene.

[0038] When there is loaded map data in the three-dimensional scene on the browser side, in order to improve data loading efficiency, the loaded map data in the three-dimensional scene on the browser side may be compared with the first map data to obtain the data to be loaded.

[0039] Here, similar to the aforementioned embodiment, the first map data is map data that matches the camera height of the virtual camera and the viewing angle range of the virtual camera. When the position of the virtual camera changes, the map data that matches the camera height of the virtual camera and the viewing angle range of the virtual camera can be re-determined.

[0040] Optionally, comparing the loaded map data in the three-dimensional scene of the browser with the first map data may be to compare the data identifier of the loaded map data with the data identifier of the first map data to obtain the data to be loaded. In this embodiment, the data identifiers of different map data may be different.

[0041] The data to be loaded may be missing data of the loaded map data compared to the first map data, that is, data in the first map data that is not loaded into the loaded map data in the three-dimensional scene of the browser.

[0042] Through this embodiment, by comparing the data identifier (ID) constructed in the three-dimensional scene with the changed data (first map data), only the required difference data is taken and loaded again, which can improve data loading efficiency and system response speed.

[0043] In an exemplary embodiment, before determining the first data type matching the first camera height based on the first camera height of the virtual camera, the method further includes:

[0044] S21, determining an intersection point between each corner point in a group of corner points of a display screen of the browser end and a ground plane of the three-dimensional scene to obtain a group of intersection points;

[0045] S22, converting the intersection coordinates of each intersection in a set of intersections from the screen coordinates of the display screen to the three-dimensional scene coordinates of the three-dimensional scene, to obtain the three-dimensional scene coordinates of each intersection;

[0046] S23, determining the polygonal range where the camera viewing angle of the virtual camera intersects the ground plane and the camera height of the virtual camera according to the three-dimensional scene coordinates of each intersection point, and obtaining a first viewing angle range and a first camera height.

[0047] Before determining the data type of the map data matching the camera height based on the camera height of the virtual data, the viewing angle range and the camera height of the virtual camera can be determined by converting the screen corner coordinates of the browser end into three-dimensional scene coordinates.

[0048] Specifically, converting the screen coordinates into three-dimensional scene coordinates may include the following steps:

[0049] Get screen coordinates: Get at least one coordinate point clicked by the user on the screen, such as {x, y}.

[0050] Get camera parameters: for example, the position of the virtual camera (position in three-dimensional space), viewing angle (viewing direction), focal length, etc.

[0051] Convert screen coordinates to rays: In a three-dimensional scene, a ray starting from the camera position and passing through the screen coordinate point can be used to represent the point the user sees on the screen. This ray can be calculated using the camera parameters and screen coordinates.

[0052] Intersection of ray with map model: To find the intersection of a ray with a map model, a ray-triangle intersection check may be performed on the map model to find the nearest intersection, thereby determining a point in three-dimensional space.

[0053] For example, in this embodiment, by constructing an infinitely distant ground plane, monitoring the intersection of the four corner points of the browser display screen and the ground plane in the three-dimensional scene, the screen coordinates of the browser can be converted to three-dimensional scene coordinates, and the range of the polygons intersecting with the ground under the current camera perspective can be obtained, and at the same time, the height of the current camera can be obtained.

[0054] Through this embodiment, by converting coordinates, the viewing angle range and camera height of the virtual camera corresponding to the current moment are determined, which can improve the accuracy of information and reduce system errors.

[0055] In an exemplary embodiment, based on a first camera height of a virtual camera, determining a first data type matching the first camera height includes:

[0056] S31, determining a camera height interval to which a first camera height belongs in a preset set of camera height intervals, and obtaining a target camera height interval;

[0057] S32: Based on the correspondence between the preset camera height intervals and the data types of the map data, determine the data type corresponding to the target camera height interval as the first data type.

[0058] Similar to the above-mentioned embodiment, the number of data types of the map data displayed in the three-dimensional scene is negatively correlated with the camera height, that is, the higher the camera height, the fewer the corresponding data types.

[0059] In order to simplify data representation and improve decision-making efficiency, the correspondence between different camera height intervals and the data type of map data can be pre-set. Based on this, when the camera height interval that matches the current camera height is determined, one or more types of map data corresponding to the height interval can be determined. By corresponding the height intervals and the data types, the one-to-one correspondence between the camera height and the data type can be avoided, which would result in excessive occupation of system resources.

[0060] For example, in this embodiment, the data type of map data that needs to be displayed in each camera height interval is defined. For example, when the camera height is above 3000 meters, only the road skeleton is displayed, and the nodes of the 1000-3000 meter road are increased for display, and so on to build a set of camera height matching solutions; according to the height matching solution, it can be known that the data type data typeArr of the high-precision map that needs to be loaded at each camera height.

[0061] Through this embodiment, the data type of the map data to be displayed is determined based on the camera height, so that the readability of the three-dimensional scene displayed on the browser side can be improved.

[0062] In an exemplary embodiment, obtaining first map data matching the first data type and the first viewing angle range of the virtual camera in a preset three-dimensional map from a server includes:

[0063] S41, sending a data acquisition request to a server, wherein the data acquisition request is used to request map data of a first data type located within a first viewing angle in a preset three-dimensional map;

[0064] S42, receiving first map data returned by the server in response to the data acquisition request, wherein the first map data is acquired by the server from a target database according to a first viewing angle range, and the target database is a database for storing map data of a first data type in a preset three-dimensional map.

[0065] In this embodiment, high-precision map data generated by various channels can be stored in a PostgreSQL database in tables according to type specifications. The browser can send an http request to the server based on the polygon viewing angle range of the (virtual) camera and the type data typeArr of the required data type that matches the camera height. The server determines the database table to be queried based on the type data typeArr, and performs a spatial query on the data in the table based on the polygon viewing angle service of the camera to obtain the first map data that matches the first data type determined based on the camera height and the camera viewing angle range. The queried first map data is returned to the browser via http.

[0066] Here, PostgreSQL is an open source object-relational database management system that is highly scalable, stable, and secure, and supports a large number of data types and functions, including complex queries, transaction processing, and concurrency control.

[0067] HTTP (Hypertext Transfer Protocol) is a protocol for transmitting data. It is a basic communication protocol on the Internet. An HTTP request is a request sent by a client (such as a browser) to a server to obtain specific resources. A request consists of a request method, URL, request header, and request body. After receiving the request, the server will process it accordingly based on the content of the request and return the corresponding data to the client.

[0068] Through this embodiment, the server-side database stores high-precision map data in tables based on data type specifications, and the browser side obtains corresponding map data from the server-side based on the data type that highly matches the camera and the camera's viewing angle range, which can improve data acquisition efficiency.

[0069] In an exemplary embodiment, loading first map data into a three-dimensional scene includes:

[0070] S51, determining a target loading method from a group of data loading methods based on the first camera height, wherein the group of data loading methods are all methods for loading map data;

[0071] S52, loading the first map data into a designated memory area of ​​the browser end through multithreading in a target loading manner, and loading the first map data in the designated memory area into the three-dimensional scene.

[0072] In order to maximize the rendering speed and capability, in this embodiment, before the map data is actually loaded into the three-dimensional scene displayed on the browser, the off-screen rendering technology of three.js can be used, combined with webWorker for multi-threading, to maximize the GPU usage capability, and finally load the data into the three-dimensional scene, which can enable efficient browsing, editing and other operations.

[0073] Here, off-screen rendering is a GPU (Graphics Processing Unit) screen rendering method, which means that the GPU opens a buffer (i.e., a specified memory area) outside the current screen buffer for rendering operations. Offscreen rendering is a common performance optimization strategy used to reduce the time and complexity of graphics rendering. In this mode, all rendering operations are performed in a memory area outside the current screen view (i.e., a specified memory area). Only when all rendering operations are completed will the final image be transferred to the screen. Off-screen rendering can avoid screen flickering or unnecessary redrawing, because all rendering work is done in the background, and users will not see semi-finished rendering results.

[0074] Through this embodiment, the map rendering task can be decomposed into multiple independent subtasks through multi-threaded off-screen rendering, thereby improving the flexibility and customizability of map rendering and realizing on-demand rendering and on-demand redrawing on the browser side.

[0075] In an exemplary embodiment, based on the first camera height, determining a target loading mode from a set of data loading modes includes:

[0076] S61, when the height of the first camera is less than a preset height threshold, determining the data loading mode of the independent grid loading as the target loading mode;

[0077] S62, when the height of the first camera is greater than or equal to a preset height threshold, determining a data loading method based on fusion loading of the same data type as a target loading method.

[0078] In order to improve rendering efficiency, in this embodiment, different geometric bodies or objects can be loaded and processed as independent meshes. Based on this, each independent mesh can be optimized and controlled separately during the rendering process, thereby improving rendering efficiency.

[0079] Optionally, in this embodiment, vertices with the same position and attributes can be merged into one vertex through vertex merging, thereby reducing the number of vertices and reducing the amount of calculation in the rendering process. Geometries with similar attributes (e.g., map elements) can be merged into a larger geometry. That is, the geometry in the scene can be reduced to a reasonable number through a data loading method based on fusion loading of the same data type, thereby reducing the amount of calculation and memory usage in the rendering process and improving rendering efficiency.

[0080] For example, in this embodiment, data is loaded according to points, lines, surfaces and attributes. Since high-precision map data are all vector point, line and surface semantic data, if it is to meet editing and other scenarios, it is necessary to adopt the data loading method of independent mesh loading, but the independent mesh loading performance is low. Therefore, an editing threshold (i.e., a preset height threshold) is set. When the camera height is lower than the editing threshold, independent mesh loading is used. At this time, because the height is low, the data volume has an upper limit, which can meet the loading efficiency; if the height is high (i.e., the camera height is greater than or equal to the preset height threshold), vertex merging can be performed to merge the same type of geometry and build relatively fewer meshes to increase rendering efficiency.

[0081] Through this embodiment, the data loading method adopted at the current camera height is dynamically selected based on the preset height threshold, which can improve the flexibility of data loading while taking into account efficiency and editability.

[0082] In an exemplary embodiment, after loading the first map data into the three-dimensional scene, the method further includes:

[0083] S71, in response to adjusting at least one of a camera height of the virtual camera and a viewing angle range of the virtual camera, determining a second data type matching a second camera height based on a current second camera height of the virtual camera, wherein the first camera height is the same as the second camera height, or the first camera height is different from the second camera height;

[0084] S72, obtaining second map data matching the second data type and the second viewing angle range of the virtual camera in a preset three-dimensional map from the server, wherein the first viewing angle range is the same as the second viewing angle range, or the first viewing angle range is different from the second viewing angle range;

[0085] S73, loading the map data in the second map data that has not been loaded into the three-dimensional scene into the three-dimensional scene, and removing the map data in the three-dimensional scene that does not belong to the second map data, so as to display the second map data on the browser side.

[0086] The user can manually adjust the display interface of the browser to trigger a change in at least one of the camera height of the virtual camera and the viewing angle range of the virtual camera.

[0087] In response to an adjustment to at least one of the camera height of the virtual camera and the viewing angle range of the virtual camera, the browser determines a second data type that matches the second camera height based on the current second camera height of the virtual camera, wherein the first camera height is the same as the second camera height, or the first camera height is different from the second camera height.

[0088] Optionally, when the first camera height and the second camera height are exactly the same or belong to the same height range, the first data type in the historical record can be determined as the second data type. Here, the historical record is used to record the correspondence between the camera height of the virtual camera and the determined data type after each virtual camera adjustment.

[0089] Obtaining second map data matching the second data type and the second viewing angle range of the virtual camera in the preset three-dimensional map from the server, where the first viewing angle range is the same as the second viewing angle range, or the first viewing angle range is different from the second viewing angle range. Here, generally, adjusting the three-dimensional scene displayed on the browser side will inevitably involve adjusting the viewing angle range of the camera.

[0090] For example, in this embodiment, when the camera position changes, the intersection of the four corner points of the screen and the ground plane is monitored, the screen coordinates are converted to three-dimensional scene coordinates, and the polygon range (i.e., the second viewing angle range) that intersects with the ground under the current camera viewing angle is obtained, and the height height of the current camera (i.e., the second camera height) is also obtained. According to the second viewing angle range and the required type data typeArr that matches the second camera height, an http request is made, and the server determines the table to be queried according to the type data typeArr, and performs a spatial query on the data in the table based on the second viewing angle range. The queried second map data is returned to the browser via http. At this time, the second map data and the scene that has been loaded in the three-dimensional scene displayed by the browser are compared for data identification, and redundant data is removed and missing data is loaded.

[0091] As an optional exemplary embodiment of the present application, a high-precision map visualization solution based on browser WebGL is taken as an example to explain the method for loading map data in the embodiment of the present application.

[0092] This solution uses a B / S architecture (browser / server architecture), and high-precision map data is stored in the database. The browser builds a three-dimensional scene based on the WebGL framework, and defines the data and loading plan required for scene screening based on the scene position, range, and height determined by the viewing angle. The database is requested for high-precision map data through an http request that carries the scene loading strategy parameters of the three-dimensional scene. The returned data is loaded according to the range and highly customized loading strategy. When the viewing angle range or height changes, the above process is executed again, and the data id constructed in the scene is compared with the changed data, and only the required difference data is loaded again. Through this application, massive high-precision map semantic data can be quickly opened and browsed on any browser web page to meet the needs of subsequent rapid verification, efficient production and other businesses.

[0093] Combination Figure 3 The method for loading map data in this application may specifically include the following steps:

[0094] Step 1: Build a 3D scene based on WebGL.

[0095] Step 2: Scenario judgment and plan formulation.

[0096] Based on the camera height height of the virtual camera, determine the current height application scenario, and according to the height matching solution, determine the data type data typeArr of the high-precision map that needs to be loaded at each camera height.

[0097] Step 3: data request and data comparison.

[0098] Based on the viewing angle range and height matching loading scheme of the virtual camera, the browser sends an http request to the server to obtain map data corresponding to the data type matching the current camera viewing angle range and camera height;

[0099] The acquired map data is compared with the existing data in the 3D scene, the difference is calculated, and only the required difference data is loaded again.

[0100] Step 4: Select merge or other solutions based on the height.

[0101] After requesting and comparing in step 3, data needs to be loaded. When loading, data is loaded according to points, lines, surfaces and attributes. Because high-precision map data are vector point, line and surface semantic data, independent mesh loading is required to meet editing and other scenes, but independent mesh loading performance is low. Therefore, the editing scene height is set. When the camera height is lower than the editing threshold, independent mesh loading is used. At this time, because the height is low, the data volume has an upper limit, which can fully meet the loading efficiency; if the height is high, vertex merging can be performed at this time, and the same type of geometry can be merged to build relatively fewer meshes to increase rendering efficiency.

[0102] Step 5: Load data in combination with off-screen rendering.

[0103] Step 6: After the data is loaded, continue to monitor the changes in camera height and range. If the camera position changes, execute step 2.

[0104] Through this embodiment, the response time for loading high-precision map data in any area is in the millisecond level, the fps after loading is greater than 50, and there is no lag in interactive response. Through an efficient visualization solution based on WebGL combined with on-demand rendering, vertex merging, off-screen rendering and other technical means for high-precision map data, the loading visualization speed is efficient, and high-precision maps can be quickly viewed and verified, edited and produced based on high-precision maps. The web page has instant access and the database has unified data management, which is convenient for the subsequent use of high-precision maps.

[0105] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0106] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware server, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0107] According to another aspect of the embodiment of the present application, a map data loading device for implementing the above-mentioned map data loading method is also provided. Figure 4 is a structural block diagram of an optional map data loading device according to an embodiment of the present application, such as Figure 4 As shown, the device may include:

[0108] A first determining unit 402 is used to determine a first data type matching the first camera height based on a first camera height of a virtual camera, wherein the virtual camera is a camera matching the three-dimensional scene on the browser side;

[0109] A first acquisition unit 404 is used to acquire first map data matching the first data type and the first viewing angle range of the virtual camera in a preset three-dimensional map from the server;

[0110] The loading unit 406 is used to load the first map data into the three-dimensional scene for display on the browser side.

[0111] Through the embodiments of the present application, based on the first camera height of the virtual camera, a first data type matching the first camera height is determined, wherein the virtual camera is a camera matching the three-dimensional scene on the browser side; first map data matching the first data type and the first viewing angle range of the virtual camera in a preset three-dimensional map is obtained from the server side; the first map data is loaded into the three-dimensional scene for display on the browser side, thereby solving the problem of low rendering efficiency in the map data loading method in the related art and improving the rendering efficiency.

[0112] In an exemplary embodiment, the loading unit comprises:

[0113] A comparison module compares the loaded map data in the three-dimensional scene of the browser with the first map data to obtain data to be loaded, wherein the data to be loaded is missing data of the loaded map data compared with the first map data;

[0114] The loading module loads the data to be loaded into the three-dimensional scene.

[0115] In an exemplary embodiment, the apparatus further comprises:

[0116] A second determining unit is used to determine the intersection of each corner point in a set of corner points of a display screen of the browser end and a ground plane of the three-dimensional scene before determining the first data type matching the first camera height based on the first camera height of the virtual camera to obtain a set of intersection points;

[0117] A calculation unit, used for converting the intersection coordinates of each intersection in a set of intersections from the screen coordinates of the display screen to the three-dimensional scene coordinates of the three-dimensional scene, so as to obtain the three-dimensional scene coordinates of each intersection;

[0118] The third determining unit is used to determine the polygonal range where the camera viewing angle of the virtual camera intersects the ground plane and the camera height of the virtual camera according to the three-dimensional scene coordinates of each intersection point, and obtain a first viewing angle range and a first camera height.

[0119] In an exemplary embodiment, the first determining unit includes:

[0120] A first determination module is used to determine a camera height interval to which the first camera height belongs in a preset set of camera height intervals, and obtain a target camera height interval;

[0121] The second determining module determines the data type corresponding to the target camera height interval as the first data type based on the correspondence between the preset camera height interval and the data type of the map data.

[0122] In an exemplary embodiment, the first acquiring unit includes:

[0123] A sending module, used to send a data acquisition request to a server, wherein the data acquisition request is used to request map data of a first data type located within a first viewing angle in a preset three-dimensional map;

[0124] A receiving module is used to receive first map data returned by the server in response to a data acquisition request, wherein the first map data is acquired by the server from a target database according to a first viewing angle range, and the target database is a database for storing map data of a first data type in a preset three-dimensional map.

[0125] In an exemplary embodiment, the loading unit comprises:

[0126] A third determination module is used to determine a target loading method from a group of data loading methods based on the first camera height, wherein the group of data loading methods are all methods for loading map data;

[0127] The execution module is used to load the first map data into a designated memory area of ​​the browser end through multi-threading in a target loading manner, and load the first map data in the designated memory area into the three-dimensional scene.

[0128] In an exemplary embodiment, the third determination module includes:

[0129] A first determination submodule is used to determine the data loading mode of the independent grid loading as the target loading mode when the height of the first camera is less than a preset height threshold;

[0130] The second determination submodule is used to determine the data loading method based on fusion loading of the same data type as the target loading method when the height of the first camera is greater than or equal to a preset height threshold.

[0131] In an exemplary embodiment, the apparatus further comprises:

[0132] a fourth determining unit, configured to determine, after loading the first map data into the three-dimensional scene, a second data type matching the second camera height based on a current second camera height of the virtual camera in response to adjusting at least one of the camera height of the virtual camera and the viewing angle range of the virtual camera, wherein the first camera height is the same as the second camera height, or the first camera height is different from the second camera height;

[0133] A second acquisition unit is used to acquire second map data matching the second data type and the second viewing angle range of the virtual camera in a preset three-dimensional map from the server, wherein the first viewing angle range is the same as the second viewing angle range, or the first viewing angle range is different from the second viewing angle range;

[0134] The execution unit is used to load the map data in the second map data that has not been loaded into the three-dimensional scene into the three-dimensional scene, and remove the map data in the three-dimensional scene that does not belong to the second map data, so as to display the second map data on the browser side.

[0135] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.

[0136] According to another aspect of the embodiment of the present application, a storage medium is further provided. Optionally, in this embodiment, the storage medium can be used to execute the program code of any of the above-mentioned map data loading methods in the embodiment of the present application.

[0137] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.

[0138] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:

[0139] S1, determining a first data type matching the first camera height based on a first camera height of a virtual camera, wherein the virtual camera is a camera matching a three-dimensional scene on a browser side;

[0140] S2, obtaining first map data matching the first data type and the first viewing angle range of the virtual camera in a preset three-dimensional map from the server;

[0141] S3, loading the first map data into the three-dimensional scene for display on the browser side.

[0142] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.

[0143] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.

[0144] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned map data loading method is also provided. The electronic device may be a smart device, a server, a terminal, or a combination thereof.

[0145] Figure 5 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Figure 5 As shown, it includes a processor 502, a communication interface 504, a memory 506 and a communication bus 508, wherein the processor 502, the communication interface 504 and the memory 506 communicate with each other through the communication bus 508, wherein,

[0146] Memory 506, used for storing computer programs;

[0147] The processor 502 is used to execute the computer program stored in the memory 506 to implement the following steps:

[0148] S1, determining a first data type matching the first camera height based on a first camera height of a virtual camera, wherein the virtual camera is a camera matching a three-dimensional scene on a browser side;

[0149] S2, obtaining first map data in a preset three-dimensional map that matches the first data type and the first viewing angle range of the virtual camera from the server;

[0150] S3, loading the first map data into the three-dimensional scene for display on the browser side.

[0151] Optionally, the communication bus may be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 The communication interface is used for communication between the above electronic device and other devices.

[0152] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0153] As an example, the memory 506 may include but is not limited to the first determining unit 402, the first acquiring unit 404 and the loading unit 406 in the map data loading device. In addition, it may also include but is not limited to other module units in the map data loading device, which will not be repeated in this example.

[0154] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0155] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0156] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only. The device for implementing the above-mentioned map data loading method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 5 The structure of the electronic device is not limited. Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations shown.

[0157] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0158] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0159] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above method embodiments.

[0160] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0161] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0162] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the above methods in each embodiment of the present application.

[0163] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0164] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0165] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.

[0166] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist physically separately, or at least two units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0167] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for loading map data, It is characterized in that include: Determining a first data type matching the first camera height based on a first camera height of a virtual camera, wherein the virtual camera is a camera matching the three-dimensional scene on the browser side; Acquire first map data in a preset three-dimensional map that matches the first data type and the first viewing angle range of the virtual camera from the server; The first map data is loaded into the three-dimensional scene to be displayed on the browser side.

2. The method according to claim 1, It is characterized in that The step of loading the first map data into the three-dimensional scene includes: Comparing the loaded map data in the three-dimensional scene of the browser with the first map data to obtain data to be loaded, wherein the data to be loaded is missing data of the loaded map data compared with the first map data; The data to be loaded is loaded into the three-dimensional scene.

3. The method according to claim 1, It is characterized in that Before determining the first data type matching the first camera height based on the first camera height of the virtual camera, the method further includes: Determine the intersection of each corner point in a group of corner points of the display screen of the browser end and the ground plane of the three-dimensional scene to obtain a group of intersection points; Converting the intersection coordinates of each intersection in the set of intersections from the screen coordinates of the display screen to the three-dimensional scene coordinates of the three-dimensional scene to obtain the three-dimensional scene coordinates of each intersection; According to the three-dimensional scene coordinates of each intersection point, the polygonal range where the camera viewing angle of the virtual camera intersects the ground plane and the camera height of the virtual camera are determined to obtain the first viewing angle range and the first camera height.

4. The method according to claim 1, It is characterized in that The determining, based on a first camera height of the virtual camera, a first data type matching the first camera height comprises: Determine a camera height interval to which the first camera height belongs in a preset set of camera height intervals, and obtain a target camera height interval; Based on the correspondence between the preset camera height intervals and the data types of the map data, the data type corresponding to the target camera height interval is determined as the first data type.

5. The method according to claim 1, It is characterized in that The step of obtaining first map data in a preset three-dimensional map that matches the first data type and the first viewing angle range of the virtual camera from the server includes: Sending a data acquisition request to the server, wherein the data acquisition request is used to request map data of the first data type located within the first viewing angle in the preset three-dimensional map; Receive the first map data returned by the server in response to the data acquisition request, wherein the first map data is acquired by the server from a target database according to the first viewing angle range, and the target database is a database for storing map data of the first data type in the preset three-dimensional map.

6. The method according to claim 1, It is characterized in that The step of loading the first map data into the three-dimensional scene includes: Based on the first camera height, determining a target loading method from a group of data loading methods, wherein the group of data loading methods are all methods for loading map data; The target loading method is adopted to load the first map data into a designated memory area of ​​the browser through multithreading, and the first map data in the designated memory area is loaded into the three-dimensional scene.

7. The method according to claim 6, It is characterized in that The step of determining a target loading method from a group of data loading methods based on the first camera height includes: When the height of the first camera is less than a preset height threshold, the data loading mode of the independent grid is determined as the target loading mode; When the height of the first camera is greater than or equal to the preset height threshold, a data loading method based on fusion loading of the same data type is determined as the target loading method.

8. The method according to any one of claims 1 to 7, It is characterized in that After loading the first map data into the three-dimensional scene, the method further includes: In response to adjusting at least one of the camera height of the virtual camera and the viewing angle range of the virtual camera, determining a second data type matching a second camera height based on a current second camera height of the virtual camera, wherein the first camera height is the same as the second camera height, or the first camera height is different from the second camera height; Acquire second map data matching the second data type and the second viewing angle range of the virtual camera in the preset three-dimensional map from the server, wherein the first viewing angle range is the same as the second viewing angle range, or the first viewing angle range is different from the second viewing angle range; The map data in the second map data that is not loaded into the three-dimensional scene is loaded into the three-dimensional scene, and the map data in the three-dimensional scene that does not belong to the second map data is removed, so that the second map data is displayed on the browser side.

9. A map data loading device, It is characterized in that include: A first determining unit, configured to determine a first data type matching a first camera height of a virtual camera based on the first camera height of the virtual camera, wherein the virtual camera is a camera matching a three-dimensional scene on a browser side; A first acquisition unit, configured to acquire, from a server, first map data in a preset three-dimensional map that matches the first data type and a first viewing angle range of the virtual camera; A loading unit is used to load the first map data into the three-dimensional scene so as to display it on the browser side.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.