Grid drawing method, device, electronic device and computer readable storage medium

By determining the reference grid and the grid to be corrected, calculating the projection distance and dividing the boundary points, the gaps and overlap problems in the boundary definition of third-party grids are solved, and the precise, seamless and non-overlapping of the grid is achieved and the processing efficiency is improved.

CN114627206BActive Publication Date: 2024-12-13LINKAGE TECHNOLOGY (NANJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110009086.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-05
Publication Date
2024-12-13
Estimated Expiration
2041-01-05

AI Technical Summary

Technical Problem

When the prior art defines a third-party grid boundary, the accuracy of processing adjacent grid gaps or overlapping parts is not high, resulting in inaccurate boundary processing results.

Method used

By determining the reference grid and the grid to be corrected, the set of coordinate points on the boundary of the grid to be corrected are obtained, the projection distance between the coordinate points and the reference grid is calculated, and the nearest point, the first boundary point and the second boundary point are determined based on these Divide and correct grid boundaries to generate target grids to ensure that grids are seamless and overlapping.

Benefits of technology

It realizes accurate, seamless and unsuperimated adjacent grids, improves the efficiency and accuracy of grid boundary processing, and adapts to complex road situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114627206B_ABST
    Figure CN114627206B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a grid drawing method, device, electronic device and computer-readable storage medium, and relate to the field of computer technology. The method includes: first determining a reference grid and a grid to be corrected, then obtaining a set of coordinate points on the boundary of the grid to be corrected and calculating the projection distance of each coordinate point to the reference grid, determining the boundary to be corrected of the grid to be corrected and the reference boundary of the reference grid based on the projection distance, then correcting the boundary to be corrected according to the reference boundary, generating a target grid, and finally determining the grid resources of the target grid. The embodiments of the present application realize the accurate seamless and non-overlapping of adjacent grids, while improving the processing efficiency of grid boundary problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a grid drawing method, device, electronic device and computer-readable storage medium. Background Art

[0002] In recent years, the business of operators has developed rapidly, and grid operation has gradually come into people's view. Operators can use grids to support business systems, unify and integrate marketing resources within the grid, and effectively evaluate and manage grid personnel.

[0003] For grid-based operations, accurate definition of the scope and boundaries of the grid is crucial. Currently, the boundary definition of third-party grids can be completed by manually drawing boundaries on map software. The method for dealing with gaps or overlapping parts of adjacent grids is to align the adjacent boundaries of the two grids to the center line of the road. However, due to the complexity of roads, the accuracy of boundary processing results is not high, and there may still be overlaps or gaps between adjacent grids. Summary of the invention

[0004] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect of low accuracy when processing boundary problems.

[0005] In a first aspect, a method for grid drawing is provided, the method comprising:

[0006] Determine the reference grid and the grid to be corrected, obtain a set of coordinate points located on the boundary of the grid to be corrected; calculate the projection distance of each coordinate point in the set of coordinate points to the reference grid respectively;

[0007] Determine a nearest point, a first boundary point, and a second boundary point from the set of coordinate points based on the projection distance;

[0008] Determine a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point and the nearest point;

[0009] The boundary to be corrected is corrected based on the reference boundary to obtain a corrected boundary, and a target grid is generated based on the corrected boundary;

[0010] Determines the mesh resource of the target mesh.

[0011] In an optional embodiment of the first aspect, determining the nearest point based on the projection distance includes:

[0012] If the projection distance corresponding to the coordinate point in the coordinate set is not the first preset value and is less than the preset distance threshold, the coordinate point is set as the first coordinate point;

[0013] A closest point is determined from the first coordinate points based on the projection distance.

[0014] In an optional embodiment of the first aspect, determining the nearest point from the first coordinate point based on the projection distance includes:

[0015] Determine the minimum distance value among the projection distances corresponding to the first coordinate point;

[0016] The closest point is determined from the first coordinate points based on the minimum distance value.

[0017] In an optional embodiment of the first aspect, determining the nearest point, the first boundary point, and the second boundary point from the set of coordinate points based on the projection distance includes:

[0018] Starting from the nearest point, traverse point by point along the boundary of the grid to be corrected. If the first projection distance corresponding to any first coordinate point in any direction is greater than the distance threshold, set the first coordinate point as a candidate boundary point and stop the traversal process in that direction.

[0019] The candidate boundary points in the two traversal directions are respectively set as the first boundary point and the second boundary point.

[0020] In an optional embodiment of the first aspect, setting candidate boundary points in two traversal directions as first boundary points and second boundary points respectively includes:

[0021] For any direction, determine the first extension line formed by the candidate boundary point and the previous coordinate point based on the traversal order in the direction;

[0022] Determine a second extension line formed by the candidate boundary point and the next coordinate point;

[0023] If the included angle between the first extension line and the second extension line is greater than or equal to a preset value, the candidate boundary point is set as the first boundary point or the second boundary point.

[0024] In an optional embodiment of the first aspect, determining a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point, and the nearest point includes:

[0025] Divide the to-be-corrected boundary and the retained boundary of the to-be-corrected grid based on the first boundary point and the second boundary point; the boundary where the closest point is located is the to-be-corrected boundary;

[0026] Determine a first projection point and a second projection point corresponding to the first boundary point and the second boundary point in the reference grid;

[0027] Determine the nearest projection point corresponding to the nearest point in the reference grid;

[0028] A reference boundary of the reference grid is determined based on the first projection point, the second projection point, and the nearest projection point.

[0029] In an optional embodiment of the first aspect, determining a reference boundary of the reference grid based on the first projection point, the second projection point, and the nearest projection point includes:

[0030] The reference boundary and the outer boundary of the reference grid are divided based on the first projection point and the second projection point; the boundary where the nearest projection point is located is the reference boundary.

[0031] In a second aspect, a device for grid drawing is provided, the device comprising:

[0032] A calculation module is used to determine the reference grid and the grid to be corrected, obtain a set of coordinate points located on the boundary of the grid to be corrected; and respectively calculate the projection distance of each coordinate point in the set of coordinate points to the reference grid;

[0033] A selection module, for determining a nearest point, a first boundary point, and a second boundary point from a set of coordinate points based on a projection distance;

[0034] A determination module, configured to determine a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point and the nearest point;

[0035] The configuration module corrects the boundary to be corrected based on the reference boundary to obtain the corrected boundary, generates the target grid based on the corrected boundary, and determines the grid resource of the target grid.

[0036] In an optional embodiment of the second aspect, when the selection module determines the nearest point based on the projection distance, it is specifically configured to:

[0037] Determine the minimum distance value among the projection distances corresponding to the first coordinate point;

[0038] The closest point is determined from the first coordinate points based on the minimum distance value.

[0039] In an optional embodiment of the second aspect, when the selection module determines the nearest point from the first coordinate point based on the projection distance, it is specifically used to:

[0040] If the projection distance corresponding to the coordinate point in the coordinate set is not the first preset value and is less than the preset distance threshold, the coordinate point is set as the first coordinate point;

[0041] The nearest point is determined from the first coordinate point; the projection distance corresponding to the nearest point is the minimum distance value.

[0042] In an optional embodiment of the second aspect, when the selection module determines the nearest point, the first boundary point, and the second boundary point from the coordinate point set based on the projection distance, it is specifically configured to:

[0043] Starting from the nearest point, traverse point by point along the boundary of the grid to be corrected. If the first projection distance corresponding to any first coordinate point in any direction is greater than the distance threshold, set the first coordinate point as a candidate boundary point and stop the traversal process in that direction.

[0044] The candidate boundary points in the two traversal directions are respectively set as the first boundary point and the second boundary point.

[0045] In an optional embodiment of the second aspect, when the selection module sets the candidate boundary points in the two traversal directions as the first boundary point and the second boundary point respectively, it is specifically used to:

[0046] For any direction, determine the first extension line formed by the candidate boundary point and the previous coordinate point based on the traversal order in the direction;

[0047] Determine a second extension line formed by the candidate boundary point and the next coordinate point;

[0048] If the included angle between the first extension line and the second extension line is greater than or equal to a preset value, the candidate boundary point is set as the first boundary point or the second boundary point.

[0049] In an optional embodiment of the second aspect, when the determination module determines the to-be-corrected boundary of the to-be-corrected grid and the reference boundary of the reference grid based on the first boundary point, the second boundary point, and the nearest point, it is specifically configured to:

[0050] Divide the to-be-corrected boundary and the retained boundary of the to-be-corrected grid based on the first boundary point and the second boundary point; the boundary where the closest point is located is the to-be-corrected boundary;

[0051] Determine a first projection point and a second projection point corresponding to the first boundary point and the second boundary point in the reference grid;

[0052] Determine the nearest projection point corresponding to the nearest point in the reference grid;

[0053] A reference boundary of the reference grid is determined based on the first projection point, the second projection point, and the nearest projection point.

[0054] In an optional embodiment of the second aspect, when the determination module determines the reference boundary of the reference grid based on the first projection point, the second projection point, and the nearest projection point, it is specifically used to:

[0055] The reference boundary and the outer boundary of the reference grid are divided based on the first projection point and the second projection point; the boundary where the nearest projection point is located is the reference boundary.

[0056] In a third aspect, an electronic device is provided, the electronic device comprising:

[0057] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the grid drawing method of any of the above embodiments is implemented.

[0058] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the grid drawing method of any of the above-mentioned embodiments.

[0059] The above-mentioned grid drawing method first determines the reference grid and the grid to be corrected, then obtains the set of coordinate points on the boundary of the grid to be corrected and calculates the projection distance of each coordinate point to the reference grid, determines the boundary to be corrected of the grid to be corrected and the baseline boundary of the reference grid based on the projection distance, then corrects the boundary to be corrected according to the baseline boundary, generates the target grid, and finally determines the grid resources of the target grid, thereby realizing the accurate seamless and non-overlapping of adjacent grids and improving the processing efficiency of grid boundary problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0061] Figure 1 A schematic diagram of a flow chart of a grid drawing method provided in an embodiment of the present application;

