Natural language query analysis and database field matching method based on large model

By combining the large language model LLM and STAM mechanism with the approximate nearest neighbor algorithm for multi-strategy fusion matching, the problem of inaccurate database field location in the NL2SQL system is solved, and the accurate matching of natural language queries to database fields is achieved, thereby improving query accuracy and system availability.

CN121009105BActive Publication Date: 2026-05-15数字郑州科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
数字郑州科技有限公司
Filing Date
2025-07-22
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, Natural Language to SQL (NL2SQL) systems are inaccurate in locating database fields, leading to skewed query results, missing or incorrect data, decreased system availability, and increased maintenance costs. They also lack accurate and robust field matching methods.

Method used

Large Language Model (LLM) is used for intent parsing and entity recognition. The STAM mechanism is combined to bind entity types. A column description vector library is constructed and an Approximate Nearest Neighbor (ANN) algorithm is used for efficient retrieval. A candidate column set is formed through a multi-strategy fusion matching mechanism, and field descriptions with enhanced semantics are generated. Finally, redundant tables are eliminated by considering the information density and connectivity within the table.

Benefits of technology

It achieves accurate and robust matching of natural language queries to database fields, improves query accuracy and system availability, reduces the frequency of manual intervention, and optimizes database representation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121009105B_ABST
    Figure CN121009105B_ABST
Patent Text Reader

Abstract

The embodiment of the specification provides a natural language query analysis and database field matching method based on a large model, which comprises the following steps: performing intent analysis and entity recognition on a user natural language query based on a large language model (LLM) to extract a potential keyword set; for each extracted keyword, binding an entity type through an STAM mechanism and constructing an entity-type mapping relationship; constructing a column description vector library, combining an approximate nearest neighbor (ANN) algorithm to realize efficient retrieval, and combining a multi-strategy fusion matching mechanism to combine the results of semantic vector matching, edit distance matching and traceability enhanced matching to form a final candidate column set; connecting a database metadata interface, analyzing information and constructing a basic structure to generate an enhanced semantic field description, and outputting in a four-tuple structure; reversing the corresponding table through column matching, judging the table structure value in combination with the information density in the table and the connectivity with other tables, eliminating redundant tables, and optimizing the database representation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of natural language processing technology, and in particular to a method and system for natural language query parsing and database field matching based on a large model. Background Technology

[0002] In the era of big data, enterprises need to effectively manage massive amounts of data. Therefore, relational databases and data warehouses have become core tools for data storage and management. However, in actual business operations, users often need to quickly access and analyze this data, a process that often relies on manually writing SQL statements. To alleviate the repetitive process of manually writing SQL, Natural Language to SQL (NL2SQL) technology has emerged. Its core goal is to automatically convert users' query requirements, described in natural language, into structured SQL statements, thereby lowering the technical barrier to data access and improving data analysis efficiency.

[0003] In practical applications, inaccurate table and field location has become one of the key bottlenecks in the implementation of NL2SQL. Due to the large number of fields in databases, diverse naming rules, and the lack of unified standards, users' natural language descriptions often differ semantically from the actual database fields, resulting in vague or even ambiguous expressions. If the system cannot accurately identify and locate the correct tables and fields, it leads to skewed query results and misleads business analysis.

[0004] Specifically, the impact of inaccurate field matching includes, but is not limited to: incorrect query results: returning data that does not match the user's intent, leading to distorted analysis; data omissions or errors: missing key indicators or selecting irrelevant fields, affecting business insights; decreased system availability: users repeatedly failing to get results, reducing their trust in the system; increased maintenance costs: requiring frequent manual intervention to correct query logic, increasing the human burden and negating the advantages of NL2SQL. Therefore, how to accurately and robustly map natural language intent to the correct database tables and table fields has become a key technical challenge to improve the accuracy, availability, and business value of NL2SQL systems. There is an urgent need for an intelligent parsing and matching system based on large language models to fill the gap in the accuracy of field positioning in complex scenarios using existing technologies. Summary of the Invention

[0005] This specification provides one or more embodiments of a method for natural language query parsing and database field matching based on a large model, including:

[0006] S1. Based on the Large Language Model (LLM), perform intent parsing and entity recognition on user natural language queries to extract a set of potential keywords;

[0007] S2. For each extracted keyword, bind it to an entity type using the STAM mechanism and construct an entity-type mapping relationship;

