Data drawing control method and device, electronic equipment and computer program product

By determining whether the dynamic data within the current visual range exists or not on the electronic map and controlling the refresh operation of the dynamic layer, the problem of excessive processor resource consumption caused by overlaying dynamic layers on the electronic map is solved, and a smoother graphical interface display is achieved.

CN119888030APending Publication Date: 2025-04-25HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411948251.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

When dynamic layers are superimposed on electronic maps, the electronic map constantly triggers drawing operations, repeatedly occupying rendering resources, resulting in large consumption of processor resources.

Method used

By determining whether dynamic data of dynamic layers exists within the current visual range of the electronic map, if dynamic data of any dynamic layer does not exist within the current visual range, the refresh operation of each dynamic layer on the electronic map is stopped.

Benefits of technology

Reduce invalid drawing, reduce processor resource consumption, ensure the smoothness of applications that display electronic maps, and solve the problems of slow refresh and lag in graphical interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888030A_ABST
    Figure CN119888030A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of map rendering, and provides a data drawing control method and device, electronic equipment and a computer program product. The method comprises the following steps: under the condition that at least one dynamic layer is superposed on an electronic map, determining whether dynamic data of the dynamic layer exists in a current visible range of the electronic map or not; the dynamic data is any data on the dynamic layer; and if the dynamic data of any one dynamic layer does not exist in the current visible range, stopping the refreshing operation of each dynamic layer on the electronic map. According to the invention, the resource consumption of the processor can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of map rendering technology, and in particular, relates to a data drawing control method, device, electronic device and computer program product. Background Art

[0002] With the reduction in the cost of oblique photography data and modeling, the development of graphics cards and processors in hardware, and the improvement of personal computer (PC) data support capabilities for oblique photography, the demand for upper-level applications is no longer limited to the display of real-life electronic maps, but to use them as base maps to overlay business data, animation effects, etc.

[0003] Currently, when a dynamic layer used to generate animation is superimposed on an electronic map, the electronic map will Figure 1 Directly triggering the drawing operation, continuous drawing will repeatedly occupy rendering resources, resulting in high processor resource consumption. Summary of the invention

[0004] The embodiments of the present application provide a data drawing control method, device, electronic device and computer program product, which can reduce the resource consumption of a processor.

[0005] In a first aspect, an embodiment of the present application provides a data drawing control method, including:

[0006] In the case where at least one dynamic layer is superimposed on the electronic map, determining whether there is dynamic data of the dynamic layer within the current visible range of the electronic map; the dynamic data is any data on the dynamic layer;

[0007] If there is no dynamic data of any of the dynamic layers within the current visible range, the refreshing operation of each of the dynamic layers on the electronic map is stopped.

[0008] In an embodiment of the present application, when at least one dynamic layer is superimposed on an electronic map, by determining whether there is dynamic data of the dynamic layer within the current visible range of the electronic map, and stopping the refresh operation of the dynamic layer on the electronic map when there is no dynamic data of any dynamic layer within the current visible range, invalid drawing can be reduced, thereby reducing processor resource consumption.

[0009] In a second aspect, an embodiment of the present application provides a data drawing control device, including:

[0010] A data determination module, used for determining, when at least one dynamic layer is superimposed on the electronic map, whether there is dynamic data of the dynamic layer within the current visible range of the electronic map; the dynamic data is any data on the dynamic layer;

[0011] The drawing stopping module is used to stop the refreshing operation of each dynamic layer on the electronic map if there is no dynamic data of any dynamic layer in the current visible range.

[0012] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the data drawing control method as described in the first aspect above.

[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the data drawing control method as described in the first aspect above is implemented.

[0014] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed, the data drawing control method described in the first aspect above is executed.

[0015] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 It is a flowchart of a data drawing control method provided in an embodiment of the present application;

[0018] Figure 2 is an example grid diagram provided in an embodiment of the present application;

[0019] Figure 3 It is another flow chart of the data drawing control method provided in the embodiment of the present application;

[0020] Figure 4 This is an example diagram of index value retrieval provided in an embodiment of the present application;

[0021] Figure 5 is another flow chart of the data drawing control method provided in an embodiment of the present application;

[0022] Figure 6is a structural schematic diagram of a data drawing control device provided in an embodiment of the present application;

[0023] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0025] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0026] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0027] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0028] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0029] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0030] Taking the real-life 3D map as an example, the real-life 3D map is a map that uses satellite or laser technology to directly scan the height and width of buildings, and then uses advanced 3D modeling technology to finally digitize the geographic information of the real world and the 3D form of real objects. Due to the difference in structure, the real-life 3D map needs to start parsing and rendering the data within the search range from the tile as the root node. However, all layers on the current map share a canvas, that is, if there is a layer that is non-static, the entire canvas needs to be erased and drawn (i.e., redrawn) continuously. When the layer data is more complex and each frame requires a lot of parsing and drawing (for example, when the base map is a real-life 3D map, the redrawn part of each frame needs to parse the required tiles from the child node until the adapted tile of the current frame is found), the continuous redrawing will repeatedly occupy the processor resources of the electronic device, thereby affecting the normal use of the application that displays the electronic map (for example, causing the graphical interface of the application to refresh slowly and cause a freeze problem).