[0062] Figure 2 A schematic diagram of determining the nearest point in 1 of a grid drawing method provided in an embodiment of the present application;

[0063] Figure 3 A schematic diagram of a first extension line, a second extension line, and an angle corresponding to a candidate boundary point in a grid drawing method provided in an embodiment of the present application;

[0064] Figure 4 A schematic diagram of a flow chart of a grid drawing method provided in an embodiment of the present application;

[0065] Figure 5 A schematic diagram of the structure of an image rendering device provided in an embodiment of the present application;

[0066] Figure 6 A schematic diagram of the structure of an electronic device for image rendering provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present invention.

[0068] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0069] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0070] Grid operation is a new operational concept that has emerged in recent years. Its purpose is to help enterprises get closer to users, make the enterprise's resource allocation more in line with market orientation, make operation plans more refined and targeted, and make the enterprise's resource allocation more efficient.

[0071] Grid-based operations can not only effectively carry integrated businesses and fully "integrate" the marketing forces of various lines, but also support the system through the grid, use the grid to coordinate management and uniformly evaluate the marketing resources within the grid, and realize personnel reuse and full customer care.

[0072] Among them, grid division is the basic step of grid operation. Whether the grid division is reasonable and the boundaries are clear will directly affect the execution effect of grid operation, involving the accuracy and uniqueness of grid resources. In particular, the boundary division between grids must be clear to avoid the possibility of overlapping resources between grids or even snatching users.

