WO2022011851A1 - 度量空间划分方式评价方法、装置、计算机设备及存储介质 - Google Patents

度量空间划分方式评价方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2022011851A1
WO2022011851A1 PCT/CN2020/119968 CN2020119968W WO2022011851A1 WO 2022011851 A1 WO2022011851 A1 WO 2022011851A1 CN 2020119968 W CN2020119968 W CN 2020119968W WO 2022011851 A1 WO2022011851 A1 WO 2022011851A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
neighborhood
metric space
divide
evaluating
Prior art date
Application number
PCT/CN2020/119968
Other languages
English (en)
French (fr)
Inventor
毛睿
赖裕雄
李胜
陈家颖
陈汝斌
戴英龙
陆敏华
Original Assignee
深圳计算科学研究院
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 深圳计算科学研究院 filed Critical 深圳计算科学研究院
Publication of WO2022011851A1 publication Critical patent/WO2022011851A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2237Vectors, bitmaps or matrices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24554Unary operations; Data partitioning operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Definitions

  • the present invention relates to the technical field of data processing, in particular to a method, device, computer equipment and storage medium for evaluating a metric space division method.
  • metric space indexes are based on distance division, and the data space is divided into multiple regions by using the relationship between the distances of several data to the support point, so that the index can be excluded from the range search. area to improve search efficiency.
  • Existing partition-based metric space indexes are mainly based on spherical partitioning or hyperplane partitioning.
  • partition-based metric space indexes can be divided into two parts based on spherical partition and hyperplane based on the logical form of the subspace of the partition result.
  • the index method based on spherical partitioning uses the support point and radius as parameters to divide the space into multiple spherical subspaces.
  • Typical forms include spherical partitioning of space represented by vp-tree and hierarchical spherical partitioning represented by M-tree two kinds.
  • the vp-tree directly uses the distance from the data to the support point to divide the data into two parts, the inner part and the outer part, while the M-tree uses the minimum boundary sphere to divide the data in a balanced manner.
  • hyperplane-based division The core idea of hyperplane-based division is to divide the data into the area represented by the support point closest to itself, and the divided space logically shows the shape of Voronoi.
  • the most basic form based on hyperplane division is the hyperplane tree gh-tree proposed by Jeffrey K.Uhlmann and the GNA-tree proposed by Sergey Brin.
  • the result of hyperplane division has good geometric properties, and the regions obtained by the division do not overlap each other.
  • the purpose of the present invention is to provide an evaluation method, device, computer equipment and storage medium for a metric space division method, aiming to solve the problems of low efficiency and high time cost of the existing evaluation method.
  • An embodiment of the present invention provides a method for evaluating a metric space division manner, including:
  • Input n normal vectors as the normal vector for dividing the hyperplane and the range search radius r;
  • the data in the metric space is mapped to two-dimensional vector data
  • the number of data falling into the r-neighborhood is output, and the evaluation result of the division method is output according to the number.
  • the data is completely divided and the data falling into the r-neighborhood is calculated, including:
  • calculating the width of the r-neighborhood using the normal vector and the range search radius r including:
  • a i represents the weight of the distance from the data to the i-th support point.
  • the previous subspace is divided into two independent subspaces that do not intersect with each other, and the data falling within the r-neighborhood is marked.
  • the metric space is a two-tuple (S, d), where S is a finite and non-empty data set, and d is a distance function defined on S.
  • An embodiment of the present invention provides an apparatus for evaluating a metric space division method, including:
  • the acquisition unit is used to divide the metric space for the data in the database, and acquire n normal vectors;
  • the input unit is used to input n normal vectors as the normal vector for dividing the hyperplane and the range search radius r;
  • the support point selection unit is used to select n support points by using the point selection algorithm
  • the mapping unit is used to map the data in the metric space into two-dimensional vector data with the distance from the data to the support point as the coordinate;
  • the evaluation unit is configured to output the number of data falling into the r-neighborhood, and output the evaluation result of the division method according to the number.
  • An embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the above when executing the computer program
  • the described metric space division method evaluation method
  • An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when executed by a processor, the computer program causes the processor to perform the above-mentioned metric space division method of evaluation.
  • the embodiments of the present invention provide a method, device, computer equipment and storage medium for evaluating a metric space division method.
  • the method includes: dividing data in a database into a metric space to obtain n normal vectors; inputting n normal vectors as a dividing hyperplane The normal vector and the range search radius r; use the point selection algorithm to select n support points; use the distance from the data to the support point as the coordinate, map the data in the metric space into two-dimensional vector data; completely divide the data, and calculate Data falling into the r-neighborhood; output the number of data falling into the r-neighborhood, and output the evaluation result of the division method according to the number.
  • the embodiment of the present invention does not need to perform a range search on all data in the database, but only needs to calculate the number of data that falls near the division boundary and cannot be excluded when creating an index, which greatly improves the efficiency of evaluation and reduces time. cost.
  • FIG. 1 is a schematic flowchart of a method for evaluating a metric space division mode provided by an embodiment of the present invention
  • FIG. 2 is a schematic block diagram of an apparatus for evaluating a metric space division manner provided by an embodiment of the present invention.
  • an embodiment of the present invention provides a method for evaluating a metric space division manner, which includes steps S101-S106:
  • the data in the database is divided into the metric space to obtain n normal vectors.
  • the metric space is a two-tuple (S, d), where S is a finite, non-empty set of data, and d is a distance function defined on S.
  • the distance function satisfies:
  • the meaning of the range search radius r is: for a given search target q and search radius r, the range search returns all data in the data set whose distance from the search target q is less than or equal to r.
  • the results of the range search are defined by the triangular inequality relationship of the distance between the search target q and each support point. Some of them are parts that cannot be excluded by the triangular inequality relationship. Whether there is an intersection with the part that cannot be excluded determines whether the data on one side of the division boundary can be excluded.
  • the region appears as a hypercube with q as the geometric center. Therefore, in the process of mapping the metric space to the support point space, the result of the range search is contained in a hypercube in the support point space, and the query sphere center point q is mapped into the support point space to search for the geometric center of the hypercube.
  • the support point selection algorithm (such as FFT (maximum closest distance first), incremental model and other algorithms) can be used to select two supports Points p 1 , p 2 .
  • the data in the metric space is mapped into two-dimensional vector data.
  • the support point space F P,d (S) is the image of S in R n:
  • the step S105 includes:
  • the step S202 includes:
  • a i represents the weight of the distance from the data to the i-th support point.
  • the r-neighborhood of the division boundary L refers to an area "near" the division boundary L.
  • the center q of the range search R(q,r) falls into this area, when the range search is performed, the triangular inequality cannot be used to determine the division boundary.
  • the regions on both sides are excluded and denoted as Nr(L).
  • the r-neighborhood of the division boundary L can be expressed in the metric space as, when the range search center q falls into the area, for example, the aforementioned unavoidable part and the division boundary L must intersect.
  • the pruning capability of the index is judged by the amount of the data falling into the r-neighborhood after the division, so as to determine the quality of the division.
  • the r-neighborhood is the area enclosed by two hyperplanes parallel to the dividing boundary.
  • the step S203 includes:
  • the previous subspace is divided into two independent subspaces that do not intersect with each other, and the data falling within the r-neighborhood range is marked.
  • Each boundary of the linear division is mapped into the support point space, and it is expressed as a hyperplane in a multi-dimensional space.
  • These hyperplanes that divide the space are called division hyperplanes.
  • n linearly independent ordered vectors are selected as the normal vectors for dividing the hyperplane, v 1 ,...,v n .
  • v 1 is the normal vector parallel to the hyperplane support point space is divided into k sub-spaces, then the k v 2 in parallel to the normal vector of the hyperplane (acting in parallel may be different on different sub-space hyperplanes) for each subspace It is further divided into k subspaces, and so on, until the n normal vectors are exhausted to generate kn subspaces.
  • the number of data falling into the r-neighborhood can be used as the performance evaluation index of the division method, and the evaluation result of the division method is output through the number.
  • the embodiment of the present invention does not need to perform a range search on all data in the database, but only needs to calculate the number of data that falls near the division boundary and cannot be excluded when the index is created, which greatly reduces the time cost of evaluation and improves the efficiency of evaluation. efficient. You only need to write a set of codes to measure the performance of different indexing methods. Through the embodiments of the present invention, the metric space division methods can be compared under the same conditions, and are less affected by other factors, and the comparison results are more objective.
  • an embodiment of the present invention further provides a metric space division method evaluation apparatus 200, which includes:
  • the obtaining unit 201 is used to divide the data in the database into the metric space, and obtain n normal vectors;
  • Input unit 202 for inputting n normal vectors as the normal vector of dividing hyperplane and the range search radius r;
  • the support point selection unit 203 is used to select n support points by using a point selection algorithm
  • the mapping unit 204 is used to map the data in the metric space into two-dimensional vector data with the distance from the data to the support point as a coordinate;
  • the complete division unit 205 is used to completely divide the data and calculate the data falling into the r-neighborhood;
  • the evaluation unit 206 is configured to output the number of data falling into the r-neighborhood, and output the evaluation result of the division method according to the number.
  • the complete division unit 205 includes:
  • the judgment unit is used to judge whether the vectors in the vector group are used up, and if so, count the number of data falling into the r-neighborhood;
  • a calculation unit for calculating the width of the r-neighborhood using the normal vector and the range search radius r if otherwise;
  • the division unit is used to sequentially take out the normal vector to divide the current subspace independently, and mark the data falling into the neighborhood of the division boundary r;
  • the computing unit includes:
  • Subcomputing unit for calculating the width of the r-neighborhood as follows:
  • a i represents the weight of the distance from the data to the i-th support point.
  • the dividing unit includes:
  • the first division unit is used to extract one of the normal vectors to construct the division hyperplane, divide the previous subspace into multiple independent subspaces that do not intersect with each other, and mark the data falling within the r-neighborhood;
  • the second dividing unit is used for then taking out the next normal vector to construct a dividing hyperplane, dividing the plurality of independent subspaces respectively, and marking the data falling within the r-neighborhood;
  • Loop unit which is used in sequence until all normal vectors are used up.
  • the previous subspace is divided into two independent subspaces that do not intersect with each other, and data falling within the r-neighborhood is marked.
  • the metric space is a two-tuple (S, d), where S is a finite, non-empty set of data, and d is a distance function defined on S.
  • the distance function satisfies:
  • An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory and running on the processor, where the processor implements the above-mentioned computer program when executing the computer program The evaluation method of the metric space division method.
  • An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when executed by a processor, the computer program causes the processor to execute the above-mentioned metric space division method Evaluation method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种度量空间划分方式评价方法、装置(200)、计算机设备及存储介质,方法包括:对数据库中的数据进行度量空间的划分,获取n个法向量(S101);输入n个法向量作为划分超平面的法向量和范围搜索半径r(S102);利用选点算法选取n个支撑点(S103);以数据到支撑点的距离作为坐标,将度量空间中的数据映射为二维向量数据(S104);对数据进行完全划分,并计算落入r-邻域的数据(S105);输出落入r-邻域的数据的数目,并根据所述数目输出划分方法的评价结果(S106)。所述方法不需要对数据库中的所有数据进行范围搜索,只需要在创建索引时计算出落入划分边界附近无法被排除的数据个数即可,极大地降低了评价的时间成本和提高了效率。

Description

度量空间划分方式评价方法、装置、计算机设备及存储介质 技术领域
本发明涉及数据处理技术领域,特别涉及度量空间划分方式评价方法、装置、计算机设备及存储介质。
背景技术
现有的树形度量空间索引大多是基于距离划分的,利用若干个数据到支撑点的距离之间的关系将数据空间划分成多个区域,以求在对索引进行范围搜索时可以排除掉部分区域从而提高搜索效率。现有基于划分的度量空间索引主要是基于球形划分或者基于超平面划分进行的。
其中,现有的基于划分的度量空间索引,根据划分结果的子空间的逻辑形态,大多可以分为以球形划分为基础和以超平面为基础两部分。
基于球形划分的索引方法利用支撑点和半径作为参数将空间划分成多个球子空间,典型的形态有以vp-tree为代表的对空间进行球形划分和以M-tree为代表的层次球形划分两种。vp-tree直接利用数据到支撑点的距离,将数据划分成球内和球外两个部分,而M-tree利用最小边界球的形式将数据进行平衡划分。
基于超平面划分的核心思想是将数据划分到离自己最近的支撑点所代表的区域,划分后的空间在逻辑上显现出Voronoi的形态。基于超平面划分的最基本形式是Jeffrey K.Uhlmann提出来的超平面树gh-tree和Sergey Brin提出了GNA-tree。超平面划分的结果具有良好的几何特性,其划分所得的各区域之间不相互重叠。
但不同索引之间的性能比较都是通过各自进行,而不同的索引方法的索引条件往往是不相同的,性能影响也由多个因素共同决定,支撑点的不同、划分方式的不同、索引的平衡性等等都会对索引的性能造成较大的影响。利用不同的索引直接进行性能比较无法比对,无法客观地反映不同划分方式的内在差异,各种条件的差异也大大降低了客观性,同时效率低,时间成本高。
发明内容
本发明的目的是提供度量空间划分方式评价方法、装置、计算机设备及存储介质,旨在解决现有评价方式效率低、时间成本高等问题。
本发明实施例提供一种度量空间划分方式评价方法,其中,包括:
对数据库中的数据进行度量空间的划分,获取n个法向量;
输入n个法向量作为划分超平面的法向量和范围搜索半径r;
利用选点算法选取n个支撑点;
以数据到支撑点的距离作为坐标,将度量空间中的数据映射为二维向量数据;
对数据进行完全划分,并计算落入r-邻域的数据;
输出落入r-邻域的数据的数目,并根据所述数目输出划分方法的评价结果。
进一步,所述对数据进行完全划分,并计算落入r-邻域的数据,包括:
判断向量组中的向量是否用完,若是则统计落入r-邻域的数据的数目;
若否则利用法向量和范围搜索半径r计算r-邻域的宽度;
依次取出法向量对当前子空间进行独立的划分,并标记落入划分边界r邻域的数据;
统计落入r-邻域的数据的数目。
进一步,所述利用法向量和范围搜索半径r计算r-邻域的宽度,包括:
按如下公式计算r-邻域的宽度:
Figure PCTCN2020119968-appb-000001
其中,a i表示数据到第i个支撑点距离的权值。
进一步,所述依次取出法向量对当前子空间进行独立的划分,并标记落入划分边界r邻域的数据,包括:
取出其中一个法向量构造划分超平面,将上一子空间划分成互不相交的多个独立子空间,并对落入r-邻域范围内的数据进行标记;
然后取出下一个法向量构造划分超平面,分别对所述多个独立子空间进行划分,并对落入r-邻域范围内的数据进行标记;
依次类推,直至用完所有法向量。
进一步,将上一子空间划分成互不相交的两个独立子空间,并对落入r-邻域范围内的数据进行标记。
进一步,所述度量空间为二元组(S,d),其中S是有限非空的数据集合,而 d是定义在S上的距离函数。
进一步,所述距离函数满足:
对于任意x,y,S,d(x,y)≥0,并且d(x,y)=0时,x=y;
对于任意x,y,S,d(x,y)=d(y,x);
对于任意x,y,z,S,d(x,y)+d(y,z)≥d(x,z)。
本发明实施例提供一种度量空间划分方式评价装置,其中,包括:
获取单元,用于对数据库中的数据进行度量空间的划分,获取n个法向量;
输入单元,用于输入n个法向量作为划分超平面的法向量和范围搜索半径r;
支撑点选取单元,用于利用选点算法选取n个支撑点;
映射单元,用于以数据到支撑点的距离作为坐标,将度量空间中的数据映射为二维向量数据;
完全划分单元,用于对数据进行完全划分,并计算落入r-邻域的数据;
评价单元,用于输出落入r-邻域的数据的数目,并根据所述数目输出划分方法的评价结果。
本发明实施例提供一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现如上所述的度量空间划分方式评价方法。
本发明实施例提供一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行如上所述的度量空间划分方式评价方法。
本发明实施例提供了度量空间划分方式评价方法、装置、计算机设备及存储介质,方法包括:对数据库中的数据进行度量空间的划分,获取n个法向量;输入n个法向量作为划分超平面的法向量和范围搜索半径r;利用选点算法选取n个支撑点;以数据到支撑点的距离作为坐标,将度量空间中的数据映射为二维向量数据;对数据进行完全划分,并计算落入r-邻域的数据;输出落入r-邻域的数据的数目,并根据所述数目输出划分方法的评价结果。本发明实施例不需要对数据库中的所有数据进行范围搜索,只需要在创建索引时计算出落入划分边界附近无法被排除的数据个数即可,极大地提高了评价的效率和降低了时间成本。
附图说明
为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的度量空间划分方式评价方法的流程示意图;
图2为本发明实施例提供的度量空间划分方式评价装置的示意性框图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本发明说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本发明。如在本发明说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当进一步理解,在本发明说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
请参阅图1,本发明实施例提供一种度量空间划分方式评价方法,其包括步骤S101~S106:
S101、对数据库中的数据进行度量空间的划分,获取n个法向量;
首先对数据库中的数据进行度量空间的划分,以此获取n个法向量。
所述度量空间为二元组(S,d),其中S是有限非空的数据集合,而d是定义在S上的距离函数。
在一实施例中,所述距离函数满足:
对于任意x,y,S,d(x,y)≥0,并且d(x,y)=0时,x=y;
对于任意x,y,S,d(x,y)=d(y,x);
对于任意x,y,z,S,d(x,y)+d(y,z)≥d(x,z)。
S102、输入n个法向量作为划分超平面的法向量和范围搜索半径r;
例如划分两个划分边界d(x,p 1)–d(x,p 2)=d和d(x,p 1)–d(x,p 2)=d(d表示任意常数),对数据进行完全划分,则输入法向量(1,-1)、(1,1)和常用的范围搜索半径r(如r=1)。
所述范围搜索半径r的意义为:对于给定的搜索目标q和搜索半径r,范围搜索返回数据集中所有距离搜索目标q的距离小于等于r的数据。
在度量空间树形索引进行范围搜索时,利用搜索目标q到各个支撑点的距离的三角不等关系对范围搜索的结果进行界定,其中有部分是三角不等关系无法排除的部分,根据划分边界和无法排除的部分是否有交集确定是否能够对划分边界一侧的数据进行排除。无法排除的部分是以支撑点为圆心,以d(q,p i)±r(i=1,2,...,n)为半径的圆弧围成的不规则区域。利用搜索目标q到支撑点的距离将该无法排除的部分区域映射到支撑点空间中时,该区域表现为以q为几何中心的超立方体。因此,在将度量空间映射到支撑点空间过程中,范围搜索的结果包含在支撑点空间中的一个超立方体中,查询球中心点q映射成支撑点空间搜索超立方体的几何中心。
S103、利用选点算法选取n个支撑点;
根据向量组(1,-1)、(1,1)判断出n=2,那么可利用支撑点选点算法(如FFT(最大最近距离优先)、增量模型等算法)选取出两个支撑点p 1,p 2
S104、以数据到支撑点的距离作为坐标,将度量空间中的数据映射为二维向量数据;
例如以数据到支撑点p 1,p 2的距离作为坐标,将度量空间中的数据都映射成二维向量数据。
度量空间(M,d),S={s i|s i∈M,i=1,2,...,m},S中选择的n个支撑点P={p 1,p 2,...,p n},对于
Figure PCTCN2020119968-appb-000002
以其到支撑点的距离d(s,p i)作为坐标,可以定义一个从M到n维空间的映射,用s p表示s在n维空间中的像,则有:
F P,d:M->R n:s P≡F P,d(s)=(f 1(s),f 2(s),...,f n(s))=(d(s,p 1),d(s,p 2),...,d(s,p n))∈F P,d(M).
支撑点空间F P,d(S)就是S在R n的像:
F P,d(s)={s P|s P=d(s,p 1),d(s,p 2),...,d(s,p n)),s∈S}.
假设度量空间中三个数据s 1,s 2,s 3,其中d(s 2,s 1)=12,d(s 2,s 3)=23,d(s 1,s 3)=13,当选用s 1,s 3两个支撑点时,得到的支撑点空间维度为2,s 1,s 2,s 3在支撑点空间中的像分别为s 1 P=(d(s 1,s 1),d(s 1,s 3))=(0,13),s 2 P=(d(s 2,s 1),d(s 2,s 3))=(12,23),s 3 P=(d(s 3,s 1),d(s 3,s 3))=(13,0)。
S105、对数据进行完全划分,并计算落入r-邻域的数据;
在一实施例中,所述步骤S105包括:
S201、判断向量组中的向量是否用完,若是则统计落入r-邻域的数据的数目;
由于本实施例需要循环判断,所以先判断向量组中的向量是否已用完,没有的话则继续执行,即执行步骤S202,如果已用完,则直接统计即可。
S202、若否则利用法向量和范围搜索半径r计算r-邻域的宽度;
在一实施例中,所述步骤S202包括:
按如下公式计算r-邻域的宽度:
Figure PCTCN2020119968-appb-000003
其中,a i表示数据到第i个支撑点距离的权值。
划分边界L的r-邻域是指划分边界L“附近”的一个区域,当范围搜索R(q,r)的中心q落入该区域时,进行范围搜索时,利用三角不等式无法对划分边界两边的区域进行排除,记作Nr(L)。
划分边界L的r-邻域在度量空间中可以表述为,当范围搜索中心q落入到区域时,例如前述的无法排除的部分和划分边界L必相交。
从r-邻域的定义可知,在进行范围查找时q落入某个划分边界的r-邻域的机率越大,该划分边界有效地排除掉另一半数据的概率越低,该划分边界的剪枝能力越差。也即,r-邻域大小和划分边界的剪枝能力成负相关关系。本发明实施例利用的就是划分之后数据落入r-邻域内的数据的多少判断索引的剪枝能力,从而确定划分的优劣。
在支撑点空间中,r-邻域为与划分边界平行的两个超平面所包围的区域,当搜索超立方体的几何中心q落入该区域时,立方体必与划分边界相交,划分边界两边的数据在本次搜索中都无法被排除。
S203、依次取出法向量对当前子空间进行独立的划分,并标记落入划分边界r邻域的数据;
在一实施例中,所述步骤S203包括:
取出其中一个法向量构造划分超平面,将上一子空间划分成互不相交的多个独立子空间,并对落入r-邻域范围内的数据进行标记;
然后取出下一个法向量构造划分超平面,分别对所述多个独立子空间进行划分,并对落入r-邻域范围内的数据进行标记;
依次类推,直至用完所有法向量。
例如利用向量组(1,-1)、(1,1)对数据进行二路划分,则第一次取出(1,-1)构造划分超平面x-y=d,将当前空间划分成两个互不相交的独立子空间记为子空间1和子空间2,并标记所有
Figure PCTCN2020119968-appb-000004
的数据的isRN=true;第二次取出(1,1)构造划分超平面x+y=d 1,对子空间1进行划分,并标记所有
Figure PCTCN2020119968-appb-000005
的数据的isRN=true,利用x+y=d 2对子空间2进行划分,并标记所有并标志所有
Figure PCTCN2020119968-appb-000006
的数据的isRN=true。
在本实施例中,将上一子空间划分成互不相交的两个独立子空间,并对落入r-邻域范围内的数据进行标记。线性划分的每个边界映射到支撑点空间中,都表现为多维空间中的超平面,将这些将空间进行划分的超平面称之为划分超平面。当n=2时,2维平面上的划分超平面表现为直线,每条直线将当前平面划分成两个不相交的部分;当n=3时,3维空间的超平面表现为平面,每个平面将当前空间划分成两个不相交的部分。
对于度量空间(M,d),
Figure PCTCN2020119968-appb-000007
在S中选择出n个支撑点p 1,p 2,...,p n
Figure PCTCN2020119968-appb-000008
利用线性关系a 1·d(s,p 1)+a 2·d(s,p 2)+...+a n·d(s,p n)=c(c和a i都是常数,i=1,2,...,n)作为边界对数据进行划分的方法称为线性划分,其中a i表示数据到第i个支撑点距离的权值。在支撑点空间中,线性划分的划分边界表现为以(a 1,a 2,...,a n)作为法向量的超平面a 1x 1+a 2x 2+...+a nx n=c。线性划分的每一个边界都可以用一个对应的线性方程进行描述,每种线性划分方式都可以一组对应的线性方程组进行表示。如果没有特别说明的话,本发明实施例所提到的划分方法都属于线性划分。
完全线性划分是特殊的线性划分,对于n个支撑点的支撑点空间,选定n 个线性无关的有序向量作为划分超平面的法向量,v 1,…,v n,首先用k个以v 1为法向量的平行超平面把支撑点空间划分为k个子空间,然后对每个子空间用k个以v 2为法向量的平行超平面(作用于不同子空间的平行超平面可能不同)进一步划分为k个子空间,如此类推,直到穷尽n个法向量产生kn个子空间。
具体的,在三维空间中利用3个无关向量(1,0,0),(0,1,0),(0,0,1)对数据进行(3,2)完全线性划分时,先利用(1,0,0)所指示的超平面x1=c1(相当于1*x1+0*x2+0*x3=c1)将空间划分成互不相交的两个子空间。对于两个子空间,分别利用第二个向量(0,1,0)所指示的超平面x 2=c 21(相当于0*x 1+1*x 2+0*x 3=c 21)和x 2=c 22(相当于0*x 1+1*x 2+0*x 3=c 22)分别对上述划分得到的两个子空间进行划分,得到4个互不相交的子空间;最后利用第三个向量(0,0,1)所指示的超平面x 3=c 31(相当于0*x 1+0*x 2+1*x 3=c 31)、x 3=c 32(相当于0*x 1+0*x 2+1*x 3=c 32)、x 3=c 33(相当于0*x 1+0*x2+1*x 3=c 33)和x 3=c 34(相当于0*x 1+0*x 2+1*x 3=c 34)分别对上述划分得到的4个子空间进行划分,得到8个互不相交的子空间。
S204、统计落入r-邻域的数据的数目。
此步骤就是统计数据集中所有isRN=true的数据,即得到落入r-邻域中的数据数目。
S106、输出落入r-邻域的数据的数目,并根据所述数目输出划分方法的评价结果。
该落入r-邻域的数据的数目即可作为划分方法的性能评价指标,通过所述数目输出划分方法的评价结果。
本发明实施例不需要对数据库中的所有数据进行范围搜索,只需要在创建索引时计算出落入划分边界附近无法被排除的数据个数即可,极大地降低了评价的时间成本和提高了效率。只需要编写一套代码即可对不同的索引方式进行性能的衡量。通过本发明实施例,可以对度量空间划分方式能够在同一的条件下进行比较,受其它因素影响更小,比较结果更加客观。
请参阅图2,本发明实施例还提供一种度量空间划分方式评价装置200,其包括:
获取单元201,用于对数据库中的数据进行度量空间的划分,获取n个法向量;
输入单元202,用于输入n个法向量作为划分超平面的法向量和范围搜索半径r;
支撑点选取单元203,用于利用选点算法选取n个支撑点;
映射单元204,用于以数据到支撑点的距离作为坐标,将度量空间中的数据映射为二维向量数据;
完全划分单元205,用于对数据进行完全划分,并计算落入r-邻域的数据;
评价单元206,用于输出落入r-邻域的数据的数目,并根据所述数目输出划分方法的评价结果。
在一实施例中,所述完全划分单元205包括:
判断单元,用于判断向量组中的向量是否用完,若是则统计落入r-邻域的数据的数目;
计算单元,用于若否则利用法向量和范围搜索半径r计算r-邻域的宽度;
划分单元,用于依次取出法向量对当前子空间进行独立的划分,并标记落入划分边界r邻域的数据;
统计单元,用于统计落入r-邻域的数据的数目。
在一实施例中,所述计算单元包括:
子计算单元,用于按如下公式计算r-邻域的宽度:
Figure PCTCN2020119968-appb-000009
其中,a i表示数据到第i个支撑点距离的权值。
在一实施例中,所述划分单元包括:
第一划分单元,用于取出其中一个法向量构造划分超平面,将上一子空间划分成互不相交的多个独立子空间,并对落入r-邻域范围内的数据进行标记;
第二划分单元,用于然后取出下一个法向量构造划分超平面,分别对所述多个独立子空间进行划分,并对落入r-邻域范围内的数据进行标记;
循环单元,用于依次类推,直至用完所有法向量。
在一实施例中,将上一子空间划分成互不相交的两个独立子空间,并对落入r-邻域范围内的数据进行标记。
在一实施例中,所述度量空间为二元组(S,d),其中S是有限非空的数据集合,而d是定义在S上的距离函数。
在一实施例中,所述距离函数满足:
对于任意x,y,S,d(x,y)≥0,并且d(x,y)=0时,x=y;
对于任意x,y,S,d(x,y)=d(y,x);
对于任意x,y,z,S,d(x,y)+d(y,z)≥d(x,z)。
上述装置实施例的具体技术细节与前述方法实施例的内容对应,故此处不再赘述。
本发明实施例还提供一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上所述的度量空间划分方式评价方法。
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行如上所述的度量空间划分方式评价方法。
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的状况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。

