An ontology-based accounting document automatic generation and verification method

CN122887393APending Publication Date: 2026-10-09上海立业乐信息科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611009707.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

一类是传统财务软件的模板化凭证生成工具,该类工具高度依赖人工录入原始凭证信息并手动选择会计科目,无法对发票、银行回单、报销单等多形态异构原始凭证进行自动语义识别与结构化转换,数据处理效率低

Benefits of technology

本发明所提供的一种基于本体的会计凭证自动生成与校验方法,通过将领域本体作为凭证生成与校验的统一语义约束,取得了显著的技术进步。该方法在接收到多模态原始凭证数据后,利用领域本体的概念层级与语义关系对异构数据进行统一语义解析,自动提取包含业务语义特征的核心凭证信息,打通了从非结构化原始数据到结构化凭证信息的自动化转换链路,大幅减少了人工数据录入环节。并通过实时监测法规更新、本体版本更新等触发条件,自动同步更新科目匹配规则与校验规则,使凭证处理能力与最新政策、知识体系保持同步,无需人工逐条重新配置。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122887393A_ABST
    Figure CN122887393A_ABST
Patent Text Reader

Abstract

The application provides a kind of ontology-based accounting document automatic generation and check method, comprising: loading the domain ontology including concept hierarchy, business association and rule constraint;Receive multi-modal original voucher data, extract core voucher information containing business semantic features through semantic analysis;Calculate the semantic similarity of business semantic features and ontology subject concept, match accounting subject, determine the debit direction and amount based on ontology rules, generate accounting voucher data record;Perform multi-dimensional verification on the voucher, including at least compliance verification based on regulation database and ontology rules, and semantic verification based on knowledge graph association relationship.The application drives voucher automatic generation and verification with domain ontology as semantic constraint, realizes multi-modal data to voucher automatic conversion, multi-dimensional deep verification and automatic correction, significantly improves the efficiency, accuracy and compliance of voucher processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer software and artificial intelligence technology, specifically relating to a method for automatically generating, verifying and iteratively optimizing accounting vouchers using domain ontology knowledge. Background Technology

[0002] With the advancement of enterprise digital transformation, the demand for automated voucher processing in the fields of bookkeeping and corporate financial management is becoming increasingly urgent. The generation and verification of accounting vouchers are core links in financial work, and their accuracy, compliance, and efficiency directly affect the quality of corporate financial management.

[0003] Currently, there are two main technical approaches to automating accounting voucher processing. One approach is the template-based voucher generation tools in traditional accounting software. These tools heavily rely on manual input of original voucher information and manual selection of accounting subjects. They cannot automatically perform semantic recognition and structured conversion on heterogeneous original vouchers of various forms, such as invoices, bank receipts, and expense reports, resulting in low data processing efficiency. Furthermore, their verification logic is limited to basic numerical checks such as debit and credit balance, failing to perform in-depth checks on the rationality of subject matching, business compliance, and semantic consistency, easily leading to problems such as subject mismatch and inconsistent business logic.

[0004] Another type is voucher processing applications based on general-purpose large language models. While these applications possess some natural language understanding capabilities, they lack structured knowledge constraints specific to the finance and taxation domain. Account matching relies on general knowledge from the model's training data, making them prone to misuse of accounting subjects and non-compliance with accounting standards, resulting in high compliance risks. Furthermore, these solutions do not integrate with structured knowledge systems such as domain ontology and knowledge graphs. When finance and tax policies or accounting standards are adjusted, the model needs to be retrained or rules need to be manually configured one by one, leading to long update cycles and high adaptation costs.

[0005] From a technical architecture perspective, existing voucher processing solutions are mostly independent, single-point functional designs. The verification data and business feedback generated during voucher processing cannot be effectively collected and fed back into the rule engine for optimization and iteration. The system's processing capabilities are static and cannot evolve with the accumulation of business data and changes in regulations. At the same time, the processing logic of existing solutions is mostly generalized, making it difficult to flexibly adapt to the differentiated needs of different enterprise sizes and industry attributes, resulting in insufficient adaptability to various scenarios.

[0006] In summary, existing technologies still have problems and certain limitations. Summary of the Invention

[0007] This invention is made to solve the above-mentioned problems, and aims to provide an ontology-based method for automatic generation and verification of accounting vouchers.