[0073] At present, the boundary definition of third-party grids is generally completed by manual drawing on map software. For the boundary gaps or overlapping parts between adjacent grids, they can be slightly adjusted by manual editing, but this method may result in low efficiency. In addition, there is another way to handle gaps or overlaps between adjacent grids, that is, the adjacent boundaries of the two grids are aligned to the center line of the road, but the roads are complicated, and the accuracy of the boundary processing results is usually not high, and there may still be overlaps or gaps between adjacent grids.

[0074] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0075] The grid drawing method provided in the embodiment of the present application can be applied to a server or a terminal.

[0076] Technicians in this technical field can understand that the "terminal" used here can be a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a MID (Mobile Internet Device), etc.; the "server" can be implemented by an independent server or a server cluster consisting of multiple servers.

[0077] The present application provides a method for grid drawing, which can be applied to a server or a terminal. Figure 1 As shown, the method may include:

[0078] Step S100, determining a reference grid and a grid to be corrected, obtaining a set of coordinate points located on the boundary of the grid to be corrected; respectively calculating the projection distance of each coordinate point in the set of coordinate points to the reference grid;

[0079] In the embodiment of the present application, two adjacent grids may be selected as objects to be subjected to boundary processing. There may be boundary overlaps or gaps between the adjacent grids.

[0080] Among the two adjacent grids to be processed, one can be selected as the reference grid and the other as the grid to be corrected. The basis for selection can be to select a grid with fewer boundary sharp corners and more regular as the reference grid to optimize the boundary processing effect.

[0081] After determining the reference grid and the grid to be corrected, the next step is to obtain a coordinate set, where the coordinate point set may include all coordinate points constituting the boundary of the grid to be corrected, and then based on the coordinate point set, the projection distance of each coordinate point to the reference grid is calculated respectively.

[0082] When calculating the projection distance, you can first perform map projection, use certain mathematical rules to convert the longitude and latitude lines on the earth's surface to a plane, and establish a one-to-one correspondence between points on the earth's surface (or other planetary surfaces or celestial spheres) and points on the projection plane (i.e., map plane). The projection methods can be roughly divided into projection by deformation, projection based on the shape of the latitude and longitude grid during orthographic projection, and projection based on the relationship between the projection axis and the earth's axis. After obtaining the longitude and latitude coordinate points after projecting from an irregular spherical surface to a two-dimensional map, the projection distance can be calculated based on the longitude and latitude coordinate points.

[0083] Specifically, the coordinate point set can be composed of the longitude and latitude coordinate points of the grid boundary to be corrected, and the coordinate point set can be traversed to calculate the projection distance of each coordinate point to the reference grid. Since the earth is an irregular sphere, on a two-dimensional map, the projection distance can represent the approximate vertical distance from a point to a line.

[0084] Step S200, determining a nearest point, a first boundary point, and a second boundary point from a set of coordinate points based on a projection distance;

[0085] In an embodiment of the present application, the projection distance from each coordinate point in the coordinate point set to the reference grid can be obtained, the nearest point can be determined by sorting the projection distances, and the first boundary point and the second boundary point whose projection distances meet preset conditions can be screened out from the coordinate point set.

