Financial tax data intelligent dialogue and query system based on large language model

By combining an intermediate adaptation layer with a large language model in the financial and tax domain, the problem of interaction between the large language model and the financial and tax business database is solved, achieving efficient, accurate and compliant financial and tax data query, and meeting users' needs for comprehensive and timely financial and tax information.

CN121501966BActive Publication Date: 2026-05-29国能四川天明发电有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
国能四川天明发电有限公司
Filing Date
2026-01-13
Publication Date
2026-05-29

Smart Images

  • Figure CN121501966B_ABST
    Figure CN121501966B_ABST
Patent Text Reader

Abstract

The application provides a kind of financial and tax data intelligent dialogue and query system based on large language model, it is related to financial and tax data processing and natural language processing technical field, first, the intermediate adaptation layer connecting large language model and financial and tax business database is built, and the database information is converted into the form that large language model can recognize.The large language model is trained in the field of finance and tax, so that it can process user financial and tax problems and generate query instructions.Through the intermediate adaptation layer, the data query is executed, and the original numerical result is obtained.The model is called to analyze the result and generate a preliminary interpretation, and the final result is formed after correction combined with the financial and tax rule text retrieval library and pushed to the user.The application improves the efficiency and accuracy of financial and tax data query, and provides comprehensive and professional financial and tax information for users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of financial and tax data processing and natural language processing, and more specifically, to a financial and tax data intelligent dialogue and query system based on a large language model. Background Technology

[0002] In the field of finance and taxation, with the acceleration of digitalization, a large amount of financial and tax data is constantly being generated and accumulated, while users' demand for querying and interpreting financial and tax data is also increasing. Traditional methods of querying financial and tax data mainly rely on professionals manually operating database query tools. This method is not only inefficient, but also requires a high level of professional knowledge and skills from the operators, making it difficult for ordinary users to complete complex financial and tax data query tasks on their own.

[0003] In recent years, although large language models have made significant progress in natural language processing, capable of understanding natural language and generating corresponding responses, directly applying them to financial and tax data queries presents numerous problems. On the one hand, large language models cannot directly interact with financial and tax business databases, making it difficult to accurately retrieve data from these databases. On the other hand, large language models lack professional understanding of the financial and tax domain, making it difficult to provide accurate and professional interpretations of user-submitted financial and tax questions. Furthermore, existing financial and tax data query systems often only provide simple data query functions, failing to combine the latest financial and tax rules with in-depth analysis and interpretation of query results, thus failing to meet users' needs for comprehensive, accurate, and timely financial and tax information. Summary of the Invention

[0004] In view of the aforementioned problems, this invention provides an intelligent dialogue and query system for financial and tax data based on a large language model, comprising:

[0005] processor;

[0006] A machine-readable storage medium for storing machine-executable instructions of the processor;

[0007] The processor is configured to perform the following steps by executing the machine-executable instructions:

[0008] Construct an intermediate adaptation layer connecting the large language model and the financial and tax business database, create a structured semantic mapping template, transform the tables, fields and relationships between tables in the financial and tax business database into a semantic association form that the large language model can recognize, generate semantic mapping rules and retrieval indexes, and integrate them to form a set of intermediate adaptation layer components.

[0009] The large language model is trained specifically for the financial and tax domain to generate a large language model for the financial and tax domain. It receives natural language questions in the financial and tax domain transmitted by users, calls the large language model for the financial and tax domain to perform intent classification, entity recognition and query condition parsing on the natural language questions in the financial and tax domain, and outputs standardized structured query statements or parameterized application programming interface call instructions.

[0010] The structured query statement or parameterized application programming interface call instruction is input into the intermediate adaptation layer component set. The semantic mapping rules in the intermediate adaptation layer component set are used to match the database access path with the retrieval index, establish a data interaction link with the financial and tax business database, execute data query operations, and obtain the structured raw numerical results returned by the financial and tax business database.

[0011] The system invokes a large language model in the field of finance and taxation, and parses the structured raw numerical results based on a preset financial and taxation business scenario template to generate preliminary interpretation results containing natural language descriptions, visualized configuration information, and risk identification indicators.

[0012] Collect currently valid tax and financial rules texts to construct a tax and financial rules text retrieval library. Calculate the semantic correlation between the preliminary interpretation results and the rule text clauses in the rule text retrieval library. Based on the semantic correlation and closely related rule text content, revise the terminology and logical content in the preliminary interpretation results to form the final intelligent dialogue and query results for tax and financial data, and push them to the user interface.

[0013] Based on the above, by constructing an intermediate adaptation layer connecting the large language model and the financial and tax business database, and creating a structured semantic mapping template, the complex financial and tax business database information is transformed into a semantic association form that the large language model can recognize. This effectively solves the interaction problem between the large language model and the database, achieving seamless integration between the two. The large language model undergoes specialized training in the financial and tax domain, enabling it to accurately understand natural language questions posed by users in the financial and tax domain, perform intent classification, entity recognition, and query condition parsing, and output standardized structured query statements or parameterized application programming interface (API) call instructions, greatly improving the accuracy and efficiency of queries. Through the intermediate adaptation layer component set, database access paths can be quickly matched, data query operations can be executed, and structured raw numerical results can be obtained, ensuring the accuracy and integrity of the data. The financial and tax domain large language model is called to parse the raw numerical results based on a preset financial and tax business scenario template, generating preliminary interpretation results containing natural language descriptions, visualized configuration information, and risk identification markers, providing users with an intuitive and easy-to-understand information display. By collecting valid tax and financial rule texts to construct a tax and financial rule text retrieval database, calculating the semantic relevance between the preliminary interpretation results and the rule text clauses, and correcting the preliminary interpretation results, the final intelligent dialogue and query results for tax and financial data are formed. This ensures the accuracy and compliance of the results and can provide users with comprehensive, accurate, and timely tax and financial information, meeting users' diverse needs in tax and financial data query and interpretation. Attached Figure Description

[0014] Figure 1 This is a schematic diagram of the execution flow of the intelligent dialogue and query method for financial and tax data based on a large language model provided in an embodiment of the present invention.

[0015] Figure 2 This is a schematic diagram of exemplary hardware and software components of the intelligent dialogue and query system for financial and tax data based on a large language model provided in an embodiment of the present invention. Detailed Implementation

[0016] The present invention will now be described in detail with reference to the accompanying drawings. Figure 1 This is a flowchart illustrating an embodiment of the present invention of an intelligent dialogue and query method for financial and tax data based on a large language model. The following is a detailed description of this intelligent dialogue and query method for financial and tax data based on a large language model.

[0017] Step S110: Construct an intermediate adaptation layer connecting the large language model and the financial and tax business database, create a structured semantic mapping template, transform the tables, fields and relationships between tables in the financial and tax business database into a semantic association form that the large language model can recognize, generate semantic mapping rules and retrieval indexes, and integrate them to form a set of intermediate adaptation layer components.

[0018] In this embodiment, we take the scenario of querying and interpreting financial and tax data of a medium-sized manufacturing enterprise as an example. This enterprise needs to query its value-added tax declaration data, corporate income tax payment status, and the applicability of relevant tax incentive rules using natural language. To achieve effective integration between the large language model and the enterprise's internal financial and tax business database, an intermediate adaptation layer needs to be constructed first. The core objective of this intermediate adaptation layer is to resolve the differences between the semantic understanding of the large language model and the structured query of the database, ensuring that the user's natural language questions can be accurately translated into database-executable operations, and that the query results are fed back to the user in a manner consistent with financial and tax business logic.

[0019] Step S111: Determine the core functional requirements of the intermediate adaptation layer. The core functional requirements include data interaction connection, semantic conversion, retrieval matching and component integration. Plan the component interaction process and data flow path of the intermediate adaptation layer.

[0020] In this manufacturing enterprise scenario, the data interaction and connection function needs to support bidirectional data transmission between the large language model and the enterprise's financial and tax business database (such as a MySQL database). This includes receiving structured query instructions generated by the large language model and returning database query results to the large language model. The semantic conversion function needs to convert the table structure (such as "Value-Added Tax Declaration Form" and "Annual Corporate Income Tax Declaration Form"), field information (such as "Sales Amount Subject to Value-Added Tax" and "Taxable Income"), and relationships between tables (such as the association between "Unified Social Credit Code of Enterprise" in the "Value-Added Tax Declaration Form" and the corresponding fields in the "Enterprise Basic Information Table") in the database into semantic descriptions that the large language model can understand. The retrieval and matching function is used to quickly locate the database objects involved in the user's query intent. Component integration encapsulates the above functional modules into a set of collaborative components. The component interaction process is planned as follows: After the user's natural language question is parsed by the large language model, a structured query statement is generated. This structured query statement first enters the semantic conversion component in the intermediate adaptation layer. The semantic conversion component calls the retrieval and matching component to locate the relevant database metadata. Then, the data interaction and connection component establishes a connection with the database and executes the query. Finally, the result is returned to the large language model for interpretation.

[0021] Step S112: Create a structured semantic mapping template. The structured semantic mapping template includes a database association module, a table description module, a field explanation module, and a relationship definition module. The database association module is used to record the identifier of the adapted financial and tax business database. The table description module is used to fill in the table name and corresponding business purpose. The field explanation module is used to record the field name, data attribute, and semantic meaning. The relationship definition module is used to explain the basis and logic of the association between different tables.

[0022] For example, a structured semantic mapping template is created for the financial and tax business database of the manufacturing enterprise. The database identifier recorded in the database association module is "DB_CAI_SHUI_001", which uniquely corresponds to the core financial and tax database within the enterprise. In the table description module, for the "Value-Added Tax Declaration Form" table, the table name is filled in as "TB_ZENGZHI_SHUI_SHENBAO", and the business purpose is described as "recording the detailed declaration data of the enterprise's value-added tax for each period, including key indicators such as sales, output tax, and input tax"; for the "Annual Corporate Income Tax Declaration Form" table, the table name is "TB_QIYE_SUODESUI_NIANDU", and the business purpose is described as "summarizing the enterprise's income, costs, expenses, and tax payable for a tax year". In the field explanation module, taking the "Sales Amount Subject to Value-Added Tax" field in the "Value-Added Tax Declaration Form" as an example, the field name is "FIELD_YINGZHENG_XIAOSHOU_E", the data attribute is "numeric, rounded to two decimal places", and the semantic meaning is "the total sales amount of goods or taxable services for which value-added tax should be calculated and paid by the enterprise during the declaration period". In the relationship definition module, it is explained that the association between the "Value-Added Tax Declaration Form" and the "Enterprise Basic Information Table" (TB_QIYE_JIBEN_XINXI) is based on the "Unified Social Credit Code of the Enterprise" field. The two establish a one-to-one association through this field, which is used to obtain the basic attribute information of the enterprise (such as industry, registered address, etc.) during the query to assist in interpreting the results.

[0023] Step S113: Extract metadata information from the financial and tax business database. The metadata information includes table name, field name, field data attributes, field constraint requirements, and inter-table association identifiers. Use a metadata parsing tool to read the metadata information and classify and organize it.

[0024] Next, use a metadata parsing tool (such as DBMetadataExtractor) to connect to the enterprise's financial and tax business database "DB_CAI_SHUI_001", and extract the metadata information of the above tables by executing database metadata query statements (such as executing "SHOWTABLES" and "DESCRIBE table_name" in MySQL). For the "Value Added Tax Declaration Form", the extracted form name is "TB_ZENGZHI_SHUI_SHENBAO", and the field names include "FIELD_SHENBAO_QI" (declaration period), "FIELD_QIYE_XINYONGDAIMA" (enterprise credit code), and "FIELD_YINGZHENG_XIAOSHOU_E" (taxable sales amount). In the field data attributes, "FIELD_SHENBAO_QI" is a date type, and "FIELD_YINGZHENG_XIAOSHOU_E" is decimal(18,2). The field constraint requirements include "FIELD_QIYE_XINYONGDAIMA" as a primary key constraint and "FIELD_SHENBAO_QI" as a non-null constraint. Regarding the inter-table relationship identifiers, a foreign key relationship was found between the "FIELD_QIYE_XINYONGDAIMA" field in the "TB_ZENGZHI_SHUI_SHENBAO" table and the "FIELD_QIYE_XINYONGDAIMA" field in the "TB_QIYE_JIBEN_XINXI" table. After extraction, the metadata information was categorized and organized according to table dimensions, with each table forming an independent metadata list. The list lists the relevant field information in order of field sequence.

[0025] Step S114: Fill in the classified and organized metadata information into the corresponding modules of the structured semantic mapping template one by one. Fill in the financial and tax business database identifier in the database association module, fill in the table name and business purpose in the table description module, fill in the field name, data attribute and semantic meaning in the field explanation module, and explain the basis and logic of the association between different tables in the relationship definition module to form a complete semantic mapping document.

[0026] Then, fill the categorized and organized metadata information into the created structured semantic mapping template. In the database association module, enter “DB_CAI_SHUI_001”. In the table description module, fill in the table name and corresponding business purpose description for the “TB_ZENGZHI_SHUI_SHENBAO” table. This business purpose description is standardized based on the business documents provided by the company's financial and tax personnel to ensure accurate reflection of the table's actual business function. In the field explanation module, fill in the field name, data attribute decimal(18,2), and semantic meaning of “FIELD_YINGZHENG_XIAOSHOU_E” ("total sales of goods or taxable services subject to VAT during the reporting period") in the corresponding positions. The relationship definition module details the association between "TB_ZENGZHI_SHUI_SHENBAO" and "TB_QIYE_JIBEN_XINXI" through the "FIELD_QIYE_XINYONGDAIMA" field. The association logic is "TB_ZENGZHI_SHUI_SHENBAO.FIELD_QIYE_XINYONGDAIMA=TB_QIYE_JIBEN_XINXI.FIELD_QIYE_XINYONGDAIMA". It is noted that this association is mandatory and is used in all scenarios involving linked queries of VAT declaration data and basic enterprise information. After completing all metadata information, a complete semantic mapping document is generated in XML format, with each module corresponding to a node in the XML for easy subsequent parsing and retrieval.

