Database query method and apparatus based on distributed computing nodes
By employing a database query method based on distributed computing nodes and utilizing deterministic pattern matching and parallel retrieval techniques, the problem of wasted computing resources and long response times in enterprise data warehouses has been solved, enabling efficient and accurate natural language queries.
Patent Information
- Application Number
- CN202611328371.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2046-08-31
AI Technical Summary
In enterprise data warehouses, existing technical solutions result in serious waste of computing resources, excessively long response times, and low utilization of computing resources. They also fail to effectively utilize the sharded storage advantages of distributed data warehouses, leading to a poor user experience.
A database query method based on distributed computing nodes is adopted. Through deterministic pattern matching, semantic element extraction, level verification and state machine transition processing, combined with dual-channel parallel retrieval and structured rendering, structured query specification description information is generated, and query and aggregation operations are executed in parallel.
It improves the accuracy and efficiency of natural language queries, saves computing resources, shortens query response time, and enhances resource utilization.
Smart Images

Figure CN122885047B_ABST
Abstract
Description
Technical Field
[0001] The embodiments disclosed herein relate to the field of computer technology, and more specifically to a database query method and apparatus based on distributed computing nodes. Background Technology
[0002] Currently, in the daily use of enterprise data warehouses (e.g., financial data warehouses), business personnel are accustomed to describing data retrieval requirements in natural language. However, data warehouses store structured table names and field names, and there is a clear semantic gap between the two, which often leads to errors in the system's understanding of requirements.
[0003] In existing technologies, the common approach is to use an end-to-end dialogue scheme based on a large language model, which provides the user input along with a summary of the data warehouse's table structure to the large language model, which then completes semantic understanding, feature extraction, term mapping, and query generation in one go.
[0004] However, when using the above method to perform database queries, the following technical problems often arise: First, there is a serious waste of computing resources. Existing solutions require full reasoning in each round of dialogue. Even if only a single element is confirmed, a complete calculation is still required, resulting in low utilization of computing resources and a sharp increase in computing costs in high-frequency scenarios. Second, the response time is too long. Semantic understanding, element extraction, and query generation are executed in sequence, and each reasoning step takes a long time, which in turn increases user waiting time and seriously affects user experience.
[0005] The information disclosed in this background section is only intended to enhance the understanding of the background of the inventive concept, and therefore may contain information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0007] Some embodiments of this disclosure provide database query methods, apparatuses, electronic devices, and computer-readable media based on distributed computing nodes to solve one or more of the technical problems mentioned in the background section above.
[0008] In a first aspect, some embodiments of this disclosure provide a database query method based on distributed computing nodes, comprising: in response to receiving natural language query text input by a target user, performing deterministic pattern matching processing on the natural language query text to generate a structured tag list; based on the structured tag list, performing semantic element extraction processing on the natural language query text to generate recognition results and corresponding inference reference information for each query element; based on the inference reference information, performing level verification and state machine transition processing on the recognition results corresponding to each query element to generate a query element state table; and in response to a target element in the query element state table entering a semantic confirmation state, performing dual-channel parallel processing on the target element. The retrieval process generates field mapping confirmation results and asynchronously updates the domain terminology knowledge base based on these results. The dual-channel parallel retrieval includes field-side retrieval and value-domain-side retrieval. Field-side retrieval includes terminology base concept vector retrieval and metadata semantic matching retrieval. The field mapping confirmation results are then subjected to structured rendering to generate structured query specification description information. This information includes the partition key information and data distribution routing information for each query field in the distributed data warehouse. Upon receiving this structured query specification description information, the system controls distributed computing nodes to execute query and aggregation operations on the distributed data warehouse to generate query results and push these results to the business display terminal.
[0009] Secondly, some embodiments of this disclosure provide a database query apparatus based on distributed computing nodes, comprising: a matching unit configured to, in response to receiving natural language query text input by a target user, perform deterministic pattern matching processing on the natural language query text to generate a structured tag list; a processing unit configured to, based on the structured tag list, perform semantic element extraction processing on the natural language query text to generate recognition results corresponding to each query element and corresponding inference reference information; a verification and transition unit configured to, based on the inference reference information, perform level verification and state machine transition processing on the recognition results corresponding to each query element to generate a query element state table; and a parallel retrieval unit configured to, in response to a target element in the query element state table entering a semantic confirmation state, perform semantic element extraction processing on the target element in the query element state table. The target elements undergo dual-channel parallel retrieval processing to generate field mapping confirmation results, and the domain terminology knowledge base is asynchronously updated based on the aforementioned field mapping confirmation results. The dual-channel parallel retrieval includes field-side retrieval and value-domain-side retrieval. The field-side retrieval includes terminology base concept vector retrieval and metadata semantic matching retrieval. The rendering unit is configured to perform structured rendering processing on the aforementioned field mapping confirmation results to generate structured query specification description information. The structured query specification description information includes the partition key information and data distribution routing information of each query field in the distributed data warehouse. The query unit is configured to, in response to receiving the aforementioned structured query specification description information, control the distributed computing nodes to perform query and aggregation operations on the aforementioned distributed data warehouse to generate query results, and push the aforementioned query results to the business display terminal.
[0010] The various embodiments of this disclosure have the following beneficial effects: The database query method based on distributed computing nodes in some embodiments of this disclosure can improve the accuracy and execution efficiency of natural language queries, thereby saving on manual intervention costs and computational resource overhead. Specifically, the reasons for the misunderstanding of natural language query requirements, low execution efficiency, and high computational resource overhead are: traditional solutions rely on large-scale end-to-end model processing, lacking deterministic process control, leading to problems such as incomplete element identification and incorrect field mapping that are difficult to trace and correct; at the same time, single-node serial execution cannot fully utilize the sharded storage advantages of distributed data warehouses, resulting in long query response times and low utilization of computational resources. Based on this, the database query method based on distributed computing nodes in some embodiments of this disclosure first, in response to receiving the natural language query text input by the target user, performs deterministic pattern matching processing on the natural language query text to generate a structured tag list. By guiding semantic element extraction processing based on the structured tag list, the semantic extraction process completes element identification and modification relationship judgment within the candidate space determined by the rule engine, while outputting verifiable inference reference information, thus improving the accuracy and traceability of semantic understanding. Then, based on the aforementioned structured tag list, semantic element extraction processing is performed on the natural language query text to generate recognition results and corresponding inference reference information for each query element. The input context is constructed by combining the structured tag list, element state table snapshot, and metadata summary, ensuring that the element extraction process operates within a defined candidate space and state constraints, and forcing the output of verifiable inference references. This achieves recordability and traceability of the semantic understanding process, supporting automated verification in subsequent state validation stages. Next, based on the aforementioned inference reference information, the recognition results corresponding to each query element are subjected to level verification and state machine transition processing to generate a query element state table. By verifying the authenticity and determining the level of trust in the inference reference information, and combining this with a state machine to achieve deterministic transitions in element states, the decision-making power of the process is transferred from the probabilistic model to the rule system. This avoids the problem of elements being arbitrarily skipped or incorrectly confirmed, ensuring the stability and controllability of the process. Secondly, in response to the target element entering the semantic confirmation state in the aforementioned query element state table, a dual-channel parallel retrieval process is performed on the target element to generate field mapping confirmation results. Based on these field mapping confirmation results, the domain terminology knowledge base is asynchronously updated. The dual-channel parallel retrieval includes field-side retrieval and value-domain retrieval. The field-side retrieval includes terminology library concept vector retrieval and metadata semantic matching retrieval. By performing dual-channel parallel retrieval on the field and value-domain sides for semantically confirmed elements, combined with cross-validation of terminology library vector retrieval, metadata semantic matching, and enumerated value matching, the accuracy of field mapping is improved. Simultaneously, the terminology knowledge base is updated asynchronously, making the system more accurate with use and gradually reducing the ambiguity rate of subsequent mappings.Next, the field mapping confirmation results are subjected to structured rendering to generate structured query specification description information. This description includes the partition key information and data distribution routing information for each query field in the distributed data warehouse. By performing structured rendering on the field mapping results and attaching partition key and data distribution routing information, a standardized query specification description is generated that can be read and confirmed by business personnel and directly parsed and executed by distributed computing nodes, thus establishing a data pathway between the natural language understanding layer and the distributed execution layer. Finally, in response to receiving the structured query specification description information, the distributed computing nodes are controlled to execute query and aggregation operations on the distributed data warehouse to generate query results and push these results to the business display terminal. By controlling the distributed computing nodes to execute query and aggregation operations in parallel based on the partition key and routing information in the structured query specification description, the sharded storage and parallel computing capabilities of the distributed data warehouse are fully utilized, significantly shortening query response time and improving resource utilization. Attached Figure Description
[0011] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0012] Figure 1 This is a flowchart of some embodiments of the database query method based on distributed computing nodes according to the present disclosure; Figure 2 This is a schematic diagram of the structure of some embodiments of the database query apparatus based on distributed computing nodes according to the present disclosure. Detailed Implementation
[0013] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0014] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0015] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0016] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0017] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0018] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0019] refer to Figure 1 The diagram illustrates a flow 100 of some embodiments of a database query method based on distributed computing nodes according to the present disclosure. This database query method based on distributed computing nodes includes the following steps: Step 101: In response to receiving the natural language query text input by the target user, perform deterministic pattern matching processing on the natural language query text to generate a structured tag list.
[0020] In some embodiments, the execution entity (e.g., an electronic device) of the above-described database query method based on distributed computing nodes can be hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster composed of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is software, it can be installed in the hardware devices listed above. It can be implemented as multiple software programs or software modules to provide distributed services, or as a single software program or software module. No specific limitations are made here.
[0021] In some other embodiments, the above-mentioned execution subject may, in response to receiving a natural language query text input by a target user, perform deterministic pattern matching processing on the above-mentioned natural language query text to generate a structured tag list. Herein, the above-mentioned target user may be a business staff member who initiates a natural language query demand. For example, the above-mentioned target user may be a business analyst who uses a data warehouse to conduct business data analysis in the wealth management field of the financial industry. The above-mentioned natural language query text may be a data extraction demand description input by the user in a colloquial manner. For example, the above-mentioned natural language query text may be "Query the customers who opened margin trading and short selling accounts last month and have assets exceeding 1 million, what are their average monthly assets and stock and fund trading volume, aggregated by customer". The above-mentioned deterministic pattern matching may be a process of performing deterministic scanning and recognition on the input text based on precompiled regular expression rules. For example, the above-mentioned deterministic pattern matching may be identifying an absolute date in the text through the regular expression "\d{4}年\d{1,2}月\d{1,2}日". The above-mentioned structured tag list may be a structured record set containing the original position, standardized value, confidence level and candidate element type of each hit segment. For example, the above-mentioned structured tag list may include a record [{Original position: 3-5, Standardized value: "2026-06-01 to 2026-06-31", Confidence level: 1.0, Candidate element type: "Time granularity"}].
[0022] In some optional implementation manners of some embodiments, the above-mentioned execution subject may, in response to receiving a natural language query text input by a target user, perform deterministic pattern matching processing on the above-mentioned natural language query text to generate a structured tag list, which may include the following steps: The first step is to obtain a pre-built pattern library, which includes a time pattern sub-library, a numerical range pattern sub-library, a negation exclusion pattern sub-library, and an aggregation pattern sub-library. This pattern library can be a pre-built dataset that stores multiple pattern rules categorized by matching target. For example, the pattern library may include time pattern sub-libraries, numerical range pattern sub-libraries, negation exclusion pattern sub-libraries, and aggregation pattern sub-libraries. The time pattern sub-library can be a set of pattern rules specifically used to match and identify time-related expressions in natural language query text. For example, it may include regular expression rules matching time expressions such as "last month," "January 15, 2024," and "last 3 months." The numerical range pattern sub-library can be a set of pattern rules specifically used to match and identify expressions related to numerical comparisons and ranges in natural language query text. For example, it may include regular expression rules matching numerical expressions such as "greater than 1 million" and "100,000 to 500,000." The aforementioned negation exclusion pattern sub-library can be a set of pattern rules specifically designed for matching and recognizing pattern expressions related to exclusion conditions and negation statements in natural language query text. For example, the aforementioned negation exclusion pattern sub-library may include regular expression rules matching negation expressions such as "not," "except," and "does not contain." The aforementioned aggregation pattern sub-library can be a set of pattern rules specifically designed for matching and recognizing expression related to aggregation function signal words in natural language query text. For example, the aforementioned aggregation pattern sub-library may include regular expression rules matching aggregation signal words such as "monthly average," "maximum," and "cumulative." In practice, a pre-built pattern library is obtained. First, pattern library data containing the time pattern sub-library, numerical range pattern sub-library, negation exclusion pattern sub-library, and aggregation pattern sub-library is loaded from system storage. Then, the regular expressions in each pattern sub-library are pre-compiled into finite automata. Finally, a primary index is built according to candidate feature type, and a secondary index is built according to priority. For example, when the system starts, it loads a pattern library containing four sub-libraries, compiles regular expressions such as "^last month$" and "\d{4}year\d{1,2}month\d{1,2}day" into automata, and organizes the index structure according to feature type and priority.
[0023] The second step involves performing regular expression matching between the natural language query text and the pattern rules in the pattern library to identify text fragments in the query text that match the respective pattern rules. These pattern rules can be deterministic matching rules comprising a five-tuple of regular expression, standardized transformation function, priority, confidence, and candidate element type. For example, a pattern rule could be {regular expression "last month", standardized transformation function "calculate the first and last dates of last month", priority 2, confidence 1.0, candidate element "time granularity"}. The text fragments can be continuous character substrings in the natural language query text that are matched by regular expressions. For example, the text fragments could be the two text fragments "last month" and "exceeded 1 million" matched in the query "query customers who opened margin trading accounts and whose assets exceeded 1 million last month". In practice, the input natural language query text is first scanned from left to right, and non-overlapping greedy matching is performed in descending order of priority. Finally, each matched text fragment is recorded as a separate text fragment.
[0024] The third step involves standardizing the text fragments to generate standardized values for each fragment. This standardization process can be the conversion of matched text fragments into structured values in a unified format. For example, it can convert "last month" into the time range "BETWEEN '2026-05-01' AND '2026-05-31'". The standardized values can be structured data in a unified format generated after the standardization process. For instance, they can include the time range "BETWEEN '2026-05-01' AND '2026-05-31'" and the comparison operation ">1,000,000". In practice, firstly, the conversion logic for each fragment is determined based on the standardization function carried in the pattern rules matched by each matched fragment. Then, absolute time fragments are directly converted to standard date format, while relative time fragments have their specific time range calculated with reference to the current system date. Finally, comparison operation fragments are converted into structured expressions with operators and numbers. For example, "last month" with reference to the system date July 13, 2026 is converted to "BETWEEN'2026-06-01'AND'2026-06-30'", and "exceeded 1 million" is converted to ">1,000,000". In practice, firstly, the corresponding normalization function is called for each matched text fragment. Then, according to the five-tuple definition of the rule, the text fragment is converted into a structured value in a uniform format, and the normalized value is recorded. Finally, the normalized value is associated with the corresponding confidence level and saved for subsequent output. For example, for the text fragment "last month", the normalization function getLastMonth() is called, and the normalized value "BETWEEN'2026-05-01'AND'2026-05-31'" is generated based on the current date July 14, 2026, with a confidence level of 1.0.
[0025] The fourth step involves generating a structured tag list based on the aforementioned text fragments and standardized values. Each tag record in this list includes the original position of the corresponding text fragment, its standardized value, confidence level, and the corresponding candidate feature type. The original position can be the start and end character indices of the text fragment in the original input string. For example, the original position could be 3-5, indicating that the fragment starts at the 3rd character and ends at the 5th character. The standardized value can be structured data in a unified format generated after standardization transformation. For example, the standardized value could be "BETWEEN '2026-05-01'AND'2026-05-31'". The confidence level can be a numerical measure of the reliability of the matching result, ranging from 0 to 1. For example, a confidence level of 1.0 indicates complete certainty, while 0.65 indicates multiple interpretations. The corresponding candidate feature type can be the query feature category to which the text fragment might belong. For example, the corresponding candidate feature type could be "time granularity", "filter condition", or "query indicator aggregation". In practice, firstly, the original text location, standardized value, confidence score, and candidate feature type of each hit fragment are assembled into a tag record. Then, all tag records are sorted by their original text location to form an ordered structured tag list. Finally, the structured tag list is output as the input context for the subsequent semantic feature extraction module. For example, the generated tag record might be {Sequence Number: 1, Hit Fragment: “Last Month”, Original Text Location: 3-5, Standardized Value: “BETWEEN '2026-05-01' AND '2026-05-31'”, Confidence Score: 1.0, Candidate Feature: “Time Granularity”}, which, together with two other records, forms the structured tag list.
[0026] Step 102: Based on the structured tag list, perform semantic element extraction processing on the natural language query text to generate the recognition results and corresponding inference reference information for each query element.
[0027] In some embodiments, the execution entity can perform semantic element extraction processing on the natural language query text based on the structured tag list to generate recognition results and corresponding inference reference information for each query element. The semantic elements can be structured information units related to the database query contained in the natural language query text. For example, the semantic elements can be the time granularity "last month", the analysis subject "customer", the filter condition "assets exceeding 1 million", and the query indicator "average monthly assets". The semantic element extraction processing can be the process of identifying and extracting various query elements and their modifying relationships from the natural language query text. For example, the semantic element extraction processing can extract the time granularity "last month" and the analysis subject "customer" from "querying customers who opened margin trading accounts last month". The recognition results corresponding to each query element can be the specific values and confidence levels of each element identified by the large model from the user input. For example, the recognition results corresponding to each query element can be {element category: "time granularity", natural language value: "last month", confidence level: 0.95}. The aforementioned inference references can be verifiable factual evidence cited by the large model when making judgments on each element. For example, the aforementioned inference references could be {reference evidence: "The word 'last month' appears in position 3-5 in the user's original text, and the rule engine's tag list has been confirmed"}.
[0028] In some optional implementations of certain embodiments, the execution entity may perform semantic element extraction processing on the natural language query text based on the structured tag list to generate recognition results and corresponding inference reference information for each query element, which may include the following steps: The first step is to obtain a snapshot of the feature status table for the current round. This snapshot records the current status and confirmed values of each feature. The current round can be the processing round corresponding to the current user input in a multi-round dialogue interaction. For example, the current round could be the first round of dialogue where the user initially inputs their query request, or the second round where the user answers follow-up questions. The snapshot can be a complete record of the status, values, and confidence levels of each query feature at the current moment. For example, the snapshot could include {time granularity: {status: missing}, analysis subject: {status: missing}, filter conditions: {status: missing}, query metrics: {status: missing}}. The current status of each feature can be the confirmation stage of the query feature in the current processing phase. For example, the current status of each feature could be "missing", "pending confirmation", "partially confirmed", "semantic confirmation", or "field confirmation". The aforementioned confirmed values can be standardized values confirmed by the rule engine or large model and written into the feature status table. For example, the confirmed values could be time-granular confirmed values such as "BETWEEN '2026-05-01' AND '2026-05-31'". In practice, firstly, a snapshot of the feature status table for the current round is obtained from the state scheduler. The state scheduler can be the deterministic decision-making center of the entire query requirement normalization process, responsible for managing the state transitions and exit decisions of each query feature. For example, the state scheduler can be a pure logic state machine engine that does not rely on any probability model for decision-making. Based on the labeling results of the rule engine, the extraction results of the large model, and the disambiguation results of the field mapping module, it updates the current state of each feature in the feature status table according to preset state transition rules, and performs a completeness determination at the end of each round of dialogue to decide whether to continue the follow-up query or output the final result. Then, the current state and confirmed values of each feature in the snapshot are parsed to identify which features have been confirmed and do not need to be processed repeatedly, and which features are still in a missing or pending confirmation state. Finally, the snapshot of the feature status table is saved as the basic context information for constructing subsequent prompts. For example, after the user answers follow-up questions in the second round of the dialogue, the snapshot of the feature status table shows that the time granularity has been confirmed, the analysis subject has been confirmed, the filter conditions are pending confirmation, and the query indicators are missing.
[0029] The second step involves constructing input prompts based on the aforementioned structured tag list, the snapshot of the feature status table, and the pre-loaded metadata summary. The pre-loaded metadata summary can be a summary of table structures, field names, definition descriptions, and enumerated value ranges related to the current query in the data warehouse. For example, the pre-loaded metadata summary could include {dimension fields: [customer type, margin trading status], indicator fields: [total assets, net assets, stock / fund trading volume]}. In practice, firstly, each tag record in the structured tag list is formatted, including the hit fragment, original text location, standardized value, confidence level, and candidate feature type. Then, the confirmed feature information from the feature status table snapshot, the structured tag list, and the metadata summary are concatenated into input prompts using a fixed template. Behavioral constraints are appended to the end of the prompts, requiring the large model to respond to each tag list item by item, extract only explicitly expressed features, and output inference reference information. Finally, the constructed input prompts are used as input to the large model. For example, the prompt might include phrases like "Feature Status Table Snapshot: Time granularity confirmed; Tag List: [Serial Number 1: Last Month, Normalized Value: BETWEEN...]; Metadata Summary: [Customer Tag Table Fields...]; Please extract only the features explicitly expressed in this round of input." The aforementioned large model could be Qwen3.6-Plus, which supports feature extraction and inference reference output guided by prompts. It can receive composite prompts containing a structured tag list, a feature status table snapshot, and a metadata summary, and output the recognition results and corresponding inference reference information for each query feature in a specified JSON format.
[0030] The third step involves semantic element extraction based on the input prompts, processing the natural language query text to generate recognition results and inference references for each query element. In practice, the constructed input prompts are first sent to a large model for inference. Then, the structured results output by the large model are received, including the element category, natural language value, confidence level, source tag, and inference reference list for each identified element. Finally, the output results are preliminarily validated to check the completeness of the output format and whether the inference references point to verifiable facts. For example, the large model outputs {Time Family: {Identified Elements: [{Category: Time Granularity, Value: Last Month, Confidence Level: 0.95, Source: Rule Engine Adoption, Citation Basis: [“Rule Engine Tag List Sequence Number 1”]}]}}. The large model can be Qwen3.6-Plus, which supports element extraction and inference reference output guided by prompts. It can receive composite prompts containing a structured tag list, an element status table snapshot, and a metadata summary, and output the recognition results and corresponding inference references for each query element in a specified JSON format.
[0031] Step 103: Based on the various inference reference information, perform level verification and state machine transition processing on the identification results corresponding to each query element to generate a query element state table.
[0032] In some embodiments, the execution entity can perform level verification and state machine transition processing on the identification results corresponding to each query element based on the aforementioned inference reference information to generate a query element state table. The level verification can be a process of classifying the credibility of the large model output according to the authenticity and confidence level of the inference reference information. For example, the level verification can divide the identification results into four levels: direct acceptance, conditional acceptance, low trust, and rejection. The state machine transition can be a process of advancing a query element from one state to another according to preset state transition rules. For example, the state machine transition can transition an element from a "missing" state to a "semantic confirmation" state or a "pending confirmation" state. The query element state table can be a structured table recording the current state, standardized value, confidence level, source tag, and change log of each type of query element. For example, the query element state table can include the current state and values of elements such as time granularity, analysis subject, filtering conditions, and query indicators.
[0033] In some optional implementations of certain embodiments, the execution entity may perform level verification and state machine transition processing on the identification results corresponding to each query element based on the aforementioned inference reference information, in order to generate a query element state table, which may include the following steps: The first step involves verifying the authenticity of each reference in the aforementioned inference reference information to generate a trust level corresponding to each identification result. This authenticity verification can be a process of checking whether the inference reference information output by the large model actually exists in the feature status table or metadata summary. For example, the authenticity verification can verify whether the reference "Reference basis: Time granularity in the feature status table has been confirmed" is true. The trust level corresponding to each identification result can be a level of credibility determined by combining the authenticity verification results and confidence levels. For example, the trust level corresponding to each identification result can be direct acceptance (the reference is verifiable and the confidence level is ≥0.9) or rejection (the reference is not verifiable). In practice, firstly, the list of inference reference information output by the large model is obtained. Each inference reference information includes an input fragment, candidate space, selection result, and reference basis. Then, the existence of each reference basis is verified in the feature status table and metadata summary to check whether the referenced feature exists, whether the status is consistent with the reference description, and whether the referenced field or value exists in the metadata. Finally, the trust level corresponding to each identification result is determined comprehensively based on the reference verification results and the confidence level of the identification results. For example, the large model output cites "because the user mentioned the time range as last month", but the time granularity status in the feature status table is missing, so the citation cannot be verified, and the identification result is judged to be of low trust level.
[0034] The second step involves using a state scheduler to perform state machine transitions on each query element based on the trust levels corresponding to the identification results. This updates the current state of each element in the query element state table, generating the updated current state of each element. The state scheduler can act as the deterministic decision-making center for the entire process, a pure logic component responsible for managing element state transitions and exit decisions. For example, it can update element states and decide whether to pursue further queries based on preset rules, according to the outputs of the rule engine, large model, and field mapping module. The current state of each element can be the confirmation stage of the query element in the current processing phase. For example, the current state of each element can be "missing," "pending confirmation," "partially confirmed," "semantic confirmation," or "field confirmation." The updated current state of each element can be the new state of each element after this round of state machine transitions. For example, the updated current state of each element can change from "missing" to "semantic confirmation" in terms of time granularity and from "missing" to "pending confirmation" in terms of filtering conditions. In practice, firstly, based on the trust levels determined in the first step, the state transition operation to be performed for each element is determined. Then, the state scheduler is invoked to perform state machine transition processing on each element according to the preset state transition rule table. Results that are directly accepted are directly advanced to the semantic confirmation state, results with low trust are marked as pending confirmation, and results that are rejected remain in the missing state and trigger follow-up inquiries. Finally, the current state of each element in the query element state table is updated, generating updated state records for each element. For example, if the recognition result at the time granularity has a direct acceptance level, its state transitions from "missing" to "semantic confirmation"; if the recognition result at the filtering condition has a low trust level, its state remains "missing" and is marked as pending confirmation.
[0035] The third step involves performing an exit judgment process based on the current status of each updated element and the set of required elements corresponding to the current query mode, to generate a judgment result. The current query mode can be the type of query labeled by the large model, including normal query, comparison query, ranking query, and trend query. For example, the current query mode could be "normal query," with the three basic elements being required fields. The set of required elements corresponding to the current query mode can be a set of element categories that must be confirmed, dynamically determined according to the query mode. For example, the set of required elements corresponding to the current query mode could be {time granularity, analysis subject, query indicator} for a normal query or {time granularity, comparison benchmark, analysis subject, query indicator} for a comparison query. The exit judgment process can check whether all required elements have reached the field confirmation status to determine whether to end the current round. For example, the exit judgment process can check whether time granularity, analysis subject, and query indicator have all reached the "field confirmation" status. The judgment result can be a Boolean value or status indicator output by the exit judgment process. For example, the judgment result could be "exit conditions met" or "exit conditions not met, further inquiry required." In practice, firstly, the current query mode type is obtained from the query mode annotations output by the large model. Then, based on the query mode type, the corresponding set of required elements is retrieved from the pre-defined required element mapping table. Finally, the updated element status table is traversed to check whether all required elements have reached the "field confirmed" state, generating an exit judgment result. For example, if the current query mode is "normal query" and the set of required elements is {time granularity, analysis subject, query indicator}, and the check finds that the time granularity has been confirmed as a field, the analysis subject has been semantically confirmed, but the query indicator is missing, the judgment result is "exit conditions not met".
[0036] The fourth step involves outputting the query element status table for the current round, in response to the above judgment result satisfying the preset exit conditions. The preset exit conditions can be that all required elements corresponding to the current query mode have reached the "field confirmed" state. For example, the preset exit conditions could be that the states of time granularity, analysis subject, and query indicator are all "field confirmed" in the normal query mode. In practice, first, it is determined whether the exit judgment result satisfies the preset exit conditions. Then, if the judgment result satisfies the preset exit conditions, i.e., all required elements have reached the field confirmed state, the current query element status table is used as the final output for this round. Finally, if the judgment result does not satisfy the preset exit conditions, a follow-up question generation process is triggered, generating corresponding follow-up question text based on the missing or unconfirmed elements, awaiting the user's input in the next round. For example, if time granularity, analysis subject, and query indicator have all reached the field confirmed state, and the judgment result satisfies the preset exit conditions, the query element status table is output to the next processing module.
[0037] Step 104: In response to the target element entering the semantic confirmation state in the query element status table, perform dual-channel parallel retrieval processing on the target element to generate field mapping confirmation results, and asynchronously update the domain terminology knowledge base based on the field mapping confirmation results.
[0038] In some embodiments, the execution entity may, in response to the target element entering the semantic confirmation state in the query element status table, perform dual-channel parallel retrieval processing on the target element to generate a field mapping confirmation result, and asynchronously update the domain terminology knowledge base based on the field mapping confirmation result. The dual-channel parallel retrieval includes field-side retrieval and value-domain-side retrieval. The field-side retrieval includes terminology base concept vector retrieval and metadata semantic matching retrieval. The target element may be a query element that has entered the semantic confirmation state and requires field mapping. For example, the target element may be a query indicator element whose semantics have been confirmed as "assets" but has not yet been mapped to a specific database field. The semantic confirmation state may be an intermediate state where the meaning of the element at the natural language level has been unambiguous but the database field mapping has not yet been completed. For example, the semantic confirmation state may be the state when a user says "assets" and, after follow-up questioning, confirms that they mean "asset balance" rather than "total assets." The dual-channel parallel retrieval processing may be a mapping method that simultaneously performs independent retrieval and cross-validation on the field-side and value-domain-side. For example, the dual-channel parallel retrieval processing may simultaneously perform field name retrieval and enumeration value retrieval on "individual customers," with the results from both sides mutually verifying each other. The aforementioned domain terminology knowledge base can be a structured knowledge base maintained by the system, containing term names, synonym lists, semantic descriptions, and mapping relationships. For example, the aforementioned domain terminology knowledge base can contain the mapping of the term "margin trading" to the standard concept "securities lending and borrowing" and its corresponding field "securities lending and borrowing activation status". The aforementioned field-side retrieval can be the process of retrieving candidate database fields from the perspective of field names and business meanings. For example, the aforementioned field-side retrieval can retrieve matching fields such as "total assets", "net assets", and "asset balance" in the metadata for the term "assets". The aforementioned value-domain-side retrieval can be the process of retrieving candidate fields from the perspective of enumerated values or legal values of fields. For example, the aforementioned value-domain-side retrieval can retrieve the enumerated values of the term "individual" in all dimension fields and match the enumerated value "individual" in the "customer type" field. The aforementioned terminology database concept vector retrieval can be the process of encoding the term to be mapped into a vector and then performing semantic similarity retrieval in the terminology database. For example, the aforementioned terminology database concept vector retrieval can encode "margin trading" into a vector and retrieve the most similar standard concept "securities lending and borrowing" in the terminology database. The aforementioned metadata semantic matching retrieval can be a process of encoding the terms to be mapped into vectors and then performing semantic similarity retrieval in the metadata field description. For example, the aforementioned metadata semantic matching retrieval can encode "assets" into a vector and retrieve the semantically closest fields "asset balance" and "total assets" in the metadata.
[0039] In addressing the aforementioned technical challenges by adopting technical solutions, the application scenario—a self-service data retrieval scenario for business personnel using natural language in an enterprise distributed data warehouse—often presents the following technical issues: business terms used in users' colloquial expressions (such as "assets" and "financial services") may correspond to multiple fields or definitions in the database. Semantic matching using a single channel struggles to distinguish subtle semantic differences between fields, leading to incorrect field mapping. Repeated retrieval results in redundant computing power and prolonged query response times. Considering the following requirements for this application scenario—high accuracy, traceability, adaptive scalability, and continuous accumulation of domain knowledge without interrupting online services—we have decided to adopt the following solution: In some optional implementations of certain embodiments, the execution entity may, in response to the target element entering the semantic confirmation state in the query element status table, perform dual-channel parallel retrieval processing on the target element to generate a field mapping confirmation result, and asynchronously update the domain terminology knowledge base based on the field mapping confirmation result, which may include the following steps: The first step, in response to the detection that a target element in the query element status table has entered the semantic confirmation state, is to determine the element category of the target element. The element category can be the functional classification to which the target element belongs, including dimension field filtering, indicator threshold filtering, query indicators, and result fields. For example, the element category of the target element could be "query indicator," corresponding to an indicator field mapping path. In practice, first, the state scheduler detects that a target element in the query element status table has entered the semantic confirmation state. Then, it reads the element category field recorded for that target element in the element status table. Finally, it determines the basis for selecting the subsequent mapping path based on the element category. For example, if the element "margin trading and securities lending activation status" is detected to have entered the semantic confirmation state, and its element category is "dimensional field filtering," it is determined that the subsequent path should be a dimension field mapping path.
[0040] In the second step, a target mapping path is determined from a plurality of preset mapping paths according to the element category of the target element. The plurality of preset mapping paths may be differentiated mapping processes predefined for different element categories. For example, the plurality of preset mapping paths may include a dimension field mapping path (two-layer mapping), a metric field caliber mapping path (field + aggregation policy), and a direct value acquisition path (analysis subject). The target mapping path may be a specific mapping process selected from the plurality of preset mapping paths according to the element category of the target element. For example, the target mapping path may be a "dimension field mapping path", which includes field-side retrieval and value domain-side retrieval performed in parallel and cross-validated. In practice, first, a corresponding mapping path configuration is looked up from a preset mapping path registry according to the element category determined in the first step. Then, configuration information of the mapping path is read, including a field-side retrieval method, a value domain-side retrieval method, and a cross-validation rule. Finally, the configuration information of the target mapping path is loaded into a mapping execution engine. For example, when the element category is "dimension field screening", the dimension field mapping path is selected, and the path is configured to perform field-side dual-channel retrieval (terminology library + metadata) and value domain-side retrieval in parallel and cross-validate the retrieval results.
[0041] In the third step, the following dual-channel parallel retrieval step is performed according to the target mapping path: In sub-step 1, field-side retrieval processing is performed on the target element to generate a field-side candidate set. The field-side candidate set may be a candidate field list returned after the field-side retrieval processing, including a table name, a field name, and a similarity score. For example, the field-side candidate set may be [{table: customer label table, field: mrgn_status, Chinese name: margin trading and short selling activation status, similarity: 0.92}]. In practice, first, an original expression of the target element is encoded into a query vector. Then, similarity retrieval is performed simultaneously in a terminology library vector index and a metadata vector index, where the terminology library retrieval returns standard concept candidates, and the metadata retrieval returns physical field candidates. Finally, retrieval results of the two channels are merged, and the field-side candidate set is generated after deduplication. For example, for the target element "margin trading and short selling", the terminology library retrieval returns the standard concept "margin trading and short selling", and the metadata retrieval returns the field "mrgn_status (margin trading and short selling activation status)", so that the field-side candidate set is generated after merging.
[0042] Sub-step two involves performing value domain-side retrieval processing on the aforementioned target elements to generate a value domain-side candidate set. This value domain-side retrieval processing includes enumeration value vector retrieval. Specifically, this process can involve retrieving candidate fields from the perspective of enumeration values or valid values of a field. For example, it could perform vector matching retrieval on the enumeration values of the word "individual" across all dimension fields. Enumeration value vector retrieval can also involve encoding value terms in the user's description into vectors and then performing similarity retrieval on the enumeration values and synonyms in the value domain table. For example, it could encode "retail investor" into a vector and retrieve the most similar enumeration value "individual" from the value domain table. In practice, firstly, the original description of the target element or its value terms are encoded into query vectors. Then, similarity retrieval is performed on the enumeration values and synonym vector indexes of the value domain table. Finally, the matching enumeration values and their corresponding field information are returned, generating a value domain-side candidate set. For example, for the target element "Individual Customer" and the "Individual", the enumeration value "Individual" is found to belong to the "Customer Type" field in the value range table, and a candidate set on the value range side is generated.
[0043] The fourth step involves cross-validation based on the aforementioned candidate sets for the field side, the candidate sets for the value domain side, and the inference reference information of the target elements, to determine the target field mapping result. This cross-validation process can be a process of cross-verifying and finally confirming the search results from both the field side and the value domain side. For example, the cross-validation process could involve the value domain side's "Individual" matching the enumerated value of the "Customer Type" field, which in turn confirms the field side's search result, completing the mapping. The target field mapping result can be a combination of the final field, table name, operator, and confidence level determined after cross-validation. For example, the target field mapping result could be {Target Table: Customer Tag Table, Target Field: mrgn_status, Operator: ='Active', Confidence Level: 0.95}. In practice, the first step is to obtain the candidate sets for the field side and the candidate sets for the value domain side. Then, matching is performed according to the cross-validation rules: if the value range side precisely matches the enumerated value of a field, then the field is confirmed as the mapping target; if the field side precisely matches and the value range side provides auxiliary confirmation, then the mapping is directly confirmed; if neither side is precise, then the candidate combinations are submitted to the large model for fine-tuning. Finally, the final target field mapping result is output. For example, if the value range side "Individual" precisely matches the enumerated value of the "Customer Type" field, and the field side result is confirmed, the mapping is complete: Customer Tag Table.Customer Type = 'Individual'.
[0044] The fifth step involves incrementally updating the domain terminology knowledge base through an asynchronous background update process in response to the determined target field mapping results. This updates the terminology relationship records within the knowledge base. The asynchronous background update process can be a terminology knowledge base update task that runs independently in the background without blocking the current query processing flow. For example, it can write the newly confirmed terminology relationships into the knowledge base while the user is viewing the query results. The incremental update process can be a method of adding or modifying the terminology knowledge base instead of a full reconstruction. For example, it can append the user-confirmed "retail investor -> individual" mapping relationship to the synonym list in the value domain table. The terminology relationship records can be stored entries in the knowledge base representing the mapping relationships between terms and standard concepts, fields, or values. For example, a terminology relationship record could be {Term Name: "Margin Trading", Standard Concept: "Margin Financing and Securities Lending", Mapping Field: mrgn_status, Status: Active}. In practice, after determining the target field mapping results, it is first checked whether any new term or value mapping relationships not present in the terminology knowledge base or value domain table are discovered during the mapping process. Then, if a new mapping relationship is established, it is asynchronously updated in the background and written as a pending review record to the domain terminology knowledge base, with an initial status of "pending review" and a confirmation count of 1. Finally, in subsequent conversations, once the mapping relationship is reconfirmed and accumulates to a preset threshold, it is automatically upgraded to an "active" status. For example, if a user confirms that "retail investor" corresponds to "customer type = individual," the background process writes this mapping relationship to the value domain table, with a status of "pending review" and a confirmation count of 1.
[0045] The above-described steps, as an inventive point of this disclosure, solve the technical problem mentioned in the background: "Business terms in users' colloquial expressions (such as 'assets' and 'margin trading') may correspond to multiple fields or definitions in the database. Semantic matching of a single channel is difficult to distinguish subtle semantic differences between fields, leading to field mapping errors. Repeated searches cause computational redundancy and prolonged query response time." The reasons for the above technical problems are as follows: Related technologies lack parallel retrieval and cross-validation mechanisms on the field side and the value domain side. Semantic matching of a single channel can only calculate similarity from a single dimension of field name or enumerated value. It cannot use field metadata information and field value domain information to mutually verify each other to eliminate semantic ambiguity between fields with similar definitions. At the same time, the static terminology knowledge base cannot continuously accumulate and correct mapping relationships during use, resulting in repeated disambiguation processing every time the same term is encountered. Furthermore, the terminology knowledge base is statically constructed and lacks online learning and progressive update mechanisms, making it unable to adapt to dynamic adjustments in business definitions. This invention utilizes a dual-channel parallel retrieval and cross-validation mechanism to confirm results through field mapping. It comprehensively leverages semantic information from both the field and value domain sides for mutual verification, achieving a significant improvement in field mapping accuracy and continuous accumulation of domain knowledge. This saves the cost of manually maintaining a terminology dictionary and the cost of correcting data queries due to mapping errors.
[0046] Step 105: Perform structured rendering processing on the field mapping confirmation results to generate structured query specification description information.
[0047] In some embodiments, the execution entity can perform structured rendering processing on the field mapping confirmation results to generate structured query specification description information. This structured query specification description information includes the partition key information and data distribution routing information of each query field in the distributed data warehouse. Specifically, the structured rendering processing can be a process of converting the field mapping results into structured text with inline annotations based on a preset template. For example, the structured rendering processing can render the field mapping result "Customer Tag Table.Customer Type='Individual'" as "Filter individual customers with customer type {Customer Tag Table.cust_type='Individual'}". The structured query specification description information can be standardized query specification text that includes both natural language descriptions and inline annotations of physical table fields and distributed routing information. For example, the structured query specification description information can be "Query individual customers of {Customer Indicator Table, Partition Key: dt, Nodes: node1-node3} [last month] from {Customer Tag Table, Partition Key: cust_id, Nodes: node1-node3}". The aforementioned distributed data warehouse can be a data warehouse system that stores data shards across multiple computing nodes based on partition keys. For example, the distributed data warehouse could store a customer metric table by date partitioning, with each partition distributed across different computing nodes. The partition key information can be the field name and partition range used for data shard storage in the data warehouse. For example, the partition key information could be "dt" for the customer metric table, with data stored by month partitioning. The data distribution routing information can be the mapping of the storage locations of each data partition on the distributed computing nodes. For example, the data distribution routing information could be that the partition "dt='2026-05-01' to '2026-05-31'" is stored on node1 and node2 nodes.
[0048] In some optional implementations of certain embodiments, the execution entity may perform structured rendering processing on the field mapping confirmation results to generate structured query specification description information. This structured query specification description information includes the partition key information and data distribution routing information of each query field in the distributed data warehouse, and may include the following steps: The first step, based on the field mapping confirmation results mentioned above, is to determine each confirmed query element in the query element status table. These confirmed query elements can be those whose status in the query element status table has reached "Field Confirmed" after semantic confirmation and field mapping. For example, these confirmed query elements could be the time granularity "Last Month," the analysis subject "Individual Customer," and the filter condition "Customer Type = Individual." In practice, first, all element records in the query element status table are traversed. Then, elements with the status "Field Confirmed" are filtered out, and the confirmed value and field mapping result for each element are read. Finally, the filtered confirmed elements and their mapping results are categorized and organized by element type for subsequent template selection. For example, in the query feature status table, the time granularity status is "Field Confirmed" with a value of "BETWEEN'2026-05-01'AND'2026-05-31'", and the field mapping result is {Target Table: Customer Indicator Table, Target Field: dt}; the filter condition status is "Field Confirmed" with a value of "Individual", and the field mapping result is {Target Table: Customer Tag Table, Target Field: cust_type, Operator: =, Value: 'Individual'}.
[0049] The second step involves determining the corresponding inline annotation templates for each confirmed query element based on its element type, using a pre-defined annotation template library. This pre-defined annotation template library can be a collection of inline annotation templates categorized by element type. For example, it might include a time template "{table name, partition key: field name, node: node list}[time range]" and a filter template "filter {table name.field name=value}". The corresponding inline annotation template can be a specific template selected from the pre-defined annotation template library based on the element type. For example, the corresponding inline annotation template could be the template "{table name, partition key: field name, node: node list}[time range]" for a time element. In practice, first, the corresponding template is retrieved from the pre-defined annotation template library based on the element type of each confirmed element. Then, the placeholder definitions and fill rules of the template are read. Finally, the template is bound to the element type, preparing for formatted rendering. For example, if the feature type is "time granularity", the time template "{table name, partition key: field name}[time range]" will be retrieved from the template library; if the feature type is "filter condition", the filter template "filter {table name.field name=value}" will be retrieved.
[0050] The third step involves performing formatted rendering based on the inline annotation templates and field mapping confirmation results for each confirmed query element, generating natural language description fragments for each element. The field mapping confirmation results can be the final field mapping information determined through dual-channel parallel retrieval and cross-validation. For example, the field mapping confirmation result could be {target table: customer metrics table, target field: asset_bal, operator: >, value: 1000000}. The formatted rendering process can be the process of filling the field mapping results with annotated natural language description fragments based on the inline annotation templates. For example, the formatted rendering process could fill the template "filter {table name.field name=value}" with the mapping result as "filter {customer tag table.cust_type='personal'}". The natural language description fragments corresponding to the confirmed query elements mentioned above can be text fragments generated after each query element has been formatted and rendered, retaining natural language readability while including physical annotations. For example, the natural language description fragments corresponding to the confirmed query elements could be "Query {Customer Indicator Table, Partition Key: dt} [Last Month] {Customer Tag Table} Individual Customers". In practice, firstly, the field values from the field mapping confirmation results are filled into the corresponding placeholders in the inline annotation template. Then, natural language description fragments with inline annotations are generated according to the format defined in the template, where the physical table name and field name are enclosed in curly braces. Finally, the generated description fragments are format-validated to ensure that all placeholders have been correctly filled. For example, after filling the time template, "{Customer Indicator Table, Partition Key: dt} [Last Month]" is generated, and after filling the filter template, "Filter {Customer Tag Table.cust_type='Individual'}" is generated.
[0051] The fourth step involves concatenating the natural language description fragments corresponding to each confirmed query element to generate an initial structured query specification description. This initial structured query specification description can be an intermediate specification text after concatenating the natural language description fragments of each element, without the addition of partition keys and routing information. For example, the initial structured query specification description could be: "Query individual customers [last month], filter customer type as 'individual', output average monthly assets and stock / fund trading volume, summarized by customer." In practice, firstly, the natural language description fragments of each element are arranged according to a fixed order of query syntax: query action -> time -> subject -> filter conditions -> query indicators -> aggregation method. Then, the fragments are concatenated in sequence, with spaces or conjunctions added between adjacent fragments. Finally, the initial structured query specification description is generated. For example, the concatenated description might be: "Query {customer indicator table, partition key: dt} [last month] {customer tag table} individual customers, filter {customer tag table.cust_type='individual'}, output average monthly assets and stock / fund trading volume, summarized by customer."
[0052] The fifth step involves extracting the partition key information and data distribution routing information corresponding to each query field in the initial structured query specification description information from the metadata of the distributed data warehouse, in order to generate the structured query specification description information. This metadata can be system data describing the table structure, field attributes, partition information, and data distribution in the data warehouse. For example, the metadata could include the partition key of the customer metrics table being "dt", the partition range being "2026-01-01 to 2026-12-31", and the partitions being distributed across nodes node1-node3. In practice, firstly, the partition key information and data distribution routing information of all tables involved in the initial structured query specification description information are read from the metadata manager of the distributed data warehouse. Then, the partition key information and routing information are appended as inline annotations to the corresponding table names in the initial structured query specification description information. Finally, a structured query specification description information containing complete physical annotations and distributed routing information is generated. For example, the partition key of the customer metrics table is "dt" obtained from the metadata, and the partition "2026-05" is stored on nodes node1-node3. After appending the label, the query is generated as "Query {customer metrics table, partition key: dt, node: node1-node3} [last month] {customer tag table, partition key: cust_id, node: node1-node3} individual customer".
[0053] Step 106: In response to receiving the structured query specification description information, control the distributed computing nodes to perform query and aggregation operations on the distributed data warehouse to generate query results and push the query results to the business display terminal.
[0054] In some embodiments, the execution entity may, in response to receiving the structured query specification description information, control the distributed computing nodes to perform query and aggregation operations on the distributed data warehouse to generate query results and push the query results to the business display terminal. The query and aggregation operations may be a process of performing data retrieval and statistical calculations on the distributed data warehouse according to the structured query specification description information. For example, the query and aggregation operations may be querying the average monthly assets of individual customers in the previous month and summarizing them by customer. The query results may be the final dataset returned to the user after data retrieval and aggregation calculations. For example, the query results may be a table containing two columns of data: customer number and average monthly assets. The business display terminal may be a front-end device or application for business personnel to view the query results. For example, the business display terminal may be a report display page or BI dashboard in a wealth management system.
[0055] In addressing the technical challenges mentioned above, the application scenario—natural language data retrieval and querying of massive (PB-level) operational data in a financial data warehouse—often presents the following technical issues: In the structured query specification generated after natural language conversion, some query fields may lack partition key information or data distribution routing information. This prevents distributed computing nodes from determining the data's shard location, forcing them to perform a full partition scan, resulting in wasted computing resources and query response delays. To meet the following requirements for this application scenario: before executing a query in the distributed data warehouse, the system must automatically detect fields lacking partition key information in the query specification and intelligently compensate and complete them based on the field type and metadata information. This ensures the distributed query plan can accurately route to the corresponding data shard, enabling partition pruning and parallel execution, and avoiding resource waste from full partition scans. Therefore, we have decided to adopt the following solution: In some optional implementations of certain embodiments, the execution entity may, in response to receiving the structured query specification description information, control the distributed computing nodes to perform query and aggregation operations on the distributed data warehouse to generate query results and push the query results to the business display terminal, which may include the following steps: The first step is to parse the structured query specification description information to extract the partition key information and data distribution routing information corresponding to each query field. The field types can be database field data types and business categories; for example, the field types can be date, numeric, string, or enumeration. The metadata information can be dictionary information describing the table structure, field attributes, partition keys, and data distribution in the data warehouse. For example, the metadata information could include a partition key of "dt" and a partition range of "2026-01-01 to 2026-12-31" for the customer metrics table. In practice, firstly, the structured query specification description information is parsed to identify each query field and its associated physical label. Then, the partition key information and data distribution routing information are extracted from the physical labels, establishing a triplet mapping table of field-partition key-route. Finally, it is checked whether each query field is accompanied by complete partition key and routing information. For example, the parsed "Customer Indicator Table" is labeled "Partition Key: dt, Nodes: node1-node3", while the "Customer Tag Table" does not have any partition labels.
[0056] The second step involves determining the corresponding compensating partition key information and compensating data distribution routing information based on the field type and metadata information of the target query field, in response to the detection of missing partition key information or data distribution routing information for the target query field. The compensating partition key information can be automatically derived from the field type and metadata when the original information is missing. For example, the compensating partition key information can be automatically inferred from the time field "dt" as the primary partition key. The compensating data distribution routing information can be the node information of each partition automatically completed from the metadata when the original information is missing. For example, the compensating data distribution routing information can be that the partition "dt='2026-05'" is stored on nodes node1-node3. In practice, firstly, missing partition key information and data distribution routing information are detected for the "Customer Tag Table". Then, based on the table's field types and information in the metadata manager, its primary partition key is determined to be "cust_id," and the data distribution routing information for each partition is: "cust_id in (000001-100000) stored in node1, cust_id in (100001-200000) stored in node2." Finally, compensation partition key information and compensation data distribution routing information are generated. For example, the compensation result is {partition key: cust_id, route: {node1: 000001-100000, node2: 100001-200000}}.
[0057] The third step involves completing the structured query specification description information based on the aforementioned compensation partition key information and compensation data distribution routing information. This completes the structured query specification description information. The completed description can be the full query specification text after compensation using partition keys and routing information. For example, it could be "Query individual customers of {Customer Indicator Table, Partition Key: dt, Nodes: node1-node3} [last month]". In practice, firstly, the compensation partition key information and compensation data distribution routing information are appended to the corresponding table names in the structured query specification description information as inline annotations. Then, the field-partition key-routes triplet mapping table is updated to ensure that all query fields include complete information. Finally, the completed structured query specification description information is output. For example, the completed description might be "Query individual customers of {Customer Indicator Table, Partition Key: dt, Nodes: node1-node3} [last month] {Customer Tag Table, Partition Key: cust_id, Nodes: node1-node2}".
[0058] The fourth step involves processing the completed structured query specification description information to generate a distributed query plan for the distributed data warehouse. This distributed query plan includes data shard query subtasks corresponding to each computing node. The query plan generation can be a process of generating a distributed execution plan based on the completed query specification description information. For example, the query plan generation can decompose the query task into multiple subtasks tailored to the partition key. The distributed query plan can be a complete execution scheme that includes the task allocation and scheduling order for each computing node. For example, the distributed query plan can include node 1 executing a sub-query task for customer number ranges 000001-100000. The data shard query subtasks corresponding to each computing node can be local query tasks assigned to each computing node for independent execution. For example, the data shard query subtasks corresponding to each computing node could be node 1 querying data where dt='2026-05' and cust_id in (000001-100000). In practice, firstly, based on the partition key information in the completed structured query specification description, the data pruning range for each table is determined. Then, based on the data distribution routing information, the data pruning range for each table is mapped to specific computing nodes. Finally, a distributed query plan containing the tasks executed by each node is generated. For example, the customer metrics table is pruned by partitioning by dt to "dt='2026-05'", and routed to node1-node3; the customer tag table is pruned by partitioning by cust_id to "cust_id in (000001-200000)", and routed to node1-node2.
[0059] The fifth step is to distribute each data shard query subtask to its corresponding computing node in the distributed computing node system, according to the distributed query plan described above. In practice, firstly, each data shard query subtask is encapsulated into an independent execution unit according to the distributed query plan. Then, the distributed scheduler distributes each subtask to its corresponding computing node. Finally, the distribution status and expected return time of each subtask are recorded. For example, the subtask "query customer metric table dt='2026-05' and cust_id in (000001-100000)" is distributed to node1, and the subtask "query customer tag table cust_id in (100001-200000)" is distributed to node2.
[0060] The sixth step involves controlling each compute node to execute its corresponding data shard query subtask in parallel, generating shard query results for each worker node. In practice, firstly, after receiving the assigned subtask, each compute node reads the corresponding data shard from its local disk. Then, it executes the filtering, projection, and local aggregation operations specified in the subtask to generate intermediate results for that shard. Finally, the shard query results are temporarily stored in the node's local memory, awaiting retrieval by the scheduler. For example, node1 executes "Query customer metrics table dt='2026-05' and cust_id in (000001-100000)", returning the asset balance records of customers within that range.
[0061] Step 7: Receive the sharded query results returned by each compute node, and aggregate and merge these results to generate a merged query result. In practice, first, the coordinating node receives the sharded query results from each compute node. Then, it merges, sorts, and deduplicates all sharded results according to the customer number. Finally, it generates the merged, complete query result set. For example, the results of customer number segments 000001-100000 returned by node1 and 100001-200000 returned by node2 are merged by customer number to generate a complete customer asset record set. (This process is repeated in the original text.)
[0062] Step 8 involves performing aggregation calculations on the merged query results to generate the final query result. This aggregation calculation process can be a secondary summary and statistical calculation of the sharded results returned by each node. For example, it could involve globally merging the local average monthly assets calculated by each node by customer number. In practice, first, the final aggregation calculation is performed on the merged query result set, such as calculating the average, sum, or count. Then, calculations are performed according to the aggregation strategy specified in the structured query specification description. Finally, the final query result is generated. For example, grouping the merged asset balance records by customer number, calculating the average asset balance for each customer within a specified time range, and generating two columns: customer number and average monthly assets.
[0063] The ninth step is to push the query results to the aforementioned business display terminal for display on its interface. In practice, firstly, the final query results are encapsulated into a data format that the front-end can parse, such as JSON or CSV. Then, the query results are pushed to the business display terminal via an API interface. Finally, the business display terminal displays the query results in table or chart format on its display interface. For example, pushing JSON data containing customer number and average monthly assets to the wealth management system's report page displays result rows such as "Customer Number: 100023, Average Monthly Assets: 2,350,000.00 yuan" in table format.
[0064] The above-described steps, as an inventive point of this disclosure, solve the technical problem mentioned in the background: "In the structured query specification description generated after natural language conversion, some query fields may lack partition key information or data distribution routing information, causing distributed computing nodes to be unable to determine the shard location of the data and only be able to perform a full partition scan, resulting in wasted computing resources and query response delays." The reasons for the above technical problem are as follows: In the structured query specification description generated from natural language conversion, some query fields may not carry partition key information and data distribution routing information. When the partition location information is missing, the distributed computing nodes cannot determine the shard location of the data and can only broadcast the query to all nodes and perform a scan on all partitions, leading to serious waste of computing resources and a sharp increase in query response time in large-scale data warehouses. This invention parses the structured query specification description, detects fields with missing partition key information, automatically determines and completes the compensation partition key information and compensation data distribution routing information based on field type and metadata information, generates a distributed query plan containing complete partition location information, and distributes the sharded query subtasks to the corresponding computing nodes for parallel execution. This achieves partition pruning to reduce the amount of data scanning, avoids the resource waste caused by full partition scanning, and saves computing resources and query response time in the distributed data warehouse.
[0065] The various embodiments of this disclosure have the following beneficial effects: The database query method based on distributed computing nodes in some embodiments of this disclosure can improve the accuracy and execution efficiency of natural language queries, thereby saving on manual intervention costs and computational resource overhead. Specifically, the reasons for the misunderstanding of natural language query requirements, low execution efficiency, and high computational resource overhead are: traditional solutions rely on large-scale end-to-end model processing, lacking deterministic process control, leading to problems such as incomplete element identification and incorrect field mapping that are difficult to trace and correct; at the same time, single-node serial execution cannot fully utilize the sharded storage advantages of distributed data warehouses, resulting in long query response times and low utilization of computational resources. Based on this, the database query method based on distributed computing nodes in some embodiments of this disclosure first, in response to receiving the natural language query text input by the target user, performs deterministic pattern matching processing on the natural language query text to generate a structured tag list. By guiding semantic element extraction processing based on the structured tag list, the semantic extraction process completes element identification and modification relationship judgment within the candidate space determined by the rule engine, while outputting verifiable inference reference information, thus improving the accuracy and traceability of semantic understanding. Then, based on the aforementioned structured tag list, semantic element extraction processing is performed on the natural language query text to generate recognition results and corresponding inference reference information for each query element. The input context is constructed by combining the structured tag list, element state table snapshot, and metadata summary, ensuring that the element extraction process operates within a defined candidate space and state constraints, and forcing the output of verifiable inference references. This achieves recordability and traceability of the semantic understanding process, supporting automated verification in subsequent state validation stages. Next, based on the aforementioned inference reference information, the recognition results corresponding to each query element are subjected to level verification and state machine transition processing to generate a query element state table. By verifying the authenticity and determining the level of trust in the inference reference information, and combining this with a state machine to achieve deterministic transitions in element states, the decision-making power of the process is transferred from the probabilistic model to the rule system. This avoids the problem of elements being arbitrarily skipped or incorrectly confirmed, ensuring the stability and controllability of the process. Secondly, in response to the target element entering the semantic confirmation state in the aforementioned query element state table, a dual-channel parallel retrieval process is performed on the target element to generate field mapping confirmation results. Based on these field mapping confirmation results, the domain terminology knowledge base is asynchronously updated. The dual-channel parallel retrieval includes field-side retrieval and value-domain retrieval. The field-side retrieval includes terminology library concept vector retrieval and metadata semantic matching retrieval. By performing dual-channel parallel retrieval on the field and value-domain sides for semantically confirmed elements, combined with cross-validation of terminology library vector retrieval, metadata semantic matching, and enumerated value matching, the accuracy of field mapping is improved. Simultaneously, the terminology knowledge base is updated asynchronously, making the system more accurate with use and gradually reducing the ambiguity rate of subsequent mappings.Next, the field mapping confirmation results are subjected to structured rendering to generate structured query specification description information. This description includes the partition key information and data distribution routing information for each query field in the distributed data warehouse. By performing structured rendering on the field mapping results and attaching partition key and data distribution routing information, a standardized query specification description is generated that can be read and confirmed by business personnel and directly parsed and executed by distributed computing nodes, thus establishing a data pathway between the natural language understanding layer and the distributed execution layer. Finally, in response to receiving the structured query specification description information, the distributed computing nodes are controlled to execute query and aggregation operations on the distributed data warehouse to generate query results and push these results to the business display terminal. By controlling the distributed computing nodes to execute query and aggregation operations in parallel based on the partition key and routing information in the structured query specification description, the sharded storage and parallel computing capabilities of the distributed data warehouse are fully utilized, significantly shortening query response time and improving resource utilization.
[0066] Further reference Figure 2 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a database query device based on distributed computing nodes. These device embodiments are similar to... Figure 1 Corresponding to the method embodiments shown, this database query device based on distributed computing nodes can be specifically applied to various electronic devices.
[0067] like Figure 2As shown, a database query device 200 based on distributed computing nodes includes: a matching unit 201, a processing unit 202, a verification and transfer unit 203, a parallel retrieval unit 204, a rendering unit 205, and a query unit 206. The matching unit 201 is configured to: in response to receiving natural language query text input by a target user, perform deterministic pattern matching processing on the natural language query text to generate a structured tag list. The processing unit 202 is configured to: based on the structured tag list, perform semantic element extraction processing on the natural language query text to generate recognition results and corresponding inference reference information for each query element. The verification and transfer unit 203 is configured to: based on the inference reference information, perform level verification and state machine transition processing on the recognition results corresponding to each query element to generate a query element state table. Parallel retrieval unit 204 is configured to: in response to the target element entering the semantic confirmation state in the above query element status table, perform dual-channel parallel retrieval processing on the target element to generate field mapping confirmation results, and asynchronously update the domain terminology knowledge base based on the above field mapping confirmation results. The dual-channel parallel retrieval includes field-side retrieval and value-domain-side retrieval. The field-side retrieval includes terminology base concept vector retrieval and metadata semantic matching retrieval. Rendering unit 205 is configured to: perform structured rendering processing on the above field mapping confirmation results to generate structured query specification description information. The structured query specification description information includes the partition key information and data distribution routing information of each query field in the distributed data warehouse. Query unit 206 is configured to: in response to receiving the above structured query specification description information, control the distributed computing nodes to execute query and aggregation operations on the above distributed data warehouse to generate query results, and push the query results to the business display terminal.
[0068] It is understandable that the units described in the database query device 200 based on distributed computing nodes are related to the reference. Figure 1 The steps in the described method correspond accordingly. Therefore, the operations, features, and beneficial effects described above for the method also apply to the database query device 200 based on distributed computing nodes and the units contained therein, and will not be repeated here.
[0069] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0070] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including a matching unit, a processing unit, a verification and transfer unit, a parallel retrieval unit, a rendering unit, and a query unit. The names of these units do not necessarily limit the unit itself; for example, a matching unit may also be described as "a unit that, in response to receiving natural language query text input by a target user, performs deterministic pattern matching processing on the natural language query text to generate a structured tag list."
[0071] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0072] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A database query method based on distributed computing nodes, characterized in that, include: In response to receiving a natural language query text input by a target user, deterministic pattern matching processing is performed on the natural language query text to generate a structured tag list. The process of performing deterministic pattern matching processing on the natural language query text to generate the structured tag list includes: Obtain a pre-built pattern library, which includes a time pattern sub-library, a numerical range pattern sub-library, a negation exclusion pattern sub-library, and an aggregation method pattern sub-library; The natural language query text is matched with each pattern rule in the pattern library using regular expressions to identify the text segments in the natural language query text that match each pattern rule. The text segments are standardized to generate standardized values for each text segment. Based on the text fragments and the standardized values, a structured tag list is generated. Each tag record in the structured tag list includes the original text position, standardized value, confidence level, and corresponding candidate feature type of the corresponding text fragment. Based on the structured tag list, semantic element extraction processing is performed on the natural language query text to generate recognition results and corresponding inference reference information for each query element. Based on the aforementioned inference reference information, the identification results corresponding to each query element are subjected to level verification and state machine transition processing to generate a query element state table. In response to the target element entering the semantic confirmation state in the query element status table, the target element is subjected to dual-channel parallel retrieval processing to generate field mapping confirmation results, and the domain terminology knowledge base is asynchronously updated based on the field mapping confirmation results. The dual-channel parallel retrieval includes field-side retrieval and value-domain-side retrieval. The field-side retrieval includes terminology base concept vector retrieval and metadata semantic matching retrieval. The value-domain-side retrieval includes retrieval of the enumerated values of the field. The field mapping confirmation results are subjected to structured rendering processing to generate structured query specification description information, which includes the partition key information and data distribution routing information of each query field in the distributed data warehouse. In response to receiving the structured query specification description information, the system controls the distributed computing nodes to perform query and aggregation operations on the distributed data warehouse to generate query results and push the query results to the business display terminal.
2. The method according to claim 1, characterized in that, The step of extracting semantic elements from the natural language query text based on the structured tag list to generate recognition results and corresponding inference reference information for each query element includes: Obtain a snapshot of the element status table for the current round, wherein the snapshot of the element status table records the current status and confirmed values of each element; Based on the structured tag list, the feature status table snapshot, and the pre-loaded metadata summary, input prompt words are constructed; Based on the input prompts, semantic element extraction processing is performed on the natural language query text to generate recognition results and corresponding inference reference information for each query element.
3. The method according to claim 1, characterized in that, The step of performing level verification and state machine transition processing on the identification results corresponding to each query element based on the various inference reference information to generate a query element state table includes: Each reference in the inference reference information is subjected to authenticity verification to generate a trust level corresponding to each recognition result; Based on the trust level corresponding to each identification result, the state scheduler performs state machine transition processing on each query element to update the current state of each element in the query element state table, so as to generate the updated current state of each element. Based on the current status of each updated element and the set of required elements corresponding to the current query mode, an exit determination process is performed to generate a determination result. In response to the determination result satisfying the preset exit conditions, the query element status table is output as the query element status table for the current round.
4. The method according to claim 1, characterized in that, The step of performing structured rendering processing on the field mapping confirmation result to generate structured query specification description information includes: Based on the field mapping confirmation results, each confirmed query element in the query element status table is determined; Based on the element type of each confirmed query element, the inline annotation template corresponding to each confirmed query element is determined using a preset annotation template library; Based on the inline annotation templates and field mapping confirmation results corresponding to each confirmed query element, a formatted rendering process is performed to generate natural language description fragments corresponding to each confirmed query element. The natural language description fragments corresponding to each confirmed query element are spliced together to generate initial structured query specification description information; Extract the partition key information and data distribution routing information corresponding to each query field in the initial structured query specification description information from the metadata of the distributed data warehouse to generate the structured query specification description information.
5. A database query device based on distributed computing nodes, characterized in that, include: A matching unit is configured to perform deterministic pattern matching processing on a natural language query text input by a target user in response to receiving such text, to generate a structured tag list. The deterministic pattern matching processing on the natural language query text in response to receiving such text from the target user to generate the structured tag list includes: Obtain a pre-built pattern library, which includes a time pattern sub-library, a numerical range pattern sub-library, a negation exclusion pattern sub-library, and an aggregation method pattern sub-library; The natural language query text is matched with each pattern rule in the pattern library using regular expressions to identify the text segments in the natural language query text that match each pattern rule. The text segments are standardized to generate standardized values for each text segment. Based on the text fragments and the standardized values, a structured tag list is generated. Each tag record in the structured tag list includes the original text position, standardized value, confidence level, and corresponding candidate feature type of the corresponding text fragment. The processing unit is configured to perform semantic element extraction processing on the natural language query text based on the structured tag list, so as to generate the recognition results and corresponding inference reference information for each query element. The verification and transfer unit is configured to perform level verification and state machine transfer processing on the identification results corresponding to each query element based on the various inference reference information, so as to generate a query element state table. The parallel retrieval unit is configured to, in response to a target element entering a semantic confirmation state in the query element status table, perform dual-channel parallel retrieval processing on the target element to generate a field mapping confirmation result, and asynchronously update the domain terminology knowledge base based on the field mapping confirmation result. The dual-channel parallel retrieval includes field-side retrieval and value-domain-side retrieval. The field-side retrieval includes terminology base concept vector retrieval and metadata semantic matching retrieval. The value-domain-side retrieval includes retrieval of enumerated values of the field. The rendering unit is configured to perform structured rendering processing on the field mapping confirmation result to generate structured query specification description information, which includes the partition key information and data distribution routing information of each query field in the distributed data warehouse. The query unit is configured to, in response to receiving the structured query specification description information, control the distributed computing nodes to perform query and aggregation operations on the distributed data warehouse to generate query results and push the query results to the business display terminal.
Citation Information
Patent Citations
Report chart automatic generation method based on natural language analysis and data query
CN121351779A
Water conservancy intelligent question-answering system and method based on knowledge enhancement and data driving
CN121860062A