[0086] In an embodiment of the present application, determining the nearest point based on the projection distance may include the steps of: determining a minimum distance value in the projection distance; and determining the nearest point from a set of coordinate points based on the minimum distance value.

[0087] Among them, the minimum distance value can be determined from the projection distance, and the minimum distance value may correspond to multiple coordinate points. According to the preset selection rule, the closest point is determined from the multiple coordinate points corresponding to the minimum distance value. Specifically, when there is no overlap but a gap between the reference grid and the grid to be corrected, the minimum distance value in the projection distance may be greater than zero; when there is an overlapping part between the boundary between the reference grid and the grid to be corrected, the minimum distance value in the projection distance may be a negative number; when there is no gap or overlap between a certain part or a certain point on the boundary between the reference grid and the grid to be corrected, the minimum distance value in the projection distance may also be zero.

[0088] In an embodiment of the present application, the preset selection rule can set the minimum distance value in the projection distance to a non-zero value, and then the minimum distance value is selected from the non-zero projection distances, because when the projection distance is zero, it means that no boundary processing operation is required at this boundary.

[0089] Step S300, determining a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point and the nearest point;

[0090] In the embodiment of the present application, the first boundary point and the second boundary point are located on the boundary of the grid to be corrected, and the grid to be corrected can be divided into two boundary segments, wherein the boundary segment adjacent to the reference grid can be set as the boundary to be corrected.

[0091] When determining the reference boundary of the reference grid, the boundary of the reference grid may be divided based on the projection points of the first boundary point and the second boundary point on the reference grid boundary to determine the reference boundary of the reference grid. The reference boundary may be used to correct the boundary to be corrected.

[0092] Step S400, correcting the boundary to be corrected based on the reference boundary to obtain a corrected boundary, generating a target grid based on the corrected boundary; and determining the grid resources of the target grid.

[0093] In the embodiment of the present application, the coordinate point set included in the reference boundary can be obtained and set as the reference coordinate point set, the coordinate point set included in the boundary to be corrected can be set as the coordinate point set to be corrected, and the reference coordinate point set can be replaced by the coordinate point set to be corrected to achieve correction, that is, the reference boundary can be used as part of the correction boundary (the new boundary generated after the correction grid is corrected), and the two ends of the correction boundary can be adaptively adjusted at the same time, for example, the two end points of the correction boundary can be directly connected to the two ends of the boundary retained in the grid to be corrected to form a closed new boundary to obtain the target grid. The grid resources of the target grid can be determined according to the coverage area and size of the target grid.

[0094] The grid drawing method in the embodiment of the present application first determines the baseline grid and the grid to be corrected, then obtains a set of coordinate points on the boundary of the grid to be corrected and calculates the projection distance of each coordinate point to the baseline grid, determines the boundary to be corrected of the grid to be corrected and the baseline boundary of the baseline grid based on the projection distance, then corrects the boundary to be corrected according to the baseline boundary, generates a target grid, and finally determines the grid resources of the target grid, thereby achieving accurate seamless and non-overlapping of adjacent grids and improving the efficiency of processing grid boundary problems.

[0095] In an embodiment of the present application, determining the nearest point from a set of coordinate points based on the minimum distance value may include the following steps:

[0096] (1) If the projection distance corresponding to the coordinate point in the coordinate set is not a first preset value and is smaller than a preset distance threshold, the coordinate point is set as the first coordinate point.

[0097] The first preset value may be set to 0, and the preset distance threshold may be set according to demand to remind that when two grids are far apart, it is not suitable for seamless non-overlapping calculation.

[0098] In an example, the first preset value may be 0, the preset distance threshold may be 5, and coordinate points whose corresponding projection distances are less than 5 and not 0 may be screened out from the coordinate point set, and these coordinate points meeting the conditions may be set as the first coordinate points.

[0099] (2) Determine the nearest point from the first coordinate points based on the projection distance.

[0100] The first coordinate point can be screened out from the coordinate point set. Each first coordinate point has a corresponding projection distance. The projection distances of the first coordinate points can be sorted by size, so as to determine the coordinate point closest to the reference grid among the first coordinate points, and set the coordinate point as the closest point.

[0101] In an embodiment of the present application, a coordinate point whose projection distance is not a first preset value and is less than a preset distance threshold can be first screened out from the coordinate set, and the coordinate point can be set as the first coordinate point. Then, the nearest point can be determined by sorting according to the size of the projection distance corresponding to the first coordinate point. This achieves the goal of narrowing the data range to be compared when comparing the projection distances, achieving a pre-screening effect and improving the efficiency of grid boundary processing.

[0102] If after traversing all the coordinate points in the coordinate set, there is no coordinate point whose corresponding projection distance meets the preset conditions, it means that the distance between the selected grid to be corrected and the reference grid is too far or has been completed seamlessly without overlap, and it is not suitable for or does not need to perform grid boundary processing operations. At this time, you can reselect the grid to be corrected and the reference grid.

