CN114998513A - Earth simulation system grid remapping method with cycle boundary based on KD tree - Google Patents
Earth simulation system grid remapping method with cycle boundary based on KD tree Download PDFInfo
- Publication number
- CN114998513A CN114998513A CN202210517802.4A CN202210517802A CN114998513A CN 114998513 A CN114998513 A CN 114998513A CN 202210517802 A CN202210517802 A CN 202210517802A CN 114998513 A CN114998513 A CN 114998513A
- Authority
- CN
- China
- Prior art keywords
- point
- target
- source
- search
- grid point
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 102
- 238000004088 simulation Methods 0.000 title claims abstract description 11
- 230000010076 replication Effects 0.000 claims abstract description 41
- 238000012545 processing Methods 0.000 claims abstract description 22
- 125000004122 cyclic group Chemical group 0.000 claims description 13
- 238000013507 mapping Methods 0.000 claims description 6
- 238000010845 search algorithm Methods 0.000 claims description 4
- 238000012805 post-processing Methods 0.000 claims description 3
- 238000000638 solvent extraction Methods 0.000 description 8
- 238000010276 construction Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 3
- 230000011218 segmentation Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005192 partition Methods 0.000 description 2
- 238000013138 pruning Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 125000002015 acyclic group Chemical group 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000002238 attenuated effect Effects 0.000 description 1
- 238000007621 cluster analysis Methods 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/005—Tree description, e.g. octree, quadtree
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/20—Finite element generation, e.g. wire-frame surface description, tesselation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention belongs to the technical field of geographic information data processing and reconstruction, and discloses a KD tree-based earth simulation system grid remapping method with a cycle boundary, which comprises the following steps: acquiring a grid of a global simulation system, determining source grid points, target grid points and a cycle boundary, and placing all the source grid points and the target grid points in a specified cycle section of each cycle dimension; if the target grid points are concentrated near the cycle boundary and the target grid points are far more than the source grid points, searching the source grid points corresponding to the target grid points based on a KD tree source point replication method; otherwise, searching a source grid point corresponding to the target grid point based on a KD tree target point replication method; and remapping the grid information according to the target grid point and the corresponding source grid point. The invention not only keeps the advantages of no requirement of KD tree on grid type and strong applicability, but also effectively solves the problem of cycle boundary in the grid remapping process with the earth simulation system, and has wide application prospect.
Description
Technical Field
The invention belongs to the technical field of geographic information data processing and reconstruction, and particularly relates to a KD tree-based earth simulation system grid remapping method with a cycle boundary.
Background
Data searching in high dimensional space is one of the most difficult problems in many applications. As a classic data structure, the KD tree is widely used for data search in a high-dimensional space, especially nearest neighbor search and range search. Typical application scenarios include ray tracing, grid mapping, cluster analysis, and the like.
The KD-tree can be viewed as a special binary tree. The KD tree is different from a general binary tree in that the general binary tree always selects a fixed dimension for partitioning, and the KD tree can select any dimension for partitioning in each layer as needed. The dimension with the largest variance or the largest dispersion is usually chosen for partitioning in order to partition the search space as evenly as possible. Intermediate points are typically chosen as partitioning points to build a balanced KD-tree, thereby reducing tree height and shortening search time. After the KD tree construction is completed, the entire search space is actually organized in a binary tree according to the partitioning order. As shown in fig. 1, the KD-tree uses hyperplane partitioning of the space to obtain independent, unique, non-overlapping subspaces, provided that any dimension of the space is acyclic. However, many applications in reality require processing of loop boundary conditions. For example, in an earth modeling system, the longitude of the global grid is cyclic. Once a loop boundary exists in the search space, many pruning decisions in the original KD-tree based data search process will no longer hold.
Disclosure of Invention
A new data structure and algorithm are designed according to the characteristics of the cycle boundary, and the problem of application of the KD tree in a high-dimensional cycle space is solved. In view of the above, the invention provides a KD-tree-based earth simulation system grid remapping method with loop boundaries.
Specifically, the invention discloses an earth simulation system grid remapping method with a cycle boundary based on a KD tree, which comprises the following steps:
step 201, if the target grid points are concentrated near the cycle boundary and the target grid points are far more than the source grid points, searching the source grid points corresponding to the target grid points based on a KD tree source point replication method;
step 202, otherwise, searching a source grid point corresponding to the target grid point based on a KD tree target point replication method;
the source replication method described in step 201 includes the following steps: for each cycle boundary pair A and B, copying source grid points near the cycle boundary A to the outer side of the cycle boundary B, and copying source grid points near the cycle boundary B to the outer side of the cycle boundary A; constructing KD trees for original source grid points and copied source grid points based on geographic information data; searching corresponding source grid points for the target grid points according to a classical KD tree searching algorithm; performing result post-processing, namely mapping the searched source grid points back to corresponding original source grid points;
the target point replication method described in step 202 includes the following steps: constructing a KD tree based on geographic information data; acquiring a target grid point, searching a corresponding source grid point in the KD tree, and acquiring a current source grid point searching result; selecting an unprocessed circulation dimension, copying a target grid point to a position corresponding to the outer side of a circulation boundary at the side far away from the target grid point, searching a corresponding source grid point search result again based on the copied target grid point, and comparing and selecting a current optimal source grid point search result from the obtained source grid point search results; and repeating the operation for the remaining circulation dimensions to obtain the final optimal source grid point.
Further, the range of the replication in step 201 is determined by the distribution characteristics of the source grid point data, and includes:
if the maximum distance between any position in the search space and its nearest source grid point is L, only source grid points within L of the distance cycle boundary need be copied;
if the maximum distance between any position in the search space within the range of the cyclic boundary L and the nearest source grid point is L, only the source grid points within the range of the cyclic boundary L need to be copied;
if the distribution characteristics of the source grid point data are unknown or uncertain, the maximum replication area per loop boundary will be half of the search space.
Further, in the target point replication method in step 202, before a new search is started, for a selected cyclic dimension, if a distance from a target grid point to a nearest cyclic boundary of the target grid point is greater than a current search threshold, replication and search cancellation are performed on the target grid point of the selected cyclic dimension.
Further, in the target point replication method described in step 202, in a new search, the optimal distance between the current target grid point and the source grid point is used as the initial search distance.
Further, the searching process in step 202 adopts a nearest neighbor searching method, which specifically includes:
setting the initial closest distance between the initial target grid point and the source grid point to be T 0 ;
After the first round of nearest neighbor searching, the shortest distance between the target grid point and the nearest source grid point is T;
processing each cycle dimension in turn; when processing an unprocessed loop dimension i, firstly comparing the distance S from a target grid point to a loop boundary which is closest to the target grid point in an ith dimension with the size of the current shortest distance T, and if S is not less than T, meaning that a point near another loop boundary in the ith dimension cannot be closer than the current point, directly starting to process the next loop dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying the target grid points to the same relative positions outside the corresponding cycle boundaries, and using the current shortest distance T as an initial shortest distance value for subsequent search to cut off more unnecessary branches in the new search;
assuming that the latest closest distance is T, comparing between T and T, and selecting the minimum result as the latest search result;
and after all the circulation dimensions are subjected to the operation, obtaining the final shortest distance and the corresponding source grid point as a final result.
Further, the searching process in step 202 adopts a K neighboring point searching method, which specifically includes:
setting an initial Kth close distance T of an initial target grid point and a source grid point 0 ;
After the first round of nearest neighbor search, the final distance between the target grid point and the nearest Kth source grid point is T;
sequentially processing each circulation dimension; when an unprocessed circulation dimension i is processed, firstly comparing the distance S from a target grid point to a circulation boundary which is closest to the target grid point in the ith dimension with the distance T of the current nearest Kth source grid point, if S is not less than T, meaning that a relevant point cannot exist near another circulation boundary in the ith dimension, directly starting to process the next circulation dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying the target grid points to the same relative positions outside the corresponding cycle boundaries, and using the current Kth short distance T as an initial shortest distance value in subsequent search to cut off more unnecessary branches in the new search;
assuming that the new Kth near distance is T, comparing between T and T, and selecting the minimum result as the latest result;
after all the cycle dimensions are subjected to the above operation, the obtained Kth close distance and the corresponding source grid point are final results.
Further, the range searching method is adopted in the searching process in step 202, and specifically includes:
setting a search distance T;
sequentially processing each circulation dimension; when processing an unprocessed loop dimension i, firstly comparing the distance S from a target grid point to a loop boundary which is closest to the target grid point in an ith dimension with the size of a current search distance T, and if S is not less than T, meaning that a relevant point is unlikely to exist near another loop boundary in the ith dimension, directly starting to process the next loop dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying the target grid points to the same relative positions outside the corresponding cycle boundaries, and then carrying out new range search;
and after all the circulation dimensions are subjected to the operation, obtaining corresponding source grid points as final results.
The invention has the following beneficial effects:
the invention can effectively solve the problem of grid remapping of the earth simulation system with the cycle boundary, and can greatly reduce the search time by using a target point replication method.
Drawings
FIG. 1 is a schematic diagram of a KD tree;
FIG. 2 is a schematic diagram of the mirror method of the present invention;
FIG. 3 is an overall flow diagram of the present invention;
FIG. 4 illustrates a source point mirror copy process flow of the present invention;
FIG. 5 illustrates a target point mirror copy process of the present invention;
FIG. 6 shows the trend of search time of the source point copy mirroring method and the target point copy mirroring method of the present invention with the number of source points;
fig. 7 shows the trend of search time according to the target point number in the source point copy mirroring method and the target point copy mirroring method of the present invention.
Detailed Description
The present invention is further described with reference to the drawings, but the present invention is not limited thereto in any way, and any modifications or alterations based on the teaching of the present invention shall fall within the scope of the present invention.
In the actual processing of the loop space, a boundary is usually artificially divided, which is called a loop boundary. Thus, the search space is at the dimension of the loop boundary, and two virtual finite boundaries appear. The invention provides a method for realizing data search of a KD tree in a high-dimensional circular space by using a mirror image method, which comprises the following steps:
step 201, if the target grid points are concentrated near the cycle boundary and the target grid points are far more than the source grid points, searching the source grid points corresponding to the target grid points based on a KD tree source point replication method;
step 202, otherwise, searching a source grid point corresponding to the target grid point based on a KD tree target point replication method;
the source replication method described in step 201 includes the following steps: for each cycle boundary pair A and B, copying source grid points near the cycle boundary A to the outer side of the cycle boundary B, and copying source grid points near the cycle boundary B to the outer side of the cycle boundary A; constructing KD trees for the original source grid points and the copied source grid points based on the geographic information data; searching corresponding source grid points for the target grid points according to a classical KD tree searching algorithm; performing result post-processing, namely mapping the searched source grid points back to corresponding original source grid points;
the target point replication method described in step 202 includes the following steps: constructing a KD tree based on geographic information data; acquiring a target grid point, searching a corresponding source grid point in the KD tree, and acquiring a current source grid point searching result; selecting an unprocessed circulation dimension, copying a target grid point to a position corresponding to the outer side of a circulation boundary at the side far away from the target grid point, searching a corresponding source grid point search result again based on the copied target grid point, and comparing and selecting a current optimal source grid point search result from the obtained source grid point search results; and repeating the operation for the remaining circulation dimensions to obtain the final optimal source grid point.
The range of replication described in step 201 is determined by the distribution characteristics of the source mesh point data, and includes:
if the maximum distance between any position in the search space and its nearest source grid point is L, only source grid points within L of the distance cycle boundary need be copied;
if the maximum distance between any position in the search space within the range of the cyclic boundary L and the nearest source grid point is L, only the source grid points within the range of the cyclic boundary L need to be copied;
if the distribution characteristics of the source grid point data are unknown or uncertain, the maximum replication area per loop boundary will be half of the search space.
In the target point replication method described in step 202, before a new search is started, for a selected cyclic dimension, if the distance from a target grid point to the nearest cyclic boundary is greater than the current search threshold, replication and search cancellation are performed on the target grid point of the selected cyclic dimension.
In the target point replication method described in step 202, the optimal distance between the current target grid point and the source grid point is used as the initial search distance in the new search.
In the searching process in step 202, a nearest neighbor searching method is adopted, which specifically includes:
setting the initial closest distance between the initial target grid point and the source grid point to be T 0 ;
After the first round of nearest neighbor search, the shortest distance between a target grid point and the nearest source grid point is T;
sequentially processing each cycle dimension; when processing an unprocessed loop dimension i, firstly comparing the distance S from a target grid point to a loop boundary which is closest to the target grid point in the ith dimension with the current shortest distance T, if S is not less than T, meaning that a point near another loop boundary in the ith dimension cannot be closer than the current point, directly starting to process the next loop dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying the target grid points to the same relative positions outside the corresponding cycle boundaries, and using the current shortest distance T as an initial shortest distance value for subsequent search to cut off more unnecessary branches in the new search;
assuming that the latest nearest distance is T, comparing T and T, and selecting the minimum result as the latest search result;
and after all the circulation dimensions are subjected to the operation, obtaining the final shortest distance and the corresponding source grid point as a final result.
In the searching process in step 202, a K neighboring point searching method is adopted, which specifically includes:
setting an initial Kth close distance T of an initial target grid point and a source grid point 0 ;
After the first round of nearest neighbor search, the final distance between the target grid point and the nearest Kth source grid point is T;
sequentially processing each circulation dimension; when an unprocessed circulation dimension i is processed, firstly comparing the distance S from a target grid point to a circulation boundary which is closest to the target grid point in the ith dimension with the distance T of the current nearest Kth source grid point, if S is not less than T, meaning that a relevant point cannot exist near another circulation boundary in the ith dimension, directly starting to process the next circulation dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying the target grid points to the same relative positions outside the corresponding cycle boundaries, and using the current Kth short distance T as an initial shortest distance value in subsequent search to cut off more unnecessary branches in the new search;
assuming that the new Kth near distance is T, comparing between T and T, and selecting the minimum result as the latest result;
after all the circulation dimensions are processed by the operation, the obtained Kth close distance and the corresponding source grid point are final results.
In the searching process in step 202, a range searching method is adopted, which specifically includes:
setting a search distance T;
sequentially processing each circulation dimension; when an unprocessed loop dimension i is processed, firstly comparing the distance S from a target grid point to a loop boundary which is closest to the target grid point in the ith dimension with the current search distance T, and if S is not smaller than T, meaning that a relevant point cannot exist near another loop boundary in the ith dimension, directly starting to process the next loop dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying the target grid points to the same relative positions outside the corresponding cycle boundaries, and then carrying out new range search;
and after all the circulation dimensions are subjected to the operation, obtaining the corresponding source grid points as final results.
Examples
The mirror image method has two schemes from the selected object of the mirror image point, and the embodiment takes the 2-dimensional space nearest point search with cycle boundaries only on the left and right sides as an example: the first scheme is to select a source point for mirroring, that is, copy a point near the loop boundary a to the outside of the loop boundary B, copy a point near the loop boundary B to the outside of the loop boundary a, and the maximum copy area for each copy is half of the entire search space (as shown in fig. 2 (a)). The number of data points that need to be replicated may be further controlled if the distribution of the source data has certain further utilizable characteristics, such as the existence of a maximum distance between any location in the search space and its nearest source point. The second approach is to select the target point to mirror. After going through a search process, the target point may be copied to the outside of the loop boundary (assumed to be B boundary) farther from the target point, and a round of search may be performed again (as shown in fig. 2 (B)). The final result is selected from the two search results by comparison. If the search time is further reduced, new data structures and algorithms can be set by utilizing the characteristics of the KD tree and the distribution characteristics of the source data and the target data, and the pruning is further performed. For example, before the second search is started, if the distance from the target point to the B boundary is greater than the first search result, the second search may be cancelled.
The following sections describe the process of the invention in detail:
assume that the search space has K dimensions and C cycle boundaries. Without loss of generality, we set D [1] to D [ c ] as the loop dimension, where D [ i ] represents the ith dimension.
Fig. 4 shows the flow of the source point copy mirroring method. For each loop dimension, source points near one loop boundary are copied to the outside of another respective loop boundary. The extent of replication may be determined by the distribution characteristics of the source data. For example, if the maximum distance between any location in the search space and its nearest source point is L, then only source points within L of the distance of the loop boundary need be copied. In fact, the preconditions may be further attenuated. Finite replication methods are still effective as long as the source point density near the loop boundary reaches this condition. However, if the distribution characteristics of the source data are unknown or uncertain, the maximum repeat area per loop boundary will be half of the original search space. It should be noted that each copy is based on the original source data. After copying the relevant source points for each loop dimension, a KD-Tree can be constructed and the nearest points found according to classical Algorithms (for more details on these classical Algorithms see non-patent paper Cao y., Wang b., Zhao w. -j., et al, "Research on search Algorithms for actual formed mapping Based on KD Tree," 3rd International Conference on Computer and Communication Engineering. pp.29-33,2020). The last step is to map the searched source grid points back to the corresponding original source grid points.
Taking the nearest neighbor search as an example, the flow of the mirroring method based on the target point replication is shown in fig. 5. Previous work, including KD-tree construction and conventional nearest neighbor searching, is the same as ordinary KD-tree based nearest neighbor searching. Initial closest distance T 0 Usually set to a negative number or a sufficiently large value. After the first round of data search, the final shortest distance between the target point and its nearest source point is T. Then, we should use a special methodEach loop dimension is processed. For simplicity, these loop dimensions may be processed sequentially. When processing the unprocessed loop dimension i, the distance S from the target point to the loop boundary closest to the target point in the ith dimension should initially be compared with the current shortest distance T. If S is not less than T, it means that a point near another loop boundary in the ith dimension is unlikely to be closer than the current point, and processing for the next loop dimension can begin directly. Otherwise, further searching in the current loop dimension is required. Before starting a new search, we need to copy the target point to the same relative position outside the corresponding loop boundary. Subsequent searches may use the current shortest distance T as the initial shortest distance value, which may help us to cut more unnecessary branches in the new search. Assuming that the new closest distance is T, we should make a comparison between T and T and select the smallest result as the latest result. After all the loop dimensions have been subjected to the above operations, the resulting shortest distance and corresponding source point will be the final result.
The method may become a range search for the circular space if the closest distance is exchanged for the specified distance. The method specifically comprises the following steps:
setting a search distance T;
sequentially processing each circulation dimension; when an unprocessed loop dimension i is processed, firstly comparing the distance S from a target grid point to a loop boundary which is closest to the target grid point in the ith dimension with the current search distance T, and if S is not smaller than T, meaning that a relevant point cannot exist near another loop boundary in the ith dimension, directly starting to process the next loop dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying the target grid points to the same relative positions outside the corresponding cycle boundaries, and then carrying out new range search;
and after all the circulation dimensions are subjected to the operation, obtaining corresponding source grid points as final results.
The method can be changed into K adjacent point search for the circular space if the nearest distance is changed into the Kth small distance. The method for searching the K adjacent points comprises the following steps:
setting an initial Kth close distance T of an initial target grid point and a source grid point 0 ;
After the first round of nearest neighbor search, the final distance between the target grid point and the nearest Kth source grid point is T;
sequentially processing each circulation dimension; when an unprocessed circulation dimension i is processed, firstly comparing the distance S from a target grid point to a circulation boundary which is closest to the target grid point in the ith dimension with the distance T of the current nearest Kth source grid point, if S is not less than T, meaning that a relevant point cannot exist near another circulation boundary in the ith dimension, directly starting to process the next circulation dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying the target grid points to the same relative positions outside the corresponding cycle boundaries, and using the current Kth short distance T as an initial shortest distance value in subsequent search to cut off more unnecessary branches in the new search;
assuming that the new Kth near distance is T, comparing between T and T, and selecting the minimum result as the latest result;
after all the circulation dimensions are processed by the operation, the obtained Kth close distance and the corresponding source grid point are final results.
The conventional KD tree construction method comprises the following steps: and constructing the KD tree after preparing the two-dimensional point set to be divided. Firstly, judging whether a point set to be divided is an empty set, if so, finishing the construction process, and if not, formally starting the construction process. The first step is to select the partition dimension K, a common criterion being to prioritize the dimensions with high variance. Sequential partitioning strategies may be employed for simplicity. The second step is to select the segmentation point, and the common criterion is to select the point in the median in the current segmentation dimension, so that the numbers of elements on the left and right subtrees after segmentation are equivalent, the finally formed binary tree is a balanced binary tree, and the depth of each search is equivalent. The selection of the median usually requires the sorting of the dots, where a fast sorting method is selected. And thirdly, putting the rest points to be divided into the left sub-tree point set and the right sub-tree point set according to the selected dividing points. The specific rule is that points to be divided with the K-dimensional value smaller than or equal to the K-dimensional value of the division point are placed in the left subtree, and other points are placed in the right subtree. And (4) respectively recursively constructing the left and right subtrees by the left and right subtree point sets according to the method introduced earlier.
The conventional KD-tree search algorithm is as follows: when the current point T of the KD tree is empty, the search is ended. Otherwise, firstly, judging the dimension K divided by the T and calculating the distance between the T and the target point M. If T is closer to M, then the minimum distance D and the corresponding closest point need to be updated. After that, the subtree is entered to continue searching. If the value of the target point M in the partitioning dimension K is equal to or less than the value of the current point T in the dimension K, meaning that M is located in the left sub-tree space of T, the distance between the point in this space and M may be smaller than the distance between the point in the right sub-tree space and M, thus searching the left sub-tree of T recursively first. Otherwise, the right sub-tree of T is searched preferentially. When a leaf node is searched, the search process begins backtracking. And judging whether the distance between the target point and the current point in the K dimension is greater than the minimum distance D. If so, meaning that no more recent points are likely to exist within the other subtree space for the current point T, then the backtracking can continue. Otherwise, another subtree space of the current point T needs to be searched further. The KD tree-based range search process is similar to the nearest neighbor search process, and only the minimum distance D needs to be replaced with a fixed range value, and the operation of updating D and the nearest point needs to be replaced with recording the current point T. For more details, reference may be made to the non-patent paper Cao Y., Wang B., Zhao W. -J., et al, "Research on search Algorithms for Unstructured Grid mapping Based on KD Tree," 3rd International Conference on Computer and Communication Engineering technology, pp.29-33,2020.
Fig. 6 shows the time for searching data at different source point numbers for the two mirroring methods. The source point and the target point are 4-dimensional data, and the number (M) of the target points is 2 21 The number of cycle boundaries is 4, and the number (N) of source points is from 2 18 To 2 24 Changes, 2-fold increase each time. As can be seen from the figure, the target point replication method is superior to the source point replication method under the current configuration. The increase rate of the search time of the source point replication method is almost Mlog 2 N is proportional, and the rate of increase of the search time for destination point replication decreases significantly as the number of sources increases, due to the rate at which the number of sources decreases the replication of destination points.
Fig. 7 shows the time for searching data under different target points by two mirroring methods. The source point and the target point are 4-dimensional data, and the number of the source points is 2 24 The number of cycle boundaries is 4, and the number of target points is from 2 18 To 2 24 Changes, 2-fold increase each time. It can be seen from the figure that the search times of both the source point replication method and the target point replication method increase linearly with the increase of the target point. In addition, the search time of the destination point replication method is still less than the search time of the source point replication method.
The invention has the following beneficial effects:
the invention not only keeps the advantages of no requirement of KD tree on the type of the grid and strong applicability, but also effectively solves the problem of cycle boundary in the process of remapping the grid with the earth simulation system.
The above embodiment is an embodiment of the present invention, but the embodiment of the present invention is not limited by the above embodiment, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be regarded as equivalent replacements within the protection scope of the present invention.
Claims (7)
1. The method for remapping the grid of the earth simulation system with the cycle boundary based on the KD tree is characterized by comprising the following steps of:
step 1, placing all source grid points and target grid points in a specified loop section of each loop dimension;
step 2, selecting different methods to search corresponding source grid points required by the remapping target grid points according to the distribution condition of the target grid points and the number of the target grid points and the source grid points;
step 201, if the target grid points are concentrated near the cycle boundary and the target grid points are far more than the source grid points, searching the source grid points corresponding to the target grid points based on a KD tree source point replication method;
step 202, otherwise, searching a source grid point corresponding to the target grid point based on a KD tree target point replication method;
step 3, remapping grid information according to the target grid point and the corresponding source grid point;
the source replication method described in step 201 includes the following steps: for each cycle boundary pair A and B, copying source grid points near the cycle boundary A to the outer side of the cycle boundary B, and copying source grid points near the cycle boundary B to the outer side of the cycle boundary A; constructing KD trees for the original source grid points and the copied source grid points based on the geographic information data; searching corresponding source grid points for the target grid points according to a classic KD tree search algorithm; performing result post-processing, namely mapping the searched source grid points back to corresponding original source grid points;
the target point replication method described in step 202 includes the following steps: constructing a KD tree based on geographic information data; acquiring a target grid point, searching a corresponding source grid point in the KD tree, and acquiring a current source grid point searching result; selecting an unprocessed circulation dimension, copying a target grid point to a position corresponding to the outer side of a circulation boundary at the side far away from the target grid point, searching a corresponding source grid point search result again based on the copied target grid point, and comparing and selecting a current optimal source grid point search result from the obtained source grid point search results; and repeating the operation for the remaining circulation dimensions to obtain the final optimal source grid point.
2. The method of claim 1, wherein the extent of the replication in step 201 is determined by the distribution characteristics of the source grid point data, and comprises:
if the maximum distance between any position in the search space and its nearest source grid point is L, only source grid points within L of the distance cycle boundary need be copied;
if the maximum distance between any position in the search space within the range of the cyclic boundary L and the nearest source grid point is L, only the source grid points within the range of the cyclic boundary L need to be copied;
if the distribution characteristics of the source grid point data are unknown or uncertain, the maximum replication area per loop boundary will be half of the search space.
3. The method of claim 1, wherein the target point replication method in step 202 copies and cancels the target grid point in the selected loop dimension if the distance between the target grid point and the nearest loop boundary is greater than the current search threshold for the selected loop dimension before the new search is started.
4. The method of claim 1, wherein the target point replication method in step 202 takes the optimal distance between the current target grid point and the source grid point as an initial search distance in a new search.
5. The method for KD-tree-based grid remapping of earth modeling systems with loop boundaries according to claim 1, wherein said searching in step 202 uses a nearest neighbor search method, specifically comprising:
setting the initial closest distance between the initial target grid point and the source grid point to be T 0 ;
After the first round of nearest neighbor searching, the shortest distance between the target grid point and the nearest source grid point is T;
sequentially processing each cycle dimension; when processing an unprocessed loop dimension i, firstly comparing the distance S from a target grid point to a loop boundary which is closest to the target grid point in an ith dimension with the size of the current shortest distance T, and if S is not less than T, meaning that a point near another loop boundary in the ith dimension cannot be closer than the current point, directly starting to process the next loop dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying target grid points to the same relative positions outside corresponding cycle boundaries, and using the current shortest distance T as an initial shortest distance value in subsequent search to cut off more unnecessary branches in the new search;
assuming that the latest closest distance is T, comparing between T and T, and selecting the minimum result as the latest search result;
and after all the circulation dimensions are subjected to the operation, obtaining the final shortest distance and the corresponding source grid point as a final result.
6. The method for reconstructing a grid of an earth modeling system with loop boundaries according to claim 1, wherein the searching process in step 202 uses a K neighboring point searching method, which specifically includes:
setting an initial Kth close distance T of an initial target grid point and a source grid point 0 ;
After the first round of nearest neighbor search, the final distance between the target grid point and the nearest Kth source grid point is T;
sequentially processing each circulation dimension; when processing an unprocessed loop dimension i, firstly comparing the distance S from a target grid point to a loop boundary which is closest to the target grid point in an ith dimension with the distance T of a current nearest Kth source grid point, if S is not less than T, meaning that a relevant point is unlikely to exist near another loop boundary in the ith dimension, directly starting to process the next loop dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying the target grid points to the same relative positions outside the corresponding cycle boundaries, and using the current Kth short distance T as an initial shortest distance value in subsequent search to cut off more unnecessary branches in the new search;
assuming that the new Kth near distance is T, comparing between T and T, and selecting the minimum result as the latest result;
after all the cycle dimensions are subjected to the above operation, the obtained Kth close distance and the corresponding source grid point are final results.
7. The method for KD-tree-based grid remapping of an earth modeling system with loop boundaries according to claim 1, wherein said searching in step 202 employs a range search method, which specifically comprises:
setting a search distance T;
sequentially processing each circulation dimension; when an unprocessed loop dimension i is processed, firstly comparing the distance S from a target grid point to a loop boundary which is closest to the target grid point in the ith dimension with the current search distance T, and if S is not smaller than T, meaning that a relevant point cannot exist near another loop boundary in the ith dimension, directly starting to process the next loop dimension; otherwise, further searching is carried out in the current circulation dimension;
before starting new search, copying the target grid points to the same relative positions outside the corresponding cycle boundaries, and then carrying out new range search;
and after all the circulation dimensions are subjected to the operation, obtaining the corresponding source grid points as final results.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210517802.4A CN114998513B (en) | 2022-05-12 | 2022-05-12 | Grid remapping method of earth simulation system with circulating boundary based on KD tree |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210517802.4A CN114998513B (en) | 2022-05-12 | 2022-05-12 | Grid remapping method of earth simulation system with circulating boundary based on KD tree |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114998513A true CN114998513A (en) | 2022-09-02 |
CN114998513B CN114998513B (en) | 2024-01-30 |
Family
ID=83026743
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210517802.4A Active CN114998513B (en) | 2022-05-12 | 2022-05-12 | Grid remapping method of earth simulation system with circulating boundary based on KD tree |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114998513B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070198568A1 (en) * | 2006-02-20 | 2007-08-23 | Linkage Technology Co., Ltd. | "Grid Plus T Tree" Index Method for Quick Orientation in Massive Memory Database |
US20080122853A1 (en) * | 2006-11-28 | 2008-05-29 | Jeffrey Douglas Brown | Dynamic Spatial Index Remapping for Optimal Aggregate Performance |
US20080122845A1 (en) * | 2006-11-28 | 2008-05-29 | Jeffrey Douglas Brown | Dynamic Determination of Optimal Spatial Index Mapping to Processor Thread Resources |
CN109118588A (en) * | 2018-09-25 | 2019-01-01 | 武汉大势智慧科技有限公司 | A kind of colored LOD model automatic forming method decomposed based on block |
CN111523159A (en) * | 2020-04-16 | 2020-08-11 | 深圳云甲科技有限公司 | Shaping method of grid model, terminal and storage medium |
CN112181991A (en) * | 2020-10-15 | 2021-01-05 | 中国人民解放军国防科技大学 | Earth simulation system grid remapping method based on rapid construction of KD tree |
-
2022
- 2022-05-12 CN CN202210517802.4A patent/CN114998513B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070198568A1 (en) * | 2006-02-20 | 2007-08-23 | Linkage Technology Co., Ltd. | "Grid Plus T Tree" Index Method for Quick Orientation in Massive Memory Database |
US20080122853A1 (en) * | 2006-11-28 | 2008-05-29 | Jeffrey Douglas Brown | Dynamic Spatial Index Remapping for Optimal Aggregate Performance |
US20080122845A1 (en) * | 2006-11-28 | 2008-05-29 | Jeffrey Douglas Brown | Dynamic Determination of Optimal Spatial Index Mapping to Processor Thread Resources |
CN109118588A (en) * | 2018-09-25 | 2019-01-01 | 武汉大势智慧科技有限公司 | A kind of colored LOD model automatic forming method decomposed based on block |
CN111523159A (en) * | 2020-04-16 | 2020-08-11 | 深圳云甲科技有限公司 | Shaping method of grid model, terminal and storage medium |
CN112181991A (en) * | 2020-10-15 | 2021-01-05 | 中国人民解放军国防科技大学 | Earth simulation system grid remapping method based on rapid construction of KD tree |
Non-Patent Citations (3)
Title |
---|
YU CAO ET AL: "general data search algorithms for earth simulation systems with cyclic boundaries", 《INTERNATIONAL JOURNAL OF GEO-INFORMATION》, pages 1 - 13 * |
YU CAO 等: "Research on Searching Algorithms for Unstructured Grid Remapping Based on KD Tree", 《2020 IEEE 3RD INTERNATIONAL CONFERENCE ON COMPUTER AND COMMUNICATION ENGINEERING TECHNOLOGY (CCET)》, pages 29 - 33 * |
朱涛;罗仕鉴;: "大规模地貌场景的实时纹理合成", 计算机工程, no. 10, pages 264 - 266 * |
Also Published As
Publication number | Publication date |
---|---|
CN114998513B (en) | 2024-01-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Cao et al. | An improved k-medoids clustering algorithm | |
EP2945071B1 (en) | Index generating device and method, and search device and search method | |
CN110275929B (en) | Candidate road section screening method based on grid segmentation and grid segmentation method | |
KR102268676B1 (en) | 3D Point Cloud Generative Adversarial Network Based on Tree Structured Graph Convolutions | |
US20150178594A1 (en) | Point cloud simplification | |
CN109033340A (en) | A kind of searching method and device of the point cloud K neighborhood based on Spark platform | |
CN116822422B (en) | Analysis optimization method of digital logic circuit and related equipment | |
CN109739585A (en) | The traffic congestion point discovery method calculated based on spark cluster parallelization | |
CN110119408B (en) | Continuous query method for moving object under geospatial real-time streaming data | |
CN111459997A (en) | Frequent mode increment mining method of space-time trajectory data and electronic equipment | |
CN110781943A (en) | Clustering method based on adjacent grid search | |
CN103761298A (en) | Distributed-architecture-based entity matching method | |
KR101994871B1 (en) | Apparatus for generating index to multi dimensional data | |
CN114998513A (en) | Earth simulation system grid remapping method with cycle boundary based on KD tree | |
CN108897820B (en) | Parallelization method of DENCLUE algorithm | |
WO2024056504A1 (en) | A method and system for range query processing of complex geometric data | |
CN112183001A (en) | Hypergraph-based multistage clustering method | |
CN110807061A (en) | Method for searching frequent subgraphs of uncertain graphs based on layering | |
CN116366538A (en) | Path updating and equivalent path planning method and related device under dynamic network | |
KR20210077975A (en) | Spatial indexing method and apparatus for blockchain-based geospatial data | |
CN109800241A (en) | A kind of set operation method and terminal | |
CN111177190A (en) | Data processing method and device, electronic equipment and readable storage medium | |
CN115374856A (en) | Data clustering analysis method based on moving grid density | |
CN113076448A (en) | Community discovery method based on extremely large cliques and strongly connected components | |
CN114490799A (en) | Method and device for mining frequent subgraphs of single graph |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB03 | Change of inventor or designer information |
Inventor after: Cao Yu Inventor after: Chen Yan Inventor after: Wang Huizan Inventor after: Zhang Xiaojiang Inventor after: Zhao Wenjing Inventor before: Cao Yu Inventor before: Chen Yan Inventor before: Wang Huizan Inventor before: Zhang Xiaojiang Inventor before: Zhao Wenjing |
|
CB03 | Change of inventor or designer information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |