CN112527926A - Electronic map rendering method, terminal and medium - Google Patents

Electronic map rendering method, terminal and medium Download PDF

Info

Publication number
CN112527926A
CN112527926A CN201910884101.2A CN201910884101A CN112527926A CN 112527926 A CN112527926 A CN 112527926A CN 201910884101 A CN201910884101 A CN 201910884101A CN 112527926 A CN112527926 A CN 112527926A
Authority
CN
China
Prior art keywords
view object
map
rendering
texture
screen
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910884101.2A
Other languages
Chinese (zh)
Inventor
吴朝良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201910884101.2A priority Critical patent/CN112527926A/en
Publication of CN112527926A publication Critical patent/CN112527926A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/26Visual data mining; Browsing structured data

Abstract

The embodiment of the invention discloses an electronic map rendering method, a terminal and a medium, wherein the electronic map rendering method comprises the following steps: determining a view object in which basic map elements in an electronic map displayed on a terminal screen are kept unchanged; when the rendering mode is off-screen rendering, performing off-screen rendering based on the basic map element of the view object to obtain the texture of the base map of the view object; and with the texture as a base map, rendering the electronic map of the view object in a corresponding display area in the terminal screen until basic map elements in the electronic map of the view object are changed. The technical scheme in the embodiment of the invention can save the resource overhead in the process of rendering the electronic map.

Description