Claims (10)

  1. 一种度量空间划分方式评价方法,其特征在于,包括:
    对数据库中的数据进行度量空间的划分,获取n个法向量;
    输入n个法向量作为划分超平面的法向量和范围搜索半径r;
    利用选点算法选取n个支撑点;
    以数据到支撑点的距离作为坐标,将度量空间中的数据映射为二维向量数据;
    对数据进行完全划分,并计算落入r-邻域的数据;
    输出落入r-邻域的数据的数目,并根据所述数目输出划分方法的评价结果。
  2. 根据权利要求1所述的度量空间划分方式评价方法,其特征在于,所述对数据进行完全划分,并计算落入r-邻域的数据,包括:
    判断向量组中的向量是否用完,若是则统计落入r-邻域的数据的数目;
    若否则利用法向量和范围搜索半径r计算r-邻域的宽度;
    依次取出法向量对当前子空间进行独立的划分,并标记落入划分边界r邻域的数据;
    统计落入r-邻域的数据的数目。
  3. 根据权利要求2所述的度量空间划分方式评价方法,其特征在于,所述利用法向量和范围搜索半径r计算r-邻域的宽度,包括:
    按如下公式计算r-邻域的宽度:
    Figure PCTCN2020119968-appb-100001
    其中,a i表示数据到第i个支撑点距离的权值。
  4. 根据权利要求3所述的度量空间划分方式评价方法,其特征在于,所述依次取出法向量对当前子空间进行独立的划分,并标记落入划分边界r邻域的数据,包括:
    取出其中一个法向量构造划分超平面,将上一子空间划分成互不相交的多个独立子空间,并对落入r-邻域范围内的数据进行标记;
    然后取出下一个法向量构造划分超平面,分别对所述多个独立子空间进行划分,并对落入r-邻域范围内的数据进行标记;
    依次类推,直至用完所有法向量。
  5. 根据权利要求4所述的度量空间划分方式评价方法,其特征在于,将上一子空间划分成互不相交的两个独立子空间,并对落入r-邻域范围内的数据进行标记。
  6. 根据权利要求1所述的度量空间划分方式评价方法,其特征在于,所述度量空间为二元组(S,d),其中S是有限非空的数据集合,而d是定义在S上的距离函数。
  7. 根据权利要求6所述的度量空间划分方式评价方法,其特征在于,所述距离函数满足:
    对于任意x,y,S,d(x,y)≥0,并且d(x,y)=0时,x=y;
    对于任意x,y,S,d(x,y)=d(y,x);
    对于任意x,y,z,S,d(x,y)+d(y,z)≥d(x,z)。
  8. 一种度量空间划分方式评价装置,其特征在于,包括:
    获取单元,用于对数据库中的数据进行度量空间的划分,获取n个法向量;
    输入单元,用于输入n个法向量作为划分超平面的法向量和范围搜索半径r;
    支撑点选取单元,用于利用选点算法选取n个支撑点;
    映射单元,用于以数据到支撑点的距离作为坐标,将度量空间中的数据映射为二维向量数据;
    完全划分单元,用于对数据进行完全划分,并计算落入r-邻域的数据;
    评价单元,用于输出落入r-邻域的数据的数目,并根据所述数目输出划分方法的评价结果。
  9. 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7中任一项所述的度量空间划分方式评价方法。
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行如权利要求1至7任一项所述的度量空间划分方式评价方法。
PCT/CN2020/119968 2020-07-16 2020-10-09 度量空间划分方式评价方法、装置、计算机设备及存储介质 WO2022011851A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010686305.8A CN111831660B (zh) 2020-07-16 2020-07-16 度量空间划分方式评价方法、装置、计算机设备及存储介质
CN202010686305.8 2020-07-16

Publications (1)

Publication Number Publication Date
WO2022011851A1 true WO2022011851A1 (zh) 2022-01-20

Family

ID=72922991

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119968 WO2022011851A1 (zh) 2020-07-16 2020-10-09 度量空间划分方式评价方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN111831660B (zh)
WO (1) WO2022011851A1 (zh)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113065036B (zh) * 2021-04-14 2021-11-16 深圳大学 一种度量空间支撑点性能衡量方法、装置及相关组件
CN113282337B (zh) * 2021-06-02 2023-02-24 深圳大学 度量空间最优完全划分索引寻找方法、装置及相关组件
CN113407799A (zh) * 2021-06-22 2021-09-17 深圳大学 度量空间划分边界的性能衡量方法、装置及相关设备
CN113407798B (zh) * 2021-06-22 2023-12-22 深圳大学 度量空间划分多边界搜索性能衡量的方法及相关组件
CN113435501B (zh) * 2021-06-25 2023-07-07 深圳大学 基于聚类的度量空间数据划分与性能衡量方法及相关组件
CN113590889B (zh) * 2021-07-30 2023-12-22 深圳大学 度量空间索引树构建方法、装置、计算机设备及存储介质
CN113628224B (zh) * 2021-08-09 2023-12-19 南通大学 一种基于三维欧式距离变换的房间分割方法
CN113982274B (zh) * 2021-11-19 2022-11-15 中铁十七局集团第五工程有限公司 一种现浇混凝土支架结构的支点设置方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020147703A1 (en) * 2001-04-05 2002-10-10 Cui Yu Transformation-based method for indexing high-dimensional data for nearest neighbour queries
CN106021458A (zh) * 2016-05-16 2016-10-12 广州鼎鼎信息科技有限公司 一种云环境下的大数据快速聚合查询方法
CN106156281A (zh) * 2016-06-25 2016-11-23 南京理工大学 基于Hash‑Cube空间层次划分结构的最近邻点集快速检索方法
CN106203165A (zh) * 2016-07-01 2016-12-07 何钟柱 基于可信云计算的信息大数据分析支撑方法
CN106528629A (zh) * 2016-10-09 2017-03-22 深圳云天励飞技术有限公司 一种基于几何空间划分的向量模糊搜索方法及***
CN108304449A (zh) * 2017-12-11 2018-07-20 北京交通大学 基于自适应数据集划分方式的大数据Top-k查询方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477523B (zh) * 2008-11-24 2011-07-20 北京邮电大学 超大型指纹库的索引结构和检索方法
CN107944027B (zh) * 2017-12-12 2020-03-31 苏州思必驰信息科技有限公司 创建语义键索引的方法及***

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020147703A1 (en) * 2001-04-05 2002-10-10 Cui Yu Transformation-based method for indexing high-dimensional data for nearest neighbour queries
CN106021458A (zh) * 2016-05-16 2016-10-12 广州鼎鼎信息科技有限公司 一种云环境下的大数据快速聚合查询方法
CN106156281A (zh) * 2016-06-25 2016-11-23 南京理工大学 基于Hash‑Cube空间层次划分结构的最近邻点集快速检索方法
CN106203165A (zh) * 2016-07-01 2016-12-07 何钟柱 基于可信云计算的信息大数据分析支撑方法
CN106528629A (zh) * 2016-10-09 2017-03-22 深圳云天励飞技术有限公司 一种基于几何空间划分的向量模糊搜索方法及***
CN108304449A (zh) * 2017-12-11 2018-07-20 北京交通大学 基于自适应数据集划分方式的大数据Top-k查询方法