[0031] Therefore, in order to solve the above technical problems, the embodiments of the present application provide a data drawing control method, device, electronic device and computer program product. When the electronic device has at least one dynamic layer superimposed on the electronic map, by determining whether there is dynamic data of the dynamic layer within the current visible range of the electronic map, and stopping the refresh operation of each dynamic layer on the electronic map when there is no dynamic data of any dynamic layer within the current visible range, invalid drawing can be reduced, thereby reducing the resource consumption of the electronic device's graphics processing unit (GPU), central processing unit (CPU) and other processors, ensuring the fluency of the application displaying the electronic map, and solving the problem of slow refresh of the graphical interface of the application and the resulting freeze.

[0032] The data drawing control method provided in the embodiment of the present application can be applied to electronic devices such as desktop computers, servers, tablet computers, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific types of electronic devices. For example, the electronic device in the embodiment of the present application can be a desktop computer of a command center of a specific industry, and an application program that can display an electronic map is installed on the desktop computer. When the application program is opened and the electronic map is displayed, the drawing control of the electronic map and the drawing control of each dynamic layer superimposed on the electronic map can be realized through the embodiment of the present application.

[0033] See also Figure 1 , Figure 1 The following is a flow chart of a data drawing control method provided in an embodiment of the present application. As an example but not a limitation, the method can be applied to electronic devices. The method includes the following steps:

[0034] Step 101: When at least one dynamic layer is superimposed on the electronic map, it is determined whether there is dynamic data of the dynamic layer within the current visible range of the electronic map.

[0035] The above dynamic data is any data on the dynamic layer. Dynamic data can also be called elements, that is, data on the dynamic layer can also be called elements. The number of dynamic data on each dynamic layer can be one or at least two, which is not limited in this application.

[0036] By superimposing a dynamic layer on the electronic map, a dynamic effect can be generated on the electronic map through the dynamic layer (for example, an animation can be generated on the electronic map). The number of dynamic layers superimposed on the electronic map can be one or at least two, and this application does not limit this. The electronic map and the dynamic layers superimposed thereon share a canvas.

[0037] In one embodiment, an electronic map may be used as a base map, and a layer may be superimposed on the base map, so as to achieve superimposition of some data on the electronic map. For example, a large-scale data visualization display or animation display may be superimposed on a real-life 3D map.

[0038] After overlaying a layer on an electronic map, you can set the layer properties of the layer. The layer properties represent the type of the corresponding layer, which includes dynamic layers and static layers. That is, the above layer properties represent whether the corresponding layer is a dynamic layer or a static layer. Therefore, when a layer is overlaid on an electronic map, you can determine whether the overlaid layer is a dynamic layer by using the layer properties of the layer.

[0039] As an example but not limitation, a layer property of a layer is a first target value (eg, true), indicating that the layer is a dynamic layer; a layer property of another layer is a second target value (eg, false), indicating that the layer is a static layer.

[0040] The current visible range of the electronic map may refer to the geographical range of the electronic map displayed on the screen of the electronic device. It should be understood that the current visible range of the electronic map is affected by the zoom level, which refers to the level of detail displayed on the electronic map. The higher the level, the more details the electronic map displays, and the smaller the current visible range, such as displaying street names, building outlines, etc. The lower the level, the fewer details the electronic map displays, and the larger the current visible range, such as only displaying the outline of a city.

[0041] In one possible implementation, when there is a target layer (i.e., a layer where data changes occur) in each dynamic layer or the visible range of the electronic map changes, it usually causes a change in the dynamic data within the current visible range of the electronic map. Therefore, when the electronic device has at least one dynamic layer superimposed on the electronic map, if there is a target layer in each dynamic layer or the visible range of the electronic map changes, it can determine whether there is dynamic data of the dynamic layer within the current visible range.

[0042] The above data changes include but are not limited to adding (i.e., increasing), updating or removing dynamic data on the corresponding dynamic layer. The update of dynamic data includes but is not limited to the style update and location update of dynamic data. The location update of dynamic data may refer to the update of the geographic location information of dynamic data.

[0043] Optionally, the user can change the visible range of the electronic map by triggering the electronic map. As an example but not limitation, the visible range displayed by the electronic map can be changed by dragging the electronic map.

[0044] In one possible implementation, when the data of the target layer is changed to newly added dynamic data, the electronic device can detect whether the newly added dynamic data is within the layer range of the target layer; if the newly added dynamic data is within the layer range of the target layer, determine whether there is dynamic data of the target layer within the current visible range (for example, all dynamic data of the target layer); if the newly added dynamic data is not within the layer range of the target layer, discard the newly added dynamic data, that is, discard the dynamic data that is not within the layer range of the target layer.

