A Top-K query method and system for incomplete data

By calculating the lowest possible score and the highest possible score of the incomplete data set, after pruning and filling, the complete data Top-K query method is used to solve the accuracy and efficiency problems of the incomplete data Top-K query, and achieve higher query Accuracy and efficiency.

CN113569141BInactive Publication Date: 2024-10-18HUAZHONG UNIV OF SCI & TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110811299.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-19
Publication Date
2024-10-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing Top-K query methods for incomplete data have limited scope of application and cannot be directly used for the differences between complete data and incomplete data, static data and dynamic data, resulting in inaccurate query results and low efficiency.

Method used

By counting the minimum and maximum values ​​of each attribute, calculate the lowest possible score and the highest possible score of the object, locate the Kth largest value of the lowest possible score as the judgment threshold, prune the candidate set and fill it, and finally use the complete data Top-K Query method to get results.

Benefits of technology

It ensures the correctness of the incomplete data Top-K query results, while improving the query efficiency, narrowing the search interval and filling range, and improving the query accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113569141B_ABST
    Figure CN113569141B_ABST
Patent Text Reader

Abstract

The present invention discloses a Top‑K query method and system for incomplete data, belonging to the field of data query. The method includes: counting the minimum and maximum values ​​of each attribute in the incomplete data set, saving the primary key and non-primary key attribute values ​​of each object in the data set into a tuple list; traversing the tuple list, calculating the minimum and maximum possible scores of each object, storing them in the tuple list, locating the value with the lowest possible score of all objects at the Kth largest value, and using it as a judgment threshold; traversing the tuple list, if the highest possible score of the object is not less than the judgment threshold, adding it to a first candidate set; traversing the first candidate set, using a filling strategy to estimate the missing attribute value, using the larger value of the estimated value and the minimum value as the filling value, calculating the score of the filled object, and adding the object with a score not less than the judgment threshold to a second candidate set; using a complete data Top‑K query method for querying. The present invention ensures the correctness of the Top‑K query result of incomplete data while effectively improving the query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data query, and more specifically, relates to a Top-K query method and system for incomplete data. Background Art

[0002] With the continuous popularization and rapid development of information technology, all walks of life are developing rapidly. By analyzing large-scale data, people can deeply explore the nature and development laws of the industry, obtain information, knowledge and business opportunities that were unattainable in the past, and thus create huge economic and social benefits.

[0003] While massive data creates value, it also brings challenges such as data quality issues. The main evaluation criteria for data quality are: accuracy, completeness, consistency, timeliness, reliability and effectiveness, among which data integrity plays an important role. Incomplete data will lead to incorrect analysis and processing results. Incomplete data processing has been widely studied in fields such as data mining and machine learning.

[0004] In massive data, Top-K query can find the k best results that users are interested in in a huge data set by setting weight coefficients, that is, the k tuples with the highest or lowest scores. Existing Top-K query research is mainly aimed at complete data or incomplete streaming data. Existing Top-K query research on incomplete data is based on crowdsourcing mode. There are significant differences in the nature of complete data and incomplete data, static data and dynamic data (streaming data), and the scope of application of crowdsourcing technology is very limited. Therefore, Top-K query of incomplete data cannot directly use previous technologies. Summary of the invention

[0005] In view of the technical defects and improvement needs of the existing Top-K query methods for incomplete data, which are not general and have limited scope of application, the present invention provides a Top-K query method and system for incomplete data, which aims to ensure the correctness of the Top-K query results of incomplete data while effectively improving the query efficiency.

[0006] To achieve the above object, according to a first aspect of the present invention, a Top-K query method for incomplete data is provided, comprising:

[0007] S1. Count the minimum and maximum values ​​of each attribute in the incomplete data set, and save the primary key and non-primary key attribute values ​​of each object in the data set into a tuple list;

[0008] S2. Traverse the tuple list, calculate the lowest possible score and the highest possible score for each object, and store them in the tuple list. At the same time, locate the Kth largest value of the lowest possible score of all objects and use it as the judgment threshold;

[0009] S3. traverse the tuple list, and if the highest possible score of the current object is not less than the judgment threshold, add it to the first candidate set;

[0010] S4. traverse the first candidate set, fill in the missing attribute values ​​of the object, calculate the score of the filled object, and add the object with a score not less than the judgment threshold to the second candidate set;

[0011] S5. Use the complete data Top-K query method to query the second candidate set and return the top K objects with the largest scores as the query results.

[0012] Preferably, step S1 includes:

[0013] S11. Open the file where the incomplete data set is located and read all records whose primary keys are not empty;

[0014] S12. Assume that all attribute values ​​are non-negative numbers, use -1 to mark missing values, use the Min array to store the minimum values ​​of all non-primary key attributes, and use the Max array to store the maximum values ​​of all non-primary key attributes;

