Patents
Literature
Patsnap Eureka AI that helps you search prior art, draft patents, and assess FTO risks, powered by patent and scientific literature data.

63 results about "Foreign key" patented technology

In the context of relational databases, a foreign key is a set of attributes subject to a certain kind of inclusion dependency constraint, specifically a constraint that the tuples consisting of the foreign key attributes in one relation, R, must also exist in some other (not necessarily distinct) relation, S, and furthermore that those attributes must also be a candidate key in S. In simpler words, a foreign key is a set of attributes that references a candidate key. For example, a table called TEAM may have an attribute, MEMBER_NAME, which is a foreign key referencing a candidate key, EMPLOYEE_NAME, in the EMPLOYEE table. Since MEMBER_NAME is a foreign key, any value existing as the name of a member in TEAM must also exist as an employee name in the EMPLOYEE table.

NL2SQL method based on foreign key completion and knowledge graph

The invention belongs to the technical field of database query and natural language processing, and provides an NL2SQL method based on foreign key completion and a knowledge graph, and the method comprises the steps: extracting a candidate foreign key relationship from database metadata and data content, and trimming and completing the candidate foreign key relationship through a three-layer funnel verification mechanism, a Schema knowledge graph is constructed; based on the natural language query, determining a seed table set directly related to the query intention; on the basis of the Schema knowledge graph, calculating a connection path between nodes of a seed table, complementing an intermediate table on the path, and expanding the seed table into a sub-graph set containing a complete connection relationship; generating a plurality of candidate SQL statements based on the sub-chart set; and executing the plurality of candidate SQL statements, and voting according to the consistency of execution results to select a final SQL statement.
Owner:XIAMEN UNIV +1

Cross-platform power grid data conversion synchronization method and device, terminal and medium

The invention discloses a cross-platform power grid data conversion synchronization method and device, a terminal and a medium. According to the method, a master table in a source database is synchronized to a target database according to master-slave table dependency sequence information; in the synchronization process, an ID mapping table is constructed to record the mapping relation between a first primary key ID and a second primary key ID of each piece of primary table data, the second primary key ID corresponding to a foreign key field is dynamically calculated to be used for updating the foreign key field based on the foreign key field of the slave table in combination with foreign key mapping relation information and the ID mapping table, and the secondary table data is synchronized. Finally, after all the foreign key fields of the slave table are updated, the data synchronization action of the slave table is executed in combination with ORM data synchronization logic, dynamic remapping of the primary key ID is achieved by constructing the ID mapping table, the foreign key fields of the slave table are updated based on the foreign key mapping relation information, the foreign key reference integrity during cross-database synchronization is ensured, and the synchronization efficiency is improved. The problem of foreign key reference integrity caused by inconsistent primary key IDs in the cross-database synchronization process is effectively solved.
Owner:ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD

Automated metadata generation and natural language database querying

A machine-readable medium stores instructions that, when executed by a processor, cause the processor to execute operations. The operations include receiving information identifying a database table and preprocessing the table. The preprocessing includes extracting primary and foreign key relationships and generating sample data by combining frequency-based sampling of common values with random sampling. The operations also include generating, using an LLM, a unified metadata schema. The generating includes processing the table and the sample data using domain-specific prompts and outputting the unified metadata schema. The operations include embedding and indexing the unified metadata schema and converting a natural language question output from an end-user device into a SQL query. The converting includes identifying relevant metadata in the unified metadata schema matching query intent and generating the SQL query using the filtered metadata. The operations also include executing the SQL query and providing query results to the end-user device.
Owner:INVENTUS HOLDINGS LLC

Data warehouse model design method

The invention discloses a data warehouse model design method, and belongs to the technical field of data warehouse modeling. According to the method, a dimension modeling method is adopted to construct and analyze a mart model, data is organized into a non-standardized relation model, and the relation between tables is defined through keywords and foreign keys. And designing a dimension table system comprising a product dimension, a calendar day dimension, an institution dimension, an insurance policy attribute dimension and a customer dimension, and a fact table system comprising an insurance claim settlement analysis fact table, a payment analysis fact table, a claim settlement efficiency analysis fact table and a corresponding intermediate fact table. The analysis subject domain data is formatted into a star model or snowflake model, where the analysis fact table is a lightly summarized transactional fact table, and the intermediate fact table is a versioned historical table. According to the method, repeated data construction is avoided through a unified modeling method, and the cost is reduced; an efficient query analysis function is provided by optimizing a model structure; and the data traceability is ensured through versioning management.
Owner:HAIER CONSUMER FINANCE CO LTD