[0045] Optionally, a layer range can be set in advance for each dynamic layer. On this basis, when new dynamic data is added to any dynamic layer, for any newly added dynamic data, the electronic device can first filter the newly added dynamic data of the dynamic layer before determining whether the dynamic data of the dynamic layer exists within the current visible range, so as to discard the newly added dynamic data that is not within the layer range of the dynamic layer, and determine whether the dynamic data within the layer range of the dynamic layer is within the current visible range.

[0046] Optionally, the layer range can be set for the dynamic layer when it is created or initialized. Of course, it is understandable that the layer range can also be set for the dynamic layer at other times, as long as it is ensured that the layer range is set before the application uses it.

[0047] The above layer range may refer to the boundary range of the corresponding dynamic layer in the geographic space. Each dynamic layer has a corresponding layer range, and the layer ranges of different dynamic layers may be the same or different, and this application does not limit this.

[0048] Optionally, the layer range of the above dynamic layer can be set according to scene requirements.

[0049] As an example but not limitation, if the layer range of a dynamic layer is the range of city A, then the data on the dynamic layer that is not within the range of city A can be discarded, and only the data within the range of city A can be retrieved by index value, thereby improving the retrieval efficiency of the index value.

[0050] In one embodiment, before determining whether there is dynamic data of a dynamic layer within the current visible range of the electronic map, the electronic device may first detect whether the dynamic layer corresponds to a layer range. If so, it may detect whether the layer range of the dynamic layer has been indexed (i.e., whether the grid has been divided and the index value of the M-layer area has been set). If it is detected that the layer range has not been indexed, the layer range is first indexed, and on this basis, an index value search is performed; if it is detected that the layer range has been indexed, an index value search is performed on this basis.

[0051] In a possible implementation, the layer range is indexed and divided, including:

[0052] Divide the layer range of the dynamic layer into at least two grids, and determine the index value of the M-level area of ​​the layer range.

[0053] Among them, M is an integer greater than 1, the first-level area among the M-level areas is the area where each grid is located, the M-th level area is the area covered by the layer range, the areas of the same level do not overlap with each other and constitute the layer range, any area of ​​the i+1th level includes at least two areas of the i-th level, the i-th level is any level among the M levels, the i+1th level is the next level of the i-th level, the i-th level is higher than the i+1th level, and i is an integer greater than or equal to 1 and less than M.

[0054] This embodiment enhances the retrieval capability and integrity of index values ​​for dynamic data spanning multiple grids by constructing additional index values ​​(i.e., index values ​​from the second level to the Mth level), making it easier to quickly determine whether an electronic map needs to be drawn later.

[0055] In a possible implementation, the index value of the M-level area may be set according to scene requirements.

[0056] In another possible implementation, the electronic device may divide the layer range into at least two grids based on the grid longitude interval and the grid latitude interval, and the index value of each grid is composed of the row number and column number of the corresponding grid.

[0057] On the basis of expressing the above layer range by longitude and latitude, the electronic device can divide the layer range from the longitude direction and latitude direction respectively based on the pre-set grid longitude interval and grid latitude interval, and form the index value of the grid based on the row number and column number of the grid, so as to retrieve the index value from the longitude direction and latitude direction, which can improve the index value retrieval efficiency and achieve more accurate index value retrieval. Optionally, in this implementation, the index values ​​of the hierarchical areas other than the first hierarchical area in the M hierarchical area can be set according to the scene requirements, and this application does not limit this.

[0058] Optionally, you can set the grid longitude interval and grid latitude interval based on empirical values. When the layer range is gridded based on the grid longitude interval and grid latitude interval, if the edge size of the layer range is smaller than the size of a grid, it is processed as a grid.

[0059] It should be understood that the grid longitude interval and the grid latitude interval can be the same or different, and this application does not limit this. As an example and not a limitation, the grid longitude interval and the grid latitude interval are both 0.25°, and the grids are divided into 0.25°*0.25° squares.

[0060] like Figure 2 The following is an example of a grid. Figure 2 The row direction represents the longitude direction, and the column direction represents the latitude direction. Figure 2 The layer range in includes three levels of areas. The first level area is the area where each grid is located, the second level area includes area A and area B, and the third level area is area C. Figure 2 The code in the table (i.e. "1-1", "1-2", etc.) is the index value of the corresponding grid. Figure 2 The index value of area A is "A", the index value of area B is "B", and the index value of area C is "C".

[0061] In one embodiment, when the layer range is gridded based on the grid longitude interval and the grid latitude interval, the number of grids after division can be counted. If the number of grids is greater than the quantity threshold, the grid longitude interval and / or the grid latitude interval can be adjusted, and the layer range is re-gridded based on the adjusted grid longitude interval and / or the adjusted grid latitude interval to adjust the size of the grids after division and reduce the number of grids until the number of grids after division is less than or equal to the quantity threshold. By dividing the layer range into a suitable number of grids, the retrieval efficiency of the index value can be improved while also improving the retrieval accuracy of the index value. Optionally, the quantity threshold can be set according to the scenario requirements or experience value. As an example and not limitation, the above quantity threshold is 400 or 500.

