Grid boundary adjustment method and device and computer storage medium
By dividing the grid into squares and establishing a corresponding coverage relationship during grid boundary adjustment, the system automatically identifies adjacent grids and optimizes the adjustment of grid vertices, thus solving the problems of low efficiency and poor accuracy in grid boundary adjustment and achieving efficient and accurate grid boundary overlap.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE GROUP ZHEJIANG
- Filing Date
- 2025-11-19
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies suffer from low adjustment efficiency and poor user experience in grid boundary adjustment, failing to meet dynamic adjustment requirements, and exhibiting problems such as small gaps or small-scale cross-over between grids.
By dividing the preset area into grids, the coverage correspondence between the grid and the bottom grid is determined. The coverage correspondence is used to automatically identify neighboring grids, and the grid vertices are optimized and adjusted based on the relative positional relationship between the grid to be adjusted and the neighboring grids, thereby reducing the amount of computation and improving the adjustment efficiency and accuracy.
It enables efficient and accurate adjustment of grid boundaries, reduces boundary gaps and intersections, and improves the accuracy and automation of resource management.
Smart Images

Figure CN121997502A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data processing technology, and in particular relates to a method, apparatus and computer storage medium for adjusting grid boundaries. Background Technology
[0002] In areas such as communication networks and urban management, a grid-based approach is typically used to manage physical resources or business areas in a refined manner. However, grid-based management often relies on manual boundary delineation, which can lead to small gaps or minor overlaps between grids, causing inconvenience to the development of related businesses.
[0003] In existing technologies, grids can be adjusted to make their boundaries coincide through functions such as boundary snapping. However, the above methods are only applicable to static or small-scale grid planning and cannot meet the needs of dynamic adjustment. Moreover, the complexity of grid adjustment increases with the number of grids, resulting in low adjustment efficiency and poor user experience. Summary of the Invention
[0004] This application provides a method, apparatus, device, and computer storage medium for adjusting grid boundaries, which can improve the automation, success rate, and accuracy of grid boundary overlap adjustment, increase the efficiency of meeting continuous optimization needs, and reduce the reliance on manual intervention.
[0005] In a first aspect, embodiments of this application provide a mesh boundary adjustment method, the method comprising: The preset area is divided into grids to obtain the bottom grid. The bottom grids covered by each grid are determined, and the coverage correspondence between grid number and grid number is obtained. Each grid is used to represent a business area. The business area is within the preset area. The bottom grids are numbered according to the position order. Determine the grid number of the grid to be adjusted, obtain the target grid number corresponding to the grid to be adjusted based on the coverage correspondence, and determine the neighboring grids of the current grid to be adjusted based on the target grid number; The vertices to be adjusted in the mesh to be adjusted are optimized based on the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices in the neighboring meshes, resulting in an adjusted mesh, and the coverage correspondence is updated based on the adjusted mesh.
[0006] Secondly, embodiments of this application provide a mesh boundary adjustment device, the device comprising: The coverage module is used to divide the preset area into grids to obtain the bottom grid, and to determine the bottom grid covered by each grid in multiple grids, and to obtain the coverage correspondence between grid number and grid number. Each grid is used to represent a business area. The business area is within the preset area, and the bottom grids are numbered according to the position order. The processing module is used to determine the grid number of the grid to be adjusted, obtain the target grid number corresponding to the grid to be adjusted based on the coverage correspondence, and determine the neighboring grids of the current grid to be adjusted based on the target grid number; The adjustment module is used to optimize and adjust the vertices of the mesh to be adjusted based on the relative positional relationship between the vertices to be adjusted and the neighboring vertices of the neighboring meshes, to obtain the adjusted mesh, and to update the coverage correspondence based on the adjusted mesh.
[0007] Thirdly, embodiments of this application provide a terminal device, the device including: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the mesh boundary adjustment method as described in the first aspect.
[0008] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the mesh boundary adjustment method as described in the first aspect.
[0009] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed, implements the mesh boundary adjustment method as described in the first aspect.
[0010] The grid boundary adjustment method, apparatus, and computer storage medium of this application embodiment can divide a preset area into grids to obtain bottom-layer grids, and determine the bottom-layer grids covered by each grid in multiple grids, obtaining a coverage correspondence between grid numbers and grid numbers. Each grid is used to represent a business area, which is within the preset area. The bottom-layer grids are numbered according to their positional order, thereby establishing an index relationship between grids and grids through the coverage correspondence. When adjusting the grid boundary, a linear processing-like process can be achieved, reducing the amount of computation required to adjust the grid data. The grid number of the grid to be adjusted is determined, the corresponding target grid number is determined according to the coverage correspondence, and the neighboring grids of the grid to be adjusted are determined according to the target grid number. The neighboring grids of the grid to be adjusted can be automatically determined according to the coverage correspondence, reducing the amount of computation required to determine neighboring grids. At the same time, based on the relative positional relationship between the vertices of the grid to be adjusted and the neighboring vertices of the neighboring grids, the grid boundary can be dynamically adjusted, improving adjustment efficiency and reliability, eliminating boundary gaps and intersections, and improving the accuracy of resource management. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart illustrating a mesh boundary adjustment method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the vertex coordinates of a line segment of a mesh provided in an embodiment of this application; Figure 3 This is a schematic diagram of a common boundary vertex provided in an embodiment of this application; Figure 4 This is a schematic diagram of an intersection point covering the bottom grid provided in an embodiment of this application; Figure 5 This is a schematic diagram illustrating the relative positional relationship between a mesh and its neighboring meshes, provided in an embodiment of this application. Figure 6 This is a schematic diagram illustrating an embodiment of the present application where the number of intersections is odd. Figure 7 This is a schematic diagram illustrating how the vertices of the edge lines of a mesh cover the underlying grid, as provided in an embodiment of this application. Figure 8 This is a schematic diagram of the mesh to be adjusted and the adjacent meshes before near vertex replacement provided in an embodiment of this application; Figure 9 This is a schematic diagram of the mesh to be adjusted and the neighboring meshes after near vertex replacement provided in an embodiment of this application; Figure 10 This is a schematic diagram of the grid to be adjusted and adjacent grids before a near-vertical point replacement, provided in an embodiment of this application; Figure 11 This is a schematic diagram of the grid to be adjusted and adjacent grids after a near-vertical point replacement provided in an embodiment of this application; Figure 12 This is a schematic diagram of the mesh to be adjusted and the neighboring meshes before adding nearby vertices, provided in an embodiment of this application; Figure 13 This is a schematic diagram of the mesh to be adjusted and the neighboring meshes after adding nearby vertices, provided in an embodiment of this application; Figure 14 This is a schematic diagram illustrating a method for adding intersection points according to an embodiment of this application; Figure 15 This is a schematic diagram illustrating the deletion of a temporary vertex according to an embodiment of this application; Figure 16 This is a schematic diagram of a vertex before replacement provided by a replacement group according to an embodiment of this application; Figure 17 This is a schematic diagram of vertices after replacement by judging the replacement group, provided in an embodiment of this application; Figure 18This is a schematic diagram illustrating an embodiment of this application where a replacement operation is not performed; Figure 19 This is a schematic diagram of a device structure provided in an embodiment of this application; Figure 20 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0013] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0014] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0015] With the acceleration of urbanization and the development of communication services, grid-based management can be used to efficiently manage and operate management resources. This involves dividing management resources into multiple layers based on their management area, such as microgrids, optical distribution grids, and equipment room grids. However, this approach is problematic due to the large number of grids and the need for frequent optimization and adjustments caused by various factors.
[0016] In existing technologies, adjusting the boundary overlap of a large number of meshes mainly relies on manual meshing or simple automated tools, such as using tools or platforms with snapping / snagging functions to mesh, or adjusting the boundary by determining the nearest vertical point of each vertex of the mesh to be adjusted on the already adjusted mesh. This can achieve preliminary meshing and adjustment to a certain extent. However, when faced with the dynamic adjustment and continuous optimization of a large number of meshes, there are shortcomings in terms of adaptability, flexibility and real-time performance.
[0017] Manually defining grid boundaries is labor-intensive and prone to accuracy issues, resulting in small gaps or minor overlaps between grids, which affects the accuracy and effectiveness of grid management. Furthermore, adjusting boundaries by using the vertices of the grid to be adjusted requires numerous calculations of point-to-line segments, line segments, and line segment intersections, increasing computational costs, slowing processing speed, and producing inaccurate results.
[0018] In addition, existing technologies have problems in determining the proximity of non-intersecting grids, such as the inability to automatically determine or to perform overall calculations on a large number of non-adjacent grids at once. They may also have insufficient constraints on the overall coverage of the grid, leading to abnormal expansion of the adjusted grid, covering blank areas or other grids that should not be managed, resulting in insufficient reliability.
[0019] To address the problems in the prior art, embodiments of this application provide a method, apparatus, device, and computer storage medium for adjusting grid boundaries.
[0020] The mesh boundary adjustment method provided in the embodiments of this application will be introduced first below.
[0021] Figure 1 A flowchart illustrating a mesh boundary adjustment method according to an embodiment of this application is shown. Figure 1 As shown, the method may include the following steps: S101: Divide the preset area into grids to obtain the bottom grid, and determine the bottom grid covered by each grid in multiple grids to obtain the coverage correspondence between grid number and grid number.
[0022] Each grid represents a business area, which is within a preset area. The bottom grids are numbered according to their position.
[0023] Specifically, the preset area is divided into grids to form a regular bottom grid. The size of the bottom grid can be set to be greater than twice the preset maximum error threshold, but smaller than the square root of the area of most grids. If the business area is small, the units of the horizontal and vertical coordinates can be converted to meters to simplify the calculation. This allows the bottom grid to effectively filter out meaningless small-range jitters, while not losing the outline features of the grid due to excessive size.
[0024] Each grid represents a business area. The business areas are within a preset area, and their location order can be from south to north or from north to south in longitude, or from east to west or from west to east in latitude.
[0025] For example, within the geographical area corresponding to the business area or the area covered by all grids (i.e., the business area range), the bottom-level grid is planned according to a preset maximum error threshold. The preset error threshold is 20 meters, and the preset area range includes the geographical area or the area covered by all grids. The current preset area range corresponds to a longitude range of 120.284 degrees to 121.938 degrees, with an interval D1 of 0.002 degrees, and a latitude range of 28.034 degrees to 29.342 degrees, with an interval D2 of 0.002 degrees. Based on the longitude range, latitude range, and interval, 540,858 bottom-level grids can be planned within the preset area range. The expression for calculating the number of bottom-level grids is: 827 * 654 = 540,858. 827 is obtained based on the longitude range and D1, representing the longitude division result within the preset area range, and 654 is obtained based on the latitude range and D2, representing the latitude division result within the preset area range.
[0026] Based on the number of bottom-level squares and the preset area range, the north-south side length of the bottom-level squares is approximately 2*π*R*0.002 / 360=222 meters, and the east-west side length is approximately 2*π*R*cos(29*π / 180)*0.002 / 360=195 meters. The side length of the bottom-level squares should ideally be greater than twice the general error limit and less than the square root of most grid areas. Here, 29*π / 180 represents the radian corresponding to the bottom-level square at a latitude of approximately 29 degrees, and R represents the Earth's radius.
[0027] Furthermore, if the current business area is smaller than the preset business area threshold, the units of the horizontal and vertical coordinates of the obtained bottom squares can be converted into meters (that is, the coordinates of the lower left corner of the preset area range are set to the origin (0,0) to simplify the calculation and complete the division. According to the preset area range and the location of the origin, the bottom squares are numbered f(m,n) from west to east and then from south to north, such as f(1,1), f(2,1), ..., f(827,1), f(1,2), ..., f(827,654). The four vertices of the bottom square f(m,n) can be denoted as d(m-1,n-1), d(m,n-1), d(m-1,n), d(m,n).
[0028] In addition, the mesh is preprocessed, including deleting and snapping to neighboring mesh vertices and deleting at least one of the overlapping meshes.
[0029] Deleting and snapping to neighboring vertices of a mesh can be done when the distance between two adjacent vertices of a mesh is less than a preset processing distance. This involves deleting one of the mesh vertices and updating its label. For example, if the distance between the (n+1)th vertex and the nth vertex is less than the preset processing distance, the (n+2)th vertex can be deleted and the (n+1)th vertex can be relabeled as the (n+1)th vertex, or the nth vertex can be deleted and the (n+1)th vertex can be relabeled as the nth vertex, and so on, updating the labels of subsequent vertices in sequence.
[0030] The preset processing distance can be set to half of the preset error threshold. For example, if the preset error threshold is 20 meters, the preset processing distance is 10 meters.
[0031] Deleting overlapping grids can exclude grids with fewer than 3 vertices, i.e., grids without orientation data, points, or line segments. This can be done by using a line segment intersection algorithm to exclude grids with their own line segments or overlapping grids. If the grid entry process has built-in grid compliance detection functions, this step can be skipped.
[0032] Furthermore, by determining the underlying squares covered by each grid in multiple grids, i.e., determining the underlying squares covered by each grid, a coverage correspondence between grid numbers and square numbers is formed. This allows complex polygons described by continuous coordinates to be converted into a discrete set of square numbers. The coverage correspondence is that a grid number can include multiple square numbers to clarify the multiple squares included in that grid. A square number can also correspond to multiple grid numbers because an underlying square may belong to different grids.
[0033] The embodiments of this application provide an accurate and easy-to-operate framework for grid boundary adjustment by dividing the grid into squares and establishing coverage correspondences, thereby improving the efficiency of grid adjustment. At the same time, adjusting the grid boundary according to the coverage correspondences ensures the accuracy and reliability of the adjustment process and reduces errors caused by manual intervention.
[0034] S102: Determine the grid number of the grid to be adjusted, obtain the target grid number corresponding to the grid to be adjusted based on the coverage correspondence, and determine the neighboring grids of the current grid to be adjusted based on the target grid number.
[0035] Specifically, the grid number of the grid to be adjusted is determined. Based on the grid number, the target grid number corresponding to the grid to be adjusted is determined from the established coverage correspondence. The neighboring grids of the current grid to be adjusted are determined through the target grid number. Then, the vertices of the grid to be adjusted are optimized and adjusted based on the neighboring grids. The neighboring grids are grids that are geographically adjacent to or overlap with the grid to be adjusted.
[0036] The process of determining neighboring grids involves expanding each target bottom-level square in the grid to be adjusted by a preset step size. For example, one of the current target bottom-level squares can be expanded into a 3*3 neighborhood (including itself and its eight adjacent directions). The expanded bottom-level squares are then used as a query list. Based on all the target bottom-level squares covered by the query list, a comparison is made in the coverage correspondence. When a bottom-level square covered by a certain grid appears in the query list, that grid is determined as a neighboring grid of the grid to be adjusted. This avoids the calculation of distance and intersection. Through one-time query list preprocessing and data retrieval, the batch and automatic identification of neighboring grids is achieved.
[0037] This application embodiment determines neighboring grids by covering correspondence and the grid to be adjusted. It only needs to determine neighboring grids for the grid to be adjusted, without having to determine the proximity relationship between all grids, which reduces the amount of computation. At the same time, by covering correspondence and setting the bottom grid, the neighboring grids of the grid to be adjusted can be quickly determined, realizing batch and automatic identification of neighboring grids and improving practicality.
[0038] S103: Optimize and adjust the vertices of the grid to be adjusted based on the relative positional relationship between the vertices to be adjusted and the neighboring vertices of the neighboring grids to obtain the adjusted grid, and update the coverage correspondence based on the adjusted grid.
[0039] Specifically, the vertices of the grid to be adjusted are optimized and adjusted based on the relative positional relationship between the vertices to be adjusted and the adjacent vertices of adjacent grids, resulting in an adjusted grid. This allows the adjusted grid to more accurately cover the business area, reduces overlap or gaps between grid boundaries, improves the overlap of grid boundaries, and enhances the reliability and accuracy of grid boundary adjustment.
[0040] In addition, after obtaining the adjusted grid, the coverage correspondence is updated according to the adjusted grid to ensure the accuracy of the coverage correspondence.
[0041] This application embodiment optimizes the adjustment of the mesh by optimizing the relative positional relationship between neighboring vertices and the vertices to be adjusted, thereby improving the overlap of mesh boundaries, reducing boundary overlaps or gaps, and improving the accuracy and effectiveness of mesh management. At the same time, updating the coverage correspondence based on the adjusted mesh can ensure the real-time performance and accuracy of the coverage correspondence.
[0042] This application's embodiments divide the bottom-layer grid and establish a corresponding coverage relationship, enabling rapid and intelligent identification of neighboring grids corresponding to the grid to be adjusted when dealing with a large amount of grid data. This improves the accuracy and efficiency of boundary adjustment, reduces the amount of computation in the process of optimizing grid boundaries, and improves the automation and reliability of adjustment. At the same time, by optimizing the position of the vertices to be adjusted, the overlap of grid boundaries is improved.
[0043] In some embodiments, determining the bottom-level squares covered by each grid in a plurality of grids to obtain the coverage correspondence between grid numbers and square numbers includes: For each grid, determine the intersection of each edge line of the grid with the bottom cell, and from the vertices and / or intersections of the grid, determine the common boundary vertices of the grid and the bottom cell. Starting from each common boundary vertex, draw a ray along at least one preset direction and determine the number of intersections between the ray and the edge line of the mesh. When the number of intersections is odd, the bottom-level squares where the common boundary points are located are added to the square number set of the corresponding bottom-level squares of the grid. Based on the square number set, duplicates are removed to obtain the coverage correspondence between grid numbers and square numbers.
[0044] Specifically, for each grid, the common boundary vertices of the grid and the bottom-level grid are determined by identifying each edge line of the grid and the vertices and / or intersections of the bottom-level grid, thereby capturing the boundary relationship between the grid and the bottom-level grid based on the common boundary vertices.
[0045] For example, consider the edge lines of the grid as line segments, determine the coordinates of the two vertices of each line segment, and determine the larger, smaller, larger, and smaller latitude values corresponding to each line segment based on the vertex coordinates. The vertex coordinates of a line segment can be denoted as (x...). i y i ), (x i+1 y i+1 By comparing the values, we find the larger longitude, smaller longitude, larger latitude, and smaller latitude of the two vertices, and denote them as x. sm x la y sm y la The portion that is divisible by the corresponding interval D1 or D2 (e.g., 0.002) is denoted as x. a x b y a y b , where x a ≤x sm x b ≤x la y a ≤y sm y b ≤y la .
[0046] Figure 2 This is a schematic diagram of the vertex coordinates of a line segment of a mesh provided in an embodiment of this application, as shown below. Figure 2As shown, AB represents the two vertices of an edge line of the grid. Based on the grid's latitude and longitude coordinates, the x-axis of line segment AB is... sm =121.0484, x la =121.0556, y sm =29.0729, y la =29.0775, x a =121.048, x b =121.054, y a =29.072, y b =29.076.
[0047] Figure 3 This is a schematic diagram of a common boundary vertex provided in an embodiment of this application, as shown below. Figure 3 As shown, d(121.006, 29.07), d(121.006, 29.072), d(121.006, 29.074), d(121.006, 29.076), and d(121.006, 29.078) are the common boundary vertices of the grid and the bottom layer grid.
[0048] For the line segment corresponding to this edge line, when x i =x i+1 =x a =x b When a line segment of the grid overlaps with a vertical line of the bottom-layer square, meaning there are infinitely many intersection points, the number of common boundary vertices of the grid and the squares is determined by the following formula: k j =(y b -y a ) / D2, where k j Used to represent the number of vertices sharing a common boundary.
[0049] Get k j Then, the common boundary vertices are determined in the following way: When the number of vertices on the common boundary exceeds a preset minimum threshold (i.e., k), j In the case of >0), the following point (x) i y a +0.002), (x i y a +0.004), ..., (x) i y a +0.002k j (Total k) j Each point is denoted as a common boundary vertex of the grid and the bottom layer squares; The current line segment's smaller latitude value coincides with a vertical line in the bottom square (i.e., y). sm =y aIn the case of ), point (x) i y a The vertex is determined as the common boundary vertex of the grid and the bottom layer grid.
[0050] The current line segment's larger latitude value coincides with a certain vertical line in the bottom square (i.e., y). la =y b In the case of ), point (x) i y b ) is denoted as the common boundary vertex of the grid and the bottom layer square.
[0051] Similarly, when y i =y i+1 =y a =y b In the case where a line segment of the grid overlaps with a horizontal line of the bottom-level square, meaning there are infinitely many intersection points, the number of common boundary vertices of the grid and the squares is determined by the following formula: k j = (x b -x a ) / D1, where k j Used to represent the number of vertices sharing a common boundary.
[0052] When the number of vertices on the common boundary exceeds a preset minimum threshold (i.e., k), i In the case of >0), the following point (x) a +0.002, y i ), (x a +0.004, y i ), ..., (x a +0.002k i y i (Total k) i Each point is denoted as a common boundary vertex of the grid and the bottom layer squares.
[0053] The current line segment's smaller longitude value coincides with a horizontal line in the bottom square (i.e., x). sm =x a In the case of ), point (x) a y i ) is denoted as the common boundary vertex of the grid and the bottom layer square.
[0054] The longitude of the current line segment coincides with a horizontal line in the bottom square (i.e., x). la =x b In the case of ), point (x) b y i ) is denoted as the common boundary vertex of the grid and the bottom layer square.
[0055] The line segments of the grid do not coincide with any horizontal or vertical line of the bottom grid (i.e., x). i=x i+1 =x a =x b This is not true, and y i =y i+1 =y a =y b In the case that (not true), determine the number of intersections between the line segment and the line segments of the bottom squares of the area covered by the grid, wherein the line segments of the bottom squares of the area covered by the grid include the north-south line segment consisting of the following two points [(x a y a ), (x a y b )]、[(x a +D1, y a ), (x a +D1, y b )], ..., [(x b y a ), (x b y b )] and east-west line segments [(x a y a ), (x b y a )]、[(x a y a +D2), (x b y a +D2)], ..., [(x) a y b ), (x b y b )].
[0056] If the number of intersections is greater than one, the intersection of the line segment on the grid and the bottom square is determined as (x). t y t ), calculate (x t -The minimum value of the horizontal coordinate of the business area) / the value of D1, and its integer part is determined as m. t The remainder is determined to be r. t .
[0057] Calculate (y) t -The minimum value of the vertical coordinate of the business area) / D2, and its integer part is determined as n. t The remainder is determined to be s. t .
[0058] When the intersection point is located on the vertical line of the bottom square (i.e., r) t =0, s t In the case of >0), the underlying grid that this grid may cover is represented as f(m). t nt ), f(m) t +1, n t ); When the intersection point is located on the horizontal line of the bottom square (i.e., r) t >0, s t When m = 0), the underlying grid that this grid may cover is represented as f(m) t n t ), f(m) t n t +1); When the intersection point is located at the vertex of the bottom square (i.e., r) t =0, s t When m = 0), the underlying grid that this grid may cover is represented as f(m) t n t ), f(m) t n t +1), f(m) t n t +1), f(m) t +1, n t +1).
[0059] Based on the intersection points of the line segment on the grid, determine all the bottom-level squares that the grid may cover. Retrieve the number of times the same bottom-level square appears repeatedly among the potentially covered bottom-level squares. If the bottom-level square f(m) i n i If the number of repetitions of a given element is 2, then the bottom square f(m) will be... i n i Add the grid to the edge coverage list, which includes the grid number and multiple corresponding grid numbers in both horizontal and vertical directions (m). i n i The bottom square f(m) represents the bottom square. i n i ).
[0060] Figure 4 This is a schematic diagram of an intersection point covering the bottom grid provided in an embodiment of this application, such as... Figure 4As shown, the intersection points of a line segment in the grid with the bottom layer squares include d(121.012, 29.0748), d(121.014, 29.0754), and d(121.016, 29.076). The coordinates of the bottom layer squares that it may cover are f(364, 522), f(365, 522), f(365, 522), f(366, 522), f(366, 522), f(367, 522), f(366, 523), and f(367, 523). Among them, f(365, 522) and f(366, 522) marked with dashed circles are repeated 2 times. Therefore, the bottom layer square corresponding to this coordinate is added to the edge coverage list of the grid.
[0061] Figure 5 This is a schematic diagram illustrating the relative positional relationship between a mesh and its neighboring meshes, as provided in an embodiment of this application. Figure 5 As shown, assume f(m) i n i ) is the cell number of the bottom layer cell covered by the edge of grid n+1. The cell number is f(m) i -1, n i -1), f(m) i -1, n i ), f(m) i -1, n i +1), f(m) i n i -1), f(m) i n i ), f(m) i n i +1), f(m) i +1, n i -1), f(m) i +1, n i ), f(m) i +1, n i +1) Add grid number n+1 to query the list of squares of the grid's neighboring grids.
[0062] Perform the above operations on all bottom-layer squares covered by the edges of grid n+1. After deduplication, obtain a list of all squares of neighboring grids based on grid n+1. For grids 1 to n, sequentially query the list of all squares of neighboring grids and the list of bottom-layer squares covered by the edges of grids 1 to n based on grid n+1, and determine whether there are any identical bottom-layer squares in the above lists. If there are, determine all neighboring grids of grid n+1 based on the identical bottom-layer squares. If there are no neighboring grids, jump to grid n+2 to determine the neighboring grids of the next grid.
[0063] like Figure 5As shown, f(353, 515) is the edge covering the underlying square of the (n + 1)-th grid, f(352, 515) is the square of the adjacent grid queried by the (n + 1)-th grid. At the same time, f(352, 515) is the edge covering the underlying square of the i-th (1 ≤ i < n + 1) grid. Therefore, the i-th grid is the adjacent grid of the (n + 1)-th grid.
[0064] In addition, a common boundary vertex may belong to two to four underlying squares simultaneously. To accurately determine the underlying square corresponding to the common boundary vertex, that is, to put the accurate underlying square corresponding to the common boundary vertex into the edge covering list to accurately determine the covering correspondence. Starting from each common boundary vertex, draw rays along at least one preset direction to determine the number of intersection points between the ray and the edge line of the grid, so that the underlying square covered by the grid can be judged by the number of intersection points between the ray and the edge line of the grid. Among them, the preset direction can be an inclined direction that is not perpendicular or parallel to the boundary of the underlying square. For example, 30 degrees south by west. The accuracy of the intersection point counting can be clarified according to critical situations such as the ray overlapping or being tangent to the common boundary vertex with the edge line of the grid.
[0065] Furthermore, when the number of intersection points is odd, it means that the underlying square is covered by the grid. Add this underlying square to the set of square numbers corresponding to the grid. By performing a duplicate removal operation on the set of square numbers, the covering correspondence between each grid number and the square number is obtained, thus providing a basis for grid boundary adjustment and ensuring the efficiency and accuracy of the boundary adjustment process.
[0066] In one embodiment, the common boundary vertex can be represented as d(m, n), the preset direction is 30 degrees south by west. Starting from each common boundary vertex, draw a ray 30 degrees south by west to determine the number of intersection points between the ray and the line segment corresponding to the edge line of the grid. Among them, the starting point of the ray is not included in the number of intersection points.
[0067] When the ray does not overlap with any line segment of the grid, that is, when the number of intersection points is not infinite, when the number of intersection points between the ray and the line segment corresponding to the edge line of the grid is odd (the starting point of the ray is not counted. If the intersection point is a vertex of the grid, that is, 1 tangent point counts as 2 intersection points), add the underlying square f(m, n) to the edge covering list of the grid. Among them, in the process of determining the number of intersection points, the number of intersection points between the ray and the grid can be any odd number less than the total number of vertices of the grid.
[0068] When the number of intersection points between the ray and the line segment corresponding to the edge line of the grid is even, add the underlying square where it is located to the edge covering list and determine the covering correspondence.
[0069] Figure 6This is a schematic diagram illustrating an embodiment of the present application where the number of intersections is odd. Figure 6 As shown, the coordinates of the common boundary vertex are (121.026, 29.076), and the grid number of the bottom layer grid is (371, 521). Starting from the grid number, four rays are drawn in the preset direction, and the four rays pass through the bottom layer grids f(371, 521), f(371, 522), f(372, 521), and f(372, 522) respectively. It can be seen that the number of intersections between the three rays and the grid is odd (1). The bottom layer grids f(371, 521), f(371, 522), and f(372, 522) are added to the edge coverage list of the grid, forming a coverage correspondence between the grid number and the grid number.
[0070] When a ray overlaps with a segment of the edge line of the grid, rays are drawn from the common boundary vertex at angles of 35 degrees, 40 degrees, and 45 degrees west and south, respectively. The odd or even number of intersections is determined, and then it is determined whether the square f(m, n) needs to be added to the edge coverage list of the grid to obtain the coverage correspondence.
[0071] In addition, following the above method, rays are drawn in other preset directions starting from the common boundary vertex. These other preset directions include, but are not limited to, east-southeast, west-northwest, and east-northeast, to determine whether the squares f(m+1,n), f(m,n+1), and f(m+1,n+1) need to be added to the edge coverage list of the grid, thus obtaining the coverage correspondence.
[0072] After traversing all common boundary vertices using the method described above, calculate the x-axis value of each vertex in the mesh. i y i The bottom cell containing (x) is assumed to be (x) i -120.284) / D1=M i , (y i -28.034) / D2=N i , of which M i The integer part is represented as m i N i The integer part is represented as n i .
[0073] In M i ≠m i And N i ≠n i In this case, determine the vertex (x) of the mesh. i y i In the bottom square f(m) i +1, n i +1) within, the bottom square f(m) i+1, n i +1) Add to the edge coverage list of this grid.
[0074] In M i =m i or N i =n i In this case, add the underlying cell containing it to the edge coverage list and determine the coverage correspondence.
[0075] Figure 7 This is a schematic diagram illustrating how the vertices of the edge lines of a mesh cover the underlying grid, as provided in an embodiment of this application. Figure 7 As shown, the coordinates of the three boundary vertices of the grid can be represented as d(121.037, 29.0705), d(121.045, 29.071), and d(121.043, 29.0785), respectively. Then, the three bottom-level squares where the boundary vertices are located are f(377, 519), f(381, 519), and f(380, 523). Add the above three bottom-level squares to the edge coverage list of the grid and determine their coverage correspondence with the grid.
[0076] Furthermore, repeat the above steps to iterate through the edge cover list corresponding to the bottom-level squares of all grid edges, establish a correspondence table, and obtain the cover correspondence. The correspondence table includes the grid number and multiple horizontal and vertical indexes (m) corresponding to that grid. i n i The bottom square f(m) represents the bottom square. i n i ).
[0077] This application embodiment determines the intersection of the grid edge line and the bottom square, and uses rays to determine the coverage of the bottom square by the grid, thereby determining the coverage correspondence between the grid number and the square number. This can accurately reflect the coverage correspondence of the grid's spatial extension range even when the grid has irregular shape and abnormal boundaries, improving the accuracy of grid management, reducing errors from manual intervention, and improving computational efficiency.
[0078] In some embodiments, optimizing the adjustment of the vertices of the mesh to be adjusted based on the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices of neighboring meshes includes: Based on the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices in the neighboring mesh, the vertices to be adjusted in the mesh to be adjusted are optimized and adjusted according to a preset optimization adjustment method. The preset optimization adjustment method includes at least one of the following: nearby vertex replacement method, nearby vertical point replacement method, nearby vertex addition method, and intersection point addition method. Among them, the near vertex replacement method is used to optimize the adjustment of the vertex to be adjusted based on the vertex to be adjusted and its neighboring vertices; The near-vertical point replacement method is used to optimize the adjustment of the vertex to be adjusted based on the first vertical point on the edge line of the adjacent mesh.
[0079] The newly added method for near-distance vertices is used to optimize the adjustment of vertices based on the second vertical point of the nearest vertex on the edge line of the mesh to be adjusted.
[0080] The new intersection point method is used to optimize the vertices to be adjusted based on the intersection points between the edge lines of the mesh to be adjusted and the adjacent meshes.
[0081] Specifically, the vertices to be adjusted are adjusted by the vertices, perpendiculars, and intersections of the neighboring vertices of the mesh to be adjusted. That is, according to the relative positional relationship between the vertices to be adjusted and the neighboring vertices, the vertices to be adjusted are adjusted by at least one of the following methods: replacing nearby vertices, replacing nearby perpendicular points, adding nearby vertices, and adding intersection points, in order to obtain the adjusted mesh.
[0082] Each of the preset adjustment methods is adapted to different geometric correction scenarios. Among them, the near vertex replacement method optimizes the vertex to be adjusted based on the vertex to be adjusted and its neighboring vertices. When the distance between the vertex to be adjusted and any of its neighboring vertices is less than a preset error threshold, the neighboring vertex can cover the vertex to be adjusted, thereby achieving the adjustment of the vertex to be adjusted.
[0083] The near-distance vertical point replacement method replaces the vertex to be adjusted with the perpendicular foot when the vertical distance between the vertex to be adjusted and the edge of the adjacent grid is less than the preset error threshold and the perpendicular foot falls inside the line segment. This keeps the direction of the edge of the grid to be adjusted unchanged, eliminates gaps between grids, and avoids pulling the vertex to be adjusted to the vertex of the adjacent grid, which would cause a sudden change in angle.
[0084] The method of adding nearby vertices involves inserting a new vertex on the edge line of the mesh to be adjusted. The insertion position is the foot of the perpendicular of one of the nearby vertices on that edge line, so that the nearby vertex becomes the vertex of the current mesh to be adjusted. This creates an outward, notch-like shape on the edge line of the mesh to be adjusted to accommodate the nearby vertex, thereby eliminating gaps between meshes.
[0085] The method of adding intersection points involves adding the intersection points to the vertex sequence of the mesh to be adjusted and the adjacent meshes, so that the mesh to be adjusted and the adjacent meshes have the same geometric description at the intersection position, thus avoiding secondary gaps caused by intersection point drift.
[0086] The first perpendicular point is the foot of the perpendicular line drawn from the vertex to be adjusted to the edge line of the adjacent grid. The second perpendicular point is the foot of the perpendicular line drawn from the adjacent vertex to the edge line of the grid to be adjusted. The intersection point is the geometric intersection point formed by the intersection of an edge line of the grid to be adjusted and an edge line of the adjacent grid in the same plane.
[0087] The embodiments of this application can adjust the vertices to be adjusted through preset adjustment methods. The preset adjustment methods include micro-level vertex coordinate correction and macro-level boundary shape reshaping, which comprehensively and controllably optimizes and adjusts the vertices to be adjusted. This ensures that the adjusted vertices meet the requirement of seamless overlap in geometric accuracy, avoids redundant vertices, and improves the accuracy of grid management and the efficiency of dynamic adjustment.
[0088] In some embodiments, the near vertex replacement method includes: Iterate through each vertex of the grid to be adjusted, find the nearest vertex in the neighboring grid whose distance to the vertex to be adjusted is less than the preset error threshold, replace the coordinates of the vertex to be adjusted with the coordinates of the nearest vertex, and determine the current nearest vertex as the overlapping vertex to obtain the initial optimized grid. The method of replacing near vertical points includes: filtering non-overlapping vertices to be adjusted, determining the first vertical point from the vertex to be adjusted to the edge line of the adjacent grid and the first vertical distance corresponding to the first vertical point, and if the first vertical distance is less than a preset error threshold, replacing the coordinates of the vertex to be adjusted with the coordinates of the first vertical point, marking the first vertical point as an overlapping vertex in the grid to be adjusted, and marking the first vertical point as a temporary vertex in the adjacent grid to obtain the adjusted grid; The method for adding nearby vertices includes: traversing all the nearby vertices of the adjacent grid, determining the second vertical point and the second vertical distance from the nearby vertex to each edge line of the grid to be adjusted, and if the second vertical distance is less than a preset error threshold, adding the nearby vertex as the initial optimized vertex of the grid to be adjusted, and marking the initial optimized vertex as an overlapping vertex, thus obtaining the adjusted grid; The method for adding intersection points includes: determining all intersection points between the mesh to be adjusted and the edge lines of all adjacent meshes, adding each intersection point as a vertex of the mesh to be adjusted and a temporary vertex on the edge line of the adjacent meshes, marking the intersection points as overlapping vertices, and obtaining the adjusted mesh.
[0089] Specifically, the close - range vertex replacement method includes: traversing each vertex to be adjusted in the mesh to be adjusted, searching for adjacent vertices in the adjacent mesh whose distance from the vertex to be adjusted is less than a preset error threshold, replacing the coordinates of the vertex to be adjusted with those of the adjacent vertex, and determining the current adjacent vertex as an overlapping vertex, thereby obtaining the adjusted mesh. Here, the overlapping vertex indicates that the mesh to be adjusted and the adjacent mesh at this position have achieved geometric coincidence. During the process of searching for adjacent vertices, a virtual circular area centered at the coordinates of the vertex to be adjusted with a radius equal to the preset error threshold can be used to search for adjacent vertices.
[0090] For example, find the coordinates of each vertex to be adjusted in the mesh to be adjusted, denoted as (x i , y i ). In the adjacent mesh, determine the adjacent vertex with the shortest distance to the vertex to be adjusted, and denote the adjacent vertex as (x j , y j ). Here, the preset error threshold can be set to 20 meters, denoted as w. If there are multiple adjacent vertices, randomly select one from them.
[0091] In the case where there is an adjacent vertex (x j , y j ), replace the vertex to be adjusted with (x j , y j ). Generally speaking, traverse each adjacent vertex on the adjacent mesh, and determine |x j - x i | + |y j - y i | = t, where t represents the distance between the vertex to be adjusted and the adjacent vertex. When t < w, the distance between the vertex to be adjusted and the adjacent vertex can be calculated using the Haversine formula (used to describe spherical geometry calculations). If there is no adjacent vertex whose distance from the vertex to be adjusted is less than the preset error threshold, then do not adjust this vertex to be adjusted.
[0092] Figure 8 is a schematic diagram of the mesh to be adjusted and the adjacent mesh before the close - range vertex replacement provided by an embodiment of the present application. Figure 9 is a schematic diagram of the mesh to be adjusted and the adjacent mesh after the close - range vertex replacement provided by an embodiment of the present application. As Figure 8 shown, P4 and P5 are vertices to be adjusted, Q1 and Q2 are adjacent vertices. The distance between P4 and Q2 is less than the preset error threshold, and the distance between P5 and Q1 is less than the preset error threshold. Replace the coordinates of the vertices to be adjusted P4 and P5 with the coordinates of Q2 and Q1 respectively, complete the adjustment of the vertices to be adjusted, and obtain the adjusted mesh. The adjusted mesh is as shown in Figure 9 .
[0093] The near-distance vertical point replacement method can be performed when there are no adjacent vertices around the vertex to be adjusted. It filters out the remaining vertices to be adjusted that are not overlapping vertices, determines the first vertical point and the corresponding first vertical distance from the vertex to be adjusted to each edge line of the adjacent grid. The first vertical point is essentially the theoretical closest point of the vertex to be adjusted on the edge line of the adjacent grid. If the first vertical distance is less than a preset error threshold, the coordinates of the vertex to be adjusted are replaced with the coordinates of the first vertical point, and the first vertical point is marked as an overlapping vertex in the grid to be adjusted. The first vertical point is regarded as a temporary vertex of the adjacent grid, resulting in the adjusted grid.
[0094] For example, using the vertex to be adjusted on the grid to be adjusted as the center, construct a temporary bottom-level grid consisting of 4 line segments, where the vertex to be adjusted can be denoted as P. i (x) i y i The four vertices of the temporary bottom-level grid can be represented as: (x i -D1, y i -D2), (x i +D1, y i -D2), (x i +D1, y i +D2), (x i -D1, y i +D2).
[0095] The line segment intersection algorithm is used to identify all segments on neighboring grids that intersect with the above four line segments, and these segments are denoted as L. j , remember L j The quantity is k.
[0096] When k=0, skip the current vertex to be adjusted and proceed to the optimization adjustment of the next vertex to be adjusted.
[0097] When k > 0, determine P. i To L j The perpendicular point of the line segment extending in both directions is not on line segment L. j Up, skip the current intersecting line segment and proceed to the calculation of the next intersecting line segment. When the perpendicular point O... j On segment L j In the case above, this vertical point is determined as the first vertical point, and the first vertical distance corresponding to the first vertical point is determined and denoted as d. j In the case of multiple first vertical points, the vertical point corresponding to the smallest first vertical distance is determined as the first vertical point.
[0098] In d jIn the case of >w, skip the current vertex to be adjusted and proceed to the optimization adjustment of the next non-adjustable vertex. In d j In the case of ≤w, P i Replace the coordinates with d j The coordinates of P, and P i Let O be the overlapping vertex of the mesh to be adjusted. j Add a temporary vertex to the adjacent grid and perform calculations on the next vertex to be adjusted.
[0099] Figure 10 This is a schematic diagram of the grid to be adjusted and adjacent grids before a near-vertical point replacement, provided in an embodiment of this application. Figure 11 This is a schematic diagram of the grid to be adjusted and adjacent grids after a near-vertical point replacement, provided in an embodiment of this application. For example... Figure 10 As shown, P1, P2, P3, and P4 are vertices to be adjusted, and Q1, Q2, Q3, and Q4 are neighboring vertices. The first vertical distance from P4 to an edge line of a neighboring grid is 12.1m (not exceeding 20 meters, i.e., less than the preset error threshold). The first vertical point is O4 (O4 is located on the edge line of the neighboring grid). Replacing the coordinates of the vertex to be adjusted P4 with the coordinates of the first vertical point O4 yields the adjusted grid, as shown below. Figure 11 As shown.
[0100] The method of adding nearby vertices involves traversing the nearby vertices of the adjacent grid and determining the second perpendicular point and the corresponding second perpendicular distance between the adjacent vertex and each edge line of the grid to be adjusted. This determines whether the distance between each adjacent vertex and a certain edge line of the grid to be adjusted is less than a preset error threshold. If so, the adjacent vertex is added as the initial optimized vertex of the grid to be adjusted and marked as an overlapping vertex to obtain the adjusted grid. Otherwise, the current vertex to be adjusted is skipped, and the next vertex to be adjusted is optimized.
[0101] For example, let L be the edge line of the grid to be adjusted. i Iterate through the neighboring vertices of the adjacent grid and denote the neighboring vertex as Q. j Determine Q j To L i The perpendicular point of the line segment extending in both directions, when the perpendicular point is not on line segment L. i The upper part may be line segment L i The endpoint is skipped, and the next vertex to be adjusted is optimized.
[0102] When vertical point O i On segment L i Above, we determine this as the second vertical point, and then determine the second vertical distance d corresponding to this second vertical point. i When d iIf the error threshold is greater than w (preset error threshold), skip the optimization adjustment of the current vertex to be adjusted and perform optimization adjustment on the next vertex to be adjusted. In d i In the case of ≤w, Q j The newly added overlapping vertices of the mesh to be adjusted (the second vertical point is located on line segment L) i Between the two endpoints), optimize and adjust the next vertex to be adjusted until all vertices to be processed have been calculated.
[0103] Figure 12 This is a schematic diagram of the mesh to be adjusted and the neighboring meshes before adding nearby vertices, provided in an embodiment of this application. Figure 13 This is a schematic diagram of the mesh to be adjusted and neighboring meshes after adding nearby vertices, as provided in an embodiment of this application. Figure 12 As shown, P1, P2, P3, and P4 are vertices to be adjusted, Q1, Q2, Q3, and Q4 are neighboring vertices, R2 is the second perpendicular point, and O2 is the initial optimized vertex. The second perpendicular distance from a neighboring vertex Q2 of a neighboring mesh to a line segment of the mesh to be adjusted is 15.2m (not exceeding the preset error threshold). The second perpendicular point is denoted as O2 (it is located on that line segment of the mesh to be adjusted). Q2 is added as the initial optimized vertex of the mesh to be adjusted. The optimization adjustment of the vertices to be adjusted is now complete, as shown below. Figure 13 The adjusted grid is shown.
[0104] The method for adding intersection points involves using set computation to find the intersection points between the edge lines of the mesh to be adjusted and all neighboring meshes. For each intersection point, it is inserted into the line segment sequence of the edge line of the mesh to be adjusted to divide the edge line segment into two segments. At the same time, it is inserted into the line segment sequence of the edge lines of neighboring meshes. In the mesh to be adjusted, the newly added intersection point is marked as an overlapping vertex, and in the neighboring meshes, the newly added intersection point is marked as a temporary vertex, so that the intersection point becomes a shared inflection point, avoiding the situation where the intersection point drifts and creates gaps during the mesh optimization and adjustment process.
[0105] For example, let L be the edge line of the grid to be adjusted. i The intersection point R between the edge lines of the mesh to be adjusted and all adjacent meshes is determined by the line segment intersection algorithm. j The overlapping parts of the line segments are not counted, that is, for each L... j There can be at most one intersection point. Let R... j Mark temporary vertices as adjacent meshes, and set R j The overlapping vertices of the mesh to be adjusted are marked until all vertices to be processed are processed, resulting in the adjusted mesh.
[0106] Figure 14 This is a schematic diagram illustrating a method for adding intersection points according to an embodiment of this application, as shown below. Figure 14 As shown, P1, P2, P3, and P4 are vertices to be adjusted, and Q1, Q2, Q3, and Q4 are neighboring vertices. The distance from the vertex P3 of the grid to be adjusted to the perpendicular point O3 of a line segment of an edge line of a neighboring grid is 35.6m (greater than the preset error threshold). The intersection point R of these two points is... 2.5 Add new vertices to the mesh to be adjusted and mark them as overlapping vertices, then set R... 2.5 Mark as a temporary vertex of the adjacent grid.
[0107] The near-distance replacement method in this application realizes the alignment of points between the mesh to be adjusted and the adjacent meshes; the near-distance perpendicular point replacement method realizes the snapping of points to lines; the near-distance vertex addition method realizes the adaptation of lines to points; and the intersection point addition method resolves the conflict between lines. This enables a multi-mode, hierarchical collaborative working mode. Vertices are moved or inserted only where necessary, resulting in low data modification and reduced computational load. This allows the boundary of the mesh to be processed to be closed, and overlapping vertices can be directly reused in the next round of optimization and adjustment without the need for a new global search, thus improving the efficiency of optimization and adjustment.
[0108] In some embodiments, after optimizing the vertices of the mesh to be adjusted according to a preset optimization adjustment method, the method further includes: Traverse the temporary vertices of adjacent grid cells; If a temporary vertex has the same coordinates as any overlapping vertex in the mesh to be adjusted, delete the temporary vertex.
[0109] Specifically, the neighboring mesh contains many temporary vertices. Although these temporary vertices are on the edge lines of the neighboring mesh and act as temporary anchor points or connection points in the geometric alignment process, too many temporary vertices will occupy a lot of memory and computational resources. Traversing the temporary vertices of the neighboring mesh, if the coordinates of the temporary vertex are the same as the coordinates of the overlapping vertex, it means that the geometric position represented by the temporary vertex has been optimized by the mesh to be adjusted, forming an overlapping vertex that is recognized and stable by both the adjusted mesh and the neighboring mesh. Temporary vertices that meet the above conditions are deleted to restore the simplicity of the edge lines of the neighboring mesh.
[0110] For example, Figure 15 This is a schematic diagram illustrating the deletion of a temporary vertex according to an embodiment of this application, as shown below. Figure 15 As shown, P1, P2, P3, and P4 are vertices to be adjusted, Q1, Q2, Q3, and Q4 are neighboring vertices, and R... 2.5 These are newly added vertices in the mesh to be adjusted, and the overlapping vertex group R on the mesh to be adjusted. 2.5 The coordinate set between P4 and R 2.5 Replace P3 and P4 with R 2.5, P4, can be replaced under the condition that |S1 - S0| < L1 * w, where S1 represents the area of the to - be - adjusted grid before replacement, S0 represents the area of the to - be - adjusted grid after replacement, L1 represents the length of the edge line, and near the grid, delete the temporary vertex R 2.5 .
[0111] The embodiments of the present application can clean up the temporary vertices generated during the optimization adjustment process, avoid the situation where temporary vertices occupy memory resources and computing resources, maintain the simplicity of the internal data structure, so as to keep the computing amount low during the process of optimizing and adjusting the to - be - adjusted grid again.
[0112] In some embodiments, after optimizing and adjusting the to - be - adjusted vertices of the to - be - adjusted grid based on the relative position relationship between the to - be - adjusted vertices of the to - be - adjusted grid and the adjacent vertices of the adjacent grid, it further includes: For each to - be - adjusted grid, identify the overlapping vertices with the same coordinates of the to - be - adjusted vertices and the adjacent vertices; Based on the connection order of the to - be - adjusted vertices, determine every two adjacent overlapping vertices on the connection sequence corresponding to the to - be - adjusted vertices as a replacement judgment group; For each replacement judgment group, perform a replacement operation based on the overlapping vertices, where the replacement operation means replacing the first vertex sequence on the to - be - adjusted grid between the two overlapping vertices of the replacement judgment group with the second vertex sequence on the adjacent grid between the two overlapping vertices, and the vertex connection directions of the first vertex sequence and the second vertex sequence are opposite.
[0113] Specifically, for each to - be - adjusted grid, identify the overlapping vertices with the same coordinates of the to - be - adjusted vertices and the adjacent vertices. The overlapping vertices indicate that the to - be - adjusted grid and the adjacent grid have reached a geometric consensus in the local position.
[0114] In addition, according to the connection order of the to - be - adjusted vertices, obtain the connection sequence, organize the relatively isolated overlapping vertices, that is, pair every two adjacent overlapping vertices in the connection sequence to form a replacement judgment group. For example, if there are four overlapping vertices P1, P2, P3, P4 (described in the order of the connection sequence) on an edge line, four replacement judgment groups (P1, P2), (P2, P3), (P3, P4), (P4, P1) can be formed to perform independent optimization adjustments according to each replacement judgment group.
[0115] In addition, replace the entire first vertex sequence on the to - be - adjusted grid between the two overlapping vertices of the replacement judgment group with the second vertex sequence on the adjacent grid between the same two overlapping vertices, where the vertex connection directions of the first vertex sequence and the second vertex sequence are opposite.
[0116] For example, if the connection order of the grid to be adjusted is counterclockwise, the corresponding connection order taken from the neighboring grid is clockwise; conversely, if the connection order of the grid to be adjusted is clockwise, the corresponding connection sequence taken from the neighboring grid is counterclockwise.
[0117] For example, find the overlapping vertices of each neighboring grid and the grid to be adjusted, and record the number of overlapping vertices as k.
[0118] When k ≤ 1, find the next neighboring grid. When k > 1, record the overlapping vertices as P1, P2, ..., P according to the coordinate order of the grids to be adjusted (e.g., counterclockwise). k Two adjacent overlapping vertices are divided into 1 group, which is called the replacement judgment group. There are a total of k groups (because a single business area is closed).
[0119] When P1 and P2 are in the same neighboring grid, the area of the grid to be adjusted is determined as S0. The set of vertex coordinates between P1 and P2 on the grid to be adjusted (e.g., counterclockwise) is compared with the set of vertex coordinates between P1 and P2 on the neighboring grid (clockwise). If the coordinate directions of the system source data are inconsistent, it is recommended to use relevant formulas, vector cross product formulas, etc. to uniformly convert them to the counterclockwise direction. Otherwise, multiple operations need to be performed in both clockwise and counterclockwise directions.
[0120] Figure 16 This is a schematic diagram of a vertex before replacement provided in an embodiment of this application, based on the determination of the replacement group. Figure 17 This is a schematic diagram of vertices after replacement by judging the replacement group, as provided in an embodiment of this application. Figure 16 As shown, P1, P2, P3, and P4 are vertices to be adjusted, and Q1, Q2, Q3, and Q4 are neighboring vertices. P1 and P2 are overlapping vertices of the mesh to be adjusted and a neighboring mesh. P1 and Q4, and P2 and Q2 have the same coordinates. P1 and P2 are arranged counter-clockwise relative to the mesh to be adjusted. There are two sets of vertices in the corresponding neighboring meshes: Q4, Q3, Q2 (the connection order of neighboring meshes is clockwise), and Q4, Q5, Q1, Q2 (the connection order of neighboring meshes is counter-clockwise). The vertices in the vertex sets P1 and P2 (counter-clockwise) are replaced using a replacement judgment group, needing to be replaced with Q4, Q3, Q2 (clockwise). The resulting new vertex connection sequence for the mesh to be adjusted is Q4, Q3, Q2, P3, P4, as shown below. Figure 17 As shown.
[0121] Similarly, P2 and P1 (clockwise) can be replaced with Q2, Q3, and Q4 (counterclockwise), or P1 and P2 (counterclockwise) can be replaced with Q4, Q5, Q1, and Q2 (counterclockwise). Then the new vertex connection sequence of the mesh to be adjusted will be Q4, Q5, Q1, Q2, P3, and P4, which can cover the adjacent meshes.
[0122] If the coordinate sets obtained by different connection orders are consistent, that is, there are no intermediate vertices, P1 and P2 on the mesh to be adjusted are recorded as fixed overlapping vertices.
[0123] When the coordinate sets obtained by different connection orders are inconsistent, P1, P2 and all new vertices (counterclockwise) on the mesh to be adjusted are recorded as fixed overlapping vertices.
[0124] The embodiments of this application can identify overlapping vertices and then perform replacement of the connection sequence with controllable direction, which can automatically align the boundary direction, eliminate potential problems such as gaps and misalignments, eliminate false overlap, and facilitate dynamic adjustment of the existing mesh again during the process of optimizing and adjusting the mesh to be adjusted.
[0125] In some embodiments, performing a replacement operation based on overlapping vertices includes: Determine the area change of the mesh to be adjusted corresponding to the replacement operation, and determine the edge length of the edge line of the overlapping vertex of the current replacement judgment group on the mesh to be adjusted; The product of the edge length and the preset error threshold is determined as the replacement execution threshold. If the absolute value of the area change is less than the replacement execution threshold, the replacement operation is performed based on the overlapping vertices.
[0126] Specifically, the first area of the current mesh to be adjusted and the second area of the mesh to be adjusted obtained after the replacement operation are determined. The difference between the first area and the second area is determined as the area change. At the same time, the edge length of the edge line of the overlapping vertex of the current replacement judgment group on the mesh to be adjusted is determined.
[0127] The replacement execution threshold is determined based on the product of the edge length and the preset error threshold. If the absolute value of the area change is less than the replacement execution threshold, the replacement operation is performed. If the absolute value of the area change is not less than the replacement execution threshold, the replacement operation is not performed, in order to avoid distortion caused by optimizing the mesh to be adjusted.
[0128] The geometric meaning of the replacement execution threshold is to define the area of a virtual rectangular region with the original boundary line as the length and the preset error threshold as the width, representing an acceptable and reasonable range of area variation for a specific edge line.
[0129] For example, P1, P2, P3, and P4 are vertices to be adjusted, Q1, Q2, Q3, and Q4 are adjacent vertices, P1 and P2 are overlapping vertices of the mesh to be adjusted and a certain adjacent mesh. Determine the sum of the line segment lengths between P1 and P2 on the mesh to be adjusted, and denote it as L1. Determine the area of the mesh to be adjusted as S0. Temporarily replace the vertex coordinate set (in counterclockwise direction) between P1 and P2 on the mesh to be adjusted with the vertex coordinate set (in clockwise direction) between P1 and P2 on the adjacent mesh to generate a new temporary mesh, and determine the area of the new temporary mesh as S1.
[0130] In the case where |S1 - S0| ≥ L1 * w, delete the temporary mesh. In the case where |S1 - S0| < L1 * w, replace the vertex coordinate set (in counterclockwise direction) between P1 and P2 on the mesh to be adjusted with the vertex coordinate set (in clockwise direction) between P1 and P2 on the adjacent mesh, and delete the temporary mesh. It can be seen that the size of S0 becomes S1, where w represents a preset error threshold.
[0131] Figure 18 is a schematic diagram of not performing a replacement operation provided by an embodiment of the present application. As Figure 18 shown, P1, P2, P3, and P4 are vertices to be adjusted, Q1, Q2, Q3, and Q4 are adjacent vertices, P1 and P2 are overlapping vertices of the mesh to be adjusted and a certain adjacent mesh. If the area of the polygon formed by vertices P1, Q3, Q2, and P2 ≥ L * w, then do not perform the replacement operation.
[0132] In addition, in the case where P1 and P2 are not in the same adjacent mesh, skip the replacement operation of this replacement judgment group.
[0133] The embodiment of the present application controls the area change amount within an acceptable range, ensures the stability of the replacement operation, and prevents the situation of mesh deformation after adjustment.
[0134] In some embodiments, after updating the coverage correspondence based on the adjusted mesh, it further includes: Adding the mesh number corresponding to the adjusted mesh to the set of optimized meshes, obtaining the mesh number of the next mesh to be adjusted according to the number sequence of the mesh numbers, and determining the adjacent mesh of the next mesh to be adjusted based on the target grid number and the set of optimized meshes; Repeatedly execute the steps of optimizing and adjusting the vertices to be adjusted of the mesh to be adjusted based on the relative position relationship between the vertices to be adjusted of the mesh to be adjusted and the adjacent vertices of the adjacent mesh, obtaining the adjusted mesh, and updating the coverage correspondence based on the adjusted mesh until there is no mesh to be adjusted.
[0135] Specifically, the adjusted grid number is added to the optimized grid set, which represents all processed grids with stable geometry. The next grid to be adjusted is retrieved from the processing queue according to its grid number order. This numbering order can be determined based on the grid's creation time, spatial location, or other business logic.
[0136] The neighboring grids of the next grid to be adjusted are determined based on the target grid number and the optimized grid set. It is not necessary to traverse the entire domain; the neighboring grids of the next grid to be adjusted can be determined simply by using the grid number in the optimized grid set.
[0137] For the next mesh to be adjusted, repeat the steps of optimizing and adjusting the vertices of the mesh to be adjusted based on the relative positional relationship between the vertices to be adjusted of the mesh to be adjusted and the adjacent vertices of the adjacent meshes to obtain the adjusted mesh, and update the corresponding relationship based on the adjusted mesh, until there are no more meshes to be adjusted.
[0138] The update step provides an accurate and timely data foundation for the next grid to be adjusted, and at the same time determines the accuracy of neighboring grids. It avoids using unoptimized grids as the benchmark for the next grid to be adjusted, thus ensuring the overall quality of the optimization adjustment.
[0139] This application embodiment optimizes and adjusts the next mesh to be adjusted by optimizing the already optimized mesh set, so that the mesh boundary adjustment can be carried out automatically, and an optimized adjustment result with all mesh boundaries highly overlapping, consistent internal and external topological relationships and a relatively clean data structure is obtained, avoiding the errors caused by manual comparison and adjustment one by one.
[0140] Figure 19 This is a schematic diagram of a device structure provided in an embodiment of this application. Figure 19 As shown, the device may include a coverage module 1910, a processing module 1920, and an adjustment module 1930.
[0141] The coverage module 1910 is used to divide the preset area into grids to obtain the bottom grid, and to determine the bottom grid covered by each grid in multiple grids, and to obtain the coverage correspondence between grid number and grid number. Each grid is used to represent a business area. The business area is within the preset area, and the bottom grids are numbered according to the position order. The processing module 1920 is used to determine the grid number of the grid to be adjusted, obtain the target grid number corresponding to the grid to be adjusted based on the coverage correspondence, and determine the neighboring grids of the current grid to be adjusted based on the target grid number; The adjustment module 1930 is used to optimize and adjust the vertices of the mesh to be adjusted based on the relative positional relationship between the vertices to be adjusted of the mesh to be adjusted and the neighboring vertices of the neighboring meshes, to obtain the adjusted mesh, and to update the coverage correspondence based on the adjusted mesh.
[0142] In some embodiments, the overlay module 1910 determines the bottom-layer squares covered by each grid in a plurality of grids, obtaining the overlay correspondence between grid numbers and square numbers, for use in: For each grid, determine the intersection of each edge line of the grid with the bottom cell, and from the vertices and / or intersections of the grid, determine the common boundary vertices of the grid and the bottom cell. Starting from each common boundary vertex, draw a ray along at least one preset direction and determine the number of intersections between the ray and the edge line of the mesh. When the number of intersections is odd, the bottom-level squares where the common boundary points are located are added to the square number set of the corresponding bottom-level squares of the grid. Based on the square number set, duplicates are removed to obtain the coverage correspondence between grid numbers and square numbers.
[0143] In some embodiments, the processing module 1920 optimizes the adjustment of the vertices of the mesh to be adjusted based on the relative positional relationship between the vertices to be adjusted of the mesh to be adjusted and the neighboring vertices of neighboring meshes, for the following purposes: Based on the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices in the neighboring mesh, the vertices to be adjusted in the mesh to be adjusted are optimized and adjusted according to a preset optimization adjustment method. The preset optimization adjustment method includes at least one of the following: nearby vertex replacement method, nearby vertical point replacement method, nearby vertex addition method, and intersection point addition method. Among them, the near vertex replacement method is used to optimize the adjustment of the vertex to be adjusted based on the vertex to be adjusted and its neighboring vertices; The near-vertical point replacement method is used to optimize the adjustment of the vertex to be adjusted based on the first vertical point of the vertex on the edge line of the nearest mesh. The newly added method for adding nearby vertices is used to optimize the adjustment of vertices based on the second vertical point of the nearest vertex on the edge line of the mesh to be adjusted. The new intersection point method is used to optimize the vertices to be adjusted based on the intersection points between the edge lines of the mesh to be adjusted and the adjacent meshes.
[0144] In some embodiments, the processing module 1920 is configured to: use the near vertex replacement method for: Iterate through each vertex of the grid to be adjusted, find the nearest vertex in the neighboring grid whose distance to the vertex to be adjusted is less than the preset error threshold, replace the coordinates of the vertex to be adjusted with the coordinates of the nearest vertex, and determine the current nearest vertex as the overlapping vertex to obtain the adjusted grid. The near-distance vertical point replacement method is used to: filter non-overlapping vertices to be adjusted, determine the first vertical point from the vertex to be adjusted to the edge line of the adjacent grid and the first vertical distance corresponding to the first vertical point. If the first vertical distance is less than a preset error threshold, replace the coordinates of the vertex to be adjusted with the coordinates of the first vertical point, mark the first vertical point as an overlapping vertex in the grid to be adjusted, and mark the first vertical point as a temporary vertex in the adjacent grid to obtain the adjusted grid. The method of adding nearby vertices is used to: traverse all the nearby vertices of the adjacent grid, determine the second vertical point and the second vertical distance from the nearby vertex to each edge line of the grid to be adjusted, and if the second vertical distance is less than the preset error threshold, add the nearby vertex as the initial optimized vertex of the grid to be adjusted, and mark the initial optimized vertex as an overlapping vertex to obtain the adjusted grid. The method of adding intersection points is used to: determine all intersection points between the edge lines of the mesh to be adjusted and all adjacent meshes, add each intersection point as a vertex of the mesh to be adjusted and a temporary vertex on the edge line of the adjacent meshes, mark the intersection points as overlapping vertices, and obtain the adjusted mesh; In some embodiments, after optimizing and adjusting the vertices of the mesh to be adjusted according to a preset optimization and adjustment method, the processing module 1920 is further configured to: Traverse the temporary vertices of adjacent grid cells; If a temporary vertex has the same coordinates as any overlapping vertex in the mesh to be adjusted, delete the temporary vertex.
[0145] In some embodiments, after optimizing the adjustment of the vertices to be adjusted in the mesh based on the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices in neighboring meshes, the adjustment module 1930 is further configured to: For each grid cell to be adjusted, identify overlapping vertices whose coordinates are the same as those of the vertices to be adjusted and their neighboring vertices; Based on the connection order of the vertices to be adjusted, each pair of adjacent overlapping vertices in the connection sequence corresponding to the vertex to be adjusted is determined as a replacement judgment group. For each replacement judgment group, a replacement operation is performed based on overlapping vertices. The replacement operation means replacing the first vertex sequence on the mesh to be adjusted, which is located between two overlapping vertices in the replacement judgment group, with the second vertex sequence on the adjacent mesh, which is located between two overlapping vertices. The vertex connection directions of the first vertex sequence and the second vertex sequence are opposite.
[0146] In some embodiments, the adjustment module 1930 performs a replacement operation based on overlapping vertices, for the purpose of: Determine the area change of the mesh to be adjusted corresponding to the replacement operation, and determine the edge length of the edge line of the overlapping vertex of the current replacement judgment group on the mesh to be adjusted; The product of the edge length and the preset error threshold is determined as the replacement execution threshold. If the absolute value of the area change is less than the replacement execution threshold, the replacement operation is performed based on the overlapping vertices.
[0147] In some embodiments, after updating the coverage correspondence based on the adjusted mesh, the adjustment module 1930 is further configured to: Add the grid number corresponding to the adjusted grid to the optimized grid set. Obtain the grid number of the next grid to be adjusted according to the grid number order. Determine the neighboring grids of the next grid to be adjusted based on the target grid number and the optimized grid set. Repeat the steps of optimizing the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices of the neighboring mesh to obtain the adjusted mesh, and updating the coverage correspondence based on the adjusted mesh, until there are no more meshes to be adjusted.
[0148] Figure 20 A schematic diagram of the hardware structure of the terminal device provided in an embodiment of this application is shown.
[0149] The terminal device may include a processor 2001 and a memory 2002 storing computer program instructions.
[0150] Specifically, the processor 2001 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0151] Memory 2002 may include mass storage for data or instructions. For example, and not limitingly, memory 2002 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one instance, memory 2002 may include removable or non-removable (or fixed) media, or memory 2002 may be non-volatile solid-state memory. Memory 2002 may be internal or external to the integrated gateway disaster recovery device.
[0152] In one instance, memory 2002 may be read-only memory (ROM). In one instance, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0153] The memory 2002 may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, generally, a memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of this disclosure.
[0154] Processor 2001 reads and executes computer program instructions stored in memory 2002 to achieve... Figure 20 The mesh boundary adjustment method in the illustrated embodiment.
[0155] In one example, the terminal device may also include a communication interface 2003 and a bus 2004. For example, Figure 20 As shown, the processor 2001, memory 2002, and communication interface 2003 are connected through bus 2004 and complete communication with each other.
[0156] The communication interface 2003 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0157] Bus 2004 includes hardware, software, or both, that couples components of an online data flow metering device together. For example, and not as a limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 2004 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.
[0158] The terminal device can execute the online data traffic billing method in this application embodiment based on the currently blocked spam text messages and text messages reported by users, thereby realizing the grid boundary adjustment method.
[0159] Furthermore, in conjunction with the mesh boundary adjustment methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the mesh boundary adjustment methods in the above embodiments.
[0160] This application also provides a computer program product, including a computer program, which, when executed, implements any of the mesh boundary adjustment methods described in the above embodiments.
[0161] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0162] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0163] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0164] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0165] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for adjusting mesh boundaries, characterized in that, include: The preset area is divided into grids to obtain the bottom grid. The bottom grids covered by each grid are determined to obtain the coverage correspondence between grid number and grid number. Each grid is used to represent a business area within the preset area. The bottom grids are numbered according to their position order. Determine the grid number of the grid to be adjusted, obtain the target grid number corresponding to the grid to be adjusted based on the coverage correspondence, and determine the neighboring grids of the current grid to be adjusted based on the target grid number; The vertices to be adjusted in the mesh to be adjusted are optimized and adjusted based on the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices in the neighboring meshes, so as to obtain the adjusted mesh, and the coverage correspondence is updated based on the adjusted mesh.
2. The method according to claim 1, characterized in that, The step of determining the bottom-layer squares covered by each of the multiple grids to obtain the coverage correspondence between grid numbers and square numbers includes: For each grid, determine the intersection point of each edge line of the grid and the bottom layer grid, and from the vertices of the grid and / or the intersection points, determine the common boundary vertices of the grid and the bottom layer grid; Starting from each of the common boundary vertices, a ray is drawn along at least one preset direction to determine the number of intersections between the ray and the edge line of the mesh; When the number of intersection points is odd, the bottom-level squares where the common boundary points are located are added to the square number set of the bottom-level squares corresponding to the grid. Based on the square number set, duplicates are removed to obtain the coverage correspondence between grid numbers and square numbers.
3. The method according to claim 1, characterized in that, The optimization and adjustment of the vertices to be adjusted in the mesh based on the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices of the neighboring meshes includes: Based on the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices in the neighboring mesh, the vertices to be adjusted in the mesh to be adjusted are optimized and adjusted according to a preset optimization adjustment method, wherein the preset optimization adjustment method includes at least one of the following: nearby vertex replacement method, nearby vertical point replacement method, nearby vertex addition method, and intersection point addition method. The near vertex replacement method is used to optimize and adjust the vertex to be adjusted based on the vertex to be adjusted and the neighboring vertices; The near-distance vertical point replacement method is used to optimize and adjust the vertex to be adjusted based on the first vertical point on the edge line of the adjacent grid. The method of adding nearby vertices is used to optimize the adjustment of the vertex to be adjusted based on the second vertical point of the neighboring vertex on the edge line of the grid to be adjusted. The newly added intersection point method is used to optimize the vertex to be adjusted based on the intersection point between the edge lines of the mesh to be adjusted and the adjacent meshes.
4. The method according to claim 3, characterized in that, The near-distance vertex replacement method includes: Traverse each vertex of the grid to be adjusted, find the neighboring vertex in the neighboring grid whose distance from the vertex to be adjusted is less than a preset error threshold, replace the coordinates of the vertex to be adjusted with the neighboring vertex, and determine the current neighboring vertex as an overlapping vertex to obtain the adjusted grid; The near-distance vertical point replacement method includes: filtering non-overlapping vertices to be adjusted, determining the first vertical point from the vertex to be adjusted to the edge line of the adjacent grid and the first vertical distance corresponding to the first vertical point, and if the first vertical distance is less than the preset error threshold, replacing the coordinates of the vertex to be adjusted with the coordinates of the first vertical point, marking the first vertical point as an overlapping vertex in the grid to be adjusted, and marking the first vertical point as a temporary vertex in the adjacent grid to obtain the adjusted grid; The method for adding nearby vertices includes: traversing all the nearby vertices of the adjacent grid, determining the second vertical point and the second vertical distance from the nearby vertex to each edge line of the grid to be adjusted, and if the second vertical distance is less than a preset error threshold, adding the nearby vertex as the initial optimized vertex of the grid to be adjusted, and marking the initial optimized vertex as an overlapping vertex to obtain the adjusted grid; The method for adding intersection points includes: determining all intersection points between the edge lines of the mesh to be adjusted and all the adjacent meshes, adding each intersection point as a vertex of the mesh to be adjusted and a temporary vertex on the edge line of the adjacent meshes, marking the intersection points as overlapping vertices, and obtaining the adjusted mesh.
5. The method according to claim 4, characterized in that, After optimizing and adjusting the vertices of the mesh to be adjusted according to the preset optimization and adjustment method, the method further includes: Traverse the temporary vertices of the adjacent meshes; If the temporary vertex has the same coordinates as any of the overlapping vertices in the mesh to be adjusted, the temporary vertex is deleted.
6. The method according to claim 1, characterized in that, After optimizing the adjustment of the vertices of the mesh to be adjusted based on the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices of the neighboring meshes, the method further includes: For each grid cell to be adjusted, identify overlapping vertices whose coordinates are the same as those of their neighboring vertices; Based on the connection order of the vertices to be adjusted, each pair of adjacent overlapping vertices in the connection sequence corresponding to the vertex to be adjusted is determined as a replacement judgment group; For each replacement judgment group, a replacement operation is performed based on the overlapping vertices, wherein the replacement operation means replacing a first vertex sequence on the mesh to be adjusted between two overlapping vertices in the replacement judgment group with a second vertex sequence on an adjacent mesh between the two overlapping vertices, wherein the vertex connection directions of the first vertex sequence and the second vertex sequence are opposite.
7. The method according to claim 6, characterized in that, The replacement operation based on the overlapping vertices includes: Determine the area change of the mesh to be adjusted corresponding to the execution of the replacement operation, and determine the edge length of the edge line of the overlapping vertex of the current replacement judgment group on the mesh to be adjusted; The product of the edge length and the preset error threshold is determined as the replacement execution threshold. If the absolute value of the area change is less than the replacement execution threshold, the replacement operation is performed based on the overlapping vertices.
8. The method according to claim 1, characterized in that, After updating the coverage correspondence based on the adjusted grid, the method further includes: The grid number corresponding to the adjusted grid is added to the optimized grid set. The grid number of the next grid to be adjusted is obtained according to the numbering order of the grid numbers. The neighboring grids of the next grid to be adjusted are determined based on the target grid number and the optimized grid set. Repeat the steps of optimizing the relative positional relationship between the vertices to be adjusted in the mesh to be adjusted and the neighboring vertices of the neighboring mesh to obtain the adjusted mesh, and updating the coverage correspondence based on the adjusted mesh, until there are no more vertices to be adjusted.
9. A grid boundary adjustment device, characterized in that, The device includes: The coverage module is used to divide a preset area into grids to obtain a bottom layer grid, and to determine the bottom layer grid covered by each of the multiple grids, thereby obtaining the coverage correspondence between grid number and grid number. Each grid is used to represent a business area, which is within the preset area. The bottom layer grids are numbered according to their positional order. The processing module is used to determine the grid number of the grid to be adjusted, obtain the target grid number corresponding to the grid to be adjusted based on the coverage correspondence, and determine the neighboring grids of the current grid to be adjusted based on the target grid number; An adjustment module is used to optimize and adjust the vertices of the grid to be adjusted based on the relative positional relationship between the vertices to be adjusted of the grid to be adjusted and the neighboring vertices of the neighboring grids, to obtain an adjusted grid, and to update the coverage correspondence based on the adjusted grid.
10. A computer-readable storage medium, characterized in that, The computer storage medium stores computer program instructions, which, when executed by a processor, implement the mesh boundary adjustment method as described in any one of claims 1 to 8.