[go: up one dir, main page]

CN114998513B - Grid remapping method of earth simulation system with circulating boundary based on KD tree - Google Patents

Grid remapping method of earth simulation system with circulating boundary based on KD tree Download PDF

Info

Publication number
CN114998513B
CN114998513B CN202210517802.4A CN202210517802A CN114998513B CN 114998513 B CN114998513 B CN 114998513B CN 202210517802 A CN202210517802 A CN 202210517802A CN 114998513 B CN114998513 B CN 114998513B
Authority
CN
China
Prior art keywords
point
search
target
source
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.)
Active
Application number
CN202210517802.4A
Other languages
Chinese (zh)
Other versions
CN114998513A (en
Inventor
曹宇
陈妍
王辉赞
张小将
赵文静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN202210517802.4A priority Critical patent/CN114998513B/en
Publication of CN114998513A publication Critical patent/CN114998513A/en
Application granted granted Critical
Publication of CN114998513B publication Critical patent/CN114998513B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/005Tree description, e.g. octree, quadtree
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information 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 grid remapping method of an earth simulation system with a circulating boundary based on a KD tree, which comprises the following steps: acquiring a grid of the earth simulation system, determining a source grid point, a target grid point and a circulation boundary, and placing all the source grid point and the target grid point in a specified circulation section of each circulation dimension; if the target grid points are concentrated near the loop 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; the grid information is remapped according to the target grid point and the corresponding source grid point. The method not only maintains the advantages of no requirement on the grid type and strong applicability of the KD tree, but also effectively solves the problem of cyclic boundaries in the grid remapping process of the earth simulation system, and has wide application prospect.

Description

基于KD树的带循环边界的地球模拟系统网格重映射方法Grid remapping method for earth simulation system with cyclic boundaries based on KD tree

技术领域Technical field

本发明属于地理信息数据处理与重构技术领域,尤其涉及基于KD树的带循环边界的地球模拟系统网格重映射方法。The invention belongs to the technical field of geographical information data processing and reconstruction, and in particular relates to a KD tree-based earth simulation system grid remapping method with cyclic boundaries.

背景技术Background technique

高维空间的数据搜索是许多应用中最困难的问题之一。作为一种经典的数据结构,KD树被广泛应用于高维空间的数据搜索,尤其是最近邻搜索和范围搜索。典型的应用场景包括光线跟踪、网格映射、聚类分析等。Data search in high-dimensional spaces is one of the most difficult problems in many applications. As a classic data structure, KD tree is widely used in data search in high-dimensional space, especially nearest neighbor search and range search. Typical application scenarios include ray tracing, grid mapping, cluster analysis, etc.

KD树可以看作是一种特殊的二叉树。KD树和普通二叉树的区别在于,普通二叉树总是选用固定维度进行划分,而KD树可以根据需要在每一层中选用任意维度进行划分。通常选择方差最大或离散度最大的维度进行划分,以便尽可能均匀地分割搜索空间。通常选择中间点作为划分点,以构建平衡的KD树,从而降低树高并缩短搜索时间。KD树构造完成后,整个搜索空间实际上按照划分顺序以二叉树的形式组织起来。如图1所示,KD树利用超平面划分空间,得到独立、唯一、不重叠的子空间的前提是空间的任何维数都是非循环的。然而,现实中的许多应用都需要处理循环边界条件。例如,在地球模拟系统中,全球网格的经度是循环的。一旦搜索空间中存在循环边界,原始的基于KD树的数据搜索过程中的许多修剪判断将不再成立。KD tree can be regarded as a special binary tree. The difference between KD trees and ordinary binary trees is that ordinary binary trees always use fixed dimensions for division, while KD trees can use any dimension for division in each layer as needed. The dimension with the largest variance or the largest dispersion is usually chosen for partitioning in order to split the search space as evenly as possible. The middle point is usually selected as the dividing point to build a balanced KD tree, thereby reducing the tree height and shortening the search time. After the KD tree is constructed, the entire search space is actually organized in the form of a binary tree according to the order of division. As shown in Figure 1, the KD tree uses hyperplanes to divide the space. The premise for obtaining independent, unique, non-overlapping subspaces is that any dimension of the space is acyclic. However, many real-world applications need to deal with cyclic boundary conditions. For example, in Earth simulation systems, the longitude of the global grid is cyclic. Once a cycle boundary exists in the search space, many pruning judgments in the original KD tree-based data search process will no longer hold.

发明内容Contents of the invention

根据循环边界的特点来设计新的数据结构和算法,解决KD树在高维循环空间的应用问题至关重要。有鉴于此,本发明提出了基于KD树的带循环边界的地球模拟系统网格重映射方法。It is crucial to design new data structures and algorithms based on the characteristics of cycle boundaries and solve the application problems of KD trees in high-dimensional cycle spaces. In view of this, the present invention proposes a KD tree-based earth simulation system grid remapping method with cyclic boundaries.

具体的,本发明公开的基于KD树的带循环边界的地球模拟系统网格重映射方法,包括以下步骤:Specifically, the KD tree-based earth simulation system grid remapping method with cyclic boundaries disclosed by the present invention includes the following steps:

步骤1,将所有源网格点和目标网格点放置在每个循环维度的指定循环段内;Step 1, place all source grid points and target grid points within the specified cycle segment of each cycle dimension;

步骤2,根据目标网格点的分布情况以及目标网格点和源网格点的数量,选择不同的方法搜寻重映射目标网格点所需的相应源网格点;Step 2: According to the distribution of target grid points and the number of target grid points and source grid points, choose different methods to search for the corresponding source grid points required to remap the target grid points;

步骤201,如果目标网格点集中在循环边界附近,且目标网格点远多于源网格点,则基于KD树源点复制法搜索目标网格点对应的源网格点;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, search for the source grid points corresponding to the target grid points based on the KD tree source point copy method;

步骤202,否则基于KD树目标点复制法搜索目标网格点对应的源网格点;Step 202, otherwise search for the source grid point corresponding to the target grid point based on the KD tree target point copy method;

步骤3,根据目标网格点和对应的源网格点,重映射网格信息;Step 3: Remap the grid information based on the target grid point and the corresponding source grid point;

步骤201中所述的源点复制法包括以下步骤:对每一个循环边界对A和B,将循环边界A附近的源网格点复制到循环边界B的外侧去,将循环边界B附近的源网格点复制到循环边界A的外侧去;基于地理信息数据为原始的源网格点和复制后的源网格点构建KD树;根据经典KD树搜索算法为目标网格点搜索对应的源网格点;结果后处理,即将搜索到的源网格点映射回对应的原始的源网格点;The source point copying method described in step 201 includes the following steps: for each loop boundary pair A and B, copy the source grid points near the loop boundary A to the outside of the loop boundary B, and copy the source grid points near the loop boundary B. The grid points are copied to the outside of the loop boundary A; a KD tree is constructed for the original source grid points and the copied source grid points based on geographical information data; the corresponding source is searched for the target grid point according to the classic KD tree search algorithm. Grid points; result post-processing, that is, mapping the searched source grid points back to the corresponding original source grid points;

步骤202中所述的目标点复制法包括以下步骤:基于地理信息数据构建KD树;获取目标网格点,在所述的KD树中搜索对应的源网格点,获得当前的源网格点搜索结果;选择一个未处理的循环维度,将目标网格点复制到距离目标网格点较远一侧循环边界的外侧对应位置处,基于复制后的目标网格点,再次搜索对应的源网格点搜索结果,并从已获得的源网格点搜索结果中比较选出当前最优源网格点搜索结果;针对剩下的循环维度,重复上述操作,以获得最终的最优源网格点。The target point copying method described in step 202 includes the following steps: constructing a KD tree based on geographical information data; obtaining the target grid point, searching for the corresponding source grid point in the KD tree, and obtaining the current source grid point Search results; select an unprocessed cycle dimension, copy the target grid point to the corresponding position outside the cycle boundary on the far side from the target grid point, and search the corresponding source network again based on the copied target grid point Grid point search results, and compare and select the current optimal source grid point search results from the obtained source grid point search results; repeat the above operations for the remaining cycle dimensions to obtain the final optimal source grid point.

进一步的,步骤201中所述的复制的范围由源网格点数据的分布特征决定,包括:Further, the scope of the copy described in step 201 is determined by the distribution characteristics of the source grid point data, including:

如果搜索空间中的任何位置与其最近的源网格点之间的最大距离为L,则仅需要复制距离循环边界L范围内的源网格点;If the maximum distance between any position in the search space and its nearest source grid point is L, then only the source grid points within the range L of the loop boundary need to be copied;

如果距离循环边界L范围内的搜索空间任何位置与其最近的源网格点之间的最大距离为L,则仅需要复制距离循环边界L范围内的源网格点;If the maximum distance between any position in the search space within the range L of the loop boundary and its nearest source grid point is L, then only the source grid points within the range L of the loop boundary need to be copied;

如果源网格点数据的分布特征未知或不确定,则每个循环边界的最大复制区域将是搜索空间的一半。If the distribution characteristics of the source grid point data are unknown or uncertain, the maximum replicated area for each loop boundary will be half the search space.

进一步的,步骤202中所述的目标点复制法,在新一次搜索开始前,对于选定的循环维度,如果目标网格点距其最近的循环边界的距离大于当前的搜索阈值,则在该选定的循环维度的目标网格点复制和搜索取消。Further, in the target point copying method described in step 202, before a new search starts, for the selected cycle dimension, if the distance between the target grid point and its nearest cycle boundary is greater than the current search threshold, then in that Target grid point copy and search canceled for selected cycle dimensions.

进一步的,步骤202中所述的目标点复制法,在新一次搜索中,以当前目标网格点与源网格点最优距离作为初始搜索距离。Further, in the target point copying 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.

进一步的,步骤202中所述的搜索的过程中采用最近邻搜索方法,具体包括:Further, the nearest neighbor search method is used in the search process described in step 202, which specifically includes:

设置初始目标网格点和源网格点的初始最近距离为T0Set the initial closest distance between the initial target grid point and the source grid point to T 0 ;

在第一轮最近邻搜索之后,目标网格点与其最近的源网格点之间的最短距离为T;After the first round of nearest neighbor search, the shortest distance between the target grid point and its nearest source grid point is T;

依次处理每个循环维度;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前最短距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近的点不可能比当前点更近,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each cycle dimension is processed in turn; when processing the unprocessed cycle dimension i, first compare the distance S from the target grid point to the cycle boundary closest to the target grid point in the i-th dimension and the size of the current shortest distance T, if S is not less than T, which means that the point near another loop boundary in the i-th dimension cannot be closer than the current point, then directly start processing the next loop dimension; otherwise, perform further search in the current loop dimension;

在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,后续的搜索用当前最短距离T作为初始最短距离值,以在新搜索中切断更多不必要的分支;Before starting a new search, copy the target grid point to the same relative position outside the corresponding cycle boundary. Subsequent searches use the current shortest distance T as the initial shortest distance value to cut off more unnecessary branches in the new search;

假设最新的最近距离是t,在t和T之间进行比较,并选择最小的结果作为最新的搜索结果;Assume that the latest closest distance is t, compare between t and T, and select the smallest result as the latest search result;

在所有循环维度都经过上述操作后,得到最终的最短距离和相应的源网格点为最终结果。After all cycle dimensions undergo the above operations, the final shortest distance and corresponding source grid point are obtained as the final result.

进一步的,步骤202中所述的搜索的过程中采用K邻近点搜索方法,具体包括:Further, the K neighboring point search method is used in the search process described in step 202, which specifically includes:

设置初始目标网格点和源网格点的初始第K近距离T0Set the initial Kth close distance T 0 between the initial target grid point and the source grid point;

在第一轮最近邻搜索之后,目标网格点与其最近的第K个源网格点之间的最终距离为T;After the first round of nearest neighbor search, the final distance between the target grid point and its nearest Kth source grid point is T;

依次处理每个循环维;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前最近第K个源网格点距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近不可能存在相关点,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each cycle dimension is processed in turn; when processing the unprocessed cycle dimension i, first compare the distance S from the target grid point to the cycle boundary closest to the target grid point in the i-th dimension and the current nearest Kth source grid The size of the point distance T. If S is not less than T, it means that there is no relevant point near another cycle boundary in the i-th dimension, and the next cycle dimension will be processed directly; otherwise, further search will be performed in the current cycle dimension;

在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,后续的搜索用当前第K近距离T作为初始最短距离值,以在新搜索中切断更多不必要的分支;Before starting a new search, copy the target grid point to the same relative position outside the corresponding loop boundary. Subsequent searches use the current Kth short distance T as the initial shortest distance value to cut off more unnecessary points in the new search. branch;

假设新的第K近距离是t,在t和T之间进行比较,并选择最小的结果作为最新的结果;Assume that the new Kth close distance is t, compare between t and T, and select the smallest result as the latest result;

在所有循环维度都经过上述操作后,得到的第K近距离和相应的源网格点为最终结果。After the above operations are performed in all cycle dimensions, the Kth close distance and corresponding source grid point are the final results.

进一步的,步骤202中所述的搜索的过程中采用范围搜索方法,具体包括:Further, the range search method is used in the search process described in step 202, which specifically includes:

设置搜索距离T;Set the search distance T;

依次处理每个循环维;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前搜索距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近不可能存在相关点,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each cycle dimension is processed in turn; when processing the unprocessed cycle dimension i, first compare the distance S from the target grid point to the cycle boundary closest to the target grid point in the i-th dimension and the size of the current search distance T, if S is not less than T, which means that there is no relevant point near another loop boundary in the i-th dimension, and then the next loop dimension will be processed directly; otherwise, further search will be performed in the current loop dimension;

在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,然后进行新的范围搜索;Before starting a new search, copy the target grid point to the same relative position outside the corresponding cycle boundary, and then perform a new range search;

在所有循环维度都经过上述操作后,得到相应的源网格点为最终结果。After all cycle dimensions undergo the above operations, the corresponding source grid points are obtained as the final result.

本发明的有益效果如下:The beneficial effects of the present invention are as follows:

本发明可有效解决带有循环边界的地球模拟系统网格重映射问题,使用目标点复制法可大大减少搜索时间。The invention can effectively solve the grid remapping problem of the earth simulation system with cyclic boundaries, and can greatly reduce the search time by using the target point copying method.

附图说明Description of the drawings

图1KD树示意图;Figure 1 Schematic diagram of KD tree;

图2本发明的镜像法示意图;Figure 2 is a schematic diagram of the mirroring method of the present invention;

图3本发明的整体流程图;Figure 3 is an overall flow chart of the present invention;

图4本发明的源点复制镜像法流程;Figure 4 is the source point copy mirroring method process of the present invention;

图5本发明的目标点复制镜像法流程;Figure 5 The target point copy mirroring method process of the present invention;

图6本发明的源点复制镜像法和目标点复制镜像法的搜索时间随源点数变化趋势;Figure 6. The search time of the source point copy mirroring method and the target point copying mirror method of the present invention changes with the number of source points;

图7本发明的源点复制镜像法和目标点复制镜像法的搜索时间随目标点数变化趋势。Figure 7. The search time of the source point copy mirroring method and the target point copying mirror method of the present invention changes with the number of target points.

具体实施方式Detailed ways

下面结合附图对本发明作进一步的说明,但不以任何方式对本发明加以限制,基于本发明教导所作的任何变换或替换,均属于本发明的保护范围。The present invention will be further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any transformation or replacement based on the teachings of the present invention falls within the protection scope of the present invention.

循环空间在实际处理时,通常会人为的划分出一条边界出来,称之为循环边界。这样一来,搜索空间在循环边界所在维度,就出现了两个虚拟的有限边界。本发明提出使用镜像法实现KD树在高维循环空间中的数据搜索,包括以下步骤:When the cyclic space is actually processed, a boundary is usually artificially divided, which is called the cyclic boundary. In this way, the search space has two virtual finite boundaries in the dimension where the cycle boundary is located. The present invention proposes to use the mirror method to realize KD tree data search in high-dimensional cyclic space, which includes the following steps:

步骤1,将所有源网格点和目标网格点放置在每个循环维度的指定循环段内;Step 1, place all source grid points and target grid points within the specified cycle segment of each cycle dimension;

步骤2,根据目标网格点的分布情况以及目标网格点和源网格点的数量,选择不同的方法搜寻重映射目标网格点所需的相应源网格点;Step 2: According to the distribution of target grid points and the number of target grid points and source grid points, choose different methods to search for the corresponding source grid points required to remap the target grid points;

步骤201,如果目标网格点集中在循环边界附近,且目标网格点远多于源网格点,则基于KD树源点复制法搜索目标网格点对应的源网格点;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, search for the source grid points corresponding to the target grid points based on the KD tree source point copy method;

步骤202,否则基于KD树目标点复制法搜索目标网格点对应的源网格点;Step 202, otherwise search for the source grid point corresponding to the target grid point based on the KD tree target point copy method;

步骤3,根据目标网格点和对应的源网格点,重映射网格信息;Step 3: Remap the grid information based on the target grid point and the corresponding source grid point;

步骤201中所述的源点复制法包括以下步骤:对每一个循环边界对A和B,将循环边界A附近的源网格点复制到循环边界B的外侧去,将循环边界B附近的源网格点复制到循环边界A的外侧去;基于地理信息数据为原始的源网格点和复制后的源网格点构建KD树;根据经典KD树搜索算法为目标网格点搜索对应的源网格点;结果后处理,即将搜索到的源网格点映射回对应的原始的源网格点;The source point copying method described in step 201 includes the following steps: for each loop boundary pair A and B, copy the source grid points near the loop boundary A to the outside of the loop boundary B, and copy the source grid points near the loop boundary B to the outside of the loop boundary B. The grid points are copied to the outside of the loop boundary A; a KD tree is constructed for the original source grid points and the copied source grid points based on geographical information data; the corresponding source is searched for the target grid point according to the classic KD tree search algorithm. Grid points; result post-processing, that is, mapping the searched source grid points back to the corresponding original source grid points;

步骤202中所述的目标点复制法包括以下步骤:基于地理信息数据构建KD树;获取目标网格点,在所述的KD树中搜索对应的源网格点,获得当前的源网格点搜索结果;选择一个未处理的循环维度,将目标网格点复制到距离目标网格点较远一侧循环边界的外侧对应位置处,基于复制后的目标网格点,再次搜索对应的源网格点搜索结果,并从已获得的源网格点搜索结果中比较选出当前最优源网格点搜索结果;针对剩下的循环维度,重复上述操作,以获得最终的最优源网格点。The target point copying method described in step 202 includes the following steps: constructing a KD tree based on geographical information data; obtaining the target grid point, searching for the corresponding source grid point in the KD tree, and obtaining the current source grid point Search results; select an unprocessed cycle dimension, copy the target grid point to the corresponding position outside the cycle boundary on the far side from the target grid point, and search the corresponding source network again based on the copied target grid point Grid point search results, and compare and select the current optimal source grid point search results from the obtained source grid point search results; repeat the above operations for the remaining cycle dimensions to obtain the final optimal source grid point.

步骤201中所述的复制的范围由源网格点数据的分布特征决定,包括:The scope of copying described in step 201 is determined by the distribution characteristics of the source grid point data, including:

如果搜索空间中的任何位置与其最近的源网格点之间的最大距离为L,则仅需要复制距离循环边界L范围内的源网格点;If the maximum distance between any position in the search space and its nearest source grid point is L, then only the source grid points within the range L of the loop boundary need to be copied;

如果距离循环边界L范围内的搜索空间任何位置与其最近的源网格点之间的最大距离为L,则仅需要复制距离循环边界L范围内的源网格点;If the maximum distance between any position in the search space within the range L of the loop boundary and its nearest source grid point is L, then only the source grid points within the range L of the loop boundary need to be copied;

如果源网格点数据的分布特征未知或不确定,则每个循环边界的最大复制区域将是搜索空间的一半。If the distribution characteristics of the source grid point data are unknown or uncertain, the maximum replicated area for each cycle boundary will be half the search space.

步骤202中所述的目标点复制法,在新一次搜索开始前,对于选定的循环维度,如果目标网格点距其最近的循环边界的距离大于当前的搜索阈值,则在该选定的循环维度的目标网格点复制和搜索取消。In the target point copying method described in step 202, before a new search starts, for the selected cycle dimension, if the distance between the target grid point and its nearest cycle boundary is greater than the current search threshold, then in the selected cycle dimension Target grid point copying and search cancellation for loop dimensions.

步骤202中所述的目标点复制法,在新一次搜索中,以当前目标网格点与源网格点最优距离作为初始搜索距离。In the target point copying 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.

步骤202中所述的搜索的过程中采用最近邻搜索方法,具体包括:The nearest neighbor search method is used in the search process described in step 202, which specifically includes:

设置初始目标网格点和源网格点的初始最近距离为T0Set the initial closest distance between the initial target grid point and the source grid point to T 0 ;

在第一轮最近邻搜索之后,目标网格点与其最近的源网格点之间的最短距离为T;After the first round of nearest neighbor search, the shortest distance between the target grid point and its nearest source grid point is T;

依次处理每个循环维度;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前最短距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近的点不可能比当前点更近,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each cycle dimension is processed in turn; when processing the unprocessed cycle dimension i, first compare the distance S from the target grid point to the cycle boundary closest to the target grid point in the i-th dimension and the size of the current shortest distance T, if S is not less than T, which means that the point near another loop boundary in the i-th dimension cannot be closer than the current point, then directly start processing the next loop dimension; otherwise, perform further search in the current loop dimension;

在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,后续的搜索用当前最短距离T作为初始最短距离值,以在新搜索中切断更多不必要的分支;Before starting a new search, copy the target grid point to the same relative position outside the corresponding cycle boundary. Subsequent searches use the current shortest distance T as the initial shortest distance value to cut off more unnecessary branches in the new search;

假设最新的最近距离是t,在t和T之间进行比较,并选择最小的结果作为最新的搜索结果;Assume that the latest closest distance is t, compare between t and T, and select the smallest result as the latest search result;

在所有循环维度都经过上述操作后,得到最终的最短距离和相应的源网格点为最终结果。After all cycle dimensions undergo the above operations, the final shortest distance and corresponding source grid point are obtained as the final result.

步骤202中所述的搜索的过程中采用K邻近点搜索方法,具体包括:The K neighboring point search method is used in the search process described in step 202, which specifically includes:

设置初始目标网格点和源网格点的初始第K近距离T0Set the initial Kth close distance T 0 between the initial target grid point and the source grid point;

在第一轮最近邻搜索之后,目标网格点与其最近的第K个源网格点之间的最终距离为T;After the first round of nearest neighbor search, the final distance between the target grid point and its nearest Kth source grid point is T;

依次处理每个循环维;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前最近第K个源网格点距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近不可能存在相关点,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each cycle dimension is processed in turn; when processing the unprocessed cycle dimension i, first compare the distance S from the target grid point to the cycle boundary closest to the target grid point in the i-th dimension and the current nearest Kth source grid The size of the point distance T. If S is not less than T, it means that there is no relevant point near another cycle boundary in the i-th dimension, and the next cycle dimension will be processed directly; otherwise, further search will be performed in the current cycle dimension;

在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,后续的搜索用当前第K近距离T作为初始最短距离值,以在新搜索中切断更多不必要的分支;Before starting a new search, copy the target grid point to the same relative position outside the corresponding loop boundary. Subsequent searches use the current Kth short distance T as the initial shortest distance value to cut off more unnecessary points in the new search. branch;

假设新的第K近距离是t,在t和T之间进行比较,并选择最小的结果作为最新的结果;Assume that the new Kth close distance is t, compare between t and T, and select the smallest result as the latest result;

在所有循环维度都经过上述操作后,得到的第K近距离和相应的源网格点为最终结果。After the above operations are performed in all cycle dimensions, the Kth close distance and corresponding source grid point are the final results.

步骤202中所述的搜索的过程中采用范围搜索方法,具体包括:The range search method is used in the search process described in step 202, which specifically includes:

设置搜索距离T;Set the search distance T;

依次处理每个循环维;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前搜索距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近不可能存在相关点,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each cycle dimension is processed in turn; when processing the unprocessed cycle dimension i, first compare the distance S from the target grid point to the cycle boundary closest to the target grid point in the i-th dimension and the size of the current search distance T, if S is not less than T, which means that there is no relevant point near another loop boundary in the i-th dimension, and then the next loop dimension will be processed directly; otherwise, further search will be performed in the current loop dimension;

在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,然后进行新的范围搜索;Before starting a new search, copy the target grid point to the same relative position outside the corresponding cycle boundary, and then perform a new range search;

在所有循环维度都经过上述操作后,得到相应的源网格点为最终结果。After all cycle dimensions undergo the above operations, the corresponding source grid points are obtained as the final result.

实施例Example

镜像法从镜像点的选取对象来分有两种方案,本实施例以仅左右两边存在循环边界的2维空间最邻近点搜索为例:第一种方案是选源点做镜像,即将循环边界A附近的点复制到循环边界B的外侧去,将循环边界B附近的点复制到循环边界A的外侧去,每次复制的最大复制区域为整个搜索搜索空间的一半(如图2(a)所示)。如果源数据的分布具有某些可进一步利用的特征,例如存在搜索空间中任何位置与其最近源点之间的最大距离,那么需要复制的数据点数可以得到进一步的控制。第二种方案是选目标点做镜像。在经历一次搜索过程之后,可以将目标点复制到距离目标点更远一侧循环边界(假设为B边界)的外侧,重新进行一轮搜索(如图2(b)所示)。最终的结果从两次搜索结果中比较选出。如果想要进一步减少搜索时间,可以利用KD树的特征和源数据、目标数据的分布特征,设置新的数据结构和算法,进一步剪枝。比如在第二次搜索开始前,如果目标点距离B边界的距离大于第一次搜索结果,则第二次搜索可以取消。The mirror method has two options based on the selection of the mirror point. This embodiment takes the nearest neighbor point search in a 2-dimensional space with only cyclic boundaries on the left and right sides as an example: the first option is to select the source point for mirroring, that is, the cyclic boundary The points near A are copied to the outside of the loop boundary B, and the points near the loop boundary B are copied to the outside of the loop boundary A. The maximum copy area for each copy is half of the entire search space (Figure 2(a)) shown). The number of data points that need to be replicated can be further controlled if the distribution of the source data has certain characteristics that can be further exploited, such as the existence of a maximum distance between any position in the search space and its nearest source point. The second option is to select a target point for mirroring. After a search process, the target point can be copied to the outside of the loop boundary (assumed to be the B boundary) farther away from the target point, and a new round of search can be performed (as shown in Figure 2(b)). The final result is selected from the comparison of the two search results. If you want to further reduce the search time, you can use the characteristics of the KD tree and the distribution characteristics of the source data and target data to set up new data structures and algorithms to further prune. For example, before the second search starts, if the distance between the target point and the B boundary is greater than the first search result, the second search can be cancelled.

