A method for discovering representative functional dependencies

By optimizing representative functional dependency discovery through attribute power set traversal and compressed tree structure, the problems of large result set size and high computational cost in existing methods are solved, achieving efficient and accurate representative functional dependency discovery.

CN117633122BActive Publication Date: 2026-11-24ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311646335.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-04
Publication Date
2026-11-24
Estimated Expiration
2043-12-04

AI Technical Summary

Technical Problem

Existing representative functional dependency discovery methods suffer from large result sets, high computational costs, and a lack of effective representativeness judgment and verification methods, resulting in low efficiency and insufficient accuracy.

Method used

We use attribute power set traversal combined with Jaccard similarity and left and right weights to determine representative functional dependencies, use a compressed tree structure to store non-representative dependencies, and optimize the computation path by stripping partitions for dynamic calculation and a greedy strategy to achieve efficient discovery of representative functional dependencies.

Benefits of technology

It effectively reduces the size of the functional dependency result set, improves discovery efficiency and accuracy, and ensures the representativeness and simplicity of the results, which is superior to existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117633122B_ABST
    Figure CN117633122B_ABST
Patent Text Reader

Abstract

This invention discloses a method for discovering representative functional dependencies, comprising the following steps: obtaining an original dataset, constructing a single-attribute partition set of an attribute power set lattice based on each attribute in the original dataset, and generating an Rhs for each node in the attribute power set lattice. + The attribute power set lattice is traversed hierarchically from bottom to top. After the current level traversal is completed, the nodes of the current level are pruned. Nodes of the next level are generated based on the superset nodes of the pruned nodes, until the pruned nodes of the current level have no superset nodes. During the traversal, the representativeness of the candidate functional dependencies corresponding to each node is judged and verified. The pruning is based on the Rhs of the current level nodes. + The method involves using both set and partition set methods. While significantly improving the efficiency of functional dependency discovery and reducing the size of the result set, it ensures the accuracy and representativeness of the results, outperforming existing methods and offering advantages such as strong versatility and ease of use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of database technology, and in particular relates to a method for discovering representative functional dependencies. Background Technology

[0002] Functional dependencies have very important applications in the database field. Since the concept of functional dependencies was proposed (Codd EF. Further normalization of the database relational model[J].Data basesystems,1972,6:33-64)(Weddell G E. Reasoning about functional dependencies generalized for semantic data models[J].ACM Transactions on Database Systems(TODS),1992,17(1):32-64), the discovery methods of functional dependencies have been a hot research topic.

[0003] Algorithms for discovering functional dependencies can be divided into exact discovery algorithms and approximate discovery algorithms. Current traditional functional dependency discovery algorithms are mainly based on exact discovery algorithms, and much research has been conducted on discovering accurate and complete sets of functional dependencies, such as (Huhtala Y, J,Porkka P,et al.TANE:An efficient algorithm for discovering functional and approximate dependencies[J].The computerjournal,1999,42(2):100-111)(Novelli N,Cicchetti R.Fun:An efficient algorithm for mining functional and embedded dependencies[A].International Conferenceon Database Theory[C].2001:189-203)(Yao H,Hamilton HJ,Butz C J.FD / spl I.bar / Mine: discovering functional dependencies in a database using equivalences[A].2002IEEE International Conference on Data Mining,2002.Proceedings.[C].2002:729-732)(Lopes S,Petit JM,Lakhal L.Efficient discovery of functionaldependencies and armstrong relations[A].International Conference on ExtendingDatabase Technology[C].2000:350-364) etc. Based on the principles of the algorithms, accurate discovery algorithms are mainly divided into three categories: lattice traversal algorithms, dependency induction algorithms, and hybrid algorithms.

[0004] Among them, lattice traversal algorithms, such as (Huhtala Y, J, Porkka P, et al. TANE: An efficient algorithm for discovering functional and approximate dependencies[J]. The computer journal, 1999, 42(2): 100-111), which normalizes the left-hand side of functional dependencies into a lattice, and all lattices constitute the functional dependency space, and abstracts the operations on functional dependencies into traversal of lattices, relation checking, deletion and addition; the dependency induction algorithm is represented by (Flach PA, Savnik I. Database dependency discovery: a machine learning approach[J]. AI communications, 1999, 12(3): 139-160.), which first obtains all non-functional dependencies from the dataset, and then derives all functional dependencies from the non-functional dependencies. Hybrid algorithms, represented by (apenbrock T, Naumann FA hybrid approach to functional dependency discovery[A]. Proceedings of the 2016 International Conference on Management of Data[C]. 2016: 821-833), employ a combination of multiple modules and loop control methods to discover accurate functional dependency results.

[0005] Besides the functional dependency discovery algorithms mentioned above, representative functional dependency discovery is a new topic. It aims to select a subset of more representative functional dependencies from the complete functional dependency result set, thereby reducing the size of the result set and lowering the difficulty of understanding and application without losing a large amount of functional dependency-related information. (Ziheng Wei and Sebastian Link. 2019. Discovery and Ranking of Functional Dependencies. In 35th IEEE International Conference on Data Engineering, ICDE 2019, Macao, China, April 8-11, 2019. IEEE, 1526-1537.) is the only research on sorting and selecting functional dependency discovery result sets to reduce their size, and it is also the most closely related idea to this method. This method introduces a dynamic hybrid algorithm, DHyFD, for functional dependency discovery and ranking the functional dependency results. For functional dependency ranking, DHyFD measures the relevance of a functional dependency to the dataset by the number of times redundant values ​​caused by the functional dependency occur. However, they only provide a rough overview of the statistics and rankings of data redundancy caused by functional dependencies as an example, without providing details on the methodology for obtaining an exact overall ranking of all functional dependency results. Furthermore, their ranking of functional dependency results is performed independently as an additional process following the DHyFD run, separate from the functional dependency result discovery process, and the statistics on data redundancy require scanning all values ​​in the dataset, meaning that significant overhead is added beyond functional dependency discovery. Summary of the Invention