[0062] In a possible implementation, for any dynamic layer, the electronic device may determine whether there is dynamic data of the dynamic layer within the current visible range of the electronic map through steps 301 to 304 .

[0063] Step 301 : Based on the geographic location information of the dynamic data of the dynamic layer, the index value to which the dynamic data belongs is determined from the index values ​​of the M-level regions.

[0064] The electronic device determines the index value to which the dynamic data belongs from the index value of the M-level area, which can avoid full-range retrieval of the layer range of the dynamic layer, thereby improving the retrieval efficiency of the index value to which the dynamic data belongs.

[0065] After determining the index value to which the dynamic data belongs, the electronic device may associate the index value with the corresponding dynamic data, so that the electronic device may determine the index value to which the dynamic data belongs when the subsequent index value is matched.

[0066] In step 301, the electronic device searches for index values ​​of dynamic data within the layer range of the dynamic layer, so the index value to which the dynamic data belongs can be searched in the index value of the M-level area, and the number of the index value is one.

[0067] It should be understood that, in the case where the above-mentioned layer range is represented by longitude and latitude, the geographical location information of the dynamic data can also be represented by longitude and latitude. On this basis, based on the longitude and latitude coordinates of the dynamic data and the longitude and latitude size of the grid (when the layer range is gridded based on the grid longitude interval and the grid latitude interval, the grid longitude interval and the grid latitude interval can be used to represent the longitude and latitude size of the grid), the index value to which the dynamic data belongs can be calculated. For example, the horizontal index value of the dynamic data can be obtained by subtracting the difference between the longitude coordinate of the dynamic data and the minimum longitude coordinate of the layer range and dividing it by the longitude interval of the grid, and the vertical index value of the dynamic data can be obtained by subtracting the difference between the latitude coordinate of the dynamic data and the minimum latitude coordinate of the layer range and dividing it by the latitude interval of the grid. The horizontal index value and the vertical index value of the dynamic data constitute the index value of the dynamic data.

[0068] As an example but not limitation, if the dynamic data is a point, then the geographic location information of the dynamic data is the latitude and longitude coordinates of the point; if the dynamic data is a line or a surface, then the geographic location information of the dynamic data is the minimum rectangular bounding box of the entire line or surface.

[0069] Among them, the rectangular bounding box is a data structure used to describe the position and size of an object, which is usually defined by a rectangle whose sides are parallel to the coordinate axis. The rectangular bounding box can be defined by recording the minimum value (i.e., the coordinates of the lower left corner of the rectangle) and the maximum value (i.e., the coordinates of the upper right corner of the rectangle) of the rectangle on the coordinate axis. On this basis, the minimum longitude coordinate, minimum latitude coordinate, maximum longitude coordinate, and maximum latitude coordinate of the rectangle (i.e., the rectangle defining the minimum rectangular bounding box) can be used to represent the minimum rectangular bounding box. For example, the longitude and latitude coordinates of the lower left corner of the rectangle (i.e., the minimum longitude coordinate and the minimum latitude coordinate of the rectangle) and the longitude and latitude coordinates of the upper right corner (i.e., the maximum longitude coordinate and the maximum latitude coordinate of the rectangle) can be used to represent the minimum rectangular bounding box.

[0070] In a possible implementation, step 301 may include the following steps:

[0071] Based on the geographic location information, determine, from the M-level regions, an area that overlaps with the geographic location information;

[0072] The index value to which the dynamic data belongs is determined from the index values ​​of the area overlapping with the geographical location information.

[0073] Among them, the regions overlapping with the geographical location information include the regions partially overlapping with the geographical location information and the regions completely overlapping with the geographical location information (i.e., the regions completely containing the geographical location information).

[0074] Optionally, for the case where the geographical location information of the dynamic data is the minimum rectangular bounding box, since the M-layer regions are also rectangular, the electronic device can determine the regions overlapping with the geographical location information from the M-layer regions by determining whether the minimum rectangular bounding box collides with each region. That is, the regions in the M-layer regions that collide with the minimum rectangular bounding box are the regions overlapping with the geographical location information, and the regions that do not collide with the minimum rectangular bounding box are the regions not overlapping with the geographical location information. As an example but not a limitation, the minimum rectangular bounding box E can be represented as (x1, y1, x2, y2), and a region F can be represented as (x3, y3, x4, y4). If the right boundary of the minimum rectangular bounding box E is to the left of the left boundary of the region F, or the lower boundary of the minimum rectangular bounding box E is above the upper boundary of the region F, it is determined that the minimum rectangular bounding box E and the region F do not collide, that is, one of the following conditions is satisfied: x1 > x4 or x2 < x3, y1 > y4 or y2 < y3. If the above conditions are not satisfied, it is determined that the minimum rectangular bounding box E and the region F collide.