Test data generation method and apparatus, device, and storage medium

The application discloses a test data generation method and device, equipment and a storage medium. The test data generation method comprises the following steps: obtaining a plurality of target record contents from a test data rule table, each target record content comprising a field type, data source information, test data generation rule information corresponding to the data source, and a record number; for each target record content, generating a test data table based on the data source information, the test data generation rule information, the record number, and a first table generated based on the field type; and finally, combining a plurality of test data tables based on the association relationship between the physical primary keys and the physical foreign keys of the plurality of database tables to obtain test data. According to the embodiment of the application, the test data is generated, the test data is rich in dimensions, the association relationship between the data is complete, and conforms to the real law.
Owner:CHINA CONSTRUCTION BANK +1

A method, device and medium for invoking a low-code data interface

The application discloses a low-code data interface calling method, equipment and medium, and the method comprises the following steps: confirming a target entity and an entity parameter corresponding to the target entity; the entity parameter comprises at least one of an entity name, a field name, a field type, a field position, whether to be filled in, an index and a foreign key; a database table corresponding to the target entity is constructed according to the entity parameter; the interface name, the interface parameter set and the interface parameter format of the target interface are defined according to the database table; the target interface of the target entity is generated according to the interface name, the interface parameter set, the interface parameter format and the entity parameter; the target interface is published, and an authorization key of the target interface is generated; it is determined that a target interface calling request from a calling party is received, and authorization signature information contained in the target interface calling request is acquired; the calling party is authorized and verified according to the authorization signature information and the authorization key, and if the verification is passed, the calling party is allowed to call the target interface.
Owner:浪潮工业互联网股份有限公司

N-way multimaster replication system and method thereof

In distributed data management traditional databases often struggle to maintain consistency and handle conflicts. Traditional solutions prioritize specific combinations of properties, resulting in trade-offs that impact user experience and application functionality. Present disclosure provides systems and methods that route incoming transaction associated with application to corresponding database server (DBS) by integrating geographical proximity mean value, and sender internet protocol affinity value. The incoming transaction is processed to extract data manipulation language (DML) operation written by the application and replicated to each DBS other than a DBS on which the application is directly applying a data through the incoming transactions. A primary key is generated by allocating an unique identifier if the DML operation is inserted on identified DBS. The primary key of record is updated from the incoming transaction. A conflict associated with parent and child association of the DML operation is dynamically monitored based on integrity Foreign key Constraint.
Owner:TATA CONSULTANCY SERVICES LTD

Real-time wide table construction method, system and equipment based on combination of Spark and Flink and medium

The invention provides a real-time wide table construction method, system and device based on the combination of Spark and Flink and a medium, and the method comprises the steps: S1, constructing a data link based on a Spark connector, and completing the rapid generation of a data set snapshot; s2, constructing a data link based on a FlinkCDC connector, and realizing incremental real-time updating of data; s3, stopping the Spark data synchronization program, setting the Flink CDC to consume increment change data in real time from the latest snapshot position generated in S1, and dividing a table needing to be associated into a master table and a plurality of slave tables; when the master table is changed, rechecking the related slave tables according to the association keys, combining to form wide table data, and writing the wide table data into a downstream wide table database in an upsert mode; and when the slave table changes, the corresponding data in the downstream wide table is directly updated according to the association key or the foreign key. Through the mechanism, changes of all the association tables can be fed back to the downstream wide table in real time, so that dynamic construction of the wide table is completed.
Owner:AACAT TECHNOLOGY LTD

Hardware acceleration of relational operations

This disclosure describes an implementation of a computing system that utilizes accelerator hardware configured to perform parallel computation of matching pairs of a join operation of a database program. This computation is performed at least in part by, for each thread that determines a matching pair, computing an offset in an output tuple by adding a global rank of a respective block, an intra block rank of a respective warp, and an intra warp rank of a respective thread. This computation is further performed by storing index values for a primary key and a foreign key in a matching pair at the computed offset location in an output tuple, and outputting the output tuple.
Owner:MICROSOFT TECHNOLOGY LICENSING LLC

Hash connection implementation method, electronic equipment, computer readable storage medium and computer program product