[0008] This invention provides an ontology-based method for automatically generating and verifying accounting vouchers, characterized by the following steps: S1. Load the preset domain ontology, which includes concept hierarchy, business relationships and rule constraints; S2. Receive multimodal original voucher data, perform semantic parsing on the multimodal original voucher data, and extract core voucher information, including business semantic features; S3. Calculate the semantic similarity between the business semantic features and the concepts of each subject in the domain ontology, match the accounting subjects according to the similarity results, and determine the lending direction and amount based on the rule constraints in the domain ontology to generate accounting voucher data records. S4. Perform multi-dimensional verification on accounting voucher data records. Multi-dimensional verification includes at least compliance verification and semantic verification. Compliance verification is based on the rule constraints of the domain ontology. The rule constraints include the coded expression of current accounting standards and tax regulations. Semantic verification is based on the relationship between accounts and business types in the knowledge graph. S5. When there are failed items in the multi-dimensional verification, the rule constraints of the domain ontology and the reasoning results of the knowledge graph are called according to the exception type to generate a correction plan. The accounting voucher data records are adjusted according to the correction plan, and the multi-dimensional verification is returned to be executed.

[0009] Furthermore, the multimodal original voucher data in step S2 includes at least one of the following: invoice image, bank receipt image, table / report, and audio recording; Semantic parsing of multimodal original voucher data includes preprocessing the multimodal original voucher data, calling a natural language processing module enhanced with domain ontology, and extracting voucher date, voucher type, business semantic features, amount and transaction subject by combining the concept hierarchy and semantic relationships in the domain ontology. The business semantic features are numerical vectors based on the concept encoding of the domain ontology.

[0010] Further, in step S3, the semantic similarity between the business semantic features and the concepts of each subject in the domain ontology is calculated, and accounting subjects are matched according to the similarity results. This includes using a cosine similarity algorithm or a semantic relevance algorithm based on the path distance of the ontology to calculate the similarity between the business semantic feature vector and the concept vector of each subject in the domain ontology. The subject with the highest similarity and exceeding the preset threshold is determined as the matching subject, and the corresponding subject code is obtained.

[0011] Furthermore, in step S3, the lending direction and amount are determined based on the rule constraints in the domain ontology. This includes automatically determining the lending direction based on the lending and accounting rules and business type associations defined in the domain ontology, and extracting the amount from the core voucher information to calculate the amount between the lender and borrower to ensure a balance between lending and borrowing.

[0012] Furthermore, the multi-dimensional verification in step S4 also includes format verification, amount verification, and association verification; among them, Format verification checks the format of the voucher and the standardization of the items filled in; The amount verification checks the balance of loan and borrowing amounts and their consistency with the amounts in the core voucher information; The correlation verification checks the completeness and accuracy of the correlation indexes between accounting voucher data records and multimodal original voucher data, the referenced ontology rules, and knowledge graph nodes.

[0013] Furthermore, in step S5, generating a correction scheme involves calling a large language model enhanced with domain ontology, taking the error cause, the rule constraints of the associated domain ontology, and the accounting voucher data records as inputs to generate a correction scheme. The correction scheme includes at least one of the following: account replacement suggestion, debit / credit direction adjustment instruction, amount correction, and format correction.

[0014] Furthermore, step S5 also includes pushing the abnormal credentials and correction suggestions to the manual terminal for processing when the multi-dimensional verification still fails to pass and the number of automatic corrections exceeds a preset threshold.

[0015] Furthermore, the method also includes: S6, real-time monitoring of preset update triggering conditions, wherein the update triggering conditions include at least one of the following: update events of rule constraints in the domain ontology, update events of the domain ontology version, and iteration events of the knowledge graph; Once an update is detected, the updated content is automatically extracted, and the subject matching rules in step S3, the compliance verification rules in step S4, and the semantic verification rules are updated based on the updated content.

[0016] Furthermore, the method also includes: S7, collecting verification feedback data, correcting records and cross-module feedback data to form a closed-loop feedback dataset; The closed-loop feedback dataset is analyzed by calling a large language model enhanced with domain ontology, generating optimization instructions, and updating the voucher generation and verification rules based on the optimization instructions.

