Performance measurement method, device and related equipment for measuring space partition boundary
Obtaining weight vectors and calculating performance coefficients through linear division boundary rules solves the problems of lack of objectivity and low efficiency in metric space index performance comparison in the existing technology, and achieves more accurate and efficient performance measurement.
Patent Information
- Application Number
- CN202110689186.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-22
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-06-22
AI Technical Summary
The existing technology lacks a systematic method to objectively evaluate the performance of different metric space indexes, resulting in a lack of objectivity in performance comparisons, and the experiments rely on different data sets, which reduces the reliability of the conclusions and the performance measurement efficiency is low.
Obtain the weight vector of the metric space through linear division boundary rules, count the weight sequence, calculate the performance coefficient, compare the performance coefficients to determine the optimal division boundary, use mathematical theorems to measure performance, and improve measurement efficiency and objectivity.
It achieves an objective measurement of the boundary performance of metric space division, improves measurement efficiency, can directly compare the advantages and disadvantages of different indexing methods without experiments, and improves the accuracy and efficiency of performance evaluation.
Smart Images

Figure CN113407799B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a performance measurement method, device and related equipment for measuring space division boundaries. Background Art
[0002] 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 types, based on spherical partitioning and hyperplane partitioning, according to the logical form of the subspace of the partitioning result. The performance comparison between different indexes is carried out by themselves, and the indexing conditions of different indexing methods are often different. The performance impact is also determined by multiple factors. Different support points, different partitioning methods, index balance, etc. will have a great impact on the performance of the index.
[0003] The performance comparisons between existing different metric space indexes are all conducted through experiments. There is no systematic and theoretical method to objectively evaluate the advantages and disadvantages of different methods. Therefore, it is impossible to objectively reflect the inherent differences between different partitioning methods. In addition, the differences between different data sets used in the experiments also greatly reduce the objectivity of the conclusions, and the performance measurement efficiency is low. Summary of the invention
[0004] The embodiments of the present invention provide a performance measurement method, apparatus and related equipment for measuring the boundary of a metric space partition, aiming to solve the problem of high performance efficiency of measuring the boundary of a metric space partition in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a performance measurement method for measuring a boundary of a metric space partition, comprising:
[0006] According to the linear partition boundary rule, the weight vectors corresponding to different partition boundaries of the metric space are obtained;
[0007] Counting the weight vectors corresponding to different partition boundaries to obtain a weight sequence corresponding to each partition boundary;
[0008] Calculating the performance of each partition boundary based on the weight sequence to obtain a performance coefficient;
[0009] The performance coefficients are compared to determine that the partition boundary with the minimum performance coefficient has the best performance.
[0010] In a second aspect, an embodiment of the present invention provides a performance measurement device for measuring a boundary of a metric space, comprising:
[0011] An acquisition module is used to obtain weight vectors corresponding to different partition boundaries of the metric space according to a linear partition boundary rule;
[0012] A statistical module, used for counting the weight vectors corresponding to different partition boundaries to obtain a weight sequence corresponding to each partition boundary;
[0013] A calculation module, used for calculating the performance of each partition boundary based on the weight sequence to obtain a performance coefficient;
[0014] The comparison module is used to compare the performance coefficients and determine that the partition boundary with the minimum performance coefficient has the best performance.
[0015] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the performance measurement method for measuring the boundary of the metric space division described in the first aspect is implemented.
[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the performance measurement method for measuring the boundary of the metric space division described in the first aspect above.
[0017] The embodiment of the present invention provides a performance measurement method, device and related equipment for a metric space partition boundary. The method includes obtaining weight vectors corresponding to different partition boundaries of the metric space according to a linear partition boundary rule; counting the weight vectors corresponding to different partition boundaries to obtain a weight sequence corresponding to each partition boundary; calculating the performance of each partition boundary based on the weight sequence to obtain a performance coefficient; comparing the performance coefficients to determine that the partition boundary with the minimum performance coefficient has the best performance. According to mathematical theorems, the method measures the performance with the weight vectors of the partition boundaries of the metric space, and the measurement results are more objective, and there is no need to conduct complicated experiments, thereby improving the efficiency of measuring the performance of different metric space partition boundaries. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0019] Figure 1 A schematic diagram of a flow chart of a performance measurement method for measuring space partition boundaries provided by an embodiment of the present invention;
[0020] Figure 2 A schematic diagram of the flow chart before step S110 in the performance measurement method for measuring the boundary of a metric space partition provided in an embodiment of the present invention;
[0021] Figure 3 A schematic diagram of a sub-flow of step S130 of the performance measurement method for measuring the boundary of a metric space partition provided in an embodiment of the present invention;
[0022] Figure 4 A schematic block diagram of a performance measurement device for measuring space partition boundaries provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0025] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0026] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0027] See also Figure 1 As shown, Figure 1 A schematic flow chart of a performance measurement method for measuring space partition boundaries provided in an embodiment of the present invention, the method comprising steps S110 to S140.
[0028] Step S110, obtaining weight vectors corresponding to different partition boundaries of the metric space according to the linear partition boundary rule;
[0029] In this embodiment, according to the linear partition boundary rule of the metric space, the weight vectors corresponding to different partition boundaries of the metric space are obtained. The partition boundary method can be hyperplane partition or spherical partition. The weight vector represents the vector expression after the partition boundary is mapped to the support point space.
[0030] In one embodiment, the metric space is a pair (M, d), where M is a finite non-empty data set, and d is a distance function defined on M.
[0031] In one embodiment, the distance function satisfies:
[0032] For any, d(x, y) ≥ 0, and when d(x, y) = 0, x = y;
[0033] For any, d(x, y) = d(y, x);
[0034] For any, d(x,y)+d(y,z)≥d(x,z).
[0035] In one embodiment, the linear partition boundary rule satisfies:
[0036] For a metric space (M, d), Select n supporting points p1, p2, ..., p in S n , Using linear relationships:
[0037] a1·d(s,p1)+a2·d(s,p2)+...+a n ·d(s,p n )=c,c∈R,a i ∈R, The method of dividing data using i=1,2,...,n as the boundary is called linear partitioning, where a i The weight vector representing the distance from the data to the i-th support point. In the support point space, the partition boundary of the linear partition is represented by (a1, a2, ..., a n ) as the hyperplane with weight vector a1x1+a2x2+...+a n x n =c,c∈R,a i ∈R, i=1,2,...,n. Each boundary of the linear partition can be described by a corresponding linear equation, and each linear partition method can be represented by a corresponding set of linear equations. If not otherwise specified, the partition methods mentioned in the embodiments of the present invention all belong to linear partition.
[0038] In one embodiment, if Figure 2 As shown, before step S110, it includes:
[0039] Step S01, dividing the data in the database into a metric space to obtain a plurality of weight vectors;
[0040] Step S02: Select several support points using a point selection algorithm;
[0041] Step S03: Using the distance from the data to the support point as the coordinate, the data in the metric space is mapped into multi-dimensional vector data to obtain the support point space.
[0042] In this embodiment, the data in the database are divided into a metric space to obtain multiple weight vectors. A number of support points are selected using a point selection algorithm; the distance from the data to the support point is used as the coordinate to map the data in the metric space into multidimensional vector data to obtain a support point space. For example, two partition boundaries d(x, p1)-d(x, p2) = d and d(x, p1) + d(x, p2) = d (d represents an arbitrary constant) are divided to completely partition the data. The weight vectors for the input hyperplane partition are (1, -1) and (1, 1), and the partition radius of the spherical partition is r (such as r = 1).
[0043] Furthermore, according to the vector group (1, -1) and (1, 1), it is determined that the number of vectors is 2. Then, two support points p1 and p2 can be selected using the support point selection algorithm (such as FFT (maximum closest distance first), incremental model and other algorithms). Then, the distance from the data to the support points p1 and p2 is used as the coordinate to map the data in the metric space into two-dimensional vector data. It should be noted that the dimension of the mapped vector data is equal to the number of selected support points.
[0044] In one embodiment, for a metric space (M, d), data S = {s i |s i ∈M, i=1,2,...,m}, select n supporting points P={p1,p2,...,p n},for The distance d(s,p from the data to the support point i ) as coordinates, we can define a mapping from M to n-dimensional space, using s p represents the image of s in n-dimensional space, then there is a mapping function F P,d as follows:
[0045] F P,d (s)=(f1(s), f2(s),...,f n (s))=(d(s,p1),d(s,p2),...,d(s,p n ))∈F P,d (M);
[0046] Support point space F P,d (S) is S in R n Image:
[0047] F P,d (s) = {s P |sP =d(s,p1),d(s,p2),...,d(s,p n ),s∈S}.
[0048] For example, in the metric space, there are three data s1, s2, and s3, where d(s2, s1) = 12, d(s2, s3) = 23, and d(s1, s3) = 13. When s1 and s3 are selected as two support points, the dimension of the support point space is 2, and the images of s1, s2, and s3 in the support point space are s1 and s3 respectively. P =(d(s1,s1),d(s1,s3))=(0,13),s2 P =(d(s2,s1),d(s2,s3))=(12,23),s3 P =(d(s3,s1),d(s3,s3))=(13,0).
[0049] Step S120, counting the weight vectors corresponding to different partition boundaries to obtain a weight sequence corresponding to each partition boundary;
[0050] In this embodiment, the weight vectors corresponding to different partition boundaries are counted to obtain the weight sequence corresponding to each partition boundary. Wherein, the metric space (M, d), data S = {s i |s i ∈M, i=1,2,...,m}, select n supporting points P={p1,p2,...,p n},for Using the linear relationship a1·d(s,p1)+a2·d(s,p2)+...+a n ·d(s,p n )=c(c and a i are all constants; i=1,2,...,n; d(s,p i ) represents the distance from the data to the i-th support point) as the boundary to divide the data, using the weight vector a1, a2, ..., a n The value of determines the partitioning performance. Statistical weight vectors a1, a2, ..., a corresponding to different partitioning boundaries n The values of get the weight sequence corresponding to different partition boundaries {|a1|,|a2|,...,|a n |}.
[0051] Step S130, calculating the performance of each partition boundary based on the weight sequence to obtain a performance coefficient;
[0052] In this embodiment, based on the weight sequence of each partition boundary, the performance of each partition boundary is calculated to obtain the performance coefficients of different partition boundaries.
[0053] In one embodiment, if Figure 3 As shown, step S130 includes:
[0054] Step S131, calculating the standard deviation and the mean of the weight sequence to obtain the standard deviation and the mean of the weight sequence;
[0055] Step S132: Using the ratio of the standard deviation to the mean as the performance coefficient of the weight sequence corresponding to the division boundary.
[0056] In this embodiment, in order to characterize the degree of proximity of the weight vectors, the ratio of the standard deviation of the absolute value of the weight vectors to the mean is used to represent the degree of proximity of the weight vectors. The standard deviation represents the overall deviation of the data, and the mean is used to represent the overall value of the weight vector. The ratio of the standard deviation to the mean can accurately represent the degree of deviation of a group of data from the average data. The smaller the value of the weight coefficient, the closer the weight vector values in the weight sequence are, and the better the performance of the division boundary. In this embodiment, the standard deviation and mean of the weight sequence are calculated to obtain the standard deviation and mean of the weight sequence; the ratio of the standard deviation to the mean is used as the performance coefficient of the weight sequence corresponding to the division boundary.
[0057] For example, if the hyperplane is divided, two support points are selected, and one of the division boundaries is mapped to the support point space with x1-x2=0. At this time, the weights a1=1, a2=-1, and the weight sequence is {1,1}; if spherical division is adopted, two support points are selected, and one of the division boundaries is mapped to the two-dimensional support point space with x1=r, r is a constant, then a1=1, a2=0, and the weight sequence is {1,0}; then the standard deviation and the average value of the weight sequences corresponding to the two division boundaries are calculated, and then the ratio between the standard deviation and the average value is used as the performance coefficient of the two division boundaries.
[0058] Step S140: Compare the performance coefficients to determine that the partition boundary with the minimum performance coefficient has the best performance.
[0059] In this embodiment, the performance coefficients of different partition boundaries are compared, and the performance of the partition boundary corresponding to the minimum performance coefficient is optimal.
[0060] This method measures the performance based on mathematical theorems and the weight vector of the boundary of the metric space division. The measurement result is more objective and does not require complicated experiments, thereby improving the efficiency of measuring the performance of the boundary of different metric spaces.
[0061] The embodiment of the present invention further provides a performance measurement device for measuring the boundary of a metric space partition, and the performance measurement device for measuring the boundary of a metric space partition is used to perform any embodiment of the performance measurement method for measuring the boundary of a metric space partition. Figure 4 , Figure 4 1 is a schematic block diagram of a performance measurement device for measuring space partition boundaries provided by an embodiment of the present invention. The performance measurement device 100 for measuring space partition boundaries may be configured in a server.
[0062] like Figure 4 As shown, the performance measurement device 100 for measuring space partition boundaries includes an acquisition module 110 , a statistics module 120 , a calculation module 130 , and a comparison module 140 .
[0063] An acquisition module 110 is used to acquire weight vectors corresponding to different partition boundaries of the metric space according to a linear partition boundary rule;
[0064] A statistics module 120, used to count the weight vectors corresponding to different partition boundaries to obtain a weight sequence corresponding to each partition boundary;
[0065] A calculation module 130, configured to calculate the performance of each partition boundary based on the weight sequence to obtain a performance coefficient;
[0066] The comparison module 140 is used to compare the performance coefficients and determine that the partition boundary with the minimum performance coefficient has the best performance.
[0067] In one embodiment, the performance measurement device 100 for measuring the boundary of a space partition includes:
[0068] A partitioning module, used for partitioning the metric space of the data in the database to obtain a plurality of weight vectors;
[0069] A selection module is used to select a number of support points using a point selection algorithm;
[0070] The mapping module is used to map the data in the metric space into two-dimensional vector data by taking the distance from the data to the support point as the coordinate to obtain the support point space.
[0071] In one embodiment, the calculation module 130 includes:
[0072] A calculation unit is used to calculate the standard deviation and the mean of the weight sequence to obtain the standard deviation and the mean of the weight sequence; and use the ratio of the standard deviation to the mean as the performance coefficient of the weight sequence corresponding to the division boundary.
[0073] An embodiment of the present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the performance measurement method for measuring the boundary of a metric space partition as described above when executing the computer program.
[0074] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the performance measurement method based on the metric space partition boundary as described above.
[0075] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, devices and units can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0076] In the several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. Units with the same function may also be combined into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be an electrical, mechanical or other form of connection.
[0077] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0078] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0079] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), disk or optical disk and other media that can store program codes.
[0080] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A performance measurement method for measuring the boundary of a metric space partition, characterized in that: include: According to the linear partition boundary rule, the weight vectors corresponding to different partition boundaries of the metric space are obtained; Counting the weight vectors corresponding to different partition boundaries to obtain a weight sequence corresponding to each partition boundary; Calculating the performance of each partition boundary based on the weight sequence to obtain a performance coefficient; Comparing the performance coefficients, determining that the partition boundary with the minimum performance coefficient has the best performance; Before obtaining the weight vectors corresponding to different partition boundaries of the metric space according to the linear partition boundary rule, the method includes: Dividing the data in the database into a metric space to obtain a plurality of weight vectors; Use the point selection algorithm to select several support points; Using the distance from the data to the support point as the coordinate, the data in the metric space is mapped into multi-dimensional vector data to obtain the support point space; The performance of each partition boundary is calculated based on the weight sequence to obtain a performance coefficient, including: Calculate the standard deviation and mean of the weight sequence to obtain the standard deviation and mean of the weight sequence, wherein the standard deviation represents the overall deviation of the data, and the mean is used to represent the overall value of the weight vector; The ratio of the standard deviation to the mean is used as the performance coefficient of the weight sequence corresponding to the partition boundary.
2. The performance measurement method for measuring the boundary of a metric space partition according to claim 1, characterized in that: The metric space is a pair (M, d), where M is a finite non-empty data set and d is a distance function defined on M.
3. The performance measurement method for measuring the boundary of a metric space partition according to claim 2, characterized in that: The distance function satisfies: For any , d(x, y) ≥ 0, and when d(x, y) = 0, x = y; For any , d(x,y)=d(y,x); For any , d(x,y)+d(y ,z)≥d(x,z).
4. The performance measurement method for measuring the boundary of a metric space partition according to claim 3, characterized in that: The metric space (M, d) satisfies: data , there are n supporting points in S ,for , the distance from the data to the support point d(s,p i ) as coordinates, define a mapping from M to n-dimensional space, using s p Represents the image of s in n-dimensional space, there exists a mapping function F P,d as follows: , The support point space is S in R n Image: 。 5. The performance measurement method for measuring the boundary of a metric space partition according to claim 4, characterized in that: The linear partition boundary rule satisfies: For a metric space (M, d), , select n supporting points p1, p2, ..., p in S n , , there is the following linear relationship: , ; , 。 6. A performance measurement device for measuring the boundary of a metric space, characterized in that: include: An acquisition module is used to obtain weight vectors corresponding to different partition boundaries of the metric space according to a linear partition boundary rule; A statistical module, used for counting the weight vectors corresponding to different partition boundaries to obtain a weight sequence corresponding to each partition boundary; A calculation module, used for calculating the performance of each partition boundary based on the weight sequence to obtain a performance coefficient; A comparison module, used to compare the performance coefficients and determine that the partition boundary with the minimum performance coefficient has the best performance; The performance measurement device for measuring the boundary of the metric space division includes: A partitioning module, used for partitioning the metric space of the data in the database to obtain a plurality of weight vectors; A selection module is used to select a number of support points using a point selection algorithm; A mapping module is used to map the data in the metric space into two-dimensional vector data using the distance from the data to the support point as the coordinate to obtain the support point space; The calculation module comprises: The calculation unit is used to calculate the standard deviation and the mean of the weight sequence to obtain the standard deviation and the mean of the weight sequence; and use the ratio of the standard deviation to the mean as the performance coefficient of the weight sequence corresponding to the division boundary.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the performance measurement method for the metric space partition boundary according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the performance measurement method for measuring the boundary of a metric space partition according to any one of claims 1 to 5.