[0075] In a possible implementation manner, determining the index value to which the dynamic data belongs from the index values of the regions overlapping with the geographical location information includes:

[0076] Determining at least one candidate level from the levels corresponding to the regions overlapping with the geographical location information; the candidate level is the level where the number of regions overlapping with the geographical location information is one;

[0077] Determining the index value of the region overlapping with the geographical location information in the target level as the index value to which the dynamic data belongs; the target level is the highest level among the candidate levels.

[0078] Since the higher the level corresponding to a region, the smaller the geographical range of the region and the richer the details of the geographical elements contained in the region, the index value of the region overlapping with the geographical location information in the highest level (i.e., the target level) among the candidate levels can more accurately represent the index value to which the dynamic data belongs. The index value of the region overlapping with the geographical location information in the target level can be determined as the index value to which the dynamic data belongs.

[0079] As Figure 4 shown is an example diagram of index value retrieval, which is based on Figure 2 the layer range in Figure 4 a, b, c, and d in Figure 4Taking the dynamic data d in as an example, the areas overlapping with the geographic location information of the dynamic data d include the "3-2" grid, area A and area C, then the corresponding alternative levels include the first level, the second level and the third level, the first level is the highest level among the three levels, and the number of areas in the first level that overlap with the geographic location information of the dynamic data d is one (that is, the "3-2" grid), then the index value of the "3-2" grid can be determined as the index value to which the dynamic data d belongs, that is, the index value to which the dynamic data d belongs is "3-2".

[0080] In another possible implementation, determining the index value to which the dynamic data belongs from the index value of the area overlapping with the geographical location information includes:

[0081] Determine the highest level in the levels corresponding to the area overlapping with the geographic location information as a candidate level;

[0082] Determining the number of regions in the candidate hierarchy that overlap with the geographic location information;

[0083] If the number of regions in the candidate level that overlap with the geographic location information is one, the index value of the region in the candidate level that overlaps with the geographic location information is determined as the index value to which the dynamic data belongs;

[0084] If the number of areas in the candidate hierarchy that overlap with the geographic location information is at least two, the next level of the candidate hierarchy is updated to the candidate hierarchy, and the step of determining the number of areas in the candidate hierarchy that overlap with the geographic location information and subsequent steps are returned to execute until the number of areas in the candidate hierarchy that overlap with the geographic location information is one, and the index value of the area in the candidate hierarchy that overlaps with the geographic location information is determined as the index value to which the dynamic data belongs.

[0085] When the number of areas overlapping with the geographic location information in the candidate level is at least two, at least two areas correspond to at least two different index values. In this case, the electronic device cannot determine the index value to which the dynamic data belongs from the at least two different index values. Therefore, it is necessary to update the next level of the candidate level to the candidate level, and continue to retrieve the index value based on the candidate level to retrieve the index value to which the dynamic data belongs.

[0086] by Figure 4Take the four dynamic data a, b, c and d in as an example. Dynamic data d is completely within the "3-2" grid, so the index value "3-2" is assigned to dynamic data d. Dynamic data a spans grids such as "1-2", "2-2", and "2-3", but falls completely in area A, so the index value "A" is assigned to dynamic data a. Similarly, the index value "B" is assigned to dynamic data b. Dynamic data c spans grids such as "3-3", "4-4", "4-5", and "4-6", spanning areas A and B, but completely belongs to area C, so the index value "C" is assigned to dynamic data c.

[0087] Step 302 : Based on the current visible range, determine the index value within the current visible range from the index values ​​of the M-level regions.

[0088] Among them, the number of index values ​​in the current visible range may be zero, one or at least two, which is related to the hierarchical area included in the current visible range. The index values ​​of the areas in the M hierarchical area that overlap with the current visible range are all index values ​​in the current visible range. The areas that overlap with the current visible range include areas that partially overlap with the current visible range and areas that completely overlap (i.e., areas that completely include the current visible range).

[0089] By way of example and not limitation, Figure 4 The area surrounded by the purple dotted line in the figure is the area corresponding to the current visible range of the electronic map within the layer range. Figure 4 , the current visible range includes the first-level grids of "2-1", "2-2", "2-3", "3-1", "3-2", "3-3", "4-1", "4-2", "4-3", etc., that is, the current visible range overlaps with these grids, and the current visible range also overlaps with the A area of ​​the second level and the C area of ​​the third level, then the index values ​​within the current visible range include "2-1", "2-2", "2-3", "3-1", "3-2", "3-3", "4-1", "4-2", "4-3", "A" and "C".

[0090] It should be understood that the present application does not limit the storage format of the index values ​​within the current visible range. For example, an array may be used to store the index values ​​within the current visible range.

[0091] Step 303: If there is an index value matching the index value to which the dynamic data belongs within the current visible range, it is determined that there is dynamic data within the current visible range.