[0008] S3. Construct a column description vector library, combine it with the approximate nearest neighbor ANN algorithm to achieve efficient retrieval, and combine the results of semantic vector matching, edit distance matching and source enhancement matching through a multi-strategy fusion matching mechanism to form the final candidate column set;

[0009] S4. Connect to the database metadata interface, parse the information and build the basic structure, generate field descriptions with enhanced semantics, and organize the output in a four-tuple structure;

[0010] S5. By reverse-engineering the table through column matching, and combining the information density within the table with its connectivity with other tables, the value of the table structure is determined, redundant tables are eliminated, and the database representation is optimized.

[0011] Furthermore, step S1 specifically includes:

[0012] An end-to-end entity recognition and keyword extraction framework is constructed using a Large Language Model (LLM). It performs intent parsing on user natural language queries (Q), identifies multiple entity types including time, location, organization, quantity, and event, and extracts a set of potential keywords, as shown below:

[0013] ;

[0014] The extracted results are transformed into dimensions and metrics of potential query intent through context-aware modeling and type mapping.

[0015] Furthermore, step S2 specifically includes:

[0016] For each extracted keyword Design an entity tracing and reasoning module based on LLM, which binds an entity type through the STAM mechanism. As shown below:

[0017] ;

[0018] Abstract concrete entities into semantic hierarchical types and construct entity-type mapping relationships.

[0019] Furthermore, step S3 specifically includes:

[0020] A column description vector library is constructed, and semantic vectors are generated for user natural language queries by combining the Approximate Nearest Neighbor (ANN) algorithm. The cosine similarity between the semantic vector and the column vector is calculated, the top-k highly relevant columns are returned, and a dynamic threshold α is set to filter out noisy matching items to obtain the semantic vector matching results.

[0021] An edit distance algorithm is introduced to calculate the character-level similarity between entity words and field enumeration values ​​in the user query, and obtain the edit distance matching result;

[0022] For values ​​that cannot be matched by character similarity, the dimension or type to which they belong is inferred through entity semantic attribution method, and the result is semantically matched with the column description vector to obtain source-enhanced matching results.

[0023] The three sets of results—semantic vector matching, edit distance matching, and source-based enhancement matching—are merged to form the final candidate column set.

[0024] Furthermore, step S4 specifically includes:

[0025] Connect to the database metadata interface, parse database information, including table names and table field names, build a basic structure for each table, sample data for each column in each table, deduplicate the sampled values, count the frequency, and obtain a set of high-frequency representative enumeration values ​​for the field.

[0026] By selecting representative enumeration values, field descriptions with enhanced semantics are generated;

[0027] The generated information is summarized into a standard four-tuple structure, and the output is JSON or structured data.

[0028] Furthermore, step S5 specifically includes:

[0029] By reverse-engineering the table by matching columns, and combining the information density within the table with its connectivity with other tables, the value of the table structure is determined, and tables with redundant structure, sparse information, and no connectivity are eliminated.

[0030] Furthermore, a column description vector library is constructed, and an efficient retrieval is achieved by combining it with the approximate nearest neighbor ANN algorithm. The results of semantic vector matching, edit distance matching, and source tracing enhancement matching are merged through a multi-strategy fusion matching mechanism to form the final candidate column set. The specific calculation method is as follows:

[0031]

[0032]

[0033]

[0034]

[0035] in, These are keywords extracted from the problem by LLM; For each keyword Vectors encoded by Embedding; A column description representing each column in a database table; Indicates the description of each column Vectors encoded by Embedding; Indicate each The set of words derived from LLM through the STAM mechanism; Representing each source word Vectors encoded by Embedding; A set described by columns; This is the set of enumerated values ​​for each column of the database table; cosine_similarity represents the cosine similarity; levenshtein represents the edit distance; , : represents the threshold; F1 represents calculating the cosine similarity between each K and each D, and taking the set of D that are greater than the threshold; F2 represents calculating the cosine similarity between each C and each D, and taking the set of D that are greater than the threshold; F3 represents calculating the edit distance between each K and each V, and taking the set of V that are greater than the threshold; F is the union of the three sets F1, F2, and F3.

[0036] This specification provides one or more embodiments of a natural language query parsing and database field matching system based on a large model, including:

[0037] Keyword extraction module: Used to perform intent parsing and entity recognition on user natural language queries based on Large Language Model (LLM), and extract a set of potential keywords;

[0038] Relationship building module: used to bind each extracted keyword to an entity type through the STAM mechanism and build an entity-type mapping relationship;

[0039] The retrieval module is used to build a column description vector library, combine the approximate nearest neighbor ANN algorithm to achieve efficient retrieval, and combine the results of semantic vector matching, edit distance matching and source tracing enhancement matching through a multi-strategy fusion matching mechanism to form the final candidate column set.

[0040] Parsing module: Used to connect to the database metadata interface, parse information and build basic structure, generate field descriptions with enhanced semantics, and organize the output in a four-tuple structure;

[0041] The filter module is used to infer the table to which a table belongs by matching columns, and to determine the value of the table structure by combining the information density within the table and its connectivity with other tables, thereby eliminating redundant tables and optimizing the database representation.

[0042] This specification provides one or more embodiments of an electronic device, including:

[0043] Processor; and,

[0044] A memory is configured to store computer-executable instructions, which, when executed, cause the processor to implement the steps of the above-described method for natural language query parsing and database field matching based on a large model.

[0045] This specification provides one or more embodiments of a storage medium for storing computer-executable instructions that, when executed, implement the steps of the above-described method for natural language query parsing and database field matching based on a large model.

[0046] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 A flowchart illustrating a natural language query parsing and database field matching method based on a large model, provided for one or more embodiments of this specification;

[0049] Figure 2 A schematic diagram illustrating the composition of a natural language query parsing and database field matching system based on a large model, provided for one or more embodiments of this specification;

[0050] Figure 3 This is a schematic diagram of the structure of an electronic device provided for one or more embodiments of this specification. Detailed Implementation

[0051] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.

[0052] Method Implementation Examples

[0053] According to embodiments of the present invention, a method for natural language query parsing and database field matching based on a large model is provided. Figure 1 The flowchart illustrates a method for natural language query parsing and database field matching based on a large model, provided for one or more embodiments of this specification. Figure 1 As shown, the natural language query parsing and database field matching method based on a large model according to an embodiment of the present invention specifically includes:

[0054] S1. Based on the Large Language Model (LLM), perform intent parsing and entity recognition on user natural language queries to extract a set of potential keywords.

[0055] An end-to-end entity recognition and keyword extraction framework is constructed using a Large Language Model (LLM). It performs intent parsing on user natural language queries (Q), identifies multiple entity types including time, location, organization, quantity, and event, and extracts a set of potential keywords, as shown below:

[0056] ;

[0057] The extracted results are transformed into dimensions and metrics of potential query intent through context-aware modeling and type mapping.

[0058] S2. For each extracted keyword, bind it to an entity type through the STAM mechanism and build an entity-type mapping relationship.

[0059] For each extracted keyword Design an entity tracing and reasoning module based on LLM, which binds an entity type through the STAM mechanism. As shown below:

[0060] ;

[0061] Specific entities are abstracted into semantic hierarchical types (e.g., "2024" is classified as "year" and "Beijing" as "region / area"), and entity-type mapping relationships are constructed to support semantic generalization, category extension and contextual reasoning, thereby enhancing the system's adaptability in fuzzy expression scenarios.

[0062] S3. Construct a column description vector library, combine it with the approximate nearest neighbor ANN algorithm to achieve efficient retrieval, and combine the results of semantic vector matching, edit distance matching and source tracing enhancement matching through a multi-strategy fusion matching mechanism to form the final candidate column set.

[0063] A column description vector library is constructed, and semantic vectors are generated for user natural language queries using the Approximate Nearest Neighbor (ANN) algorithm. The cosine similarity between the semantic vectors and column vectors is calculated, and the top-k highly relevant columns are returned. A dynamic threshold α is set to filter out noisy matching items to obtain the semantic vector matching results. In this embodiment, the dynamic threshold α is set to 0.65.

[0064] An edit distance algorithm is introduced to perform character-level similarity calculation between entity words and field enumeration values ​​in user queries. It is suitable for fuzzy matching in scenarios such as year and code, and obtains edit distance matching results.

[0065] For values ​​that cannot be matched by character similarity, the dimension or type to which they belong is inferred through entity semantic attribution (e.g., "Beijing" → location / region), and the result is semantically matched with the column description vector to obtain source-enhanced matching results.

[0066] The three sets of results—semantic vector matching, edit distance matching, and source-based enhancement matching—are merged to form the final candidate column set.

[0067] The specific calculation method is as follows:

[0068]

[0069]

[0070]

[0071]

[0072] in, These are keywords extracted from the problem by LLM; For each keyword Vectors encoded by Embedding; A column description representing each column in a database table; Indicates the description of each column Vectors encoded by Embedding; Indicate each The set of words derived from LLM through the STAM mechanism; Representing each source word Vectors encoded by Embedding; A set described by columns; This is the set of enumerated values ​​for each column of the database table; cosine_similarity represents the cosine similarity; levenshtein represents the edit distance; , : represents the threshold; F1 represents calculating the cosine similarity between each K and each D, and taking the set of D that are greater than the threshold; F2 represents calculating the cosine similarity between each C and each D, and taking the set of D that are greater than the threshold; F3 represents calculating the edit distance between each K and each V, and taking the set of V that are greater than the threshold; F is the union of the three sets F1, F2, and F3.

[0073] S4. Connect to the database metadata interface, parse the information and build the basic structure, generate field descriptions with enhanced semantics, and organize the output in a four-tuple structure.

[0074] Connect to the database metadata interface, parse database information, including table names and table field names, build the basic structure for each table, sample data for each column in each table, such as selecting the first 1000 rows of each column, remove duplicates from the sampled values, and count the frequency. The sampled values ​​include text fields, addresses, and description fields. Extract the top-k values ​​to obtain the set of high-frequency representative enumeration values ​​for the fields.

[0075] By selecting representative enumeration values, enhanced semantic field descriptions are generated. These enumeration values ​​can be directly used as Prompt input, enhancing the LLM's understanding of the fields. For example:

[0076] Field: user_level

[0077] Enumerated values: Regular Member, VIP Member, Diamond Member

[0078] => Generate semantic description:

[0079] This indicates a user's membership level on the platform, including regular, VIP, diamond, etc.

[0080] The generated information is summarized into a standard four-tuple structure, and the output is JSON or structured data.

[0081] S5. By reverse-engineering the table through column matching, and combining the information density within the table with its connectivity with other tables, the value of the table structure is determined, redundant tables are eliminated, and the database representation is optimized.

[0082] By reverse-engineering the table by matching columns, and combining the information density within the table with its connectivity with other tables, the value of the table structure is determined. Tables with redundant structures, sparse information, and no connectivity are eliminated, database representation is optimized, and overall query efficiency and semantic mapping interpretability are improved.

[0083] The beneficial effects of this invention are as follows:

[0084] The "Structured Parsing and Matching System for Natural Language Queries Based on a Large Language Model" proposed in this invention possesses high integration and innovation in entity recognition, semantic mapping, column-level retrieval, value-level reasoning, and structural redundancy removal. By introducing a unified four-tuple modeling, vector semantic retrieval, and a multi-strategy fusion mechanism, it achieves intelligent, efficient, and interpretable alignment of natural language queries to structured database fields, providing a feasible path for building next-generation human-computer natural interaction database interfaces.

[0085] System Implementation Examples

[0086] According to embodiments of the present invention, a natural language query parsing and database field matching system based on a large model is provided. Figure 2 This diagram illustrates the composition of a natural language query parsing and database field matching system based on a large model, as provided in one or more embodiments of this specification. Figure 2 As shown, the natural language query parsing and database field matching system based on a large model according to an embodiment of the present invention specifically includes:

[0087] Keyword extraction module 20: Used to perform intent parsing and entity recognition on user natural language queries based on the Large Language Model (LLM), and extract a set of potential keywords;

[0088] Relationship building module 22: Used to bind each extracted keyword to an entity type through the STAM mechanism and build an entity-type mapping relationship;

[0089] Retrieval Module 24: Used to build a column description vector library, combine the approximate nearest neighbor ANN algorithm to achieve efficient retrieval, and combine the results of semantic vector matching, edit distance matching and source enhancement matching through a multi-strategy fusion matching mechanism to form the final candidate column set;

[0090] Parsing module 26: Used to connect to the database metadata interface, parse information and build the basic structure, generate field descriptions with enhanced semantics, and organize the output in a four-tuple structure;

[0091] Filter module 28: Used to infer the table to which the table belongs by matching columns, and to determine the value of the table structure by combining the information density within the table and its connectivity with other tables, thereby eliminating redundant tables and optimizing the database representation.

[0092] The embodiments of the present invention are system embodiments corresponding to the above method embodiments. The specific operation of each module can be understood by referring to the description of the method embodiments, and will not be repeated here.

[0093] Device Example 1

[0094] This invention provides an electronic device, such as... Figure 3As shown, it includes: a memory 50, a processor 32, and a computer program stored in the memory 30 and executable on the processor 32. When the computer program is executed by the processor 32, it performs the following method steps:

[0095] S1. Based on the Large Language Model (LLM), perform intent parsing and entity recognition on user natural language queries to extract a set of potential keywords;

[0096] S2. For each extracted keyword, bind it to an entity type using the STAM mechanism and construct an entity-type mapping relationship;

[0097] S3. Construct a column description vector library, combine it with the approximate nearest neighbor ANN algorithm to achieve efficient retrieval, and combine the results of semantic vector matching, edit distance matching and source enhancement matching through a multi-strategy fusion matching mechanism to form the final candidate column set;

[0098] S4. Connect to the database metadata interface, parse the information and build the basic structure, generate field descriptions with enhanced semantics, and organize the output in a four-tuple structure;

[0099] S5. By reverse-engineering the table through column matching, and combining the information density within the table with its connectivity with other tables, the value of the table structure is determined, redundant tables are eliminated, and the database representation is optimized.

[0100] Device Example 2

[0101] This invention provides a computer-readable storage medium storing an information transmission implementation program. When executed by a processor 32, the program performs the following method steps:

[0102] S1. Based on the Large Language Model (LLM), perform intent parsing and entity recognition on user natural language queries to extract a set of potential keywords;

[0103] S2. For each extracted keyword, bind it to an entity type using the STAM mechanism and construct an entity-type mapping relationship;

[0104] S3. Construct a column description vector library, combine it with the approximate nearest neighbor ANN algorithm to achieve efficient retrieval, and combine the results of semantic vector matching, edit distance matching and source enhancement matching through a multi-strategy fusion matching mechanism to form the final candidate column set;

[0105] S4. Connect to the database metadata interface, parse the information and build the basic structure, generate field descriptions with enhanced semantics, and organize the output in a four-tuple structure;

[0106] S5. By reverse-engineering the table through column matching, and combining the information density within the table with its connectivity with other tables, the value of the table structure is determined, redundant tables are eliminated, and the database representation is optimized.

[0107] The computer-readable storage media described in this embodiment include, but are not limited to, ROM, RAM, disk, or optical disk.

