A large language model perceives and determines a billing method in cooperation with a rule engine
Patent Information
- Application Number
- CN202611273611.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]针对现有技术的不足,本发明提供了一种大语言模型感知与确定性规则引擎协同的记账方法,以解决现有技术中票据适配性差、业务无法自动分流、大模型账务输出不确定、存在数值幻觉、无标准化内控审计体系的技术缺陷等问题
1、无模板高适配识别,场景兼容性强:无需配置固定票据识别模板,支持多版式票据逐张独立解析,适配复杂跨境票据场景,通过置信度筛选保障输入数据质量;
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent data processing technology, specifically to an accounting method that combines large language model perception with a deterministic rule engine. Background Technology
[0002] Cross-border enterprises need to handle multi-format and multi-language invoices for financial accounting, while adapting to differentiated tax policies in different jurisdictions, and balancing accounting efficiency, accuracy, and financial internal control compliance requirements. Traditional manual accounting is inefficient, has a high error rate, and is costly in terms of manpower; traditional template-based OCR accounting solutions rely on fixed invoice formats, have poor adaptability, cannot automatically distinguish between different types of financial business scenarios, and require high levels of human intervention; pure large language model-based intelligent accounting solutions rely on models to complete the entire process, which has inherent probabilistic defects, is prone to numerical illusions, and results in unreproducible accounting results. Furthermore, they lack standardized verification, hierarchical risk control, and audit traceability mechanisms, failing to meet the rigid requirements of corporate financial audit compliance, traceability, and reproducibility, and are difficult to implement on a large scale in cross-border enterprises with multiple tax systems. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention provides an accounting method that combines large language model perception with a deterministic rule engine, thereby solving technical defects in existing technologies such as poor invoice adaptability, inability to automatically divert business, uncertainty in large model accounting output, existence of numerical illusion, and lack of a standardized internal control audit system.
[0004] To achieve the above objectives, the present invention provides the following technical solution: an accounting method that combines large language model perception with a deterministic rule engine, comprising the following steps: S1. Perception and Triage: Obtain the invoice image and user natural language description, extract the structured candidate fields and confidence level of the invoice through a multimodal large language model, analyze the business intent, determine the three types of business paths: reimbursement, direct payment, and loan, and extract the accounting information and store it in the queue to be verified. S2, Human-Machine Solidification Verification: Conducts compliance and numerical self-consistency verification on queue data, supports interactive correction by users using natural language and system re-verification, triggers secondary confirmation for large transactions, and solidifies data and generates a unique hash value after confirmation; S3, Deterministic Accounting Decision: Matches tax rates based on the four-dimensional tax rate decision table, avoids model errors through tax deviation verification, generates balanced accounting entries according to business paths, completes multi-currency conversion and retention exchange rate snapshots, reduces budgets in real time and triggers over-limit warnings; S4. Hierarchical Audit Linkage: Based on the authorization matrix, accounts are posted hierarchically. Data throughout the entire process is retained through an anti-tampering audit chain, and business domain data is synchronized by publishing accounting events.
[0005] Preferably, the perception layer does not require a fixed invoice recognition template, supports independent parsing of multiple formats and multiple invoices, and allows independent configuration of confidence scores for each financial field. It can automatically distinguish between three types of financial scenarios: REF reimbursement, PAF direct payment, and BAF loan, and achieve unmanned automatic order routing.
[0006] Preferably, the verification layer supports multi-dimensional self-consistent verification of date, currency, numerical validity, and amount consistency, visualizes and displays the recognition results, supports real-time error correction and automatic re-verification using natural language, and is configured with a risk control mechanism for secondary confirmation of large transactions and a SHA-256 data hash anti-tampering and solidification mechanism.
[0007] Preferably, the tax rate decision table is based on a four-dimensional matching of tax jurisdiction, transaction type, supplier attributes, and goods / service categories, covering 26 tax system combinations including Nepal's TDS and VAT, with a preset tax deviation threshold of 0.5%. When the deviation exceeds the limit, it is forcibly returned to the verification layer for correction.
[0008] Preferably, the three types of business paths correspond to different accounting entry logics. Loan business can be linked to the employee loan ledger to realize dynamic balance updates and subsequent write-offs. All entries are subject to mandatory verification of debit and credit balance to ensure accounting compliance.
[0009] Preferably, the multi-currency conversion process permanently stores the original currency amount, the official exchange rate snapshot on the accounting date, and the converted amount in the local currency, completely preserving cross-border accounting data and adapting to cross-border auditing and tax settlement scenarios.
[0010] Preferably, a three-tiered authorization risk control mechanism is configured to achieve differentiated management of small transactions (automatic posting), medium transactions (posting notification and review), and large transactions (posting after manual approval), adapting to different accounting risk levels.
[0011] Preferably, an append-only tamper-proof audit chain is adopted to solidify and store core data such as hash values, rule versions, journal entries, approval paths, timestamps, and operating entities, so as to achieve full-chain traceability and reproducibility of accounting.
[0012] Preferably, the multimodal large language model only outputs unstructured candidate information, while core accounting operations such as tax amount review, numerical calculation, journal entry generation, and budget reduction are all executed by the deterministic rule engine. The same input and rule version can output a unique accounting result, eliminating the numerical illusion of the large model.
[0013] This invention provides an accounting method that combines large language model perception with a deterministic rule engine, which has the following beneficial effects: 1. Template-free, highly adaptable recognition with strong scenario compatibility: No need to configure fixed invoice recognition templates, supports independent parsing of multiple invoice formats, adapts to complex cross-border invoice scenarios, and ensures input data quality through confidence level filtering; 2. Fully automated business routing, reducing manual intervention: It can accurately distinguish between three core financial scenarios: reimbursement, direct payment, and loan, and realize automatic order routing without human intervention, which greatly improves the automation rate of bookkeeping; 3. Determined and reproducible accounting results, eliminating model illusions: Through the decoupled architecture of AI and rule engine, the core accounting calculations are executed by deterministic programs. Combined with the tax amount cross-verification mechanism, the problem of probabilistic output and numerical illusion of large models is avoided from the root, ensuring that the output result of the same input is unique. Detailed Implementation
[0014] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0015] Example 1 This invention provides a technical solution: an accounting method that combines large language model perception with a deterministic rule engine, comprising the following steps: S1. Perception and Triage: Obtain the invoice image and user natural language description, extract the structured candidate fields and confidence level of the invoice through a multimodal large language model, analyze the business intent, determine the three types of business paths: reimbursement, direct payment, and loan, and extract the accounting information and store it in the queue to be verified. S2, Human-Machine Solidification Verification: Conducts compliance and numerical self-consistency verification on queue data, supports interactive correction by users using natural language and system re-verification, triggers secondary confirmation for large transactions, and solidifies data and generates a unique hash value after confirmation; S3, Deterministic Accounting Decision: Matches tax rates based on the four-dimensional tax rate decision table, avoids model errors through tax deviation verification, generates balanced accounting entries according to business paths, completes multi-currency conversion and retention exchange rate snapshots, reduces budgets in real time and triggers over-limit warnings; S4. Hierarchical Audit Linkage: Based on the authorization matrix, accounts are posted hierarchically. Data throughout the entire process is retained through an anti-tampering audit chain, and business domain data is synchronized by publishing accounting events.
[0016] This invention features globally fixed system parameters, version-based management, and change tracking. The core calculation formulas and threshold parameters are fixed and reproducible. Default implementation parameters are as follows: field extraction confidence threshold 0.85 (values below this threshold are automatically marked for review); tax deviation tolerance threshold 0.5%; large transaction judgment threshold equivalent to RMB 10,000; budget warning threshold ≤ 20% of remaining budget; fixed core formula: amount reconciliation formula. Tax deviation formula Multi-currency conversion formula Budget accounting formula Lending and borrowing balance formula Hash solidification formula .
[0017] Example 2 In this embodiment, the perception layer does not require a fixed invoice recognition template, supports independent parsing of multiple formats and multiple invoices, and allows independent configuration of confidence scores for each financial field. It can automatically distinguish between three types of financial scenarios: REF reimbursement, PAF direct payment, and BAF loan, and achieve unmanned automatic order routing.
[0018] In this embodiment, the verification layer supports multi-dimensional self-consistent verification of date, currency, numerical validity, and amount consistency, visualizes and displays the recognition results, supports real-time error correction and automatic re-verification using natural language, and is configured with a risk control mechanism for secondary confirmation of large transactions and a SHA-256 data hash anti-tampering and solidification mechanism.
[0019] In this embodiment, the tax rate decision table is based on four-dimensional matching of tax jurisdiction, transaction type, supplier attributes, and goods and services category, covering 26 tax system combinations including Nepal's TDS and VAT. A preset tax deviation threshold of 0.5% is used, and when the deviation exceeds the limit, it is forcibly returned to the verification layer for correction.
[0020] In this embodiment, the three types of business paths correspond to different accounting entry logics. Loan business can be linked with the employee loan ledger to realize dynamic balance updates and subsequent write-offs. All entries are subject to mandatory verification of debit and credit balance to ensure accounting compliance.
[0021] In this embodiment, the multi-currency conversion process permanently stores the original currency amount, the official exchange rate snapshot on the accounting date, and the converted amount in the local currency, thus completely preserving cross-border accounting data and adapting to cross-border auditing and tax settlement scenarios.
[0022] In this embodiment, a three-tiered authorization risk control mechanism is configured to achieve differentiated management of small-amount transactions (automatic posting), medium-amount transactions (posting notification and review), and large-amount transactions (posting after manual approval), adapting to different accounting risk levels.
[0023] In this embodiment, an append-only anti-tampering audit chain is adopted to solidify and store core data such as hash values, rule versions, journal entries, approval paths, timestamps, and operating entities, thereby achieving full-chain traceability and reproducibility of accounting information.
[0024] In this embodiment, the multimodal large language model only outputs unstructured candidate information. Core accounting operations such as tax amount review, numerical calculation, journal entry generation, and budget reduction are all executed by the deterministic rule engine. The same input and rule version can output a unique accounting result, eliminating the numerical illusion of the large model.
[0025] Users upload photos of one or more invoices through the financial digital employee portal, along with natural language business descriptions, such as scenarios like office procurement or employee travel loans. The system uses a multimodal large language model to parse each invoice image, extracting nine candidate fields in a structured manner: supplier, invoice number, transaction date, currency, pre-tax amount, tax item, tax amount, total amount, and expense category. A confidence score for each field is generated simultaneously. Semantic intent analysis is also performed on the user's natural language description to accurately determine if the current business is one of three paths: employee expense reimbursement, direct company payment, or employee loan. The system then extracts the entity, department, and project accounting information to which the business belongs. All candidate data output by the AI is stored only in a verification queue and is not yet integrated into the accounting database, thus isolating perceptual data from accounting decisions.
[0026] The system performs automated compliance checks on the data in the verification queue, including date format validity, currency enumeration compliance, amount validity, and consistency verification between the total amount and the pre-tax amount and tax amount, eliminating abnormal and contradictory data. After verification, all field information is displayed to the user in a visually editable card. The user can check the recognition results, correct erroneous fields using natural language commands, and the system automatically updates the data and restarts the full-dimensional compliance verification. If the transaction amount exceeds a preset large threshold, the system proactively initiates a secondary explicit confirmation query to verify the authenticity of the transaction. After the user finally confirms that everything is correct, the system freezes all input data and uses the SHA-256 algorithm to generate a unique hash value based on the input data, operation timestamp, and rule version number, thus completing the data tamper-proofing and solidification.
[0027] The solidified compliance data is input into the deterministic rule engine. The engine uses four dimensions—tax jurisdiction, transaction type, supplier attributes, and product / service category—as search criteria, and calls upon a built-in decision table of 26 tax rate combinations for Nepal's TDS and VAT to match a uniquely suitable tax type and rate. The system extracts the tax amount from the large model and compares it with the standard tax amount calculated by the rule engine, calculating the relative deviation. If the deviation exceeds a 0.5% error tolerance threshold, the system automatically returns to the validation layer for correction.
[0028] After successful verification, the system executes differentiated journal entry generation logic based on the business path: the employee expense reimbursement path generates expense accounts and accounts payable to employees; the company direct payment path generates expense accounts and accounts payable to suppliers; the employee loan path generates employee loan entries, synchronously updates the employee loan ledger, dynamically updates the employee loan balance, supports automatic offsetting and reconciliation of subsequent reimbursement and repayment business, and all entries are subject to mandatory verification of debit and credit balance to prevent accounting errors.
[0029] For foreign currency transactions, the system retrieves an official exchange rate snapshot from the accounting date, completes the conversion of multiple currencies to the base currency, and retains complete data on the original currency amount, exchange rate, and base currency amount. The exchange rate snapshot is permanently saved. Simultaneously, the system deducts corresponding budget amounts in real time based on expense category, department, and project, calculates the remaining available budget, and automatically issues a budget overrun warning when the remaining budget percentage reaches a preset threshold, achieving dynamic budget risk control.
[0030] The system uses a three-tiered authorization matrix that matches transaction amount thresholds with business operation types to perform tiered accounting processing: green indicates small, routine transactions that are automatically posted without intervention; yellow indicates medium-sized transactions that are automatically posted and then pushed to the responsible personnel for post-event review; red indicates large, high-risk transactions that are suspended from posting, generate a unique approval card, and are recorded after manual approval by the approver.
[0031] After each accounting transaction is completed, the system writes the unique hash value, rule engine version, tax rate decision table version, accounting entry result, authorization approval path, operation timestamp, and operation entity information into the append-only audit chain. Data can only be added, not tampered with, achieving end-to-end traceability and verifiability. Finally, the system publishes an accounting completion event to the event bus, linking related business domains such as financial ledgers, report statistics, and cross-entity data synchronization to complete the entire business loop.
[0032] The six functional modules of the automatic accounting device of this invention work together to execute the above four-layer processing flow one by one, realizing the full-process functions of invoice perception and diversion, human-machine collaborative verification, deterministic accounting adjudication, hierarchical authorization control, full-link auditing and traceability, and cross-domain event linkage.
[0033] The electronic device of the present invention includes a memory and a processor. When the processor runs the computer program stored in the memory, it can completely execute all the steps of the automatic accounting method defined in the claims of the present invention.
[0034] The computer-readable storage medium of this invention stores an executable computer program. When the program is called by a processor, it can realize all the technical solutions of this invention, and the accounting processing results are stable, reproducible, and auditable.
[0035] Example 3 To verify the technical superiority of this invention over traditional solutions, this invention selected a dataset of 2,000 real invoices from cross-border enterprises in Nepal (including invoices in multiple languages, formats, high and low quality, and currencies). Under a unified hardware and software environment, this invention was compared with traditional template OCR solutions and pure large-model end-to-end accounting solutions. At the same time, multiple ablation experiments were set up to quantify core performance indicators. All experimental results are reproducible.
[0036] 1. Comparative experimental data of three groups of schemes (1) Accuracy of document field recognition: Traditional template OCR is 74.5%, pure large model solution is 93.1%, and the present invention solution reaches 98.3%, which is 31.9% higher than the traditional solution, effectively solving the problem of recognition and adaptation of multi-format documents without templates; (2) Accuracy of automatic business diversion: Traditional template OCR has no automatic diversion capability, pure large model solution is 95.2%, and the present invention reaches 99.6%, realizing almost unmanned automatic order diversion; (3) Reproducibility rate of accounting results: Traditional template OCR is 92.3%, and pure large model solution is only 67%. 8%, the present invention relies on a deterministic rule engine to achieve 100% complete reproducibility; (4) Tax amount illusion error rate: the traditional template OCR is 1.27%, the pure large model is 3.42%, the present invention reduces the error rate to 0% through the tax amount deviation double verification mechanism; (5) Unmanned automated posting rate: the traditional template OCR is 35.6%, the pure large model is 81.2%, the present invention can reach 93.0%; (6) Comprehensive accounting processing efficiency: compared with the traditional manual + OCR solution, it is improved by 66.2%, and the basic financial accounting manpower cost is reduced by 51.5%.
[0037] 2. Ablation experiment verification of key indicators To verify the necessity of the core formula and decoupled architecture of this invention, ablation experiments were conducted: ① The tax deviation verification formula was turned off. After the verification mechanism was implemented, the tax error rate rebounded to 2.86%, and the accounting irregularity rate increased significantly; ② The amount reconciliation formula was closed. After self-consistency verification, the rate of missed detection of numerical inconsistencies in invoices increased by 4.1 times; ③ After canceling the deterministic calculation of the rule engine and relying entirely on the output of the large model, the reproducibility rate of accounting plummeted to 69.2%, and the numerical illusion problem reappeared; ④ After disabling the dynamic reduction mechanism of the budget formula, the rate of missed reporting of budget overrun warnings reached 18.7%. Ablation experiments proved that the core calculation formula nested in the claims and the decoupled architecture of AI and rules in this invention are the core necessary features for achieving high-precision, deterministic, and highly compliant accounting.
[0038] 3. Cross-border tax system adaptation experiment A comprehensive test was conducted on 26 TDS / VAT tax system combinations in Nepal. The invention achieved 100% accuracy in tax rate matching, with tax calculation deviations all controlled within the 0.5% threshold. The snapshots of multi-currency conversion rates were fully preserved, and the adaptability of cross-border account reconciliation and tax settlement was 100%, fully meeting the compliant accounting needs of cross-border enterprises with multiple tax systems.
[0039] 4. Risk Control and Audit Compliance Experiment The large-value transaction secondary confirmation and three-level authorization mechanism achieved a 100% pass rate in full-coverage testing. In the hash-fixed audit chain tampering simulation test, all tampered data could be accurately identified, and the full-chain traceability success rate was 100%, meeting the enterprise's internal control and financial and tax audit compliance standards.
[0040] This invention features template-free, highly adaptable recognition with strong scenario compatibility: It eliminates the need for fixed invoice recognition templates, supports independent parsing of multiple invoice formats, adapts to complex cross-border invoice scenarios, and ensures input data quality through confidence level filtering. This invention also features fully automated business routing, reducing manual intervention: It accurately distinguishes between three core financial scenarios—reimbursement, direct payment, and loans—achieving automatic order routing without human intervention, significantly improving the automation rate of bookkeeping. Furthermore, this invention ensures deterministic and reproducible accounting results, eliminating model illusions: Through a decoupled architecture between AI and the rule engine, core accounting calculations are executed by deterministic programs, coupled with a tax cross-verification mechanism, fundamentally avoiding the probabilistic output and numerical illusion problems of large models, ensuring unique output results for the same input. Finally, this invention is adaptable to cross-border multi-tax systems. Features: Built-in decision tables for 26 tax system and rate combinations covering Nepal's TDS and VAT, accurately adapting to the differentiated taxation needs of cross-border enterprises with strong compatibility; Differentiated accounting processing with high business adaptability: Dedicated accounting entry logic is configured for three types of financial transactions, linking with employee loan ledgers to achieve dynamic reconciliation, closely aligning with the actual financial accounting process of enterprises; Hierarchical risk control + full-link audit for comprehensive compliance: A three-level authorization and control system is constructed, balancing automation efficiency with financial internal control, achieving full traceability and reviewability through an append-only audit chain, meeting financial and tax compliance requirements; Dynamic budget control enables pre-emptive risk control: Real-time reduction of multi-dimensional budgets, automatic warnings for exceeding limits, achieving dynamic and refined management of enterprise budgets.
[0041] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A bookkeeping method that combines large language model perception with a deterministic rule engine, characterized in that, Includes the following steps: S1. Perception and Triage: Obtain the invoice image and user natural language description, extract the structured candidate fields and confidence level of the invoice through a multimodal large language model, analyze the business intent, determine the three types of business paths: reimbursement, direct payment, and loan, and extract the accounting information and store it in the queue to be verified. S2, Human-Machine Solidification Verification: Performs compliance and numerical self-consistency verification on queue data, supports interactive correction by users using natural language and system re-verification, triggers secondary confirmation for large transactions, and solidifies data and generates a unique hash value after confirmation; S3, Deterministic Accounting Decision: Matches tax rates based on the four-dimensional tax rate decision table, avoids model errors through tax deviation verification, generates balanced accounting entries according to business paths, completes multi-currency conversion and retention exchange rate snapshots, reduces budgets in real time and triggers over-limit warnings; S4. Hierarchical Audit Linkage: Based on the authorization matrix, accounts are posted hierarchically. Data throughout the entire process is retained through an anti-tampering audit chain, and business domain data is synchronized by publishing accounting events.
2. The accounting method for collaboration between large language model perception and deterministic rule engine as described in claim 1, characterized in that, The perception layer does not require a fixed invoice recognition template, supports independent parsing of multiple formats and multiple invoices, and allows independent configuration of confidence scores for each financial field. It can automatically distinguish between three types of financial scenarios: REF reimbursement, PAF direct payment, and BAF loan, and achieve unmanned automatic order routing.
3. The accounting method for collaboration between large language model perception and deterministic rule engine as described in claim 1, characterized in that, The verification layer supports multi-dimensional self-consistent verification of date, currency, numerical validity, and amount consistency, visually displays the recognition results, supports real-time error correction and automatic re-verification using natural language, and is configured with a risk control mechanism for secondary confirmation of large transactions and a SHA-256 data hash anti-tampering and solidification mechanism.
4. The accounting method for collaboration between large language model perception and deterministic rule engine as described in claim 1, characterized in that, The tax rate decision table is based on a four-dimensional matching of tax jurisdiction, transaction type, supplier attributes, and goods and services category, covering 26 tax system combinations in Nepal, including TDS and VAT. It has a preset tax deviation threshold of 0.5%, and when the deviation exceeds the limit, it will be forcibly returned to the verification layer for correction.
5. The accounting method for collaboration between large language model perception and deterministic rule engine as described in claim 1, characterized in that, The three business paths correspond to different accounting entry logics. Loan business can be linked to the employee loan ledger to realize dynamic balance updates and subsequent write-offs. All entries are subject to mandatory verification of debit and credit balance to ensure accounting compliance.
6. The accounting method for collaboration between large language model perception and deterministic rule engine as described in claim 1, characterized in that, The multi-currency conversion process permanently stores the original currency amount, the official exchange rate snapshot on the accounting date, and the converted amount in the local currency, completely preserving cross-border accounting data and adapting to cross-border auditing and tax settlement scenarios.
7. The accounting method for collaboration between large language model perception and deterministic rule engine as described in claim 1, characterized in that, Configure a three-tiered authorization risk control mechanism to achieve differentiated management of small transactions (automatic posting), medium transactions (posting notification and review), and large transactions (posting after manual approval), adapting to different accounting risk levels.
8. The accounting method for collaboration between large language model perception and deterministic rule engine as described in claim 1, characterized in that, An append-only tamper-proof audit chain is adopted to solidify and store core data such as hash values, rule versions, journal entries, approval paths, timestamps, and operating entities, enabling full-chain traceability and verification of accounting.
9. The accounting method for collaboration between large language model perception and deterministic rule engine as described in claim 1, characterized in that, The multimodal large language model only outputs unstructured candidate information. Core accounting operations such as tax review, numerical calculation, journal entry generation, and budget reduction are all executed by the deterministic rule engine. The same input and rule version can output a unique accounting result, eliminating the numerical illusion of the large model.