[0103] In an embodiment of the present application, determining the nearest point from the first coordinate point based on the projection distance may include the steps of: determining the minimum distance value in the projection distance corresponding to the first coordinate point; and determining the nearest point from the first coordinate point based on the minimum distance value.

[0104] After the first coordinate point is selected from the coordinate point set, the projection distances corresponding to the first coordinate point can be sorted, and the smallest projection distance can be set as the minimum distance value. If the projection distance corresponding to the first coordinate point is a non-zero value, the minimum distance value is also a non-zero value; when the grid to be corrected and the reference grid have no overlapping parts, the minimum distance value, if it exists, is greater than 0; when there is a boundary overlap between the grid to be corrected and the reference grid, the minimum distance value may be a negative number.

[0105] In one example, if Figure 2 As shown, it is assumed that there are first coordinate points A, B, C, D, E and the corresponding calculated projection distances. Among them, the projection distance from point A to the reference grid is 4; the projection distance from point B to the reference grid is 2; the projection distance from point C to the reference grid is -1; the projection distance from point D to the reference grid is -1, and the projection distance from point E to the reference grid is 2. The specific measurement units of all the above distance parameters can be determined based on the map projection method of the map software and the establishment scheme of the coordinate system. At this time, the minimum distance value is -1, corresponding to coordinate points C and D, and the nearest point can be selected from points C and D according to the preset selection rules.

[0106] Specifically, the preset selection rule may be to select the first coordinate point whose first projection distance is the minimum distance value as the closest point according to the traversal order when calculating the projection distance. For example, when calculating the projection distance, the traversal order is "A, B, C, D, E", then point C is the first coordinate point whose first projection distance is the minimum distance value, and point C is set as the closest point.

[0107] In the embodiment of the present application, the second closest point can also be determined by the same method, and the second closest point can be used to assist in the subsequent correction grid coordinate reorganization.

[0108] In an embodiment of the present application, determining the nearest point, the first boundary point, and the second boundary point from the coordinate point set based on the projection distance may include the following steps:

[0109] (1) Starting from the nearest point, traverse point by point along the boundary of the grid to be corrected. If the projection distance corresponding to any coordinate point in any direction is greater than the distance threshold, the coordinate point is set as a candidate boundary point and the traversal process in that direction is stopped;

[0110] (2) The candidate boundary points in the two traversal directions are respectively set as the first boundary point and the second boundary point.

[0111] Specifically, we can start from the nearest point and start traversing point by point in both directions on both sides of the nearest point, and determine whether the projection distance corresponding to each coordinate point is greater than the distance threshold according to the traversal order. If the projection distance corresponding to a coordinate point is greater than the distance threshold during the traversal in any direction, we can set the coordinate point as a candidate boundary point and stop the traversal in that direction. If no candidate boundary point is determined in the other direction, we continue traversing, and the traversal processes in the two directions remain relatively independent.

[0112] After obtaining two candidate boundary points, the two candidate boundary points may be set as a first boundary point and a second boundary point, respectively.

[0113] In one example, there are five coordinate points A1, B1, C1, D1 and E1 in a certain boundary of the grid to be corrected. It is known that C1 is the closest point, and the preset distance threshold is 2. Start traversing point by point in the direction of both sides of C1 to check whether the projection distance corresponding to each coordinate point is greater than 2. Assume that the projection distance from point A1 to the reference grid is 4; the projection distance from point B1 to the reference grid is 2; the projection distance from point C1 to the reference grid is 1; the projection distance from point D1 to the reference grid is 2; and the projection distance from point E1 to the reference grid is 3. The specific measurement units of all the above distance parameters can be determined based on the map projection method of the map software and the establishment scheme of the coordinate system.

[0114] According to the above coordinate points and the corresponding projection distances, when traversing from the left side of point C1, the projection distance corresponding to point B1 is equal to 2, which does not meet the condition of being greater than 2. Then continue to traverse to point A1. The projection distance corresponding to point A1 is 4, which meets the condition of being greater than 2. Then set point A1 as a candidate boundary point and stop the traversal process in this direction. When traversing from the right side of point C1, the projection distance corresponding to point D1 is 2, which does not meet the condition of being greater than 2. Continue to traverse to point E1. The projection distance corresponding to point E1 is 3, which meets the condition of being greater than 3. Then you can set E1 as another candidate boundary point and stop the traversal process in this direction. Points A1 and E1 can be set as the first boundary point and the second boundary point, respectively.

[0115] In the embodiment of the present application, setting the candidate boundary points in the two traversal directions as the first boundary point and the second boundary point respectively may include the following steps:

[0116] (1) For any direction, determine the first extension line formed by the candidate boundary point and the previous coordinate point based on the traversal order in that direction;

[0117] (2) Determine the second extension line formed by the candidate boundary point and the next coordinate point.