[0006] The purpose of this application is to provide a method for discovering representative functional dependencies, addressing the shortcomings of existing technologies in this area.

[0007] According to a first aspect of the embodiments of this application, a method for discovering representative functional dependencies is provided, comprising:

[0008] (1) Obtain the original dataset, based on the original dataset r = {A1, A2, A3, ..., A...} n Each attribute A in} i Construct an initial layer of the attribute power set lattice, and generate Rhs for each node in the initial layer of the attribute power set lattice. + The set is obtained by clustering to extract the partitions of each attribute in the original dataset;

[0009] (2) The attribute power set lattice is traversed hierarchically from bottom to top. After the current level traversal is completed, the nodes of the current level are pruned. The nodes of the next level are generated based on the superset nodes of the pruned nodes, until the pruned nodes of the current level have no superset nodes. During the traversal, the representativeness of the candidate functional dependencies corresponding to each node is judged and verified. The pruning is based on the Rhs of the current level nodes. + The set and the corresponding attribute or attribute set are stripped and partitioned.

[0010] Furthermore, the stripped partitions of each attribute in the original dataset are obtained through clustering, including:

[0011] (1.1) In the original dataset r = {A1, A2, A3, ..., A...} n Each attribute A of} i The following clustering operation is performed based on attribute values, so that tuples t with the same attribute value are included in the same cluster, and the clusters constitute the partitions Π corresponding to each attribute. A , i.e. Π A ={[t] A |t∈r};

[0012] (1.2) Partition each attribute obtained in step (1.1) Π A Clusters with only one element are omitted, resulting in a stripped partition. Right now

[0013] Furthermore, the Rhs + The set consists of the right-hand side of the smallest nontrivial functional dependency that the current node can form.

[0014] Furthermore, in step (2), the representativeness judgment and verification of the candidate functional dependencies corresponding to the nodes are performed, specifically as follows:

[0015] Representativeness is determined by the similarity between the functional dependency corresponding to the node and the functional dependencies found in the functional dependency result set. If no functional dependencies have been found, the functional dependency corresponding to the node is directly determined to be representative. The functional dependency similarity is determined based on the Jaccard similarity coefficient and the left and right weights.

[0016] If the functional dependency represented by a node is not representative, then the functional dependency is stored using a compressed tree structure; otherwise, the validity of the functional dependency is determined by the stripping partition of the corresponding attribute set.

[0017] If the functional dependency is not valid, the corresponding node is retained to participate in the generation of the next level node; if the functional dependency is valid, the compressed tree structure is used to determine if it is the smallest. If it is the smallest, it is added to the functional dependency result set and processed in Rhs.+ Delete the corresponding right-hand side.

[0018] Furthermore, if Then the functional dependency X→A holds, where

[0019] Furthermore, if the node's Rhs + If the set is empty, then prune that node.

[0020] Furthermore, for representative and valid functional dependencies, the compressed tree structure is searched for whether there exists a functional dependency whose left part is a subset of the left part of the functional dependency and whose right part is the same as the right part of the functional dependency. If such a functional dependency exists, then the functional dependency is not minimal.

[0021] Furthermore, a hash table structure is used to store the stripped partitions calculated at each level. Each node maintains a value k to record which attribute subset the node's stripped partitions should be calculated from. This value is assigned when the node is generated and changes dynamically during traversal. Thus, when it is necessary to calculate the stripped partitions of an attribute set, the optimal calculation path is searched using a greedy and first-fit strategy, starting from the position indicated by k.

[0022] According to a third aspect of the embodiments of this application, an electronic device is provided, comprising:

[0023] The technical solution of this invention can be summarized as follows:

[0024] 1. An effective method for discovering representative functional dependencies is proposed. By combining a lattice traversal strategy for functional dependency similarity checking, representative functional dependencies are discovered efficiently. The functional dependency similarity is determined based on the Jaccard similarity coefficient and the left and right weights of the functional dependency.

[0025] 2. To ensure the accuracy of representative functional dependency discovery, we designed a compressed functional dependency tree structure to record non-representative functional dependencies and perform a minimum check on valid functional dependencies.

[0026] 3. A dynamic computation method for partitioning is proposed to selectively verify functional dependencies. It has a memory release mechanism and automatically selects the method with the lowest computational cost when needed through greedy and first-fit strategies.

[0027] The technical solutions provided by the embodiments of this application may include the following beneficial effects:

[0028] As can be seen from the above embodiments, this application effectively mitigates the poor scalability of the lattice traversal column by combining functional dependency representativeness checks and attribute lattice traversal strategies, and selectively verifies candidate functional dependencies by leveraging partitioned dynamic computation and compressed functional dependency trees. This ensures efficient and accurate discovery of representative functional dependencies. This invention is the first to propose an effective method for discovering representative functional dependencies, which significantly improves the efficiency of functional dependency discovery, reduces the size of the result set, and ensures the accuracy and representativeness of the results. It outperforms existing methods and has advantages such as strong versatility and ease of use.