[0015] S13. Each time a row of records is read, the primary key and non-primary key attribute values ​​of the object are stored in the tuple list in the form of objects, and the Min array and Max array are dynamically updated.

[0016] Preferably, step S2 comprises:

[0017] S21. traverse the tuple list, calculate and save the inner product of the vector composed of all non-primary key attribute values ​​of each object and the weight vector;

[0018] S22. Replace the missing attribute values ​​with the values ​​corresponding to the Min array, and the corresponding inner product is the lowest possible score of the object;

[0019] S23. Replace the missing attribute values ​​with the values ​​corresponding to the Max array, and the corresponding inner product is the highest possible score of the object;

[0020] S24. Calculate the Kth largest value among the lowest possible scores of all objects, and use this value as the judgment threshold for the candidate object.

[0021] Preferably, step S4 comprises:

[0022] S41. Estimating the filling value of the missing value using the filling strategy, comparing the estimated value with the minimum and maximum values ​​of the attribute corresponding to the missing value to obtain a final filling value to ensure that the filling value is within the range of the minimum and maximum values ​​of the attribute;

[0023] S42. Calculate the inner product of the attribute value vector and the weight vector of the complete object after filling, and use the inner product as the score of the object;

[0024] S43. Add objects whose scores are not less than the judgment threshold to the second candidate set.

[0025] Preferably, the imputation strategy is regression imputation or multiple imputation.

[0026] Beneficial effect: When the missing rate σ is the same, the MAPE and SMAPE of the multiple imputation method are slightly lower than those of the regression imputation method, and the MAPE and SMAPE of the regression imputation method are lower than those of other imputation strategies. When the missing rate σ is greater than 20%, the MAE and RMSE of the regression imputation method and the multiple imputation method are always lower than those of other strategies. In summary, the multiple imputation method and the regression imputation method perform the best and most stable.

[0027] Preferably, the complete data Top-K query method is a layer-based method, a view-based method or an ordered list-based method.

[0028] To achieve the above object, according to a second aspect of the present invention, there is provided a Top-K query system for incomplete data, comprising: a computer-readable storage medium and a processor;

[0029] The computer-readable storage medium is used to store executable instructions;

[0030] The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the Top-K query method for incomplete data described in the first aspect.

[0031] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

[0032] The present invention prunes objects that cannot be query results in advance by comparing the highest possible score of the object with the size of the threshold, and obtains the first candidate set, thereby narrowing the search interval and the filling range; the missing value is estimated by the filling strategy, and the missing value is guaranteed to be no less than the minimum value of the attribute. While filling, the first candidate set is further pruned by comparing the score of the complete object with the size of the pruning threshold. After two prunings and one filling, the present invention uses the Top-K query algorithm for complete data to query the second candidate set that does not contain missing values, fully considering various possible estimated values ​​of the missing values, while ensuring the accuracy of the query results, greatly narrowing the search interval and the filling interval, and having higher query accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A flow chart of a Top-K query method for incomplete data provided by the present invention. DETAILED DESCRIPTION

[0034] To make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0035] The inventive concept of the present invention is as follows: First, prune the data set according to the dominance relationship to obtain a candidate set containing missing values, then further prune while filling the candidate set, and finally perform a Top-K query on the complete data set after filling to obtain the query result.

[0036] First, the terms related to the present invention are explained as follows.

[0037] Top-K query for complete data: Given a d (d>1)-dimensional complete data set P with n objects (denoted as ), then this data set can be expressed as Each object with d attribute values can be represented as a point in the d-dimensional data space Assume that all attribute values are definite numerical values, and larger numerical values represent better scores. The Top-K query for complete data consists of a scoring function score, the size k of the result set (0 < k ≤ n, and k is a positive integer), and a weight vector , where score is used to calculate the score of an object, and the score of object is represents the user's preference for different attributes, and satisfies The Top-K query for complete data returns the top k objects with the largest scores.

[0038] Incomplete data: Given a d (d>1)-dimensional incomplete data set M with n objects (denoted as ), each object has d attribute values. Among them, some objects lack some attribute values, but at least one attribute value of the objects with missing values is not missing. And for each attribute, at least one object has a non-missing value on this attribute. If the j-th attribute of the i-th object is missing, the missing value ) is represented by "-".

[0039] The missing rate (MissRate) refers to the ratio of the missing non-primary key attribute values to all non-primary key attribute values of all objects. Given an incomplete data set Assume that the number of all missing non-primary key attribute values is x, and σ is used to represent the missing rate of this data set, then Where 0 <x≤n×d。

[0040] Incomplete data Top-K query problem: Given an incomplete data set Scoring function score, result set size k and weight vector After special processing, Top-K queries on incomplete data return the top k objects with the most likely highest scores.

[0041] like Figure 1 As shown, the present invention provides a Top-K query method for incomplete data, comprising the following steps:

[0042] S1: Preprocess the incomplete data, calculate the minimum and maximum values ​​of each attribute, and save the primary key and non-primary key attribute values ​​of all objects into a list;

[0043] S2: traverse the list, calculate and save the lowest possible score and the highest possible score of all objects, and calculate the kth largest number among the lowest possible scores of all objects, and use this number as the threshold;

[0044] S3: traverse the list, and if the highest possible score of the object is not less than the threshold, add the object to the first candidate set;

[0045] S4: Fill the first candidate set, calculate the scores of the filled objects, and add the objects whose scores are not less than the threshold to the second candidate set;

[0046] S5: Use the Top-K query algorithm for complete data to query the second candidate set and obtain the query result.

[0047] 1. Data preprocessing

[0048] The present invention is applicable to all static data with missing values ​​based on a random missing model.

[0049] The preprocessing of incomplete data includes: marking missing values ​​with -1, using the Min array to save the minimum values ​​of all attributes, and using the Max array to save the maximum values ​​of all attributes; opening the file where the incomplete data set is located, and reading all records whose primary keys are not empty; for each row of records read, saving the primary key and non-primary key attribute values ​​of all objects into the tupleList list, and dynamically updating the Min array and Max array.

[0050] Open the file where the incomplete data set is located and read all records whose primary keys are not empty; assume that all attribute values ​​are non-negative numbers, mark missing values ​​with -1, use the Min array to save the minimum values ​​of all attributes, and use the Max array to save the maximum values ​​of all attributes; for each row of records read, save the primary key and non-primary key attribute values ​​of all objects into a list, and dynamically update the Min array and Max array.

[0051] 2. Calculate the pruning threshold, the minimum possible score of the object, and the maximum possible score

[0052] This step calculates the data required by the pruning strategy, including the pruning threshold, the minimum possible score of all objects, and the maximum possible score. The specific implementation process is as follows: traverse the tupleList list, use the scoring function to calculate the object score, and use the idea of ​​heap sort to calculate the pruning threshold.

[0053] The specific process of calculating the object score includes: traversing all the attribute values ​​of the object, replacing the missing values ​​with the values ​​of the corresponding indexes of the specified array, and calculating the inner product of the attribute value vector and the weight vector. When the specified array is a Min array, the inner product is the lowest possible score of the object. When the specified array is a Max array, the inner product is the highest possible score of the object. According to the above process, the highest possible score of an object must be greater than or equal to the lowest possible score of the object. The highest possible score of an object is equal to the lowest possible score of the object if and only if there are no missing values ​​for the object.

[0054] While calculating the object score, a small top heap of size k is maintained according to the lowest possible score of the object. After completing the traversal of the tupleList list, the top element of the small top heap is taken as the pruning threshold. This threshold is the kth largest number among the lowest possible scores of all objects.

[0055] 3. Generate the first candidate set

[0056] This step designs a pruning strategy based on the relationship between the lowest possible score and the highest possible score of objects in the Top-K query of incomplete data, and preliminarily prunes all objects that cannot be query results.

[0057] The design idea of ​​the pruning strategy is as follows: In the Top-K query of the complete data, if the object The score is greater than The score of (i≠j), and Not in the query results, then It is definitely not in the query results. Similarly, in the Top-k query of incomplete data, if the highest possible score of an object is smaller than the kth largest number among the lowest possible scores, then the object is definitely not in the query results. Therefore, traverse the tupleList list, compare the highest possible score of the object with the threshold, and add the objects whose highest possible scores are not less than the threshold to the candidate set to generate the first candidate set.

[0058] It is worth noting that the first candidate set will be filled in the subsequent steps. The pruning strategy can narrow the filling interval and reduce the running time of the filling strategy. However, since some filling strategies need to build the model required for the filling process based on the complete object, the pruning strategy may cause a large number of complete objects to be pruned. Therefore, based on the above pruning strategy, the complete object is also added to the candidate set to ensure the rationality of the estimated value of the filling strategy. Since pruning will be performed in the subsequent steps, the complete object will not affect the performance of the method.

[0059] 4. Fill the candidate set and generate the second candidate set

[0060] The purpose of this step is to fill missing values ​​and, at the same time, further prune the first candidate set. Filling missing values ​​can fully consider the impact of missing values ​​when calculating object scores, and pruning can improve query efficiency while ensuring high accuracy of query results. The specific implementation process is as follows.