[0017] The role and effect of invention This invention provides an ontology-based method for automatic generation and verification of accounting vouchers, achieving significant technological advancements by using domain ontology as a unified semantic constraint for voucher generation and verification. Upon receiving multimodal raw voucher data, this method utilizes the conceptual hierarchy and semantic relationships of the domain ontology to perform unified semantic parsing of heterogeneous data, automatically extracting core voucher information containing business semantic features. This establishes an automated conversion link from unstructured raw data to structured voucher information, significantly reducing manual data entry. Furthermore, by monitoring real-time regulatory updates, ontology version updates, and other triggering conditions, it automatically updates account matching and verification rules, ensuring that voucher processing capabilities remain synchronized with the latest policies and knowledge systems, eliminating the need for manual reconfiguration of each voucher. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating an ontology-based method for automatically generating and verifying accounting vouchers according to the present invention. Detailed Implementation

[0019] To make the technical means, creative features, objectives and effects of this invention easier to understand, the following embodiments are described in detail with reference to the accompanying drawings.

[0020] like Figure 1 As shown, this invention provides an ontology-based method for automatically generating and verifying accounting vouchers, comprising the following steps: S1. Load the preset domain ontology, which includes concept hierarchy, business relationships and rule constraints.

[0021] Specifically, during the system initialization phase, the program loads pre-built domain ontology data from the storage module. This domain ontology is stored using a graph database or resource description framework format, and its internal structure is divided into three layers: a core layer, a business layer, and a rule layer. The core layer defines basic concepts such as accounting subjects, subject codes, and subject categories, as well as the parent-child hierarchical relationships and synonymous associations between these concepts. For example, the "Management Expenses" subject may include multiple detailed subjects such as "Travel Expenses" and "Office Expenses." The business layer defines business concepts such as voucher types, business scenarios, and transaction types, and establishes association edges between these business concepts and core layer subject concepts. For example, the "Travel Expense Reimbursement" business concept and the "Management Expenses - Travel Expense" subject concept have a "corresponding accounting" association edge. The rule layer defines constraints such as debit and credit accounting rules, amount accounting rules, and compliance constraint rules. Each rule is stored in a condition-conclusion format, such as "If the business type is expense reimbursement, then the debit account is an expense category account, and the credit account is bank deposit or cash on hand." After loading, the program establishes a semantic association index table between each data level, mapping concept identifiers, association edge identifiers, and rule identifiers to ensure the efficiency of semantic query and rule matching in subsequent processes.

[0022] S2. Receive multimodal original voucher data, perform semantic parsing on the multimodal original voucher data, and extract core voucher information, including business semantic features.

[0023] Specifically, the program receives raw voucher data submitted by external systems or user terminals through a standardized data interface. Multimodal raw voucher data includes at least one of the following: invoice images, bank statement images, tables / reports, and audio recordings. For image data, the program first calls the image preprocessing module for noise reduction, tilt correction, and sharpness enhancement; for audio data, it calls the speech recognition module to convert it into text. After preprocessing, the program calls a natural language processing module enhanced with domain ontology to perform semantic parsing of the data. This natural language processing module incorporates the conceptual hierarchy and semantic relationships of the domain ontology during the training or fine-tuning phase, enabling it to associate voucher text with ontology concepts. During the parsing process, the module identifies and extracts the following core voucher information from the preprocessed data: voucher date, stored in a standardized date format; voucher type, aligned with business concepts in the ontology's business layer, for example, identifying the invoice type as "Value-Added Tax Special Invoice" and mapping it to the corresponding business concept in the ontology; business semantic features, which is the core output of this step, a multi-dimensional numerical vector based on ontology concept encoding. Each dimension of this vector corresponds to a subject concept in the core layer of the ontology or a business concept in the business layer, and its value represents the semantic relevance between the current voucher data and that concept, thus representing the business meaning of the voucher in the form of a numerical vector; amount, including detailed amount fields such as total amount including tax, amount excluding tax, and tax amount; transaction entities, including the names of both parties to the transaction and identification information such as taxpayer identification numbers. After extraction, the program verifies the completeness of the above core voucher information, checking whether there are empty values ​​in each required field. If there are missing values ​​but they can be inferred and supplemented based on the default value rules in the ontology or historical similar voucher data, they are automatically supplemented; if they cannot be automatically supplemented, a missing information report is generated and pushed to the manual terminal for supplementation.