[0118] The first extension line may be an extension line of a line connecting the candidate boundary point in two directions and the previous coordinate point in the traversal order; the second extension line may refer to an extension line of a line connecting the candidate boundary point and the next coordinate point in the traversal order. The candidate boundary point in each direction may correspond to the respective first extension line and second extension line. The number of coordinate points on the map may be finite, and the angle formed by connecting the candidate boundary point and the coordinate points in the previous and next order is not rounded, but may form a sharp angle of a certain angle.

[0119] (3) If the included angle between the first extension line and the second extension line is greater than or equal to a preset value, the candidate boundary point is set as the first boundary point or the second boundary point.

[0120] The first extension line and the second extension line of each candidate boundary point may form an angle. If the angle of the angle is greater than or equal to a preset value, the candidate boundary point may be set as the first boundary point or the second boundary point.

[0121] In an embodiment of the present application, if the angle is less than a preset value, the traversal process can be restarted with the candidate boundary point as the starting point until a new candidate boundary point is determined, and then the angle corresponding to the candidate boundary point is checked to see whether the angle is greater than or equal to the preset value.

[0122] In one example, if Figure 3 As shown, three coordinate points A3, B3 and C3 are known, B3 is a candidate boundary point, and the first extension line, the second extension line and the angle corresponding to B3 are shown in the figure.

[0123] In the embodiment of the present application, determining the boundary to be corrected of the grid to be corrected and the reference boundary of the reference grid based on the first boundary point, the second boundary point and the nearest point may include the following steps:

[0124] (1) Based on the first boundary point and the second boundary point, the grid to be corrected is divided into a boundary to be corrected and a reserved boundary; the boundary where the closest point is located is the boundary to be corrected.

[0125] The boundary of the grid to be corrected can be divided into two sections by the first boundary point and the second boundary point, and the boundary where the nearest point is located can be set as the boundary to be corrected, and the other section can be set as the reserved boundary.

[0126] (2) Determine the first projection point and the second projection point corresponding to the first boundary point and the second boundary point in the reference grid; determine the nearest projection point corresponding to the nearest point in the reference grid.

[0127] The first projection point and the second projection point corresponding to the first boundary point and the second boundary point in the reference grid are determined by a preset projection scheme, and the boundary point can be projected in a vertical manner.

[0128] (3) Determine a reference boundary of the reference grid based on the first projection point, the second projection point, and the nearest projection point.

[0129] In an embodiment of the present application, determining the reference boundary of the reference grid based on the first projection point, the second projection point and the nearest projection point may include: dividing the reference boundary and the outer boundary of the reference grid based on the first projection point and the second projection point; the boundary where the nearest projection point is located is the reference boundary.

[0130] The boundary of the reference grid may be divided into two sections by the first projection point and the second projection point, and the boundary where the nearest projection point is located may be set as the reference boundary, and the other section may be set as the outer boundary.

[0131] In order to more clearly explain the grid drawing method of the present application, the grid drawing method will be further described below with reference to specific examples.

[0132] In one example, the present application provides a grid drawing method, such as Figure 4 , including the following steps:

[0133] Step S401, selecting two adjacent grids to be processed, determining one of them as a reference grid and the other as a correction grid;

[0134] Step S402, obtaining a latitude and longitude coordinate set of the correction network, the latitude and longitude coordinate set including all coordinate points on the correction grid boundary;

[0135] Step S403, traversing the coordinate points in the longitude and latitude coordinate set, and calculating the projection distance of each coordinate point to the reference grid;

[0136] Step S404: if the projection distance corresponding to the coordinate point is 0, proceed to step S405; if the projection distance corresponding to the coordinate point is not 0, proceed to step S406;

[0137] Step S405, ignore the coordinate point and proceed to step S408;

[0138] Step S406, if the projection distance corresponding to the coordinate point is greater than the preset distance threshold, proceed to step S405, otherwise, proceed to step S407;

[0139] Step S407, storing the coordinate point and the corresponding projection distance;

[0140] Step S408, determine whether there are any unprocessed coordinate points, if yes, proceed to step S403, if no, proceed to step S409;

[0141] Step S409: if all coordinate points are ignored and no coordinate point and corresponding projection distance are stored, then go to step S410; otherwise, go to step S411;

[0142] Step S410, ending the process, the two selected grids are not suitable for seamless non-overlapping processing;

[0143] Step S411, determining the minimum distance among the stored projection distances;

[0144] Step S412, determining the coordinate point corresponding to the minimum distance as the candidate closest point, and taking the candidate closest point processed first in the traversal process as the closest point;

[0145] Step S413, starting from the nearest point, traverse point by point along the correction grid boundary to both sides to determine the first boundary point and the second boundary point;

[0146] Step S414, determining a retained boundary of the correction grid based on the first boundary point and the second boundary point, and determining a first projection point and a second projection point of the first boundary point and the second boundary point on the boundary of the reference grid;

[0147] Step S415, determining a target boundary of the reference grid based on the first projection point and the second projection point;

[0148] Step S416, determining a correction boundary of the correction grid based on the retained boundary and the target boundary, and drawing a new correction grid based on the correction boundary to achieve seamless and non-overlapping processing.