[0061] The filling strategy is executed to calculate the estimated value of the missing value, and then the larger value of the estimated value and the minimum value of the attribute is used as the filling value. After filling the incomplete object with a complete object, the object score is calculated using the scoring function, and the objects with a score not less than the threshold are added to the second candidate set.

[0062] 5. Calculate query results

[0063] Finally, the complete data Top-K query method is executed on the complete candidate set, and the query results are output. Due to the above two prunings, the size of the candidate set is greatly reduced compared with the original incomplete data set. In addition, the filling strategy makes the missing value reasonably estimated, ensuring the accuracy of the query results.

[0064] Example

[0065] In order to quickly retrieve data that a user may be interested in from massive data, such as commodities, the following embodiment is used to quickly and effectively report the k best results in large-scale data according to user preferences.

[0066] The incomplete product ratings dataset in Table 1 contains ratings of 12 product objects by 5 users. Some ratings of some products are missing, and the missing values ​​are replaced by “-”. Assume that the result set size k = 2 and the weight vector Calculate the LB and UB of each object, as shown in the last two columns of Table 1. Sort the data set in descending order according to LB, and the first k objects are ID=11 and ID=12. Take the LB of ID=12 (i.e. 52.15) as the threshold, compare this value with the UB of other objects, and get the first candidate set {ID=11, ID=12, ID=1, ID=2, ID=5, ID=9}. Fill the first candidate set, such as mean filling. First, calculate the mean of each attribute is 29.5, 67.25, 84.8, 59.4, 52; then, prune while filling, compare the threshold and the score of the filled object, and get the second candidate set {ID=11, ID=12, ID=1, ID=2, ID=5}. Perform a Top-K query on the complete data of the second candidate set, and get the query result {ID=12, ID=2}, with scores of 66.65 and 65.125 respectively.

[0067] Table 1

[0068]

[0069]

[0070] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A Top-K query method for incomplete data, characterized in that: include: S1. Count the minimum and maximum values ​​of each attribute in the incomplete data set, and save the primary key and non-primary key attribute values ​​of each object in the data set into a tuple list; Step S1 includes: S11. Open the file where the incomplete data set is located and read all records whose primary keys are not empty; S12. Assume that all attribute values ​​are non-negative numbers, use -1 to mark missing values, use the Min array to store the minimum values ​​of all non-primary key attributes, and use the Max array to store the maximum values ​​of all non-primary key attributes; S13. Each time a row of records is read, the primary key and non-primary key attribute values ​​of the object are stored in the tuple list in the form of objects, and the Min array and Max array are dynamically updated; S2. Traverse the tuple list, calculate the lowest possible score and the highest possible score for each object, and store them in the tuple list. At the same time, locate the Kth largest value of the lowest possible score of all objects and use it as the judgment threshold; Step S2 includes: S21. traverse the tuple list, calculate and save the inner product of the vector composed of all non-primary key attribute values ​​of each object and the weight vector; S22. Replace the missing attribute values ​​with the values ​​corresponding to the Min array, and the corresponding inner product is the lowest possible score of the object; S23. Replace the missing attribute values ​​with the values ​​corresponding to the Max array, and the corresponding inner product is the highest possible score of the object; S24. Calculate the Kth largest value among the lowest possible scores of all objects, and use this value as the judgment threshold of the candidate object; S3. traverse the tuple list, and if the highest possible score of the current object is not less than the judgment threshold, add it to the first candidate set; S4. traverse the first candidate set, fill in the missing attribute values ​​of the object, calculate the score of the filled object, and add the object with a score not less than the judgment threshold to the second candidate set; S5. Use the complete data Top-K query method to query the second candidate set and return the top K objects with the largest scores as the query results.

2. The method according to claim 1, characterized in that Step S4 includes: S41. Estimating the filling value of the missing value using the filling strategy, comparing the estimated value with the minimum and maximum values ​​of the attribute corresponding to the missing value to obtain a final filling value to ensure that the filling value is within the range of the minimum and maximum values ​​of the attribute; S42. Calculate the inner product of the attribute value vector and the weight vector of the complete object after filling, and use the inner product as the score of the object; S43. Add objects whose scores are not less than the judgment threshold to the second candidate set.

3. The method according to claim 2, characterized in that The imputation strategy is regression imputation or multiple imputation.

4. The method according to claim 1, characterized in that The complete data Top-K query method is a layer-based method, a view-based method, or an ordered list-based method.

5. A Top-K query system for incomplete data, characterized in that: include: A computer readable storage medium and a processor; The computer-readable storage medium is used to store executable instructions; The processor is used to read the executable instructions stored in the computer-readable storage medium and execute the Top-K query method for incomplete data according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Incomplete data query processing method based on PostgreSQL (Object-Relational Database Management System) and crowd-sourcing

    CN106897373A

  • Data filling method and device

    CN109564641A