[0092] The electronic device matches the index value within the current visible range with the index value belonging to the dynamic data, and can determine whether there is an index value within the current visible range that matches the index value belonging to the dynamic data (for example, determine whether there is an index value within the current visible range that is the same as the index value belonging to the dynamic data).

[0093] Step 304: If there is no index value matching the index value to which the dynamic data belongs in the current visible range, it is determined that there is no dynamic data in the current visible range.

[0094] After the electronic device executes the above steps 301 to 304 for all dynamic data within the layer range of the dynamic layer, it can detect whether all dynamic data within the layer range of the dynamic layer are not within the current visible range. If all dynamic data within the layer range of the dynamic layer are not within the current visible range, it is determined that the dynamic data of the dynamic layer does not exist within the current visible range; if there is dynamic data within the layer range of the dynamic layer that is within the current visible range, it is determined that the dynamic data of the dynamic layer exists within the current visible range.

[0095] This embodiment can control the drawing timing of the dynamic layer by determining whether there is dynamic data of the dynamic layer within the current visible range of the electronic map, and flexibly determine whether to stop the dynamic layer from refreshing the electronic map according to the dynamic data status within the current visible range.

[0096] Step 102: If there is no dynamic data of any dynamic layer in the current visible range, the refresh operation of each dynamic layer on the electronic map is stopped.

[0097] Among them, the above-mentioned stopping the refreshing operation of each dynamic layer on the electronic map may refer to stopping the continuous redrawing of the electronic map by each dynamic layer, including stopping the continuous redrawing of each dynamic layer and the continuous redrawing of the electronic map caused by each dynamic layer. The above-mentioned continuous redrawing may refer to redrawing at intervals of a preset time. Optionally, the above-mentioned preset time can be set according to the scene requirements, and this application does not limit this.

[0098] In this embodiment, the drawing of the electronic map by each dynamic layer can be controlled as needed based on whether there is dynamic data of each dynamic layer within the current visible range. That is, when there is no dynamic data of each dynamic layer within the current visible range, the refresh operation of the electronic map by each dynamic layer is stopped, thereby solving the problem that the dynamic data that is not within the current visible range is still involved in the drawing, causing the slow refresh of the graphical interface, reducing invalid drawing (that is, reducing the amount of data drawn), and reducing processor resource consumption.

[0099] In one embodiment, when drawing an electronic map, a dynamic attribute can be set for each dynamic layer to control the drawing timing. The dynamic attribute indicates whether the corresponding dynamic layer draws the electronic map, that is, whether the dynamic layer in the current visible range needs to be continuously redrawn. When the dynamic layer is drawn, the electronic map is also drawn. Therefore, the dynamic attribute can avoid unnecessary redrawing to the processor of the electronic device and the loss of data interaction when there is no dynamic data in the current visible range.

[0100] For any dynamic layer, the initial value of the dynamic attribute of the dynamic layer is the same as the layer attribute of the dynamic layer. As an example but not limitation, if the layer attribute of the dynamic layer is the first target value, then the initial value of the dynamic attribute of the dynamic layer is also the first target value.

[0101] For any dynamic layer, during the drawing process of the electronic map, the dynamic properties of the dynamic layer can be updated based on whether there is dynamic data of the dynamic layer in the current visible range of the electronic map. Specifically, if there is dynamic data of the dynamic layer in the current visible range, the dynamic properties of the dynamic layer are maintained as the first target value; if there is no dynamic data of the dynamic layer in the current visible range, the dynamic properties of the dynamic layer are updated to the second target value. When the dynamic properties of each dynamic layer on the electronic map are all the second target values, it is determined that there is no dynamic data of any dynamic layer in the current visible range, and the drawing of the electronic map by each dynamic layer is automatically stopped, thereby avoiding invalid calculations and resource occupation. Improve the efficiency and fluency of map drawing, and effectively save computing resources.

[0102] In one embodiment, the number of dynamic layers is at least two. If there is a target layer in each dynamic layer and the data of the target layer is changed to newly added dynamic data, it can be determined by index value retrieval whether there is dynamic data of the target layer in the current visible range. If there is no dynamic data of the target layer, the dynamic attribute of the target layer is updated to the second target value, and the dynamic attributes of the remaining layers are read. The remaining layers are the layers other than the target layer in each dynamic layer. If the dynamic attributes of the remaining layers are all the second target values, it can be determined that there is no dynamic data of any dynamic layer in the current visible range.

[0103] It should be understood that, under the condition that the first target value and the second target value are different, the present application does not limit the specific content of the first target value and the second target value. For example, the first target value may be true, and the second target value may be false.

[0104] The embodiment of the present application can effectively improve the drawing efficiency of the electronic map and reduce the waste of resources caused by invalid rendering through index value retrieval and drawing timing control.