以下部分详细描述本发明的方法:The following sections describe the method of the invention in detail:

假设搜索空间有K维和C个循环边界。在不丧失一般性的情况下,我们将D[1]到D[c]设置为循环维数,其中D[i]表示第i维。Assume that the search space has K dimensions and C cycle boundaries. Without loss of generality, we set D[1] to D[c] as cyclic dimensions, where D[i] represents the i-th dimension.

图4展示了源点复制镜像法流程。对于每个循环维度,将一个循环边界附近的源点复制到另一个相应循环边界的外侧。复制的范围可以由源数据的分布特征决定。例如,如果搜索空间中的任何位置与其最近的源点之间的最大距离为L,则仅需要复制距离循环边界L范围内的源点。事实上,前提条件可以进一步削弱。只要循环边界附近的源点密度达到这种条件,有限复制法仍然有效。然而,如果源数据的分布特征未知或不确定,则每个循环边界的最大重复区域将是原始搜索空间的一半。应注意的是,每次复制都基于原始源数据。在复制每个循环维度的相关源点后,可以构建KD树,并根据经典算法找到最近的点(关于这些经典算法的更多细节见更多细节可参考非专利论文Cao Y.,Wang B.,Zhao W.-J.,et al.,“Research on Searching Algorithms for Unstructured Grid Remapping Based on KDTree,”3rd International Conference on Computer and Communication EngineeringTechnology.pp.29-33,2020)。最后一步是将搜索到的源网格点映射回对应的原始的源网格点。Figure 4 shows the source point copy mirroring method process. For each cycle dimension, a source point near one cycle boundary is copied to the outside of the other corresponding cycle boundary. The scope of replication can 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 that are within L from the loop boundary need to be copied. In fact, the preconditions can be weakened even further. As long as the density of source points near the loop boundary reaches this condition, the finite replication method is still valid. However, if the distribution characteristics of the source data are unknown or uncertain, the maximum repeat area for each cycle boundary will be half of the original search space. It should be noted that each replication is based on the original source data. After copying the relevant source points of each cycle dimension, a KD tree can be constructed and the nearest point is found according to classic algorithms (more details about these classic algorithms can be found in the non-patent papers Cao Y., Wang B. ,Zhao W.-J.,et al.,"Research on Searching Algorithms for Unstructured Grid Remapping Based on KDTree," 3rd International Conference on Computer and Communication EngineeringTechnology.pp.29-33, 2020). The final step is to map the searched source grid points back to the corresponding original source grid points.