[0027] Step S115: Based on the table descriptions, field explanations, and relationship definitions in the semantic mapping document, extract the business purpose keywords, field semantic meaning keywords, and related logical keywords, and perform deduplication and classification on each type of keyword.

[0028] Based on the generated semantic mapping document, various keywords are extracted. From the business purpose description of the "Value-Added Tax Declaration Form"—"Records detailed data of the enterprise's value-added tax declarations for each period, including key indicators such as sales revenue, output tax, and input tax"—the keywords for the business purpose of the form are extracted as "value-added tax," "declaration details," "sales revenue," "output tax," and "input tax." From the semantic meaning of the field "FIELD_YINGZHENG_XIAOSHOU_E"—"The total sales revenue of goods or taxable services for which value-added tax should be calculated and paid by the enterprise during the declaration period"—the keywords for the semantic meaning of the field are extracted as "declaration period," "calculation and payment," "goods," "taxable services," and "total sales revenue." From the relationship definition—"Establishing a one-to-one association through the enterprise's unified social credit code field to obtain the enterprise's basic attribute information during queries"—the keywords for the association logic are extracted as "enterprise unified social credit code," "one-to-one," and "basic attribute information." After extraction, the keywords are deduplicated; for example, if "sales revenue" appears in the semantic meaning of multiple fields, only one keyword, "sales revenue," is retained. When categorizing, keywords related to the business purpose of the table are classified into the "TABLE_KEYWORDS" category, keywords related to the semantic meaning of the fields are classified into the "FIELD_KEYWORDS" category, and keywords related to the association logic are classified into the "RELATION_KEYWORDS" category. Each category forms a keyword list.

[0029] Step S116: Determine the search index construction rules, set the index classification rules and association methods according to the classification of key semantic words, and associate each key semantic word with the corresponding semantic mapping document location to form a semantic mapping search index.

[0030] The index construction rules are determined as follows: for the keywords categorized above, the index classification rules are set as follows: keywords under the "TABLE_KEYWORDS" category are associated with the table description module node paths in the semantic mapping document; keywords under the "FIELD_KEYWORDS" category are associated with the field explanation module node paths; and keywords under the "RELATION_KEYWORDS" category are associated with the relationship definition module node paths. The association method uses an inverted index structure, meaning each keyword maps to all node paths in the semantic mapping document where it appears. For example, the keyword "Value Added Tax" belongs to "TABLE_KEYWORDS," and its associated semantic mapping document location is " / SemanticMapping / Database / Table[@name='TB_ZENGZHI_SHUI_SHENBAO'] / Description"; the keyword "Sales Amount" appears in both the table's business purpose and the field's semantic meaning, and is therefore associated with the table description module node path and the semantic meaning node path of "FIELD_YINGZHENG_XIAOSHOU_E" in the field explanation module, respectively. The completed semantic mapping retrieval index is stored in the form of a Lucene index file for easy subsequent fast retrieval and matching.

[0031] Step S117: Generate semantic mapping rules, which include rules for the correspondence between metadata information and semantic mapping documents, rules for extracting key semantic terms, and rules for updating the retrieval index. When the metadata information changes subsequently, the semantic mapping documents and the retrieval index are adjusted synchronously according to the semantic mapping rules.

[0032] Semantic mapping rules are generated, with explicit rules governing the correspondence between metadata information and semantic mapping documents: table names in metadata correspond to the "name" attribute of the "Table" node in the semantic mapping document; field data types in metadata correspond to the values ​​of the "DataAttribute" child nodes in the field explanation module; when a new table is added to the metadata, a new "Table" node is added under the "Database" node in the semantic mapping document, and the corresponding table description information is filled in; when a field in the metadata is deleted, the corresponding field explanation node in the semantic mapping document is also deleted. Key semantic vocabulary extraction rules specify that the extraction scope is the content of all text nodes in the semantic mapping document, and the extraction criteria are words or phrases with a length of no less than two Chinese characters and containing financial and tax business meanings. The deduplication method uses string exact matching, and the classification method follows the three categories mentioned above: "TABLE_KEYWORDS", "FIELD_KEYWORDS", and "RELATION_KEYWORDS". The retrieval index update rule is triggered when the content of the semantic mapping document is modified (e.g., changes in the semantic meaning of fields), new metadata information is added (e.g., new tables are added), or the terminology of the tax and financial rules text is adjusted (e.g., the official terminology of "taxable sales amount" is changed to "taxable sales amount"). The update process is as follows: First, locate the node in the semantic mapping document that has changed, delete all keyword entries corresponding to that node in the retrieval index, then re-extract the keywords for that node, generate new index entries and add them to the retrieval index, and finally optimize the index (e.g., merge similar entries and adjust index weights).

[0033] Step S1171: Set the correspondence rules between metadata information and semantic mapping documents, determine the correspondence between each element in the metadata information and each module in the semantic mapping document, including the table name in the metadata information corresponding to the table name item in the table description module of the semantic mapping document, the field data attributes in the metadata information corresponding to the data attribute items in the field explanation module, and specify the adjustment method of the corresponding module in the semantic mapping document when metadata information is added, modified or deleted.

[0034] Specifically, the rules for the correspondence between metadata information and semantic mapping documents are set. The “table name” element in the metadata information (such as “TB_ZENGZHI_SHUI_SHENBAO”) corresponds to the “table name item” (XML node is “ / SemanticMapping / Database / Table / TableName”) in the table description module of the semantic mapping document; the “field data attribute” element in the metadata information (such as “decimal(18,2)”) corresponds to the “data attribute item” (XML node is “ / SemanticMapping / Database / Table / Field / FieldDataAttribute”) in the field interpretation module. When a new table is added to the metadata (e.g., adding "TB_ZENGZHI_SHUI_YINGSHUIJIANSHOU" (Value-Added Tax Reduction and Exemption Table)), a new "Table" child node is added under the "Database" node in the semantic mapping document. The "TableName" child node value is set to the name of the new table, and the "TableDescription" child node value is filled in according to the table comments in the metadata or the business document. When the data attributes of a field in the metadata are modified (e.g., the data attribute of "FIELD_YINGZHENG_XIAOSHOU_E" is changed from "decimal(18,2)" to "decimal(20,2)"), the value of the "FieldDataAttribute" node in the corresponding field explanation module in the semantic mapping document is updated to the new data attribute. When a field in the metadata is deleted (e.g., "FIELD_FEIYINGSHUI_XIAOSHOU_E" (Tax-Exempt Sales Amount) is removed due to business adjustments), the corresponding "Field" node and all its child nodes in the semantic mapping document are deleted together.

[0035] Step S1172: Determine the key semantic vocabulary extraction rules. The extraction scope includes the business purpose of tables, the semantic meaning of fields, and the description of related logic in semantic mapping documents. The extraction criteria are words or phrases that contain the core meaning of financial and tax business. At the same time, the deduplication and classification methods of the extracted words are specified to ensure that the words are not repeated and are classified reasonably.

[0036] Determine the extraction rules for key semantic vocabulary, and the extraction scope is clearly defined as the text of the "TableBusinessPurpose" node (table business purpose) in the table description module of the semantic mapping document, the text of the "FieldSemanticMeaning" node (field semantic meaning) in the field explanation module, and the text of the "RelationLogicDescription" node (association logic description) in the relation definition module. The extraction criteria are as follows: the vocabulary or phrase should be able to accurately reflect the core meaning of the fiscal and tax business, with a length generally between 2 and 8 Chinese characters, excluding function words (such as "of", "in", "etc.") and punctuation marks. For example, from the text of the "FieldSemanticMeaning" node "The total sales amount of goods or taxable services that should be calculated and paid for value-added tax during the declaration period of an enterprise", the vocabulary that meets the criteria are "declaration period", "calculate and pay", "value-added tax", "goods", "taxable services", "total sales amount", while the vocabulary that does not meet the criteria such as "enterprise", "occurred", "should" are filtered out. The duplicate removal method for the extracted vocabulary uses duplicate removal based on a hash table. Each vocabulary is used as the key of the hash table. If the key already exists, the vocabulary is skipped; otherwise, it is added to the hash table. The classification method is based on the object described by the vocabulary. Vocabularies describing the function of the table are classified into the keyword class of table business purposes, those describing the meaning of fields are classified into the keyword class of field semantic meanings, and those describing the relationship between tables are classified into the keyword class of association logic, ensuring that the classified vocabulary has a clear orientation for subsequent retrieval and matching.

[0037] Step S1173: Set the retrieval index update rules, set the trigger conditions for index update, and the trigger conditions include modification of the semantic mapping document, addition of metadata information, and adjustment of rule text terms. When the trigger conditions are met, determine the index range that needs to be updated.

[0038] Set up index update rules, with triggering conditions including: modification of semantic mapping documents (e.g., updates to table business usage descriptions, changes to field semantic meanings); addition of metadata information to the financial and tax business database (e.g., new tables, new fields); and adjustments to the terminology in financial and tax rules (e.g., the release of new terminology standards by relevant institutions, requiring "output tax amount" to be changed to "total output tax amount"). When the triggering conditions are met, determine the scope of the index that needs to be updated. For example, if the description of the business purpose of the "Value-Added Tax Declaration Form" in the semantic mapping document is modified, resulting in a change in the extracted keywords related to the business purpose of the form, then all index entries corresponding to the keywords related to that form under the "TABLE_KEYWORDS" category need to be updated. If a new "TB_SHUIWUBU_HUIYUAN" (Tax Department Member Table) table is added, and its extracted keywords are "Tax Department" and "Member Information," then these keywords and their corresponding semantic mapping document locations need to be added to the search index. If the rule text term "Enterprise Unified Social Credit Code" is adjusted to "Legal Person and Other Organization Unified Social Credit Code," then "Enterprise Unified Social Credit Code" needs to be deleted from the associated logical keywords, "Legal Person and Other Organization Unified Social Credit Code" needs to be added, and all index entries corresponding to this keyword need to be updated, while the index entries of the original keyword need to be deleted.

[0039] Step S1174: Construct the retrieval index update process. First, delete the entries in the original index that are related to the changed content. Then, extract the key semantic words based on the modified semantic mapping document to generate new index entries. Finally, insert the new index entries into the retrieval index and establish a connection. The updated index is used to point to the latest semantic mapping document content.

[0040] A retrieval index update process is established, which is initiated when any of the above triggering conditions are met. First, based on the changed content, the corresponding module node in the semantic mapping document (such as the table description module, field explanation module, etc.) is located. The retrieval index is then used to perform a reverse query to find all index entries corresponding to the keywords under that node, and these entries are deleted from the original index. For example, if the semantic meaning of the field "FIELD_YINGZHENG_XIAOSHOU_E" is modified, resulting in a change in the keyword of the field's semantic meaning, the "Field" node corresponding to that field is located, and all index entries of the original keyword (such as "total sales revenue") under the category "FIELD_KEYWORDS" are retrieved and deleted. Next, based on the content of the corresponding module in the modified semantic mapping document, key semantic terms are re-extracted; for example, the new keyword "total taxable sales revenue" is extracted from the updated field semantic meaning. Next, index entries are generated for the newly extracted keywords. Each entry contains the keyword text, the corresponding semantic mapping document node path (e.g., " / SemanticMapping / Database / Table[@name='TB_ZENGZHI_SHUI_SHENBAO'] / Field[@name='FIELD_YINGZHENG_XIAOSHOU_E'] / FieldSemanticMeaning"), and the start and end offsets of that node in the document. Finally, the newly generated index entries are inserted into the retrieval index, and the association between keywords and node paths is established to ensure that the updated index accurately points to the latest content of the semantic mapping document.

[0041] Step S1175: Establish a verification and maintenance mechanism for semantic mapping rules, regularly check the consistency between metadata information and semantic mapping documents, the accuracy of key semantic vocabulary extraction, and monitor the update status of the retrieval index. If inconsistencies or inaccuracies are detected, they are corrected according to the semantic mapping rules. If an update delay is detected, the index update process is triggered. The semantic mapping rules are used to guide the collaborative operation of intermediate adaptation layer components.

[0042] Establish a semantic mapping rule verification and maintenance mechanism, and schedule an automatic verification task to be executed every Sunday at 2:00 AM. Verification content includes: consistency between metadata information and semantic mapping documents, by comparing the table names, field names, and field data attributes in the database metadata with the values ​​of the corresponding nodes in the semantic mapping document; for example, checking whether the name "TB_ZENGZHI_SHUI_SHENBAO" in the metadata is the same as the value of the "TableName" node in the semantic mapping document; accuracy of key semantic term extraction, by randomly sampling a portion of the semantic mapping document content and manually checking whether the extracted keywords conform to the extraction rules, and whether any core terms are omitted or irrelevant terms are included; and the update status of the retrieval index, checking whether the last update time of the retrieval index is consistent with the last modification time of the semantic mapping document. If the document has been modified but the index has not been updated, it is determined to be an update delay. When inconsistencies are detected between metadata and documents, the semantic mapping document is automatically corrected according to the corresponding rules in the semantic mapping rules. For example, if a field's data attribute in the metadata is updated but the document is not, the data attribute node value of the corresponding field in the document is updated to the value in the metadata. If inaccurate keyword extraction is found, such as incorrectly extracting "tax-free" as a keyword (when this field is actually a taxable field), the extraction process is re-executed and the incorrect keyword is replaced. If an index update delay is detected, the retrieval index update process is immediately triggered to ensure that the index is synchronized with the document content. In addition, manual maintenance is performed monthly to check whether the semantic mapping rules themselves need optimization, such as whether the keyword extraction criteria need to be adjusted to adapt to new financial and tax business terms. The maintenance results are recorded in the rule maintenance log.