[0024] S3. Calculate the semantic similarity between the business semantic features and the concepts of each subject in the domain ontology, match the accounting subjects according to the similarity results, and determine the lending direction and amount based on the rule constraints in the domain ontology to generate accounting voucher data records.

[0025] Specifically, this step is executed in three sub-steps: The first sub-step is subject matching. The program uses the business semantic feature vector extracted in step S2 as the query vector, traverses the pre-encoded vectors of each subject concept in the core layer of the domain ontology, and calculates the semantic similarity one by one. The similarity algorithm adopts the cosine similarity algorithm, which is calculated by dividing the inner product of two vectors by the product of their magnitudes; or it adopts the semantic relevance algorithm based on ontology path distance, which calculates the shortest path distance between the concept node activated by the business semantic features and each subject concept node in the ontology hierarchy, and converts it into a similarity score after normalization. After the calculation is completed, the program sorts all subjects in descending order of similarity score, and determines the subject with the highest score that exceeds a preset threshold (e.g., 0.75) as the matching subject, and reads the subject code of the subject from the core layer of the ontology. If the highest score does not exceed the threshold, the top three subjects that exceed the candidate threshold (e.g., 0.5) are selected as candidates and pushed to the human terminal for confirmation.

[0026] The second sub-step involves determining the debit / credit direction and calculating the amount. The program retrieves the debit / credit accounting rules corresponding to the current voucher type from the rule layer of the domain ontology. These rules are stored in a structured manner within the rule layer, clearly defining the logic for determining debit and credit accounts under different business types. Based on the voucher type extracted in step S2, the program locates the corresponding business concept node in the ontology's business layer and then finds the debit / credit rules bound to the rule layer through the associated edges. According to these rules, the program automatically determines that the debit account is a matched expense or asset account, and the credit account is determined as "bank deposit" or "cash on hand" based on the payment method. Subsequently, the program reads the total amount including tax from the amount field extracted in step S2, calculates the debit and credit amounts, and verifies that the debit and credit amounts are equal.

[0027] The third sub-step involves assembling the voucher data record. The program invokes a large language model enhanced with domain ontology, using business semantic features, matching accounting subject names, and amount information as input prompts to generate a voucher summary text that conforms to financial regulations, such as "Payment of travel expense reimbursement for employee Zhang". Finally, the program integrates the accounting subject, subject code, debit / credit direction, amount, summary text, and original voucher association identifier, assembling it into a complete accounting voucher data record according to a preset standardized data structure format (e.g., JSON format, including voucher header information and a list of journal entries). It also establishes an association index between this data record and the original voucher data file, the referenced ontology rule identifiers, and knowledge graph nodes.

[0028] S4. Perform multi-dimensional verification on accounting voucher data records. Multi-dimensional verification includes at least compliance verification and semantic verification. Compliance verification is based on the rule constraints of the domain ontology. The rule constraints include the coded expression of current accounting standards and tax regulations. Semantic verification is based on the relationship between accounts and business types in the knowledge graph.

[0029] Specifically, the program loads a verification rule system composed of personalized configuration parameters, domain ontology rules, fiscal and taxation regulation database, and knowledge graph inference rules, and performs five-dimensional verification on the accounting voucher data records generated in step S3.

[0030] Format verification checks whether each field of the voucher data record is completely filled, whether the date format meets the standard, whether the account code is within the valid coding range, whether the amount precision meets the accounting standards and other requirements for the standardization of item filling.

[0031] Amount verification first checks whether the debit amount is equal to the credit amount, then extracts the original amount from the associated original voucher data, and compares the consistency between each entry amount in the voucher data record and the original amount one by one to ensure that there is no error in the transmission of the amount from the original data to the voucher.

[0032] Compliance verification is performed based on compliance constraint rules in the domain ontology rule layer. The compliance constraint rules have pre-integrated key provisions of current accounting standards and fiscal and taxation regulations, and are expressed in coded form. The program uses the accounting subjects, business types, amount ranges involved in the voucher as query conditions to perform pattern matching with these rules, and can simultaneously check whether the content of the voucher conforms to the domain knowledge logic and the provisions of current fiscal and taxation regulations through a single verification action. For example, when verifying a travel expense reimbursement voucher, the program checks whether the input tax deduction for accommodation expense invoices has been processed in accordance with regulations, and whether it meets the requirements of deductible invoice types.