[0105] like Figure 5 The figure shows another flow chart of the data drawing control method provided in the embodiment of the present application. Figure 5 Taking a layer as an example, the electronic device adds the layer to the electronic map, adds the layer to the layer container, and sets the layer properties of the layer. After setting the layer properties, the electronic map can be redrawn. The layer container controls the layer group (including layers and electronic maps) to be redrawn. When redrawing the layer, the value of the state to be updated of the layer is detected. If the state to be updated is true or the visible range of the electronic map changes, the dynamic data in the current visible range is retrieved based on the index value and counted. If the number of dynamic data in the current visible range is 0, it is determined that there is no dynamic data in the current visible range, and the dynamic property of the layer is updated to false; if the number of dynamic data in the current visible range is not 0, it is determined that there is dynamic data in the current visible range, and the dynamic property of the layer is updated to true; the state to be updated is determined to be false. When the state to be updated is false, the GPU is called to redraw the layer. When redrawing layers, check the state of the layer group (i.e., the dynamic properties of each layer in the layer group); if the state of the layer group is false (i.e., the dynamic properties of each layer in the layer group are false), stop refreshing the electronic map; if the state of the layer group is true (i.e., there are layers with dynamic properties of true in the layer group), redraw the electronic map. Among them, the state to be updated is false, indicating that it has been determined whether there is dynamic data in the current visible range.

[0106] Figure 5 When data of a layer in the , the state of the layer to be updated can be determined to be true.

[0107] In an embodiment of the present application, when at least one dynamic layer is superimposed on an electronic map, by determining whether there is dynamic data of the dynamic layer within the current visible range of the electronic map, and stopping the refresh operation of the dynamic layer on the electronic map when there is no dynamic data of any dynamic layer within the current visible range, invalid drawing can be reduced, thereby reducing processor resource consumption.

[0108] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0109] Corresponding to the data drawing control method described in the above embodiment, Figure 6 A schematic diagram of the structure of a data drawing control device provided in an embodiment of the present application is shown. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.

[0110] Reference Figure 6 , the device comprises:

[0111] The data determination module 601 is used to determine whether there is dynamic data of the dynamic layer in the current visible range of the electronic map when at least one dynamic layer is superimposed on the electronic map; the dynamic data is any data on the dynamic layer;

[0112] The drawing stopping module 602 is used to stop the refreshing operation of each dynamic layer on the electronic map if there is no dynamic data of any dynamic layer in the current visible range.

[0113] Optionally, the above device further comprises:

[0114] An index partitioning module is used for dividing the layer range of any of the dynamic layers into at least two grids, and determining the index value of the M-level area of ​​the layer range; M is an integer greater than 1, the first-level area in the M-level area is the area where each grid is located, the M-th level area is the area covered by the layer range, the areas of the same level do not overlap with each other and constitute the layer range, any area of ​​the i+1th level includes at least two areas of the i-th level, the i-th level is any level in the M levels, the i+1th level is the next level of the i-th level, the i-th level is higher than the i+1th level, and i is an integer greater than or equal to 1 and less than M;

[0115] The data determination module 601 includes:

[0116] A first determining unit, configured to determine, based on the geographic location information of the dynamic data of the dynamic layer, from the index values ​​of the M-level regions, the index value to which the dynamic data belongs;

[0117] A second determining unit, configured to determine, based on the current visible range, from the index values ​​of the M-level regions, an index value within the current visible range;

[0118] A third determining unit, configured to determine that the dynamic data exists within the current visible range if an index value matching the index value to which the dynamic data belongs exists within the current visible range;

[0119] The fourth determining unit is configured to determine that the dynamic data does not exist in the current visible range if there does not exist an index value matching the index value to which the dynamic data belongs in the current visible range.

[0120] Optionally, the first determining unit includes:

[0121] A first subunit is configured to determine, based on the geographic location information, from the M-level regions, an area overlapping with the geographic location information;

[0122] The second subunit is used to determine the index value to which the dynamic data belongs from the index value of the area overlapping with the geographical location information.

[0123] Optionally, the second subunit is specifically used for:

[0124] Determine at least one candidate level from the levels corresponding to the area overlapping with the geographic location information; the candidate level is a level having one area overlapping with the geographic location information;

[0125] The index value of the area in the target level that overlaps with the geographic location information is determined as the index value to which the dynamic data belongs; the target level is the highest level among the alternative levels.

[0126] Optionally, the index partitioning module is specifically used for:

[0127] Based on the grid longitude interval and the grid latitude interval, the layer range is divided into at least two grids, and the index value of each grid is composed of the row number and column number of the corresponding grid.

[0128] Optionally, the data determination module 601 is specifically used for:

[0129] If there is a target layer in each of the dynamic layers or the visible range of the electronic map changes, it is determined whether there is dynamic data of the dynamic layer in the current visible range; the target layer is the layer in which data changes occur in each of the dynamic layers.

[0130] Optionally, the data determination module 601 is specifically used for:

[0131] When the data of the target layer is changed to newly added dynamic data, detecting whether the newly added dynamic data is within the layer range of the target layer;