[0043] Step S118: Integrate the structured semantic mapping template, semantic mapping document, semantic mapping retrieval index and semantic mapping rules to form a set of intermediate adaptation layer components, establish a call link between components, and realize data transfer and function call between components through preset interfaces.

[0044] The aforementioned structured semantic mapping templates, semantic mapping documents, semantic mapping retrieval indexes, and semantic mapping rules are integrated to form a middleware adaptation layer component set. This middleware adaptation layer component set includes the following core components: a semantic mapping template management component (responsible for template creation, modification, and deletion), a metadata extraction and parsing component (performs metadata reading and classification), a semantic mapping document generation component (generates documents based on templates and metadata), a keyword extraction and index building component (extracts keywords and generates a retrieval index), a semantic mapping rule engine (stores and executes semantic mapping rules), and a retrieval matching component (provides keyword retrieval services). A call chain is established between components. For example, when a user initiates a natural language query, the large language model generates a structured query statement and sends it to the middleware adaptation layer. The middleware adaptation layer first calls the retrieval matching component; when the retrieval matching component needs keywords, it calls the keyword extraction and index building component to obtain the retrieval index; if it finds that the semantic mapping document needs to be updated during the retrieval process (e.g., triggered by metadata changes), the semantic mapping rule engine calls the semantic mapping document generation component and the keyword extraction and index building component to regenerate the document and index. Components exchange data through pre-defined interfaces in a RESTful style. For example, the retrieval and matching component provides the " / api / retrieve" interface, which receives keyword parameters and returns the location information of the matched semantic mapping document in JSON format.

[0045] Step S120: Perform specialized training on the large language model for the financial and tax domain to generate a large language model for the financial and tax domain. Receive natural language questions for the financial and tax domain transmitted by the user. Call the large language model for the financial and tax domain to perform intent classification, entity recognition, and query condition parsing on the natural language questions for the financial and tax domain. Output standardized structured query statements or parameterized application programming interface call instructions.

[0046] In this manufacturing enterprise scenario, users need to ask the system questions using natural language, such as, "What was our company's taxable sales amount for the third quarter of 2023? Does it meet the VAT preferential rules for small and micro enterprises?" To enable the large language model to accurately understand these tax-related questions, it needs specialized training to master tax terminology, business logic, and query rules. After training, the system receives the user's natural language questions, analyzes the question intent, extracts key entities and query conditions using the tax-related large language model, and ultimately transforms it into a structured query statement executable by the database or an instruction to call the relevant rule text interpretation interface.

[0047] Step S121: Collect training data in the field of finance and taxation. The training data in the field of finance and taxation includes historical financial and taxation consultation questions, interpretation texts of financial and taxation rules, financial and taxation data query cases and corresponding standard processing results.

[0048] Training data in the field of finance and taxation is collected. Data sources include internal financial and tax consultation records from the past three years, interpretation texts of rules such as value-added tax and corporate income tax issued by relevant institutions (such as interpretations of relevant notices), actual financial and tax data query cases from enterprises (such as operation records of querying tax data for a specific period through the ERP system), and the corresponding standard processing results of these cases (such as correct SQL query statements and rule text clause matching results). For example, historical financial and tax consultation questions include "How to calculate the ending balance of input tax credit?" and "What are the conditions for additional deduction of R&D expenses?"; interpretation texts of financial and tax rules include the original text of the rule clauses, official interpretations, and case analyses; financial and tax data query cases record the natural language description of the user's query (such as "Query input tax amount in December 2022"), the corresponding database query statement (such as "SELECT FIELD_JINXIANG_SHUIEFROMTB_ZENGZHI_SHUI_SHENBAOWHEREFIELD_SHENBAO_QI='2022-12'"), and query result data. Ensure that the collected training data covers multiple sub-domains of financial and tax business, such as value-added tax, corporate income tax, and tax incentive rules, with a data volume reaching millions, to guarantee the sufficiency of model training.

[0049] Step S122: Clean the training data in the financial and tax domain and label the cleaned training data. The labeling content includes the question intent category, key entity information, query condition elements, and standard output format. The question intent category includes data query, rule text interpretation, and risk analysis. The key entity information includes financial and tax subjects, time range, and enterprise identifier. The query condition elements include filtering requirements, sorting requirements, and aggregation requirements. The standard output format includes structured query statement format and parameterized application programming interface call instruction format.

[0050] The collected training data in the finance and taxation field is cleaned to remove duplicate data (such as the same consultation question being recorded multiple times), invalid data (such as incomplete questions like "2023 VAT..."), and sensitive data (such as query results containing specific bank account numbers of enterprises). After cleaning, the data is labeled. Taking a natural language question in the training data, "Query the company's VAT-taxable sales amount in the third quarter of 2023 and determine whether it meets the conditions for VAT reduction and exemption for micro and small enterprises," as an example, its question intent category is labeled as "data query + rule text interpretation" (composite intent); key entity information includes the financial and tax subject "VAT-taxable sales amount," the time range "third quarter of 2023," and the enterprise identifier "this company" (which can be mapped to the enterprise credit code later); the filtering requirements in the query conditions are "time range = third quarter of 2023" and "enterprise identifier = this company's credit code," and the aggregation requirement is "sum" (if there are multiple records, they need to be summarized); the standard output format is a structured query statement (used to query sales data) + parameterized API call instructions (used to call the rule text matching interface to determine whether it meets the conditions for reduction and exemption). LabelStudio was used as the annotation tool, and the annotators were professionals with finance and tax backgrounds. After the annotation was completed, the annotated data was sampled and checked to ensure that the annotation accuracy rate reached more than 95%.

[0051] Step S123: Divide the labeled training data into a training set and a validation set, allocate the data volume according to a preset ratio, use the training set to train the large language model, adjust the parameter settings of the large language model, and through multiple iterations of training, enable the large language model to learn to recognize the terminology and business logic in the financial and tax field.

[0052] The labeled training data was divided into training and validation sets in an 8:2 ratio, with 80% of the data used for model training and 20% for validating model performance. The chosen base language model was qwen3 4b, and the training framework was PyTorch. During training, natural language questions from the training set were used as input to the model, and the corresponding labeled information (intent category, entity information, query conditions, and output format) was used as the expected output. Model parameters were adjusted, including an initial learning rate of a relatively small value (e.g., 1e-5), a cosine annealing learning rate scheduling strategy, a batch size of 16, and 50 training epochs. After each training epoch, the validation set was used to evaluate the model's performance metrics on tasks such as intent classification and entity recognition. Training was stopped when the model's intent classification accuracy on the validation set no longer improved and tended to stabilize after multiple iterations. During training, the model adjusts its weight parameters through backpropagation, gradually learning the terminology of the financial and tax field (such as "sales amount subject to VAT" and "tax refund") and business logic (such as "sales amount needs to be distinguished between taxable and tax-exempt parts" and "preferential rules have applicable periods and conditions").

[0053] Step S124: Use the validation set to validate the performance of the trained large language model, analyze the performance of the large language model in terms of intent classification accuracy, entity recognition completeness, and query condition parsing accuracy. If the validation results do not meet the preset requirements, supplement the training data and retrain the large language model until the performance of the large language model meets the requirements, and generate a large language model for the financial and tax domain.

[0054] The trained large language model was validated using a validation set. Evaluation metrics included intent classification accuracy (number of correctly classified questions / total number of validated questions), entity recognition completeness (number of correctly identified entities / total number of labeled entities), and query condition parsing accuracy (number of correctly parsed query conditions / total number of labeled query conditions). The preset requirements were: intent classification accuracy ≥ 90%, entity recognition completeness ≥ 85%, and query condition parsing accuracy ≥ 88%. If the intent classification accuracy was 88%, failing to meet the preset requirements, incorrect cases were analyzed. It was found that the model had low accuracy in recognizing "risk analysis" intents (e.g., misclassifying "Is there a tax risk in this expenditure?" as "rule text interpretation"). To address this, 10,000 additional training data points of risk analysis questions were collected, re-labeled, and added to the training set. Training continued for 10 more rounds according to the parameter settings in steps S123. During the next validation, if all metrics met the preset requirements, training was stopped, and the current model was saved as a large language model for the finance and tax domain. The model file storage path was " / models / cai_shui_llm_v1.0".

[0055] Step S125: Establish a user question receiving channel. The user question receiving channel supports text input and is used to record the user's input of natural language questions in the financial and tax field and the input time. The received questions are processed to unify the format. The unified format of the natural language questions in the financial and tax field is input into the financial and tax field big language model. The financial and tax field big language model is called to perform intent classification. The intent category is determined according to the business expression in the unified format of the natural language questions in the financial and tax field.

[0056] Set up a user question receiving channel. Integrate a text input box in the enterprise's internal financial and tax management system as the user interaction interface, supporting users to input Chinese natural language questions. After the user inputs a question, the system records the question text and the input time (accurate to seconds), and assigns a unique question ID to each question (such as "QID_20231027_153045_001"). Perform unified formatting on the received questions, including removing special symbols (such as emojis, irrelevant punctuation) in the text, converting full-width characters to half-width characters, and unifying the date format (such as converting "23 years, Q3" to "The third quarter of 2023"). For example, if the user inputs "What is the VAT payable sales amount of our company in Q3 of 23 years?", after unified formatting, it becomes "What is the VAT payable sales amount of our company in the third quarter of 2023?". Input the uniformly formatted question into the large language model in the financial and tax field, and call the intent classification function of the model. The model determines its intent category based on the business expressions ("VAT payable sales amount", "The third quarter of 2023") in the question.

[0057] Step S1251: Call the large language model in the financial and tax field to receive the natural language question in the financial and tax field after unified formatting, perform word segmentation on the question text, split the continuous text into independent lexical units, and extract business expression keywords from the lexical units after word segmentation. The business expression keywords include financial and tax business-related vocabulary, data requirement-related vocabulary, and rule text-related vocabulary.

[0058] Call the large language model in the financial and tax field to receive the question "What is the VAT payable sales amount of our company in the third quarter of 2023?" after unified formatting. The model first performs word segmentation on the question text. Using the word segmentation method based on BPE (Byte Pair Encoding), the continuous text is split into independent lexical units, such as "we / company / 2023 year / third quarter / of / VAT payable / sales amount / is / how much / ?". Extract business expression keywords from the word segmentation result. The financial and tax business-related vocabulary is "VAT payable" and "sales amount"; the data requirement-related vocabulary is "the third quarter of 2023" and "our company"; since this question does not involve rule text content, the rule text-related vocabulary is empty. During the extraction process, the model automatically identifies and marks the above keywords through the financial and tax vocabulary table learned during its training.

[0059] Step S1252: Call the large language model in the financial and tax field to load the preset intent category recognition library. The intent category recognition library contains a set of characteristic keywords corresponding to each intent category. Compare the extracted business expression keywords with the set of characteristic keywords of each intent category in the intent category recognition library, and count the number of coincidences between the set of characteristic keywords of each intent category and the business expression keywords.

[0060] A pre-defined intent category recognition library is loaded using a large language model in the finance and taxation domain. This library contains feature keyword sets for three intent categories: data query, rule text interpretation, and risk analysis. The feature keyword set for data query includes terms like "sales amount," "tax amount," "how much," "query," "amount," and "data." The feature keyword set for rule text interpretation includes terms like "preferential treatment," "conditions," "how," "regulations," and "interpretation." The feature keyword set for risk analysis includes terms like "risk," "compliance," "whether," "problem," "inspection," and "hidden danger." The extracted business expression keywords "taxable VAT," "sales amount," "third quarter of 2023," and "our company" are compared with the feature keyword sets for each intent category. The overlapping keywords between the data query feature keyword set and the business expression keywords are "sales amount" and "third quarter of 2023" ("third quarter of 2023" is a time range element in data queries, corresponding to the data query category feature), with an overlap of 2. The overlap for the rule text interpretation and risk analysis categories is 0.

[0061] Step S1253: Calculate the ratio of overlapping keywords to the total number of keywords in the business description, and determine the intent category with the highest ratio as the preliminary intent category.

[0062] The overlap rate was calculated as a percentage of the total number of keywords in the business description. The total number of keywords in the business description was 4 ("VAT payable", "sales revenue", "Third quarter of 2023", "our company"). The overlap rate for data query keywords was 2, with a ratio of 2 / 4 = 0.5; the ratios for rule text interpretation and risk analysis keywords were both 0. Therefore, the intent category with the highest overlap rate was data query, which was determined as the preliminary intent category.

[0063] Step S1254: Perform secondary verification on the preliminary intent category, analyze whether the complete business logic in the question text matches the preliminary intent category. If the business logic matches the preliminary intent category, the intent category is finally determined.

[0064] A secondary validation was performed on the initial intent category "data query," analyzing the complete business logic of the question text: The user is asking for the specific value of "our company's" "taxable sales amount" in the "third quarter of 2023." This is a typical need to obtain data on a specific period, a specific company, and a specific financial and tax indicator, which matches the definition of a data query intent (aiming to obtain specific financial and tax data stored in the database). Therefore, the business logic matches the initial intent category, and the intent category is ultimately determined to be data query.