Electronic map rendering method, terminal and medium
Technical Field
The embodiment of the invention relates to the technical field of electronic maps, in particular to an electronic map rendering method, a terminal and a medium.
Background
An electronic map, i.e., a digital map, is a map that is stored and referred to digitally by using a computer technology, and is a map that is displayed in a paperless manner using collected map data.
Reducing the resource overhead in the process of rendering the electronic map is a problem that technicians are always solving.
Disclosure of Invention
The embodiment of the invention solves the problem of reducing the resource overhead in the process of rendering the electronic map.
In order to solve the above problems, the present invention provides an electronic map rendering method, including:
determining a view object in which basic map elements in an electronic map displayed on a terminal screen are kept unchanged;
when the rendering mode is off-screen rendering, performing off-screen rendering based on the basic map element of the view object to obtain the texture of the base map of the view object;
and with the texture as a base map, rendering the electronic map of the view object in a corresponding display area in the terminal screen until basic map elements in the electronic map of the view object are changed.
Optionally, the method further comprises: determining a rendering mode of obtaining the texture of the base map of the view object based on a preset configuration rule, wherein the rendering mode comprises the following steps: off-screen rendering or replica rendering.
Optionally, the determining, based on a preset configuration rule, a rendering manner of a texture of a base map of the view object includes:
determining time for obtaining texture of the base map of the view object by performing off-screen rendering as first duration;
determining time for obtaining texture of the base map of the view object by copying and rendering as second duration;
and determining a configuration rule of the texture of the base map of the view object based on the comparison result of the first duration and the second duration.
Optionally, the determining, based on the comparison result of the first duration and the second duration, a configuration rule of obtaining a texture of the base map of the view object includes:
if the first duration is less than or equal to the second duration, configuring texture of a base map of the view object obtained through off-screen rendering;
and if the first duration is longer than the second duration, configuring texture of a base map of the view object obtained by copying and rendering.
Optionally, the obtaining, by copying and rendering, a texture of the base map of the view object includes:
applying for copying and rendering a used texture handle;
copying the base map of the rendered electronic map of the view object in the current frame cache space to the texture handle as the texture of the base map of the view object.
Optionally, the 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 includes:
applying for off-screen rendering frame buffer space;
applying for texture handles used for off-screen rendering;
binding the off-screen rendering frame cache space with a texture handle used by the off-screen rendering;
and rendering the basic map element of the view object in the off-screen rendering frame buffer space to obtain the texture of the base map of the view object.
Optionally, the determining a view object in which a basic map element in an electronic map displayed on a terminal screen remains unchanged includes:
determining whether a basic map element in an electronic map of a view object displayed on a terminal screen changes based on a state of the view object displayed on the terminal screen, and a base map element in the electronic map of the view object and states of the base map element;
when the state of the view object displayed on the terminal screen is determined, and neither the base map element in the electronic map of the view object nor the state of the base map element is changed, determining that the basic map element in the electronic map of the view object is not changed, and obtaining the view object with the basic map element in the electronic map displayed on the terminal screen kept unchanged.
Optionally, the determining, 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, whether a base map element in the electronic map of the view object displayed on the terminal screen changes includes:
comparing the view object displayed on the terminal screen with view objects that have been displayed on the terminal screen before the view object;
when the central point, the elevation angle, the rotation angle and the scale level of the view object are not changed, determining that the state of the view object is not changed;
when the rendering state of the bottom map element and the rendering state of the bottom map element in the electronic map of the view object are not changed, determining that the state of the bottom map element and the rendering state of the bottom map element in the electronic map of the view object are not changed;
when the state of the view object, and the bottom map element in the electronic map of the view object and the state of the bottom map element are determined to be unchanged, determining that the basic map element in the electronic map of the view object displayed on the terminal screen is unchanged; otherwise, determining that basic map elements in the electronic map of the view object displayed on the terminal screen are changed.
Optionally, the rendering, with the texture as a base map, an electronic map of the view object in a corresponding display area in the terminal screen includes:
and taking the texture as a base map, and overlaying and drawing elements of other map layers of the electronic map on the base map.
The embodiment of the invention also provides another electronic map rendering method, which comprises the following steps:
determining a view object in which basic map elements in an electronic map displayed on a terminal screen are kept unchanged, and requesting a rendering mode from a server, wherein the request at least carries hardware index parameters of the terminal, so that the server learns the rendering mode suitable for the terminal based on the request;
when the rendering mode returned by the server side is off-screen rendering, off-screen rendering is carried out based on the basic map element of the view object, and the texture of the base map of the view object is obtained;
and with the texture as a base map, rendering the electronic map of the view object in a corresponding display area in the terminal screen until basic map elements in the electronic map of the view object are changed.
The embodiment of the invention also provides a terminal, which is suitable for rendering the electronic map, and the terminal comprises:
the view object determining unit is suitable for determining a view object in which basic map elements in the electronic map displayed on the terminal screen are kept unchanged;
the off-screen rendering unit is suitable for performing off-screen rendering based on the basic map element of the view object when the rendering mode is off-screen rendering to obtain the texture of the base map of the view object;
and the drawing unit is suitable for rendering the electronic map of the view object in a corresponding display area in the terminal screen by taking the texture as a base map until basic map elements in the electronic map of the view object are changed.
The embodiment of the present invention further provides another terminal, which includes a memory and a processor, where the memory stores computer instructions capable of being executed on the processor, and the processor executes the steps of the electronic map rendering method according to any one of the foregoing embodiments when executing the computer instructions.
The embodiment of the present invention further provides a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed, the steps of the electronic map rendering method according to any one of the foregoing embodiments are executed.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, under the condition that basic map elements in an electronic map of a view object displayed on a terminal screen are kept unchanged, when a rendering mode is off-screen rendering, off-screen rendering is carried out based on the basic map elements of the view object to obtain textures of a base map of the view object, and then the electronic map of the view object is rendered in a corresponding display area in the terminal screen by taking the textures as the base map. In the process, because the texture of the base map of the view object is used as the base map, under the condition that basic map elements in the electronic map of the view object displayed on the terminal screen are not changed, in the process of rendering the electronic map of the view object in the corresponding display area in the terminal screen, the base map of the view object does not need to be repeatedly rendered in real time and only needs to be rendered once, and because the data volume of the map elements usually contained in the base map is very large, the space and the rendering time for rendering the base map of the map can be greatly saved, and the resource overhead in the rendering process is reduced.
Furthermore, the rendering mode of the texture of the base map of the view object is determined and obtained based on the preset configuration rule, so that an appropriate rendering mode can be configured according to the specific hardware characteristics of the terminal, the flexibility of the rendering mode of the electronic map is enhanced, and the hardware resources of the terminal under different hardware configurations can be more fully utilized.
Furthermore, the time for obtaining the base map of the view object through off-screen rendering and the time for obtaining the map base map of the view object through copying and rendering are determined, and the configuration rule for obtaining 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 shorter time to obtain the texture of the base map of the view object, the system overhead in the electronic rendering process can be further reduced, and different hardware GPUs can be reasonably utilized.
Further, when the state of the view object displayed on the terminal screen, the base map element in the electronic map of the view object and the state of the base map element are determined to be unchanged, the base map element in the electronic map of the view object is determined to be unchanged, and the view object with the unchanged base map element in the electronic map displayed on the terminal screen is obtained.
Further, by comparing the view object displayed on the terminal screen with the view object that has been displayed on the terminal screen before it, determining that a state of the view object is not changed when a center point, an elevation angle, a rotation angle, and a scale level of the view object are not changed, and when the rendering state of the base map element and the base map element in the electronic map of the view object are not changed, determining that neither a base map element in the electronic map of the view object nor a state of the base map element has changed, and then determining that a base map element in the electronic map of the view object displayed on the terminal screen has not changed, so that the view object in which the basic map element is kept unchanged in the electronic map displayed on the terminal screen can be accurately determined, and then, a base map of the view object can be accurately drawn in a corresponding display area in a terminal screen.
Drawings
FIG. 1 is a schematic diagram of an electronic map of view objects;
FIG. 2 is a schematic diagram of an electronic map of another view object;
FIG. 3 is a flowchart of a method for rendering an electronic map according to an embodiment of the present invention;
FIG. 4 is a flowchart of an off-screen rendering method according to an embodiment of the present invention;
FIG. 5 is a flow diagram of one manner in which a map base map of a view object may be determined in an embodiment of the present invention;
FIG. 6 is a flow diagram of a method of replication rendering in an embodiment of the invention;
FIG. 7 is a diagram of a view object of an electronic map according to an embodiment of the present invention;
FIG. 8 is a schematic view of another electronic map in an embodiment of the invention;
FIG. 9 is a schematic illustration of an electronic map according to yet another embodiment of the invention;
FIG. 10 is a schematic diagram of an electronic map according to another embodiment of the present invention;
fig. 11 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 12 is a flowchart of another electronic map rendering method according to an embodiment of the present invention.
Detailed Description
As can be seen from the background art, how to save the resource overhead in the rendering process of the electronic map becomes a problem to be solved urgently.
The electronic map can be displayed through a mobile phone, a tablet or a special navigation device (such as a vehicle navigation device) and other terminal devices. In the process of performing route navigation by using the electronic map, the terminal device displaying the electronic map may include a Central Processing Unit (CPU) and a Graphics Processing Unit (GPU), and render and display the electronic map on a display screen. The rendering of the electronic map can be performed based on elements such as points, lines, surfaces, roads and the like in the electronic map.
As will be understood by those skilled in the art, the electronic map may be displayed on the terminal screen through one or more view objects, each view object may include multiple layers, the electronic map is generated by overlapping multiple layers, and different elements constituting the electronic map are distributed on each layer. The base map may be a layer at the lowest layer in the electronic map, and the base map may include a plurality of map elements, for example, referring to the electronic map of the view object shown in fig. 1, the map elements may include points, lines, faces, roads, and real-time Traffic (TMC) in the electronic map, points of Interest (POI), and the like. The layer above the base map may include elements such as an electronic eye, a parking space, and a path line, for example, an electronic map referring to the view object shown in fig. 2, which includes a plurality of planned path lines 21.
In the current electronic map rendering method, a terminal device displaying an electronic map generally renders all elements in view objects of the electronic map displayed at each moment.
Because the CPU and the GPU need to consume higher system resources when rendering the electronic map, the resource overhead in the rendering process of the electronic map is always at high consumption, and particularly when the performance of the device displaying the electronic map is not high, the system resources of the device displaying the electronic map are difficult to be reasonably applied.
The inventor finds that in some scenes, the base map of the map is not changed, that is, the base map elements such as points, lines, surfaces, roads and the like displayed in the electronic map are not changed, and the map elements in the layer above the base map may be changed. For convenience of description, a state in which the base map of such a map is unchanged may be referred to herein as a view object being in an immersive state; the state in which the base map of the map has changed is referred to as the view object being in a non-immersive state.
For example, when a terminal device that presents an electronic map is located at a certain position and stops, a view object in a display area of a terminal screen may be in an immersive state. In this case, the CPU and GPU of the terminal device that presents the electronic map typically continue to render the displayed electronic map in an On-Screen Rendering (On-Screen Rendering) manner. It should be noted that, the current screen rendering mode here refers to rendering and then displaying, by the device displaying the electronic map, the points, lines, surfaces, roads, TMC, POIs, and the like to be displayed at the current time of the electronic map. At the next moment, the equipment for displaying the electronic map renders and displays the map elements displayed according to needs again.
For the scenes, the existing electronic map rendering method needs to occupy a large amount of resource overhead.
In order to reduce resource overhead in the process of rendering the electronic map, in the embodiment of the invention, under the condition that a basic map element in the electronic map of the view object displayed on a terminal screen is kept unchanged, off-screen rendering is carried out based on the basic map element of the view object to obtain a texture of a base map of the view object, and then the electronic map of the view object is rendered in a corresponding display area in the terminal screen by taking the texture as the base map. In the process, because the texture of the base map of the view object is used as the base map, under the condition that basic map elements in the electronic map of the view object displayed on the terminal screen are not changed, in the process of rendering the electronic map of the view object in the corresponding display area in the terminal screen, the base map of the view object does not need to be repeatedly rendered in real time and only needs to be rendered once, and because the data volume of the map elements usually contained in the base map is very large, the space and the rendering time for rendering the base map of the map can be greatly saved, and the resource overhead in the rendering process is reduced.
In order to make the aforementioned objects, features and advantages of the embodiments of the present invention more comprehensible, specific embodiments accompanied with figures are described in detail below.
Referring to a flowchart of an electronic map rendering method shown in fig. 3, in an embodiment of the present invention, the method may include the following steps:
and S31, determining the view object in which the basic map element in the electronic map displayed on the terminal screen is kept unchanged.
The view object is a view on an electronic map displayed on a terminal screen, and one or more view objects can be displayed on the terminal screen. As previously mentioned, each view object may include multiple layers, with different elements making up the electronic map distributed over each layer. In the embodiment of the present invention, the outline shape of the view object is not limited, and may be, for example, a rectangle, a square, a circle, or the like, or may be another regular shape or an irregular shape. When a plurality of view objects exist, the view objects can be distributed in different display areas on the terminal screen, or can be partially overlapped.
In an embodiment of the present invention, the basic map elements in the electronic map of the view object may include points, lines, faces, and roads displayed by the electronic map, and in other embodiments of the present invention, the basic map elements of the electronic map may further include at least one of TMC, points of interest, and the like in the electronic map, and may also include other basic map elements.
In a specific implementation, the view object in which the basic map element remains unchanged in the electronic map displayed on the terminal screen can be determined by comparing the electronic maps of the view objects continuously drawn on the terminal screen. For example, a terminal screen draws 100 frames of images every second, and if the base map of the electronic map of the view object of consecutive preset frames is not changed, it may be considered that the basic map element in the electronic map on the terminal screen is a view object that is not changed, for example, the base map of the view object of consecutive two frames is not changed, or the base map of the view object of consecutive three frames is not changed. If the base map of the view object of the consecutive preset frames is not changed, for the convenience of description, it may be referred to that the view object enters an immersion state. When the view object is in the immersive state, if it is detected that the bottom map of the view object has changed, the view object may be referred to as exiting the immersive state and entering a non-immersive state.
In order to accurately determine a view object in which a basic map element in an electronic map displayed on a terminal screen remains unchanged, in a specific implementation, it may be determined whether the basic map element in the electronic map of the view object displayed on the terminal screen changes based on a state of the view object displayed on the terminal screen, and a base map element in the electronic map of the view object and a state of the base map element; when the state of the view object displayed on the terminal screen is determined, and neither the base map element in the electronic map of the view object nor the state of the base map element is changed, determining that the basic map element in the electronic map of the view object is not changed, and obtaining the view object with the basic map element in the electronic map displayed on the terminal screen kept unchanged.
In an embodiment of the present invention, whether a basic map element in an electronic map of a view object displayed on a terminal screen changes is determined as follows:
firstly, comparing a view object displayed on a terminal screen with a view object displayed on the terminal screen before the view object, and if the center point, the elevation angle, the rotation angle and the scale level of the view object are not changed, determining that the state of the view object is not changed; and if the rendering state of the bottom map element and the rendering element in the electronic map of the view object are not changed, determining that the rendering state of the bottom map element and the rendering element in the electronic map of the view object are not changed. Then, when 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 are determined to be unchanged, it can be determined that the basic map element in the electronic map of the view object displayed on the terminal screen is unchanged; otherwise, determining that basic map elements in the electronic map of the view object displayed on the terminal screen are changed.
In a specific implementation, before the view object enters the immersive state, a Rendering mode of the electronic map of the view object On the terminal Screen may be an On-Screen Rendering (On-Screen Rendering) mode, which may also be referred to as a foreground Rendering mode. Whether the view object displayed in the corresponding display area in the terminal screen is currently in an immersion state or not can be detected and judged at preset time intervals.
And S32, when the rendering mode is off-screen rendering, performing off-screen rendering based on the basic map element of the view object to obtain the texture of the base map of the view object.
And S33, with the texture as a base map, rendering the electronic map of the view object in the corresponding display area in the terminal screen until the basic map elements in the electronic map of the view object are changed.
After the texture of the base map of the view object is obtained through off-screen rendering, the current screen rendering may be switched to, and electronic map elements of other map layers, such as point-like or line-like elements such as an electronic eye and a path line in a dynamic map layer on the base map, are drawn by superimposing on the base map with the texture as the base map.
In the current solution, no matter what the situation, the base map of the view object needs to be rendered in real time, and those skilled in the art will understand that the base map usually includes a large number of elements such as roads, buildings, greenbelts, TMC, and so on, and thus consumes a large amount of time and system overhead. By adopting the embodiment of the invention, in the process of rendering the electronic map, the base map of the electronic map of the view object can be obtained by one off-screen rendering only under the condition that the basic map element in the electronic map of the view object is determined to be unchanged, and then the rendering is not required to be repeated under the condition that the basic map element in the electronic map of the view object is unchanged, so that the loaded data volume and the rendering time can be reduced, and the resource overhead of the rendering processing of the electronic map is reduced.
For step S32, in order to make clear to those skilled in the art how to obtain the texture of the base map of the view object through Off-Screen Rendering (Off-Screen Rendering), the following example is a specific implementation of Off-Screen Rendering. Referring to the flowchart of the off-screen rendering method shown in fig. 4, the off-screen rendering method may specifically be implemented by the following steps:
s321, applying for an off-screen rendering frame buffer space.
S322, applying for texture handles used by off-screen rendering.
S323, binding the off-screen rendering frame buffer space with the texture handle used by the off-screen rendering.
S324, rendering the basic map element of the view object in the off-screen rendering frame buffer space to obtain the texture of the base map of the view object.
It will be understood by those skilled in the art that the steps in the embodiments of the present invention are not necessarily performed in the order of the above step numbers, and that the different step numbers are only used for distinguishing different steps, and do not represent that the steps can be performed only in the order shown. For example, for off-screen rendering, the sequence of step S321 and step S322 is not unique, and step S321 may be executed first, step S322 may be executed first, or both may be executed concurrently.
In specific implementation, the embodiment of the invention can be further expanded and optimized according to requirements. An extended example is given below with reference to the accompanying drawings. It is to be understood that the following specific examples are not intended to limit the scope of the invention, but are merely included to provide those skilled in the art with a better understanding and appreciation for the various aspects of the invention.
In a specific implementation, when it is detected that the view object displayed on the terminal screen enters the immersion state, that is, it is determined that a basic map element in the electronic map of the view object displayed on the terminal screen remains unchanged, the texture of the base map of the view object may be obtained through other rendering methods, for example, the texture of the base map of the view object may be obtained through a duplicate rendering method, in addition to obtaining the texture of the base map of the view object through off-screen rendering. Thus, the skilled person may configure the rendering of the texture of the base map resulting in said view object when said view object enters the immersive state.
In the embodiment of the invention, a proper rendering mode can be configured according to the specific hardware (including GPU and the like) characteristics of the terminal, the rendering flexibility of the electronic map is enhanced, so that hardware resources of the terminal under different hardware configurations can be more fully utilized, and the rendering mode of obtaining the texture of the base map of the view object can be determined based on the preset configuration rule.
For example, in order to enhance the compatibility and flexibility of the electronic map rendering scheme of the embodiment of the invention, different hardware GPUs are reasonably utilized, the electronic map rendering overhead is reduced as much as possible, the time at which the texture of the base map of the view object is obtained by performing the off-screen rendering may be determined, as the first duration, and determining the time for copying and rendering to obtain the texture of the base map of the view object as a second duration, determining a configuration rule of the texture of the base map of the view object according to a comparison result of the first duration and the second duration, therefore, the texture of the base map of the view object can be obtained by selecting and configuring a rendering mode with shorter actual use time according to the actual use time of off-screen rendering and copying rendering of a hardware GPU of a terminal for rendering the electronic map, so as to reduce the hardware overhead as much as possible.
Referring to the flowchart of fig. 5 illustrating a method for determining a texture of a base map of a view object, an embodiment of the present invention may specifically use the following method for determining a texture of a base map of a view object, and may further perform electronic map rendering on the view object by using the texture as a base map.
S51, determining the time for performing off-screen rendering to obtain the texture of the map base map of the view object as a first time t 1.
S52, determining the time for copying and rendering to obtain the texture of the map base map of the view object as a second time length t 2.
In specific implementations, the first duration t1 and the second duration t2 may be determined in various manners, such as by data-embedded manner or timing measurement manner, for example, the first duration t1 and the second duration t2 may be determined.
S53, comparing the first duration t1 with the second duration t2, and if the first duration t1 is less than or equal to the second duration t2, performing step S54; otherwise, step S55 is executed.
S54, obtaining the texture of the base map of the view object by performing off-screen rendering.
S55, configuring and obtaining the texture of the base map of the view object by copying and rendering.
If the texture of the base map of the view object is obtained by off-screen rendering, before the base map of the view object is obtained, for example, before electronic map rendering, even when the terminal is started, the terminal may obtain configuration parameters how to obtain the texture of the base map of the view object, obtain a specific way of obtaining the texture of the base map of the view object from the configuration parameters, and perform rendering in the configured way to obtain the texture of the base map of the view object.
How to obtain the texture of the base map of the view object through off-screen rendering may refer to fig. 4 and the detailed description in the foregoing embodiments, which are not described herein again. Referring to fig. 6, a specific example of obtaining the texture of the base map of the view object by copy rendering is given, and the specific steps are as follows:
s61, apply for copying the texture handle used by the rendering.
S62, copying the base map of the rendered electronic map of the view object in the current frame buffer space to the texture handle as the texture of the base map of the view object.
Through the embodiment, for the view object entering the immersion state, the base map of the electronic map of the view object 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 continuously, and the resource overhead can be reduced.
In the embodiment of the invention, for the view object entering the immersion state, after the base map of the electronic map of the view object is obtained in an off-screen rendering or copy rendering mode, the base map can be stored in the texture space applied by each view object. Assuming that the texture Identification (ID) is 100, if the view object is in an immersive state all the time, drawing the base map of the view object only needs to draw a texture image with the texture ID of 100, but not all base maps of the electronic map of the view object. After the texture image with the texture ID of 100 is drawn, elements of other layers of the electronic map are drawn on the texture image in an overlapping mode, and therefore the purpose of reducing resource expenditure of a CPU and a GPU can be achieved.
In order to enable those skilled in the art to better understand and apply the embodiments of the present invention, the following detailed description is provided with some specific application scenarios.
Among them, the view object in the terminal screen may be an area of an electronic map displayed by the terminal display screen, for example, the view object 71 shown in fig. 7.
As described above, in some scenarios, whether the base map in the electronic map of the view object changes may be determined by some conditions, and specifically, the determination may be made from the state of the view object, and whether the base map element of the view object and the state of the base map element change. For example, whether the base map in the electronic map of the view object has changed may be determined by whether a center point, an elevation angle, a rotation angle, a scale level of the view object in the electronic map, rendering states of the base map element and the base map element in the electronic map in the view object, and the like, all remain unchanged.
Specifically, when the electronic map of the view object satisfies the following condition, it may be determined that the base map has not changed: the center point of the view object is unchanged; elevation angle of the view object is unchanged; the rotation angle of the view object is unchanged; the scale level of the view object is unchanged; and the base map elements in the electronic map of the view object are unchanged; the rendering state of the bottom map elements in the electronic map of the view object is unchanged. In summary, in the case that all the conditions are satisfied, it may be determined that the view object is in the immersive state, and otherwise, the view object is in the non-immersive state, which will be described separately below.
With continued reference to the view object 71 in the electronic map shown in fig. 7, the center point of the view object may be the center point of the display area of the electronic map in the terminal device screen, for example, point a. In a specific implementation, if the center point of the view object is changed, it may be determined that the view object is in the navigation state or the cruise state, for example, the terminal device is in the motion state in the physical space, or the user manually changes the center point of the view object, and the view object is in the non-immersion state.
In another application scenario, as the terminal device moves, the height of the driving road or the walking road is fluctuated, or due to user operation, the elevation angle of the view object changes, and if the elevation angle of the view object changes, it can be determined that the view object is in a non-immersion state.
Referring to fig. 7 and 8 in combination, the rotation angle of the point B in the point a direction in the view object 81 shown in fig. 8 is changed with respect to fig. 7, so that it can be determined that the view object 81 shown in fig. 8 is in the non-immersive state.
In another application scenario, since the base map of the electronic map of the view object includes multiple elements such as points, lines, faces, roads, TMC, POIs, etc., one or more elements in the base map are changed, which changes the rendering state of the view object. For example, it may be that the TMC changes, the number of POIs or the coordinate position of the same POI changes, and thus it may be determined that the view object is in a non-immersive state. Assuming that the view object 71 in fig. 7 and the view object 91 in fig. 9 are two consecutive images of the same view object, the rendering state of the view object changes if the POI indicated by the point B in the view object 71 in the electronic map shown in fig. 7 is not displayed in fig. 9.
It is understood by those skilled in the art that the foregoing is only exemplary, and in other embodiments, other confirmation manners or other confirmation conditions may be adopted, without limitation. Through the arrangement, the condition that the base map of the view object in the electronic map is not changed can be determined, and the method and the device are all within the protection scope of the invention.
In a specific implementation of the present invention, the view objects displayed in the terminal screen may include a plurality of view objects, and it may be determined whether each view object in the electronic map in the terminal screen is in an immersion state, and further it may be determined whether a texture of a base map corresponding to the view object may be obtained by using the off-screen rendering manner or the copy rendering manner according to the embodiment of the present invention, and in a case where the view object is in the immersion state continuously, the texture is used as a base map in a subsequent current screen rendering process to perform rendering of the electronic map of the view object, including overlaying and drawing elements of other map layers of the electronic map behind the base map.
For example, referring to a schematic diagram of a view object displayed on a terminal screen shown in fig. 10, on the terminal screen, a main view object 101 and a sub view object 102 are displayed on a display area set in advance, respectively. Wherein the display scale of the primary view object 101 is larger than the display scale of the secondary view object 102. As the terminal device moves, elements displayed in the primary view object 101 change in real time, such as POI and TMC, the primary view object 101 can be rendered and refreshed in real time, and only the path line 1021 and the terminal device identifier 1022 in the secondary view object 102 change along with the movement of the terminal device. Here, according to the difference in the sizes of the view objects, the primary view object may also be referred to as a large map, the secondary view object may also be referred to as a small map, or the secondary view object may also be referred to as an eagle eye diagram.
In a specific implementation, it may be determined whether a change occurs in a basic map element in the electronic map of the primary view object 101 and the secondary view object 102, that is, whether the primary view object 101 and the secondary view object enter or are in an immersive state. For example, it is determined that primary view object 101 is in a non-immersive state and secondary view object 102 is in an immersive state.
For the auxiliary view object 102 in the immersion state, the elements in the base map are not changed, and when the electronic map is rendered, the texture of the base map obtained by off-screen rendering or copying rendering can be used as the base map, and the rendering is performed based on the base map, the path line 1021 in the layer above the base map and the terminal device identifier 1022, so that the elements in the base map of the auxiliary view object 102 do not need to be continuously rendered, thereby reducing the resource overhead and the rendering time. Statistics shows that the auxiliary view object can be in an immersion state for more than half of the time in the navigation process of the terminal, so that the resource overhead can be greatly reduced by adopting the scheme of the embodiment of the invention.
It will be appreciated that other forms of rendering interfaces are possible in addition to the various forms of rendering interfaces of the view objects exemplified by the foregoing embodiments.
After the base map of the view object is drawn in the corresponding display area in the terminal screen by adopting any of the embodiments of the present invention, other map layers above the base map can be further drawn, and dynamic primitives can be drawn in real time. The dynamic primitive, that is, the dynamic map element, may be an element of the layer above the base map, for example, the dynamic primitive may include an electronic eye, a parking space, a route line, and the like.
In particular, if the texture of the base map in the electronic map of the view object is determined to be subjected to off-screen rendering or duplicate rendering according to the hardware condition of the terminal device, the texture of the base map in the electronic map of the view object may be determined to be subjected to off-screen rendering or duplicate rendering. For example, if the terminal device can perform off-screen rendering in the hardware environment with anti-aliasing being turned on, the texture of the base map of the view object in the immersive state can be subjected to off-screen rendering, and if the terminal device cannot perform off-screen rendering or copy rendering in the hardware environment with anti-aliasing being turned on, the current screen rendering manner described in the foregoing embodiment of the present invention may be adopted to draw the base map of each frame of the view object in real time in the corresponding region in the terminal screen, and to draw the map elements in the other layers above the base map of the view object in an overlapping manner.
By adopting the embodiment, for the view object in the immersion state, the texture of the base map of the view object obtained by off-screen rendering or copy rendering is used as the base map, and other map layers of the electronic map for drawing the view object are superposed on the base map, so that the system consumption for repeatedly drawing the base map can be reduced, and the resource overhead can be reduced.
An embodiment of the present invention further provides a terminal, and referring to fig. 11, the terminal 110 may include:
a view object determining unit 111 adapted to determine a view object in which a basic map element remains unchanged in an electronic map displayed on a terminal screen;
an off-screen rendering unit 112, adapted to perform, when the rendering mode is off-screen rendering, off-screen rendering based on the basic map element of the view object, so as to obtain a texture of a base map of the view object;
and the drawing unit 113 is adapted to render the electronic map of the view object in the corresponding display area of the terminal screen by using the texture as a base map until a basic map element in the electronic map of the view object is changed.
In a specific implementation, the drawing unit 113 is adapted to draw elements of other layers of the electronic map by using the texture as a base map and superimposing the elements on the base map.
In a specific implementation, the view object determining unit 111 is adapted to determine whether a base map element in the electronic map of the view object displayed on the terminal screen changes based on a state of the view object displayed on the terminal screen, and a base map element in the electronic map of the view object and a state of the base map element; and when the state of the view object displayed on the terminal screen is determined, and the base map element in the electronic map of the view object and the state of the base map element are not changed, determining that the basic map element in the electronic map of the view object is not changed, and obtaining the view object in which the basic map element in the electronic map displayed on the terminal screen is kept unchanged.
In an embodiment of the present invention, the view object determining unit 111 may include the following sub-units:
a comparison subunit adapted to compare the view object displayed on the terminal screen with the view object that has been displayed on the terminal screen before it;
a first determining subunit 1111, adapted to determine that a state of the view object is not changed when a center point, an elevation angle, a rotation angle, and a scale level of the view object are not changed;
a second determining subunit 1112, adapted to determine that neither the base map element in the electronic map of the view object nor the rendering state of the base map element has changed when neither the base map element in the electronic map of the view object nor the rendering state of the base map element has changed;
a third determining subunit 1113, adapted to determine that the basic map element in the electronic map of the view object displayed on the terminal screen has not changed when determining 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 have not changed; otherwise, determining that basic map elements in the electronic map of the view object displayed on the terminal screen are changed.
By adopting the view object determining unit, the view object with unchanged basic map elements in the electronic map displayed on the terminal screen can be accurately determined, and the texture of the base map of the view object can be accurately drawn in the corresponding display area in the terminal screen.
In a specific implementation, the terminal 110 may further include a rendering manner determining unit 114, adapted to determine, based on a preset configuration rule, a rendering manner of a texture of the base map of the view object, where the rendering manner includes: off-screen rendering or replica rendering.
In an embodiment of the present invention, the rendering mode determining unit 114 may include the following sub-units:
a first duration determining subunit 1141, adapted to determine, as a first duration, a time for performing off-screen rendering to obtain a texture of a base map of the view object;
a second duration determining subunit 1142 adapted to determine a time to copy the texture of the base map of the view object as a second duration;
a configuration rule determining subunit 1143, adapted to determine, based on the comparison result of the first duration and the second duration, a configuration rule of obtaining a texture of the base map of the view object.
The configuration rule for obtaining the texture of the base map of the view object is set by adding the unit or the sub-unit on the terminal, so that the terminal can select 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, enhancing the compatibility and flexibility of the electronic map rendering scheme and reasonably utilizing different hardware GPUs.
In an embodiment of the present invention, the configuration rule determining subunit 1143 is adapted to configure, when the first time length is less than or equal to the second time length, a texture of a base map of the view object obtained by off-screen rendering; and configuring the texture of the base map of the view object obtained by copying and rendering when the first time length is longer than the second time length.
In a specific implementation, referring to fig. 11, the off-screen rendering unit 112 may include: 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, where:
an off-screen rendering space application subunit 1121 adapted to apply for an off-screen rendering frame buffer space;
an off-screen rendering texture handle application subunit 1122 adapted to apply for a texture handle used in off-screen rendering;
a binding subunit 1123, adapted to bind the off-screen rendering frame buffer space with a texture handle used by the off-screen rendering;
an off-screen rendering subunit 1124 adapted to render the base map element of the view object in the off-screen rendering frame buffer space, resulting in a texture of a base map of the view object.
In a specific implementation, the terminal 110 may further include a copy rendering unit 115 adapted to obtain a texture of the base map of the view object through copy rendering.
With continued reference to fig. 11, in a specific implementation, the replication rendering unit 115 may include the following sub-units:
a copy rendering texture handle application subunit 1151 adapted to apply for a texture handle used for copy rendering;
a copy sub-unit 1152 adapted to copy the base map of the rendered electronic map of the view object in the current frame buffer space to the texture handle as a texture of the base map of the view object.
The electronic map rendering method adopted by the embodiment of the invention can be applied to various scenes, for example, besides map navigation, the electronic map rendering method can also be applied to indoor maps, the field of industrial internet (such as chip navigation on a production line) and the like.
Referring to the flowchart of the electronic map rendering method shown in fig. 12, in another embodiment of the present invention, the method may specifically include the following steps:
s121, determining a view object with unchanged basic map elements in an electronic map displayed on a terminal screen, and requesting a rendering mode from a server, wherein the request at least carries hardware index parameters of the terminal, so that the server learns the rendering mode suitable for the terminal based on the request.
For example, after the system starts networking, system hardware information of the terminal may be acquired through the network, for example, key hardware index parameters such as system hardware parameters and GPU models may be acquired, and then the hardware index parameters may be uploaded to the server.
And S122, when the rendering mode returned by the server side is off-screen rendering, off-screen rendering is carried out based on the basic map element of the view object, and the texture of the base map of the view object is obtained.
In specific implementation, the server can find parameters matched with the terminal model performance, the adopted rendering software and the like from the database through modes of big data, machine learning, artificial intelligence analysis and the like, and determine an applicable rendering mode.
In an embodiment of the present invention, information describing all hardware terminals accessing a preset navigation platform and information describing two rendering modes (off-screen rendering and copy rendering) used by each hardware terminal in an embodiment of the present invention are stored in a database. The acquired key hardware index parameters can be matched in a database by adopting a preset machine learning or artificial intelligence analysis algorithm, so that which rendering mode can be automatically selected. Then, the server may modify the configuration information in the navigation software of the terminal that issued the request through a network protocol, for example, modify the configuration information of the rendering mode in the navigation software of the terminal that issued the request to a configuration parameter corresponding to off-screen rendering based on the learning result.
And S123, with the texture as a base map, rendering the electronic map of the view object in a corresponding display area in the terminal screen until basic map elements in the electronic map of the view object are changed.
By adopting the scheme, the rendering mode adopted by the terminal can be matched with the hardware index parameter of the terminal, so that the resources of the terminal are utilized more fully in the rendering process of the electronic map.
Specific implementation and beneficial effects of the terminal suitable for rendering the electronic map in the embodiment of the present invention can be referred to as the electronic map rendering method in the embodiment of the present invention, and are not described herein again.
The embodiment of the present invention further provides another terminal, which includes a memory and a processor, where the memory stores computer instructions capable of being executed on the processor, and the processor, when executing the computer instructions, is adapted to perform the steps of the electronic map rendering method according to any one of the foregoing embodiments. For specific steps, reference may be made to the description of the foregoing embodiments, which are not described herein again.
In specific implementation, the terminal may be a smart phone, a tablet computer, a special navigation device installed in a vehicle, or other appropriate electronic devices.
The terminal may include one screen or a plurality of screens.
In the embodiment of the present invention, if only one screen is disposed on the terminal, one or more view objects may be disposed in the screen, and if there are multiple view objects, each view object may be displayed in a different display area according to the preset setting, and different view objects may also be partially displayed in an overlapping manner.
In the embodiment of the invention, if the terminal is provided with a plurality of screens, one view object in the electronic map can be rendered and drawn in the display areas of the plurality of screens at the same time; or rendering and drawing the view objects in the electronic map in display areas in different screens respectively; or two or more view objects are rendered in the display area of the same screen, and one or more view objects are rendered in other screens of the terminal. The rendering mode of each view object on each screen can be determined based on the state and preset configuration rules.
It can be understood that the area map, the location information, and the like displayed on the terminal screen by the browser and various application clients are also a specific presentation form of the electronic map, and the rendering method in the embodiment of the present invention may also be adopted.
An embodiment of the present invention further provides a computer-readable storage medium, where computer instructions are stored, and when the computer instructions are executed, the steps of the electronic map rendering method according to any one of the foregoing embodiments are executed, and specific methods may refer to descriptions of the foregoing embodiments and are not described herein again.
The computer readable storage medium may be an optical disc, a mechanical hard disk, a solid state hard disk, etc.
Although the embodiments of the present invention have been disclosed, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (13)