[0132] If the newly added dynamic data is within the layer range of the target layer, it is determined whether there is dynamic data of the target layer within the current visible range.

[0133] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0134] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device 7 of this embodiment includes: at least one processor 70 ( Figure 7 Only one is shown in the figure), a memory 71, and a computer program 72 stored in the memory 71 and executable on the at least one processor 70, wherein the processor 70 implements the steps of any of the above-mentioned method embodiments when executing the computer program 72.

[0135] The electronic device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 It is only an example of the electronic device 7 and does not constitute a limitation on the electronic device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0136] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0137] In some embodiments, the memory 71 may be an internal storage unit of the electronic device 7, such as a hard disk or memory of the electronic device 7. In other embodiments, the memory 71 may also be an external storage device of the electronic device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the electronic device 7. The memory 71 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 71 may also be used to temporarily store data that has been output or is to be output.

[0138] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0139] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0140] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0141] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

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

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

[0144] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A data drawing control method, characterized in that: include: In the case where at least one dynamic layer is superimposed on the electronic map, determining whether there is dynamic data of the dynamic layer within the current visible range of the electronic map; The dynamic data is any data on the dynamic layer; If there is no dynamic data of any of the dynamic layers within the current visible range, the refreshing operation of each of the dynamic layers on the electronic map is stopped.

2. The data drawing control method according to claim 1, characterized in that: Before determining whether there is dynamic data of the dynamic layer within the current visible range of the electronic map, the method further includes: For any of the dynamic layers, the layer range of the dynamic layer is divided into at least two grids, and the index value of the M-level area of ​​the layer range is determined; M is an integer greater than 1, the first-level area in the M-level area is the area where each grid is located, the M-th level area is the area covered by the layer range, the areas of the same level do not overlap with each other and constitute the layer range, any area of ​​the i+1th level includes at least two areas of the i-th level, the i-th level is any level in the M levels, the i-th level is higher than the i+1th level, and i is an integer greater than or equal to 1 and less than M; The determining whether the dynamic data of the dynamic layer exists within the current visible range of the electronic map includes: Based on the geographic location information of the dynamic data of the dynamic layer, determining the index value to which the dynamic data belongs from the index values ​​of the M-level regions; Based on the current visible range, determine, from the index values ​​of the M-level regions, an index value that is within the current visible range; If there is an index value matching the index value to which the dynamic data belongs within the current visible range, it is determined that the dynamic data exists within the current visible range; If there is no index value matching the index value to which the dynamic data belongs within the current visible range, it is determined that there is no dynamic data within the current visible range.

3. The data drawing control method according to claim 2, characterized in that: The determining, based on the geographic location information of the dynamic data of the dynamic layer, from the index value of the M-level area, the index value to which the dynamic data belongs, comprises: Based on the geographic location information, determining, from the M-level regions, an area overlapping with the geographic location information; The index value to which the dynamic data belongs is determined from the index values ​​of the area overlapping with the geographical location information.

4. The data drawing control method according to claim 3, characterized in that: The step of determining the index value to which the dynamic data belongs from the index value of the area overlapping with the geographical location information includes: Determine at least one candidate level from the levels corresponding to the area overlapping with the geographic location information; the candidate level is a level having one area overlapping with the geographic location information; The index value of the area in the target level that overlaps with the geographic location information is determined as the index value to which the dynamic data belongs; the target level is the highest level among the alternative levels.

5. The data drawing control method according to claim 2, characterized in that: The step of dividing the layer range of the dynamic layer into at least two grids includes: Based on the grid longitude interval and the grid latitude interval, the layer range is divided into at least two grids, and the index value of each grid is composed of the row number and column number of the corresponding grid.

6. The data drawing control method according to any one of claims 1 to 5, characterized in that: The determining whether the dynamic data of the dynamic layer exists within the current visible range of the electronic map includes: If there is a target layer in each of the dynamic layers or the visible range of the electronic map changes, it is determined whether there is dynamic data of the dynamic layer in the current visible range; the target layer is the layer in which data changes occur in each of the dynamic layers.

7. The data drawing control method according to claim 6, characterized in that: When the data of the target layer is changed to newly added dynamic data, it also includes: Check whether the newly added dynamic data is within the layer range of the target layer; The determining whether there is dynamic data of the dynamic layer within the current visible range includes: If the newly added dynamic data is within the layer range of the target layer, it is determined whether there is dynamic data of the target layer within the current visible range.

8. A data drawing control device, characterized in that: include: A data determination module, used for determining whether there is dynamic data of the dynamic layer within the current visible range of the electronic map when at least one dynamic layer is superimposed on the electronic map; The dynamic data is any data on the dynamic layer; The drawing stopping module is used to stop the refreshing operation of each dynamic layer on the electronic map if there is no dynamic data of any dynamic layer in the current visible range.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the electronic device implements the data drawing control method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables the data drawing control method according to any one of claims 1 to 7 to be executed.