[0065] Step S1255: If there are multiple intent categories with similar overlap ratios or if the business logic does not match the initial intent category, the tax and finance domain big language model further analyzes the contextual information in the question. The contextual information includes the user's historical query intent, the time description in the question, and the company-related description. The weight of the feature keywords is adjusted in combination with the contextual information, and the overlap ratio is recalculated until a unique intent category that matches the business logic is determined.

[0066] Suppose a user's question is "Does our company's taxable sales revenue for the third quarter of 2023 meet the requirements of the VAT preferential rules for small and micro enterprises?". The extracted business-related keywords include "taxable sales revenue," "third quarter of 2023," "our company," "small and micro enterprise," and "VAT preferential rules text." After comparing with the intent category recognition database, the overlapping keywords for data query are "taxable sales revenue," "third quarter of 2023," and "our company" (3 overlaps), while the overlapping keywords for rule text interpretation are "small and micro enterprise" and "VAT preferential rules text" (2 overlaps), with similar ratios (3 / 5 = 0.6, 2 / 5 = 0.4). At this point, the large language model further analyzes the contextual information. The user's historical query intent is "to query VAT declaration data for the second quarter of 2023" (data query category). The time expression "third quarter of 2023" in the question is recent, and the company-related expression "our company" may involve the company size (small and micro enterprise). Based on this information, the model determines that the user first needs to query sales data (data query category), and then determines whether it matches the rule text (rule text interpretation category). Therefore, the weight of data query keywords is adjusted (e.g., the weight of "sales amount subject to VAT" is increased). After recalculating the overlap ratio, the data query category ratio is higher. At the same time, considering that the question includes "whether it matches", the final determination is a composite intent of "data query category + rule text interpretation category".

[0067] Step S1256: Mark the determined intent category in the problem handling record.

[0068] The identified intent category, "Data Query," is marked in the issue processing record. The issue processing record also includes the issue ID "QID_20231027_153045_001", the input time "2023-10-27 15:30:45", and the issue text in a standardized format, which facilitates the tracking and backtracking of subsequent steps.

[0069] Step S126: Perform entity recognition based on intent category, extract key entity information from the unified formatted natural language problem in the financial and tax domain, verify the extracted key entity information, and confirm that the key entity information matches the intent category.

[0070] Based on the determined "data query" intent category, entity recognition is performed. The large language model for the finance and tax domain uses the Named Entity Recognition (NER) module to extract key entity information from the standardized question, "What was our company's taxable sales amount for the third quarter of 2023?". According to the entity types learned during training, the extracted entities include: the enterprise identifier entity "our company" (corresponding to the "enterprise identifier" type in the model), the time range entity "third quarter of 2023" (corresponding to the "time range" type), and the tax item entity "taxable sales amount" (corresponding to the "tax item" type). The extracted key entity information is validated to check whether the entity types meet the requirements of the data query intent (data queries typically require entities such as enterprise identifier, time range, and tax item), confirming that no key entities are missing (e.g., without a time range, the query data cannot be located), and that no entities are irrelevant to the intent category (e.g., rule text name entities do not need to be extracted in pure data queries). After validation, the above entity information is complete and matches the data query intent.

[0071] Step S127: Perform query condition parsing based on intent category and key entity information, and transform the business requirements in the unified format of natural language problems in the financial and tax field into specific query condition elements.

[0072] Based on the "Data Query" intent category and the extracted key entity information, query condition parsing is performed. The user's business requirement, "Query our company's taxable VAT sales revenue for the third quarter of 2023," is transformed into specific query condition elements. These elements include filtering and aggregation requirements. Filtering requirements are determined based on entity information: the enterprise identifier filter is "Enterprise Credit Code = Our Company's Credit Code" (this needs to be mapped to the actual credit code via the enterprise information system, such as "91310XXXXXXXXXX"); the time range filter is "Reporting Period = Third Quarter of 2023" (this needs to be converted to a date range in the database, such as "2023-07-01" to "2023-09-30"). The aggregation requirement is "Sum the 'Taxable VAT Sales Revenue' items" (because the user is querying total sales revenue, while the database may store multiple records by month or transaction, requiring aggregation). Furthermore, the target field for the query is parsed as the database field corresponding to "Taxable VAT Sales Revenue."

[0073] Step S128: Select the output format according to the intent category. If it is a data query intent, organize the query condition elements according to the syntax requirements of the structured query statement to generate a standardized structured query statement. If it is a rule text interpretation intent or a risk analysis intent, integrate the query condition elements and key entity information into a parameterized application programming interface call instruction, and the parameters in the instruction correspond to the intent requirements.

[0074] Based on the intent category "Data Query," the output format is selected as Structured Query Statement (SQL). The query condition elements are organized according to SQL syntax requirements to generate a standardized structured query statement. The target table is "Value-Added Tax Declaration Form" (TB_ZENGZHI_SHUI_SHENBAO), and the target field is "Taxable Value-Added Tax Sales Amount" (FIELD_YINGZHENG_XIAOSHOU_E). The filter conditions are "FIELD_QIYE_XINYONGDAIMA='91310XXXXXXXXXX'" (the mapped enterprise credit code) and "FIELD_SHENBAO_QIBETWEEN'2023-07-01'AND'2023-09-30'" (the converted declaration period range). The aggregation requirement is SUM(FIELD_YINGZHENG_XIAOSHOU_E). Therefore, the generated SQL statement is "SELECT SUM(FIELD_YINGZHENG_XIAOSHOU_E)ASTOTAL_YINGZHENG_XIAOSHOU_EFROMTB_ZENGZHI_SHUI_SHENBAOWHEREFIELD_QIYE_XINYONGDAIMA='91310XXXXXXXXXX'ANDFIELD_SHENBAO_QIBETWEEN'2023-07-01'AND'2023-09-30'".

[0075] Step S129: Perform logical verification on the generated structured query statement or parameterized application programming interface call instruction to confirm that the statement or instruction is used to express the business requirements in the user's problem. If there is a logical deviation, return to the financial and tax domain big language model for reprocessing until the output of the standard statement or instruction that meets the requirements is obtained.

[0076] The generated SQL statement underwent logical validation, including: syntactic correctness (e.g., correct keyword spelling, matching brackets), existence of table and field names (based on information from the semantic mapping document), reasonableness of filtering conditions (e.g., valid date ranges), and appropriate use of aggregate functions. For example, the check found that "FIELD_SHENBAO_QI" is indeed a date field in the semantic mapping document, and the BETWEEN condition is suitable for date range filtering; the SUM function is valid for the numeric field "FIELD_YINGZHENG_XIAOSHOU_E". The SQL statement was confirmed to accurately express the user's business requirement of "querying the total sales amount subject to VAT in the third quarter of 2023" without any logical deviations. If the generated SQL statement mistakenly writes "FIELD_YINGZHENG_XIAOSHOU_E" as "FIELD_FEIYINGSHUI_XIAOSHOU_E" (the tax-free sales amount field), then during logical verification, the semantic meaning of the field in the semantic mapping document is compared. If the field name does not match the user's requirement of "applying", it is determined that there is a logical deviation. The problem is then returned to the financial and tax domain big language model for re-parsing until the correct SQL statement is generated.

[0077] Step S130: Input the structured query statement or parameterized application programming interface call instruction into the intermediate adaptation layer component set, match the database access path with the retrieval index through the semantic mapping rules in the intermediate adaptation layer component set, establish a data interaction link with the financial and tax business database, execute the data query operation, and obtain the structured raw numerical results returned by the financial and tax business database.

[0078] In this manufacturing enterprise scenario, the user's natural language question is processed by a large language model in the financial and tax domain to generate a structured query statement (SQL). To accurately retrieve data from the enterprise's financial and tax business database, this SQL statement needs to be input into a set of intermediate adaptation layer components. The intermediate adaptation layer uses semantic mapping rules and retrieval indexes to map the logical table names and field names in the SQL to the actual table names and field names in the database, determine the access path, establish a connection with the database, execute the query, and finally obtain the structured raw numerical results.

[0079] Step S131: Parse the structured query statement or parameterized application programming interface call instruction to obtain the target table identifier, target field identifier, and query condition content information contained therein. Standardize the obtained information to make its expression consistent with the expression in the semantic mapping document.

[0080] Parse the generated SQL statement "SELECTSUM(FIELD_YINGZHENG_XIAOSHOU_E)ASTOTAL_YINGZHENG_XIAOSHOU_EFROMTB_ZENGZHI_SHUI _SHENBAOWHEREFIELD_QIYE_XINYONGDAIMA='91310XXXXXXXXXX'ANDFIELD_SHENBAO_QIBETWEEN'2023-07-01'AND' The query query, "2023-09-30", retrieves the target table identifier as "TB_ZENGZHI_SHUI_SHENBAO", the target field identifier as "FIELD_YINGZHENG_XIAOSHOU_E", and the query conditions as "FIELD_QIYE_XINYONGDAIMA='91310XXXXXXXXXX'" and "FIELD_SHENBAO_QIBETWEEN'2023-07-01'AND'2023-09-30'". This information is then standardized. For example, the capitalization of the target table identifier is checked to ensure consistency with the semantic mapping document (the semantic mapping document uses uppercase for table identifiers; lowercase entries in the SQL are converted to uppercase). The date format in the query conditions is also checked to ensure it conforms to the semantic mapping document's requirements for date fields (e.g., uniformly using the "YYYY-MM-DD" format). After processing, the information is completely consistent with the semantic mapping document.

[0081] Step S132: Retrieve the semantic mapping retrieval index from the intermediate adaptation layer component set, use the standardized core elements as retrieval keywords, perform a matching query in the semantic mapping retrieval index, and find the corresponding semantic mapping document location.

[0082] The semantic mapping retrieval index (stored at " / indexes / semantic_mapping_index") is retrieved from the intermediate adaptation layer component set. The standardized core elements "TB_ZENGZHI_SHUI_SHENBAO" (target table identifier) ​​and "FIELD_YINGZHENG_XIAOSHOU_E" (target field identifier) ​​are used as search keywords. A matching query is executed in the retrieval index. Since the retrieval index uses an inverted index structure, the keyword "TB_ZENGZHI_SHUI_SHENBAO" corresponds to the table description module node path " / SemanticMapping / Database / Table[@name='TB_ZENGZHI_SHUI_SHENBAO']" in the semantic mapping document, and the keyword "FIELD_YINGZHENG_XIAOSHOU_E" corresponds to the field explanation module node path " / SemanticMapping / Database / Table[@name='TB_ZENGZHI_SHUI_SHENBAO'] / Field[@name='FIELD_YINGZHENG_XIAOSHOU_E']". By matching, the semantic mapping document locations corresponding to these keywords are found.

[0083] Step S133: Obtain the corresponding semantic mapping document through the semantic mapping document location, parse the semantic mapping document content in combination with the semantic mapping rules, and determine the actual correspondence of the core elements in the financial and tax business database. The actual correspondence includes the actual table name corresponding to the target table identifier, the actual field name corresponding to the target field identifier, and the database filtering logic corresponding to the query condition content.

[0084] By finding the semantic mapping document location, obtain the complete semantic mapping document (XML format). Combine the metadata mapping rules in the semantic mapping rules to parse the document content. For the target table identifier "TB_ZENGZHI_SHUI_SHENBAO", in the document's table description module, its corresponding actual table name (physical table name in the database) is "t_zengzhi_shui_shenbao_2023" (the company adds a year suffix to the physical table name for easier data management); the target field identifier "FIELD_YINGZHENG_XIAOSHOU_E" in the field explanation module corresponds to the actual field name "c_yingzheng_xiaoshou_e" (the database uses a lowercase letter and underscore naming convention). The actual field name corresponding to "FIELD_QIYE_XINYONGDAIMA" in the query condition is "c_qiye_xinyongdaima", and the actual field name corresponding to "FIELD_SHENBAO_QI" is "d_shenbao_qi". Therefore, the database filtering logic corresponding to the query condition is "c_qiye_xinyongdaima='91310XXXXXXXXXX'ANDd_shenbao_qiBETWEEN'2023-07-01'AND'2023-09-30'".

[0085] Step S134: Based on the actual correspondence obtained from parsing, generate an access path that can be identified by the financial and tax business database. The access path includes a database identifier, a table path, a field path, and a query logic path. The access path is used to point to the target data in the database.