以最邻近点搜索为例,基于目标点复制的镜像方法流程如图5所示。前期工作,包括KD树构造和常规最邻近点搜索,与普通基于KD树的最近邻搜索相同。初始最近距离T0通常设置为负数或足够大的值。在第一轮数据搜索之后,目标点与其最近的源点之间的最终最短距离为T。随后,我们应该用一种特殊的方法处理每个循环维。为了简单起见,可以依次处理这些循环维度。在处理未处理的循环维度i时,应在在一开始首先比较从目标点到第i维中距目标点最近的循环边界的距离S和当前最短距离T的大小。如果S不小于T,则意味着第i维中另一个循环边界附近的点不可能比当前点更近,可以直接开始处理下一个循环维度。否则,需要在当前循环维度中进行进一步搜索。在开始新的搜索之前,我们需要将目标点复制到相应循环边界外相同的相对位置。后续的搜索可以用当前最短距离T作为初始最短距离值,它可能会帮助我们在新搜索中切断更多不必要的分支。假设新的最近距离是t,我们应该在t和T之间进行比较,并选择最小的结果作为最新的结果。在所有循环维度都经过上述操作后,最后得到的最短距离和相应的源点将是最终结果。Taking nearest neighbor point search as an example, the flow of the mirroring method based on target point copying is shown in Figure 5. The preliminary work, including KD tree construction and conventional nearest neighbor search, is the same as the ordinary nearest neighbor search based on KD tree. The initial closest distance T 0 is 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. Subsequently, we should handle each loop dimension in a special way. For simplicity, these cyclic dimensions can be processed sequentially. When processing the unprocessed cycle dimension i, the distance S from the target point to the cycle boundary closest to the target point in the i-th dimension should be compared at the beginning with the size of the current shortest distance T. If S is not less than T, it means that the point near another cycle boundary in the i-th dimension cannot be closer than the current point, and you can directly start processing the next cycle dimension. Otherwise, further searches within the current loop dimension are 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 can use the current shortest distance T as the initial shortest distance value, which may help us cut off more unnecessary branches in new searches. Suppose the new nearest distance is t, we should compare between t and T and choose the smallest result as the latest result. After all cycle dimensions have gone through the above operations, the final shortest distance and corresponding source point will be the final result.