[0029] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0030] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0031] Figure 1 This is a system architecture diagram illustrating a representative method for discovering functional dependencies, according to an exemplary embodiment.

[0032] Figure 2 This is a flowchart illustrating a representative method for discovering functional dependencies according to an exemplary embodiment.

[0033] Figure 3 This is a schematic diagram of a search space attribute power set lattice according to an exemplary embodiment.

[0034] Figure 4 This is a schematic diagram illustrating the generation of a partition set according to an exemplary embodiment.

[0035] Figure 5 This is a schematic diagram illustrating a representative judgment and pruning process according to an exemplary embodiment.

[0036] Figure 6 This is a schematic diagram of the structure of a compressed function dependency tree according to an exemplary embodiment.

[0037] Figure 7 This is a schematic diagram illustrating the stripping partition management and calculation according to an exemplary embodiment.

[0038] Figure 8 This is a schematic diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0039] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.

[0040] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0041] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0042] The method provided in this application can be based on, for example... Figure 1 The system architecture shown in the diagram includes: database 1, database 2, and server 3. Database 1 is used to store and provide the original dataset, server 3 is used to process the dataset provided by database 1 and infer the set of functional dependencies, and database 2 is used to store the representative set of functional dependencies obtained by server 3.

[0043] Functional dependency here refers to a situation where one set of attributes uniquely determines another set of attributes; it can also be described as the other set of attributes depending on the first set of attributes. In the database domain, functional dependency is defined as follows: In an instance r of schema R, when... When A∈R, the functional dependency X→A means that for any two tuples t1 and t2 in instance r, if t1[X]=t2[X], then t1[A]=t2[A].

[0044] Taking a timetable scenario as an example, the course name can be determined by the course number. According to the definition of functional dependency, the course number determines the course name, or the course name depends on the course number. This functional dependency can be represented as "{course number} → {course name}". However, the course number cannot be determined by the course name because multiple identical courses may exist simultaneously. One course name can correspond to multiple course numbers. The course name cannot determine the course number; that is, the course number does not depend on the course name. In this case, "{course name} → {course number}" is not true, and it can also be called a non-functional dependency.

[0045] In this application, the similarity between functional dependencies is defined as follows: in an instance r of pattern R, there exist functional dependencies X→A and Y→B, with left and right part weights w respectively. LHS and w RHS Then the similarity between two functional dependencies is defined as follows: in The left-hand side of the Jaccard similarity coefficient represents the functional dependence. Let be the Jaccard similarity coefficient on the right-hand side of the functional dependency. If the similarity between two functional dependencies is greater than a threshold α, they are said to be similar functional dependencies.

[0046] In this example, Database 1 and Database 2 can be any type of relational database. The data maintained in Database 1 is in tabular form, with each record in the dataset being a row or tuple in the table. For example, the course table described above is stored in Database 1, where the course number, course name, and course time for each course are represented as a single tuple, and the table's columns contain the attribute information corresponding to the dataset. Database 2 also maintains a table to store the functional dependency set, with columns for the left-hand side of the functional dependency, the right-hand side of the functional dependency, generation time, source dataset, and runtime.

[0047] Server 3 is a physical server containing independent hosts or a virtual server hosted in a host cluster. During operation, server 3 obtains the original dataset from database 1, performs calculations on the dataset, derives the set of functional dependencies, and stores it in database 2.

[0048] like Figure 2 As shown, this application provides a method for discovering representative functional dependencies, which is applied to the server 3 and may include the following steps:

[0049] Table 1 is used as an example to introduce the approximate discovery algorithm for this function dependency in detail.

[0050] Table 1

[0051] Tuple number Name gender age blood pressure drug 1 Li Yi female 60 high Drug A 2 Wang Er male 32 Low Drug C 3 Zhang San female 28 normal Drug X 4 Zhao Si female 49 Low Drug Y 5 Friday female 32 normal Drug X 6 Huang Liu female 49 normal Drug X 7 Chen Qi female 32 Low Drug C

[0052] (1) Obtain the original dataset, based on the original dataset r = {A1, A2, A3, ..., A...} n Each attribute A in} i Construct an initial layer of the attribute power set lattice, and generate Rhs for each node in the initial layer of the attribute power set lattice. + The dataset is then clustered to obtain the stripped partitions for each attribute in the original dataset.

[0053] Specifically, the original dataset is obtained from database 1. This original dataset contains several attributes and several tuples composed of attribute values. All different attribute values ​​under each attribute constitute the value space corresponding to that attribute. Each tuple consists of a set of attribute values ​​containing all attributes. Based on the original dataset r = {A1, A2, A3, ..., A...} n Each attribute A of} i An initial layer of the attribute power set lattice is constructed, and partition sets are generated for a single attribute of the original dataset for subsequent dynamic partition calculations.

[0054] In this embodiment, the dataset is read in, meaning the server reads the raw data from the database and stores it locally in the form of a table, as shown in Table 1. This dataset has 7 rows, meaning Table 1 contains 7 tuples, corresponding to tuples 1, 2, 3, 4, 5, 6, and 7, and also contains seven different attributes: name, gender, age, blood pressure, and medication. Each tuple corresponds to a value for one of these five attributes. For example, tuple 1 has the attribute value "Li Yi" for name, "female" for gender, "60" for age, "high" for blood pressure, and "medication A" for medication. Different tuples may have the same attribute value for the same attribute, such as tuples 1 and 3 both having the attribute value "female" for gender; different tuples may also have different attribute values ​​for the same attribute, such as tuple 2 having the attribute value "32" for age, while tuple 4 has the attribute value "49" for age.