[0149] The above-mentioned grid drawing method first determines the reference grid and the grid to be corrected, then obtains the set of coordinate points on the boundary of the grid to be corrected and calculates the projection distance of each coordinate point to the reference grid, determines the boundary to be corrected of the grid to be corrected and the reference boundary of the reference grid based on the projection distance, then corrects the boundary to be corrected according to the reference boundary, generates the target grid, and finally determines the grid resources of the target grid, thereby achieving the precise seamless non-overlapping of adjacent grids and improving the processing efficiency of grid boundary problems. In addition, this solution is not affected by the map road network conditions and is suitable for complex road conditions. The application scenarios of the grid drawing solution are wider.

[0150] The present application embodiment provides an image rendering device, such as Figure 5 As shown, the grid drawing device 50 may include: a calculation module 501, a selection module 502, a determination module 503 and a configuration module 504, wherein:

[0151] The calculation module 501 is used to determine the reference grid and the grid to be corrected, obtain a set of coordinate points located on the boundary of the grid to be corrected, and respectively calculate the projection distance of each coordinate point in the set of coordinate points to the reference grid;

[0152] A selection module 502, for determining a nearest point, a first boundary point, and a second boundary point from a set of coordinate points based on a projection distance;

[0153] A determination module 503, configured to determine a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point and the nearest point;

[0154] The configuration module 504 corrects the boundary to be corrected based on the reference boundary to obtain a corrected boundary, generates a target grid based on the corrected boundary, and determines the grid resources of the target grid.

[0155] In an embodiment of the present application, when the selection module 502 determines the nearest point based on the projection distance, it is specifically used to:

[0156] Determine the minimum distance value among the projection distances corresponding to the first coordinate point;

[0157] The closest point is determined from the first coordinate points based on the minimum distance value.

[0158] In an embodiment of the present application, when the selection module 502 determines the nearest point from the first coordinate point based on the projection distance, it is specifically used to:

[0159] If the projection distance corresponding to the coordinate point in the coordinate set is not the first preset value and is less than the preset distance threshold, the coordinate point is set as the first coordinate point;

[0160] The nearest point is determined from the first coordinate point; the projection distance corresponding to the nearest point is the minimum distance value.

[0161] In an optional embodiment of the second aspect, when the selection module determines the nearest point, the first boundary point, and the second boundary point from the coordinate point set based on the projection distance, it is specifically configured to:

[0162] Starting from the nearest point, traverse point by point along the boundary of the grid to be corrected. If the first projection distance corresponding to any first coordinate point in any direction is greater than the distance threshold, set the first coordinate point as a candidate boundary point and stop the traversal process in that direction.

[0163] The candidate boundary points in the two traversal directions are respectively set as the first boundary point and the second boundary point.

[0164] In the embodiment of the present application, when the selection module 502 sets the candidate boundary points in the two traversal directions as the first boundary point and the second boundary point respectively, it is specifically used to:

[0165] For any direction, determine the first extension line formed by the candidate boundary point and the previous coordinate point based on the traversal order in the direction;

[0166] Determine a second extension line formed by the candidate boundary point and the next coordinate point;

[0167] If the included angle between the first extension line and the second extension line is greater than or equal to a preset value, the candidate boundary point is set as the first boundary point or the second boundary point.

[0168] In an embodiment of the present application, when determining the to-be-corrected boundary of the to-be-corrected grid and the reference boundary of the reference grid based on the first boundary point, the second boundary point and the nearest point, the determination module 503 is specifically used to:

[0169] Divide the to-be-corrected boundary and the retained boundary of the to-be-corrected grid based on the first boundary point and the second boundary point; the boundary where the closest point is located is the to-be-corrected boundary;

[0170] Determine a first projection point and a second projection point corresponding to the first boundary point and the second boundary point in the reference grid;

[0171] Determine the nearest projection point corresponding to the nearest point in the reference grid;

[0172] A reference boundary of the reference grid is determined based on the first projection point, the second projection point, and the nearest projection point.

[0173] In an embodiment of the present application, when determining the reference boundary of the reference grid based on the first projection point, the second projection point and the nearest projection point, the determination module 503 is specifically used to:

[0174] The reference boundary and the outer boundary of the reference grid are divided based on the first projection point and the second projection point; the boundary where the nearest projection point is located is the reference boundary.

[0175] The above-mentioned grid drawing device first determines the reference grid and the grid to be corrected, then obtains the set of coordinate points on the boundary of the grid to be corrected and calculates the projection distance of each coordinate point to the reference grid, determines the boundary to be corrected of the grid to be corrected and the reference boundary of the reference grid based on the projection distance, then corrects the boundary to be corrected according to the reference boundary, generates the target grid, and finally determines the grid resources of the target grid, thereby achieving accurate seamless and non-overlapping of adjacent grids and improving the processing efficiency of grid boundary problems.