该方法如果将最近距离换成指定距离,就可以变成针对循环空间的范围搜索。具体包括:If this method replaces the nearest distance with a specified distance, it can become a range search for the cyclic space. Specifically include:

设置搜索距离T;Set the search distance T;

依次处理每个循环维;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前搜索距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近不可能存在相关点,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each cycle dimension is processed in turn; when processing the unprocessed cycle dimension i, first compare the distance S from the target grid point to the cycle boundary closest to the target grid point in the i-th dimension and the size of the current search distance T, if S is not less than T, which means that there is no relevant point near another loop boundary in the i-th dimension, and then the next loop dimension will be processed directly; otherwise, further search will be performed in the current loop dimension;

在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,然后进行新的范围搜索;Before starting a new search, copy the target grid point to the same relative position outside the corresponding cycle boundary, and then perform a new range search;

在所有循环维度都经过上述操作后,得到相应的源网格点为最终结果。After all cycle dimensions undergo the above operations, the corresponding source grid points are obtained as the final result.

该方法如果将最近距离换成第K小的距离,就可以变成针对循环空间的K邻近点搜索。采用K邻近点搜索方法,具体包括:If this method replaces the nearest distance with the Kth smallest distance, it can become a search for K neighboring points in the cyclic space. The K neighboring point search method is adopted, including:

设置初始目标网格点和源网格点的初始第K近距离T0Set the initial Kth close distance T 0 between the initial target grid point and the source grid point;

在第一轮最近邻搜索之后,目标网格点与其最近的第K个源网格点之间的最终距离为T;After the first round of nearest neighbor search, the final distance between the target grid point and its nearest Kth source grid point is T;

依次处理每个循环维;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前最近第K个源网格点距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近不可能存在相关点,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each cycle dimension is processed in turn; when processing the unprocessed cycle dimension i, first compare the distance S from the target grid point to the cycle boundary closest to the target grid point in the i-th dimension and the current nearest Kth source grid The size of the point distance T. If S is not less than T, it means that there is no relevant point near another cycle boundary in the i-th dimension, and the next cycle dimension will be processed directly; otherwise, further search will be performed in the current cycle dimension;

在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,后续的搜索用当前第K近距离T作为初始最短距离值,以在新搜索中切断更多不必要的分支;Before starting a new search, copy the target grid point to the same relative position outside the corresponding loop boundary. Subsequent searches use the current Kth short distance T as the initial shortest distance value to cut off more unnecessary points in the new search. branch;

假设新的第K近距离是t,在t和T之间进行比较,并选择最小的结果作为最新的结果;Assume that the new Kth close distance is t, compare between t and T, and select the smallest result as the latest result;

在所有循环维度都经过上述操作后,得到的第K近距离和相应的源网格点为最终结果。After the above operations are performed in all cycle dimensions, the Kth close distance and corresponding source grid point are the final results.