[0055] Power set lattices are generated based on the attributes of the dataset. Currently, only the first layer of the power set lattice is generated (each node contains only one attribute), that is, each attribute of the dataset serves as a node in the first layer; each node in the attribute power set lattice is an attribute set X = {x1, x2, x3, ..., x...} n} are called candidate functional dependencies. In the attribute power set lattice, the edges between nodes at different levels represent the existence of superset and subset relationships between the nodes, with the superset above and the subset below. This attribute power set lattice is used to select and traverse candidate functional dependencies that need to be verified;

[0056] Specifically, the stripped partitions of each attribute in the original dataset are obtained through clustering, including:

[0057] (1.1) In the original dataset r = {A1, A2, A3, ..., A...} n Each attribute A of} i The following clustering operation is performed based on attribute values. For example, for attribute A, tuples t with the same attribute value are included in the same cluster (also known as an equivalence class) [t]. A In this context, these clusters constitute the partition Π corresponding to attribute A. A , i.e. Π A ={[t] A |t∈r};

[0058] The attribute power set lattice of a dataset containing four attributes is as follows: Figure 3 As shown in Table 1, taking the data as an example, we use t1, t2, t3, ..., t7 to represent the 7 tuples in the table. The table has 5 different attributes, corresponding to 5 partitions. Each partition contains multiple clusters, i.e., sets of tuples. All tuples in the same cluster have the same attribute value for that attribute, while tuples in different clusters will have different attribute values ​​for that attribute. Taking the attribute "age" as an example, the attribute value range is 4, meaning there are 4 different attribute values: 60, 32, 28, and 49. The tuple with the value 60 for the age attribute is tuple t1; the tuples with the value 32 for the age attribute are tuples t2, t4, and t7; the tuple with the value 28 for the age attribute is tuple t3; and the tuples with the value 49 for the age attribute are tuples t4 and t6. Therefore, the age attribute has four clusters: {t1}, {t2, t4, t7}, {t3}, {t4, t6}, corresponding to partitions {{t1}, {t2, t4, t7}, {t3}, {t4, t6}}. The attribute "gender" has two values, "male" and "female," in these seven tuples, so its partitions contain two clusters: {t1, t3, t4, t5, t6, t7} and {t2}, i.e., Π. 性别 ={{t1, t3, t4, t5, t6, t7}, {t2}}; Similarly, Π 血压 = {{t1}, {t2, t4, t7}, {t3, t5, t6}}; the partition set of a single attribute in Table 1 is as follows: Figure 4 As shown.

[0059] (1.2) Simplify partition calculation and save space overhead. Each attribute partition obtained in step (1.1) is... A Clusters with only one element are omitted, resulting in a stripped partition. Right now

[0060] When validating functional dependencies, the intersection of attribute partitions is calculated and changes in clusters within the partitions are checked. For example, in Table 1, Π 性别,血压 =Π 性别 ·Π血压 ={{t1}, {t2}, {t4, t7}, {t3, t5, t6}}, we can observe Π 性别 Clusters {t2} and Π in 血压 The cluster {t1} in the calculation remains unchanged before and after; in other words, it cannot be split into smaller clusters through intersection calculation. Therefore, it can be omitted to simplify the calculation and save storage space. The simplified stripping partition is as follows: Similarly,

[0061] In practical implementation, the partitions obtained in (1.2) are associated with the corresponding number of attributes for management and used for the dynamic calculation of subsequent attribute set partitions. The stripped partitions obtained in all steps (1.2) and the attribute set X = {x1, x2, x3, ..., x} are used for subsequent dynamic calculations. n The stripped partitions of the dataset constitute the corresponding partition set Π. r .

[0062] Specifically, we use a map key-value pair structure to store and manage these partitions, where key 1 corresponds to the stripped partitions of all computed single attributes, such as... And so on, the value corresponding to key 2 is the stripped partition of all computed attribute sets containing two attributes, such as It is worth noting that these stripping partitions are not all calculated in step (1). Initially, only the stripping partitions of a single attribute node in the first layer of the power set lattice are calculated, while the stripping partitions of subsequent attribute sets are calculated when verifying each node during the step-by-step traversal.

[0063] Specifically, the Rhs+ set consists of the right-hand side of the minimal nontrivial functional dependencies that the current node can form. This application begins a level-order traversal with a single attribute at the lowest level, performing pruning after each level and progressively generating attribute set nodes containing more attributes to avoid missing any functional dependency candidates. In other words, when traversing the entire attribute power set lattice, all potential representative minimal nontrivial functional dependencies are examined, as each functional dependency is traversed and examined as a node within it.

[0064] Based on the attribute grid obtained in step (1.1), the algorithm calculates Rhs for each generated node. + The set consists of the right-hand side of the minimal nontrivial functional dependencies that the current node can form. For ease of understanding, let ABCDE represent the five attributes in Table 1. Since no pruning has been performed yet, the Rhs values ​​of the generated first-level nodes {A}, {B}, {C}, {D}, and {E} are... +If the set is {ABCDE}, then node {A} represents four candidate functional dependencies: {A}→{B}, {A}→{C}, {A}→{D}, and {A}→{E}. Node {B} represents four candidate functional dependencies: {B}→{A}, {B}→{C}, {B}→{D}, and {B}→{E}, and so on.

