Intelligent retrieval and query method for project cost auditing database
By using a dynamic semantic association model to identify intent and semantically expand natural language queries in the engineering cost audit database, structured query statements are generated and sorted based on semantic relevance. This solves the problems of low retrieval accuracy and poor result relevance in the engineering cost audit database, and achieves efficient and accurate retrieval results output.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI CHENGXIN BAIHUI METAL PRODUCTS TECHNOLOGY CO LTD
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing database retrieval methods for engineering cost auditing suffer from low retrieval accuracy and poor result relevance when handling complex or fuzzy natural language queries. In particular, due to the diverse terminology and high context dependence in the field of engineering cost, existing systems struggle to effectively parse the deep semantics of users.
By constructing a dynamic semantic association model, we can identify the intent of natural language queries, expand and rewrite semantics, generate structured query statements, and rank the results based on semantic association. This includes word segmentation, key entity annotation, pre-trained language model training, synonym matching, and high-dimensional semantic vector calculation.
It achieves deep understanding and accurate conversion of natural language queries, improves the targeting of retrieval and the relevance of results, ensures that the final retrieval results are comprehensive and highly relevant to user needs, and solves the problems of low retrieval accuracy and poor result relevance.
Smart Images

Figure CN121901246A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data retrieval technology, specifically to an intelligent retrieval and query method for an engineering cost audit database. Background Technology
[0002] In the field of engineering cost auditing, database retrieval is one of the core tasks, involving the rapid access and querying of a large amount of historical consultation records, contract terms, quota standards, and regulatory documents. Traditional database retrieval methods typically rely on keyword matching or fixed query templates, which have significant limitations when handling complex or ambiguous natural language queries. For example, users may use non-standard terms or descriptive language to express their query intent, but existing systems cannot effectively parse the deep semantics of these queries, resulting in irrelevant or incomplete search results.
[0003] Furthermore, due to the highly specialized nature of the engineering cost field, with its diverse terminology and strong contextual dependencies, simple keyword matching often fails to capture the true intent of the query, thus affecting the accuracy of the retrieval. While some rule-based query processing systems exist, they lack adaptive learning capabilities and struggle to cope with constantly changing query patterns and domain knowledge. This forces users to repeatedly adjust query conditions or perform tedious manual filtering, increasing complexity and reducing efficiency. More importantly, existing retrieval methods typically rank results based on simple relevance scores, such as term frequency or matching degree, while ignoring semantic connections, potentially relegating important results to lower positions. Summary of the Invention
[0004] The purpose of this invention is to provide an intelligent retrieval and query method for engineering cost audit databases to solve the problems mentioned in the background. Specific technical problems include how to achieve intent recognition, semantic expansion and rewriting of natural language queries, and result ranking based on semantic relevance through a dynamic semantic association model, in order to solve the problems of low retrieval accuracy and poor result relevance in engineering cost audit databases.
[0005] To achieve the above objectives, the present invention aims to provide an intelligent retrieval and query method for an engineering cost audit database, specifically including the following method steps: S1. Obtain natural language query requests in string form through the application programming interface (API); standardize the character encoding of the natural language query requests and temporarily store the processed natural language query requests in a memory buffer. Receiving user-input natural language query requests through the API and performing pre-processing is crucial for providing standardized and clean input data for subsequent deep semantic analysis. Standardizing the character encoding of the query requests ensures that text from different sources and formats can be correctly recognized by the system, avoiding parsing errors caused by encoding chaos. Temporarily storing the processed requests in a memory buffer prepares the data for efficient parsing of the subsequent dynamic semantic association model, laying a reliable data input foundation for the smooth execution of the entire intelligent retrieval and query method.
[0006] S2. Utilize a dynamic semantic association model to parse natural language query requests and identify query intents, including key entities and semantic context. The construction process of the dynamic semantic association model specifically includes: Collect and clean historical consultation records, contract terms, quota standards and normative documents in the field of engineering cost auditing, and build a corpus for the field. The text in the domain corpus is segmented and key entities are labeled. Key entities include materials, equipment, engineering projects, cost names and specification clauses. Supervised training of the pre-trained language model was performed using a processed and labeled domain corpus. The trained language model is encapsulated into a semantic analysis component that receives natural language query requests and outputs structured semantic parsing results.
[0007] The process of identifying query intent specifically includes: Perform word segmentation and part-of-speech tagging on natural language query requests; Using pre-trained semantic analysis components, key entities are extracted from the segmented sequence, and the grammatical modification relationships and logical dependencies between key entities are analyzed to form a semantic context. Identify query intent based on key entities and semantic context.
[0008] Based on the query intent, the natural language query request is semantically expanded and rewritten to generate a structured query statement; the semantic query expansion process of the natural language query request specifically includes: Based on the key entities and semantic context in the query intent, the system automatically matches and adds standardized synonyms and related terms from a pre-defined thesaurus for engineering cost auditing.
[0009] The rewriting process for a natural language query request specifically includes: The semantic elements of the semantic query are mapped to the field relationships in the database, and transformed into conditional expressions and association logic supported by the engineering cost audit database query language; according to the preset structured query statement template, the conditional expressions and association logic are assembled into a structured query statement.
[0010] Step S2 is the core of the entire method. It achieves deep understanding and transformation of natural language query requests through a dynamic semantic association model. This step first performs word segmentation and part-of-speech tagging on the query, and then uses a model trained on domain corpora to extract key entities such as materials and engineering projects, and analyzes the grammatical and logical relationships between them to form a semantic context, thereby accurately identifying the user's query intent. On this basis, semantic query expansion is performed according to the query intent, and synonyms and related terms are automatically added to broaden the search scope. Subsequently, the expanded semantic elements are mapped to database fields and conditions, and rewritten into precise structured query statements. This directly transforms the ambiguous user natural language into machine-executable instructions, significantly improving the targeting of the search from the source, and providing key support for solving the problem of low search accuracy.
[0011] S3. Retrieve the structured query statement in the engineering cost audit database to obtain a preliminary search result set, specifically including: The database access component deployed in the application server establishes a connection pool session with the engineering cost audit database and submits structured query statements to the database query engine. The database query engine parses structured query statements and performs query optimization, retrieving a set of records that meet the query conditions by accessing database indexes and data tables; The record set is encapsulated into a preliminary search result set and temporarily stored in the application server's memory.
[0012] Step S3 is responsible for executing the structured query statement generated in step S2 to obtain a preliminary search result set. This step establishes an efficient connection through the database access component and submits the optimized query to the database engine. It uses mechanisms such as indexes to quickly retrieve the set of records that meet the query conditions. The role of this step is to transform the semantically enhanced query intent into an efficient database interaction, ensuring that potentially relevant data records can be quickly located from massive amounts of data based on the query intent. This prepares the data foundation for subsequent semantically based fine-grained sorting and serves as a bridge connecting intelligent parsing and high-quality result output.
[0013] S4. Using a dynamic semantic association model, calculate the semantic relevance of each result in the preliminary search result set to the query intent, specifically including: The key entities of the query intent and semantic context, as well as the current result text extracted from the preliminary search result set, are mapped to the same high-dimensional semantic vector space to generate a semantic vector of the query intent and a semantic vector of the result text. Calculate the cosine similarity between the semantic vector of the query intent and the semantic vector of the result text, and quantify the cosine similarity into semantic relevance.
[0014] The preliminary search results are weighted and sorted according to semantic relevance to generate the final search results, which include: Semantic relevance is used as a weighting factor to assign a weight score to each result in the initial search result set; Sort the results in descending order based on their weight scores; The sorted list of results is then packaged into the final search results.
[0015] Step S4 further utilizes the dynamic semantic association model to refine the preliminary search result set, aiming to completely solve the problem of poor result relevance. This step maps the query intent (including key entities and semantic context) and each result text to a high-dimensional semantic space to generate vectors, and quantifies the semantic relevance between them by calculating cosine similarity. Then, the preliminary search result set is weighted and sorted according to semantic relevance, so that the results most relevant to the user's query intent in deep semantics are ranked first. This process realizes a leap from simple keyword matching and sorting to deep semantic relevance sorting, ensuring that the final search result list returned is not only comprehensive, but also highly consistent with the user's real needs, greatly improving the relevance and usability of the results.
[0016] Compared with the prior art, the beneficial effects of the present invention are: This invention uses a dynamic semantic association model to deeply analyze natural language query requests, accurately identify key entities and semantic context to understand the user's true query intent, and then performs semantic expansion and rewriting to generate structured query statements that accurately express the intent, thereby improving the targeting of the retrieval from the source. Furthermore, after obtaining the preliminary retrieval result set, the model is used again to calculate the semantic relevance of each result to the query intent, and then weighted and sorted accordingly to ensure that the final retrieval results are not only comprehensive but also presented in an orderly manner according to the degree of semantic relevance. This effectively solves the problems of low retrieval accuracy and poor result relevance caused by the diversity of terminology and semantic ambiguity in engineering cost audit databases. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the overall method steps of the present invention; Figure 2 This is the core flowchart of step S2 of the present invention. Detailed Implementation
[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Next, please refer to Figure 1 The purpose of this embodiment is to provide an intelligent retrieval and query method for an engineering cost audit database, which includes the following steps: S1. The query interface module deployed on the server obtains natural language query requests input in string form through the application programming interface. Specifically, when an external system calls the application programming interface, the query interface module listens for and receives network data packets containing natural language query requests, parses the original request string from the payload of the data packet, performs security checks and format verification on the string to ensure that it is valid text data, and then outputs the verified string as a standardized natural language query request.
[0020] The character encoding of the natural language query request is standardized and then temporarily stored in a memory buffer for subsequent steps. Specifically, the character encoding format of the natural language query request is first detected, and then an encoding conversion library is called to convert it into a predefined unified character encoding format to ensure that the characters are correct and the format is standardized. Subsequently, a temporary storage area is allocated in the server's memory as a memory buffer, and the natural language query request after encoding conversion is written as a data object into the memory buffer. This data object is assigned a unique identifier for subsequent steps.
[0021] S2, please refer to Figure 2 The dynamic semantic association model is used to parse natural language query requests and identify query intents including key entities and semantic context. The construction process of the dynamic semantic association model is as follows: Collect and clean historical consultation records, contract terms, quota standards and normative documents in the field of engineering cost auditing to build a domain corpus; automatically collect the original electronic documents of historical consultation records, contract terms, quota standards and normative documents from multiple designated business systems and document storage repositories, and then perform cleaning operations on the collected raw data, including removing formatting marks and irrelevant symbols in the documents, filtering out invalid data without substantial text content, and converting documents of different formats into plain text format. Finally, aggregate all the processed text data into a structured domain corpus. The text in the domain corpus is segmented and labeled with key entities, including materials, equipment, engineering projects, cost names, and specification clauses. Each text in the domain corpus is segmented into independent lexical units using a domain dictionary. Then, according to predefined key entity labeling specifications, a labeling tool is used to identify and label specific words in the segmented sequence, and to label the corresponding key entity types for all lexical fragments identified as materials, equipment, engineering projects, cost names, and specification clauses. Then, the annotated domain corpus is used to perform supervised fine-tuning training on the pre-trained language model, enabling the language model to learn the semantic relationships and contextual logic between entities in the field of engineering cost auditing. The segmented and annotated domain corpus is used as training samples and input into an initialized pre-trained language model. The training process uses text sequences as model input and the correct key entity labels corresponding to each word in the sequence as supervision signals. The loss function is calculated iteratively and the model parameters are adjusted using the backpropagation algorithm, so that the model can learn to accurately predict key entities in the field of engineering cost auditing. Finally, the trained language model is encapsulated into a semantic analysis component that can receive natural language query requests and output structured semantic parsing results, thus completing the construction of the dynamic semantic association model. The trained language model and its weight parameters are packaged into a software class with standard input and output interfaces. This software class is defined as a semantic analysis component, which provides calling methods to receive natural language query requests in string format. After processing inside the component, it outputs a structured data object containing the identified key entities and their type relationships as the semantic parsing result.
[0022] The dynamic semantic association model first performs word segmentation and part-of-speech tagging on the natural language query request. Then, it uses a pre-trained semantic analysis component to extract key entities representing core elements in the field of engineering cost auditing from the segmented sequence. Simultaneously, it analyzes the grammatical modification relationships and logical dependencies between key entities to form a semantic context. Finally, it performs a comprehensive understanding based on the key entities and semantic context to identify the complete query intent.
[0023] Based on the query intent, the natural language query request is semantically expanded and rewritten to generate a structured query statement, specifically including: Based on the key entities and semantic context in the query intent, the system automatically matches and adds standardized synonyms and related terms from a pre-set thesaurus for engineering cost auditing, thereby expanding the semantic query. Specifically, the query module first extracts each key entity identified in the query intent and uses it as a search key. It then performs precise and fuzzy matching in the pre-set thesaurus for engineering cost auditing to find all standardized synonyms and related terms corresponding to that key entity. Subsequently, based on the semantic context, the applicability of these synonyms and related terms is determined, and applicable terms are automatically added to the semantic element set of the original query, thus completing the semantic query expansion.
[0024] The extended semantic elements are mapped to the field relationships in the database, transforming them into conditional expressions and association logic supported by the database query language. The mapping module maps each term in the semantic element set obtained after semantic query expansion to a specific data table and field in the engineering cost audit database, based on a preset semantic element-database field mapping table. Then, based on the semantic relationships between terms (such as parallel and subordinate) and the logic implied by the semantic context, the association relationships between these fields are organized into association logic such as equi-join and left join supported by the database query language, and the filtering conditions for the fields are combined into conditional expressions.
[0025] According to the preset structured query statement template, the conditional expressions and association logic are assembled into a complete and executable structured query statement. The statement generation engine calls the preset structured query statement template, which defines the fixed framework structure of the query statement. The generation engine fills the conditional expressions obtained in the previous step into the conditional clause positions of the template, fills the association logic into the join clause positions of the template, and determines the fields to be returned to fill the select clause of the template, thereby assembling a syntactically complete structured query statement that can be directly executed by the database query engine.
[0026] S3. Retrieve the structured query statement in the engineering cost audit database to obtain a preliminary search result set, specifically including: The database access component deployed in the application server establishes a connection pool session with the engineering cost audit database and submits a structured query statement as input parameters to the database query engine. Specifically, the database access component in the application server requests an idle connection session from the database connection pool, and the connection pool allocates an established physical connection session with the engineering cost audit database. The database access component then opens a new database cursor on this session, binds the structured query statement as command text to the cursor, and finally submits the command to the query engine in the database backend.
[0027] The database query engine parses the logic of the structured query statement and performs query optimization. By accessing database indexes and data tables, it retrieves the set of all records that meet the query conditions. Specifically, the database query engine receives the structured query statement and first performs lexical and syntactic analysis to generate an initial query plan. Then, the query optimizer reconstructs and optimizes the initial query plan based on the cost model, selects the optimal execution path, which indicates how to quickly locate the data in the data table by accessing the relevant database indexes. Finally, the execution engine scans the indexes and data tables according to the optimized plan, retrieves all data records that meet the query conditions, and forms the original set of records. Finally, the record set is encapsulated into a preliminary search result set containing complete field data and returned to the application server's memory for temporary storage. Specifically, the database driver transmits the retrieved raw record set from the database server to the application server. The database access component receives these records and organizes them into a specific data object format according to the row and field structure. This data object is the encapsulated preliminary search result set. Finally, the preliminary search result set is temporarily stored in a designated memory area allocated by the application server.
[0028] S4. Using a dynamic semantic association model, calculate the semantic relevance of each result in the preliminary search result set to the query intent, specifically including: The dynamic semantic association model maps the key entities of the query intent and semantic context, as well as the current result text extracted from the preliminary search result set, to the same high-dimensional semantic vector space, generating corresponding query intent semantic vectors and result text semantic vectors. Subsequently, the cosine similarity between the semantic vector of the query intent and the semantic vector of the result text is calculated, and the cosine similarity value is quantified as the semantic relevance that represents the degree of semantic matching between the two.
[0029] The preliminary search results are weighted and sorted according to semantic relevance to generate the final search results, which include: First, semantic relevance is used as the core weighting factor to assign a corresponding weight score to each result in the initial search result set. Then, all results are sorted in descending order based on their weight scores; Finally, the sorted list of results is packaged into a new data set to generate the final search results.
[0030] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. An intelligent retrieval and query method for an engineering cost audit database, characterized in that, The methods and steps include the following: S1. Receive natural language query requests input by the user; S2. Use a dynamic semantic association model to parse the natural language query request and identify the query intent, including key entities and semantic context. Based on the query intent, the natural language query request is semantically expanded and rewritten to generate a structured query statement; S3. Retrieve the structured query statement in the engineering cost audit database to obtain a preliminary search result set; S4. Using the dynamic semantic association model, calculate the semantic association degree between each result in the preliminary search result set and the query intent; and perform weighted sorting on the preliminary search result set according to the semantic association degree to generate the final search result.
2. The intelligent retrieval and query method for the engineering cost audit database according to claim 1, characterized in that, Step S1 obtains a natural language query request input as a string through an application programming interface.
3. The intelligent retrieval and query method for the engineering cost audit database according to claim 2, characterized in that, Step S1 performs unified standardization processing on the character encoding of the natural language query request, and temporarily stores the processed natural language query request in a memory buffer.
4. The intelligent retrieval and query method for the engineering cost audit database according to claim 1, characterized in that, The construction process of the dynamic semantic association model specifically includes: Collect and clean historical consultation records, contract terms, quota standards and normative documents in the field of engineering cost auditing, and build a corpus for the field. The text in the domain corpus is segmented and labeled with key entities, including materials, equipment, engineering projects, cost names, and specification clauses. Supervised training of the pre-trained language model was performed using a processed and labeled domain corpus. The trained language model is encapsulated into a semantic analysis component that receives natural language query requests and outputs structured semantic parsing results.
5. The intelligent retrieval and query method for the engineering cost audit database according to claim 1, characterized in that, The process of identifying the query intent specifically includes: The natural language query request is processed by word segmentation and part-of-speech tagging; Using pre-trained semantic analysis components, key entities are extracted from the segmented sequence, and the grammatical modification relationships and logical dependencies between key entities are analyzed to form a semantic context. The query intent is identified based on the key entities and semantic context.
6. The intelligent retrieval and query method for the engineering cost audit database according to claim 1, characterized in that, The semantic query expansion process of the natural language query request specifically includes: Based on the key entities and semantic context in the query intent, the system automatically matches and adds standardized synonyms and related terms from a pre-defined thesaurus for engineering cost auditing.
7. The intelligent retrieval and query method for the engineering cost audit database according to claim 1, characterized in that, The rewriting process of the natural language query request specifically includes: The semantic elements of the semantic query are mapped to the field relationships in the database, and transformed into conditional expressions and association logic supported by the engineering cost audit database query language; according to the preset structured query statement template, the conditional expressions and association logic are assembled into a structured query statement.
8. The intelligent retrieval and query method for the engineering cost audit database according to claim 1, characterized in that, The process of obtaining the preliminary search result set specifically includes: The database access component deployed in the application server establishes a connection pool session with the engineering cost audit database and submits structured query statements to the database query engine. The database query engine parses structured query statements and performs query optimization, retrieving a set of records that meet the query conditions by accessing database indexes and data tables; The record set is encapsulated into a preliminary search result set and temporarily stored in the application server's memory.
9. The intelligent retrieval and query method for the engineering cost audit database according to claim 1, characterized in that, The generation of the semantic relevance specifically includes: The key entities of the query intent and semantic context, as well as the current result text extracted from the preliminary search result set, are mapped to the same high-dimensional semantic vector space to generate a semantic vector of the query intent and a semantic vector of the result text. Calculate the cosine similarity between the semantic vector of the query intent and the semantic vector of the result text, and quantify the cosine similarity into semantic relevance.
10. The intelligent retrieval and query method for the engineering cost audit database according to claim 1, characterized in that, The process of generating the final search results specifically includes: Semantic relevance is used as a weighting factor to assign a weight score to each result in the initial search result set; Sort the results in descending order based on their weight scores; The sorted list of results is then packaged into the final search results.