[0033] Semantic verification uses the association between accounting subjects and business types in the knowledge graph to conduct logical consistency verification. The program takes the accounting subjects and business types in the voucher as nodes, queries whether there is a preset semantic association edge between the two in the knowledge graph, and whether the type of the association edge matches the debit and credit direction of the voucher. For example, there is a "normal accounting" association edge between the "travel expense reimbursement" business node and the "administrative expense - travel expense" account node. If the voucher records travel expenses into the "selling expense" account, the association path does not exist in the knowledge graph or the association strength is lower than the threshold, it will be determined as semantic inconsistency. For another example, if the voucher takes bank deposit as the debit account and the expense account as the credit account, which is opposite to the capital flow direction of the "expense reimbursement payment" scenario defined in the knowledge graph, it will be determined as semantic abnormality in debit and credit direction.

[0034] Association verification checks whether the association indexes between the voucher data record, the original multimodal voucher data file, the referenced ontology rule identifier, and the knowledge graph node identifier are complete and accurate, so as to ensure that the full-link data is traceable.

[0035] After each dimension of verification is completed, the program summarizes the verification results for each dimension. All verified credentials proceed to the subsequent archiving steps; for those that fail, a verification exception report is generated, which includes the exception type, a description of the exception reason, and the location of the exception field, and the process proceeds to step S5.

[0036] S5. When there are failed items in the multi-dimensional verification, the rule constraints of the domain ontology and the reasoning results of the knowledge graph are called according to the exception type to generate a correction plan. The accounting voucher data records are adjusted according to the correction plan, and the multi-dimensional verification is returned to be executed.

[0037] Specifically, the program parses and verifies the anomaly types in the anomaly report, which include five categories: format anomalies, amount anomalies, compliance anomalies, semantic anomalies, and association anomalies. Based on the anomaly type, the program calls the corresponding error identification submodule, combining domain ontology rule constraints and knowledge graph reasoning results to pinpoint the specific cause of the anomaly. For example, for a mismatched account in a semantic anomaly, the program takes the business semantic features of the voucher as input, performs multi-hop reasoning along the association edges in the knowledge graph, finds the account node with the highest association strength that has a "normal accounting" association edge with the current business type, and uses that account as the suggested replacement account. For a non-compliant deduction in a compliance anomaly, the program retrieves the corresponding deduction rules in the ontology rule layer to clarify the compliant deduction conditions and amount limits.

[0038] After determining the cause of the error, the program invokes a large language model enhanced with domain ontology to generate a correction plan. The input to the large language model includes: an exception type and error cause description, associated domain ontology rule constraints, the complete content of the current voucher data record, and correction suggestions based on knowledge graph reasoning. Based on these inputs, the large language model generates a structured correction plan. This correction plan contains one or more correction operation instructions, specifically including at least one of the following: account replacement suggestion (e.g., replacing "Sales Expenses - Travel Expenses" with "Administrative Expenses - Travel Expenses"), debit / credit direction adjustment instruction (e.g., swapping debit and credit accounts), amount correction (e.g., splitting tax amounts from expense amounts), and format correction (e.g., adjusting date formats or adding missing fields).

[0039] The program automatically adjusts the corresponding fields in the accounting voucher data records according to the correction plan. After the correction is completed, it returns to step S4 to re-execute the multi-dimensional verification. If the re-verification passes, the voucher and the correction record are archived together; if the verification still fails, the program checks whether the number of automatic corrections exceeds a preset threshold (e.g., three times). If it does not exceed the threshold, the program re-executes the error identification and correction generation process in this step; if it exceeds the threshold, the program packages the complete data of the current abnormal voucher, all previous correction records, and correction suggestions and pushes them to the human terminal for manual review and processing. After receiving the manual correction instruction, the program performs the adjustment and verifies again.

[0040] Furthermore, this method also includes steps S6 and S7.

[0041] S6. Monitor preset update trigger conditions in real time, and update subject matching rules and verification rules according to the updated content.