The invention discloses a Hash connection implementation method, electronic equipment, a computer readable storage medium and a computer program product, and the method comprises the steps: creating a reference table according to an implementation method for foreign key reference and connection query based on an array index, automatically creating a reference array index for the reference table through a specified option when the reference table is created, and automatically creating a connection query result according to the reference array index. Meanwhile, a referenced array index is automatically created for the referenced table; a column of reference is added to the created reference array index, and a new reference array index is obtained; constructing a byte array according to [the maximum subscript used in the quoted array index corresponding to the quoted table / 8] + 1, and setting the content of the byte array as 0; for all records meeting conditions in the referenced table, setting a bit corresponding to the byte array as 1; all units in the reference array index are sequentially scanned, and for the matching condition, the required referenced table and the corresponding record information of the reference table are directly output to an upper-layer operator.
Owner:JIANGSU DAMENG DATABASE CO LTD

Method for establishing miichthys miiuy germplasm resource library

The invention discloses a method for establishing a miichthys miiuy germplasm resource library, and particularly relates to the technical field of germplasm resource information management. According to the method, a drift risk assessment model is constructed based on a main key variation sensitivity factor and a foreign key reference strength index, and when the risk level of a sample main key exceeds a set threshold value, a version control type database structure is automatically started to replace a traditional main and foreign key direct mapping relation; by introducing a version number and an activation identification field, multi-version coexistence and traceable management of a sample primary key are realized; meanwhile, through consistency verification and an automatic remapping mechanism, the problem of external key contact loss caused by primary key change in the sub-table is solved; the method has high reliability, structural elasticity and good expandability, is suitable for data structure long-term evolution and information traceability requirements in an aquatic product germplasm resource management system, and significantly improves the consistency and integrity of sample data and the stability of system operation.
Owner:MARINE FISHERIES RES INST OF ZHEJIANG

A heterogeneous database logical association construction and privacy compliance code generation method for intelligent programming assistance

This invention discloses a method for constructing logical associations and generating privacy-compliant code for heterogeneous databases in intelligent programming assistance. It introduces a custom metadata description file independent of the database's physical schema, defining cross-domain logical association attributes and data security attributes, including the target database identifier. The description file is parsed, comparing the associated target with the database identifier of the current context, and automatically selecting either an intra-database join strategy or an application-layer aggregation strategy based on the comparison result. An enhanced context hint containing architectural constraints and security rules is constructed, and the target code is generated by inputting a large language model. De-identification processing logic is automatically embedded based on the data security attributes. This invention effectively solves the problems of AI programming context breakage, cross-database association code generation errors, and data privacy compliance risks caused by missing physical foreign keys in microservice architectures, achieving automatic code generation and source-level data privacy protection for complex cross-service business logic.
Owner:CHINA LIFE INSURANCE CO LTD

Method and device for detecting foreign key constraint, electronic equipment and storage medium

The application relates to the technical field of detection, and particularly provides a foreign key constraint detection method and device, electronic equipment and a storage medium. The foreign key constraint detection method comprises the following steps: determining a target key value of a to-be-inquired foreign key in a to-be-inquired row according to a received target query instruction, and obtaining a key value set; at an executor level, a key value query task is constructed based on the key value set; the key value query task is executed by the executor, and a target query result is obtained. In this way, the system overhead is reduced, and the system performance is improved without SQL statement analysis and execution.
Owner:BEIJING OCEANBASE TECHNOLOGY CO LTD

Database table foreign key association reconstruction method and device

The invention relates to the technical field of databases, and discloses a database table foreign key association reconstruction method and device. The method comprises the steps that columns of multiple target data tables are combined in pairs to generate column pairs, and a first set is constructed based on all the column pairs; pruning the first set based on the target unique key through the target large language model; constructing a second set based on column pairs reserved after pruning; performing foreign key association detection on the column pairs in the second set through the target large language model to obtain a detection result; traversing all the column pairs with foreign key association, and deleting at least one column pair with foreign key association through the target large language model under the condition that foreign key conflicts exist between the column pairs so as to eliminate the foreign key conflicts; under the condition that foreign key conflicts do not exist between the column pairs, foreign key association is reconstructed for the multiple target data tables. By adopting the method, the accuracy and generalization of foreign key association reconstruction of the database can be improved, and the reconstruction quality is improved.
Owner:PEKING UNIV

A metadata and metadata relationship automatic extraction method, system and product