[0065] (2) The attribute power set lattice is traversed hierarchically from bottom to top. After the current level traversal is completed, the nodes of the current level are pruned. The nodes of the next level are generated based on the superset nodes of the pruned nodes, until the pruned nodes of the current level have no superset nodes. During the traversal, the representativeness of the candidate functional dependencies corresponding to each node is judged and verified. The pruning is based on the Rhs of the current level nodes. + The search space is further reduced by stripping the set and corresponding attributes or attribute sets.

[0066] This application begins a level-order traversal with a single attribute at the lowest level. During node traversal, each candidate functional dependency represented by the current node is checked and verified. After each level of traversal, pruning is performed, and nodes representing attribute sets with more attributes are generated level by level upwards. When generating nodes for the next level, the attribute intersection of the nodes retained in the previous level is calculated. For example, if node {E} is pruned from {A}, {B}, {C}, {D}, and {E} after the first level of traversal, then the generated second-level nodes are {AB}, {AC}, {AD}, {BC}, {BD}, and {CD}, and all nodes containing E are no longer generated. If no nodes are pruned after the second level of traversal, then the generated third-level nodes are {ABC}, {ABD}, {ACD}, and {BCD}.

[0067] The Rhs-based + Set and pruning specifically refer to: when the Rhs of a certain node + When the set is empty, the node will be removed, meaning that its superset node will not be generated at the next level; the key pruning based on the stripping partition specifically refers to: in addition to using Rhs + In addition to non-minimum and non-trivial functional dependency pruning implemented in the set, if a certain attribute set is found to be a key of the dataset during the traversal by calculating the partitioning, the corresponding node will also be removed. For example, according to Table 1, the partition for the single attribute "name" calculated in the first level of the power set lattice is Π. 姓名 ={{t1}, {t2}, {t3}, {t4}, {t5}, {t6}, {t7}}, its stripped partition is If the partition to be stripped is empty, then the attribute "name" is determined to be a key in the dataset, and the node can be removed.

[0068] In this step, the representativeness of the candidate functional dependencies corresponding to the nodes is judged and verified, specifically as follows:

[0069] Representativeness is determined by the similarity between the functional dependency corresponding to the node and the functional dependencies found in the functional dependency result set. If no functional dependencies have been found, the functional dependency corresponding to the node is directly determined to be representative. The functional dependency similarity is determined based on the Jaccard similarity coefficient and the left and right weights.

[0070] If the functional dependency represented by a node is not representative, then the functional dependency is stored using a compressed tree structure; otherwise, the stripping partition of the corresponding attribute set is calculated to determine whether the functional dependency is valid.

[0071] If the functional dependency is not valid, the corresponding node is retained to participate in the generation of the next level node; if the functional dependency is valid, the compressed tree structure is used to determine if it is the smallest. If it is the smallest, it is added to the functional dependency result set and processed in Rhs. + Delete the corresponding right-hand side.

[0072] The following is a detailed description of the embodiments in Table 1.

[0073] Specifically, for each node in the attribute power set lattice, a representativeness judgment is performed based on functional dependency similarity. The similarity between functional dependencies is calculated based on the Jaccard similarity coefficient and the left and right weights of the functional dependency. If representative, the validity of the functional dependency is verified; otherwise, the check is skipped and the node is recorded using the structure of the prefix tree.

[0074] Representativeness is determined based on the similarity between the functional dependencies corresponding to nodes and the discovered functional dependencies. This functional dependency similarity is determined based on the Jaccard similarity coefficient and the left and right part weights. Specifically, the similarity between functional dependencies is defined as follows: in instance r of pattern R, there exist functional dependencies X→A and Y→B, with left and right part weights w respectively. LHS and w RHS Then the similarity between two functional dependencies is defined as follows: in The left-hand side of the Jaccard similarity coefficient represents the functional dependence. represents the right-hand side Jaccard similarity coefficient for functional dependence.

[0075] Specifically, we compare the similarity between the candidate functional dependencies and the functional dependencies already discovered in the result set. If the similarity between two functional dependencies is greater than a certain threshold α, we call them similar functional dependencies. If there are no similar functional dependencies among the discovered functional dependencies, they are judged to be representative.

[0076] For the attribute power set lattice obtained in step (1), a representativeness judgment based on functional dependency similarity is first performed on each candidate node. Figure 5 The diagram illustrates a partial power set lattice of a dataset containing attributes {ABCDE}. Only the portion relevant to the example descriptions of representative pruning is shown, not the complete power set lattice. In one embodiment, the similarity threshold for functional dependencies is set to α = 0.4, and the left-right weight ratio of the functional dependencies is w. LHS ∶w RHS = 4:1, assuming the dataset contains two minimal nontrivial representative functional dependencies {AB}→{E} and {AC}→{E}, and only focusing on the right-hand side of the functional dependency {E} (i.e., assuming the Rhs of each node is 4:1), + The focus is only on attribute E). Starting from level 1, since no functional dependencies have been found yet and the functional dependency result set is empty, the candidate functional dependency {A}→{E} corresponding to the first node is directly determined as the representative functional dependency. Then, the similarity between the remaining candidate functional dependencies in level 1 and {A}→{E} is calculated. Since the similarity is not greater than the threshold α, each candidate functional dependency {A}→{E}, {B}→{E}, {C}→{E}, and {D}→{E} are verified in turn. No valid functional dependencies are found, so the second-level nodes {AB}, {AC}, {AD}, {BC}, {BD}, and {CD} are generated.