常规KD树构建方法包括:准备好待划分二维点集之后即可开始构建KD树。首先判断待划分的点集是否为空集,如果是,则结束构建过程,如果否,则正式开始构建过程。第一步是选择划分维度K,常用的准则为优先划分方差高的维度。为了简单可以采用依次分割的策略。第二步为选择分割点,常用的准则为选择当前分割维度上处于中位数的点,以便分割后左右两个子树上的元素个数相当,最终形成的二叉树是个平衡二叉树,每次搜索的深度相当。中位数的选取通常需要对点进行排序,这里选用快速排序法。第三步则为根据选择好的分割点,将剩余的待划分点放入左子树点集和右子树点集中。具体规则为将K维值小于等于分割点K维值的待划分点放入左子树中,其他的则放入右子树中。左右子树点集按照之前所介绍的方法,分别递归的构建左右子树。The conventional KD tree construction method includes: after preparing the two-dimensional point set to be divided, the KD tree can be constructed. First, it is judged whether the point set to be divided is an empty set. If so, the construction process is ended. If not, the construction process is officially started. The first step is to select the division dimension K. The commonly used criterion is to prioritize the division of dimensions with high variance. For simplicity, the strategy of segmentation can be adopted. The second step is to select the split point. The commonly used criterion is to select the median point on the current split dimension so that the number of elements on the left and right subtrees after splitting is equal. The final binary tree is a balanced binary tree. Each search Quite deep. The selection of the median usually requires sorting the points, and the quick sort method is used here. The third step is to put the remaining points to be divided into the left subtree point set and the right subtree point set according to the selected split points. The specific rule is to put the points to be divided whose K-dimensional value is less than or equal to the K-dimensional value of the split point into the left subtree, and the others into the right subtree. The left and right subtree point sets are constructed recursively according to the method introduced before.

常规KD树搜索算法如下:当KD树的当前点T为空时,结束搜索。否则,首先判断T所划分的维度K并计算T与目标点M之间的距离。如果T距离M更近,则需更新最小距离D和对应的最近点。在这之后,进入子树继续搜索。如果当目标点M在划分维度K上的值小于等于当前点T在K维上的值,意味着M位于T的左子树空间内,该空间内的点与M的距离可能比右子树空间内的点与M的距离更小,因此优先递归的搜索T的左子树。反之,优先搜索T的右子树。当搜索到叶子节点时,搜索过程开始回溯。判断目标点与当前点在K维上的距离是否大于最小距离D。若是,意味着当前点T的另一子树空间内不可能存在更近的点,则可以继续回溯。否则,需要进一步搜索当前点T的另一子树空间。基于KD树的范围搜索过程与最邻近搜索过程类似,只需将最小距离D更换为固定的范围值,并将更新D和最近点的操作替换为记录当前点T即可。更多细节可参考非专利论文Cao Y.,Wang B.,Zhao W.-J.,et al.,“Research onSearching Algorithms for Unstructured Grid Remapping Based on KD Tree,”3rdInternational Conference on Computer and Communication EngineeringTechnology.pp.29-33,2020。The conventional KD tree search algorithm is as follows: When the current point T of the KD tree is empty, the search ends. Otherwise, first determine the dimension K divided by T and calculate the distance between T and the target point M. If T is closer to M, the minimum distance D and the corresponding closest point need to be updated. After this, enter the subtree and continue the search. If the value of the target point M on the division dimension K is less than or equal to the value of the current point T on the K dimension, it means that M is located in the left subtree space of T, and the distance between the points in this space and M may be greater than that of the right subtree. The distance between the point in the space and M is smaller, so the left subtree of T is searched recursively first. Otherwise, the right subtree of T is searched first. When a leaf node is searched, the search process starts backtracking. Determine whether the distance between the target point and the current point in the K dimension is greater than the minimum distance D. If so, it means that there is no closer point in another subtree space of the current point T, and you can continue to backtrack. Otherwise, another subtree space of the current point T needs to be further searched. The range search process based on KD tree is similar to the nearest neighbor search process. It only needs to replace the minimum distance D with a fixed range value, and replace the operation of updating D and the nearest point with recording the current point T. For more details, please refer to the non-patent paper Cao Y., Wang B., Zhao W.-J., et al., "Research onSearching Algorithms for Unstructured Grid Remapping Based on KD Tree," 3rdInternational Conference on Computer and Communication EngineeringTechnology.pp .29-33, 2020.

图6展示了两种镜像法在不同源点数下搜索数据的时间。源点和目标点均为4维数据,目标点数(M)为221,循环边界数为4个,源点数(N)从218到224变化,每次增加2倍。从图中可以看出,当前配置下目标点复制法优于源点复制法。源点复制法的搜索时间的增长速率几乎与Mlog2N成正比,而目标点复制法的搜索时间的增长速率明显随着源点数量的增加而减少,这是由于源点数量增加减少了目标点复制的比率导致的。Figure 6 shows the time of searching data for two mirroring methods under different number of source points. Both source points and target points are 4-dimensional data, the number of target points (M) is 2 21 , the number of cycle boundaries is 4, and the number of source points (N) changes from 2 18 to 2 24 , increasing by 2 times each time. It can be seen from the figure that the target point copying method is better than the source point copying method under the current configuration. The growth rate of the search time of the source point copying method is almost proportional to Mlog 2 N, while the growth rate of the search time of the target point copying method obviously decreases with the increase in the number of source points. This is because the increase in the number of source points reduces the target Caused by the point copy ratio.

图7展示了两种镜像法在不同目标点数下搜索数据的时间。源点和目标点均为4维数据,源点数为224,循环边界数为4个,目标点数从218到224变化,每次增加2倍。从图中可以看出源点复制法和目标点复制法的搜索时间都随着目标点的增长线性增长。此外,目标点复制法的搜索时间依旧少于源点复制法的搜索时间。Figure 7 shows the time of searching data for two mirroring methods under different number of target points. Both the source point and the target point are 4-dimensional data, the number of source points is 2 24 , the number of cycle boundaries is 4, and the number of target points changes from 2 18 to 2 24 , increasing by 2 times each time. It can be seen from the figure that the search time of the source point copy method and the target point copy method increases linearly with the increase of target points. In addition, the search time of the target point copy method is still less than the search time of the source point copy method.

本发明的有益效果如下:The beneficial effects of the present invention are as follows:

本发明既保持了KD树对网格类型无要求、适用性强的优点,又有效解决带了地球模拟系统网格重映射过程中循环边界的问题。The invention not only maintains the advantages of the KD tree having no requirements on grid types and strong applicability, but also effectively solves the problem of cyclic boundaries in the grid remapping process of the earth simulation system.

上述实施例为本发明的一种实施方式,但本发明的实施方式并不受所述实施例的限制,其他的任何背离本发明的精神实质与原理下所做的改变、修饰、代替、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above embodiment is an implementation mode of the present invention, but the implementation mode of the present invention is not limited by the above embodiment. Any other changes, modifications, substitutions, and combinations that deviate from the spirit and principles of the present invention are not allowed. , simplification, should all be equivalent replacement methods, and are all included in the protection scope of the present invention.

Claims (6)