This invention provides a method, system, and product for automatically extracting metadata and metadata relationships, relating to the field of big data technology. The method includes: extracting table information, table field information, and foreign key relationships between tables in the current database to obtain explicit metadata; extracting multiple sample data entries from each table; assembling the explicit metadata and the sample data entries to obtain model instruction prompts; using these prompts to call a large language model to output structured table semantic descriptions and field semantic descriptions, and outputting these as metadata; extracting semantic relationships between tables based on the table semantic descriptions, and extracting semantic relationships between fields based on the field semantic descriptions; and outputting the inter-table semantic relationships and inter-field semantic relationships as metadata relationships. This invention solves the problem that existing technologies mainly focus on explicit structured information while neglecting deep semantic mining, significantly improving the efficiency and fault tolerance of data querying, integration, and modeling processes.
Owner:CHINESE PEOPLES LIBERATION ARMY INFORMATION SUPPORT CORPS ENGINEERING UNIVERSITY

A method, device and equipment for generating a purchase and sale contract and a storage medium

The application provides a purchase and sale contract generation method and device, equipment and a storage medium, including: when the order is approved, obtaining order information, the order information including: the number, the quantity; generating a pre-purchase and sale contract according to the order information; obtaining the input pre-purchase and sale contract that needs to be merged; judging whether the number of pre-purchase and sale contracts that need to be merged is greater than one; if yes, judging whether the pre-purchase and sale contract that needs to be merged meets the merging rule; if yes, merging the pre-purchase and sale contract that needs to be merged to generate a purchase and sale contract, and associating the pre-purchase and sale contract that needs to be merged with the purchase and sale contract through the way of an associated foreign key. Through the connection between the upstream order, the purchase and sale contract is quickly and efficiently made, and multiple pre-purchase and sale contracts are merged into one purchase and sale contract, so that the number of contracts is reduced, and the problems of printing waste and easy error are avoided. Again, by associating the pre-purchase and sale contract with the purchase and sale contract, the repeated storage of data is avoided, and the data redundancy is greatly reduced.
Owner:GREIGER (SHENZHEN) TECH CO LTD

Data synchronization method, apparatus, medium, and electronic device

Embodiments of the present application disclose a data synchronization method, device, medium and electronic equipment. The method comprises: obtaining synchronization configuration information of a to-be-synchronized database, and determining target synchronization data in the to-be-synchronized database according to a data synchronization range in the synchronization configuration information; determining synchronization associated data associated with the target synchronization data according to a foreign key selection operation acting on the target synchronization data; generating a data synchronization task according to the target synchronization data and the synchronization associated data; and publishing the data synchronization task to distributed database nodes for each distributed database node to preempt and execute the data synchronization task. In the data synchronization process, the embodiments of the present application synchronize the association relationship between data in the to-be-synchronized database, thereby ensuring the data consistency of the synchronization data.
Owner:AGRICULTURAL BANK OF CHINA

Internet self-research operation and maintenance management method, device and storage medium

The application discloses an internet self-research operation and maintenance management method, device and storage medium, comprising: analyzing current operation and maintenance management requirements, and determining at least one target instance according to the analysis result; extracting the associated foreign key of the target instance, and dynamically associating the target instance based on the associated foreign key to form a target entity set; obtaining business configuration information based on the target entity set, updating the dynamic key-value pair configuration of the target entity set according to the business configuration information; generating a task flow arrangement template based on the updated target entity set, and scheduling a task object to execute a task chain through the task flow arrangement template. The application establishes a multi-level configuration management architecture and a templated task chain mechanism, supports environment adaptive differentiated execution after automatically merging multi-level configuration parameters, improves operation and maintenance efficiency and full-link execution monitoring and auditing traceability capability, and reduces the risk of manual operation errors.
Owner:SHENZHEN BAOYI NETWORK TECH CO LTD

Discovering a schema for a data lakehouse by identifying the primary and foreign keys

ActiveUS12681906B2Connection tableEngineering
Described are techniques for identifying primary and foreign keys to build a schema. A primary key of a query table of a data lakehouse, which may consist of multiple columns, is identified. The top n-similar columns of the tables of the data lakehouse are then identified to identify the joinable tables using the primary key as a query using column embeddings. A list of candidate joinable tables is then identified based on the identified top n-similar columns of tables of the data lakehouse. Joinable tables from the list of candidate joinable tables are selected that satisfy an inclusion dependency constraint. The foreign keys having full containment with the primary key of the query table are then identified from the selected joinable tables. Such identified primary and foreign keys are utilized to build / discover the schema, such as a relational schema, of the data lakehouse.
Owner:INTERNATIONAL BUSINESS MACHINE CORPORATION

