Business document automatic voucher generation method and system based on dynamic rules

By using large language models and deep neural network technology, association rules are dynamically updated, which solves the problems of delayed system response and low efficiency of manual adjustment in the existing technology for generating vouchers for business documents, and realizes automated and accurate voucher generation to adapt to business and policy changes.

CN120805884APending Publication Date: 2025-10-17SHANDONG INSPUR GENESOFT INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511043415.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-10-17

Smart Images

  • Figure CN120805884A_ABST
    Figure CN120805884A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and provides a dynamic rule-based automatic voucher generation method and system for business receipts, and the method comprises the steps: obtaining a plurality of historical business receipts, extracting business receipt elements for each historical business receipt, and marking voucher elements; based on the business document elements and the voucher elements of the plurality of historical business documents, generating association rules of the voucher elements and the business document elements through a large language model in combination with the policy data; for each historical business document, calling association rules related to business document elements of the historical business document, and storing the association rules; and obtaining a to-be-processed business document, extracting business document elements, searching for the historical business document with the highest similarity, and generating voucher elements through the association rule stored in the historical business document with the highest similarity. And a new scene can be covered without manually modifying the template, so that the dependence on a static rule is eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of data processing, and particularly relates to a business document automatic voucher generation method and system based on dynamic rules. BACKGROUND