[0077] If the functional dependency corresponding to a node is representative, then the validity of the functional dependency is determined by the stripping partition of the corresponding attribute set; if the functional dependency represented by the node is not representative, then the functional dependency is stored using the structure of a prefix tree.

[0078] In the representativeness assessment phase of candidate functional dependencies, to ensure efficiency, only those functional dependencies most likely to be similar are compared. More specifically, all discovered functional dependencies are arranged according to different levels (determining the number of left-hand attributes) and right-hand attributes. Then, the weights set during the similarity calculation process determine which level of functional dependencies or functional dependencies with a certain right-hand attribute are compared with.

[0079] Starting with the candidate functional dependency {AB}→{E}, traverse level 2. Since the functional dependency result set is empty, the candidate functional dependency {AB}→{E} is considered representative, so its functional dependency is verified. The peeling and partitioning of the computed attribute set is then performed. This yields a valid minimal nontrivial representative functional dependency {AB}→{E}, which is then added to the result set. At this point, attribute E is removed from the Rhs+ set of node {AB}. Therefore, node {AB} is pruned. Figure 5The nodes are marked in red. Next, we traverse the node {AC} and its Rhs... + Rhs Collection + {AC} ={E}, first check the representativeness of the candidate functional dependency {AB}→{E}, based on the similarity definition. in The left-hand side of the Jaccard similarity coefficient represents the functional dependence. Let α be the Jaccard similarity coefficient of the right-hand side of the functional dependency. The similarity between the candidate functional dependency {AC}→{E} and the functional dependency {AB}→{E} in the result set is calculated to be 0.46 > α = 0.4. Therefore, the validation of this candidate functional dependency is skipped, and it is marked as an invalid node. Figure 5 The gray area is used to indicate this. Similarly, for nodes {AD}, Rhs + Rhs Collection + {AD} The candidate functional dependency {AD}→{E} on {E} is also skipped from verification because its similarity to {AB}→{E} is greater than the threshold. Thus, in this algorithm, only 4 of the 6 candidate functional dependencies in level 2 need to be verified, while the verification of the other 2 candidate functional dependencies is skipped, which improves the efficiency of the algorithm.

[0080] In this example, since there is only one functional dependency {AB}→{E} in the result set, each candidate functional dependency needs to be compared with it in terms of similarity.

[0081] The algorithm performs similarity judgment on candidate nodes. If a node is deemed unrepresentative, its verification is skipped. The algorithm adds the node to the aforementioned compressed tree data structure for recording and marks the current candidate functional dependency as invalid. This representative pruning improves the algorithm's efficiency. If a candidate functional dependency is deemed representative, the algorithm verifies whether the functional dependency is valid.

[0082] Specifically, selectively verifying candidate functional dependencies may lead to non-minimum functional dependency results, such as after... Figure 5 The representativeness judgment and pruning shown are as follows: After the level 2 traversal, level 3 nodes {ACD} and {BCD} are generated. When checking the candidate functional dependency {ACD}→{E}, since its similarity with {AB}→{E} is 0.4≤α, we further check whether this functional dependency holds. Here, we calculate the stripping partition. The representative nontrivial functional dependency {ACD}→{E} is obtained. However, since it is not the minimal functional dependency, directly adding it to the result set would result in a non-minimal functional dependency. This is because the minimal functional dependency {AC}→{E} corresponding to {ACD}→{E} is skipped in level 2 due to representativeness considerations. Therefore, a compressed tree data structure is introduced to record all skipped and unverified candidate functional dependencies. Figure 6 The diagram shows a compressed FD-Tree containing four candidate functional dependencies: {A}→{B}, {AB}→{C}, {AB}→{D}, and {CD}→{B}. Except for the root node, each node in the compressed functional dependency tree represents one or more attributes in the variable *r*. Each path from the root to a node represents the left-hand side of one or more functional dependencies. The right-hand side of a functional dependency is marked on the corresponding node on its left-hand path. The color of the marked right-hand side indicates the node type of that functional dependency: black indicates it is a path node, and red indicates it is the last node in the set of left-hand attributes.

[0083] Using this compressed FD-Tree data structure, when skipping the candidate functional dependency {AC}→{E}, it is added to the compressed FD-Tree for recording. Then, after finding a valid functional dependency {ACD}→{E} in level 3, the compressed FD-Tree is checked to see if there are any skipped, unrepresentative functional dependencies whose left-hand side is a subset of {ACD} and whose right-hand side is {E}. At this point, {AC}→{E} will be found in the compressed FD-Tree and used to check its minimality. If {ACD}→{E} is not minimal, it is not added to the result set.

[0084] This application verifies the validity of functional dependencies by dynamically calculating the partitioning of attribute sets. Specifically, if If the functional dependency X→A holds, then the functional dependency is valid. If the functional dependency does not hold, then the candidate node is retained to participate in the generation of the next level node; if the functional dependency holds, then the minimumity is checked.

[0085] As mentioned above, functional dependencies are validated by stripping the computation of partitions. Partitions are not computed from scratch for each attribute set. Instead, a more efficient method is needed to compute a partition as two previously computed partitions of a product, i.e. As shown in Table 1, we have generated partition sets for a single attribute of the dataset. There are 5 different attributes in the table, each corresponding to a 5-partition set. Taking the age attribute as an example, the attribute value range is 4, meaning there are 4 different attribute values: 60, 32, 28, and 49. The tuple with the value 60 for the age attribute is tuple 1; the tuples with the value 32 are tuples 2, 4, and 7; the tuple with the value 28 is tuple 3; and the tuples with the value 49 are tuples 4 and 6. Therefore, there are four clusters under the age attribute: {1}, {2, 4, 7}, {3}, and {4, 6}, corresponding to partitions {{1}, {2, 4, 7}, {3}, and {4, 6}}. Similarly, So we can use Calculated So when we calculate hour, The computational path efficiency is significantly better than The computation efficiency of partitioning is improved because partitions with more attributes contain fewer clusters, requiring less intersection calculation. In other words, to improve the computational efficiency of partitioning or the efficiency of functional dependency verification, partitions at a certain level should be calculated using neighboring lower-level partitions as much as possible, and it is best to avoid calculating the intersection of clusters in partitions one by one starting from a single attribute.

[0086] To improve the efficiency of dynamic partitioning calculation, a hash table structure is used to store the calculated partitions at each level, enabling unified storage and batch deletion. When the stored partition data consumes too much memory, lower-level partitions are preferentially deleted from the hash table. Furthermore, a value 'k' is maintained for each node to record which attribute subset should be used to start calculating the partitions for that node. This value is assigned when the node is generated and dynamically changes during traversal; it is also deleted when the corresponding partition is deleted due to space release. When calculating the partitions for a set of attributes, we start searching for the optimal calculation path using a greedy and first-fit strategy, starting from the position indicated by 'k'.

[0087] like Figure 7As shown, a hash table structure is used to store the calculated stripped partitions at each level, enabling unified storage and batch deletion. Furthermore, a value `k` is maintained for each node to record which attribute subset should be used to calculate the stripped partitions for that node. This value is assigned when the node is generated and dynamically changes during traversal. This value is also deleted when the corresponding partition is deleted due to space release. When calculating the stripped partitions of an attribute set, in the actual algorithm, `k` is represented by a numerical identifier optimized for storage. For simplicity, we will still use ABCDE to represent each attribute. After generating level 1 of the attribute power set lattice, a value `k` is assigned to each node and checked and updated during traversal of each node. Since the stripped partitions for each attribute have already been calculated during initialization, the `k` value of node {A} directly points to... The k value of node {B} points to The k value of node {C} points to And so on.

[0088] When generating level 2, a k value is assigned to each node based on its generation path. For example, if node {AB} is generated from nodes {A} and {B} in level 1, then the k value is directly copied from the assigned values ​​of nodes {A} and {B}. Following the process described in step (2), when calculating the stripping partition of {AB}, the k value will be determined based on... conduct The calculation is performed, and after the calculation is completed, the k value of node {AB} is updated to point to... When calculating the stripped partition of {ABE}, the {ABE} node is generated in advance, and the k value of {ABE} is set to point according to the k values ​​of nodes {AB} and {E}. and Then through calculate And update the k value; while skipping the similarity-based judgment. If the calculation is performed, then no node's k value will point to them; the k value of node {AC} will still point to... and It will not be updated to The same applies to node {AD}; therefore, when generating level 3, the k value of node {ACD} will point to a value based on the k values ​​of nodes {AC / AD} and {CD}. and After automatic optimization and This is a superior calculation method (the optimal path is...). Since we skipped some partition calculations to improve efficiency, we can only choose a suboptimal calculation method here. The k value of node {BCD} will point to different values ​​depending on the k values ​​of nodes {BC / BD} and {CD}. and This is the optimal computation path.

[0089] Since we only need minimal functional dependencies, after obtaining a valid functional dependency, we check in the tree data structure whether there exists a functional dependency whose generalized form is valid. A generalized form refers to a dependency whose left-hand side is a subset of the current functional dependency. This check utilizes the path structure of a binary search tree and a compressed prefix tree to verify the left-hand side and inclusion relationship. If it exists, the current functional dependency is not added to the result set but is pruned. Similarly, the corresponding generalized functional dependency is removed from the tree structure and no longer recorded. Otherwise, it is added to the result set and recorded in Rhs. + Delete the corresponding right-hand side.

[0090] When the stored partition data consumes too much memory, space will be released layer by layer, meaning that lower-level stripping partitions will be deleted from the hash table first. Our partition management will sequentially abandon computational partitions from the lowest level (except for a single attribute, except for level 1, with the lowest level being level 2 in the first space release) to higher levels, until the expected amount of space is released. After releasing space, the k values ​​pointing to these discarded partitions need to be deleted. Therefore, when calculating stripping partitions using the k value as an indication, there will be cases where the k value is deleted and becomes empty. At this point, our partition management will start searching for the optimal computational path using a greedy and first-fit strategy based on the position indicated by k. For example, suppose... Figure 7 The k pointer of the middle node {BCD} and If in the space release of level 2 The node {BCD} was deleted, and its k was updated to point only to the node. So in the calculation If it is found that the subset stripping partition pointed to by k cannot satisfy the computation, a greedy strategy will be used to search for a subset stripping partition that can be used for computation, starting from the maximum subset level of the current attribute set. In this example, the search will start from level 2 and use a first-fit strategy. If the calculation is not satisfied, continue searching for the next one. If we find that {BC}U{BD}={BCD} satisfies the calculation, then by... To calculate