[0042] Specifically, the program starts a rule update monitoring thread in the background, continuously listening for preset update trigger conditions. These trigger conditions include at least one of the following: update events of rule constraints in the domain ontology (e.g., the State Taxation Administration issuing new VAT invoice management regulations, or accounting standard revisions leading to compliance rule adjustments), domain ontology version update events (e.g., accounting standard revisions leading to adjustments in the subject system), and knowledge graph iteration events (e.g., adding associations between new business types and subjects). Upon detecting an update trigger event, the program automatically extracts specific update content from the update data source, including newly added or modified accounting subjects and subject codes, adjusted tax and financial regulations and compliance standards, and optimized ontology rules and knowledge graph associations. Based on the extracted update content, the program automatically updates the subject concept vector library and similarity threshold parameters referenced in the subject matching step of step S3, synchronously updates the regulatory database index and ontology rule constraints referenced in the compliance verification step of step S4, and the knowledge graph association data referenced in the semantic verification step. After the update is complete, the program uses a pre-stored historical voucher dataset to perform regression testing on the updated rules, comparing the test results with the verification results before the update to verify the accuracy and compatibility of the updated content. If the test passes, the update will officially take effect and be applied to subsequent credential processing procedures; if the test fails, the system will automatically roll back to the previous rule version to ensure stable system operation and generate an update exception report.

[0043] S7. Collect verification feedback data, correction records, and cross-module feedback data to form a closed-loop feedback dataset, analyze and generate optimization instructions, and update voucher generation rules and verification rules.

[0044] Specifically, after each voucher processing, the program automatically collects end-to-end feedback data, including verification feedback data from step S4 (verification scores and pass status for each dimension), correction records from step S5 (error type, correction scheme, and correction result), cross-module feedback data (application status and anomaly information returned after voucher data is synchronized to other business systems), and user feedback data (user correction operations and evaluation data for voucher results). The program integrates and associates the above multi-source feedback data according to voucher identifiers, converts it into a unified structured format, forms a closed-loop feedback dataset, and stores it in the feedback database. When the accumulated data volume of the feedback dataset reaches a preset threshold (e.g., 500 records) or a preset period (e.g., weekly), the program calls a large language model enhanced with domain ontology to perform aggregation analysis on the feedback dataset. The large language model identifies optimization points such as high-frequency error types, low-accuracy subject matching patterns, and trends in missed or false alarms in verification rules, and outputs structured optimization instructions. The optimization instructions include: adjusting the semantic similarity matching weight of a certain subject under a specific business type, tightening or relaxing the pass threshold of a certain verification dimension, supplementing verification rule entries for specific business scenarios, and optimizing the correction scheme template for a certain type of error, etc. The program automatically parses optimization instructions, updates the configuration parameters and rule base of the corresponding stages, and pushes suggestions involving ontology optimization to the ontology management module and suggestions involving model optimization to the large language model fine-tuning module. After the optimization takes effect, the program continues to collect new feedback data, forming a continuous iterative closed loop of "processing-feedback-analysis-optimization-reprocessing".

[0045] The following example, using a case study of an accounting agency processing travel expense reimbursements and generating accounting vouchers for a trading company, further illustrates the technical solution of this invention.

[0046] In step S1, the system loads the financial and tax domain ontology. The core layer defines accounting subjects such as "Management Expenses," "Sales Expenses," "Bank Deposits," and "Other Receivables," with the "Management Expenses" subject subdivided into detailed subjects such as "Travel Expenses" and "Office Expenses." The business layer defines business concepts such as "Travel Expense Reimbursement" and "Office Expense Reimbursement," with a "corresponding accounting" association edge between the "Travel Expense Reimbursement" business node and the "Management Expenses - Travel Expenses" subject node. The rules layer stores the debit and credit accounting rules for "Expense Reimbursement Business: Debit is for expense accounts, credit is for bank deposits or cash on hand," as well as compliance constraints rules integrating current input tax deduction regulations.

[0047] In step S2, the company submitted a business trip approval form, a high-speed rail ticket image, and a VAT invoice image for accommodation expenses. After preprocessing the images, the system calls the ontology-enhanced natural language processing module for semantic parsing. The system extracts the voucher date "March 15, 2026" from the accommodation invoice, maps the voucher type to "VAT Special Invoice - Accommodation Service," and assigns a value of 0.92 to the "Travel Expense Reimbursement" dimension and 0.88 to the "Management Expenses - Travel Expenses" dimension in the business semantic feature vector. The amount is 1060 yuan (excluding tax, 1000 yuan, with a tax of 60 yuan), and the transaction entity is the trading company. Integrity verification confirms that all required fields have been extracted.