1. An electronic map rendering method, comprising:
determining a view object in which basic map elements in an electronic map displayed on a terminal screen are kept unchanged;
when the rendering mode is off-screen rendering, performing off-screen rendering based on the basic map element of the view object to obtain the texture of the base map of the view object;
and with the texture as a base map, rendering the electronic map of the view object in a corresponding display area in the terminal screen until basic map elements in the electronic map of the view object are changed.
2. The method of claim 1, further comprising:
determining a rendering mode of obtaining the texture of the base map of the view object based on a preset configuration rule, wherein the rendering mode comprises the following steps: off-screen rendering or replica rendering.
3. The method according to claim 2, wherein the determining a rendering manner of obtaining the texture of the base map of the view object based on a preset configuration rule comprises:
determining time for obtaining texture of the base map of the view object by performing off-screen rendering as first duration;
determining time for obtaining texture of the base map of the view object by copying and rendering as second duration;
and determining a configuration rule of the texture of the base map of the view object based on the comparison result of the first duration and the second duration.
4. The method of claim 3, wherein determining the configuration rule for obtaining the texture of the base map of the view object based on the comparison of the first duration and the second duration comprises:
if the first duration is less than or equal to the second duration, configuring texture of a base map of the view object obtained through off-screen rendering;
and if the first duration is longer than the second duration, configuring texture of a base map of the view object obtained by copying and rendering.
5. The method of claim 4, wherein the rendering by replication of the texture of the base map of the view object comprises:
applying for copying and rendering a used texture handle;
copying the base map of the rendered electronic map of the view object in the current frame cache 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, wherein 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 comprises:
applying for off-screen rendering frame buffer space;
applying for texture handles used for off-screen rendering;
binding the off-screen rendering frame cache space with a texture handle used by the off-screen rendering;
and rendering the basic map element of the view object in the off-screen rendering frame buffer space to obtain the texture of the base map of the view object.
7. The method according to any one of claims 1 to 5, wherein the determining of the view object in which the basic map element remains unchanged in the electronic map displayed on the terminal screen comprises:
determining whether a basic map element in an electronic map of a view object displayed on a terminal screen changes based on a state of the view object displayed on the terminal screen, and a base map element in the electronic map of the view object and states of the base map element;
when the state of the view object displayed on the terminal screen is determined, and neither the base map element in the electronic map of the view object nor the state of the base map element is changed, determining that the basic map element in the electronic map of the view object is not changed, and obtaining the view object with the basic map element in the electronic map displayed on the terminal screen kept unchanged.
8. The method according to claim 7, wherein the determining whether a 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 a base map element in the electronic map of the view object and the state of the base map element comprises:
comparing the view object displayed on the terminal screen with view objects that have been displayed on the terminal screen before the view object;
when the central point, the elevation angle, the rotation angle and the scale level of the view object are not changed, determining that the state of the view object is not changed;
when the rendering state of the bottom map element and the rendering state of the bottom map element in the electronic map of the view object are not changed, determining that the state of the bottom map element and the rendering state of the bottom map element in the electronic map of the view object are not changed;
when the state of the view object, and the bottom map element in the electronic map of the view object and the state of the bottom map element are determined to be unchanged, determining that the basic map element in the electronic map of the view object displayed on the terminal screen is unchanged; otherwise, determining that basic map elements in the electronic map of the view object displayed on the terminal screen are changed.
9. The method according to any one of claims 1 to 5, wherein the rendering of the electronic map of the view object in the corresponding display area in the terminal screen based on the texture map comprises:
and taking the texture as a base map, and overlaying and drawing elements of other map layers of the electronic map on the base map.
10. An electronic map rendering method, comprising:
determining a view object in which basic map elements in an electronic map displayed on a terminal screen are kept unchanged, and requesting a rendering mode from a server, wherein the request at least carries hardware index parameters of the terminal, so that the server learns the rendering mode suitable for the terminal based on the request;
when the rendering mode returned by the server side is off-screen rendering, off-screen rendering is carried out based on the basic map element of the view object, and the texture of the base map of the view object is obtained;
and with the texture as a base map, rendering the electronic map of the view object in a corresponding display area in the terminal screen until basic map elements in the electronic map of the view object are changed.
11. A terminal adapted for electronic map rendering, the terminal comprising:
the view object determining unit is suitable for determining a view object in which basic map elements in the electronic map displayed on the terminal screen are kept unchanged;
the off-screen rendering unit is suitable for performing off-screen rendering based on the basic map element of the view object when the rendering mode is off-screen rendering to obtain the texture of the base map of the view object;
and the drawing unit is suitable for rendering the electronic map of the view object in a corresponding display area in the terminal screen by taking the texture as a base map until basic map elements in the electronic map of the view object are changed.
12. A terminal comprising a memory and a processor, the memory having stored thereon computer instructions executable on the processor, wherein the processor, when executing the computer instructions, performs the steps of the electronic map rendering method of any one of claims 1 to 9.
13. A computer readable storage medium having stored thereon computer instructions, wherein the computer instructions when executed perform the steps of the electronic map rendering method of any of claims 1 to 9.
CN201910884101.2A 2019-09-19 2019-09-19 Electronic map rendering method, terminal and medium Pending CN112527926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910884101.2A CN112527926A (en) 2019-09-19 2019-09-19 Electronic map rendering method, terminal and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910884101.2A CN112527926A (en) 2019-09-19 2019-09-19 Electronic map rendering method, terminal and medium