[0176] An electronic device is provided in an embodiment of the present application, and the electronic device includes: a memory and a processor; at least one program, which is stored in the memory and is used to be executed by the processor. Compared with the prior art, it can achieve: by first determining a reference grid and a grid to be corrected, then obtaining a set of coordinate points on the boundary of the grid to be corrected and calculating the projection distance of each coordinate point to the reference grid, determining the boundary to be corrected of the grid to be corrected and the baseline boundary of the reference grid based on the projection distance, then correcting the boundary to be corrected according to the baseline boundary, generating a target grid, and finally determining the grid resources of the target grid, thereby achieving accurate seamless and non-overlapping of adjacent grids, and at the same time improving the processing efficiency of grid boundary problems.

[0177] In an alternative embodiment, an electronic device is provided, such as Figure 6 As shown, Figure 6 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0178] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0179] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0180] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.

[0181] The memory 4003 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the contents shown in the above method embodiment.

[0182] The electronic devices include but are not limited to mobile terminals such as mobile phones, notebook computers, PADs, etc. and fixed terminals such as digital TVs, desktop computers, etc.

[0183] The present application embodiment provides a computer-readable storage medium, on which a computer program is stored, and when it is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment. It should be understood that although the various steps in the flowchart of the accompanying drawings are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and it can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

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

Claims

1. A grid drawing method, characterized in that: include: Determine a reference grid and a grid to be corrected, and obtain a set of coordinate points located on the boundary of the grid to be corrected; Calculating the projection distance of each coordinate point in the coordinate point set to the reference grid respectively; Determining a nearest point, a first boundary point, and a second boundary point from the set of coordinate points based on the projection distance; Determine a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point and the nearest point; Correcting the boundary to be corrected based on the reference boundary to obtain a corrected boundary, and generating a target grid based on the corrected boundary; A grid resource of the target grid is determined.

2. The grid drawing method according to claim 1, characterized in that: The determining the nearest point based on the projection distance comprises: If the projection distance corresponding to the coordinate point in the coordinate point set is not a first preset value and is smaller than the preset distance threshold, setting the coordinate point as the first coordinate point; The closest point is determined from the first coordinate points based on the projection distance.

3. The grid drawing method according to claim 2, characterized in that: Determining the nearest point from the first coordinate point based on the projection distance includes: Determine a minimum distance value among the projection distances corresponding to the first coordinate point; A closest point is determined from the first coordinate points based on the minimum distance value.

4. The grid drawing method according to claim 1, characterized in that: The determining the nearest point, the first boundary point and the second boundary point from the coordinate point set based on the projection distance includes: Taking the nearest point as the starting point, traverse point by point along the boundary of the grid to be corrected toward both sides. If the projection distance corresponding to any coordinate point in any direction is greater than the distance threshold, set the coordinate point as a candidate boundary point and stop the traversal process in this direction. The candidate boundary points in two traversal directions are respectively set as the first boundary point and the second boundary point.

5. The grid drawing method according to claim 4, characterized in that: The step of respectively setting the candidate boundary points in two traversal directions as the first boundary point and the second boundary point comprises: For any direction, determine a first extension line formed by the candidate boundary point and the previous coordinate point based on the traversal order in the direction; Determine a second extension line formed by the candidate boundary point and the next coordinate point; If the included angle between the first extension line and the second extension line is greater than or equal to a preset value, the candidate boundary point is set as the first boundary point or the second boundary point.

6. The grid drawing method according to claim 1, characterized in that: The determining the to-be-corrected boundary of the to-be-corrected grid and the reference boundary of the reference grid based on the first boundary point, the second boundary point and the nearest point comprises: Divide the boundary to be corrected and the reserved boundary of the grid to be corrected based on the first boundary point and the second boundary point; the boundary where the closest point is located is the boundary to be corrected; Determine a first projection point and a second projection point corresponding to the first boundary point and the second boundary point in the reference grid; Determine the nearest projection point corresponding to the nearest point in the reference grid; A reference boundary of the reference grid is determined based on the first projection point, the second projection point, and the closest projection point.

7. The grid drawing method according to claim 6, characterized in that: The determining the reference boundary of the reference grid based on the first projection point, the second projection point and the nearest projection point comprises: The reference boundary and the outer boundary of the reference grid are divided based on the first projection point and the second projection point; the boundary where the nearest projection point is located is the reference boundary.

8. A grid drawing device, characterized in that: include: A calculation module, used to determine a reference grid and a grid to be corrected, and obtain a set of coordinate points located on the boundary of the grid to be corrected; Calculating the projection distance of each coordinate point in the coordinate point set to the reference grid respectively; A selection module, configured to determine a nearest point, a first boundary point, and a second boundary point from the set of coordinate points based on the projection distance; A determination module, configured to determine a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point and the nearest point; A configuration module is configured to correct the boundary to be corrected based on the reference boundary to obtain a corrected boundary, and to generate a target grid based on the corrected boundary; A grid resource of the target grid is determined.

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 program, the grid drawing method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the grid drawing method according to any one of claims 1 to 7.