An electronic map rendering method, terminal and medium
By rendering view objects with unchanged basic map elements in electronic maps off-screen or by copying them, a base map texture is generated, which solves the problem of high rendering resource consumption in electronic maps and achieves resource conservation and full utilization of hardware resources.
Patent Information
- Application Number
- CN201910884101.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-19
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2039-09-19
AI Technical Summary
In existing technologies, electronic map rendering processes consume a lot of resources, especially when the device performance is low, making it difficult to make reasonable use of system resources.
While keeping the base map elements of the view object displayed on the terminal screen unchanged, off-screen rendering or copy rendering is used to generate the base map texture of the view object, and the electronic map is rendered using the texture as the base map, reducing repeated rendering.
Off-screen rendering or copy rendering saves space and time in rendering the base map, reduces resource consumption, improves hardware resource utilization, and maintains rendering accuracy.
Smart Images

Figure CN112527926B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of electronic map technology, and in particular to an electronic map rendering method, terminal, and medium. Background Technology
[0002] Electronic maps, also known as digital maps, are maps stored and viewed digitally using computer technology. They are a type of map that uses collected map data and is displayed in a paperless manner.
[0003] Reducing resource consumption during the electronic map rendering process is a problem that technical personnel have been working on. Summary of the Invention
[0004] The problem addressed by the embodiments of the present invention is how to reduce resource overhead during the electronic map rendering process.
[0005] To address the above problems, this invention provides an electronic map rendering method, comprising:
[0006] Identify view objects whose base map elements remain unchanged in the electronic map displayed on the terminal screen;
[0007] When the rendering method is off-screen rendering, off-screen rendering is performed based on the base map elements of the view object to obtain the texture of the base map of the view object;
[0008] Using the texture as a base map, an electronic map of the view object is rendered in the corresponding display area on the terminal screen until the basic map elements in the electronic map of the view object change.
[0009] Optionally, the method further includes: determining the rendering method of the texture of the base map of the view object based on preset configuration rules, wherein the rendering method includes: off-screen rendering or copy rendering.
[0010] Optionally, determining the rendering method of the texture of the base map of the view object based on preset configuration rules includes:
[0011] The time taken to obtain the texture of the base map of the view object through off-screen rendering is determined as the first duration;
[0012] The time taken to obtain the texture of the base map of the view object through copy rendering is determined as the second duration;
[0013] Based on the comparison results of the first duration and the second duration, the configuration rules for the texture of the base map of the view object are determined.
[0014] Optionally, determining the configuration rules for the texture of the base map of the view object based on the comparison result of the first duration and the second duration includes:
[0015] If the first duration is less than or equal to the second duration, then configure the texture of the base map of the view object to be obtained through off-screen rendering;
[0016] If the first duration is greater than the second duration, then configure the texture of the base map of the view object to be obtained by copy rendering.
[0017] Optionally, the process of obtaining the texture of the base map of the view object through copy rendering includes:
[0018] Request the texture handle used for copy rendering;
[0019] Copy the base map of the electronic map of the view object that has been rendered in the current frame buffer space to the texture handle as the texture of the base map of the view object.
[0020] Optionally, the step of performing off-screen rendering based on the base map elements of the view object to obtain the texture of the view object's base map includes:
[0021] Request off-screen rendering frame cache space;
[0022] Request a texture handle for off-screen rendering;
[0023] Bind the off-screen rendering frame cache space to the texture handle used for off-screen rendering;
[0024] The base map elements of the view object are rendered in the off-screen rendering frame buffer space to obtain the texture of the view object's base map.
[0025] Optionally, the determination of view objects whose basic map elements remain unchanged in the electronic map displayed on the terminal screen includes:
[0026] Based on the state of the view object displayed on the terminal screen, and the base map elements in the electronic map of the view object and the state of the base map elements, determine whether the base map elements in the electronic map of the view object displayed on the terminal screen have changed.
[0027] When it is determined that the state of the view object displayed on the terminal screen and the state of the base map elements in the electronic map of the view object have not changed, it is determined that the base map elements in the electronic map of the view object have not changed, thus obtaining a view object in which the base map elements in the electronic map displayed on the terminal screen remain unchanged.
[0028] Optionally, the state of the view object displayed on the terminal screen, and the base map element in the electronic map of the view object and the state of the base map element, determine whether the base map element in the electronic map of the view object displayed on the terminal screen changes, comprising:
[0029] comparing the view object displayed on the terminal screen with the view object that has been displayed on the terminal screen before;
[0030] when the center point, the elevation angle, the rotation angle and the scale level of the view object do not change, determining that the state of the view object does not change;
[0031] when the base map element in the electronic map of the view object and the rendering state of the base map element do not change, determining that the base map element in the electronic map of the view object and the state of the base map element do not change;
[0032] when it is determined that the state of the view object and the state of the base map element in the electronic map of the view object do not change, it is determined that the base map element in the electronic map of the view object displayed on the terminal screen does not change; otherwise, it is determined that the base map element in the electronic map of the view object displayed on the terminal screen changes.
[0033] Optionally, rendering the electronic map of the view object in the corresponding display area of the terminal screen based on the texture as the base map, comprising:
[0034] superimposing and drawing the elements of other layers of the electronic map on the base map.
[0035] The embodiment of the application further provides another electronic map rendering method, comprising:
[0036] determining the view object of the base map element in the electronic map displayed on the terminal screen that remains unchanged, and requesting a rendering mode from a server, wherein the request carries at least the hardware index parameter of the terminal, so that the server learns the rendering mode suitable for the terminal based on the request;
[0037] when the rendering mode returned by the server is off-screen rendering, performing off-screen rendering based on the base map element of the view object to obtain the texture of the base map of the view object;
[0038] rendering the electronic map of the view object in the corresponding display area of the terminal screen based on the texture as the base map, until the base map element in the electronic map of the view object changes.
[0039] The embodiment of the present application also provides a terminal which is suitable for electronic map rendering, and the terminal comprises:
[0040] a view object determining unit suitable for determining a view object in which a basic map element in an electronic map displayed on a terminal screen remains unchanged;
[0041] an off-screen rendering unit suitable for, when the rendering mode is off-screen rendering, performing off-screen rendering based on the basic map element of the view object to obtain a texture of a base map of the view object;
[0042] a drawing unit suitable for rendering the electronic map of the view object in a corresponding display area of the terminal screen with the texture as the base map until the basic map element in the electronic map of the view object changes.
[0043] The embodiment of the present application also provides another terminal which comprises a memory and a processor, and the memory stores computer instructions capable of running on the processor, and the processor executes the steps of the electronic map rendering method of any one of the foregoing embodiments when running the computer instructions.
[0044] The embodiment of the present application also provides a computer readable storage medium which stores computer instructions, and the computer instructions execute the steps of the electronic map rendering method of any one of the foregoing embodiments when running.
[0045] Compared with the prior art, the technical scheme of the embodiment of the present application has the following beneficial effects:
[0046] In the embodiment of the present application, when the rendering mode is off-screen rendering in the case that the basic map element in the electronic map of the view object displayed on the terminal screen remains unchanged, off-screen rendering is performed based on the basic map element of the view object to obtain the texture of the base map of the view object, and then the electronic map of the view object is rendered in the corresponding display area of the terminal screen with the texture as the base map. In this process, since the texture of the base map of the view object is used as the base map, in the case that the basic map element in the electronic map of the view object displayed on the terminal screen remains unchanged, the base map of the view object does not need to be rendered repeatedly in real time, but only needs to be rendered once. Since the data amount of the map element usually contained in the base map is very large, a large amount of space for rendering the map base map and rendering time can be saved, and resource consumption in the rendering process can be reduced.
[0047] Further, the rendering mode of the texture of the base map of the view object is determined based on the preset configuration rule, so that the rendering mode can be configured according to the specific hardware characteristics of the terminal, the flexibility of the electronic map rendering mode is enhanced, and the hardware resources of the terminal under different hardware configurations can be fully utilized.
[0048] Further, the time for performing off-screen rendering to obtain the base map of the view object and the time for performing copy rendering to obtain the base map of the view object are determined, and the configuration rule of the texture of the base map of the view object is determined based on the comparison result of the two times, so that the terminal can select a shorter time to obtain the texture of the base map of the view object, and the system overhead in the electronic rendering process can be further reduced, and different hardware GPUs can be reasonably utilized.
[0049] Further, when the state of the view object displayed on the terminal screen and the state of the base map element in the electronic map of the view object and the base map element do not change, it is determined that the base map element in the electronic map of the view object does not change, and the view object whose base map element in the electronic map displayed on the terminal screen remains unchanged is obtained. The above method can accurately determine the view object whose base map element in the electronic map displayed on the terminal screen remains unchanged, and the accuracy of the rendered electronic map can be maintained while reducing the system overhead.
[0050] Further, by comparing the view object displayed on the terminal screen with the view object that has been displayed on the terminal screen before, when the center point, the elevation angle, the rotation angle and the scale level of the view object do not change, it is determined that the state of the view object does not change, and when the base map element in the electronic map of the view object and the state of the base map element do not change, it is determined that the base map element in the electronic map of the view object and the state of the base map element do not change, and then it is determined that the base map element in the electronic map of the view object displayed on the terminal screen does not change, so that the view object whose base map element in the electronic map displayed on the terminal screen remains unchanged can be accurately determined, and the base map of the view object can be accurately drawn in the corresponding display area of the terminal screen. BRIEF DESCRIPTION OF DRAWINGS
[0051] Figure 1 is a schematic view of an electronic map of a view object;
[0052] Figure 2 is a schematic view of another electronic map of a view object;
[0053] Figure 3 is a flowchart of an electronic map rendering method in an embodiment of the present application;
[0054] Figure 4 is a flowchart of a method for off-screen rendering in an embodiment of the present application;
[0055] Figure 5 is a flowchart of a method for determining a map base map of a view object in an embodiment of the present application;
[0056] Figure 6 is a flowchart of a method for copying rendering in an embodiment of the present application;
[0057] Figure 7 is a schematic diagram of a view object of an electronic map in an embodiment of the present application;
[0058] Figure 8 is a schematic diagram of another electronic map in an embodiment of the present application;
[0059] Figure 9 is a schematic diagram of yet another electronic map in an embodiment of the present application;
[0060] Figure 10 is a schematic diagram of still another electronic map in an embodiment of the present application;
[0061] Figure 11 is a schematic diagram of a structure of a terminal in an embodiment of the present application;
[0062] Figure 12 is a flowchart of another electronic map rendering method in an embodiment of the present application. DETAILED DESCRIPTION
[0063] As can be seen from the background, how to save resource consumption in the process of electronic map rendering has become a problem to be solved.
[0064] An electronic map can be displayed through a terminal device such as a mobile phone, a tablet, or a dedicated navigation device (such as a vehicle-mounted navigation device). In the process of applying an electronic map for route navigation, a terminal device displaying an electronic map can include a central processing unit (CPU) and a graphics processing unit (GPU) to render and display the electronic map on a display screen. The rendering of the electronic map can be based on elements such as points, lines, surfaces, and roads in the electronic map.
[0065] It can be understood by those skilled in the art that the electronic map can be displayed on the terminal screen by one or more view objects, each view object can include multiple layers, the electronic map is generated by superimposing multiple layers, and different elements constituting the electronic map are distributed on each layer. Among them, the base map can be the layer at the bottom of the electronic map, and the base map can include various map elements, for example, as shown in the view object of the electronic map Figure 1 The electronic map can include points, lines, surfaces, roads, and real-time traffic (Traffic Message Channel, TMC) and points of interest (Point of Interest, POI) in the electronic map. The layers above the base map can include elements such as electronic eyes, parking spaces, path lines, and the like, for example, as shown in the view object of the electronic map Figure 2 The electronic map as shown in the view object includes multiple planned path lines 21.
[0066] In the current electronic map rendering method, the terminal device displaying the electronic map usually renders all elements in the view object of the electronic map displayed at each moment.
[0067] Since the CPU and GPU consume high system resources when rendering the electronic map, the resource consumption in the electronic map rendering process is always high, especially when the performance of the device displaying the electronic map is not high, and the system resources of the device displaying the electronic map are difficult to be reasonably applied.
[0068] The inventors have found through research that in some scenarios, the base map of the map does not change, that is, the point, line, surface, road and other base map elements displayed in the electronic map do not change, and the map elements in the layers above the base map can change. For convenience of description, in this paper, the state of the base map of the map without change can be referred to as the view object being in an immersive state; the state of the base map of the map with change can be referred to as the view object being in a non-immersive state.
[0069] For example, when the terminal device displaying the electronic map is stationary at a certain position, the view object in the display area of the terminal screen can be in an immersive state. In this case, the CPU and GPU of the terminal device displaying the electronic map usually continue to render the displayed electronic map in the current on-screen rendering mode. It should be noted that the current on-screen rendering mode described herein refers to rendering and then displaying by the device displaying the electronic map according to the points, lines, surfaces, roads, TMCs, POIs and the like to be displayed at the current moment of the electronic map. At the next moment, the device displaying the electronic map renders and displays again according to the map elements to be displayed.
[0070] For the above scenario, the existing electronic map rendering method requires a large amount of resource consumption.
[0071] In order to reduce resource consumption in the process of rendering the electronic map, in the case that the basic map elements in the electronic map of the view object displayed on the terminal screen remain unchanged, the basic map elements of the view object are used to perform off-screen rendering to obtain the texture of the base map of the view object, and then the electronic map of the view object is rendered in the corresponding display area of the terminal screen by using the texture as the base map. In this process, since the texture of the base map of the view object is used as the base map, in the case that the basic map elements in the electronic map of the view object displayed on the terminal screen remain unchanged, the base map of the view object does not need to be rendered repeatedly in real time, but only needs to be rendered once. Since the data amount of the map elements usually contained in the base map is very large, a large amount of space for rendering the base map of the map and rendering time can be saved, and resource consumption in the process of rendering can be reduced.
[0072] In order to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings.
[0073] Referring to Figure 3 The flowchart of the electronic map rendering method shown in FIG. 1 can include the following steps in the embodiments of the present application:
[0074] S31, determining a view object whose basic map elements in the electronic map displayed on the terminal screen remain unchanged.
[0075] The view object is a view on the electronic map displayed on the terminal screen, and one or more view objects can be displayed on one terminal screen. As described above, each view object can include a plurality of layers, and different elements constituting the electronic map are distributed on each layer. In the embodiments of the present application, the contour shape of the view object is not limited, for example, it can be a rectangle, a square, a circle, etc., or other regular or irregular shapes. When there are a plurality of view objects, the view objects can be distributed in different display areas on the terminal screen, or some of the view objects can overlap.
[0076] In an embodiment of the present application, the basic map elements in the electronic map of the view object can include points, lines, surfaces and roads displayed on the electronic map, and in other embodiments of the present application, the basic map elements of the electronic map can further include at least one of TMC, points of interest, etc. in the electronic map, or other basic map elements.
[0077] In a specific implementation, the view object whose underlying map element in the electronic map displayed on the terminal screen remains unchanged can be determined by comparing the electronic maps of the view objects successively drawn on the terminal screen. For example, if the base map of the electronic maps of the view objects of a certain terminal screen does not change for a preset number of consecutive frames, it can be considered that the view object whose underlying map element in the electronic map displayed on the terminal screen remains unchanged, for example, the base map of the view objects of two consecutive frames does not change, or the base map of the view objects of three consecutive frames does not change. If the base map of the view objects of a preset number of consecutive frames does not change, for the convenience of description, it can be referred to as the view object entering the immersive state. When the view object is in the immersive state, if it is detected that the base map of the view object has changed, it can be referred to as the view object exiting the immersive state and entering the non-immersive state.
[0078] To accurately determine the view object whose underlying map element in the electronic map displayed on the terminal screen remains unchanged, in a specific implementation, the state of the view object displayed on the terminal screen and the base map element in the electronic map of the view object and the state of the base map element can be used to determine whether the underlying map element in the electronic map of the view object displayed on the terminal screen changes; when it is determined that the state of the view object displayed on the terminal screen and the base map element in the electronic map of the view object and the state of the base map element do not change, it is determined that the underlying map element in the electronic map of the view object does not change, and the view object whose underlying map element in the electronic map displayed on the terminal screen remains unchanged is obtained.
[0079] In an embodiment of the present application, the following method is used to determine whether the underlying map element in the electronic map of the view object displayed on the terminal screen changes:
[0080] First, the view object displayed on the terminal screen is compared with the view object that has been displayed on the terminal screen before. If the center point, the elevation angle, the rotation angle and the scale level of the view object do not change, it is determined that the state of the view object does not change; if the base map element in the electronic map of the view object and the rendering state of the base map element do not change, it is determined that the base map element in the electronic map of the view object and the state of the base map element do not change. Then, when it is determined that the state of the view object and the base map element in the electronic map of the view object and the state of the base map element do not change, it is determined that the underlying map element in the electronic map of the view object displayed on the terminal screen does not change; otherwise, it is determined that the underlying map element in the electronic map of the view object displayed on the terminal screen changes.
[0081] In a specific implementation, before the view object enters the immersive state, the rendering manner of the electronic map of the view object on the terminal screen can be an on-screen rendering manner, which can also be referred to as a foreground rendering mode. Whether the view object currently displayed in the corresponding display area of the terminal screen is in the immersive state can be detected and determined at a preset time interval.
[0082] S32, when the rendering manner is off-screen rendering, off-screen rendering is performed based on the basic map element of the view object to obtain a texture of the base map of the view object.
[0083] S33, the electronic map of the view object is rendered in the corresponding display area of the terminal screen with the texture as the base map until the basic map element in the electronic map of the view object changes.
[0084] After the texture of the base map of the view object is obtained through off-screen rendering, the current on-screen rendering can be switched to, and the electronic map elements of other layers, such as the electronic eye, path line and other point or line elements in the dynamic layer on the base map, are superimposed and drawn on the base map with the texture as the base map.
[0085] In the current scheme, the base map of the view object needs to be rendered in real time regardless of the situation. As can be understood by those skilled in the art, the base map usually includes a large number of road, building, green land, TMC and other elements, and therefore a large amount of time and system overhead is consumed. In the above embodiments of the present application, during the electronic map rendering process, the base map of the electronic map of the view object can be obtained through off-screen rendering only when it is determined that the basic map element in the electronic map of the view object remains unchanged, and then the rendering is not repeated when the basic map element in the electronic map of the view object remains unchanged, thereby reducing the amount of data loaded and the rendering time and reducing the resource overhead of the electronic map rendering process.
[0086] For step S32, to make those skilled in the art understand how to obtain the texture of the base map of the view object through off-screen rendering, the following is an example of a specific implementation of off-screen rendering. Referring to the flowchart of the off-screen rendering method shown in FIG. 3, the off-screen rendering can be implemented through the following steps: Figure 4
[0087] S321, an off-screen rendering frame buffer space is applied for.
[0088] S322, a texture handle used for off-screen rendering is applied for.
[0089] S323, the off-screen rendering frame buffer space is bound to the texture handle used for off-screen rendering.
[0090] S324, rendering the base map element of the view object in the off-screen rendering frame buffer space to obtain a texture of the base map of the view object.
[0091] Those skilled in the art can understand that the steps in the embodiments of the present application are not necessarily executed in the order of the above step labels, and each different step label is only used to distinguish different steps, and does not mean that only the shown order can be executed. For example, for off-screen rendering, the order of steps S321 and S322 is not unique, and step S321 can be executed first, or step S322 can be executed first, or both can be executed simultaneously in parallel.
[0092] In specific implementations, the embodiments of the present application can be further extended and optimized as needed. Referring to the accompanying drawings, an extended example is given. It can be understood that the following specific examples do not limit the protection scope of the present application, but only facilitate better understanding and application by those skilled in the art.
[0093] In specific implementations, when it is detected that the view object displayed on the terminal screen enters the immersive state, that is, it is determined that the base map element in the electronic map of the view object displayed on the terminal screen remains unchanged, in addition to obtaining the texture of the base map of the view object through off-screen rendering, the texture of the base map of the view object can also be obtained through other rendering methods, for example, the texture of the base map of the view object can be obtained through a copy rendering method. Therefore, the rendering method for obtaining the texture of the base map of the view object when the view object enters the immersive state can be configured by the technician.
[0094] In the embodiments of the present application, appropriate rendering methods can be configured according to the specific hardware (including GPU, etc.) characteristics of the terminal, to enhance the flexibility of electronic map rendering, so that the hardware resources of the terminal under different hardware configurations can be more fully utilized, and the rendering method for obtaining the texture of the base map of the view object can be determined based on a preset configuration rule.
[0095] For example, in order to enhance the compatibility and flexibility of the electronic map rendering scheme of the embodiment of the present application, reasonably utilize different hardware GPUs, and reduce the rendering overhead of the electronic map as much as possible, the time for obtaining the texture of the base map of the view object by off-screen rendering can be determined as the first time length, and the time for obtaining the texture of the base map of the view object by copy rendering can be determined as the second time length, and the configuration rule for obtaining the texture of the base map of the view object can be determined according to the comparison result of the first time length and the second time length, so that the rendering mode with shorter actual use time can be selected to obtain the texture of the base map of the view object according to the hardware GPU of the terminal for rendering the electronic map, so as to reduce the hardware overhead as much as possible.
[0096] Referring to Figure 5 The embodiment of the present application can determine the mode for obtaining the texture of the base map of the view object in the following manner, and then the electronic map rendering of the view object can be performed based on the texture.
[0097] S51, determining the time for obtaining the texture of the base map of the view object by off-screen rendering as the first time length t1.
[0098] S52, determining the time for obtaining the texture of the base map of the view object by copy rendering as the second time length t2.
[0099] In a specific implementation, the first time length t1 and the second time length t2 can be determined in various ways, for example, the first time length t1 and the second time length t2 can be determined by data burying or timing measurement.
[0100] S53, comparing the first time length t1 and the second time length t2, if the first time length t1 is less than or equal to the second time length t2, step S54 is performed; otherwise, step S55 is performed.
[0101] S54, configuring to obtain the texture of the base map of the view object by off-screen rendering.
[0102] S55, configuring to obtain the texture of the base map of the view object by copy rendering.
[0103] If the texture of the base map of the view object is configured to be obtained by off-screen rendering, the terminal can obtain the configuration parameters for obtaining the texture of the base map of the view object before obtaining the base map of the view object, for example, before the electronic map rendering, or even when the terminal is started, and the specific mode for obtaining the texture of the base map of the view object can be obtained from the configuration parameters, and the configured mode is used for rendering to obtain the texture of the base map of the view object.
[0104] How to get the texture of the base map of the view object through off-screen rendering can refer to Figure 4 and the specific description in the foregoing embodiments, which will not be repeated here. The following refers to Figure 6 , gives a specific example of getting the texture of the base map of the view object through copy rendering, and the specific steps are as follows:
[0105] S61, apply for a texture handle for copy rendering.
[0106] S62, copy the base map of the electronic map of the view object that has been rendered in the current frame buffer space to the texture handle as the texture of the base map of the view object.
[0107] Through the foregoing embodiments, for the view object entering the immersive state, the base map of the electronic map of the view object that is currently displayed on the screen can be copied as the texture of the base map of the view object, so that the base map of the electronic map of the view object does not need to be rendered all the time, and thus the resource consumption can be reduced.
[0108] In the embodiments of the present application, for the view object entering the immersive state, after the base map of the electronic map of the view object is obtained through off-screen rendering or copy rendering, it can be saved in the respective applied texture space. Assuming that the texture identifier (ID) is 100, if the view object is in the immersive state all the time subsequently, drawing the base map of the view object only needs to draw a texture image with the texture ID of 100, and then the base maps of all the electronic maps of the view object are not rendered. After the texture image with the texture ID of 100 is drawn, the elements of other layers of the electronic map are superimposed and drawn on the texture image, so that the purpose of reducing the resource consumption of the CPU and GPU can be achieved.
[0109] In order for those skilled in the art to better understand and apply the embodiments of the present application, the following will be described in detail through some specific application scenarios.
[0110] Among them, the view object in the terminal screen can be a region of the electronic map displayed by the terminal display screen, for example, Figure 7 the view object 71 shown in the figure.
[0111] As described above, in some scenarios, whether the base map in the electronic map of the view object changes can be determined through some conditions, which can be determined from whether the state of the view object, and whether the base map elements in the view object and the rendering state of the base map elements change. For example, whether the base map in the electronic map of the view object changes can be determined by whether the center point, the elevation angle, the rotation angle, the scale level of the view object in the electronic map, and the rendering state of the base map elements in the view object and the base map elements in the electronic map remain unchanged.
[0112] Specifically, the base map can be determined to be unchanged when the electronic map of the view object meets the following conditions: the center point of the view object has not changed; the elevation angle of the view object has not changed; the rotation angle of the view object has not changed; the scale level of the view object has not changed; the base map elements in the electronic map of the view object have not changed; and the rendering state of the base map elements in the electronic map of the view object has not changed. In summary, if all the above conditions are met, the view object can be determined to be in an immersive state; otherwise, the view object is in a non-immersive state. These conditions will be explained separately below.
[0113] Continue to refer to Figure 7 The view object 71 in the electronic map shown can have its center point as the center point of the display area of the electronic map on the terminal device screen, such as point A. In specific implementations, if the center point of the view object changes, it can be determined that the view object is in a navigation or cruise state. For example, the terminal device is in motion in physical space, or the user manually changes the center point of the view object, etc. In this case, the view object is in a non-immersive state.
[0114] In another application scenario, as the terminal device moves, the road surface is uneven, or due to user operation, the elevation angle of the view object will change. If the elevation angle of the view object changes, it can be determined that the view object is in a non-immersive state.
[0115] Reference Figure 7 and Figure 8 In contrast Figure 7 , Figure 8 The rotation angle of point B in the view object 81 shown relative to point A has changed, thus it can be determined that... Figure 8 The view object 81 shown is in a non-immersive state.
[0116] In another application scenario, because the base map of the view object includes various elements such as points, lines, polygons, roads, TMCs, and POIs, a change in one or more elements in the base map will alter the rendering state of the view object. For example, a change in TMCs, the number of POIs, or the coordinate position of the same POI can indicate that the view object is in a non-immersive state. Assume... Figure 7 View object 71 and Figure 9 View object 91 in the image consists of two consecutive frames of the same view object, such as in... Figure 7 Point B, the POI shown in view object 71 of the electronic map, is located in... Figure 9 If it is not displayed, then the rendering state of the view object has changed.
[0117] Those skilled in the art will understand that the above are merely illustrative examples, and other confirmation methods or conditions may exist in other embodiments, without limitation. Any setting that determines whether the base map of a view object in an electronic map has not changed is within the scope of protection of this invention.
[0118] In a specific implementation of the present invention, the view objects displayed on the terminal screen may include multiple objects. It can be determined whether each view object in the electronic map on the terminal screen is in an immersive state. Then it can be determined whether the texture of the base map of the corresponding view object can be obtained by using the off-screen rendering method or copy rendering method of the present invention. When the view object is continuously in an immersive state, the texture is used as the base map in the subsequent current screen rendering process to render the electronic map of the view object, including overlaying and drawing elements of other layers of the electronic map after the base map.
[0119] For example, refer to Figure 10 The diagram shown illustrates the view objects displayed on the terminal screen. On the terminal screen, within a pre-defined display area, a main view object 101 and a secondary view object 102 are displayed. The main view object 101 has a larger display scale than the secondary view object 102. As the terminal device moves, the elements displayed in the main view object 101 change in real time, such as POIs and TMCs. The main view object 101 can be rendered and refreshed in real time. In the secondary view object 102, only the path line 1021 and the terminal device identifier 1022 change with the movement of the terminal device. Based on the difference in view object size, the main view object can also be called a large map, and the secondary view object can also be called a small map, or a bird's-eye view.
[0120] In practice, it can be determined whether the basic map elements in the electronic maps of the main view object 101 and the auxiliary view object 102 have changed, that is, it can be determined whether the main view object 101 and the auxiliary view object are in an immersive state. For example, it can be determined that the main view object 101 is in a non-immersive state and the auxiliary view object 102 is in an immersive state.
[0121] For the auxiliary view object 102 in the immersive state, the elements in the base map do not change, and when rendering the electronic map, the texture of the base map obtained by off-screen rendering or copy rendering can be taken as the base map, and the base map and the path line 1021 and the terminal device identifier 1022 in the layer above the base map are drawn based on the base map, so that the elements in the base map of the auxiliary view object 102 do not need to be drawn repeatedly, and therefore, the resource consumption can be reduced, and the rendering time can be reduced. It is found through statistics that more than half of the time of the terminal in the navigation process is in the immersive state of the auxiliary view object, and therefore, the resource consumption can be greatly reduced by using the scheme of the embodiment of the application.
[0122] It can be understood that, in addition to the rendering interfaces of the view object in the various forms of the foregoing embodiment examples, other forms of rendering interfaces can also be used.
[0123] After the base map of the view object is drawn in the corresponding display area of the terminal screen by using any one of the foregoing embodiments of the application, the drawing of other layers above the base map can be further performed, and dynamic map elements are drawn in real time. The dynamic map elements, that is, dynamic map elements, can be the elements in the layers above the base map, for example, can include electronic eyes, parking spaces, path lines and the like.
[0124] It can be understood by those skilled in the art that, in a specific implementation, when it is determined that the electronic map of the view object in the current screen is in a hardware environment in which the anti-aliasing is enabled in the current screen rendering mode, whether the texture of the base map in the electronic map of the view object is subjected to off-screen rendering or copy rendering can be determined according to the hardware conditions of the terminal device. For example, if the terminal device can perform off-screen rendering in the hardware environment in which the anti-aliasing is enabled, the texture of the base map of the view object in the immersive state can be subjected to off-screen rendering, if the terminal device cannot perform off-screen rendering or copy rendering in the hardware environment in which the anti-aliasing is enabled, the current screen rendering mode introduced in the foregoing embodiments of the application can be used to draw the base map of each frame of the view object in real time in the corresponding area of the terminal screen, and the map elements in the other layers above the base map of the view object are superimposed and drawn.
[0125] By using the foregoing embodiments, for the view object in the immersive state, the texture of the base map of the view object obtained by off-screen rendering or copy rendering is taken as the base map, and the other layers of the electronic map of the view object are superimposed and drawn above the base map, so that the system consumption required for repeatedly drawing the base map can be reduced, and therefore, the resource consumption can be reduced.
[0126] The embodiment of the application further provides a terminal, which refers to Figure 11 The terminal 110 can include:
[0127] The view object determining unit 111 is adapted to determine a view object whose base map element in the electronic map displayed on the terminal screen remains unchanged.
[0128] The off-screen rendering unit 112 is adapted to perform off-screen rendering based on the base map element of the view object when the rendering mode is off-screen rendering, to obtain a texture of the base map of the view object.
[0129] The drawing unit 113 is adapted to render the electronic map of the view object in the corresponding display area of the terminal screen with the texture as the base map, until the base map element in the electronic map of the view object changes.
[0130] In a specific implementation, the drawing unit 113 is adapted to superimpose and draw the elements of other layers of the electronic map on the base map with the texture as the base map.
[0131] In a specific implementation, the view object determining unit 111 is adapted to determine whether the base map element in the electronic map of the view object displayed on the terminal screen changes based on the state of the view object displayed on the terminal screen, and the base map element in the electronic map of the view object and the state of the base map element; and determine that the base map element in the electronic map of the view object does not change when the state of the view object displayed on the terminal screen and the state of the base map element in the electronic map of the view object and the base map element do not change, to obtain the view object whose base map element in the electronic map displayed on the terminal screen remains unchanged.
[0132] In an embodiment of the present application, the view object determining unit 111 can include the following sub-units.
[0133] The comparison sub-unit is adapted to compare the view object displayed on the terminal screen with the view object that has been displayed on the terminal screen before;
[0134] The first determining sub-unit 1111 is adapted to determine that the state of the view object does not change when the center point, the elevation angle, the rotation angle and the scale level of the view object do not change.
[0135] The second determining sub-unit 1112 is adapted to determine that the base map element in the electronic map of the view object and the state of the base map element do not change when the base map element in the electronic map of the view object and the rendering state of the base map element do not change.
[0136] The third determination sub-unit 1113 is adapted to determine that the base map element in the electronic map of the view object displayed on the terminal screen does not change when it is determined that the state of the view object and the state of the base map element in the electronic map of the view object do not change; otherwise, it is determined that the base map element in the electronic map of the view object displayed on the terminal screen changes.
[0137] The view object determination unit can accurately determine the view object whose base map element in the electronic map displayed on the terminal screen remains unchanged, and then accurately draw the texture of the base map of the view object in the corresponding display area of the terminal screen.
[0138] In a specific implementation, the terminal 110 can further include a rendering mode determination unit 114 adapted to determine a rendering mode of the texture of the base map of the view object based on a preset configuration rule, wherein the rendering mode includes off-screen rendering or copy rendering.
[0139] In an embodiment of the present application, the rendering mode determination unit 114 can include the following sub-units:
[0140] The first time length determination sub-unit 1141 is adapted to determine the time for performing off-screen rendering to obtain the texture of the base map of the view object as a first time length.
[0141] The second time length determination sub-unit 1142 is adapted to determine the time for copying the texture of the base map of the view object as a second time length.
[0142] The configuration rule determination sub-unit 1143 is adapted to determine the configuration rule for obtaining the texture of the base map of the view object based on the comparison result of the first time length and the second time length.
[0143] By adding the above units or sub-units on the terminal, the configuration rule for obtaining the texture of the base map of the view object is set, so that the terminal can select a shorter time to obtain the texture of the base map of the view object, thereby further reducing the system overhead in the electronic rendering process, and enhancing the compatibility and flexibility of the electronic map rendering scheme, and reasonably utilizing different hardware GPUs.
[0144] In an embodiment of the present application, the configuration rule determination sub-unit 1143 is adapted to configure the texture of the base map of the view object to be obtained by off-screen rendering when the first time length is less than or equal to the second time length; and is adapted to configure the texture of the base map of the view object to be obtained by copy rendering when the first time length is greater than the second time length.
[0145] In a specific implementation, reference is made to Figure 11The off-screen rendering unit 112 can comprise an off-screen rendering space application subunit 1121, an off-screen rendering texture handle application subunit 1122, a first binding subunit 1123, and a first rendering subunit 1124.
[0146] The off-screen rendering space application subunit 1121 is adapted to apply an off-screen rendering frame buffer space.
[0147] The off-screen rendering texture handle application subunit 1122 is adapted to apply a texture handle used by the off-screen rendering.
[0148] The binding subunit 1123 is adapted to bind the off-screen rendering frame buffer space and the texture handle used by the off-screen rendering.
[0149] The off-screen rendering subunit 1124 is adapted to render a base map element of the view object in the off-screen rendering frame buffer space to obtain a texture of the base map of the view object.
[0150] In a specific implementation, the terminal 110 can further comprise a copy rendering unit 115 adapted to obtain the texture of the base map of the view object through copy rendering.
[0151] Continuing to refer to Figure 11 In a specific implementation, the copy rendering unit 115 can comprise the following subunits:
[0152] The copy rendering texture handle application subunit 1151 is adapted to apply a texture handle used by copy rendering.
[0153] The copy subunit 1152 is adapted to copy a base map of an electronic map of the view object that has been rendered in a current frame buffer space to the texture handle as a texture of the base map of the view object.
[0154] The electronic map rendering method adopted by the embodiments of the present application can be applied in various scenarios, for example, in addition to map navigation, it can also be applied to indoor maps, the field of industrial internet (such as navigation of chips on a production line), etc.
[0155] Referring to Figure 12 the flowchart of the electronic map rendering method shown, in another embodiment of the present application, the method can specifically comprise the following steps:
[0156] S121, determining a view object of which a base map element in an electronic map displayed on a terminal screen remains unchanged, and requesting a rendering mode from a server, wherein the request carries at least a hardware index parameter of the terminal, so that the server learns a rendering mode suitable for the terminal based on the request.
[0157] For example, the system hardware information of the terminal can be acquired through the network after the system is started to be connected to the network, such as the system hardware parameters, the GPU model and other key hardware index parameters, and then the hardware index parameters can be uploaded to the server.
[0158] S122, when the rendering mode returned by the server is off-screen rendering, performing off-screen rendering based on the base map elements of the view object to obtain the texture of the base map of the view object.
[0159] In a specific implementation, the server can find the parameters matched with the terminal model performance, the rendering software used and the like from the database through big data, machine learning, artificial intelligence analysis and the like, and determine the applicable rendering mode.
[0160] In an embodiment of the present application, the database stores the hardware terminal information describing all the access to the preset navigation platform, and the information of the two rendering modes (off-screen rendering and copy rendering) used by each hardware terminal in the embodiment of the present application. The acquired key hardware index parameters can be matched in the database by using the preset machine learning or artificial intelligence analysis algorithm, so that which rendering mode can be automatically selected. Then, the server can modify the configuration information in the navigation software of the terminal sending the request through the network protocol, for example, based on the learning result, the configuration information of the rendering mode in the navigation software of the terminal sending the request is modified to the configuration parameters corresponding to the off-screen rendering.
[0161] S123, rendering the electronic map of the view object in the corresponding display area in the terminal screen with the texture as the base map until the base map elements in the electronic map of the view object change.
[0162] The above scheme makes the rendering mode used by the terminal more matched with the hardware index parameters of the terminal, so that the resources of the terminal in the electronic map rendering process are more fully utilized.
[0163] The specific implementation and beneficial effects of the terminal suitable for electronic map rendering in the embodiment of the present application can be referred to the electronic map rendering method in the embodiment of the present application, which will not be described here.
[0164] The embodiment of the present application also provides another terminal, which comprises a memory and a processor, the memory stores computer instructions capable of running on the processor, and the processor is adapted to execute the steps of the electronic map rendering method of any one of the preceding embodiments when running the computer instructions. The specific steps can be referred to the description of the preceding embodiments, which will not be described here.
[0165] In a specific implementation, the terminal can be a smart phone, a tablet computer, a dedicated navigation device installed in a vehicle, or various appropriate electronic devices.
[0166] The terminal can include one screen or multiple screens.
[0167] In the embodiments of the present application, if the terminal has only one screen, one or more view objects can be displayed in the screen.
[0168] In the embodiments of the present application, if the terminal has multiple screens, one view object in the electronic map can be rendered and drawn in the display area of the multiple screens at the same time.
[0169] It can be understood that the area map, location information, and the like displayed on the terminal screen through a browser or various application clients are also specific presentation forms of the electronic map, and the rendering method in the embodiments of the present application can also be used.
[0170] The embodiments of the present application also provide a computer readable storage medium having computer instructions stored thereon, and the computer instructions perform the steps of the electronic map rendering method in any of the foregoing embodiments when executed.
[0171] The computer readable storage medium can be an optical disc, a mechanical hard disk, a solid state disk, or the like.
[0172] Although the embodiments of the present application are disclosed as above, the present application is not limited thereto. Any person skilled in the art can make various modifications and changes without departing from the spirit and scope of the present application, and the protection scope of the present application should be subject to the scope defined by the claims.
Claims
1. An electronic map rendering method, characterized by, include: Based on the state of the view object displayed on the terminal screen, and the base map elements in the electronic map of the view object and the state of the base map elements, determine whether the base map elements in the electronic map of the view object displayed on the terminal screen have changed. When it is determined that the state of the view object displayed on the terminal screen and the state of the base map elements in the electronic map of the view object have not changed, it is determined that the base map elements in the electronic map of the view object have not changed, and a view object with unchanged base map elements in the electronic map displayed on the terminal screen is obtained. The view object with unchanged base map elements enters the immersive state, and the view object includes multiple layers. When the rendering method is off-screen rendering, off-screen rendering is performed based on the base map elements of the view object to obtain the texture of the base map of the view object; Using the texture as a base map, an electronic map of the view object is rendered in the corresponding display area on the terminal screen until the basic map elements in the electronic map of the view object change.
2. The method according to claim 1, characterized in that, Also includes: The rendering method of the texture of the base map of the view object is determined based on preset configuration rules. The rendering method includes: off-screen rendering or copy rendering.
3. The method according to claim 2, characterized in that, The rendering method for determining the texture of the base map of the view object based on preset configuration rules includes: The time taken to obtain the texture of the base map of the view object through off-screen rendering is determined as the first duration; The time taken to obtain the texture of the base map of the view object through copy rendering is determined as the second duration; Based on the comparison results of the first duration and the second duration, the configuration rules for the texture of the base map of the view object are determined.
4. The method according to claim 3, characterized in that, The configuration rules for determining the texture of the base map of the view object based on the comparison result of the first duration and the second duration include: If the first duration is less than or equal to the second duration, then configure the texture of the base map of the view object to be obtained through off-screen rendering; If the first duration is greater than the second duration, then configure the texture of the base map of the view object to be obtained by copy rendering.
5. The method according to claim 4, characterized in that, The texture of the base map of the view object obtained by copy rendering includes: Request the texture handle used for copy rendering; Copy the base map of the electronic map of the view object that has been rendered in the current frame buffer space to the texture handle as the texture of the base map of the view object.
6. The method according to any one of claims 1-5, characterized in that, The process of rendering the base map texture of the view object off-screen based on the basic map elements of the view object includes: Request off-screen rendering frame cache space; Request a texture handle for off-screen rendering; Bind the off-screen rendering frame cache space to the texture handle used for off-screen rendering; The base map elements of the view object are rendered in the off-screen rendering frame buffer space to obtain the texture of the view object's base map.
7. The method according to claim 1, characterized in that, The determination of whether the base map elements in the electronic map of the view object displayed on the terminal screen have changed based on the state of the view object displayed on the terminal screen, the base map elements in the electronic map of the view object, and the state of the base map elements includes: Compare the view objects displayed on the terminal screen with view objects that have been previously displayed on the terminal screen; When the center point, elevation angle, rotation angle, and scale level of the view object remain unchanged, it is determined that the state of the view object has not changed. When the base map elements in the electronic map of the view object and the rendering state of the base map elements have not changed, it is determined that the base map elements in the electronic map of the view object and the state of the base map elements have not changed. If the state of the view object and the base map elements in the electronic map of the view object have not changed, it is determined that the base map elements in the electronic map of the view object displayed on the terminal screen have not changed; otherwise, it is determined that the base map elements in the electronic map of the view object displayed on the terminal screen have changed.
8. The method according to any one of claims 1-5, characterized in that, The step of rendering an electronic map of the view object in the corresponding display area on the terminal screen using the texture as a base map includes: Using the texture as a base map, elements of other layers of the electronic map are overlaid on top of the base map.
9. An electronic map rendering method, characterized in that, include: Based on the state of the view object displayed on the terminal screen, and the base map elements in the electronic map of the view object and the state of the base map elements, determine whether the base map elements in the electronic map of the view object displayed on the terminal screen have changed. When it is determined that the state of the view object displayed on the terminal screen and the state of the base map elements in the electronic map of the view object have not changed, it is determined that the base map elements in the electronic map of the view object have not changed, and a view object with unchanged base map elements in the electronic map displayed on the terminal screen is obtained. Then, a rendering method is requested from the server. The request carries at least the hardware index parameters of the terminal so that the server can learn a rendering method suitable for the terminal based on the request. The view object with unchanged base map elements enters an immersive state. The view object includes multiple layers. When the server returns that the rendering method is off-screen rendering, off-screen rendering is performed based on the base map elements of the view object to obtain the texture of the base map of the view object; Using the texture as a base map, an electronic map of the view object is rendered in the corresponding display area on the terminal screen until the basic map elements in the electronic map of the view object change.
10. A terminal, characterized in that, The terminal, suitable for electronic map rendering, includes: The view object determination unit is adapted to determine whether the base map elements in the electronic map of the view object displayed on the terminal screen have changed based on the state of the view object displayed on the terminal screen, the base map elements in the electronic map of the view object, and the state of the base map elements. When it is determined that the state of the view object displayed on the terminal screen and the state of the base map elements in the electronic map of the view object have not changed, it is determined that the base map elements in the electronic map of the view object have not changed, and a view object with unchanged base map elements in the electronic map displayed on the terminal screen is obtained. The view object with unchanged base map elements enters the immersive state, and the view object includes multiple layers. The off-screen rendering unit is suitable for performing off-screen rendering based on the base map elements of the view object when the rendering mode is off-screen rendering, so as to obtain the texture of the base map of the view object; The rendering unit is adapted to render an electronic map of the view object in the corresponding display area of the terminal screen using the texture as a base map, until the basic map elements in the electronic map of the view object change.
11. A terminal comprising a memory and a processor, wherein the memory stores computer instructions executable on the processor, characterized in that, When the processor executes the computer instructions, it performs the steps of the electronic map rendering method according to any one of claims 1 to 8.
12. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the computer instructions are executed, they perform the steps of the electronic map rendering method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Hybrid rending apparatus and method
CN101923727A
Rendering method and system of geographic information system
CN103035164A
Video processing method and device, electronic device and computer readable medium
CN109218802A
Map rendering method and related equipment
CN110019612A
Generating images quickly in raster image processing
US20020109853A1