Publications (1)

Publication Number Publication Date
CN112527926A true CN112527926A (en) 2021-03-19

Family

ID=74975256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910884101.2A Pending CN112527926A (en) 2019-09-19 2019-09-19 Electronic map rendering method, terminal and medium

Country Status (1)

Country Link
CN (1) CN112527926A (en)

Similar Documents

Publication Publication Date Title
US11585675B2 (en) Map data processing method, computer device and storage medium
CN112256897B (en) Vector tile loading method in three-dimensional scene
US20230053462A1 (en) Image rendering method and apparatus, device, medium, and computer program product
JP4896761B2 (en) 3D map display system, 3D map display method, and program thereof
US8823734B1 (en) Indicating availability of indoor content on a digital map
US9495767B2 (en) Indexed uniform styles for stroke rendering
US8976169B1 (en) Rendering terrain patches
US20180089791A1 (en) Rendering map data using descriptions of raster differences
KR101591427B1 (en) Method for Adaptive LOD Rendering in 3-D Terrain Visualization System
US20130127852A1 (en) Methods for providing 3d building information
CN112102489B (en) Navigation interface display method and device, computing equipment and storage medium
CN111104076B (en) Map display method, map display device and storage medium
EP2589933B1 (en) Navigation device, method of predicting a visibility of a triangular face in an electronic map view
RU2296368C2 (en) Method for cutting off a line and method for displaying three-dimensional image based on this method
CN109712225B (en) Rendering method, device, equipment and storage medium of surface object
CN114359231A (en) Parking space detection method, device, equipment and storage medium
CN110378948B (en) 3D model reconstruction method and device and electronic equipment
JP7086180B2 (en) Dynamic styling of digital maps
CN112527926A (en) Electronic map rendering method, terminal and medium
JP2023021469A (en) Positioning method, positioning apparatus, method of generating visual map, and apparatus thereof
CN115761166A (en) Map construction method based on vector tiles and application thereof
CN112330769B (en) Method and device for generating dotted line texture and electronic equipment
KR20160143936A (en) Method for increasing 3D rendering performance and system thereof
CN115187709A (en) Geographic model processing method and device, electronic equipment and readable storage medium
US20150154784A1 (en) Use of Photo Animation Transitions to Mask Latency

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination