Automated financial settlement method and device
By obtaining company account change information in real time, building a loan account and performing balanced calculations, the problem of inaccurate financial data caused by incorrect entries in the existing technology is solved, and efficient and accurate financial settlement and accounting is achieved.
Patent Information
- Application Number
- CN202411307331.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-09-19
AI Technical Summary
In the prior art, when processing sales orders and conducting large-scale entries and accounting, if a small part of the entries occurs, it is easy for the automation system to fail to properly write off, and the entries nodes are difficult to check and correct, affecting the accuracy and completeness of financial data.
By obtaining company account change information in real time, conducting total order query on the bank and enterprise database, building a loan account, performing loan balance calculations and financial updates, and making error alarms and automatic corrections when there is an imbalance to ensure the accuracy and completeness of financial data.
Real-time financial settlement is realized, the accuracy and reliability of financial statements are improved, the workflow of accountants is simplified, and the processing efficiency of accountants is improved through automatic error traceability and alarm.
Smart Images

Figure CN119398946B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial settlement, and in particular to an automated financial settlement method and device. Background Art
[0002] Double-entry bookkeeping is a standard accounting record method. Each transaction needs to be recorded in two or more accounts to ensure that the accounting equation (assets = liabilities + owner's equity) is always balanced. The core of double-entry bookkeeping is that for each transaction order, both the debit and credit sides must be recorded to ensure the accuracy and completeness of financial data. It is the basis of modern accounting. Accurate bookkeeping is crucial for corporate management and financial analysis. It not only reflects the operating status of the company, but also provides a basis for management decision-making and helps companies achieve financial transparency and compliance.
[0003] However, in actual applications, when there are a large number of transaction orders that need to be reconciled and written off, accountants are prone to fatigue and affect the efficiency of reconciliation, and accountants who are not familiar with financial software are also prone to affect the efficiency of reconciliation and write-off. In addition, when erroneous entries occur, it is difficult to troubleshoot and correct the erroneous entry nodes.
[0004] The existing partially automated accounting methods realize the automatic matching and cancellation of bank statements and internal corporate bills, so as to reduce manual intervention and improve work efficiency by automatically identifying related transaction information. However, when these existing technologies process a large number of sales orders and make accounting entries, if a small number of erroneous entries occur, it is easy for the automated system to fail to normally cancel the entire sales order when the bank receives or makes a payment. In particular, there are problems with erroneous entry nodes that are difficult to troubleshoot and correct, which affects the accuracy and integrity of financial data. Summary of the invention
[0005] Based on this, an object of the present invention is to provide an automated financial settlement method.
[0006] An automated financial settlement method comprises the following steps:
[0007] S1. Query the bank-enterprise database for total orders based on the company's account change information, and query the order database for entry information based on the query results to obtain the entry voucher corresponding to the relevant total order information;
[0008] S2. Construct debit and credit accounts according to the entry voucher, and perform debit and credit balance calculation to obtain the current debit and credit balance information;
[0009] S3. Financially update the asset account according to the current loan balance information, obtain the current asset change information, and determine whether the information is balanced according to the account balance system: if yes, complete the financial update; if no, roll back to the backup state and record the imbalance information, and execute step S4;
[0010] S4. Issue an error alarm based on the imbalance information, and correct the loan account to obtain the current loan balance information, and execute step S3.
[0011] Compared with the prior art, the automated financial settlement method of the present invention realizes real-time financial settlement through company account change information, ensures that financial data is kept up to date, prevents financial data from lagging, and thus improves the accuracy and reliability of financial statements. At the same time, by constructing loan accounts for related orders, refined accounting is achieved, thereby improving the accuracy and transparency of accounting and simplifying the workflow of accountants. In addition, when an imbalance in the balance sheet occurs, the corresponding related loan accounts can be queried to achieve error tracing and automatic alarm, thereby improving the processing efficiency of accountants.
[0012] Furthermore, the step S4 also includes the following sub-steps:
[0013] S41. Tracing errors in the order database according to the entry voucher in the imbalance information, obtaining a number of source data and corresponding key position indexes, and highlighting a number of data sources according to the key position indexes to obtain error-related content data, displaying the error-related content data to the client, and obtaining correction information from the user; wherein the order database is constructed using an accounting subject classification model based on RoBERTa;
[0014] S42. Correct the current debit and credit account according to the user's correction information, and use the corrected information as the current debit and credit balance information, and execute step S3.
[0015] Furthermore, the construction of the order database includes the following steps:
[0016] SA1: Preprocess the text images of different data sources of the total order information to obtain relevant text information;
[0017] Wherein, the pre-processing includes the following sub-steps:
[0018] Recognize text images through optical character recognition and extract text information;
[0019] Use the preset regular expression to clean the text information, and perform abbreviation conversion on the cleaned data to obtain relevant text information. The specific expression is as follows:
[0020] Tclean ={t1, ..., t i ,…,t n}, i≤n
[0021] Where, T clean is the cleaned data, t i is the relevant text, n is the total number of text information; then, the relevant text t involved in the abbreviation conversion i Increase the weight. The specific expression is as follows:
[0022] w i ′=w i ×(1+α)
[0023] In the formula, w i ′ is the relevant text t i The weight after participating in the abbreviation conversion; w i For the relevant text i The weight before the abbreviation conversion; α is the weight coefficient;
[0024] Based on this, the specific expression of its related text information is as follows:
[0025] T={(t1,w n ′),(t2,w2′),…,(t n ,w n ′)}
[0026] SA2: Perform word segmentation and entity recognition on relevant text information through a preset vocabulary to obtain keyword groups;
[0027] The steps of obtaining the keyword group are as follows:
[0028] Segment the relevant text information into several initial subsets. The specific expressions are as follows:
[0029]
[0030] Where, T is the relevant text information; t n is the nth relevant text in T; k m is the nth related text t n The mth word after word segmentation; w n is the weight corresponding to the nth related text; K n init From t n An initial subset of words extracted from and their corresponding weights;
[0031] Entity recognition is performed on several initial subsets to extract several keyword subsets, which are specifically expressed as follows:
[0032]
[0033] In the formula, K n entity Represents the initial subset K n init The keyword subset extracted from the , which contains the keywords identified as entities and their corresponding weights; m Represented as vocabulary k m The identified keywords belong to the preset word list
[0034] Repeated statistics are performed on several keyword subsets, and the weights of the keywords in the keyword subsets are updated to obtain keyword groups. The specific expression is as follows:
[0035] w m ′=w m ×α r-1
[0036] In the formula, w m ' is the keyword e m The corresponding weight, w m For keyword e m The corresponding original weight, r is the keyword e m The number of times it appears in all keyword subsets; α is the weight adjustment coefficient, and its coefficient value range is 1<α<2. The expression of the keyword group is as follows:
[0037] K adj ={K1 adj ,K2 adj ,…,K n adj ={(e m ,w m ′)|k m ∈t n}}
[0038] SA3: Use a sliding window to perform context extraction on relevant text information according to the keyword group to obtain a context-keyword group; wherein the expression for the nth context-keyword group is:
[0039]
[0040] In the formula, k max(0,m-s) and k min(m+s,n) are respectively represented as the mth keyword e m The previous and next words, the context fragment determined by the dynamic sliding window step size s; K n adj is the nth keyword group; K n init is the nth initial subset; its mth keyword em The specific calculation of the sliding window step size is as follows:
[0041]
[0042] In the formula, w m For keyword e m The corresponding weight; s0 is the basic step size of the sliding window; β is the adjustment coefficient;
[0043] SA4: Classify the context-keyword group by the accounting subject classification model based on RoBERTa to obtain relevant accounting entry information;
[0044] SA5: Matching the accounting subjects and amounts in the relevant accounting entry information one by one to obtain a number of preliminary entry vouchers, and attaching the preliminary entry vouchers according to the keyword group to obtain a number of entry vouchers; then, constructing a position index for the images of the different data sources of the general order information, obtaining a key position index, and associating it with the number of entry vouchers, the general order information and the number of data sources, and storing it in the order database, thereby completing the construction of the order database;
[0045] The location index is constructed by performing keyword search on images from different data sources according to the context-keyword group corresponding to the entry voucher to obtain the paragraph corresponding to the image, and converting the paragraph into corresponding paragraph coordinates.
[0046] The present invention further combines natural language processing technology to enter the total order information, greatly reducing manual intervention, while significantly improving the efficiency and reliability of the system when processing a large number of entries. By establishing key query paths with images from different data sources, data tracing is achieved, enhancing the transparency and traceability of the system, thereby improving the accuracy and integrity of financial data.
[0047] In addition, the key position index constructed through context-keyword groups can provide the key text data corresponding to the entry voucher recognized by the user's current model, ensuring that the user can obtain comprehensive reference information during the error correction and tracing process, thereby accelerating problem location and correction, and further improving the overall process efficiency and accuracy.
[0048] Furthermore, the accounting subject classification model based on RoBERTa includes an input embedding module, an encoder module and an accounting subject classification module;
[0049] The input embedding module is used to segment the context-keyword group, and vectorize and position encode it in sequence to obtain a number of position-encoded word embeddings;
[0050] The encoder module is used to calculate the multi-head self-attention weights of several position encoding word embeddings, and perform nonlinear transformation and information aggregation on them to obtain accounting subject feature information;
[0051] The accounting subject classification module includes a pooling layer, a fully connected layer, a subject classification submodule and an amount division submodule;
[0052] The pooling layer is used to perform pooling and dimensionality reduction on the accounting subject feature information to obtain pooled feature information;
[0053] The fully connected layer is used to linearly transform the pooled feature information using an activation function to obtain features to be identified;
[0054] The subject classification submodule is used to identify the accounting subject of the feature to be identified and obtain the accounting subject label;
[0055] The amount division submodule is used to use the subject-amount recognition model to identify the amount of context-keyword groups, accounting subject feature information, accounting subject labels and features to be identified, obtain accounting subjects and corresponding amounts, and combine the accounting subjects and corresponding amounts to obtain relevant accounting entry information.
[0056] Furthermore, the subject-amount recognition model includes an accounting subject deep feature extraction module, an accounting subject shallow feature extraction module, a feature fusion module and an amount recognition module;
[0057] The accounting subject deep feature extraction module is used to vectorize the accounting subject labels, obtain the subject label embedding, and splice it with the features to be identified and the accounting subject feature information to obtain the deep feature vector;
[0058] Next, the self-attention mechanism is used to calculate the attention weight of the deep feature vector, and the multi-layer perceptron is used to extract features to obtain the deep features to be fused;
[0059] The accounting subject shallow extraction module is used to perform multiple splicing of accounting subject labels and all the context-keyword groups to obtain context-combined keyword groups; and vectorize the context-combined keyword groups to obtain a number of word embedding groups;
[0060] Next, a multi-head self-attention mechanism is used to calculate the weights of several word vector groups to obtain the shallow features to be fused;
[0061] The feature fusion module is used to splice the shallow features to be fused and the deep features to be fused, and use a multi-layer perceptron to perform feature fusion on the spliced features to obtain complete feature information;
[0062] The amount recognition module is used to use a fully connected layer to map and predict the complete feature information to obtain the amount corresponding to the current accounting subject.
[0063] This invention is based on the model structure of RoBERTa, combined with the subject-amount recognition model, and fully utilizes the context-keyword group and RoBERTa's context extraction ability, thereby realizing the accurate processing of text data from different source data. At the same time, through the fusion of shallow and deep features in the subject-amount recognition model, the interference of potential duplicate information in the text data of different source data is effectively eliminated, ensuring the accuracy and consistency of the entry information, and finally realizing the automation of order entry, greatly reducing manual intervention.
[0064] Furthermore, the trainable parameters of the accounting subject classification model based on RoBERTa are trained by the following steps:
[0065] D1: Label several context-keyword groups according to relevant businesses to obtain an accounting training data set;
[0066] D2: Processing the training samples by adopting the dynamic mask strategy proposed by RoBERTa, and inputting them into the accounting subject classification model based on RoBERTa for classification, so as to obtain the predicted accounting subject labels;
[0067] D3: Using the cross entropy loss function to calculate the loss of the predicted accounting subject label and the label corresponding to the training sample to obtain the subject loss value; and using the back propagation algorithm to update the parameter weight of the model until the subject loss value reaches a preset threshold;
[0068] D4: Freeze the parameters of the input embedding module, the encoder module, and the subject classification submodule to obtain a frozen RoBERTa-based accounting subject classification model;
[0069] D5: Input the training samples of the accounting training data set into the currently frozen RoBERTa-based accounting subject classification model to obtain the predicted relevant accounting entry information;
[0070] D6: Using a mean square error loss function to calculate the loss of the predicted related accounting entry information and the actual amount corresponding to the training sample to obtain an amount loss value; and using a back propagation algorithm to update the parameters of the subject-amount recognition model until the amount loss value reaches a preset threshold;
[0071] D7: unfreeze the parameters of the input embedding module, the encoder module, and the subject classification submodule to obtain a preliminarily trained RoBERTa-based accounting subject classification model;
[0072] D8: Input the training samples of the accounting training data set into the initially trained RoBERTa-based accounting subject classification model to obtain accurately predicted relevant accounting entry information;
[0073] D9: Use the cross entropy loss function and the mean square error loss function to calculate the loss of the accurately predicted relevant accounting entry information and the true labels corresponding to the training samples to obtain the total loss value; and use the back propagation algorithm to update the parameters of the initially trained RoBERTa-based accounting subject classification model until the total loss value is minimized to obtain the trained RoBERTa-based accounting subject classification model.
[0074] The present invention trains the accounting subject classification model based on RoBERTa based on a segmented training strategy, and in particular gradually optimizes the loss of classification and regression tasks by freezing and unfreezing model parameters, thereby ensuring the stability and effectiveness of the training process. Among them, segmented training can avoid excessive updates of shared parameters in the early stages of training, thereby protecting the performance of the model in accounting subject classification, and gradually optimizing the amount recognition task on this basis, significantly reducing gradient oscillations and ensuring the smooth convergence of the model. At the same time, the segmented and joint loss calculation strategies ensure balanced training of classification and regression tasks, effectively improving the overall performance of the model in accounting subject classification and amount recognition tasks, and avoiding deviations between tasks.
[0075] An automated financial settlement device, comprising a bank-enterprise association unit, a loan account calculation unit, a financial update unit, and an error tracking and correction unit;
[0076] The bank-enterprise association unit is used to query the bank-enterprise database for total orders according to the company's account change information, and query the order database for entry information based on the query result to obtain the entry voucher corresponding to the relevant total order information;
[0077] The debit and credit account calculation unit is used to construct debit and credit accounts according to the entry voucher, and perform debit and credit balance calculation to obtain current debit and credit balance information;
[0078] The financial update unit is used to perform financial updates on the asset account according to the current loan balance information, obtain the current asset change information, and determine whether the information is balanced according to the account balance system: if yes, complete the financial update; if no, roll back to the backup state and record the imbalance information, and call the error tracking and correction unit;
[0079] The error tracking and correction unit is used to issue an error alarm based on the imbalance information, correct the loan account, obtain the current loan balance information, and execute the call of the financial update unit.
[0080] Further, the error tracking and correction unit includes an error alarm module and a loan account correction module;
[0081] The error alarm module is used to trace errors in the order database according to the entry vouchers in the imbalance information, obtain several source data and corresponding key position indexes, highlight several data sources according to the key position indexes, obtain error-related content data, display the error-related content data to the client, and obtain the user's correction information; wherein, the order database is constructed using an accounting subject classification model based on RoBERTa;
[0082] The loan account correction module is used to correct the current loan account according to the user's correction information, and use the correction information as the current loan balance information to call the financial update unit.
[0083] Furthermore, all the total order information and entry vouchers are saved to the order database through the following steps:
[0084] SA1: Preprocess the text images of different data sources of the total order information to obtain relevant text information;
[0085] Wherein, the pre-processing includes the following sub-steps:
[0086] Recognize text images through optical character recognition and extract text information;
[0087] Use the preset regular expression to clean the text information, and perform abbreviation conversion on the cleaned data to obtain relevant text information. The specific expression is as follows:
[0088] T clean ={t1, ..., t i ,…,t n}, i≤n
[0089] Where, T clean is the cleaned data, t i is the relevant text, n is the total number of text information; then, the relevant text t involved in the abbreviation conversion i Increase the weight. The specific expression is as follows:
[0090] w i ′=w i ×(1+α)
[0091] In the formula, w i ′ is the relevant text t i The weight after participating in the abbreviation conversion; w i For the relevant text i The weight before the abbreviation conversion; α is the weight coefficient;
[0092] Based on this, the specific expression of its related text information is as follows:
[0093] T={(t1,w n ′),(t2,w2′),…,(t n ,w n ′)}
[0094] SA2: Perform word segmentation and entity recognition on relevant text information through a preset vocabulary to obtain keyword groups;
[0095] The steps of obtaining the keyword group are as follows:
[0096] Segment the relevant text information into several initial subsets. The specific expressions are as follows:
[0097]
[0098] Where, T is the relevant text information; t n is the nth relevant text in T; k m is the nth related text t n The mth word after word segmentation; w n is the weight corresponding to the nth related text; K n init For n An initial subset of words extracted from and their corresponding weights;
[0099] Entity recognition is performed on several initial subsets to extract several keyword subsets, which are specifically expressed as follows:
[0100]
[0101] In the formula, K n entity Represents the initial subset K n init The keyword subset extracted from the , which contains the keywords identified as entities and their corresponding weights; m Represented as vocabulary k m The identified keywords belong to the preset word list
[0102] Repeated statistics are performed on several keyword subsets, and the weights of the keywords in the keyword subsets are updated to obtain keyword groups. The specific expression is as follows:
[0103] w m ′=w m ×α r-1
[0104] In the formula, w m ' is the keyword em The corresponding weight, w m For keyword e m The corresponding original weight, r is the keyword e m The number of times it appears in all keyword subsets; α is the weight adjustment coefficient, and its coefficient value range is 1<α<2. The expression of the keyword group is as follows:
[0105] K adj ={K1 adj ,K2 adj ,…,K n adj ={(e m ,w m ′)|k m ∈t n}}
[0106] SA3: Use a sliding window to perform context extraction on relevant text information according to the keyword group to obtain a context-keyword group; wherein the expression for the nth context-keyword group is:
[0107]
[0108] In the formula, k max(0,m-s) and k min(m+s,n) are respectively represented as the mth keyword e m The previous and next words, the context fragment determined by the dynamic sliding window step size s; K n adj is the nth keyword group; K n init is the nth initial subset; its mth keyword e m The specific calculation of the sliding window step size is as follows:
[0109]
[0110] In the formula, w m For keyword e m The corresponding weight; s0 is the basic step size of the sliding window; β is the adjustment coefficient;
[0111] SA4: Classify the context-keyword group by the accounting subject classification model based on RoBERTa to obtain relevant accounting entry information;
[0112] SA5: Matching the accounting subjects and amounts in the relevant accounting entry information one by one to obtain a number of preliminary entry vouchers, and attaching the preliminary entry vouchers according to the keyword group to obtain a number of entry vouchers; then, constructing a position index for the images of the different data sources of the general order information, obtaining a key position index, and associating it with the number of entry vouchers, the general order information and the number of data sources, and storing it in the order database, thereby completing the construction of the order database;
[0113] The location index is constructed by performing keyword search on images from different data sources according to the context-keyword group corresponding to the entry voucher to obtain the paragraph corresponding to the image, and converting the paragraph into corresponding paragraph coordinates.
[0114] Furthermore, the accounting subject classification model based on RoBERTa includes an input embedding module, an encoder module and an accounting subject classification module;
[0115] The input embedding module is used to segment the context-keyword group, and vectorize and position encode it in sequence to obtain a number of position-encoded word embeddings;
[0116] The encoder module is used to calculate the multi-head self-attention weights of several position encoding word embeddings, and perform nonlinear transformation and information aggregation on them to obtain accounting subject feature information;
[0117] The accounting subject classification module includes a pooling layer, a fully connected layer, a subject classification submodule and an amount division submodule;
[0118] The pooling layer is used to perform pooling and dimensionality reduction on the accounting subject feature information to obtain pooled feature information;
[0119] The fully connected layer is used to linearly transform the pooled feature information using an activation function to obtain features to be identified;
[0120] The subject classification submodule is used to identify the accounting subject of the feature to be identified and obtain the accounting subject label;
[0121] The amount division submodule is used to use the subject-amount recognition model to perform amount recognition on the context-keyword group, accounting subject feature information, accounting subject label and the feature to be recognized, obtain the accounting subject and the corresponding amount, and combine the accounting subject and the corresponding amount to obtain relevant accounting entry information;
[0122] The subject-amount recognition model includes an accounting subject deep feature extraction module, an accounting subject shallow feature extraction module, a feature fusion module and an amount recognition module;
[0123] The accounting subject deep feature extraction module is used to vectorize the accounting subject labels, obtain the subject label embedding, and splice it with the features to be identified and the accounting subject feature information to obtain the deep feature vector;
[0124] Next, the self-attention mechanism is used to calculate the attention weight of the deep feature vector, and the multi-layer perceptron is used to extract features to obtain the deep features to be fused;
[0125] The accounting subject shallow extraction module is used to perform multiple splicing of accounting subject labels and all the context-keyword groups to obtain context-combined keyword groups; and vectorize the context-combined keyword groups to obtain a number of word embedding groups;
[0126] Next, a multi-head self-attention mechanism is used to calculate the weights of several word vector groups to obtain the shallow features to be fused;
[0127] The feature fusion module is used to splice the shallow features to be fused and the deep features to be fused, and use a multi-layer perceptron to perform feature fusion on the spliced features to obtain complete feature information;
[0128] The amount recognition module is used to use a fully connected layer to map and predict the complete feature information to obtain the amount corresponding to the current accounting subject.
[0129] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0130] Figure 1 This is a schematic diagram of the structure of the automated financial settlement device of the present invention;
[0131] Figure 2 This is a schematic diagram of a specific process of the automated financial settlement method of the present invention;
[0132] Figure 3 This is a simple example diagram for querying entry information;
[0133] Figure 4 This is a diagram of a simple example of calculating debit and credit balance;
[0134] Figure 5 This is a simplified example diagram of the normal update of the balance sheet;
[0135] Figure 6 This is a simple flow chart for building an order database;
[0136] Figure 7 This is a schematic diagram of a simple structural example of the account-amount recognition model. DETAILED DESCRIPTION
[0137] In order to solve the problem that when the prior art processes transaction order entry accounting, if an erroneous entry occurs, it is easy to cause the erroneous entry node to be difficult to check and correct, the present invention obtains the change information of the company account in real time to query the bank flow, obtain the relevant total order information, and perform an entry query on the total order information to obtain a number of entry vouchers. And according to the several entry vouchers, the debit and credit accounts are constructed, the debit and credit accounts are balanced, and the current debit and credit balance information is obtained. According to the current debit and credit balance information, the asset account is financially updated to ensure that the account balance system remains balanced and the financial update is completed. When the account balance system is unbalanced, an error alarm is issued to obtain correction information, so that the user can immediately track the current debit and credit accounts to track the entry orders, and the user can sort out the entry orders to ensure the integrity and accuracy of the financial data.
[0138] Based on the above design, the present invention proposes an automated financial settlement method, and based on the method, proposes an automated financial settlement device.
[0139] Please also see Figure 1 and Figure 2 , Figure 1 This is a schematic diagram of the structure of the automated financial settlement device of the present invention. Figure 2 The figure is a schematic diagram of a specific process of the automated financial settlement method of the present invention.
[0140] The automated financial settlement device comprises a bank-enterprise association unit 1, a loan account calculation unit 2, a financial update unit 3 and an error tracking and correction unit 4.
[0141] The bank-enterprise association unit 1 is used to execute step S1: perform a general order query on the bank-enterprise database according to the company account change information, and perform an entry information query on the order database based on the query result to obtain the entry voucher corresponding to the relevant general order information.
[0142] Specifically, the bank-enterprise association unit 1 includes a bank-enterprise connection module 11 and an entry order query module 12; Figure 3 , Figure 3 This is a simple example diagram for entry information query.
[0143] The bank-enterprise connection module 11 is used to execute step S11: query the bank-enterprise database according to the company account change information to obtain relevant total order information.
[0144] Specifically, a target enterprise query is performed on the bank-enterprise database according to the enterprise header in the company account change information to obtain a corresponding target enterprise identifier.
[0145] According to the target enterprise identifier and the transaction amount in the company account change information, the bank-enterprise database is queried for orders with consistent enterprise identifier and transaction amount to obtain relevant total order information.
[0146] The company account change information is obtained through bank-enterprise direct connection, and its shortest acquisition cycle is real-time acquisition; the company account change information includes the company title and transaction amount, the company title is the name of the user's target customer company, and the transaction amount is the transaction amount received or spent by the user's corporate bank;
[0147] The bank-enterprise database is used to record transaction orders between the user's enterprise and the target customer enterprise, including an enterprise identifier and a transaction order; the enterprise identifier is used to identify the names of the relevant enterprises involved in the transaction, and the transaction order includes the transaction amount and the transaction type; the transaction amount is the transaction amount between the user's enterprise and the target customer enterprise, and the transaction type is used to classify whether the amount of the current transaction order belongs to expenditure or income.
[0148] The total order information includes an order identifier, an enterprise identifier and a total transaction amount. The order identifier is used to identify related entry order information, the enterprise identifier is used to identify the target customer enterprise, and the total transaction amount is the total receivables amount of the order.
[0149] Among them, direct connection between banks and enterprises is used to obtain company account change information in real time, so that when changes occur in company accounts, financial settlement can be carried out at the first time to prevent omissions or delayed accounting to the greatest extent.
[0150] The entry order query module 12 is used to execute step S12: query the order database for entry information according to the relevant general order information to obtain the entry voucher.
[0151] Specifically, the order database is screened for entry orders through the order identifier of the relevant general order information. If a relevant order exists, an entry voucher is obtained; if no relevant order exists, the current general order information is used as an entry voucher.
[0152] The order database is used to store all general order information and entry vouchers; the entry vouchers include accounting subjects and account amounts. The entry vouchers are independent orders for entry of general orders through related businesses. The specific order processing of sales and purchase general orders is as follows:
[0153] When the general sales order is generated, the business department is responsible for making entries. If the general order contains multiple accounting subjects such as goods, logistics and finance, the business department will divide them into independent vouchers for the corresponding subjects, namely entry vouchers; if the general order only includes one subject, no entry is required.
[0154] When the purchase business general order is generated, the accountant will review and make entries to ensure that the current expenditure amount has been approved. The purchase business general order entry is the same as the sales business general order entry, which will not be elaborated here.
[0155] Among them, entries are made with the assistance of relevant business, and each subject is formed into a corresponding independent entry voucher to ensure the accuracy and integrity of the data, thereby realizing refined management and ensuring that related orders can be quickly located and processed during verification, thereby ensuring the continuity and integrity of the data.
[0156] See also Figure 6 , Figure 6 This is a simple flowchart for building an order database.
[0157] In another embodiment, the journal entry voucher corresponding to the total order information is also generated through an accounting subject classification model based on RoBERTa, and a number of journal entry vouchers, total order information and a number of data sources are associated and stored in the order database to complete the construction of the order database. The steps of constructing the order database are as follows:
[0158] SA1: Preprocess the text images of different data sources of the total order information to obtain relevant text information.
[0159] Specifically, the text image is recognized through optical character recognition (OCR) to extract text information.
[0160] The preset regular expression is used to clean the text information, and the cleaned data is converted into abbreviations to obtain relevant text information. The specific expression is as follows:
[0161] T clean ={t1, ..., t i ,…,t n}, i≤n
[0162] Where, T clean is the cleaned data, t i is the relevant text, n is the total number of text information; then, the relevant text t involved in the abbreviation conversion i Increase the weight. The specific expression is as follows:
[0163] w i ′=w i ×(1+α)
[0164] In the formula, w i ′ is the relevant text t i The weight after participating in the abbreviation conversion; w i For the relevant text iThe weight before the abbreviation conversion is preset to 1 as the initial weight; α is the weight coefficient, and its value range is [1,1.5], which is used to indicate an increase in weight.
[0165] Based on this, the specific expression of its related text information is as follows:
[0166] T={(t1,w n ′),(t2,w2′),…,(t n ,w n ′)}
[0167] The different data sources include image data with texts such as orders, notes or contracts that are related to the total order information and are not paid and / or not received. The reliability of the data related to the total order information is enhanced by extracting texts from multiple data sources. The abbreviation conversion can simplify or standardize texts with different descriptions, such as "logistics price: 'transportation fee', 'delivery price', 'matching price'", and the mapping list of the specific abbreviation conversion can be customized by the user.
[0168] Due to the internal regulations of different enterprises, the data sources related to the total order information include but are not limited to paper orders, emails, contracts, etc., the present invention does not specifically limit the selection of the data sources related to the total order information.
[0169] SA2: Perform word segmentation and entity recognition on relevant text information through a preset vocabulary to obtain keyword groups.
[0170] Specifically, the relevant text information is segmented into several initial subsets. The specific expressions are as follows:
[0171]
[0172] Where, T is the relevant text information; t n is the nth relevant text in T; k m is the nth related text t n The mth word after word segmentation; w n is the weight corresponding to the nth related text; K n init From t n The initial subset consisting of the words extracted from the word and the corresponding weights. Wherein, the word segmentation operation can be performed by LTP or Jieba, and the present invention does not specifically limit the selection of word segmentation.
[0173] Next, entity recognition is performed on several initial subsets to extract several keyword subsets, which are specifically expressed as follows:
[0174]
[0175] In the formula, Kn entity Represents the initial subset K n init The subset of keywords extracted from the , which contains the keywords identified as entities and their corresponding weights. m Represented as vocabulary k m The identified entity, i.e. the keyword, belongs to the entity set The entity collection That is, the preset word list sets the entity set related to the entry according to the user's needs, such as "remittance", "company", "account number", "yuan", "¥" and other characters, which are used to extract potential and key information from the text. m Represented as the corresponding keyword e m The weight of the n .
[0176] Finally, several keyword subsets are repeatedly counted, and the weights of the keywords in the keyword subsets are updated to obtain keyword groups. The specific expression is as follows:
[0177] w m ′=w m ×α r-1
[0178] In the formula, w m ' is the keyword e m The corresponding weight, w m For keyword e m The corresponding original weight, r is the keyword e m The number of times it appears in all keyword subsets; α is the weight adjustment coefficient, and its coefficient value range is 1<α<2. The expression of the keyword group is as follows:
[0179] K adj ={K1 adj ,K2 adj ,…,K n adj ={(e m ,w m ′)|k m ∈t n}}
[0180] Since the aforementioned steps have replaced the text data of different source data with abbreviations, the present invention further uses prior knowledge of accounting to screen the replaced text data to extract key words that have a significant impact on accounting entries, and repeatedly counts and updates the weights of the key words to ensure that these key words can accurately reflect the key semantic information of the text.
[0181] SA3: Use a dynamic sliding window to perform context extraction on relevant text information based on the keyword group to obtain the context-keyword group.
[0182] Specifically, the expression for extracting context from relevant text information using the dynamic sliding window is as follows:
[0183] Let s0 be the basic step size of the sliding window, expressed as the minimum window range.
[0184] Assume m is the mth keyword e m The sliding window step size is .
[0185] Let β be the adjustment coefficient, which is used to control the influence of weight on window step size.
[0186] but:
[0187]
[0188] In the formula, w m For keyword e m The corresponding weight, β, has a default value of 2. Based on this, the sliding window step size is used to extract the context of the relevant text information to obtain a number of context-keyword groups. For the nth context-keyword group, its expression is:
[0189]
[0190] In the formula, k max(0,m-s) and k min(m+s,n) are respectively represented as the mth keyword e m The previous and next words are context fragments determined by the dynamic sliding window step size s, with max(0,ms) and min(m+s,n) used to prevent the words extracted by the current step size from exceeding the edge of the text. K n adj is the nth keyword group. n init is the nth initial subset.
[0191] The present invention associates keywords with their contexts through a dynamic sliding window, thereby ensuring that the model can accurately capture and understand key semantic information in different data sources or complex text data, thereby improving the system's ability to understand and process multi-source information and complex text data.
[0192] SA4: Classify the context-keyword groups through the accounting subject classification model based on RoBERTa to obtain relevant accounting entry information.
[0193] Specifically, the accounting subject classification model based on RoBERTa (ARobustly Optimized BERT Pretraining Approach) includes an input embedding module, an encoder module and an accounting subject classification module.
[0194] The input embedding module is used to segment the context-keyword group, and vectorize and position encode it in sequence to obtain a number of position-encoded word embeddings.
[0195] Specifically, the input embedding module includes a word segmentation submodule (Tokenizer), a vocabulary embedding submodule (WordEmbedding) and a position embedding submodule (Positional Embedding).
[0196] The word segmentation submodule is used to perform a word segmentation operation on the context-keyword group to obtain a plurality of words. The word segmentation operation is to divide the continuous natural language text into independent words, each of which will be encoded as a numerical representation so that the computer can efficiently process the semantic information of these words.
[0197] The word embedding submodule is used to vectorize several words to obtain several word embeddings. The vectorization is used to map the numerical values corresponding to the words into high-dimensional vectors to represent the semantic information of the words. For example, the distance between "buy" and "procure" in the vector space is relatively close to reflect the semantic similarity between "buy" and "procure".
[0198] The position embedding submodule is used to perform position encoding on a plurality of word embeddings to obtain a plurality of position encoded word embeddings.
[0199] Among them, by adding position encoding to word embedding, the model can perceive the relative position of words in the sentence, thereby maintaining and strengthening the semantic order of the context.
[0200] The encoder module is used to calculate the multi-head self-attention weights of several position encoding word embeddings, and perform nonlinear transformation and information aggregation on them to obtain accounting subject feature information.
[0201] Specifically, the encoder module includes a multi-head self-attention submodule (Multi-Head Self-Attention) and a feed-forward neural network submodule (Feed-Forward Neural Network, FFN).
[0202] The multi-head self-attention submodule is used to calculate the weights of several positional encoding word embeddings to obtain several associated word embeddings. The multi-head self-attention mechanism calculates the dependencies between the encoding word embeddings at different positions, captures context information from multiple perspectives, and combines this information through weights to generate a richer representation of associated features.
[0203] The feedforward neural network submodule is used to perform nonlinear transformation and information aggregation on a number of associated word embeddings to obtain accounting subject feature information. The associated word embeddings are nonlinearly transformed by a nonlinear activation function (such as ReLU) to extract higher-level semantic features, and these features are aggregated to generate feature information for accounting subject classification.
[0204] The accounting subject classification module includes a pooling layer, a fully connected layer, a subject classification submodule and an amount division submodule.
[0205] The pooling layer is used to pool and reduce the dimension of the accounting subject feature information to obtain the pooled feature information. The pooling operation can suppress the influence of noise features, retain key information, and help the model better identify important accounting subject features.
[0206] The fully connected layer is used to perform linear transformation on the pooled feature information by using an activation function to obtain features to be identified.
[0207] The subject classification submodule is used to identify the accounting subject of the feature to be identified and obtain the accounting subject label. The feature to be identified is converted into a probability distribution through a Softmax function, and the accounting subject label corresponding to the feature to be identified with the highest probability is selected as the current accounting subject label.
[0208] The amount division submodule is used to use the subject-amount recognition model to identify the amount of context-keyword groups, accounting subject feature information, accounting subject labels and features to be identified, obtain accounting subjects and corresponding amounts, and combine the accounting subjects and corresponding amounts to obtain relevant accounting entry information.
[0209] See also Figure 7 , Figure 7 This is a schematic diagram of a simple structural example of the account-amount recognition model.
[0210] Specifically, the subject-amount recognition model includes an accounting subject deep feature extraction module, an accounting subject shallow feature extraction module, a feature fusion module and an amount recognition module.
[0211] The accounting subject deep feature extraction module is used to vectorize the accounting subject labels, obtain the subject label embedding, and splice it with the features to be identified and the accounting subject feature information to obtain a deep feature vector; its deep feature vector F D The specific expression is as follows:
[0212] F D = {W Embedding (Label); F detect ; F sub}
[0213] In the formula, F detect is the feature to be identified; F sub is the characteristic information of accounting subject; Label is the label of accounting subject; W Embedding (·) is the same vectorization operation as the word segmentation submodule, which is used to vectorize the accounting subject labels to obtain accounting label embedding.
[0214] Then, the self-attention mechanism is used to calculate the attention weight of the deep feature vector, and the multi-layer perceptron is used to extract the features to obtain the deep features to be fused; the deep features to be fused F fusion :
[0215] F fusion =MLP(F Att )
[0216] Where MLP(·) represents a multi-layer perceptron, which performs nonlinear transformation on the input features through the hidden layer and combines it with the ReLU activation function to further extract and combine the input features; F Att is the feature vector of the depth feature vector after attention encoding weighting; for the i-th weighted feature vector The specific weight calculation is as follows:
[0217]
[0218] In the formula, Q i Denoted as the i-th F D The query vector corresponding to the feature is used to measure the relationship with other j-th F D The key vector K corresponding to the feature j Similarity of V j is the jth F D The value vector corresponding to the feature (Value); d k represents the dimension of the key vector, which is used for normalization to avoid too large a similarity value when calculating the dot product; Softmax(·) represents the Q i and K j The similarity is converted into weight.
[0219] Based on this, the deep feature vector is weighted by the self-attention mechanism, so that the model can dynamically adjust the weight of each feature according to the context, thereby enhancing the importance of accounting subject labels in different contexts through weights. Therefore, the weighted feature vector is further extracted and combined by the multi-layer perceptron to obtain the key features related to the accounting subject, thereby improving the accuracy of subject classification and amount recognition.
[0220] The accounting subject shallow extraction module is used to perform multiple splicing of the accounting subject label and all the context-keyword groups to obtain the context combination keyword group K n final , specifically expressed as follows:
[0221]
[0222] In the formula, Label represents the accounting subject label, which is used to match the subset of the current context-keyword group (k max(0,m-s) ,…,e m ,…,k min(m+s,n) ) for splicing.
[0223] The context-combined keyword groups are vectorized to obtain several word embedding groups.
[0224] Next, a multi-head self-attention mechanism is used to calculate the weights of several word vector groups to obtain the shallow features F to be fused. S , the specific calculation is as follows:
[0225] F S =MultiHead(Q,K,V)=Concat(h1,h2,…,h n )W O
[0226] In the formula, Q, K, and V are the query vector, key vector, and value vector corresponding to several word vector groups respectively; Concat represents the concatenation operation; W O is the final weight matrix of the multi-head self-attention mechanism, which is used to perform linear transformation on the concatenated attention calculation results; h n is the calculation result of the nth attention head. The specific calculation for the nth attention head is as follows:
[0227]
[0228] Where W n Q ,W n K ,W n Vare the weight matrices corresponding to the query vector, key vector, and value vector of the nth attention head; d k is the dimension of the key vector.
[0229] Since the context-keyword phrase comes from multiple data sources, when the accounting subject label is concatenated with the phrase itself and directly identified or extracted, it is easy to introduce duplicate or redundant information, which will affect the performance of the model. Therefore, by adopting a multi-head self-attention mechanism, key information of different contexts can be captured in multiple data sources, and the interference of redundant information on the model can be effectively reduced, thereby improving the accuracy and robustness of the model in the process of identifying accounting subjects and amount features.
[0230] The feature fusion module is used to splice the shallow features to be fused and the deep features to be fused, and use a multi-layer perceptron to perform feature fusion on the spliced features to obtain complete feature information. The complete feature information F complete The specific expression is as follows:
[0231] F complete =MLP(Concat(F fusion ,F s ))
[0232] In the formula, F fusion is the deep feature to be fused; F S is the shallow feature to be fused; Concat is the concatenation operation; MLP is the multi-layer perceptron.
[0233] The present invention integrates the local information of shallow features with the global semantics of deep features through feature fusion, fully combines the key information related to the current subject label of the two, and further captures the key semantic features in the fused features through the nonlinear transformation of the multi-layer perceptron, thereby effectively extracting the feature information of the corresponding amount of the accounting subject, significantly improving the accuracy of the model in accounting subject classification and amount recognition.
[0234] The amount recognition module is used to use a fully connected layer to map and predict the complete feature information to obtain the amount corresponding to the current accounting subject.
[0235] Based on this, the complete feature information is mapped through the fully connected layer to complete the prediction of the amount corresponding to the accounting subject and accurately output the amount corresponding to the current accounting subject.
[0236] The subject-amount recognition model proposed in the present invention uses the accounting subject label as an anchor point through a multi-head self-attention mechanism, and performs attention calculations with different source data and deep features respectively, so that the model can effectively capture key information in different contexts and ensure the multi-dimensional alignment of accounting subjects and related semantic features. In addition, the model semantically fuses shallow features (such as keywords) and deep features (such as semantic information) through a multi-layer perceptron to ensure the matching and consistency between accounting subjects and amounts. Accordingly, the present invention enhances the accuracy and robustness of accounting subject and amount recognition through the subject-amount recognition model, reduces erroneous recognition caused by data redundancy, and improves the model's ability to process complex financial data.
[0237] Furthermore, in order to improve the accuracy of the RoBERTa-based accounting subject classification model in identifying relevant accounting entry information, the present invention obtains several context-keyword groups through the aforementioned steps and labels them according to relevant businesses, ensuring that each context keyword group corresponds to one or more accounting subject labels and amounts, so as to obtain an accounting training data set. Among them, the accounting subject labels are set according to the relevant businesses, and the present invention does not specifically limit the selection of the accounting subject labels.
[0238] In the data preparation stage, the accounting training data set is divided into training samples and verification samples. The training samples are used to train the accounting subject classification model, and the verification samples are used to evaluate the performance of the accounting subject classification model.
[0239] In the first stage of model training, the training samples are processed by adopting the dynamic mask strategy proposed by RoBERTa and input into the accounting subject classification model based on RoBERTa for classification until the predicted accounting subject labels are obtained.
[0240] Next, the cross entropy loss function is used to calculate the loss of the predicted accounting subject labels and the labels corresponding to the training samples to obtain the subject loss value, and the back propagation algorithm is used to update the parameter weights of the model until the subject loss value reaches a preset threshold.
[0241] Among them, the dynamic masking strategy dynamically masks some words in the training data input to the model each time, so that the model needs to predict the masked words according to the context and continue to perform downstream tasks based on the predicted words, so that the model can perform more accurately in complex contexts.
[0242] In the second stage of model training, the parameters of the input embedding module, encoder module and subject classification submodule are frozen, and the training samples of the accounting training data set are input into the currently frozen RoBERTa-based accounting subject classification model until the predicted relevant accounting entry information is obtained.
[0243] Next, the mean square error loss function is used to calculate the loss of the predicted relevant accounting entry information and the actual amount corresponding to the training sample to obtain the amount loss value, and the back propagation algorithm is used to update the parameters of the subject-amount recognition model until the amount loss value reaches the preset threshold.
[0244] In the third stage of model training, the parameters of the input embedding module, encoder module and subject classification submodule are unfrozen, and the training samples of the accounting training data set are input into the current RoBERTa-based accounting subject classification model until accurate prediction of relevant accounting entry information is obtained.
[0245] Next, the cross entropy loss function and the mean square error loss function are used to calculate the total loss value of the corresponding label in the training data set corresponding to the accurately predicted relevant accounting entry information, and the back propagation algorithm is used to update the parameters of the account-amount recognition model to minimize the total loss value.
[0246] In the model verification stage, the verification sample is input into the RoBERTa-based accounting subject classification model for classification and identification, the relevant accounting entry information is obtained, and the accuracy between the relevant accounting entry information and the actual label of the verification sample is evaluated. According to a preset accuracy threshold, when the model accuracy exceeds the accuracy threshold, it means that the performance of the model meets the required standards and the training process ends; otherwise, the third stage of model training is executed.
[0247] Among them, the execution steps of the model for classifying and identifying the verification samples of the training sample set are the same as the execution steps of the aforementioned RoBERTa-based accounting subject classification model, and the present invention will not be described in detail here.
[0248] SA5: Match relevant accounting entry information according to the keyword group, generate several entry vouchers, associate them with several entry vouchers, total order information and several data sources, store them in the order database, and complete the construction of the order database.
[0249] Specifically, the accounting subjects and amounts in the relevant accounting entry information are matched one by one to obtain a number of preliminary entry vouchers, and the preliminary entry vouchers are attached according to the date and / or other business information in the keyword group to obtain a number of entry vouchers.
[0250] Next, position indexes are constructed for the images of several journal vouchers and different data sources of the total order information to obtain key position indexes, which are then associated with several journal vouchers, the total order information and several data sources and stored in the order database to complete the construction of the order database.
[0251] The location index is constructed by performing keyword search on images from different data sources according to the context-keyword group corresponding to the entry voucher to obtain the paragraph corresponding to the image, and converting the paragraph into corresponding paragraph coordinates.
[0252] Based on this, the construction of the key position index enables the system to accurately locate the keyword position in the image, helping users to quickly focus on key information in different data sources and significantly improve information retrieval efficiency. At the same time, by associating the paragraph coordinates of keywords, the system not only optimizes the search process, but also provides accurate reference clues for subsequent data tracing, thereby further improving the system's error correction capabilities and overall operation accuracy. In addition, the key position index constructed through the context-keyword group can provide the user with the key text data corresponding to the entry voucher recognized by the current model, ensuring that the user can obtain comprehensive reference information during the error correction and tracing process, thereby speeding up problem location and correction, and further improving the overall process efficiency and accuracy.
[0253] The debit and credit account calculation unit 2 is used to execute step S2: construct a debit and credit account according to the entry voucher, and perform debit and credit balance calculation to obtain current debit and credit balance information.
[0254] Specifically, the loan account calculation unit 2 includes a loan account construction module 21 and a loan balance calculation module 22; Figure 4 , Figure 4 This is a diagram showing a simple example of calculating debit / credit balance.
[0255] The loan account construction module 21 is used to execute step S21: construct loan accounts according to entry vouchers to obtain relevant loan accounts.
[0256] Specifically, according to the accounting subjects in the entry voucher, the corresponding T-account is generated, and the debit and credit amounts are recorded to obtain the relevant debit and credit accounts.
[0257] For example: the subject of a journal entry is Goods: Accounts Receivable-Goods, with an amount of 3,000; the subject of a journal entry is Logistics: Accounts Receivable-Logistics, with a debit amount of 500;
[0258] Then, construct the T-account of Accounts Receivable - Goods based on the journal entry voucher, increase 3000 on the debit side, and mark it as unwritten off;
[0259] Create a T-account for Accounts Receivable - Logistics, add 500 to the debit side, and mark it as unwritten off;
[0260] Based on this, the corresponding vouchers of the accounts receivable-goods account and the accounts receivable-logistics account are obtained, and their vouchers are used as relevant debit and credit accounts.
[0261] Among them, by constructing debit and credit accounts, it is ensured that the debit and credit amounts of each transaction are recorded, so as to provide more records or vouchers for potential error tracing. In addition, if the corresponding amount of the goods on the contract information corresponding to the sales order is further subdivided, such as accounting subjects such as raw materials, commodity purchases and manufacturing expenses, multiple debit and credit accounts can be constructed according to the above example, so that the subsequent steps can be balanced by themselves. Accordingly, the present invention does not specifically limit the construction rules of its debit and credit accounts.
[0262] The loan balance calculation module 22 is used to execute step S22: perform balance calculation on relevant loan accounts to obtain current loan balance information.
[0263] Specifically, the relevant debit and credit accounts belonging to accounts receivable or accounts payable are written off, and the accounts receivable are written off and recorded as income, and the accounts payable are written off and recorded as expenses.
[0264] At the same time, recording income will increase the cash account, and recording expenditure will decrease the cash account, so as to obtain the current debit and credit balance information.
[0265] For example: If there is a debit amount of 3,000 in the current Accounts Receivable - Goods account, the T-account of Accounts Receivable - Goods will be written off and the credit will be increased by 3,000, and the final balance in the Accounts Receivable - Goods account will be 0;
[0266] Next, construct a T-account for the cash account and add 3,000 to the debit side;
[0267] And construct a T-account for the income account and increase the amount of 3000 on the credit side.
[0268] Finally, the current debit and credit accounts include: the T-account of accounts receivable-goods has a debit of 3000 and a credit of 3000, and is marked as written off; the T-account of the cash account has a debit of 3000; and the T-account of the income account has a credit of 3000.
[0269] Among them, automatic cancellation operations are used to ensure the balance of debits and credits between accounts, further improve the accuracy and completeness of financial data, and ensure that accounts receivable or payable are completely settled, so as to improve the efficiency of accounting personnel. At the same time, the vouchers corresponding to the T-accounts after automatic cancellation will be retained, and users can query the cancellation records at any time, thereby preventing bad debts from occurring and being difficult to track.
[0270] The financial update unit 3 is used to execute step S3: financially update the asset account according to the current loan balance information, obtain the current asset change information, and determine whether the information is balanced according to the account balance system. If yes, complete the financial update; if no, roll back to the backup state and record the imbalance information, and execute step S4.
[0271] Specifically, the financial update unit 3 includes a temporary financial update module 31 and an asset balance judgment module 32; Figure 5 , Figure 5 This is a simplified example diagram of a normal update of a balance sheet.
[0272] The temporary financial update module 31 is used to execute step S31: financially update the asset account according to the current loan balance information, and obtain the asset account backup node and the current asset account change information.
[0273] Specifically, back up the current asset account and obtain the asset account backup node;
[0274] According to the debit and credit accounts in the current debit and credit balance information, the corresponding accounts in the finance are temporarily updated, and the current asset account change information is obtained.
[0275] The asset account is a comprehensive account of all subject accounts in the user company's finances, used to record financial changes in different subjects;
[0276] The asset account backup node is a temporary backup of the comprehensive account of all subjects in the current company's finances, which is used to prevent the original normal finances from being overwritten when errors occur.
[0277] Among them, all current subject accounts are backed up, and the corresponding subject accounts are updated by all currently obtained debit and credit accounts to prevent errors after the current update. The backup data can be rolled back to prevent financial errors from being found after the update and overwriting the original normal finances. At the same time, the erroneous information can be effectively traced and corrected.
[0278] The asset balance judgment module 32 is used to execute step S32: determine whether the current asset account change information is balanced according to the account balance system? If yes, complete the financial update; if not, roll back the current asset account change information according to the asset account backup node, obtain the imbalance information, and execute step S4.
[0279] Specifically, the current asset account change information is summed up according to the account balance system to obtain the current total assets, total liabilities and total owner's equity.
[0280] Determine whether the current total assets are equal to the sum of the current total liabilities and the current total owner's equity. If yes, complete the financial update; if no, roll back the current asset account change information, and use all debit and credit accounts and entry vouchers as unbalanced information, and execute step S4;
[0281] The account balance system is assets = liabilities + owner's equity, wherein the assets include a cash account, several accounts receivable accounts and financial accounts, etc.; the liabilities include an expenditure account and several accounts payable accounts, etc.; the allocation rules of the owner's equity are defined by the user, and the present invention does not specifically limit them.
[0282] The financial update is a preliminary update of the balance sheet, and the preliminary update is to back up the current balance sheet and update the current balance sheet according to the current asset account change information. The backup balance sheet will be saved according to the time date, and the updated balance sheet will be used as the current balance sheet as the basis for subsequent updates.
[0283] Among them, if financial reports are prepared on a quarterly basis, the current financial report can be represented by obtaining the backup balance sheet of the corresponding time and date of the period. If bad debts and other situations occur at present, the balance sheet of the corresponding time and date can be found as a node from the backup balance sheet in the current period, and the relevant debit and credit accounts and all entry vouchers can be queried to achieve rapid error or bad debt tracking.
[0284] The error tracking and correction unit 4 is used to execute step S4: issue an error alarm according to the imbalance information, and correct the loan account to obtain the current loan balance information, and execute step S3.
[0285] Specifically, the error tracking and correcting unit 4 includes an error alarm module 41 and a loan account correction module 42 .
[0286] The error alarm module 41 is used to execute step S41: issue an error alarm according to the imbalance information and obtain correction information.
[0287] Specifically, all debit and credit accounts and entry vouchers in the unbalanced information are displayed, and the current financial update process is exited, waiting for the user to check and verify, and obtaining the user's correction information.
[0288] Among them, by exiting the current financial update process, the current financial settlement process can be exited from the processing state, thereby preventing resource preemption or long waiting times for other financial settlement processes.
[0289] Furthermore, the error alarm traces the error of the order database according to the entry voucher in the imbalance information, obtains several source data and corresponding key position indexes, and highlights several data sources according to the key position indexes to obtain error-related content data, and displays the error-related content data to the client to obtain the user's correction information.
[0290] Accordingly, the present invention uses several source data and corresponding key position indexes to accurately locate the erroneous source data in the entry voucher, so as to significantly reduce the workload of users to manually find and check errors and improve the efficiency of error correction. At the same time, it effectively avoids the error interference caused by the fluctuation of the accuracy of the accounting subject classification model based on RoBERTa, making the overall system more stable and reliable when processing complex financial information.
[0291] The loan account correction module 42 is used to execute step S42: correct the loan account according to the correction information, obtain corrected loan balance information, and use the corrected loan balance information as the current loan balance information to execute step S31.
[0292] Specifically, the current debit and credit accounts are corrected according to the user's correction information, and the corrected information is used as the current debit and credit balance information, and step S31 is executed to perform current financial update.
[0293] The user's correction information is obtained by the accounting user after manual inspection and error correction based on the imbalance information to provide a new debit and credit balance account, which can be directly used for financial updates.
[0294] Among them, manual inspection and error correction can further ensure potential security issues caused by full automation. At the same time, by quickly tracking and locating imbalance information, skilled accountants can analyze the source or cause of the error and adjust the entry or business strategy.
[0295] Compared with the prior art, the present invention realizes the visualization of bad debts and the tracing of accounts when they are unbalanced by backing up and updating the balance sheet in real time multiple times, thus solving the problem that the prior art is difficult to troubleshoot and correct financial imbalances. At the same time, the company's account change information is obtained in real time through direct bank-enterprise connection to ensure the immediacy of financial settlement and prevent financial data lags. Based on the business, sales orders and purchase orders are finely recorded, which realizes the independence of each accounting subject and the direct tracing of data, and simplifies the automated processing logic. In addition, the automated debit and credit account write-off and reconciliation ensures the balance of accounts receivable and accounts payable for all transaction orders, reducing the occurrence of bad debts.
[0296] In addition, the present invention further uses natural language processing technology to record the total order information and unstructured text, and realizes the refined entry and independence management of sales orders or purchase orders. By adding traceability information to the total order information, each data entity can be traced back to the original data source, which fully improves the system's error correction ability and data transparency, and thus significantly improves the efficiency and reliability of the system when processing a large number of entries.
[0297] Based on the same inventive concept, the present application also provides an electronic device, which may be a terminal device such as a server, a desktop computing device or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). The device includes one or more processors and a memory, wherein the processor is used to execute a program to implement an automated financial settlement method according to an embodiment of the present invention; and the memory is used to store a computer program executable by the processor.
[0298] Based on the same inventive concept, the present application also provides a computer-readable storage medium, corresponding to an embodiment of the aforementioned automated financial settlement method, wherein the computer-readable storage medium stores a computer program thereon, and when the program is executed by a processor, the steps of an automated financial settlement method recorded in any of the aforementioned embodiments are implemented.
[0299] The present application may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0300] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, and the present invention is also intended to include these modifications and modifications.
Claims
1. An automated financial settlement method, characterized in that: The following steps are involved: S1. Perform a general order query on the bank-enterprise database according to the company account change information, and perform an entry information query on the order database based on the query result to obtain the entry voucher corresponding to the relevant general order information; wherein the construction of the order database includes the following steps: SA1: Preprocess the text images of different data sources of the total order information to obtain relevant text information; Wherein, the pre-processing includes the following sub-steps: Recognize text images through optical character recognition and extract text information; Use the preset regular expression to clean the text information, and perform abbreviation conversion on the cleaned data to obtain relevant text information. The specific expression is as follows: T clean ={t1,…,t i ,…,t n },i≤n Where, T clean is the cleaned data, t i is the relevant text, n is the total number of text information; then, the relevant text t involved in the abbreviation conversion i Increase the weight. The specific expression is as follows: w i ′=w i ×(1+a) In the formula, w i ′ is the relevant text t i The weight after participating in the abbreviation conversion; w i For the relevant text i The weight before the abbreviation conversion; α is the weight coefficient; Based on this, the specific expression of its related text information is as follows: T={(t1,w n ′),(t2,w2′),…,(t n ,w n ′)} SA2: Perform word segmentation and entity recognition on relevant text information through a preset vocabulary to obtain keyword groups; The steps of obtaining the keyword group are as follows: Segment the relevant text information into several initial subsets. The specific expressions are as follows: T→K n init ={(k m ,w n )|k m ∈t n } Where, T is the relevant text information; t n is the nth relevant text in T; k m is the nth related text t n The mth word after word segmentation; w n is the weight corresponding to the nth related text; K n init For n An initial subset of words extracted from and their corresponding weights; Entity recognition is performed on several initial subsets to extract several keyword subsets, which are specifically expressed as follows: K n entity ={(e m ,w m )|e m ∈E,(k m ,w n )∈K n init And k m Identify as entity e m } In the formula, K n entity Represents the initial subset K n init The keyword subset extracted from the , which contains the keywords identified as entities and their corresponding weights; m Represented as vocabulary k m The identified keywords belong to the preset word list Repeated statistics are performed on several keyword subsets, and the weights of the keywords in the keyword subsets are updated to obtain keyword groups. The specific expression is as follows: In m ′=in m ×α r-1 In the formula, w m ' is the keyword e m The corresponding weight, w m For keyword e m The corresponding original weight, r is the keyword e m The number of times it appears in all keyword subsets; α is the weight adjustment coefficient, and its coefficient value range is 1<α<2. The expression of the keyword group is as follows: K adj ={K1 adj ,K2 adj ,…,K n adj ={(e m ,In m ′)|k m ∈t n }} SA3: According to the keyword group, a dynamic sliding window is used to extract the context of the relevant text information to obtain the context-keyword group; wherein, the expression for the nth context-keyword group is: In the formula, k max(0,m-s) and k min(m+s,n) are respectively represented as the mth keyword e m Previous and next words, context segments determined by the dynamic sliding window step size s; K n adj is the nth keyword group; K n init is the nth initial subset; its mth keyword e m The specific calculation of the sliding window step size is as follows: In the formula, w m For keyword e m The corresponding weight; s0 is the basic step size of the sliding window; β is the adjustment coefficient; SA4: Classify the context-keyword group by the accounting subject classification model based on RoBERTa to obtain relevant accounting entry information; SA5: Matching the accounting subjects and amounts in the relevant accounting entry information one by one to obtain a number of preliminary entry vouchers, and attaching the preliminary entry vouchers according to the keyword group to obtain a number of entry vouchers; then, constructing a position index for the images of the different data sources of the general order information, obtaining a key position index, and associating it with the number of entry vouchers, the general order information and the number of data sources, and storing it in the order database, thereby completing the construction of the order database; The position index is constructed by searching for keywords on images from different data sources according to the context-keyword group corresponding to the entry voucher to obtain the paragraph corresponding to the image, and converting the paragraph into the corresponding paragraph coordinates; S2. Construct debit and credit accounts according to the entry voucher, and perform debit and credit balance calculation to obtain the current debit and credit balance information; S3. Financially update the asset account according to the current loan balance information, obtain the current asset change information, and determine whether the information is balanced according to the account balance system: if yes, complete the financial update; if no, roll back to the backup state and record the imbalance information, and execute step S4; S4. Issue an error alarm based on the imbalance information, and correct the loan account to obtain the current loan balance information, and execute step S3; Wherein, the step S4 also includes the following sub-steps: S41. Tracing errors in the order database according to the entry voucher in the imbalance information, obtaining a number of source data and corresponding key position indexes, highlighting a number of data sources according to the key position indexes, obtaining error-related content data, displaying the error-related content data to the client, and obtaining correction information from the user; S42. Correct the current debit and credit account according to the user's correction information, and use the corrected information as the current debit and credit balance information, and execute step S3.
2. The automated financial settlement method according to claim 1, characterized in that: The accounting subject classification model based on RoBERTa includes an input embedding module, an encoder module and an accounting subject classification module; The input embedding module is used to segment the context-keyword group, and vectorize and position encode it in sequence to obtain a number of position-encoded word embeddings; The encoder module is used to calculate the multi-head self-attention weights of several position encoding word embeddings, and perform nonlinear transformation and information aggregation on them to obtain accounting subject feature information; The accounting subject classification module includes a pooling layer, a fully connected layer, a subject classification submodule and an amount division submodule; The pooling layer is used to perform pooling and dimensionality reduction on the accounting subject feature information to obtain pooled feature information; The fully connected layer is used to linearly transform the pooled feature information using an activation function to obtain features to be identified; The subject classification submodule is used to identify the accounting subject of the feature to be identified and obtain the accounting subject label; The amount division submodule is used to use the subject-amount recognition model to identify the amount of context-keyword groups, accounting subject feature information, accounting subject labels and features to be identified, obtain accounting subjects and corresponding amounts, and combine accounting subjects and corresponding amounts to obtain relevant accounting entry information.
3. The automated financial settlement method according to claim 2, characterized in that: The subject-amount recognition model includes an accounting subject deep feature extraction module, an accounting subject shallow extraction module, a feature fusion module and an amount recognition module; The accounting subject deep feature extraction module is used to vectorize the accounting subject labels, obtain the subject label embedding, and splice it with the features to be identified and the accounting subject feature information to obtain the deep feature vector; Next, the self-attention mechanism is used to calculate the attention weight of the deep feature vector, and the multi-layer perceptron is used to extract features to obtain the deep features to be fused; The accounting subject shallow extraction module is used to perform multiple splicing of accounting subject labels and all the context-keyword groups to obtain context-combined keyword groups; and vectorize the context-combined keyword groups to obtain a number of word embedding groups; Next, a multi-head self-attention mechanism is used to calculate the weights of several word vector groups to obtain the shallow features to be fused; The feature fusion module is used to splice the shallow features to be fused and the deep features to be fused, and use a multi-layer perceptron to perform feature fusion on the spliced features to obtain complete feature information; The amount recognition module is used to use a fully connected layer to map and predict the complete feature information to obtain the amount corresponding to the current accounting subject.
4. The automated financial settlement method according to claim 3, characterized in that: The trainable parameters of the RoBERTa-based accounting subject classification model are trained by the following steps: D1: Label several context-keyword groups according to relevant businesses to obtain an accounting training data set; D2: Processing the training samples by adopting a dynamic mask strategy and inputting them into the accounting subject classification model based on RoBERTa for classification to obtain predicted accounting subject labels; D3: Using the cross entropy loss function to calculate the loss of the predicted accounting subject label and the label corresponding to the training sample to obtain the subject loss value; and using the back propagation algorithm to update the parameter weight of the model until the subject loss value reaches a preset threshold; D4: Freeze the parameters of the input embedding module, the encoder module, and the subject classification submodule to obtain a frozen RoBERTa-based accounting subject classification model; D5: Input the training samples of the accounting training data set into the currently frozen RoBERTa-based accounting subject classification model to obtain the predicted relevant accounting entry information; D6: Using a mean square error loss function to calculate the loss of the predicted related accounting entry information and the actual amount corresponding to the training sample to obtain an amount loss value; and using a back propagation algorithm to update the parameters of the subject-amount recognition model until the amount loss value reaches a preset threshold; D7: unfreeze the parameters of the input embedding module, the encoder module, and the subject classification submodule to obtain a preliminarily trained RoBERTa-based accounting subject classification model; D8: Input the training samples of the accounting training data set into the initially trained RoBERTa-based accounting subject classification model to obtain accurately predicted relevant accounting entry information; D9: Use the cross entropy loss function and the mean square error loss function to calculate the loss of the accurately predicted relevant accounting entry information and the true labels corresponding to the training samples to obtain the total loss value; and use the back propagation algorithm to update the parameters of the initially trained RoBERTa-based accounting subject classification model until the total loss value is minimized to obtain the trained RoBERTa-based accounting subject classification model.
5. An automated financial settlement device, characterized in that: It includes a bank-enterprise association unit, a loan account calculation unit, a financial update unit, and an error tracking and correction unit; The bank-enterprise association unit is used to query the bank-enterprise database for total orders according to the company account change information, and query the order database for entry information based on the query result to obtain the entry voucher corresponding to the relevant total order information; wherein the construction of the order database includes the following steps: SA1: Preprocess the text images of different data sources of the total order information to obtain relevant text information; Wherein, the pre-processing includes the following sub-steps: Recognize text images through optical character recognition and extract text information; Use the preset regular expression to clean the text information, and perform abbreviation conversion on the cleaned data to obtain relevant text information. The specific expression is as follows: T clean ={t1,…,t i ,…,t n },i≤n Where, T clean is the cleaned data, t i is the relevant text, n is the total number of text information; then, the relevant text t involved in the abbreviation conversion i Increase the weight. The specific expression is as follows: w i ′=w i ×(1+a) In the formula, w i ′ is the relevant text t i The weight after participating in the abbreviation conversion; w i For the relevant text i The weight before the abbreviation conversion; α is the weight coefficient; Based on this, the specific expression of its related text information is as follows: T={(t1,w n ′),(t2,w2′),…,(t n ,w n ′)} SA2: Perform word segmentation and entity recognition on relevant text information through a preset vocabulary to obtain keyword groups; The steps of obtaining the keyword group are as follows: Segment the relevant text information into several initial subsets. The specific expressions are as follows: Where, T is the relevant text information; t n is the nth relevant text in T; k m is the nth related text t n The mth word after word segmentation; w n is the weight corresponding to the nth related text; K n init From t n An initial subset of words extracted from and their corresponding weights; Entity recognition is performed on several initial subsets to extract several keyword subsets, which are specifically expressed as follows: In the formula, K n entity Represents the initial subset K n init The keyword subset extracted from the , which contains the keywords identified as entities and their corresponding weights; m Represented as vocabulary k m The identified keywords belong to the preset word list Repeated statistics are performed on several keyword subsets, and the weights of the keywords in the keyword subsets are updated to obtain keyword groups. The specific expression is as follows: In m ′=in m ×α r-1 In the formula, w m ' is the keyword e m The corresponding weight, W m For keyword e m The corresponding original weight, r is the keyword e m The number of times it appears in all keyword subsets; α is the weight adjustment coefficient, and its coefficient value range is 1<α<2. The expression of the keyword group is as follows: K adj ={K1 adj ,K2 adj ,…,K n adj ={(e m ,In m ′)|k m ∈t n }} SA3: According to the keyword group, a dynamic sliding window is used to extract the context of the relevant text information to obtain the context-keyword group; wherein, the expression for the nth context-keyword group is: In the formula, k max(0,m-s) and k min(m+s,n) are respectively represented as the mth keyword e m Previous and next words, context segments determined by the dynamic sliding window step size s; K n adj is the nth keyword group; K n init is the nth initial subset; its mth keyword e m The specific calculation of the sliding window step size is as follows: In the formula, w m For keyword e m The corresponding weight; s0 is the basic step size of the sliding window; β is the adjustment coefficient; SA4: Classify the context-keyword group by the accounting subject classification model based on RoBERTa to obtain relevant accounting entry information; SA5: Matching the accounting subjects and amounts in the relevant accounting entry information one by one to obtain a number of preliminary entry vouchers, and attaching the preliminary entry vouchers according to the keyword group to obtain a number of entry vouchers; then, constructing a position index for the images of the different data sources of the general order information, obtaining a key position index, and associating it with the number of entry vouchers, the general order information and the number of data sources, and storing it in the order database, thereby completing the construction of the order database; The position index is constructed by searching for keywords on images from different data sources according to the context-keyword group corresponding to the entry voucher to obtain the paragraph corresponding to the image, and converting the paragraph into the corresponding paragraph coordinates; The debit and credit account calculation unit is used to construct debit and credit accounts according to the entry voucher, and perform debit and credit balance calculation to obtain current debit and credit balance information; The financial update unit is used to perform financial updates on the asset account according to the current loan balance information, obtain the current asset change information, and determine whether the information is balanced according to the account balance system: if yes, complete the financial update; if no, roll back to the backup state and record the imbalance information, and call the error tracking and correction unit; The error tracking and correction unit is used to issue an error alarm based on the imbalance information, and to correct the debit and credit accounts, obtain the current debit and credit balance information, and execute the call of the financial update unit; Wherein, the error tracking and correction unit includes an error alarm module and a loan account correction module; The error alarm module is used to trace errors in the order database according to the entry voucher in the imbalance information, obtain several source data and corresponding key position indexes, highlight several data sources according to the key position indexes, obtain error-related content data, display the error-related content data to the client, and obtain correction information from the user; The loan account correction module is used to correct the current loan account according to the user's correction information, and use the correction information as the current loan balance information to call the financial update unit.
6. The automated financial settlement device according to claim 5, characterized in that: The accounting subject classification model based on RoBERTa includes an input embedding module, an encoder module and an accounting subject classification module; The input embedding module is used to segment the context-keyword group, and vectorize and position encode it in sequence to obtain a number of position-encoded word embeddings; The encoder module is used to calculate the multi-head self-attention weights of several position encoding word embeddings, and perform nonlinear transformation and information aggregation on them to obtain accounting subject feature information; The accounting subject classification module includes a pooling layer, a fully connected layer, a subject classification submodule and an amount division submodule; The pooling layer is used to perform pooling and dimensionality reduction on the accounting subject feature information to obtain pooled feature information; The fully connected layer is used to linearly transform the pooled feature information using an activation function to obtain features to be identified; The subject classification submodule is used to identify the accounting subject of the feature to be identified and obtain the accounting subject label; The amount division submodule is used to use the subject-amount recognition model to perform amount recognition on the context-keyword group, accounting subject feature information, accounting subject label and the feature to be recognized, obtain the accounting subject and the corresponding amount, and combine the accounting subject and the corresponding amount to obtain relevant accounting entry information; The subject-amount recognition model includes an accounting subject deep feature extraction module, an accounting subject shallow feature extraction module, a feature fusion module and an amount recognition module; The accounting subject deep feature extraction module is used to vectorize the accounting subject labels, obtain the subject label embedding, and splice it with the features to be identified and the accounting subject feature information to obtain the deep feature vector; Next, the self-attention mechanism is used to calculate the attention weight of the deep feature vector, and the multi-layer perceptron is used to extract features to obtain the deep features to be fused; The accounting subject shallow extraction module is used to perform multiple splicing of accounting subject labels and all the context-keyword groups to obtain context-combined keyword groups; and vectorize the context-combined keyword groups to obtain a number of word embedding groups; Next, a multi-head self-attention mechanism is used to calculate the weights of several word vector groups to obtain the shallow features to be fused; The feature fusion module is used to splice the shallow features to be fused and the deep features to be fused, and use a multi-layer perceptron to perform feature fusion on the spliced features to obtain complete feature information; The amount recognition module is used to use a fully connected layer to map and predict the complete feature information to obtain the amount corresponding to the current accounting subject.
Citation Information
Patent Citations
Video tag extraction method, system and device and medium
CN117793483A
Resource clearing processing method, system and device, computer equipment, readable storage medium and program product
CN118570003A