[0048] In step S3, the system calculates the cosine similarity between the business semantic feature vector and the concept vectors of each subject in the core ontology layer. The similarity with "Management Expenses - Travel Expenses" is 0.96, and the similarity with "Sales Expenses - Travel Expenses" is 0.52. The highest score of 0.96 exceeds the threshold of 0.75, so the matching subject is determined to be "Management Expenses - Travel Expenses", with the subject code "6602-01". The system retrieves the debit and credit rules corresponding to "Expense Reimbursement Business" from the rule layer, automatically determining the debit subject as "Management Expenses - Travel Expenses" of 1060 yuan and the credit subject as "Bank Deposit" of 1060 yuan. The system calls the large language model to generate the summary "Payment of reimbursement for employee Zhang's business trip to Beijing". The system assembles and generates a complete accounting voucher data record, and simultaneously establishes an association index with the original invoice image, business trip approval form, referenced debit and credit rules, and knowledge graph nodes.

[0049] In step S4, the system performs multi-dimensional validation on the generated voucher data records. Format validation confirms that all fields are filled in correctly. Amount validation confirms that the debit amount of 1060 yuan equals the credit amount of 1060 yuan, and is consistent with the total amount on the invoice. Compliance validation, based on the compliance constraints rules integrated into the ontology rule layer, confirms that the input tax deduction of 60 yuan complies with the provision that "input tax on domestic passenger transportation services and accommodation services is allowed to be deducted from output tax," and that the invoice type meets the deductible requirements. Semantic validation finds a "normal accounting" association edge between the "travel expense reimbursement" node and the "management expenses - travel expenses" node in the knowledge graph, and that "bank deposit" as a credit account is semantically consistent with the "expense reimbursement payment" scenario. Association validation confirms that all association indexes are complete. All dimensions pass the validation.

[0050] Step S5 is skipped because all steps S4 have been completed, and the process proceeds directly to archiving.

[0051] In step S6, the system background monitoring thread continues to run. If subsequent tax regulations adjust the input tax deduction standard for travel expenses, the system will detect the update event in the regulatory database, automatically extract the new deduction standard and applicable conditions, update the deduction parameters in the amount calculation stage in step S3, and the deduction rules in the compliance verification stage in step S4, and officially take effect after regression testing.

[0052] In step S7, the system summarizes the verification data and cross-module feedback processed this time and stores it in the feedback dataset. When the feedback dataset accumulates to a preset threshold, the large language model analysis does not find any obvious optimization points. The system continues to collect subsequent business feedback, forming a continuous iterative closed loop.

[0053] As can be seen from the above embodiments, the method of the present invention fully realizes the automated processing of the entire process from multimodal original voucher data input, ontology-driven subject matching and voucher generation, multi-dimensional verification to rule dynamic updating and feedback optimization, effectively solving the problems of high reliance on manual labor, single verification dimension, and lagging rule updates in the prior art.

[0054] The role and effect of the embodiments This invention provides an ontology-based method for automatically generating and verifying accounting vouchers. Through the implementation of the aforementioned travel expense reimbursement voucher processing example, the method achieves significant technical advantages. The system automatically performs semantic parsing and information extraction of multimodal voucher data, such as accommodation invoices and high-speed rail tickets, based on an ontology in the financial and tax domain, eliminating the need for manual entry. In the account matching stage, the similarity between business semantic features and account concept vectors is calculated using a cosine similarity algorithm, accurately selecting the "Management Expenses - Travel Expenses" account and avoiding potential misselection of management expenses or sales expenses accounts due to manual judgment.