1.基于KD树的带循环边界的地球模拟系统网格重映射方法,其特征在于,包括以下步骤:1. A KD tree-based grid remapping method for earth simulation systems with cyclic boundaries, which is characterized by including the following steps: 步骤1,将所有源网格点和目标网格点放置在每个循环维度的指定循环段内;Step 1, place all source grid points and target grid points within the specified cycle segment of each cycle dimension; 步骤2,根据目标网格点的分布情况以及目标网格点和源网格点的数量,选择不同的方法搜寻重映射目标网格点所需的相应源网格点;Step 2: According to the distribution of target grid points and the number of target grid points and source grid points, choose different methods to search for the corresponding source grid points required to remap the target grid points; 步骤201,如果目标网格点集中在循环边界附近,且目标网格点远多于源网格点,则基于KD树源点复制法搜索目标网格点对应的源网格点;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, search for the source grid points corresponding to the target grid points based on the KD tree source point copy method; 步骤202,否则基于KD树目标点复制法搜索目标网格点对应的源网格点;Step 202, otherwise search for the source grid point corresponding to the target grid point based on the KD tree target point copy method; 步骤3,根据目标网格点和对应的源网格点,重映射网格信息;Step 3: Remap the grid information based on the target grid point and the corresponding source grid point; 步骤201中所述的源点复制法包括以下步骤:对每一个循环边界对A和B,将循环边界A附近的源网格点复制到循环边界B的外侧去,将循环边界B附近的源网格点复制到循环边界A的外侧去;基于地理信息数据为原始的源网格点和复制后的源网格点构建KD树;根据经典KD树搜索算法为目标网格点搜索对应的源网格点;结果后处理,即将搜索到的源网格点映射回对应的原始的源网格点;所述的复制的范围由源网格点数据的分布特征决定,包括:The source point copying method described in step 201 includes the following steps: for each loop boundary pair A and B, copy the source grid points near the loop boundary A to the outside of the loop boundary B, and copy the source grid points near the loop boundary B to the outside of the loop boundary B. The grid points are copied to the outside of the loop boundary A; a KD tree is constructed for the original source grid points and the copied source grid points based on geographical information data; the corresponding source is searched for the target grid point according to the classic KD tree search algorithm. Grid points; post-processing of the results, that is, mapping the searched source grid points back to the corresponding original source grid points; the range of the copy is determined by the distribution characteristics of the source grid point data, including: 如果搜索空间中的任何位置与其最近的源网格点之间的最大距离为L,则仅需要复制距离循环边界L范围内的源网格点;If the maximum distance between any position in the search space and its nearest source grid point is L, then only the source grid points within the range L of the loop boundary need to be copied; 如果距离循环边界L范围内的搜索空间任何位置与其最近的源网格点之间的最大距离为L,则仅需要复制距离循环边界L范围内的源网格点;If the maximum distance between any position in the search space within the range L of the loop boundary and its nearest source grid point is L, then only the source grid points within the range L of the loop boundary need to be copied; 如果源网格点数据的分布特征未知或不确定,则每个循环边界的最大复制区域将是搜索空间的一半;If the distribution characteristics of the source grid point data are unknown or uncertain, the maximum replication area for each loop boundary will be half the search space; 步骤202中所述的目标点复制法包括以下步骤:基于地理信息数据构建KD树;获取目标网格点,在所述的KD树中搜索对应的源网格点,获得当前的源网格点搜索结果;选择一个未处理的循环维度,将目标网格点复制到距离目标网格点较远一侧循环边界的外侧对应位置处,基于复制后的目标网格点,再次搜索对应的源网格点搜索结果,并从已获得的源网格点搜索结果中比较选出当前最优源网格点搜索结果;针对剩下的循环维度,重复上述操作,以获得最终的最优源网格点。The target point copying method described in step 202 includes the following steps: constructing a KD tree based on geographical information data; obtaining the target grid point, searching for the corresponding source grid point in the KD tree, and obtaining the current source grid point Search results; select an unprocessed cycle dimension, copy the target grid point to the corresponding position outside the cycle boundary on the far side from the target grid point, and search the corresponding source network again based on the copied target grid point Grid point search results, and compare and select the current optimal source grid point search results from the obtained source grid point search results; repeat the above operations for the remaining cycle dimensions to obtain the final optimal source grid point. 2.根据权利要求1所述的基于KD树的带循环边界的地球模拟系统网格重映射方法,其特征在于,步骤202中所述的目标点复制法,在新一次搜索开始前,对于选定的循环维度,如果目标网格点距其最近的循环边界的距离大于当前的搜索阈值,则在该选定的循环维度的目标网格点复制和搜索取消。2. The earth simulation system grid remapping method with cyclic boundaries based on KD tree according to claim 1, characterized in that the target point copying method described in step 202, before starting a new search, for the selected For a certain cycle dimension, if the distance of the target grid point from its nearest cycle boundary is greater than the current search threshold, the copy and search of the target grid point in the selected cycle dimension are cancelled. 3.根据权利要求1所述的基于KD树的带循环边界的地球模拟系统网格重映射方法,其特征在于,步骤202中所述的目标点复制法,在新一次搜索中,以当前目标网格点与源网格点最优距离作为初始搜索距离。3. The KD tree-based earth simulation system grid remapping method with cyclic boundaries according to claim 1, characterized in that the target point copying method described in step 202 uses the current target in a new search. The optimal distance between the grid point and the source grid point is used as the initial search distance. 4.根据权利要求1所述的基于KD树的带循环边界的地球模拟系统网格重映射方法,其特征在于,步骤202中所述的搜索的过程中采用最近邻搜索方法,具体包括:4. The KD tree-based earth simulation system grid remapping method with cyclic boundaries according to claim 1, characterized in that the nearest neighbor search method is used in the search process described in step 202, specifically including: 设置初始目标网格点和源网格点的初始最近距离为T0Set the initial closest distance between the initial target grid point and the source grid point to T 0 ; 在第一轮最近邻搜索之后,目标网格点与其最近的源网格点之间的最短距离为T;After the first round of nearest neighbor search, the shortest distance between the target grid point and its nearest source grid point is T; 依次处理每个循环维度;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前最短距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近的点不可能比当前点更近,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each cycle dimension is processed in turn; when processing the unprocessed cycle dimension i, first compare the distance S from the target grid point to the cycle boundary closest to the target grid point in the i-th dimension and the size of the current shortest distance T, if S is not less than T, which means that the point near another loop boundary in the i-th dimension cannot be closer than the current point, then directly start processing the next loop dimension; otherwise, perform further search in the current loop dimension; 在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,后续的搜索用当前最短距离T作为初始最短距离值,以在新搜索中切断更多不必要的分支;Before starting a new search, copy the target grid point to the same relative position outside the corresponding cycle boundary. Subsequent searches use the current shortest distance T as the initial shortest distance value to cut off more unnecessary branches in the new search; 假设最新的最近距离是t,在t和T之间进行比较,并选择最小的结果作为最新的搜索结果;Assume that the latest closest distance is t, compare between t and T, and select the smallest result as the latest search result; 在所有循环维度都经过上述操作后,得到最终的最短距离和相应的源网格点为最终结果。After all cycle dimensions undergo the above operations, the final shortest distance and corresponding source grid point are obtained as the final result. 5.根据权利要求1所述的基于KD树的带循环边界的地球模拟系统网格重映射方法,其特征在于,步骤202中所述的搜索的过程中采用K邻近点搜索方法,具体包括:5. The KD tree-based earth simulation system grid remapping method with cyclic boundaries according to claim 1, characterized in that the K neighboring point search method is used in the search process described in step 202, which specifically includes: 设置初始目标网格点和源网格点的初始第K近距离T0Set the initial Kth close distance T 0 between the initial target grid point and the source grid point; 在第一轮最近邻搜索之后,目标网格点与其最近的第K个源网格点之间的最终距离为T;After the first round of nearest neighbor search, the final distance between the target grid point and its nearest Kth source grid point is T; 依次处理每个循环维;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前最近第K个源网格点距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近不可能存在相关点,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each cycle dimension is processed in turn; when processing the unprocessed cycle dimension i, first compare the distance S from the target grid point to the cycle boundary closest to the target grid point in the i-th dimension and the current nearest Kth source grid The size of the point distance T. If S is not less than T, it means that there is no relevant point near another cycle boundary in the i-th dimension, and the next cycle dimension will be processed directly; otherwise, further search will be performed in the current cycle dimension; 在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,后续的搜索用当前第K近距离T作为初始最短距离值,以在新搜索中切断更多不必要的分支;Before starting a new search, copy the target grid point to the same relative position outside the corresponding loop boundary. Subsequent searches use the current Kth short distance T as the initial shortest distance value to cut off more unnecessary points in the new search. branch; 假设新的第K近距离是t,在t和T之间进行比较,并选择最小的结果作为最新的结果;Assume that the new Kth close distance is t, compare between t and T, and select the smallest result as the latest result; 在所有循环维度都经过上述操作后,得到的第K近距离和相应的源网格点为最终结果。After the above operations are performed in all cycle dimensions, the Kth close distance and corresponding source grid point are the final results. 6.根据权利要求1所述的基于KD树的带循环边界的地球模拟系统网格重映射方法,其特征在于,步骤202中所述的搜索的过程中采用范围搜索方法,具体包括:6. The KD tree-based earth simulation system grid remapping method with cyclic boundaries according to claim 1, characterized in that the range search method is used in the search process described in step 202, specifically including: 设置搜索距离T;Set the search distance T; 依次处理每个循环维;在处理未处理的循环维度i时,首先比较从目标网格点到第i维中距目标网格点最近的循环边界的距离S和当前搜索距离T的大小,如果S不小于T,意味着第i维中另一个循环边界附近不可能存在相关点,则直接开始处理下一个循环维度;否则,在当前循环维度中进行进一步搜索;Each loop dimension is processed in turn; when processing the unprocessed loop dimension i, first compare the distance S from the target grid point to the loop boundary closest to the target grid point in the i-th dimension and the size of the current search distance T, if S is not less than T, which means that there is no relevant point near another loop boundary in the i-th dimension, and then the next loop dimension will be processed directly; otherwise, further search will be performed in the current loop dimension; 在开始新的搜索之前,将目标网格点复制到相应循环边界外相同的相对位置,然后进行新的范围搜索;Before starting a new search, copy the target grid point to the same relative position outside the corresponding cycle boundary, and then perform a new range search; 在所有循环维度都经过上述操作后,得到相应的源网格点为最终结果。After all cycle dimensions undergo the above operations, the corresponding source grid points are obtained as the final result.
CN202210517802.4A 2022-05-12 2022-05-12 Grid remapping method of earth simulation system with circulating boundary based on KD tree Active CN114998513B (en)

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 CN114998513A (en) 2022-09-02
CN114998513B true 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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100418092C (en) * 2006-02-20 2008-09-10 南京联创科技股份有限公司 Grid and T-tree index method for rapid positioning in main memory database
US7852336B2 (en) * 2006-11-28 2010-12-14 International Business Machines Corporation Dynamic determination of optimal spatial index mapping to processor thread resources
US9041713B2 (en) * 2006-11-28 2015-05-26 International Business Machines Corporation Dynamic spatial index remapping for optimal aggregate performance

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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)