Foreign key constraint checking method and device, equipment and storage medium

The application provides a foreign key constraint checking method and device, equipment and a storage medium, and relates to the technical field of databases and the technical field of data processing. The method comprises the following steps: preprocessing a first foreign key value to obtain a first hash value and mapping the first hash value to a bit array to obtain a Bloom relationship table, the first foreign key value being any one of foreign key column data of a reference table; preprocessing a foreign key value of to-be-written data to obtain a second hash value and performing bit matching in the Bloom relationship table according to the second hash value; and in the case of a failed bit matching, rejecting to write the to-be-written data. The method provided by the application can improve the foreign key constraint checking efficiency.
Owner:CETC JINCANG (BEIJING) TECH CO LTD

Database logical topology construction method based on large language model

The application discloses a database logical topology construction method based on a large language model, which comprises the following steps: obtaining target database Schema information, using a large language model to complete the semantic metadata of a missing service to generate enhanced metadata; based on the enhanced metadata, performing multi-stage reasoning arrangement to construct a global logical topology network, using an adaptive partition strategy and an early stop mechanism to solve the context limitation problem of the large language model; performing information entropy determination on key data fields to identify feature types, using an orthogonal boundary synthesis method to construct a virtual sample set covering global feature values to obtain an enhanced topology network; establishing a Schema change monitoring mechanism, triggering an incremental adsorption algorithm to integrate change elements, and maintaining the validity of the correlation relationship through a timeliness confidence decay model to obtain a dynamic global logical topology. The application realizes automatic correlation mining and topology dynamic maintenance of a foreign key-free database, and improves the SQL generation accuracy of an intelligent query scene.
Owner:BEIJING E TECHSTAR

Software application label management for machine learning

A computer-implemented method includes adding, using a label management system (LMS), an object-specific multi-value label extension field to an application object (AO) associated with a software application. Using the LMS and to an AO user interface (UI) associated with the AO, a multi-value label UI extension field is added. Using the LMS, a label value table and associated label value maintenance UI is created to maintain label values. Using the LMS, a mapping table is created between the object-specific multi-value label extension field of the AO and the label value table. Using the LMS and the AO UI, label values assigned to the AO are read using foreign key retrieval from the mapping table and the label value table.
Owner:SAP SE

A method and system for storing and invoking a knowledge representation data structure

The application discloses a kind of storage and calling method and system of knowledge representation data structure, comprising: equivalence relation record table is constructed in computer external storage medium, single record in the record table includes first expression field and second expression field, and two fields are not distinguished in physical byte arrangement main key and foreign key;First expression and second expression with semantic equivalence mapping relationship are written into first expression field and second expression field respectively;Global unique expression hash index is constructed to single record in record table, and hash index table is established.In the application, processor can be realized when undertaking bidirectional mixed load, positive and negative direction query share same memory cache page, so as to effectively avoid page replacement concussion, and can realize the fast addressing of point-to-point equivalence relationship, and make cache hit rate greatly improve.
Owner:UNIV OF SCI & TECH OF CHINA

A method for determining foreign keys in a data table, an electronic device, and a storage medium.

This invention provides a method, electronic device, and storage medium for determining foreign keys in a data table, involving obtaining the semantic similarity η between the annotation ZA corresponding to any field name TA in a first data table and the annotation ZB of any field name TB in a second data table. AB ; Obtain the attribute data similarity λ between the attribute data list corresponding to TA and the attribute data list corresponding to TB. AB The process involves obtaining an initial field name pair list C; acquiring the matching degree and expansion rate; obtaining the historical query percentage corresponding to each field name in each initial field name pair in C; determining the query percentage based on historical query statements; determining the correlation degree of each initial field name pair; and identifying initial field name pairs with a correlation degree greater than a preset correlation degree threshold as foreign keys in the first and second data tables. This invention effectively solves the problem of low efficiency in manual judgment when there are a large number of data tables.
Owner:MOBILE TECH COMPANY CHINA TRAVELSKY HLDG

Generation method and generation device of database query language