[0055] The above embodiments are preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for automatic generation and verification of accounting vouchers based on ontology, characterized in that, Includes the following steps: S1. Load the preset domain ontology, which includes concept hierarchy, business relationships and rule constraints; S2. Receive multimodal original voucher data, perform semantic parsing on the multimodal original voucher data, and extract core voucher information, the core voucher information including business semantic features; S3. Calculate the semantic similarity between the business semantic features and the concepts of each subject in the domain ontology, match the accounting subjects according to the similarity results, and determine the lending direction and amount based on the rule constraints in the domain ontology to generate accounting voucher data records. S4. Perform multi-dimensional verification on the accounting voucher data record. The multi-dimensional verification includes at least compliance verification and semantic verification. The compliance verification is based on the rule constraints of the domain ontology. The rule constraints include the coded expression of current accounting standards and tax regulations. The semantic verification is based on the association between accounts and business types in the knowledge graph. S5. When there are failed items in the multi-dimensional verification, the rule constraints of the domain ontology and the reasoning results of the knowledge graph are called according to the exception type to generate a correction scheme. The accounting voucher data record is adjusted according to the correction scheme, and the execution of the multi-dimensional verification is returned.

2. The ontology-based automatic generation and verification method for accounting vouchers according to claim 1, characterized in that: The multimodal original voucher data mentioned in step S2 includes at least one of invoice images, bank receipt images, tables and reports, and audio recordings; The semantic parsing of the multimodal original voucher data includes preprocessing the multimodal original voucher data, then calling the natural language processing module enhanced by the domain ontology, and combining the concept hierarchy and semantic relationships in the domain ontology to extract the voucher date, voucher type, business semantic features, amount, and transaction subject. The business semantic features are numerical vectors based on the concept encoding of the domain ontology.

3. The ontology-based automatic generation and verification method for accounting vouchers according to claim 1, characterized in that: Step S3 involves calculating the semantic similarity between the business semantic features and the subject concepts in the domain ontology, and matching accounting subjects based on the similarity results. This includes using a cosine similarity algorithm or a semantic relevance algorithm based on ontology path distance to calculate the similarity between the business semantic feature vector and the subject concept vector in the domain ontology. The subject with the highest similarity exceeding a preset threshold is identified as the matching subject, and the corresponding subject code is obtained.

4. The ontology-based automatic generation and verification method for accounting vouchers according to claim 1, characterized in that: The step S3, which involves determining the lending direction and amount based on the rule constraints in the domain ontology, includes automatically determining the lending direction based on the lending and accounting rules and business type associations defined in the domain ontology, and extracting the amount from the core voucher information to calculate the amount between the lender and borrower to ensure a balance between lending and borrowing.

5. The ontology-based automatic generation and verification method for accounting vouchers according to claim 1, characterized in that: The multi-dimensional verification in step S4 also includes format verification, amount verification, and association verification; among which, The format verification checks the conformity of the voucher format and the accuracy of the item filling. The amount verification checks the balance of loan and borrowing amounts and their consistency with the amounts in the core voucher information; The association verification checks the completeness and accuracy of the association indexes between the accounting voucher data records and the multimodal original voucher data, the referenced ontology rules, and the knowledge graph nodes.

6. The ontology-based automatic generation and verification method for accounting vouchers according to claim 1, characterized in that: The generation of the correction scheme in step S5 includes calling the large language model enhanced by the domain ontology, taking the error cause, the rule constraints of the associated domain ontology, and the accounting voucher data record as input to generate the correction scheme. The correction scheme includes at least one of the following: account replacement suggestion, debit / credit direction adjustment instruction, amount correction, and format correction.

7. The ontology-based automatic generation and verification method for accounting vouchers according to claim 1, characterized in that: Step S5 also includes pushing the abnormal credentials and correction suggestions to a human terminal for processing when the multi-dimensional verification still fails to pass and the number of automatic corrections exceeds a preset threshold.

8. The method according to claim 1, characterized in that, The method further includes: S6. Real-time monitoring of preset update triggering conditions, wherein the update triggering conditions include at least one of the following: update events of rule constraints in the domain ontology, update events of the domain ontology version, and iteration events of the knowledge graph; Upon detecting an update trigger, the updated content is automatically extracted, and the subject matching rules in step S3, the compliance verification rules in step S4, and the semantic verification rules are updated according to the updated content.

9. The method according to claim 1, characterized in that, The method further includes: S7. Collect verification feedback data, correction records, and cross-module feedback data to form a closed-loop feedback dataset; The closed-loop feedback dataset is analyzed by calling the large language model enhanced by the domain ontology to generate optimization instructions, and the voucher generation rules and verification rules are updated according to the optimization instructions.