* Cited by examiner, † Cited by third party
Title
general data search algorithms for earth simulation systems with cyclic boundaries;yu cao et al;《international journal of geo-information》;1-13 *
Research on Searching Algorithms for Unstructured Grid Remapping Based on KD Tree;Yu Cao 等;《2020 IEEE 3rd International Conference on Computer and Communication Engineering Technology (CCET)》;29-33 *
大规模地貌场景的实时纹理合成;朱涛;罗仕鉴;;计算机工程(10);264-266 *

Also Published As

Publication number Publication date
CN114998513A (en) 2022-09-02

Similar Documents

Publication Publication Date Title
Jiang et al. Hop doubling label indexing for point-to-point distance querying on scale-free networks
Zhang et al. Scalable skyline computation using object-based space partitioning
CN106528793B (en) Space-time fragment storage method of distributed spatial database
CN104281617A (en) Domain knowledge-based multilayer association rules mining method and system
US10545915B2 (en) Recursive multi-threaded file system scanner for serializing file system metadata exoskeleton
CN109241355A (en) Accessibility querying method, system and the readable storage medium storing program for executing of directed acyclic graph
CN107766406A (en) A kind of track similarity join querying method searched for using time priority
CN108134739B (en) Route searching method and device based on index trie
CN111291085B (en) Hierarchical interest matching method, device, computer equipment and storage medium
TW201837749A (en) Method and device for searching group based on social networks
US20180336224A1 (en) Hash-based synchronization of geospatial vector features
CN117150082B (en) A Neighbor Graph Update Method for Approximate Nearest Neighbor Search
CN114491200A (en) Heterogeneous interest point matching method and device based on graph neural network
CN116521949A (en) A retrieval optimization method and system for astronomical star catalogs
Abdelhafeez et al. DDCEL: Efficient distributed doubly connected edge list for large spatial networks
CN114998513B (en) Grid remapping method of earth simulation system with circulating boundary based on KD tree
CN115114464A (en) Power grid graph database storage method based on multi-Hash algorithm
CN103761298A (en) Distributed-architecture-based entity matching method
CN119848361A (en) Method for storing and retrieving large data of space vector of black soil ploughing quality
CN110008215A (en) A Big Data Search Method Based on Improved KD Tree Parallel Algorithm
CN113076448A (en) Community discovery method based on extremely large cliques and strongly connected components
CN109063222B (en) Self-adaptive data searching method based on big data
CN114741621B (en) Heterogeneous gate address matching method, device, computer equipment and storage medium
CN115292962B (en) Path similarity matching method and device based on track rarefaction and storage medium
CN110807061A (en) Method for searching frequent subgraphs of uncertain graphs based on layering

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
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

GR01 Patent grant
GR01 Patent grant