[0086] Based on the actual correspondence obtained from the parsing, a database-recognizable access path is generated. The database identifier is "DB_CAI_SHUI_001" (the unique identifier of the enterprise's financial and tax business database); the table path is "DB_CAI_SHUI_001.dbo.t_zengzhi_shui_shenbao_2023" (where "dbo" is the database schema name); the field path is "c_yingzheng_xiaoshou_e"; and the query logic path is "c_qiye_xinyongdaima='91310XXXXXXXXXX'ANDd_shenbao_qiBETWEEN'2023-07-01'AND'2023-09-30'". These paths are integrated to form a complete access path, which accurately points to the enterprise's taxable VAT sales data for the third quarter of 2023 stored in the database.

[0087] Step S135: Establish a data interaction link, which includes three stages: connection establishment, data transmission, and result reception. First, a connection request is sent to the financial and tax business database. After the financial and tax business database responds and confirms the connection, a query request containing the access path is transmitted to the financial and tax business database.

[0088] A data interaction link is established to enable data transmission between the intermediate adaptation layer and the financial and tax business database. This data interaction link consists of three stages: connection establishment, data transmission, and result reception.

[0089] Step S1351: Determine the format composition of the connection request, including the request identifier, request time, target database identifier, and authentication information, and process the authentication information using an encryption algorithm.

[0090] The connection request format is determined as follows: the request identifier is a randomly generated UUID (e.g., "a1b2c3d4-e5f6-7890-abcd-1234567890ab"), used to uniquely identify this connection request; the request time is the current system time (e.g., "2023-10-27 15:31:20"); the target database identifier is "DB_CAI_SHUI_001"; the authentication information includes the username ("cai_shui_query_user") and password ("********"). The authentication information is processed using the AES-256 encryption algorithm, concatenating the username and password and encrypting them to generate an encrypted string as the value of the authentication field.

[0091] Step S1352: Generate a connection request according to the format, send the connection request to the financial and tax business database through the preset communication port, and record the sending time and request content.

[0092] A connection request is generated according to the above format. The request format is JSON, for example: {"requestId":"a1b2c3d4-e5f6-7890-abcd-1234567890ab","requestTime":"2023-10-27 15:31:20","targetDbId":"DB_CAI_SHUI_001","authInfo":"encrypted string"}. The connection request is sent to the IP address of the financial and tax business database server (e.g., "192.168.1.100") through a preset communication port (e.g., TCP port 3306, the default MySQL port). Simultaneously, the sending time "2023-10-27 15:31:20" and the request content (anonymized JSON) are recorded in the local log file.

[0093] Step S1353: After receiving the connection request, the financial and tax business database decrypts and verifies the authentication information in the connection request to confirm the legitimacy of the request initiator. If the verification is successful, a connection confirmation response is returned; if the verification fails, a verification error response is returned and the reason for the error is recorded.

[0094] After receiving a connection request, the financial and tax business database (MySQL database) extracts the "authInfo" field and decrypts it using a pre-shared AES key to obtain the original username and password. The database then compares the decrypted username and password with its stored user table to check if the username exists, if the password is correct, and if the user has permission to query the "t_zengzhi_shui_shenbao_2023" table. If the verification succeeds (username exists, password is correct, and permissions are allowed), a connection confirmation response is returned, containing a connection identifier (e.g., "conn_id_12345") and a connection validity period (e.g., 30 minutes). If the verification fails (e.g., incorrect password), a verification error response is returned with the error message "Authentication failed: Incorrect password," and this error is logged in the database's security log.

[0095] Step S1354: Receive the response information returned by the financial and tax business database. If it is a connection confirmation response, record the connection establishment time and connection identifier to complete the connection establishment process. If it is a verification error response, adjust the authentication information according to the error reason, regenerate the connection request and send it until the connection is successfully established.

[0096] The middleware layer receives the response information from the financial and tax business database. If the response is a connection confirmation response (containing "connectionStatus": "success"), it records the connection establishment time "2023-10-27 15:31:22" and the connection identifier "conn_id_12345", completing the connection establishment process. If the response is a verification error response, such as "incorrect password", the middleware layer prompts the administrator to check the username and password. After the administrator corrects the password, the middleware layer regenerates a connection request containing the correct authentication information and sends it until the connection is successfully established.

[0097] Step S1355: Determine the encapsulated components of the query request, including connection identifier, query identifier, access path, query time, and data format requirements. Convert the access path according to the syntax format recognizable by the financial and tax business database. The access path is used to be correctly parsed.

[0098] The encapsulation composition of the query request is determined. The connection identifier is "conn_id_12345" (from the connection confirmation response); the query identifier is the newly generated UUID ("e6f7g8h9-i0j1-2345-klmn-67890abcdefg"); the access path is the database-recognizable access path generated in step S134, which needs to be converted into a MySQL executable SQL statement, i.e., the SQL after replacing the actual table name and field name: "SELECT SUM(c_yingzheng_xiaoshou_e)ASTOTAL_Y The query result is: INGZHENG_XIAOSHOU_EFROMdbo.t_zengzhi_shui_shenbao_2023WHEREc_qiye_xinyongdaima='91310XXXXXXXXXX'ANDd_shenbao_qiBETWEEN'2023-07-01'AND'2023-09-30'”; the query time is the current system time ("2023-10-27 15:31:25"); the data format must be JSON, including field names and data values.

[0099] Step S1356: Process the query request according to its encapsulated components and add a data validation field. The data validation field is used to verify the integrity of the query request after the financial and tax business database receives it.

[0100] The query request is processed according to its encapsulated components, generating a JSON-formatted query request object, for example: {"connectionId":"conn_id_12345","queryId":"e6f7g8h9-i0j1-2345-klmn-67890abcdefg","sqlQuery":"SELECTSUM(c_yingzheng_xiaoshou_e)ASTOTAL_YINGZHENG_XIAOSHOU_EFROMdbo.t_zengzhi_shui_shenbao_2023WHEREc_qiye_xinyongdaima='91310XXXXXXXXXX'ANDd_shenbao_qiBETWEEN'2023-07-01'AND'2023-09-30'","queryTime":"2023-10-2715:31:25","dataFormat":"JSON"}. Add a data validation field, use the MD5 hash algorithm to calculate the hash value of the query request object (all content except the validation field), and add the hash value as the "checksum" field to the query request object.

[0101] Step S1357: Transmit the processed query request to the financial and tax business database through the established connection link. During the transmission process, monitor the data transmission rate and transmission status in real time. If the transmission is interrupted, re-initiate the transmission request and resume data transmission based on the breakpoint resume mechanism.

[0102] The processed query request (including data validation fields) is transmitted to the financial and tax business database via the established TCP connection. During transmission, the network monitoring module of the intermediate adaptation layer monitors the data transmission rate (e.g., current transmission rate of 100KB / s) and transmission status (e.g., "Transmitting", "Completed", "Interrupted") in real time. If transmission is interrupted due to network fluctuations (transmission status changes to "Interrupted"), the intermediate adaptation layer waits 5 seconds and then re-initiates the transmission request. Based on the breakpoint resumption mechanism, it only transmits the data that was not successfully sent, thereby improving transmission efficiency.

[0103] Step S1358: After receiving the query request, the financial and tax business database verifies the integrity of the query request through the data validation field. If the verification passes, it parses the access path and data format requirements in the query request; if the verification fails, it returns a data error response. The request initiator receives the error response, repackages it, and sends the query request again.

[0104] After receiving a query request, the financial and tax business database extracts the "checksum" field and other field contents. It then calculates the hash value of the other field contents using the same MD5 algorithm and compares it with the value of the "checksum" field. If they match, the query request is verified as complete; otherwise, it is determined that the request was corrupted during transmission, and a data error response is returned, stating the error as "the query request is incomplete or has been tampered with." Upon receiving the error response, the intermediate adaptation layer repackages the query request (generating a new query identifier and verification field) and sends it back.

[0105] Step S1359: When the financial and tax business database has completed parsing and processing the query request and is ready to return the query results, maintain the connection link continuously and monitor the response status of the financial and tax business database in real time to receive the returned structured raw numerical results in a timely manner.

[0106] After verifying the integrity of the query request, the financial and tax business database parses the SQL statement and executes the query operation. During the database query execution, the middleware layer maintains a continuous connection and does not actively disconnect. Simultaneously, it monitors the response status of the financial and tax business database in real time (by periodically sending heartbeat packets to confirm connection activity) and waits for the database to return the query results so as to receive the structured raw numerical results promptly.

[0107] Step S136: After receiving the query request, the financial and tax business database locates the target data storage location according to the access path, performs data filtering, statistics or extraction operations according to the query logic path, and obtains data that meets the query request requirements from the financial and tax data stored in the database.

[0108] After receiving and parsing the SQL statement in the query request, the financial and tax business database locates the target data storage location (the physical storage file path of the table in the database) according to the table path "dbo.t_zengzhi_shui_shenbao_2023" in the access path. Based on the query logical path "c_qiye_xinyongdaima='91310XXXXXXXXXX'ANDd_shenbao_qiBETWEEN'2023-07-01'AND'2023-09-30'", a data filtering operation is performed to filter out records that meet the conditions (i.e., the company's VAT declaration records for the third quarter of 2023). Then, a SUM statistical operation is performed on the "c_yingzheng_xiaoshou_e" field in the filtered records to calculate the sum of this field, obtaining the total VAT sales amount that meets the query request requirements.

[0109] Step S137: Perform structured processing on the acquired data, and organize the data content according to a preset data structure format, wherein the data structure format includes field name, data value, data unit, and data timestamp.

[0110] The obtained SUM statistical results are processed into a structured data structure. The default data structure format is JSON, which includes field names ("TOTAL_YINGZHENG_XIAOSHOU_E"), data values ​​(the total sales amount obtained from the statistics, such as a specific numerical value), data units ("yuan"), and data timestamps (the time the query was completed, such as "2023-10-27 15:31:30"). An example of the processed structured data is: {"fieldName":"TOTAL_YINGZHENG_XIAOSHOU_E","dataValue": a specific numerical value,"dataUnit":"yuan","dataTimestamp":"2023-10-27 15:31:30"}.

[0111] Step S138: The structured data is used as the structured raw numerical result and returned to the intermediate adaptation layer component set through the data interaction link. After receiving the result, the intermediate adaptation layer component set confirms that the data fields in the result are consistent with the target fields in the query request, and that there is no missing or incorrect data, thus completing the data query operation.

[0112] The structured data described above is used as the original structured numerical result and returned to the intermediate adaptation layer component set through the result receiving stage of the data interaction link. After receiving the result, the intermediate adaptation layer checks whether the field name "TOTAL_YINGZHENG_XIAOSHOU_E" in the result corresponds to the target field (taxable VAT sales amount) in the query request, whether the data value is a reasonable numerical type, whether the data unit is correct (should be "yuan"), and whether the data timestamp is within a reasonable range (close to the query execution time). If, after confirmation, no data is missing or incorrect, the data query operation is completed.

[0113] Step S140: Call the large language model in the financial and tax field, and parse the structured raw numerical results based on the preset financial and tax business scenario template to generate preliminary interpretation results containing natural language descriptions, visual configuration information and risk identification indicators.

[0114] In this manufacturing enterprise scenario, structured raw data on taxable sales revenue for the third quarter of 2023 has been obtained. To provide users with an easily understandable interpretation, a large language model in the financial and tax domain needs to be invoked, combined with a pre-set financial and tax business scenario template (such as a "Value-Added Tax Sales Revenue Query and Interpretation Template"), to parse the results. The parsing process includes converting the numerical results into natural language descriptions, generating chart configuration information, identifying potential tax risks, and ultimately forming a preliminary interpretation result.

[0115] Step S141: Collect typical business scenarios in financial and tax processing for enterprises of different industries and sizes, record the business objectives, data requirements, key points of interpretation and output format of each typical business scenario, and create a financial and tax business scenario template library based on the recorded content. The financial and tax business scenario template library contains templates corresponding to different business scenarios. Each template contains a scenario feature description, key points of interpretation and output content structure.

[0116] This project collects typical business scenarios in financial and tax processing from enterprises of different industries (such as manufacturing, service, and retail) and sizes (small and micro enterprises, medium-sized enterprises, and large enterprises). For example, typical business scenarios for medium-sized manufacturing enterprises include "monthly VAT declaration data self-check," "quarterly income tax prepayment calculation," and "annual R&D expense deduction declaration." It records the business objectives (e.g., the objective of "monthly VAT declaration data self-check" is to ensure the accuracy of declaration data and avoid tax risks caused by declaration errors), data requirements (e.g., needing sales revenue, input tax, and output tax data), key interpretation points (e.g., whether the data is within a reasonable fluctuation range, and whether there are any anomalies compared with previous data), and output formats (e.g., text descriptions, line graphs, and risk warning boxes). Based on these records, a financial and tax business scenario template library is created, with each template being an XML file. Taking the "Value-Added Tax Sales Amount Inquiry and Interpretation Template" as an example, the scenario is described as "enterprises inquire about the value-added tax sales amount payable during a specific period to understand the sales scale and tax base"; the key interpretation directions are "explanation of sales amount values, comparative analysis with the previous / same period, and whether there are any abnormal fluctuations"; the output content structure includes three parts: "natural language description", "visual configuration" and "risk identification mark", each of which defines specific content elements and format requirements.

[0117] Step S142: Retrieve templates that match the user's problem intent category from the financial and tax business scenario template library, and analyze the scenario feature descriptions and key interpretation directions in the templates.

[0118] Based on the user's intent category "Data Query" and the key entities "Taxable Sales Amount" and "Third Quarter of 2023," a matching template was retrieved from the financial and tax business scenario template library. By comparing the intent category and entity information, the "Taxable Sales Amount Query Interpretation Template" was identified as the matching template and retrieved from the template library. Analyzing the template's scenario description—"Enterprises query taxable sales amount for a specific period to understand sales volume and tax base"—confirmed its consistency with the user's business scenario. The key interpretation areas were "Explanation of sales amount figures, comparison with the previous / same period, and whether there are any abnormal fluctuations," clarifying the core content to be covered during the interpretation.

[0119] Step S143: Input the structured raw numerical results into the financial and tax domain big language model, and use the financial and tax domain big language model in combination with the retrieved scenario template to interpret the meaning of the structured raw numerical results, explaining the business meaning, data source and role of each data field in the current scenario.

[0120] The structured raw numerical results (such as {"fieldName":"TOTAL_YINGZHENG_XIAOSHOU_E", "dataValue": a certain value, "dataUnit":"yuan", "dataTimestamp":"2023-10-2715:31:30"}) are input into the financial and tax domain big data model. The model, combined with the retrieved "Value-Added Tax Sales Amount Query Interpretation Template", interprets the meaning of the data fields. For example, the "TOTAL_YINGZHENG_XIAOSHOU_E" field can be interpreted as "the total sales of goods and taxable services subject to VAT incurred by your company in the third quarter of 2023 (July 1, 2023 to September 30, 2023)"; the data source is "the 't_zengzhi_shui_shenbao_2023' table in the enterprise's financial and tax business database, obtained by summing the data of the 'c_yingzheng_xiaoshou_e' field within the specified reporting period"; and its role in the current scenario is "this data is the basis for calculating the VAT payable in the third quarter, and is also one of the key indicators for determining whether an enterprise meets the condition of 'monthly sales of less than 100,000 yuan' in the text of the VAT preferential rules for small and micro enterprises".

[0121] Step S144: Analyze the structured raw numerical results based on the key interpretation direction. If the key interpretation of the scenario template is data comparison, perform correlation analysis between the structured raw numerical results and historical data of the same period and industry average data to describe the data change trend or differences. If the key interpretation is compliance verification, analyze whether the structured raw numerical results meet the financial and tax business norms requirements under the current scenario.

[0122] The template-based interpretation focuses on "sales revenue figures, comparison with the previous / same period, and whether there are any abnormal fluctuations," analyzing the structured raw data results. First, the sales revenue figures are explained, directly presenting the specific value (in yuan) of the taxable VAT sales revenue for the third quarter. Next, a comparison analysis is performed with the data from the previous period (Q2 2023) and the same period (Q3 2022). The financial and tax domain's large language model queries historical data through an intermediate adaptation layer (the process is the same as steps S130-S138), obtaining the sales revenue for Q2 as a certain value and the sales revenue for Q3 2022 as a certain value. The quarter-on-quarter growth rate ((current period value - previous period value) / previous period value) and the year-on-year growth rate ((current period value - same period value) / same period value) are calculated. If the quarter-on-quarter growth rate is 5% and the year-on-year growth rate is 8%, then the data trend is described as "the taxable VAT sales revenue in Q3 2023 increased by 5% compared to the previous quarter and by 8% compared to the same period last year, showing an overall stable growth trend." Analyze whether there are abnormal fluctuations. If the growth rate is within the company's historical average fluctuation range (e.g., ±10%), it is determined that there are no abnormal fluctuations; if it exceeds the range, it indicates that there may be an anomaly.

[0123] Step S145: Transform the interpretation and analysis of the data into natural language descriptions, organize the language according to the output content structure, and generate visualization results. The visualization results are used to present data characteristics. Specifically, a matching visualization form is selected according to the data type and analysis content. If it is a data change trend, a time series visualization configuration is constructed; if it is a data proportion, a proportion visualization configuration is constructed. The visualization configuration information includes data association method, display dimension, and style settings.

[0124] The data interpretation and analysis are transformed into natural language descriptions, and the language is organized according to the template output content structure. For example: "Your company's taxable sales amount for the third quarter of 2023 (July 1, 2023 to September 30, 2023) is a certain value. This data comes from the VAT declaration form and is the basis for calculating the VAT payable. Compared with the second quarter of 2023, sales increased by 5% quarter-on-quarter; compared with the third quarter of 2022, sales increased by 8% year-on-year. The overall sales scale shows a steady growth trend without abnormal fluctuations." A visualization result is generated. Since the analysis content includes data change trends (quarter-on-quarter and year-on-year growth), a time-series visualization format (line chart) is selected. The visualization configuration information is as follows: the data association method is "time-sales amount", that is, the X-axis is time (third quarter of 2022, second quarter of 2023, and third quarter of 2023), and the Y-axis is sales amount (unit: yuan); the display dimension is "quarterly sales amount trend"; the style settings include the line color being blue, the data point markers being circles, the chart title being "Quarterly Trend Chart of Sales Amount Subject to Value Added Tax", and the axis label font size being 12.

[0125] Step S146: Perform risk identification on the structured raw numerical results. Combine the risk judgment logic in the scenario template to analyze whether there are any abnormalities in the structured raw numerical results. If there are abnormalities, add corresponding risk identification tags. The identification content of the risk identification tags includes the risk type, the data fields involved, and the risk manifestation form.

[0126] Risk identification was performed on the structured raw numerical results. The risk judgment logic in the "VAT Sales Revenue Query and Interpretation Template" includes: abnormally high or low sales revenue compared to previous periods (fluctuation exceeding 20%), zero sales revenue but existing input tax (potential risk of false input tax credit), and sales revenue not matching the company's actual production and operating capacity (e.g., a production capacity of 10 million but a declared sales revenue of 20 million). The analysis showed a month-on-month growth rate of 5% and a year-on-year growth rate of 8%, both within the normal fluctuation range (not exceeding 20%). Furthermore, by querying the input tax data for the same period, it was confirmed that sales revenue was not zero and the ratio of input tax to sales revenue was reasonable. In addition, the company's current production capacity was a certain value, and the declared sales revenue did not exceed the production capacity range. Therefore, no abnormalities were found, and no risk identification marker was added. If any anomalies are found, such as a 30% quarter-on-quarter increase in sales (exceeding 20%), a risk identification label will be added. The label will be: Risk type "Abnormal fluctuation risk in sales", involving the data field "Sales subject to VAT", and the risk manifestation is "Sales in the third quarter of 2023 increased by 30% compared to the previous quarter, which exceeds the normal fluctuation range (±20%), and there may be cases of failure to recognize revenue in a timely manner or inflated sales".

[0127] Step S147: Organize and encapsulate the natural language description, visual configuration information, and risk identification markers according to the preset output content structure to form preliminary interpretation results.

[0128] The natural language description, visualization configuration information (line chart configuration), and risk identification markers (none) are organized and encapsulated according to the template's preset output content structure. The encapsulation format is JSON, containing three primary fields: "naturalLanguageDescription," "visualizationConfig," and "riskIdentifiers." The value of the "naturalLanguageDescription" field is the aforementioned natural language description text; the value of the "visualizationConfig" field is the visualization configuration information (data association method, display dimensions, style settings, etc.); and the value of the "riskIdentifiers" field is an empty array (because no risk was identified). The encapsulated JSON object represents the preliminary interpretation result.

[0129] Step S150: Collect currently valid financial and tax rule texts to construct a financial and tax rule text retrieval library, calculate the semantic correlation between the preliminary interpretation results and the rule text clauses in the rule text retrieval library, and based on the semantic correlation and closely related rule text content, correct the terminology and logical content in the preliminary interpretation results to form the final financial and tax data intelligent dialogue and query results, and push them to the user interaction interface.

[0130] To ensure that the interpretation results comply with the requirements of the latest tax and financial regulations, it is necessary to correlate the preliminary interpretation results with the currently effective tax and financial regulations. By constructing a tax and financial regulations text retrieval database, the semantic relevance between the preliminary interpretation results and the clauses of the regulations is calculated. Based on the closely related regulations, the preliminary interpretation results are revised to make the terminology more standardized and the logical analysis more in line with the requirements of the regulations, and finally pushed to the user.

[0131] Step S151: Collect currently valid tax and financial rule texts, classify and organize the currently valid tax and financial rule texts, and divide them into different categories according to the applicable fields of the rule texts.

[0132] We collect currently valid tax and financial rules texts, sourced from authoritative announcements, regulations and interpretations, and implementing rules issued by authoritative institutions. These texts are categorized and organized according to their applicable areas, such as Value Added Tax (VAT), Corporate Income Tax, Individual Income Tax, Tax Incentives, and Tax Collection and Administration. For example, relevant notice A is categorized under Tax Incentives, and relevant notice B under VAT. Within each category, the texts are arranged in reverse chronological order of publication date for easy access to the latest rules.

[0133] Step S152: Decompose the classified rule text into content, extract the rule text clauses, and perform semantic encoding on the rule text clauses to transform the clause content into computable semantic features. Each rule text clause includes a clause theme, core content, scope of application, and execution requirements.

[0134] The categorized rule texts are broken down into their content. Taking a certain announcement rule text as an example, the decomposed rule text clauses include "From January 1, 2023 to December 31, 2023, value-added tax (VAT) is exempted for small-scale VAT taxpayers with monthly sales of 100,000 yuan or less (inclusive)" and "VAT is levied at a reduced rate of 1% on taxable sales revenue applicable to small-scale VAT taxpayers at a 3% tax rate." Each rule text clause includes the clause theme (e.g., "VAT is exempted for small-scale taxpayers with monthly sales of 100,000 yuan or less"), core content (e.g., "VAT is exempted for monthly sales of 100,000 yuan or less"), scope of application (e.g., "VAT is applicable to small-scale VAT taxpayers from January 1, 2023 to December 31, 2023"), and implementation requirements (e.g., "Monthly sales must be accurately calculated, and tax declarations must be made as required"). The rule text clauses are semantically encoded. The Word2Vec model is used to transform the clause text into a fixed-dimensional semantic feature vector (e.g., 300-dimensional). Each dimension in the vector represents a semantic feature component, which is used to calculate the degree of semantic association in subsequent calculations.

[0135] Step S153: Store the semantically encoded rule text clauses according to categories, establish index rules for the retrieval database, and realize subsequent retrieval through the index rules to form a currently valid financial and tax rule text retrieval database. The index rules include clause subject index, scope of application index, and core content keyword index.

[0136] The semantically encoded rule text clauses are stored in a rule text retrieval database according to categories such as value-added tax (VAT) and corporate income tax. The database uses Elasticsearch for efficient retrieval. Indexing rules are established for the retrieval database, including: Clause Topic Index: Clause topics are segmented into words and an inverted index is created. For example, "Small-scale taxpayers with monthly sales below 100,000 RMB are exempt from VAT" is segmented into "small-scale taxpayers," "monthly sales," "below 100,000 RMB," and "exempt from VAT," with each word mapping to a corresponding clause; Scope of Application Index: "Taxpayer type" (e.g., small-scale taxpayers), "Time range" (e.g., January 1, 2023 to December 31, 2023), and "Industry" (e.g., all industries, specific industries) are used as index fields; Core Content Keyword Index: Keywords (e.g., "exempt from VAT," "reduced to 1% tax rate") are extracted from the core content and indexed. Through these indexing rules, relevant rule text clauses can be quickly retrieved by topic, scope of application, or keywords, forming a currently valid financial and tax rule text retrieval database.

[0137] Step S154: Extract the key content from the preliminary interpretation results, perform semantic encoding on the key content, and generate interpretation semantic features consistent with the semantic encoding format of the rule text clauses. The key content includes terminology, logical analysis basis, and conclusions.

[0138] Key content was extracted from the preliminary interpretation results. Terminology included "taxable sales revenue," "text of VAT preferential rules for micro and small enterprises," and "monthly sales revenue below 100,000 yuan." The logical basis for the analysis was that "this data is one of the key indicators for determining whether an enterprise meets the condition of 'monthly sales revenue below 100,000 yuan' in the text of VAT preferential rules for micro and small enterprises." The conclusion was that "the taxable sales revenue in the third quarter of 2023 was a certain value, showing a stable growth trend overall." Semantic encoding was performed on the above key content using the same Word2Vec model as the rule text clauses. The key content text was transformed into a 300-dimensional semantic feature vector, ensuring consistency with the semantic feature vector format of the rule text clauses for semantic relevance calculation.

[0139] Step S155: Set a semantic relevance calculation method, and calculate the degree of overlap and relevance based on the semantic features of the interpretation and the semantic features of the rule text clauses. The degree of overlap is used to reflect the consistency between the two in terms of terminology, and the degree of relevance is used to reflect the degree of matching between the two in business logic. The semantic relevance value is obtained by combining the degree of overlap and the degree of relevance.

[0140] The semantic relevance calculation method is defined as follows: First, the overlap is calculated by taking the cosine similarity of the corresponding dimensions of the same terms in the semantic feature vector of the interpretation and the semantic feature vector of the rule text. The closer the cosine similarity is to 1, the higher the overlap of the terms. For example, if the terms "small and micro enterprise VAT preferential rule text" and "monthly sales of less than 100,000 yuan" in the preliminary interpretation result are completely consistent with the terms in a rule text, then the overlap is high. Next, the relevance is calculated by analyzing the degree of matching between the interpretation logic and the execution requirements of the rule text. For example, if the interpretation mentions "determining whether the condition of monthly sales of less than 100,000 yuan is met," and the core content of the rule text is "monthly sales of less than 100,000 yuan are exempt from VAT," then the relevance is high. The relevance is achieved by training a classification model (such as SVM). The input is the text pair of the interpretation logic and the execution requirements of the rule text, and the output is a relevance value between 0 and 1. Finally, the semantic relevance value is calculated as the overlap multiplied by 0.4 plus the relevance multiplied by 0.6 (weights are set according to importance), with a value range of 0-1. A larger value indicates a higher degree of relevance.

[0141] Step S156: Input the semantic features of the preliminary interpretation results into the tax and finance rule text retrieval database, and use index rules to match rule text clauses whose semantic relevance values ​​meet the preset threshold to determine the rule text content that is closely related to the preliminary interpretation results.

[0142] The semantic feature vectors from the preliminary interpretation results are input into the tax and finance rule text retrieval database. Rule text clauses applicable to "manufacturing," "medium-sized enterprises" (or "micro-enterprises," depending on the actual size of the enterprise), and "2023" are selected using the scope of application index. For the selected clauses, the semantic correlation between their semantic feature vectors and the interpretation semantic feature vectors is calculated, with a preset threshold of 0.7. If a rule text clause (such as the clause regarding VAT reduction for micro-enterprises in Announcement No. 1 of 2023) has a semantic correlation value of 0.85 (higher than 0.7), it is considered a closely related rule text. The specific content of this rule text clause is determined as follows: "From January 1, 2023 to December 31, 2023, VAT is exempted for small-scale VAT taxpayers with monthly sales of 100,000 yuan or less (inclusive). For taxable sales revenue subject to a 3% tax rate for small-scale VAT taxpayers, VAT is levied at a reduced rate of 1%."

[0143] Step S157: Based on the closely related rule text content, revise the preliminary interpretation results. If the terminology in the preliminary interpretation results is inconsistent with the standard terminology in the rule text, revise it according to the terminology in the rule text. If the logical analysis basis in the preliminary interpretation results is inconsistent with the execution requirements in the rule text, adjust the analysis logic to make it conform to the rule text. If the conclusions in the preliminary interpretation results do not cover the preferential or compliance requirements in the rule text, supplement the corresponding content to form the final intelligent dialogue and query results for financial and tax data.

[0144] The preliminary interpretation results were revised based on the closely related rule text content. The terminology was checked; the phrase "rule text for VAT preferential treatment for micro and small enterprises" in the preliminary interpretation results is accurate and consistent with the rule text clauses, requiring no correction. If the preliminary interpretation results used "small-scale enterprise," it needs to be corrected to the standard term "small-scale taxpayer" in the rule text clauses. The logical analysis was checked; the preliminary interpretation results mentioned "determining whether the enterprise meets the condition of 'monthly sales below 100,000 yuan' in the rule text for VAT preferential treatment for micro and small enterprises," while the rule text clauses clearly state that this preferential treatment applies to "small-scale VAT taxpayers." Therefore, the analysis logic needs to be adjusted, adding "firstly, it is necessary to confirm whether the enterprise is a small-scale VAT taxpayer; if it is, then determine whether the monthly sales are below 100,000 yuan." The initial interpretation of the inspection conclusion did not mention the preferential treatment details in the rule text and needs to be supplemented: "According to relevant announcements, if your company is a small-scale VAT taxpayer and its monthly sales in each month of the third quarter of 2023 are all below 100,000 yuan, it can enjoy the VAT exemption rule text; if the monthly sales exceed 100,000 yuan, the taxable sales revenue subject to the 3% tax rate can be reduced to a 1% tax rate for VAT payment." The revised interpretation result will be the final result of the intelligent dialogue and query of financial and tax data.

[0145] Step S158: Establish a result push channel to convert the final financial and tax data intelligent dialogue and query results into a format supported by the user interface. The user interface is used to display natural language descriptions, visual content, and risk identification indicators. The result push channel supports the synchronous transmission of text and visual information.

[0146] A results push channel is established, with the user interface being a web page of the enterprise's internal financial and tax management system. This interface supports displaying text, images (visual charts), and risk warning indicators (red exclamation mark icons + text descriptions). The final financial and tax data intelligent dialogue and query results (JSON format) are converted to a format supported by the user interface; natural language descriptions are converted to HTML text (supporting paragraphs, bolding, etc.); visualization configuration information is converted to Chart.js chart configuration objects for generating line charts on the web page; risk identification indicators (none) require no special conversion. The results push channel is built on the WebSocket protocol, supporting the synchronous transmission of text and visualization information (chart configuration data), ensuring users can see both text descriptions and charts simultaneously.

[0147] Step S159: Transmit the final financial and tax data intelligent dialogue and query results to the user interaction interface through the result push channel to complete the result push, and record the push time and result content at the same time.

[0148] The final financial and tax data, after conversion, is intelligently communicated and the query results are transmitted to the user interface (the web page the user is currently logged into) via a WebSocket result push channel. Upon receiving the results, the user interface parses the HTML text and displays a natural language description, parses the Chart.js configuration object and renders a line chart, thus completing the result display. Simultaneously, the intermediate adaptation layer records the push time "2023-10-27 15:35:10" and the result content (anonymized JSON) in the system log for subsequent auditing and traceability.

[0149] The entire process described above involves multiple stages, including handling user natural language issues, interacting with the database, and associating rule texts. For potentially privacy-sensitive data (such as enterprise credit codes and specific sales figures), encryption algorithms (such as AES-256) are used for encryption during data transmission. Sensitive fields are anonymized during storage (e.g., partial masking). During access, strict authentication and access control (such as role-based access control, RBAC) ensure that only authorized personnel can view the data, thereby achieving privacy protection and preventing data leakage.

[0150] In one exemplary embodiment, a large language model-based intelligent dialogue and query system for financial and tax data is provided. This system can be a terminal, server, etc., and its internal structure diagram can be as follows: Figure 2 As shown, this intelligent dialogue and query system for financial and tax data based on a large language model includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, near-field communication, or other technologies. When the computer program is executed by the processor, it implements an intelligent dialogue and query method for financial and tax data based on a large language model. The display unit is used to form a visually visible screen and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device can be a touch layer covering the display screen, or a button, trackball, or touchpad set on the shell of the intelligent dialogue and query system for financial and tax data based on a large language model. It can also be an external keyboard, touchpad, or mouse, etc.

[0151] It should be noted that, in order to simplify the description of the present invention and thus help to understand one or more embodiments of the invention, multiple features may sometimes be grouped into one embodiment, drawing or description thereof in the foregoing description of the embodiments of the present invention.

Claims

1. A smart dialogue and query system for financial and tax data based on a large language model, characterized in that, include: processor; A machine-readable storage medium for storing machine-executable instructions of the processor; The processor is configured to perform the following steps by executing the machine-executable instructions: Construct an intermediate adaptation layer connecting the large language model and the financial and tax business database, create a structured semantic mapping template, transform the tables, fields and relationships between tables in the financial and tax business database into a semantic association form that the large language model can recognize, generate semantic mapping rules and retrieval indexes, and integrate them to form a set of intermediate adaptation layer components. The large language model is trained specifically for the financial and tax domain to generate a large language model for the financial and tax domain. It receives natural language questions in the financial and tax domain transmitted by users, calls the large language model for the financial and tax domain to perform intent classification, entity recognition and query condition parsing on the natural language questions in the financial and tax domain, and outputs standardized structured query statements or parameterized application programming interface call instructions. The structured query statement or parameterized application programming interface call instruction is input into the intermediate adaptation layer component set. The semantic mapping rules in the intermediate adaptation layer component set are used to match the database access path with the retrieval index, establish a data interaction link with the financial and tax business database, execute data query operations, and obtain the structured raw numerical results returned by the financial and tax business database. The system invokes a large language model in the field of finance and taxation, and parses the structured raw numerical results based on a preset financial and taxation business scenario template to generate preliminary interpretation results containing natural language descriptions, visualized configuration information, and risk identification indicators. Collect currently valid tax and financial rules texts to construct a tax and financial rules text retrieval library. Calculate the semantic correlation between the preliminary interpretation results and the rule text clauses in the rule text retrieval library. Based on the semantic correlation and closely related rule text content, revise the terminology and logical content in the preliminary interpretation results to form the final intelligent dialogue and query results for tax and financial data, and push them to the user interface.

2. The intelligent dialogue and query system for financial and tax data based on a large language model as described in claim 1, characterized in that, The process involves constructing an intermediate adaptation layer connecting the large language model and the financial and tax business database. This layer creates a structured semantic mapping template, transforming tables, fields, and relationships between tables in the financial and tax business database into semantic associations recognizable by the large language model. Semantic mapping rules and retrieval indexes are generated and integrated to form a set of intermediate adaptation layer components, including: Determine the core functional requirements of the intermediate adaptation layer, which include data interaction connection, semantic conversion, retrieval matching and component integration, and plan the component interaction process and data flow path of the intermediate adaptation layer. Create a structured semantic mapping template, which includes a database association module, a table description module, a field explanation module, and a relationship definition module. The database association module is used to record the identifier of the adapted financial and tax business database. The table description module is used to fill in the table name and corresponding business purpose. The field explanation module is used to record the field name, data attribute, and semantic meaning. The relationship definition module is used to explain the basis and logic of the association between different tables. Extract metadata information from the financial and tax business database. The metadata information includes table names, field names, field data attributes, field constraint requirements, and inter-table association identifiers. Use a metadata parsing tool to read the metadata information and classify and organize it. The categorized and organized metadata information is filled into the corresponding modules of the structured semantic mapping template one by one. In the database association module, the financial and tax business database identifier is filled in. In the table description module, the table name and business purpose are filled in. In the field explanation module, the field name, data attribute and semantic meaning are filled in. In the relationship definition module, the basis and logic of the association between tables are explained to form a complete semantic mapping document. Based on the table descriptions, field explanations, and relationship definitions in the semantic mapping document, keywords for the business purpose of the table, keywords for the semantic meaning of the fields, and keywords for the association logic are extracted, and each type of keyword is deduplicated and classified. Determine the rules for building the retrieval index, set the index classification rules and association methods according to the classification of key semantic terms, and associate each key semantic term with the corresponding semantic mapping document location to form a semantic mapping retrieval index; Generate semantic mapping rules, which include rules for the correspondence between metadata information and semantic mapping documents, rules for extracting key semantic terms, and rules for updating the retrieval index. When the metadata information changes subsequently, the semantic mapping documents and the retrieval index are adjusted synchronously according to the semantic mapping rules. The structured semantic mapping template, semantic mapping document, semantic mapping retrieval index and semantic mapping rules are integrated to form a set of intermediate adaptation layer components, establish call links between components, and realize data transfer and function call between components through preset interfaces.

3. The intelligent dialogue and query system for financial and tax data based on a large language model according to claim 1, characterized in that, The process involves training a large language model specifically for the tax and finance domain to generate a large language model for the tax and finance domain. This model receives natural language questions in the tax and finance domain transmitted by the user, calls the large language model to perform intent classification, entity recognition, and query condition parsing on the natural language questions, and outputs standardized structured query statements or parameterized application programming interface (API) call instructions, including: Collect training data in the field of finance and taxation, which includes historical financial and tax consultation questions, interpretation texts of financial and tax rules, financial and tax data query cases and corresponding standard processing results. The training data in the financial and tax field is cleaned and labeled. The labeling content includes question intent category, key entity information, query condition elements and standard output format. Question intent category includes data query, rule text interpretation, and risk analysis. Key entity information includes financial and tax subjects, time range, and enterprise identifier. Query condition elements include filtering requirements, sorting requirements, and aggregation requirements. Standard output format includes structured query statement format and parameterized application programming interface call instruction format. The labeled training data is divided into a training set and a validation set. The amount of data is allocated according to a preset ratio. The training set is used to train the large language model. The parameter settings of the large language model are adjusted. Through multiple iterations of training, the large language model learns to recognize the terminology and business logic in the field of finance and taxation. The training large language model is validated using a validation set. The performance of the large language model in terms of intent classification accuracy, entity recognition completeness, and query condition parsing accuracy is analyzed. If the validation results do not meet the preset requirements, training data is supplemented and the large language model is retrained until the performance of the large language model meets the requirements, thus generating a large language model for the financial and tax domain. A user question receiving channel is established, which supports text input and is used to record the natural language questions in the financial and tax field and the input time. The received questions are processed to unify the format. The unified formatted natural language questions in the financial and tax field are input into the financial and tax field big language model. The financial and tax field big language model is called to perform intent classification. The intent category is determined according to the business expression in the unified formatted natural language questions in the financial and tax field. Entity recognition is performed based on intent categories. Key entity information is extracted from the unified formatted natural language questions in the financial and tax field. The extracted key entity information is verified to confirm that the key entity information matches the intent category. Based on the intent category and key entity information, query conditions are parsed to transform the business requirements in the unified formatted natural language questions in the financial and tax field into specific query condition elements. The output format is selected based on the intent category. If it is a data query intent, the query condition elements are organized according to the syntax requirements of a structured query statement to generate a standardized structured query statement. If it is a rule text interpretation intent or a risk analysis intent, the query condition elements and key entity information are integrated into a parameterized application programming interface call instruction, and the parameters in the instruction correspond to the intent requirements. The generated structured query statements or parameterized application programming interface call instructions are logically validated to confirm that the statements or instructions express the business requirements in the user's problem. If there are logical deviations, the process is returned to the financial and tax domain language model for reprocessing until the output of the standardized statements or instructions that meet the requirements is obtained.

4. The intelligent dialogue and query system for financial and tax data based on a large language model according to claim 1, characterized in that, The process involves inputting structured query statements or parameterized application programming interface (API) call instructions into the intermediate adaptation layer component set. Through semantic mapping rules within the intermediate adaptation layer component set, the database access path is matched with the retrieval index. A data interaction link is established with the financial and tax business database, data query operations are executed, and structured raw numerical results returned by the financial and tax business database are obtained, including: Parse the structured query statement or parameterized application programming interface call instruction to obtain the target table identifier, target field identifier, and query condition content information contained therein. Standardize the obtained information to make its expression consistent with the expression in the semantic mapping document. The semantic mapping retrieval index is retrieved from the middle adaptation layer component set. The standardized core elements are used as search keywords. A matching query is performed in the semantic mapping retrieval index to find the corresponding semantic mapping document location. The semantic mapping document is obtained by the semantic mapping document location. The semantic mapping document content is parsed in combination with the semantic mapping rules to determine the actual correspondence of the core elements in the financial and tax business database. The actual correspondence includes the actual table name corresponding to the target table identifier, the actual field name corresponding to the target field identifier, and the database filtering logic corresponding to the query condition content. Based on the actual correspondence obtained from the parsing, an identifiable access path for the financial and tax business database is generated. The access path includes a database identifier, a table path, a field path, and a query logic path. The access path is used to point to the target data in the database. Establish a data interaction link, which includes three stages: connection establishment, data transmission, and result reception. First, a connection request is sent to the financial and tax business database. After the financial and tax business database responds and confirms the connection, a query request containing the access path is transmitted to the financial and tax business database. After receiving a query request, the financial and tax business database locates the target data storage location according to the access path, performs data filtering, statistics or extraction operations according to the query logic path, and retrieves data that meets the query request requirements from the financial and tax data stored in the database. The acquired data is structured and organized according to a preset data structure format, which includes field names, data values, data units, and data timestamps. The structured data is used as the original structured numerical result and returned to the intermediate adaptation layer component set through the data interaction link. After receiving the result, the intermediate adaptation layer component set confirms that the data fields in the result are consistent with the target fields in the query request, and that there is no missing or incorrect data, thus completing the data query operation.

5. The intelligent dialogue and query system for financial and tax data based on a large language model according to claim 1, characterized in that, The process involves calling a large language model in the financial and tax domain, parsing the structured raw numerical results based on a preset financial and tax business scenario template, and generating preliminary interpretation results including natural language descriptions, visualized configuration information, and risk identification markers, including: Collect typical business scenarios in financial and tax processing of enterprises of different industries and sizes, record the business objectives, data requirements, key points of interpretation and output format of each typical business scenario, and create a financial and tax business scenario template library based on the recorded content. The financial and tax business scenario template library contains templates corresponding to different business scenarios, and each template contains a scenario feature description, key points of interpretation and output content structure. Retrieve templates from the financial and tax business scenario template library that match the user's question intent category, and analyze the scenario feature descriptions and key interpretation directions in the templates; The structured raw numerical results are input into the financial and tax domain big language model. The financial and tax domain big language model is used in conjunction with the retrieved scenario template to interpret the meaning of the structured raw numerical results, explaining the business meaning, data source and role of each data field in the current scenario. The structured raw numerical results are analyzed based on the key interpretation focus. If the interpretation focus of the scenario template is data comparison, the structured raw numerical results are correlated with historical data of the same period and industry average data to describe the data change trend or differences. If the interpretation focus is compliance verification, the structured raw numerical results are analyzed to see if they meet the financial and tax business norms requirements of the current scenario. The interpretation and analysis of data meaning are transformed into natural language descriptions. The language is organized according to the output content structure to generate visualization results. The visualization results are used to present data characteristics. The visualization form is selected according to the data type and analysis content. If it is a data change trend, a time series visualization configuration is constructed; if it is a data proportion, a proportion visualization configuration is constructed. The visualization configuration information includes data association method, display dimension, and style settings. Risk identification is performed on the structured raw numerical results. Based on the risk judgment logic in the scenario template, it is analyzed whether there are any abnormalities in the structured raw numerical results. If there are abnormalities, a corresponding risk identification mark is added. The risk identification mark includes the risk type, the data fields involved, and the form of risk manifestation. The natural language description, visual configuration information, and risk identification markers are organized and encapsulated according to a preset output content structure to form preliminary interpretation results.

6. The intelligent dialogue and query system for financial and tax data based on a large language model according to claim 1, characterized in that, The process involves collecting currently valid tax and financial rules texts to construct a tax and financial rules text retrieval library, calculating the semantic relevance between the preliminary interpretation results and the rule text clauses in the retrieval library, and, based on the semantic relevance and closely related rule text content, revising the terminology and logical content in the preliminary interpretation results to form the final intelligent dialogue and query results for tax and financial data, which are then pushed to the user interface, including: Collect currently valid tax and financial rules texts, classify and organize these texts, and categorize them according to the applicable fields of the rules texts. The classified rule texts are decomposed to extract the rule text clauses. The rule text clauses are then semantically encoded to transform the clause content into computable semantic features. Each rule text clause includes a clause theme, core content, scope of application, and execution requirements. The semantically encoded rule text clauses are stored according to categories, and index rules for the retrieval database are established. Subsequent retrieval is achieved through the index rules, forming a currently valid financial and tax rule text retrieval database. The index rules include clause subject index, scope of application index, and core content keyword index. Extract key content from the preliminary interpretation results, perform semantic encoding on the key content, and generate interpretation semantic features that are consistent with the semantic encoding format of the rule text clauses. The key content includes terminology, logical analysis basis, and conclusions. A semantic relevance calculation method is set up, which is based on the overlap and relevance of the semantic features of the interpretation and the semantic features of the rule text clauses. The overlap is used to reflect the consistency between the two in terms of terminology, and the relevance is used to reflect the matching between the two in terms of business logic. The semantic relevance value is obtained by combining the overlap and the relevance. The semantic features of the preliminary interpretation results are input into the tax and finance rule text retrieval database. The rule text clauses whose semantic relevance values ​​meet the preset threshold are matched by indexing rules to determine the rule text content that is closely related to the preliminary interpretation results. The preliminary interpretation results are revised based on the closely related rule text content. If the terminology in the preliminary interpretation results is inconsistent with the standard terminology in the rule text, it is revised according to the terminology in the rule text. If the logical analysis basis in the preliminary interpretation results is inconsistent with the implementation requirements in the rule text, the analysis logic is adjusted to conform to the rule text. If the conclusions in the preliminary interpretation results do not cover the preferential or compliance requirements in the rule text, the corresponding content is added to form the final intelligent dialogue and query results for financial and tax data. Establish a result push channel to convert the final financial and tax data intelligent dialogue and query results into a format supported by the user interface. The user interface is used to display natural language descriptions, visualizations, and risk identification markers. The result push channel supports the synchronous transmission of text and visualization information. The final financial and tax data intelligent dialogue and query results are transmitted to the user interface through the result push channel to complete the result push, and the push time and result content are recorded at the same time.

7. The intelligent dialogue and query system for financial and tax data based on a large language model according to claim 2, characterized in that, The semantic mapping rules are generated, including rules for the correspondence between metadata information and semantic mapping documents, rules for extracting key semantic terms, and rules for updating the retrieval index. When the metadata information changes subsequently, the semantic mapping documents and the retrieval index are adjusted synchronously according to the semantic mapping rules, including: Establish the correspondence rules between metadata information and semantic mapping documents, determine the correspondence between each element in the metadata information and each module of the semantic mapping document, including the table name in the metadata information corresponding to the table name item in the table description module of the semantic mapping document, the field data attributes in the metadata information corresponding to the data attribute items in the field explanation module, and specify the adjustment method of the corresponding module in the semantic mapping document when metadata information is added, modified or deleted. Determine the key semantic vocabulary extraction rules. The extraction scope includes the business purpose of tables, the semantic meaning of fields, and the description of related logic in semantic mapping documents. The extraction criteria are words or phrases that contain the core meaning of financial and tax business. At the same time, specify the deduplication and classification methods for the extracted words to ensure that the words are not repeated and are classified reasonably. Set search index update rules and set the trigger conditions for index updates. The trigger conditions include semantic mapping document modification, addition of metadata information, and adjustment of rule text terms. When the trigger conditions are met, determine the scope of the index that needs to be updated. The process for updating the retrieval index involves first deleting entries in the original index that are related to the changed content; then, extracting key semantic terms based on the modified semantic mapping document to generate new index entries; and finally, inserting the new index entries into the retrieval index and establishing a connection. The updated index is used to point to the latest semantic mapping document content. Establish a semantic mapping rule verification and maintenance mechanism, regularly check the consistency between metadata information and semantic mapping documents, the accuracy of key semantic vocabulary extraction, and monitor the update status of the retrieval index. If inconsistencies or inaccuracies are detected, they are corrected according to the semantic mapping rules. If an update delay is detected, the index update process is triggered. The semantic mapping rules are used to guide the collaborative operation of the intermediate adaptation layer components.

8. The intelligent dialogue and query system for financial and tax data based on a large language model according to claim 3, characterized in that, The process involves inputting a standardized formatted natural language question about the finance and tax domain into a large language model for the finance and tax domain, then calling the model to perform intent classification. The intent category is determined based on the business expression within the standardized formatted natural language question about the finance and tax domain, including: The system calls the large language model in the financial and tax domain to receive natural language questions in the financial and tax domain in a unified format. It then performs word segmentation on the question text, splitting the continuous text into independent lexical units, and extracts business expression keywords from the segmented lexical units. The business expression keywords include financial and tax business-related words, data requirement-related words, and rule text-related words. The pre-set intent category recognition library is loaded by calling the large language model in the financial and tax field. The intent category recognition library contains a set of feature keywords corresponding to each intent category. The extracted business expression keywords are compared with the set of feature keywords of each intent category in the intent category recognition library, and the number of overlaps between the set of feature keywords of each intent category and the business expression keywords is counted. Calculate the ratio of overlapping keywords to the total number of keywords in the business description, and determine the intent category with the highest ratio as the preliminary intent category; A second verification is performed on the initial intent category. The complete business logic in the question text is analyzed to see if it matches the initial intent category. If the business logic matches the initial intent category, the intent category is finally determined. If there are multiple intent categories with similar overlap ratios or if the business logic does not match the initial intent category, the tax and finance big language model further analyzes the contextual information in the question. The contextual information includes the user's historical query intent, the time description in the question, and the company-related description. The weight of the feature keywords is adjusted in combination with the contextual information, and the overlap ratio is recalculated until a unique intent category that matches the business logic is determined. Mark the identified intent categories in the issue handling record.

9. The intelligent dialogue and query system for financial and tax data based on a large language model according to claim 4, characterized in that, The establishment of the data interaction link includes three stages: connection establishment, data transmission, and result reception. First, a connection request is sent to the financial and tax business database. After the financial and tax business database responds and confirms the connection, a query request containing the access path is transmitted to the financial and tax business database, including: The format of the connection request is determined, including the request identifier, request time, target database identifier, and authentication information. The authentication information is processed using an encryption algorithm. A connection request is generated according to a specified format and sent to the financial and tax business database through a preset communication port, while recording the sending time and request content. After receiving a connection request, the financial and tax business database decrypts and verifies the authentication information in the connection request to confirm the legitimacy of the request initiator. If the verification is successful, a connection confirmation response is returned; if the verification fails, a verification error response is returned and the reason for the error is recorded. Receive response information from the financial and tax business database. If it is a connection confirmation response, record the connection establishment time and connection identifier to complete the connection establishment process. If it is a verification error response, adjust the authentication information according to the error reason, regenerate the connection request and send it until the connection is successfully established. Determine the encapsulated components of the query request, including connection identifier, query identifier, access path, query time, and data format requirements. Convert the access path according to the syntax format recognizable by the financial and tax business database. The access path is used to be correctly parsed. The query request is processed according to its encapsulated components, and a data validation field is added. The data validation field is used to verify the integrity of the query request after the financial and tax business database receives it. The processed query request is transmitted to the financial and tax business database through the established connection link. During the transmission process, the data transmission rate and transmission status are monitored in real time. If the transmission is interrupted, the transmission request is re-initiated and the data transmission is restored based on the breakpoint resume mechanism. After receiving a query request, the financial and tax business database verifies the integrity of the query request through the data validation field. If the verification passes, it parses the access path and data format requirements in the query request; if the verification fails, it returns a data error response. The request initiator receives the error response, repackages it, and sends the query request again. Once the financial and tax business database has completed parsing and processing the query request and is ready to return the query results, the connection link is maintained to monitor the response status of the financial and tax business database in real time, so as to receive the returned structured raw numerical results in a timely manner.

10. The intelligent dialogue and query system for financial and tax data based on a large language model according to claim 5, characterized in that, The process involves collecting typical business scenarios in financial and tax processing from enterprises of different industries and sizes, recording the business objectives, data requirements, key interpretation points, and output formats for each typical business scenario, and creating a financial and tax business scenario template library based on the recorded content, including: Collect typical business scenarios in financial and tax processing of enterprises of different industries and sizes, record the business objectives, data requirements, key points of interpretation and output format of each typical business scenario, and form a scenario requirement survey document. Based on the scenario requirements survey document, the collected business scenarios are classified and summarized to determine the core scenario types that the financial and tax business scenario template library should include. For each core scenario type, a template is set. The template includes a scenario feature description module, an interpretation focus direction module, and an output content structure module. The scenario feature description module is used to define the business scope and typical characteristics of the scenario. The interpretation focus direction module is used to determine the core focus of data interpretation in the scenario. The output content structure module is used to standardize the organization of the interpretation results. Based on the business processes and data characteristics of each typical business scenario, the applicable business links, the types of financial and tax data involved, and the core needs of users in the typical business scenario are described, and scenario feature description content is generated. The scenario feature description content is used to reflect the business attributes of the typical business scenario. Based on the business objectives and user needs of typical business scenarios, the key interpretation directions of each typical business scenario are determined, and the output content structure is set according to the content logic and information transmission logic. The output content structure is used to represent the presentation order and hierarchical relationship. The constructed scenario feature descriptions, key interpretation directions, and output content structures are integrated into a complete scenario template. Each scenario template is assigned a unique identifier, which includes a scenario type code and a version number. The integrated scenario templates are tested and applied to enterprise users in different industries. The integrated scenario templates are applied to actual financial and tax data interpretation scenarios, and user feedback on the applicability, content completeness, and clarity of expression of the integrated scenario templates is collected. Based on the user feedback, the scenario templates are optimized and adjusted. The optimized scenario templates are then stored according to scenario type, and template retrieval rules are established, including scenario type retrieval and keyword retrieval, forming the final financial and tax business scenario template library.