[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for natural language query parsing and database field matching based on a large model, characterized in that, include: S1. Based on the Large Language Model (LLM), perform intent parsing and entity recognition on user natural language queries to extract a set of potential keywords; S2. For each extracted keyword, bind it to an entity type using the STAM mechanism and construct an entity-type mapping relationship; Specifically, it includes: For each extracted keyword Design an entity tracing and reasoning module based on LLM, which binds an entity type through the STAM mechanism. As shown below: ; Abstract concrete entities into semantic hierarchical types and construct entity-type mapping relationships; S3. Construct a column description vector library, combine it with the approximate nearest neighbor ANN algorithm to achieve efficient retrieval, and merge the results of semantic vector matching, edit distance matching, and source tracing enhancement matching through a multi-strategy fusion matching mechanism to form the final candidate column set; specifically: A column description vector library is constructed, and semantic vectors are generated for user natural language queries by combining the Approximate Nearest Neighbor (ANN) algorithm. The cosine similarity between the semantic vector and the column vector is calculated, the top-k highly relevant columns are returned, and a dynamic threshold α is set to filter out noisy matching items to obtain the semantic vector matching results. An edit distance algorithm is introduced to calculate the character-level similarity between entity words and field enumeration values ​​in the user query, and obtain the edit distance matching result; For values ​​that cannot be matched by character similarity, the entity semantic attribution method is used to infer the dimension or type to which it belongs, and the result is semantically matched with the column description vector to obtain the source-enhanced matching result; The three sets of results—semantic vector matching, edit distance matching, and source-based enhanced matching—are merged to form the final candidate column set. S4. Connect to the database metadata interface, parse the information and build the basic structure, generate field descriptions with enhanced semantics, and organize the output in a four-tuple structure; S5. By reverse-engineering the table through column matching, and combining the information density within the table with its connectivity with other tables, the value of the table structure is determined, redundant tables are eliminated, and the database representation is optimized.

2. The method according to claim 1, characterized in that, Step S1 specifically includes: An end-to-end entity recognition and keyword extraction framework is constructed using a Large Language Model (LLM). It performs intent parsing on user natural language queries (Q), identifies multiple entity types including time, location, organization, quantity, and event, and extracts a set of potential keywords, as shown below: ; The extracted results are transformed into dimensions and metrics of potential query intent through context-aware modeling and type mapping.

3. The method according to claim 1, characterized in that, Step S4 specifically includes: Connect to the database metadata interface, parse database information, including table names and table field names, build a basic structure for each table, sample data for each column in each table, deduplicate the sampled values, count the frequency, and obtain a set of high-frequency representative enumeration values ​​for the field. By selecting representative enumeration values, field descriptions with enhanced semantics are generated; The generated information is summarized into a standard four-tuple structure, and the output is JSON or structured data.

4. The method according to claim 1, characterized in that, Step S5 specifically includes: By reverse-engineering the table by matching columns, and combining the information density within the table with its connectivity with other tables, the value of the table structure is determined, and tables with redundant structure, sparse information, and no connectivity are eliminated.

5. The method according to claim 1, characterized in that, A column description vector library is constructed, and an efficient retrieval is achieved by combining the approximate nearest neighbor (ANN) algorithm. Furthermore, a multi-strategy fusion matching mechanism is used to combine the results of semantic vector matching, edit distance matching, and source-based enhanced matching to form the final candidate column set. The specific calculation method is as follows: in, These are keywords extracted from the problem by LLM; For each keyword Vectors encoded by Embedding; A column description representing each column in a database table; Indicates the description of each column Vectors encoded by Embedding; Indicate each The set of words derived from LLM through the STAM mechanism; Representing each source word Vectors encoded by Embedding; A set described by columns; This is the set of enumerated values ​​for each column of the database table; cosine_similarity represents the cosine similarity; levenshtein represents the edit distance; , : represents the threshold; F1 represents calculating the cosine similarity between each K and each D, and taking the set of D that are greater than the threshold; F2 represents calculating the cosine similarity between each C and each D, and taking the set of D that are greater than the threshold; F3 represents calculating the edit distance between each K and each V, and taking the set of V that are greater than the threshold; F is the union of the three sets F1, F2, and F3.

6. A natural language query parsing and database field matching system based on a large model, characterized in that, include: Keyword extraction module: Used to perform intent parsing and entity recognition on user natural language queries based on Large Language Model (LLM), and extract a set of potential keywords; Relationship building module: used to bind each extracted keyword to an entity type through the STAM mechanism and build an entity-type mapping relationship; Specifically, it includes: For each extracted keyword Design an entity tracing and reasoning module based on LLM, which binds an entity type through the STAM mechanism. As shown below: ; Abstract concrete entities into semantic hierarchical types and construct entity-type mapping relationships; The retrieval module is used to build a column description vector library, combine the approximate nearest neighbor (ANN) algorithm to achieve efficient retrieval, and merge the results of semantic vector matching, edit distance matching, and source tracing enhancement matching through a multi-strategy fusion matching mechanism to form the final candidate column set; specifically: A column description vector library is constructed, and semantic vectors are generated for user natural language queries by combining the Approximate Nearest Neighbor (ANN) algorithm. The cosine similarity between the semantic vector and the column vector is calculated, the top-k highly relevant columns are returned, and a dynamic threshold α is set to filter out noisy matching items to obtain the semantic vector matching results. An edit distance algorithm is introduced to calculate the character-level similarity between entity words and field enumeration values ​​in the user query, and obtain the edit distance matching result; For values ​​that cannot be matched by character similarity, the entity semantic attribution method is used to infer the dimension or type to which it belongs, and the result is semantically matched with the column description vector to obtain the source-enhanced matching result; The three sets of results—semantic vector matching, edit distance matching, and source-based enhanced matching—are merged to form the final candidate column set. Parsing module: Used to connect to the database metadata interface, parse information and build basic structure, generate field descriptions with enhanced semantics, and organize the output in a four-tuple structure; The filter module is used to infer the table to which a table belongs by matching columns, and to determine the value of the table structure by combining the information density within the table and its connectivity with other tables, thereby eliminating redundant tables and optimizing the database representation.

7. An electronic device, characterized in that, include: processor; as well as, A memory configured to store computer-executable instructions, which, when executed, cause the processor to implement the steps of the large-model-based natural language query parsing and database field matching method as described in any one of claims 1 to 5.

8. A storage medium, characterized in that, Used to store computer-executable instructions, which, when executed, implement the steps of the large-model-based natural language query parsing and database field matching method as described in any one of claims 1 to 5.