[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art.

[0003] In a business system, the accounting subject screening rule generally applies a preset rule template. This type of method requires manual presetting of voucher schemes, and requires secondary development when the business changes. It cannot realize intelligent migration of rules, and each type of document needs to be independently configured. When the tax / accounting standards change, manual adjustment of rules is inefficient and prone to errors.

[0004] In the prior art, the traditional preset rule template method has the following static rule defects: The traditional preset rule template relies on manual predefinition of fixed field mapping relationships (such as "business type = travel expenses → subject = management expenses"). When the business scenario changes (such as the addition of a "cross-border travel expenses" type), the document format is adjusted (such as the addition of a "foreign exchange rate" field), or the policy is updated (such as adjustment of travel expense reimbursement standards), the static rule will be directly invalidated, and the template needs to be manually modified, resulting in a lag in system response.

[0005] In the prior art, non-standardized documents (such as handwritten documents, third-party documents with disorganized formats) or special business scenarios (such as "research and development expense add-back deduction" and "cross-border payment tax fee apportionment") have complex logic and irregular fields, and static rules cannot identify element associations (such as being unable to automatically associate "research and development project number" with "add-back deduction ratio"). Manual judgment and voucher generation are required for each single document, which is inefficient and prone to errors. SUMMARY

[0006] To solve the technical problems in the background art, the present application provides a business document automatic voucher generation method and system based on dynamic rules. By generating association rules through a large language model + matching the similarity of historical documents, the system dynamically adapts to changes. The large language model can automatically update the association rules based on new historical data (such as identifying the new association between "cross-border travel expenses" and "management expenses - cross-border travel"). The to-be-processed document generates a voucher by matching the rules of similar historical documents, without the need for manual modification of templates to cover new scenarios and eliminate dependence on static rules.

[0007] To achieve the above purpose, the present application adopts the following technical solutions: The first aspect of the present application provides a business document automatic voucher generation method based on dynamic rules, which includes: Obtaining a plurality of historical business documents, and for each historical business document, extracting business document elements and labeling voucher elements; based on the business document elements and voucher elements of the plurality of historical business documents, combining policy data, and generating association rules of the voucher elements and the business document elements through a large language model; For each historical business document, retrieve its business document element related association rules for storage; Obtaining a to-be-processed business document, extracting business document elements, and finding the most similar historical business document, generating voucher elements through the association rules stored in the most similar historical business document.

[0008] Further, the extracting step of the business document elements comprises: For the text in the business document, a deep neural network is used to recognize business entities, and a BiLSTM semantic encoder is used to extract text feature vectors for each business entity and its context; For the numerical value in the business document, a numerical value embedding layer is used to obtain a numerical value feature vector; The text feature vector and the numerical value feature vector are fused to obtain a fused feature vector; The fused feature vector is weighted and fused to obtain a weighted fused feature; Based on the weighted fused feature, feature mapping and multi-task classification are performed to obtain labels of entities and numerical values, and the labels, entities and numerical values are integrated to obtain business document elements.

[0009] Further, the BiLSTM semantic encoder extracts word-level features, phrase-level features and sentence-level features for each business entity and its context, and then performs feature pyramid fusion to obtain a text feature vector.

[0010] Further, the weight in the weighted fusion is: ; Wherein, the basic attention weight , f i is the feature of the i-th element in the fused feature vector, q is the query vector, d is the dimension of the fused feature vector, and the accounting term is added , the set of accounting terms is D, and the term t belongs to D.

[0011] Further, it further comprises: In response to the cross-document migration instruction, and obtaining the target document that needs to be migrated; Comparing the feature vectors of the target document and the plurality of historical business documents to calculate a semantic similarity score; For the target document and the plurality of historical business documents, respectively extract a set of business document elements, and calculate a structural similarity; Based on the semantic similarity score and the structural similarity, the total similarity of the target document and each historical business document is calculated, and the association rules corresponding to the historical business documents with the highest total similarity and exceeding the threshold are migrated to the target document.

[0012] Further, the structural similarity Sstru=1-[edit distance of the source document and the target document / max (length of the business document element set of the source document, length of the business document element set of the target document)], wherein the source document is one historical business document.

[0013] Further, the feature vector used when calculating the semantic similarity score is: Emb(t)=BERT(t)+∑ r∈R(t) wr·Emb(r); Wherein R(t) is a set of entities associated with the word t in the accounting subject knowledge graph, wr is the association weight, and Emb(r) is the vector representation of the entity r generated by the graph embedding model.

[0014] Further, it further comprises: in response to a policy change instruction, analyzing the policy key change point, and updating the association rules of the voucher elements and the business document elements through the large language model.

[0015] The second aspect of the application provides a business document automatic voucher generation system based on dynamic rules, which comprises: An association rule construction module configured to: obtain a plurality of historical business documents, and for each historical business document, extract business document elements and label voucher elements; based on the business document elements and the voucher elements of the plurality of historical business documents, combine policy data, and generate association rules of the voucher elements and the business document elements through a large language model; An association rule storage module configured to: for each historical business document, retrieve the association rules related to its business document elements and store them; A voucher generation module configured to: obtain a to-be-processed business document, extract business document elements, and find the historical business document with the highest similarity, and generate voucher elements through the association rules stored by the historical business document with the highest similarity.

[0016] The third aspect of the application provides a computer device, comprising a computer readable storage medium, a processor and a computer program stored on the computer readable storage medium and executable on the processor, wherein the processor executes the program to realize the steps of the above-mentioned business document automatic voucher generation method based on dynamic rules.

[0017] Compared with the prior art, the application has the following beneficial effects: The application provides a dynamic rule-based business document automatic voucher generation method, which generates associated rules through a large language model + historical document similarity matching, dynamically adapts to changes, and the large language model can automatically update the associated rules based on newly added historical data (for example, identifying a new association between "cross-border travel expenses" and "management expenses-cross-border travel").

[0018] The application provides a dynamic rule-based business document automatic voucher generation method, which extracts core business elements (for example, identifying "business type", "amount" and other key information from a handwritten document) for non-standardized documents; matches historical similar documents based on the elements (even if the formats are different, as long as the core elements are consistent, the documents can be matched), and generates vouchers by reusing the associated rules to reduce manual intervention (especially suitable for special scenarios - as long as there are similar cases in the history, the rules can be automatically reused).

[0019] The application provides a dynamic rule-based business document automatic voucher generation method, which uses an improved BiLSTM+Attention model to extract key features of the document, realizes end-to-end automatic generation of "business document→rule", and replaces manual configuration.

[0020] The application provides a dynamic rule-based business document automatic voucher generation method, which establishes a rule similarity matching model, realizes cross-document rule migration, and solves the problem of multi-type document rule adaptation.

[0021] The application provides a dynamic rule-based business document automatic voucher generation method, which establishes a policy response engine, monitors a policy database in real time, and shortens the policy response time. BRIEF DESCRIPTION OF DRAWINGS

[0022] The drawings accompanying the specification of the application form part of the application and serve to provide further understanding of the application, the illustrative embodiments of the application and their description serve to explain the application, and do not constitute an improper limitation of the application.

[0023] Figure 1 is a flowchart of a dynamic rule-based business document automatic voucher generation method according to the first embodiment of the application; Figure 2 is a flowchart of intelligent semantic analysis according to the first embodiment of the application; Figure 3 is a structural diagram of a BiLSTM semantic encoder according to the first embodiment of the application; Figure 4 is a flowchart of cross-document rule migration according to the first embodiment of the application; Figure 5 is a structural schematic diagram of a computer device according to the third embodiment of the application. DETAILED DESCRIPTION

[0024] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application.

[0025] It should be pointed out that the following detailed description is exemplary and is intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as generally understood by those of ordinary skill in the art to which the present application belongs.

[0026] Embodiment one The present embodiment provides a method for automatically generating vouchers based on dynamic rules of business documents.

[0027] The method for automatically generating vouchers based on dynamic rules of business documents provided by the present embodiment, as shown in Figure 1 , includes the following steps: Step 1, intelligent semantic analysis of business documents.

[0028] Step 101, obtain historical business documents, and after extracting characters by OCR recognition, obtain an original character set that has not been classified (may contain characters, numbers, symbols, and even garbled codes due to recognition errors); extract numerical fields (structured data) such as amount, date, and tax rate by pre-set field feature rules; after extracting the above numerical fields, remove redundant symbols (such as colons, spaces, etc.) in the original OCR results to obtain text content (document text).

[0029] Among them, the pre-set field feature rule can be: such as matching "amount: (\d+.\d+)" to extract "5000.00", such as extracting the date by date format regular expression (such as "\d{4}-\d{2}-\d{2}"), such as matching "tax rate: (\d+)%" to extract the tax rate "9%".

[0030] Step 102, as shown in Figure 2 , based on the text content and the numerical fields, extract the business document elements.

[0031] (1) For the text content T, after performing word segmentation and standardization processing (such as full-width to half-width conversion, unified case), T' is obtained, and a deep neural network (such as BERT) is used to recognize business entities (such as "technical service fee", "travel expense reimbursement", "USD", "X country xx supplier"): ; Among them, E is a set of business entities, e i represents a single business entity, and k is the number of entities.

[0032] (2) For each business entity and its context, extract the text feature vector through the BiLSTM semantic encoder (capture the context dependence, such as the association between "USD" and "X country xx supplier").

[0033] A single BiLSTM layer cannot capture the differences in word / phrase / sentence features, such as Figure 3 As shown, the BiLSTM semantic encoder uses word-level BiLSTM, phrase-level CNN, sentence-level Transformer, and feature pyramid fusion mechanism to identify "travel expenses" (word level), "overseas technical services" (phrase level), and "in line with the policy of adding and deducting" (sentence level) features.

[0034] Let the sequence composed of business entities and contexts be S = [s1, s2,..., s k ], s k is a text unit, and the features are extracted through a multi-level encoder: Among them, the word-level feature (BiLSTM): capture the word-level dependence F word = BiLSTM(S); Among them, the phrase-level feature (CNN): extract the phrase-level local feature F phrase = CNN(S); Among them, the sentence-level feature (Transformer): capture the sentence-level global dependence F sent = Transformer(S) = MultiHeadAttention(Emb(S)); where Emb(S) is the embedding vector of the text unit, and MultiHeadAttention is the multi-head attention mechanism.

[0035] Feature pyramid fusion: fuse multi-level features to output text feature vector F text = Pyramid(F word ,F phrase ,F sent )=∑ l∈{word,phrase,sent} α l ·F l ; where α l is the level weight, and the importance of different level features is learned through training.

[0036] (3) For numerical fields, get the numerical feature vector F num through the numerical embedding layer.

[0037] (4) For the text feature vector and the numerical feature vector, input the feature fusion layer, and fuse the text feature and the numerical feature through concatenation or gating mechanism (such as using Sigmoid to control the weight proportion of the text / numerical feature) to obtain a fused feature vector F fusion .

[0038] (5) For the fused feature vector F fusion , perform attention weighting to obtain a weighted fused feature.

[0039] The general attention does not pay enough attention to financial terms (such as "input tax deduction"), and the embodiment enhances the weight of accounting terms. The terms in the accounting subject dictionary obtain a basic weight bonus, and the weight = basic attention + term bonus coefficient. A dynamic aggregation strategy is applied to automatically improve the weight of high-amount fields, and a domain adaptive attention mechanism is established.

[0040] Let the fused feature vector sequence be F fusion =[f1,f2,...,f d ] (d is the number of entities and numerical fields), and calculate the domain adaptive attention weight: Basic attention weight: calculated by the general attention mechanism , wherein q is the query vector (Query); Accounting term bonus: let the set of accounting terms be D, if the feature f i corresponds to a term t∈D, then the bonus coefficient is β t (preset or training learning): ; Maximum weight and weighted feature: ; F weighted =[α1f1,α2f2,...,α d f d ].

[0041] (6) The weighted fused feature needs to go through the "feature mapping → multi-task classification" link, and special output branches are designed for different types of labels (business type, currency, supplier location, etc.), as follows: The weighted features are first compressed and dimensionally adapted by 1-2 fully connected layers (with ReLU activation function) to map the fused features into "task feature vectors" that are more suitable for label prediction (e.g., mapping 1024-dimensional fused features to 256-dimensional task features); independent output branches are designed according to the label types (all are classification tasks), each branch corresponds to the prediction of a label type, for example: Business type branch: For predefined business types such as "technical service" and "travel expense reimbursement", use Softmax activation function for multi-classification output (output dimension = number of business type categories); Currency branch: For currencies such as "USD" and "CNY", use Softmax multi-classification output (output dimension = number of currency categories); Supplier's place of origin branch: For "X country" and others, use Softmax multi-classification output (output dimension = number of place of origin categories); Tax rate / amount verification branch: Although the amount and tax rate have been extracted by OCR, the binary classification output ("valid" / "invalid") can be used to verify the reasonableness of the values (such as whether the "tax rate 9%" in the text is consistent with the extracted "9%").

[0042] Each output branch outputs the class probability through Softmax, and the class with the highest probability is taken as the prediction result of the label (e.g., the currency branch outputs "USD" probability 0.92 and "CNY" probability 0.08, then the predicted currency is USD).

[0043] Finally, the business document element set S is obtained, for example, business type: technical service, currency: USD, amount: 5000, supplier's place of origin: X country.

[0044] Step 2, for each historical business document, label the voucher elements, combine the policy data, and use a large language model to generate the association rules between the voucher elements and the business document elements.

[0045] Step 201, data preprocessing and LLM input construction.

[0046] Core goal: Convert raw data into LLM understandable input format, improve rule mining accuracy.

[0047] Standardize Si (business elements) and Ci (voucher elements) in historical labeled data: Business elements: unify field names (such as "amount" and "business type"), standardize expressions (such as "travel accommodation" unified as "accommodation fee"); Voucher elements: unify subject names based on the accounting subject dictionary (such as "management fee-travel" unified as "management fee-travel expense").

[0048] Example: Standardize the original sample <“Business Type: Business Trip Accommodation, Amount: 3000 Yuan”, “Account: Management Fee – Travel”> to <“Business Type: Accommodation Fee, Amount: 3000 Yuan”, “Account: Management Fee – Travel Fee”>.

[0049] Step 202, Policy Rule Structured Parsing.

[0050] Use LLM to “condition-conclusion” disassemble natural language policy text, and convert it into structured policy knowledge that LLM can call: Input prompt: “Please disassemble the following policy into ‘applicable conditions’ and ‘allowed associated voucher elements’: Policy text: ‘Accommodation fee reimbursement account limit management expenses / sales expenses, single amount ≤10,000 can be directly reimbursed’”; Output result: <Applicable conditions: “Business Type = Accommodation Fee, Amount ≤ 10000 Yuan”; Allowed Voucher Elements: “Account = Management Expenses / Sales Expenses”>.

[0051] Step 203, LLM Input prompt construction.

[0052] Integrate standardized samples and structured policies to build a “task instruction + example + data” prompt, and clearly define the rule generation target: Task instruction: “Based on the following historical business and voucher association samples, combined with policy constraints, generate ‘IF-THEN’ format business rules (rules need to meet: comply with policies; cover high-frequency business scenarios; conditions include business elements, conclusions include voucher elements)”; Example injection: “Reference example: Sample <“Business Type: Accommodation Fee, Amount: 3000 Yuan”, “Account: Management Fee – Travel Fee”>, policy requirement “Accommodation fee amount ≤10,000 can be associated with management expenses”, generate rule: IF Business Type = Accommodation Fee AND Amount ≤10000 Yuan THEN Account = Management Fee – Travel Fee”; Data input: Batch input standardized samples (such as the first 1000 high-frequency samples) and structured policies.

[0053] Step 204, LLM Association Reasoning and Rule Initial Generation.

[0054] Core goal: Use LLM's semantic association capabilities to mine business element and voucher element associations from historical data and preliminarily generate rules.

[0055] LLM, based on the input samples and prompts, identifies high-frequency and strongly associated <Si, Ci> pairs through “semantic clustering + association reasoning”: Semantic clustering: LLM automatically classifies similar business elements (e.g., "accommodation fee", "hotel accommodation", "travel accommodation" into the same business type) into the same category; Correlation reasoning: Based on sample frequency and semantic similarity, judge the correlation strength (e.g., "accommodation fee" and "management fee-travel fee" have a correlation frequency of 90%, and are identified as strong correlation).

[0056] LLM generates a natural language rule draft based on "strong correlation pairs" and the rule format requirements in the prompt, including "conditions (business elements)" and "conclusions (voucher elements)": Example: For the strong correlation pair < "business type: technical service fee", "subject: management fee-technical service fee" >, generate the rule draft: "If the business type is technical service fee, the corresponding voucher subject is management fee-technical service fee"; Supplementary logic: For low-frequency but important correlations (e.g., "business type: R&D service fee", although the sample is small, but the policy requires correlation with "R&D expenses"), LLM can generate rules based on policy priority (avoid missing due to small sample size).

[0057] Step 205, LLM policy compliance verification and rule revision.

[0058] Core goal: Use LLM's ability to understand policy semantics to verify whether the rule draft conforms to the policy and revise rules that violate the policy.

[0059] Input the rule draft and structured policy (decomposed <applicable conditions, allowed voucher elements> in step 201) into LLM, and make compliance judgments through prompt instructions: Input prompt: "Judge whether the following rule conforms to the policy: Rule: 'IF business type = accommodation fee AND amount = 15000 yuan THEN subject = management fee-travel fee'; Policy: 'Accommodation fee single amount ≤10,000 can be associated with management expenses, over 10,000 needs special approval' "; LLM output judgment result: "Rule violation (amount 15000 yuan exceeds policy upper limit 10000), need to modify the condition to 'amount ≤10000' or supplement 'amount >10000 need to mark "special approval"'".

[0060] For rules that violate the policy, LLM automatically revises the conditions or conclusions based on policy requirements: Condition revision: As mentioned above, the rule is revised to "IF business type = accommodation fee AND amount ≤10000 THEN subject = management fee-travel fee"; Supplementary constraints: Additional conditions required by policy (e.g., "Overseas travel expenses must be marked 'cross-border'"), LLM supplements in rules: "IF Business Type = Travel Expenses AND Supplier Location = Overseas THEN Account = Management Expenses - Travel Expenses (Mark: Cross-border)"; For rules that cannot be corrected (e.g., "Business Type: Gift Expenses" is associated with "Management Expenses", but the policy clearly states "Gift Expenses cannot be included in Management Expenses"), LLM directly marks as "Invalid Rule" and removes.

[0061] Step 206, rule structure conversion and standardization.

[0062] Core goal: Convert natural language rules generated by LLM into executable structured rules (such as JSON / rule engine format) for subsequent calls.

[0063] Based on the preset rule template (e.g., "Condition: {Field1: Value1, Field2: Value2...}; Conclusion: {Field: Value}"), LLM converts natural language rules into structured format: Natural language rule: "If the business type is technical service fee and the tax rate is 6%, the corresponding voucher account is management expenses - technical service fee"; Structured output: { "Condition": { "Business Type": "Technical Service Fee", "Tax Rate": "6%"}, "Conclusion": { "Account": "Management Expenses - Technical Service Fee"}}.

[0064] LLM combines with accounting term dictionary to unify field names and values in rules (avoid ambiguity): Before standardization: "Business Type: Tech Service, Tax Rate: 6"; After standardization: "Business Type: Technical Service Fee, Tax Rate: 6%" (match accounting terms and field specifications).

[0065] Step 207, rule verification and optimization (manual + LLM collaboration).

[0066] Core goal: Ensure the accuracy and coverage of rules, and optimize through feedback iteration.

[0067] LLM uses test data sets (historical samples not involved in training) to perform matching tests on rules: Input test sample: < "Business Type: Accommodation Expenses, Amount: 8000 yuan" >; Rule matching: Call rule "IF Business Type = Accommodation Expenses AND Amount ≤ 10000 yuan THEN Account = Management Expenses - Travel Expenses"; Verification result: "Match success, output conclusion correct" (if the actual voucher elements of the test sample are consistent with the rule conclusion); if not consistent (such as the actual subject of the sample is "sales expenses-travel expenses"), LLM is marked as "rule to be optimized".

[0068] The "invalid rule", "rule to be optimized" or high-frequency business scenario rule marked by LLM is reviewed by financial personnel: If the rule misses the association (such as not covering "business type: conference accommodation expenses"), manually supplement the sample and feed back to LLM; If the policy understanding is biased (such as LLM misjudging the "R&D service fee" policy), manually correct the policy disassembly result and re-input LLM.

[0069] LLM adjusts the generation logic based on manual feedback (such as increasing sample weight, correcting policy analysis method), and regenerates rules: Example: manual feedback "conference accommodation expenses should be associated with 'conference fees' instead of 'travel expenses'", LLM updates the clustering logic (splits "conference accommodation expenses" from "travel expenses" class to "conference fees" class), and generates a new rule: "IF business type = conference accommodation expenses THEN subject = management expenses-conference fees" Step 3, real-time response to policy changes, interface with official policy data (such as tax bureau announcement interface), real-time analysis of key policy changes (such as "R&D expense addition deduction ratio adjusted to 100%").

[0070] Based on semantic analysis, identify the affected rules, locate all R&D class document rules according to the keyword "R&D expense", build a list of affected rules, automatically reconstruct the calculation logic (such as modify the deduction ratio parameter) through LLM, save the historical version of the rule, support audit tracking query, use test data set to verify the new rule before deployment, and trigger manual review when the error rate exceeds the threshold.

[0071] Step 4, cross-document migration rules, such as Figure 4 As shown, including the following steps: Step 401, compare the feature vectors of the source document (such as a normal payment order) and the target document (such as a cross-border payment order), calculate the semantic similarity score (range 0-1) through a deep semantic model.

[0072] Specifically, build an accounting subject knowledge graph, for each word t of the source document and the target document, after encoding, calculate the semantic similarity.

[0073] Wherein, each word t is encoded as: Emb(t)=BERT(t)+∑ r∈R(t) wr·Emb(r); wherein R(t) is the set of entities associated with the word t in the knowledge graph, wr is the association weight (0≤wr≤1), and Emb(r) is the vector representation of the entity generated by a graph embedding model (e.g., GNN).

[0074] Step 402: Using the method of step 1, extract the business document element set of the source document and the target document, respectively, and calculate the structural similarity.

[0075] An example of structural similarity calculation is as follows: The business document element set of the source document: business type: technical service, currency: CNY, amount: 5000, supplier's location: X country; The business document element set of the target document: business type: technical service, currency: USD, amount: 5000, supplier's location: X country; Structural similarity Sstru=1-[edit distance / max (length of the business document element set of the source document, length of the business document element set of the target document)].

[0076] Step 403: Dynamic weight allocation, calculate the total similarity = α × semantic similarity + β × structural similarity; α = f (complexity of the source document), β = g (length of the business document element set of the source document). Similarity threshold >= 0.85, directly migrate and adapt the rules, similarity threshold between 0.75-0.84, need manual confirmation whether to migrate the rules, similarity threshold < 0.75, create new document rules.

[0077] Step 5: Rule execution and feedback. Obtain the business document to be processed, extract the business document elements, and based on the business document elements, find the historical business document with the highest similarity, and generate the voucher elements through the associated rules of the historical business document with the highest similarity. If the similarity with all historical business documents is less than 90%, go to step 4 or create new rules.

[0078] When generating the voucher, according to the document feature matching rule library, automatically output the voucher elements according to the rules. The documents that do not match the rules are transferred to the processing queue for manual processing, and the manual processing results are fed back to the LLM, and the rule execution error rate is analyzed every month, and through the LLM, the inefficient rules are automatically optimized (such as merging redundant conditions, etc.).

[0079] For example, the output voucher elements are as follows: Abstract: payment of technical consulting fee to X company in X country; Account: management expenses-technical service fee (original currency USD); Amount: 5000 × exchange rate 6.92 = 34600 yuan.

[0080] Example two This embodiment provides a system for automatically generating vouchers for business documents based on dynamic rules, including: The association rule building module is configured to: obtain a number of historical business documents, extract business document elements from each historical business document, and annotate voucher elements; based on the business document elements and voucher elements of the historical business documents, combined with policy data, and using a large language model, generate association rules between voucher elements and business document elements; An association rule storage module is configured to: for each historical business document, retrieve and store association rules related to its business document elements; The voucher generation module is configured to: obtain the business document to be processed, extract the business document elements, and find the historical business document with the highest similarity, and generate the voucher elements according to the association rules stored in the historical business document with the highest similarity.

[0081] It should be noted here that the various modules in this embodiment correspond one-to-one to the various steps in Example 1, and the specific implementation processes are the same, which will not be repeated here.

[0082] Example 3 This embodiment provides a computer device, such as Figure 5 As shown, the system includes a computer-readable storage medium 1003, a processor 1001, a communication interface 1002, and a computer program stored on the computer-readable storage medium 1003 and executable by the processor 1001. The processor 1001, the communication interface 1002, and the computer-readable storage medium 1003 may be connected via a bus or other means. The communication interface 1002 is configured to receive and transmit data. When the processor 1001 executes the program, the steps of the method for automatically generating vouchers for business documents based on dynamic rules, as described in the first embodiment, are implemented.

[0083] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A method for automatically generating vouchers from business documents based on dynamic rules, characterized in that: include: Obtain several historical business documents, extract the business document elements for each historical business document, and mark the voucher elements; Based on the business document elements and voucher elements of several historical business documents, combined with policy data, and using a large language model, association rules between voucher elements and business document elements are generated; For each historical business document, retrieve the association rules related to its business document elements and store them; Obtain the business documents to be processed, extract the business document elements, and find the historical business documents with the highest similarity. Generate voucher elements based on the association rules stored in the historical business documents with the highest similarity.

2. A method for automatically generating vouchers from business documents based on dynamic rules as claimed in claim 1, characterized in that: The steps of extracting the business document elements include: For the text in business documents, a deep neural network is used to identify business entities. A BiLSTM semantic encoder is used to extract text feature vectors for each business entity and its context. For the numerical values ​​in the business documents, the numerical feature vector is obtained through the numerical embedding layer; Perform feature fusion on the text feature vector and the numerical feature vector to obtain a fused feature vector; For the fused feature vector, weighted fusion is performed to obtain weighted fusion features; Based on weighted fusion features, after feature mapping and multi-task classification, the labels of entities and values ​​are obtained. The labels, entities and values ​​are integrated to obtain the business document elements.

3. A method for automatically generating vouchers for business documents based on dynamic rules as claimed in claim 2, characterized in that: The BiLSTM semantic encoder extracts word-level features, phrase-level features, and sentence-level features from each business entity and its context, and then fuses them through a feature pyramid to obtain a text feature vector.

4. A method for automatically generating vouchers for business documents based on dynamic rules as claimed in claim 2, characterized in that: The weights in the weighted fusion are: ; Among them, the basic attention weight , f i is the feature of the i-th element in the fusion feature vector, q is the query vector, d is the dimension of the fusion feature vector, and accounting term addition , the accounting term set is D, and term t∈D.

5. The method for automatically generating vouchers for business documents based on dynamic rules as claimed in claim 1, characterized in that: Also includes: Respond to the cross-document migration instruction and obtain the target document to be migrated; Compare the feature vectors of the target document with those of several historical business documents and calculate the semantic similarity score; For the target document and several historical business documents, extract the business document element sets and calculate the structural similarity; Based on the semantic similarity score and structural similarity, the total similarity between the target document and each historical business document is calculated, and the association rules corresponding to the historical business documents with the highest total similarity that exceeds the threshold are migrated to the target document.

6. A method for automatically generating vouchers for business documents based on dynamic rules as claimed in claim 5, characterized in that: The structural similarity Sstru=1-[edit distance between the source document and the target document / max(business document element set length of the source document, business document element set length of the target document)], where the source document is a historical business document.

7. The method for automatically generating vouchers from business documents based on dynamic rules as claimed in claim 1, characterized in that: The feature vector used in calculating the semantic similarity score is: Emb(t)=BERT(t)+∑ r∈R(t) wr·Emb(r); Among them, R(t) is the set of entities associated with word t in the accounting subject knowledge graph, wr is the association weight, and Emb(r) is the vector representation of entity r generated by the graph embedding model.

8. The method for automatically generating vouchers from business documents based on dynamic rules as claimed in claim 1, characterized in that: Also includes: In response to policy change instructions, key policy change points are parsed, and the association rules between voucher elements and business document elements are updated through the large language model.

9. A system for automatically generating vouchers for business documents based on dynamic rules, characterized in that: include: The association rule building module is configured to: obtain a number of historical business documents, extract business document elements from each historical business document, and annotate voucher elements; based on the business document elements and voucher elements of the historical business documents, combined with policy data, and using a large language model, generate association rules between voucher elements and business document elements; An association rule storage module is configured to: for each historical business document, retrieve and store association rules related to its business document elements; The voucher generation module is configured to: obtain the business document to be processed, extract the business document elements, and find the historical business document with the highest similarity, and generate the voucher elements according to the association rules stored in the historical business document with the highest similarity.

10. A computer device comprising a computer-readable storage medium, a processor, and a computer program stored on the computer-readable storage medium and executable on the processor, wherein: When the processor executes the program, the steps of the method for automatically generating vouchers from business documents based on dynamic rules as described in any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • RPA robot intelligent verification method and system for financial voucher processing

    CN121788278A