Also Published As

Publication number Publication date
CN111831660B (zh) 2021-03-30
CN111831660A (zh) 2020-10-27

Similar Documents

Publication Publication Date Title
WO2022011851A1 (zh) 度量空间划分方式评价方法、装置、计算机设备及存储介质
Hu et al. Distance indexing on road networks
CN108932347B (zh) 一种分布式环境下基于社会感知的空间关键字查询方法
CN105765576B (zh) 使用数据结构处理搜索查询
US9691006B2 (en) Point cloud simplification
CN105654483A (zh) 三维点云全自动配准方法
CN110489419A (zh) 一种基于多层局部敏感哈希的k最近邻近似查询方法
US20150178594A1 (en) Point cloud simplification
CN112434031A (zh) 一种基于信息熵的不确定高效用模式挖掘方法
CN113065036B (zh) 一种度量空间支撑点性能衡量方法、装置及相关组件
Midtbo Spatial modelling by Delaunay networks of two and three dimensions
CN113282337B (zh) 度量空间最优完全划分索引寻找方法、装置及相关组件
CN105302833A (zh) 一种基于内容的视频检索数学模型建立方法
Zhang et al. Gridvoronoi: An efficient spatial index for nearest neighbor query processing
Di Angelo et al. An efficient algorithm for the nearest neighbourhood search for point clouds
Le et al. Balanced nearest neighborhood query in spatial database
WO2022267094A1 (zh) 基于欧氏距离的度量空间索引构建方法、装置及相关设备
CN106445960A (zh) 一种数据聚类方法和装置
Goncalves et al. Making recommendations using location-based skyline queries
CN113590889A (zh) 度量空间索引树构建方法、装置、计算机设备及存储介质
US11620269B2 (en) Method, electronic device, and computer program product for data indexing
Sun et al. Geospatial indexing for sea–land navigation based on machine learning
Shaw et al. Efficient approximation of spatial network queries using the m-tree with road network embedding
JP2011081554A (ja) 多次元インデックスのセル生成方法、セル拡張方法、並びにセルのデータ構造
Huang et al. Processing Probabilistic K-Nearest Neighbor Query Using Rlsd-Tree

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20945490

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20945490

Country of ref document: EP

Kind code of ref document: A1