[0091] After the current layer traversal is completed, perform Rhs-based... + The nodes are pruned and stripped from the partition and then moved upwards. Superset nodes of the pruned nodes are generated and their representativeness is judged and verified until there are no superset nodes in the current layer.

[0092] Corresponding to the aforementioned embodiments of the representative functional dependency discovery method, this application also provides embodiments of the representative functional dependency discovery apparatus.

[0093] This application also provides a representative functional dependency discovery apparatus, which may include:

[0094] The power set lattice initial layer generation module obtains the original dataset and, based on the original dataset r = {A1, A2, A3, ..., A...}, generates the initial layer. n Each attribute A in} i Construct an initial layer of the attribute power set lattice, and generate Rhs for each node in the initial layer of the attribute power set lattice. + The set is obtained by clustering to extract the partitions of each attribute in the original dataset;

[0095] The functional dependency discovery module is used to perform a hierarchical, bottom-up traversal of the attribute power set lattice. After the current level traversal is completed, the nodes of the current level are pruned. Nodes of the next level are generated based on the superset nodes of the pruned nodes, until no superset nodes exist for the pruned nodes of the current level. During the traversal, the representativeness of the candidate functional dependencies corresponding to each node is judged and verified. The pruning is based on the Rhs of the current level nodes. + The set and the corresponding attribute or attribute set are stripped and partitioned.

[0096] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0097] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0098] Accordingly, this application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the representative functional dependency discovery method as described above. Figure 8 The diagram shown is a hardware structure diagram of any data processing-capable device where a representative functional dependency discovery device provided by an embodiment of the present invention is located. Except for... Figure 8 In addition to the processor, memory, and network interface shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.

[0099] Accordingly, this application also provides a computer-readable storage medium storing computer instructions thereon, which, when executed by a processor, implement the representative functional dependency discovery method described above. The computer-readable storage medium can be an internal storage unit of any data-processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data-processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data-processing device, and can also be used to temporarily store data that has been output or will be output.

[0100] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.

[0101] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A method for discovering representative functional dependencies, characterized in that, The server used in the database system includes the following steps: (1) Obtain the original dataset from the first database, and based on the original dataset Each attribute in Construct an initial layer of the attribute power set lattice, and generate for each node in the initial layer of the attribute power set lattice. The set is obtained by clustering to extract the partitions of each attribute in the original dataset; (2) Perform a hierarchical traversal of the attribute power set lattice from bottom to top. After the current layer traversal is completed, prune the nodes of the current layer. Generate nodes of the next layer based on the superset nodes of the pruned nodes, until the pruned nodes of the current layer have no superset nodes. Store the resulting functional dependency result set in the second database. During the traversal, the representativeness judgment and verification of the candidate functional dependencies corresponding to each node are performed. The pruning is based on the current layer nodes. The stripping of the set and corresponding attribute or attribute set is performed, the The set consists of the right-hand side of the smallest nontrivial functional dependency that the current node can form; In the database domain, functional dependency is defined as: in the schema Examples ,when and Functional dependency This indicates that in the instance Any two tuples in ,if There must be ; Clustering is used to obtain the stripped partitions for each attribute in the original dataset, including: (1.1) In the original dataset Each attribute The following clustering operation is performed based on attribute values ​​to identify tuples that have the same attribute value on the same attribute. Contained within the same cluster, the clusters form partitions corresponding to each attribute. ,Right now ; (1.2) Partition each attribute obtained in step (1.1). Clusters with only one element are omitted, resulting in a stripped partition. ,Right now ; In step (2), the representativeness judgment and verification of the candidate functional dependencies corresponding to the nodes are performed, specifically as follows: Representativeness is determined by the similarity between the functional dependency corresponding to the node and the functional dependencies found in the functional dependency result set. If no functional dependencies have been found, the functional dependency corresponding to the node is directly determined to be representative. The functional dependency similarity is determined based on the Jaccard similarity coefficient and the left and right weights. If the functional dependency represented by a node is not representative, then the functional dependency is stored using a compressed tree structure; otherwise, the stripping partition of the corresponding attribute set is calculated to determine whether the functional dependency is valid. If the functional dependency is not valid, the corresponding node is retained to participate in the generation of the next level node; if the functional dependency is valid, the compressed tree structure is used to determine if it is the smallest. If it is the smallest, it is added to the functional dependency result set, and... Delete the corresponding right-hand side.

2. The method according to claim 1, characterized in that, if Then functional dependency Established, among which .

3. The method according to claim 1, characterized in that, If the node If the set is empty, then prune that node.

4. The method according to claim 1, characterized in that, For a representative and valid functional dependency, search in the compressed tree structure for a functional dependency whose left part is a subset of the left part of the functional dependency and whose right part is the same as the right part of the functional dependency. If such a functional dependency exists, then the functional dependency is not minimal.

5. The method according to claim 1, characterized in that, A hash table structure is used to store the calculated stripped partitions at each level, with each node maintaining a value. The value records which attribute subset the node's stripping partition should begin calculating from. This value is assigned when the node is generated and changes dynamically during traversal. Therefore, when calculating the stripping partition for a set of attributes, the value is determined based on... The indicated position is used to search for the optimal computational path using a greedy and first-fit strategy.

6. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-4.

7. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1-4.