The invention discloses a database query language generation method and device. The generation method comprises the steps of obtaining an entity set, an intention type and an intention classification probability in question information according to the question information input by a user; based on the entity set, the intention type and the intention classification probability, target tables are screened out from candidate tables of a preset metadata graph, and foreign keys between the target tables are obtained according to foreign key activeness weights; and obtaining a database query statement corresponding to the question information based on the target table, the foreign key and a preset constraint condition. According to the generation method, the candidate table can be subjected to intention type and intention classification probability filtering and then matched with the entity set, and the precision of selecting the target table in the candidate table is improved. According to the generation method, the foreign keys are obtained according to the foreign key activeness weights, the foreign keys with high activeness represent that the relevance between the two target tables is high, and the probability of establishing the JOIN path is high.
Owner:FUTAIHUA PRECISION ELECTRONICS (ZHENGZHOU) CO LTD

A metadata-driven text-to-sql adaptation method

This invention discloses a metadata-driven adaptive Text-to-SQL method, relating to the field of natural language processing technology. It involves: initially screening pattern items based on database metadata to obtain a preliminary pattern subset; then, obtaining a simplified pattern subset through disambiguation verification of candidate columns; constructing a weighted set of join constraints based on foreign key relation metadata; determining an anchor table set based on the simplified pattern subset; calculating the reachability strength of each table; selecting and forming a set of joinable closure tables and determining the structurally joinable retrieval domain; establishing an inverted index for columns in the retrieval domain; allocating recall quotas based on the relevance scores of each column and the reachability strength of its respective table; and retrieving and filtering to generate a predicate evidence set. Finally, organizing database prompts based on the simplified pattern subset, relevant join constraints, and the predicate evidence set, and inputting them into an SQL generation model to generate executable SQL. This method adaptively constrains and enhances the Text-to-SQL generation process using metadata.
Owner:贵州省通信产业服务有限公司

Method and device for generating a synthetic data table, electronic equipment and storage medium

The embodiment of the application discloses a kind of generation methods, device, electronic equipment and storage medium of synthetic data table, belong to big data processing technical field.Method includes: according to the primary key and foreign key of each original table, determine out field name dependency relationship and field data dependency number;According to field name dependency relationship, the field name of multiple original tables is merged to obtain first total table;According to field data dependency number, at least part field data is simulated data processing, and the simulated field data corresponding to any two field names is obtained;According to all simulated field data, update first total table to obtain second total table, according to field name dependency relationship, split second total table, generate and the table structure of each original table one-to-one corresponding initial synthetic data table;According to field name dependency relationship, field data dependency number and second total table, update each initial synthetic data table, obtain the target synthetic data table corresponding to each original table.The application can improve the efficiency of generating synthetic data table.
Owner:PENG CHENG LAB

A metadata-based database foreign key relationship identification method

This invention discloses a method for identifying foreign key relationships in databases based on metadata, relating to database technology, data processing, and natural language processing. The method first extracts database metadata and statistically analyzes core field features, generating a standardized metadata set through standardized preprocessing. Then, it parses this set to filter explicit primary keys, determines semantic primary keys based on metadata statistical features and semantic rules, and integrates these to generate a global primary key set. Subsequently, it encodes string features in the metadata set to generate candidate foreign key field pairs, and calculates the structural dependency degree (SDS) by fusing three metadata-derived features: value range coverage, primary key uniqueness coefficient, and reference dependency rate. Finally, it verifies and filters valid and suspected foreign key relationships based on a preset threshold, generating a standardized foreign key relationship result set. This invention does not rely on field naming, is robust to data noise, accurately identifies database foreign key relationships, and achieves full-process traceability and verifiability based on metadata, providing reliable structural support for data governance and intelligent database applications.
Owner:HUNAN UNIV

A method for NL2SQL based on foreign key completion and knowledge graph

This disclosure belongs to the field of database query and natural language processing technology. It provides an NL2SQL method based on foreign key completion and knowledge graph. The method includes: extracting candidate foreign key relationships from database metadata and data content, and pruning and completing the candidate foreign key relationships through a three-layer funnel verification mechanism to construct a schema knowledge graph; determining a set of seed tables directly related to the query intent based on natural language queries; calculating the connection paths between seed table nodes based on the schema knowledge graph, completing intermediate tables on the paths, and expanding the seed tables into a set of subgraphs containing complete connection relationships; generating multiple candidate SQL statements based on the subgraph set; executing the multiple candidate SQL statements, and selecting the final SQL statement based on the consistency of the execution results.
Owner:XIAMEN UNIV +1