An automated accounting and bookkeeping method and system based on multi-source document recognition
By employing multimodal feature extraction and fusion, dual-channel graph construction, and self-supervised anomaly detection, this technology addresses the shortcomings of existing multi-source document processing, enabling efficient, accurate, and adaptive accounting processing of financial data.
Patent Information
- Application Number
- CN202611394335.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-09
- Publication Date
- 2026-11-17
AI Technical Summary
Existing automated accounting and bookkeeping methods and systems have shortcomings in multi-source document feature extraction, end-to-end traceability, anomaly detection, and adaptive early warning. They are unable to effectively handle diverse financial documents, lack end-to-end correlation, rely on labeled data, and have fixed early warning thresholds, making them unable to adapt to changes in business models.
Employing multimodal feature extraction and fusion, dual-channel full-link graph construction, healthy-state self-supervised anomaly detection, and dynamic adaptive early warning, this method extracts document features through CNN, BiLSTM, and GRU networks, uses GCN+HGCN dual-channel graph encoding, and combines a healthy-state self-supervised encoder and SPOT streaming peak thresholding algorithm to achieve full-link traceability and dynamic early warning of financial data.
It improves the accuracy of accounting subject mapping and anomaly detection, realizes full-chain visualization and traceability of financial data, reduces false alarm rate, improves audit efficiency, and can dynamically adapt to changes in business models.
Smart Images

Figure CN123118286A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of enterprise financial management technology, and in particular to an automatic accounting and bookkeeping processing method and system based on multi-source document recognition. Background Technology
[0002] With the continuous improvement of enterprise informatization, financial systems have evolved from traditional stand-alone accounting models to complex information systems covering multiple business systems such as ERP, invoice systems, fund systems, and budget systems. Every day, massive amounts of business orders, expense reports, invoice data, cash flow records, and accounting vouchers flow between different systems, causing the scale and complexity of financial data to grow exponentially. Against this backdrop, automated accounting processing technology based on multi-source document recognition has emerged, becoming a key supporting technology for the intelligent transformation of finance.
[0003] Currently, existing automated accounting and bookkeeping methods and systems have the following main technical shortcomings: I. Insufficient feature extraction capability for multi-source heterogeneous documents.
[0004] Existing automated accounting systems typically employ a single-modal feature extraction approach when processing multi-source documents. This might involve parsing only structured fields or directly using text results after OCR recognition of image-based documents. However, financial documents exhibit a wide variety of formats: invoices contain both image layout information and structured fields, contracts contain a large amount of unstructured text semantics, and cash flow records display typical time-series data patterns. Single-modal feature extraction methods struggle to simultaneously capture key local field information, contextual semantic information, and time-series pattern information from documents. This results in incomplete feature inputs for subsequent accounting processing, affecting the accuracy of accounting subject mapping and anomaly detection.
[0005] Second, there is a lack of end-to-end traceability capabilities for the flow of financial data.
[0006] Current technologies for processing financial data typically treat business documents, accounting vouchers, account entries, and report summaries in a fragmented manner, failing to establish an end-to-end, end-to-end connection between original documents and final reports. When an anomaly is found in an account, auditors need to manually review vouchers and trace documents step by step, consuming significant time and manpower. Even when some systems introduce knowledge graph technology, their graph construction is mainly based on simple transaction scenario clustering, unable to distinguish the structural differences between single debit / credit relationships and multi-account composite entries, let alone model the temporal evolution patterns of these two different structures separately.
[0007] Third, anomaly detection relies on labeled data, which makes it difficult to cope with the problem of sample scarcity.
[0008] Most existing financial anomaly detection methods employ a supervised learning paradigm, requiring a large number of labeled fraudulent samples for model training. However, in real-world financial scenarios, fraudulent or error samples are extremely scarce, and the positive-negative sample imbalance makes it difficult to train supervised models effectively. Some systems have attempted to use unsupervised methods such as Isolation Forests, but these methods rely on static decision boundaries and cannot adapt to the dynamic changes in the distribution of financial data. Furthermore, existing reconstruction-based anomaly detection methods (such as autoencoders) often only use reconstruction loss for training, lacking the discriminative constraints of contrastive learning, resulting in insufficient separability between normal and abnormal samples in the latent space.
[0009] Fourth, the fixed warning threshold cannot adapt to the dynamic changes in business models.
[0010] The statistical characteristics of corporate financial data are not static. With the launch of new businesses, seasonal fluctuations, updates to accounting standards, or adjustments to business models, business characteristics such as transaction amount distribution, account usage frequency, and debit / credit ratios will continuously shift. Most existing automated accounting systems rely on fixed risk thresholds or static rules for early warning, which either generates numerous false alarms or misses genuine anomalies when business characteristics shift. A few systems have introduced concept drift detection, but these only remain at the detection level and fail to create a closed loop between drift detection results and model updates and threshold recalibration.
[0011] In summary, existing automated accounting and bookkeeping methods and systems have significant shortcomings in multi-source document feature extraction, end-to-end tracing, anomaly detection paradigms, and adaptive early warning. There is an urgent need for an automated accounting and bookkeeping method and system that can integrate multimodal document parsing, dual-channel end-to-end graph construction, healthy self-supervised anomaly detection, and dynamic adaptive early warning. Summary of the Invention
[0012] The purpose of this invention is to provide an automatic accounting and bookkeeping method and system based on multi-source document recognition, thereby solving the problems existing in the background art.
[0013] To achieve the above objectives, the present invention provides an automatic accounting and bookkeeping processing method based on multi-source document identification, comprising the following steps: S1. Configure the connection parameters and collection frequency of various financial data collection sources, and configure the initial parameters, risk threshold parameters, user access permissions, and knowledge guidance mask matrix based on accounting standards for the monitoring and analysis model. S2. According to the preset collection frequency, retrieve raw financial data from multiple business-finance systems, extract and fuse multimodal features from heterogeneous documents, and output a unified document feature vector. S3. Preprocess the collected heterogeneous financial data, establish data association based on business ID and voucher association, construct a dual-channel financial full-link map, and output low-order time series features and high-order time series features. S4. Input the real-time input data into the health-state self-supervised encoder, calculate the reconstruction error as the node anomaly score, identify and mark abnormal nodes that exceed the dynamic threshold; trace the abnormal nodes back to the upstream of the business along the full-link map, extract the complete flow link and perform risk scoring on each node to identify potential risk sources. S5. Generate risk monitoring reports and link diagrams; S6. Issue early warnings and push reports to audit or financial management personnel, and monitor the distribution changes of business characteristics in real time, calculating the test statistics for each business characteristic and their corresponding values. Value, when When the value is below the significance threshold, concept drift is determined to have occurred, triggering model updates or threshold recalibration.
[0014] Preferably, the multimodal feature extraction and fusion in S2 includes: extracting local key field features using a CNN network after OCR recognition of image-type documents; extracting contextual semantic features using a BiLSTM network for structured documents; extracting temporal pattern features using a GRU network for unstructured text documents; and fusing the three features into a unified document feature vector through an attention mechanism.
[0015] Preferably, S3 includes: S31. Initialize the graph structure using the constructed knowledge-guided mask matrix; S32. Extract 3rd-order and 4th-order closed-loop phantoms from the initial graph structure, prune the 3rd-order closed-loop phantoms nested inside the 4th-order closed-loop phantoms, and supplement the local information loss caused by pruning through a weighted correlation matrix. S33. Based on the weighted correlation matrix, perform dual-channel graph encoding to output low-order and high-order time series features; S34. Adaptively fuse low-order and high-order temporal features using a gating mechanism to calculate the gating matrix, and then obtain the comprehensive node representation matrix.
[0016] Preferably, the weighted correlation matrix in S32 is as follows: ; In the formula, For compensation coefficient, For nodes Compared to hyperedge The compensation count.
[0017] Preferably, S33 includes: S331. Constructing a low-order spatial feature matrix ; S332, Constructing a high-order spatial feature matrix ; S333, The low-order spatial feature matrix and higher-order spatial characteristic matrix Two GRU cells with mutually isolated parameter spaces are input separately, and independent GRU timing evolution is performed: ; ; in, and The low-order and high-order channel GRU units are respectively located at the current time step. Updated timing hidden state; and The low-order and high-order channel GRU cells were respectively located at the previous time step. The temporal hidden state of 1.
[0018] Preferably, in S34, the gating matrix As shown in the following formula: ; in, This represents vector concatenation. For learnable gated weight matrix, For bias terms, Use the Sigmoid activation function; This leads to the comprehensive node representation matrix. As shown in the following formula: ; in, For element-wise multiplication, 1 represents an all-one matrix.
[0019] Preferably, in step S4, the healthy self-supervised encoder is trained using the contrast-reconstruction joint loss as the training objective, as shown in the following equation: ; In the formula, To normalize the temperature-scaled cross-entropy contrast loss, For input With reconstruction output The mean square error between them is calculated using the following two formulas: ; ; In the formula, For cosine similarity, For temperature parameters, and Encoding representation of two enhanced views for the same set of accounts without abnormalities. For the first The feature vector of each input sample For encoder-decoder pairs The reconstructed output, The total number of nodes. To reconstruct the loss weight coefficients.
[0020] Preferably, the dynamic threshold in S4 is shown in the following formula: In the formula, The initial baseline threshold, For shape parameters, For scale parameters, As for risk tolerance, This represents the total number of samples with abnormal ratings. For exceeding the initial baseline threshold The number of samples.
[0021] Preferably, the test statistic in S6 is shown in the following formula: ; In the formula, The empirical cumulative distribution function of the features within the reference window, Let be the empirical cumulative distribution function of the features within the current window. This indicates that for all independent variables Take the supremum.
[0022] A system for automatic accounting and bookkeeping processing based on multi-source document recognition includes: a data acquisition module, a multimodal document parsing module, a full-link graph construction module, a gating fusion module, a monitoring and anomaly tracing module, a report output and early warning module, a storage and access control module, and a concept drift monitoring module.
[0023] Therefore, the present invention employs the above-mentioned automatic accounting and bookkeeping processing method and system based on multi-source document identification, which has the following beneficial effects: (1) This invention introduces a multimodal feature parallel extraction and attention fusion mechanism in the data acquisition stage: for image-type documents, a CNN network is used to extract local key field features after OCR recognition; for structured documents, a BiLSTM network is used to extract contextual semantic features; and for unstructured text documents, a GRU network is used to extract temporal pattern features. The three features are adaptively fused into a unified document feature vector through an attention mechanism. Compared with the single-modal feature extraction method in the prior art, this invention can simultaneously capture the local key information, contextual semantic information, and temporal pattern information of the document, providing more complete input features for subsequent map construction and anomaly detection, and effectively improving the accuracy of accounting subject mapping and anomaly detection.
[0024] (2) This invention introduces a dual-channel graph coding architecture (GCN+HGCN) for the first time in the financial field. The GCN channel extracts low-order pairwise debit / credit relationship features between business documents and accounting subjects, while the HGCN channel extracts high-order structural features of composite journal entry modules containing multiple accounting subjects by extracting 3rd and 4th order closed-loop modules and constructing a weighted hypergraph. The two channels are equipped with independent GRU units for time-series evolution modeling, with completely isolated parameter spaces. This ensures that the gradients of low-order pairwise debit / credit relationships (high-frequency changes) do not interfere with the time-series modeling of high-order composite journal entry modules (low-frequency stability), solving the gradient interference and feature annihilation problems caused by parameter sharing in the prior art. The gating fusion mechanism adaptively adjusts the fusion ratio of the dual-channel features, enabling the system to dynamically decide whether to focus on the judgment of "single debit / credit deviation" or "abnormal composite journal entry structure" based on the specific business scenario.
[0025] (3) This invention proposes a healthy self-supervised encoder based on contrast-reconstruction joint loss, which can complete model training using only historical accounts without anomalies as training samples. The contrast learning branch brings together different enhanced views of similar accounts without anomalies and pushes away heterogeneous views, giving the encoder discriminative representation capabilities; the reconstruction learning branch ensures that the encoder retains complete original information by minimizing the mean square error between the input and the reconstruction output. During inference, abnormal accounts generate significantly higher reconstruction errors due to their deviation from the healthy distribution, and these reconstruction errors are directly used as node anomaly scores. Compared with the existing technologies where supervised learning relies on labeled fraud samples and the pure reconstruction loss method lacks discriminative power, this invention can be effectively deployed in enterprises lacking labeled fraud data, fundamentally solving the engineering problem of "extreme scarcity of fraud samples" in the financial field.
[0026] (4) This invention introduces the SPOT streaming peak threshold algorithm to generate dynamic early warning thresholds. SPOT only fits the tail (extreme values) of the abnormal score distribution with a generalized Pareto distribution, so that the threshold can automatically rise and fall with recent transaction activity and business fluctuations: the threshold naturally rises during peak business periods to filter noise, and the threshold remains sensitive to penetrate alarms when a real anomaly occurs. At the same time, this invention uses a two-sample Kolmogorov-Smirnov test to monitor the distribution changes of business characteristics in real time. When a statistically significant distribution shift is detected, the model fine-tuning of the healthy self-supervised encoder or the parameter recalibration of the SPOT threshold is automatically triggered. Compared with the problem of the false alarm rate soaring after business mode changes in the existing technology with fixed thresholds or static rules, this invention realizes the adaptive evolution capability of the early warning system to move with business, which greatly reduces the harassment of financial personnel by invalid alarms.
[0027] (5) The financial end-to-end graph constructed by this invention fully records every processing step and its data flow relationship from the original business documents to voucher generation, account posting, and report summary. When an abnormal node is marked, the system automatically traces back to the upstream of the business along the graph, extracts the complete flow link, and calculates the risk score for each node in the link and identifies the potential risk source. The generated monitoring report includes the location of the abnormal node, the complete traceability link, the risk score of each node, the abnormality type, and the timestamp, and supports the visualization of the link graph. Compared with the existing technology of manually flipping through vouchers level by level for tracing, this invention realizes the automation and visualization of the cause of abnormality, which significantly improves the problem location efficiency of audit and financial management personnel.
[0028] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0029] Figure 1 This is a system framework diagram of an automatic accounting and bookkeeping processing method based on multi-source document recognition according to the present invention; Figure 2 This is a flowchart of an automatic accounting and bookkeeping processing method based on multi-source document recognition according to the present invention. Detailed Implementation
[0030] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0031] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0032] Example Please see Figures 1-2 This invention provides an automatic accounting and bookkeeping system based on multi-source document recognition, comprising: The data acquisition module is configured to connect to multiple business and financial systems, such as ERP, invoice, funds, and budget systems, and periodically capture raw financial data according to a preset collection frequency. The raw financial data includes business orders, expense reports, invoice data, cash flow, accounting vouchers, and account balance data. Each data entry is accompanied by a unique business ID, timestamp, and flow node marker.
[0033] The multimodal document parsing module, connected to the data acquisition module, is configured to: extract multimodal features from the heterogeneous document data output by the data acquisition module; input local key field features into a CNN network after OCR recognition of image-type documents; input contextual semantic features into a BiLSTM network for structured documents; input temporal pattern features into a GRU network for unstructured text documents; and fuse the three features through an attention mechanism to output a document feature vector in a unified format.
[0034] The end-to-end graph construction module, connected to the multimodal document parsing module, is configured to: receive document feature vectors output by the multimodal document parsing module; establish relationships between different data tables based on business IDs and voucher associations; and construct an end-to-end graph of financial data. The graph employs a dual-channel encoding architecture: the GCN channel extracts low-order pairwise debit / credit relationship features between business documents and accounting subjects, while the HGCN channel extracts high-order structural features of composite entry modules containing multiple accounting subjects. The GCN and HGCN channels are each equipped with independent GRU units for time-series evolution modeling, outputting low-order and high-order time-series features. Graph nodes include business document nodes, voucher generation nodes, account posting nodes, and report summary nodes; edges represent data flow and transmission relationships. The graph's edge connections are constrained by a knowledge-guided mask matrix, which is pre-encoded according to accounting standards.
[0035] The gating fusion module, connected to the full-link graph construction module, is configured to receive low-order temporal features output from the GCN channel and high-order temporal features output from the HGCN channel, adaptively calculate the fusion weights through a gating mechanism, and output the fused integrated node representation.
[0036] The monitoring and anomaly tracing module, connected to the gating fusion module, is configured as follows: it receives the comprehensive node representation output by the gating fusion module, uses a healthy self-supervised encoder to calculate the reconstruction error as the node anomaly score, and marks nodes with scores exceeding the dynamic threshold as anomaly nodes; it traces back from the anomaly node to the upstream of the business along the entire link map, extracts all flow nodes from the link start point to the anomaly node, calculates the risk score of each node, and identifies potential risk sources; the healthy self-supervised encoder is trained using only historical accounts without anomalies as training samples, and is trained through a contrast-reconstruction joint loss function; the dynamic threshold is adaptively generated by the SPOT streaming peak threshold algorithm based on the recent anomaly score distribution.
[0037] The report output and early warning module is connected to the monitoring and anomaly tracing module and is configured to: receive the location of the abnormal node, the complete tracing link and the risk score of each node output by the monitoring and anomaly tracing module, generate a risk monitoring report and display it visually, output early warnings and push reports to audit or financial management personnel, and support viewing the raw data of the link nodes.
[0038] The storage and access control module is connected to the data acquisition module, multimodal document parsing module, full-link graph construction module, monitoring and anomaly tracing module, and report output and early warning module, respectively. It is configured to store standardized datasets and full-link graph data, and manage user access permissions.
[0039] The concept drift monitoring module, connected to the monitoring and anomaly tracing module, is configured to: use a two-sample Kolmogorov-Smirnov test to monitor changes in the distribution of business features in real time; when a significant shift in the distribution is detected, it triggers a model update of the healthy self-supervised encoder or parameter recalibration of the SPOT dynamic threshold.
[0040] The above-mentioned processing method of an automated accounting and bookkeeping system based on multi-source document recognition includes the following steps: S1. System Initialization Configuration: Configure the connection parameters and collection frequency of various financial data collection sources, configure the initial parameters, risk threshold parameters, user access permissions, and knowledge-guided mask matrix based on accounting standards for the monitoring and analysis model. The connection parameters include API address authentication credentials for the ERP system, invoice system, funds system, and budget system.
[0041] The inputs for this step are: connection information for each financial system, accounting standard configuration file, initial risk threshold parameters, and user permission list.
[0042] The output of this step is: the configured data acquisition task queue and the knowledge guidance mask matrix. Initialize the monitoring model parameters.
[0043] The knowledge-guided mask matrix is constructed using the following method: based on the debit and credit rules and account hierarchy in accounting standards, it is pre-encoded as a bipartite graph structure mask matrix K. For the set of accounting accounts... and lag order mask matrix middle, Indicates the first The current subject and the first There are debit and credit relationships between the lagging accounts that comply with accounting standards. This indicates that there is no direct relationship.
[0044] The knowledge-guided mask matrix is used in S3 to constrain the edge connections of the graph, ensuring that information is only allowed to propagate between nodes that comply with accounting standards.
[0045] S2. Multi-source Financial Data Multimodal Acquisition and Analysis: Raw financial data is captured from multiple business-finance systems according to a preset acquisition frequency. This includes business orders, expense reports, invoice data, cash flow records, accounting vouchers, and account balance data. Each data entry is accompanied by a unique business ID, timestamp, and transfer node marker. Multimodal feature extraction and fusion are performed on heterogeneous documents to output a unified document feature vector.
[0046] The input for this step is the data acquisition task queue configured in S1.
[0047] The output of this step is: a set of document feature vectors in a uniform format. And the corresponding business ID, timestamp, and flow node marker.
[0048] This step specifically includes: S21. Heterogeneous Document Classification and Preprocessing: Collected heterogeneous documents are classified according to data type, including: image documents (such as scanned invoices) are identified by OCR and then text information is extracted; structured documents (such as accounting vouchers and trial balances) have their fields directly parsed; and unstructured text documents (such as contracts and expense reports) undergo text cleaning and word segmentation preprocessing. All documents are uniformly encoded into sequence form. .
[0049] S22. Perform parallel multimodal feature extraction on the classified heterogeneous documents: S221. Image Document Feature Extraction: The text sequence recognized by OCR is input into a one-dimensional CNN network. Local key field features are extracted through three convolutional layers (in this embodiment, the kernel sizes are 7, 5, and 3, and the number of channels are 128, 64, and 32, respectively). After max pooling and flattening, the local feature vector is output. : ; In the formula, This is a text sequence of image-based documents after OCR recognition and encoding. The dimension of the feature vector.
[0050] S222, Structured Document Feature Extraction: The structured field sequence is input into a bidirectional LSTM network, which contains two BiLSTM layers, each with 128 units. The forward and backward hidden states are concatenated and then processed by Dropout (in this embodiment, the dropout rate is set to 0.3) to output a contextual semantic feature vector. : ; ; In the formula, In time step The first field in the structured document field sequence of the input BiLSTM network One element, For the forward LSTM at time step The hidden state, For backward LSTM at time step The hidden state, For the forward LSTM at the final time step The hidden state, This represents the hidden state of the backward LSTM at the initial time step. This indicates a vector concatenation operation.
[0051] S223. Feature Extraction from Unstructured Text Documents: Input the text sequence into a two-layer GRU network (128 units per layer), and extract temporal pattern feature vectors through update and reset gates. : ; ; ; In the formula, This represents the Sigmoid activation function. , , These are the learnable weight matrices for the update gate, reset gate, and candidate hidden states in the GRU network, respectively. To update the gate output, control the proportion of the hidden state from the previous moment that is passed to the current moment; To reset the door output, control the degree to which the hidden state of the previous moment is ignored; This is the candidate hidden state; This is the final hidden state at the current moment; This represents the hidden state of the GRU network at the final time step TT.
[0052] S23. Multimodal attention fusion: Adaptively fuses three feature vectors into a unified document feature vector through an attention mechanism. For modal indexing ,in, , , These correspond to image modality, structured data modality, and unstructured text modality, respectively; first, the features of each modality are projected onto a shared space to obtain... Calculate attention weights The weighted sum is then calculated as follows: ; ; ; in, For the first Feature representation of each modality after projection onto the shared space For the first Feature representation of each modality after projection onto the shared space For the first The projection weight matrix of each modality, The output of S22 / S222 / S223 The feature vector of a modality For bias terms, Let be the query vector for the attention network. Here is the weight matrix of the attention network; satisfy ; This is the final unified document feature vector after merging; The hyperbolic tangent function is used as an activation function to convert the input... Mapping to the (-1,1) interval serves as a non-linear transformation and feature scaling, enabling the attention network to learn more complex feature interactions. At the same time, its zero-centrosymmetric output characteristics help alleviate the gradient vanishing problem and improve training stability.
[0053] S3. Construct a dual-channel financial full-link graph: Clean and standardize the collected heterogeneous financial data, including deduplication, missing value completion, format conversion, and dirty data filtering. Then, establish data associations based on business IDs and voucher relationships to construct a dual-channel financial full-link graph.
[0054] The dual-channel architecture includes a GCN channel for extracting low-order paired lending relationship features and an HGCN channel for extracting high-order composite entry module features. The two channels use independent GRU units for time-series evolution modeling and output low-order and high-order time-series features, respectively.
[0055] The input for this step is: the set of document feature vectors output by S2. And the corresponding business ID and timestamp.
[0056] The output of this step is: the low-order timing characteristics of the GCN channel output. High-order timing characteristics of HGCN channel output Integrated node representation after fusion .
[0057] This step specifically includes: S31. Knowledge-guided graph structure initialization: using accounting subjects, business documents, vouchers, and reports as node sets. Using data flow and transmission relationships as the edge set The knowledge-guided mask matrix constructed in conjunction with S1 Initialize the graph structure. Graph adjacency matrix. satisfy: ; in, is the original adjacency matrix based on data statistics, and © is the element-wise product (Hadamard product). A knowledge-guided mask matrix.
[0058] S32. Hypergraph Construction and Higher-Order Module Extraction: Extract 3rd and 4th order closed-loop modules from the initial graph. A module represents a closed-loop relationship structure formed between multiple accounting items, such as "Debit: Bank Deposit, Credit: Main Business Revenue, Taxes Payable," which is a closed-loop module containing 3 nodes. For the set of 3rd order closed-loop modules... and 4th order closed-loop phantom set Each motif is mapped to a hyperedge to construct an initial hypergraph. ,in, This is the initial set of hyperedges. The initial incidence matrix. middle, Represents a node Belongs to superedge .
[0059] To address the information redundancy issue caused by the natural inclusion of third-order closed-loop motifs within fourth-order motifs, the third-order motifs nested within the fourth-order motifs are pruned. The set of pruned third-order motifs is as follows: ; In the formula, For the model The set of nodes contained therein For the model The set of nodes it contains.
[0060] To compensate for the loss of local information caused by pruning, weight compensation is applied to the nodes in the retained superedges. For the retained superedges... Nodes in Compensation count For inclusion Number of pruned 3rd-order motifs: ; Weighted correlation matrix for: ; in, The compensation coefficient (determined through parameter sensitivity analysis in this embodiment) is... (for the optimal value), weighted correlation matrix Used for high-order feature propagation in the HGCN channel of S33; For nodes Compared to hyperedge The compensation count.
[0061] S33, Dual-channel map encoding: S331, GCN low-order channel: A two-layer graph convolutional network is used on the original graph to extract low-order pairwise lending relationship features. Layered graph convolution is: ; in, To add a self-loop adjacency matrix, It is the identity matrix. for The degree matrix, The node feature matrix output by S2, and the node feature vectors output by S23. Arranged by stacking rows; For the first Layer learnable weight matrix, This is the ReLU activation function.
[0062] through The low-order spatial feature matrix is obtained after convolution. .
[0063] S332 and HGCN higher-order channels: A two-layer hypergraph convolutional network is used on the weighted hypergraph constructed by S32 to extract higher-order composite journal motif features. To maintain the purity of the topological metric, features are first extracted based on the weighted correlation matrix. The binary version calculates the vertex degree matrix. and hypermarginality matrix Redefine the hypergraph propagation matrix : ; in, This is the hyperedge weight matrix (default identity matrix). Hypergraph convolution is: ; in, , which is the initial node feature matrix of the HGCN channel; For the first Layer learnable weight matrix.
[0064] through The high-order spatial feature matrix is obtained after hypergraph convolution. .
[0065] S333, Independent GRU Temporal Evolution: Transforming Low-Order Spatial Features and higher-order spatial features Input two GRU cells whose parameter spaces are isolated from each other: ; ; in, and The low-order and high-order channel GRU units are respectively located at the current time step. Updated timing hidden state; and These are the low-order and high-order spatial feature matrices output by S331 and S332, respectively; and The low-order and high-order channel GRU cells were respectively located at the previous time step. The temporal hidden state of 1; and The GRU unit has independent parameter spaces, namely low-order channels and high-order channels, and the parameter spaces of the two are completely isolated and do not share each other.
[0066] S34. Gated Adaptive Fusion: Adaptive fusion of low-order temporal features using a gating mechanism. and higher-order temporal features The gating matrix is calculated to obtain the comprehensive node representation matrix. The calculation is as follows: ; in, This represents vector concatenation. For learnable gated weight matrix, For bias terms, This is the Sigmoid activation function.
[0067] Synthetic Node Representation Matrix for: ; in, For element-wise multiplication, 1 represents an all-one matrix.
[0068] S4. Real-time monitoring and anomaly tracing of the entire link: Input real-time input data into the healthy self-supervised encoder, calculate the reconstruction error as the node anomaly score, identify and mark abnormal nodes that exceed the dynamic threshold; trace the abnormal nodes back to the upstream of the business along the entire link map, extract the complete flow link and perform risk scoring on each node to identify potential risk sources.
[0069] Among them, the dynamic threshold is adaptively generated by the SPOT streaming peak over-threshold algorithm, and the healthy state self-supervised encoder uses only historical accounts without anomalies as training samples.
[0070] The input for this step is: the synthesized node representation output by S3. Full-link map The initial risk threshold parameters configured in S1.
[0071] The output of this step is: a set of abnormal nodes. Complete traceability chain Risk score set for each node Potential risk sources .
[0072] This step specifically includes: S41. Healthy Self-Supervised Encoder Training: The CNN-Transformer encoder is trained using only historical accounts without anomalies as training samples. The encoder consists of three one-dimensional CNN layers (kernel sizes of 7, 5, and 3, stride of 2) and two Transformer layers (in this embodiment, 4-head attention and embedding dimension of 64). The training objective is the contrast-reconstruction joint loss. ; in, To normalize the temperature-scaled cross-entropy contrastive loss, maximize representational consistency for different enhanced views of the same anomaly-free set of accounts (with added minor Gaussian noise and amplitude scaling): ; in, For cosine similarity, For temperature parameters, and This is a coded representation of two enhanced views for the same set of accounts without any abnormalities.
[0073] For input With reconstruction output The mean square error between them is calculated using the following formula: ; in, For the first The feature vectors of each input sample (i.e., the comprehensive node representation output by S34) The OK), For encoder-decoder pairs The reconstructed output, The total number of nodes. To reconstruct the loss weight coefficients, the encoder in S42 calculates the reconstruction error for each node as an anomaly score.
[0074] S42. Anomaly Scoring and Dynamic Threshold Detection: A comprehensive node representation of real-time input data. The reconstruction error of each node is calculated by inputting the trained healthy self-supervised encoder. As an anomaly score: ; In the formula, For nodes At time step Reconstruction error, For nodes At time step The input feature vector, Reconstruct its vector; The SPOT streaming peak over-threshold algorithm is used to adaptively generate dynamic thresholds. For abnormal scoring streams Assuming the initial baseline threshold is exceeded The scores follow a generalized Pareto distribution: ; in, For shape parameters, For scale parameters, and All data were obtained by fitting the tail data of the outlier scores using maximum likelihood estimation. The initial baseline threshold is the 95th percentile of the abnormal score distribution.
[0075] Dynamic threshold for: ; in, Risk tolerance (set according to audit false statement rate requirements). This represents the total number of samples with abnormal ratings. To exceed the baseline The number of samples, This is a general anomaly scoring variable. When... At that time, node It was marked as an abnormal node.
[0076] S43. Abnormal Node Reverse Tracing: Tracing upstream from the abnormal node along the entire link graph to extract the complete flow link from the link's starting point to the abnormal node. For abnormal nodes... Its upstream node set for: ; In the formula, For the set of all nodes in the full-link graph, This refers to the set of all upstream nodes from the start of the link to the abnormal node. These are the marked abnormal nodes.
[0077] The abnormal propagation path is ,in, As the starting node of the link, It is the direct upstream parent node of the abnormal node.
[0078] S44. Node Risk Score Calculation and Risk Source Identification: This involves analyzing the upstream node set obtained through tracing. Each node in Considering its reconstruction error Node betweenness centrality (represents the frequency of a node's appearance in the shortest path of the entire link graph, reflecting the criticality of a node in data flow). Probability of abnormal propagation (Calculate the risk score based on the probability of risk propagation along the edges, calculated according to the edge weights of the graph.) ; in, , , All are weighting coefficients, and satisfy the following conditions: In this embodiment, , , Take values of 0.5, 0.2, and 0.3 respectively; node Betweenness centrality; The Min-Max normalization function is shown in the following equation: ; The upstream node with the highest risk score is the potential source of risk. .
[0079] S5. Generate Risk Monitoring Report: Generate a risk monitoring report that includes the location of abnormal nodes, complete traceability link, risk score of each node, abnormality type, and timestamp, and supports visual display of the link map.
[0080] The input for this step is the set of abnormal nodes output by S44. Complete traceability chain Risk score set for each node Potential risk sources .
[0081] The output of this step is: a risk monitoring report (including the location of abnormal nodes, complete traceability link, risk score of each node, abnormality type, and timestamp) and a visualized link map.
[0082] This step specifically includes: S51, Report Data Assembly: This includes the location of the abnormal node (including node ID, node type, and associated account / document), and the complete traceability chain (as output in S43). Based on this, the risk propagation direction is marked, and the risk score for each node is calculated (output by S44). The data is assembled into structured report data based on the anomaly type (classified according to the anomaly node type and scoring mode, such as "debit and credit imbalance anomaly", "amount deviation anomaly", "account usage anomaly", etc.) and timestamp.
[0083] S52. Link graph visualization: The force-directed graph layout algorithm is used to visualize the entire link graph in the form of nodes and edges; abnormal nodes and their upstream cone paths are marked with highlighted colors, the node color depth is positively correlated with the risk score, and the edge thickness is positively correlated with the data flow frequency.
[0084] S6. Output early warnings and push reports to audit or financial management personnel, supporting the viewing of raw data at each link node; and employing a two-sample Kolmogorov-Smirnov test to monitor the distribution changes of business characteristics in real time, calculating the test statistics for each business characteristic and their corresponding values. Value, when When the value is below the significance threshold, concept drift is determined to have occurred, triggering model updates or threshold recalibration.
[0085] The inputs for this step are: the risk monitoring report output by S51 and the real-time business characteristic data stream.
[0086] The outputs of this step are: early warning notifications, reports pushed to audit / financial management personnel, concept drift detection results, and triggered model update signals.
[0087] This step specifically includes: S61. Early Warning Classification and Push: Based on the risk score output by S44 and S42 dynamic threshold Implement early warning classification. When A Level 1 warning (high risk) is triggered at 0.8. When a Level 2 warning (medium risk) is triggered, A Level 3 alert (low risk, only recorded, not pushed) is triggered. The alert report is pushed to audit or financial management personnel via email, SMS, or system message, and the original document data can be viewed by clicking on the link node.
[0088] S62. Concept Drift Monitoring: A two-sample Kolmogorov-Smirnov test is used to monitor changes in the distribution of business characteristics in real time. A reference time window (data from the past 30 days) and a current time window (data from the last 7 days) are set, and the Kolmogorov-Smirnov test statistic for each business characteristic (transaction amount, transaction frequency, account usage frequency, loan-to-debit ratio, etc.) is calculated. ; In the formula, This is the Kolmogorov-Smirnov test statistic, with a value range of [0,1]. The empirical cumulative distribution function of the features within the reference window, Let be the empirical cumulative distribution function of the features within the current window. This indicates that for all independent variables Take the supremum (maximum value).
[0089] The calculated Substitute the values into the Kolmogorov distribution function and calculate. value: ; In the formula, For effective sample size, and The number of samples in the reference window and the current window is not specified; the first 10 terms of this series are usually sufficient to obtain adequate accuracy. The value represents the probability of observing the current DD value or a larger value when the null hypothesis that "two window samples come from the same distribution" is true, and the value ranges from [0,1].
[0090] when corresponding Value below significance threshold When this occurs, it is determined that the feature has undergone conceptual drift.
[0091] S63, Adaptive Model Update: When S62 detects concept drift, one or a combination of the following operations is automatically triggered: (1) If the degree of drift is small ( We fine-tuned the healthy self-supervised encoder in S41 using recent data.
[0092] (2) If the degree of drift is large Then, re-execute S41 to retrain the model.
[0093] (3) Update the reference baseline of the SPOT algorithm in S42. and generalized Pareto distribution parameters and This enables dynamic recalibration of the threshold.
[0094] The following examples further illustrate this method.
[0095] Business Background: On January 15, 20xx, a manufacturing company made a purchase transaction for steel worth 10 million yuan, with VAT of 1.3 million yuan, totaling 11.3 million yuan including tax. The ERP system generated a purchase order (PO-2026-0015), the invoice system entered the VAT invoice (INV-2026-0082), and the financial system recorded the bank payment transaction (PAY-2026-0031).
[0096] Step S1: System initialization configuration.
[0097] The system reads the accounting standards configuration and generates a knowledge-guided mask matrix. The matrix stipulates that the "Materials Procurement" account can only have debit / credit relationships with accounts such as "Accounts Payable", "Taxes Payable - Value Added Tax (Input Tax)" and "Bank Deposits", and cannot be directly linked to accounts such as "Main Business Revenue".
[0098] Step S2: Multi-modal acquisition and analysis of multi-source financial data.
[0099] The system retrieves data from the ERP, invoice, and financial systems at a preset frequency (every hour): Purchase order (structured JSON): { :PO-2026-0015, :11300000, S-0082, :2026-01-15}; The contextual semantics are extracted using a BiLSTM network to obtain... =[0.32,-0.18,0.57,...].
[0100] Scanned copy of VAT invoice (image): After OCR recognition, key fields are extracted using a CNN network to obtain... =[0.28,-0.45,0.63,...] Bank payment transaction records (structured time series): The time series pattern is extracted via a GRU network to obtain... =[0.41,-0.22,0.39,...] Through multimodal attention fusion ( =0.38, =0.35, =0.27), thus obtaining the unified document feature vector. =[0.34,-0.28,0.53,...] (128 dimensions).
[0101] Step S3: Construct a dual-channel financial full-link map.
[0102] The system adds seven nodes (purchase order → warehouse receipt → accounting voucher → material procurement → taxes payable → accounts payable → bank deposit) of this transaction to the graph, including documents, vouchers, and accounts. Total number of nodes. =7, edge set =6.
[0103] S331, GCN low-order channel: Perform graph convolution (2 layers) on the original graph. Taking the node "Material Procurement" as an example, aggregate the features of its neighboring nodes "Warehouse Entry Slip" (association strength 0.7) and "Accounts Payable" (association strength 0.6), and obtain the updated low-order spatial features. =[0.45,-0.32,0.58,...].
[0104] S32. Hypergraph Construction: Extract a 4th-order closed-loop module "Accounts Payable → Material Procurement → Taxes Payable → Bank Deposit" (compound payment entry), and map it as a hyperedge. The dataset contains nodes {v2, v4, v5, v7}. Four third-order motifs (e.g., "Accounts Payable → Material Procurement → Taxes Payable") are also extracted. These are pruned because they are contained within fourth-order motifs. Weight compensation is applied to v2, v4, v5, and v7 (taking...). =1, =0.2). The weighted correlation matrix is obtained. (7×1): (2,1)=1.2, (4,1)=1.2, (5,1)=1.2, (7,1)=1.2, the rest are 0.
[0105] S332, HGCN higher-order channels: based on Calculate the hypergraph propagation matrix (7×7), perform hypergraph convolution (2 layers) to obtain high-order spatial features. =[0.62,-0.15,0.71,...].
[0106] S333, Independent GRU Temporal Evolution: Using the features of historical time steps as input, update two independent GRUs: ; ; S34. Gated Adaptive Fusion: Calculate the gating matrix: =0.35; The result after fusion is: =[0.53,-0.18,0.63,...]; The higher weighting of compound entries indicates that the higher-order structural information of this transaction is more important for accounting decisions.
[0107] Step S4: Real-time monitoring and anomaly tracing across the entire chain.
[0108] S41, Healthy Self-Supervised Encoder Inference: [The following text appears to be incomplete and requires further context:] (7×128) Input the trained CNN-Transformer encoder to obtain the reconstructed output. The reconstruction error of each node is calculated, as shown in Table 1 below: Table 1 Reconstruction error of each node
[0109] "Accounting Voucher" node reconstruction error =0.42 exceeds the dynamic threshold =0.15, marked as an anomalous node. (The threshold was obtained by analyzing the tail of the historical anomalous score distribution using the SPOT algorithm, with a risk tolerance of q=10.) -4 (Corresponding quantiles.) S43. Reverse tracing of abnormal nodes: Tracing upstream along the graph to obtain the complete link: purchase order → warehouse receipt → accounting voucher (abnormal), and then applying the risk propagation matrix. The risk value of each upstream node is calculated.
[0110] S44. Node Risk Score Calculation: Calculate the risk score for each upstream node, including the risk score for "Purchase Orders". =0.76 (highest), "Inbound Order" =0.52, which is the second highest. Therefore, the potential source of risk is identified as the purchase order.
[0111] Step S5: Generate a risk monitoring report.
[0112] The system automatically generates a report: Abnormal node: Accounting voucher (voucher number V-2026-0017); Anomaly type: Amount deviation anomaly; Complete traceability chain: Purchase order PO-2026-0015 → Inbound slip GR-2026-0023 → Accounting voucher V-2026-0017; Risk scores for each node: Purchase order 0.76, Inbound slip 0.52, Accounting voucher 0.42; Timestamp: 2026-01-15 14:23:05; Original data preview: Purchase amount 10 million yuan, value-added tax 1.3 million yuan, total price including tax 11.3 million yuan.
[0113] Step S6: Output early warning and adaptive optimization.
[0114] S61. Early Warning Classification and Push: Based on risk score =0.76 falls under the level 2 warning category (0.5 < (≤0.8), the system pushes a report to the finance manager via email, indicating "It is recommended to review the supplier information and amount of purchase order PO-2026-0015".
[0115] S62. Concept Drift Monitoring: On the same day, the system's KS detection module compared the distribution of the "average monthly purchase amount" over the past 30 days with that over the past 7 days, and calculated... =0.08, =0.002, lower than =0.05, indicating a concept drift – a significant change in the company's purchase amount distribution was detected (the average monthly purchase amount increased from 8 million yuan to 20 million yuan year-on-year).
[0116] S63, Adaptive Model Update: Due to significant drift ( =0.08≥0.05, =0.002<0.01), the system automatically triggers: retrain the healthy self-supervised encoder using the procurement data of the past 7 days, and recalculate the SPOT baseline with the new data. and generalized Pareto distribution parameters , This enables dynamic threshold recalibration. The model resumes stable operation the following day, maintaining a false alarm rate of ≤0.1% in the new business environment.
[0117] Therefore, this invention adopts the above-mentioned automatic accounting and bookkeeping processing method and system based on multi-source document recognition. Through the dual-channel decoupling architecture of GCN and HGCN and independent GRU time-series modeling, it realizes the separate characterization and adaptive fusion of low-order paired debit and credit entries and high-order composite entries, which significantly improves the accuracy of anomaly identification. The healthy self-supervised encoder based on contrast-reconstruction joint loss can be trained with only anomaly-free account sets, completely eliminating the dependence on labeled fraud data and greatly reducing deployment costs. Combined with the closed-loop adaptive mechanism of SPOT dynamic threshold and KS concept drift monitoring, the warning threshold is autonomously adjusted with business fluctuations and the model evolves online, effectively balancing the false alarm rate and the false negative rate, and enhancing the deployment robustness of the system.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. An automatic accounting and bookkeeping processing method based on multi-source document recognition, characterized in that, Includes the following steps: S1. Configure the connection parameters and collection frequency of various financial data collection sources, and configure the initial parameters, risk threshold parameters, user access permissions, and knowledge guidance mask matrix based on accounting standards for the monitoring and analysis model. S2. According to the preset collection frequency, retrieve raw financial data from multiple business-finance systems, extract and fuse multimodal features from heterogeneous documents, and output a unified document feature vector. S3. Preprocess the collected heterogeneous financial data, establish data association based on business ID and voucher association, construct a dual-channel financial full-link map, and output low-order time series features and high-order time series features. S4. Input the real-time input data into the healthy self-supervised encoder, calculate the reconstruction error as the node anomaly score, identify and mark abnormal nodes that exceed the dynamic threshold; Tracing the abnormal nodes back to the upstream of the business along the entire link map, extracting the complete flow link and scoring each node for risk, and identifying potential risk sources; S5. Generate risk monitoring reports and link diagrams; S6. Issue early warnings and push reports to audit or financial management personnel, and monitor the distribution changes of business characteristics in real time, calculating the test statistics for each business characteristic and their corresponding values. Value, when When the value is below the significance threshold, concept drift is determined to have occurred, triggering model updates or threshold recalibration.
2. The automatic accounting and bookkeeping processing method based on multi-source document recognition according to claim 1, characterized in that, The multimodal feature extraction and fusion in S2 includes: extracting local key field features using a CNN network after OCR recognition of image-type documents; extracting contextual semantic features using a BiLSTM network for structured documents; extracting temporal pattern features using a GRU network for unstructured text documents; and fusing the three features into a unified document feature vector through an attention mechanism.
3. The automatic accounting and bookkeeping processing method based on multi-source document recognition according to claim 2, characterized in that, S3 includes: S31. Initialize the graph structure using the constructed knowledge-guided mask matrix; S32. Extract 3rd-order and 4th-order closed-loop phantoms from the initial graph structure, prune the 3rd-order closed-loop phantoms nested inside the 4th-order closed-loop phantoms, and supplement the local information loss caused by pruning through a weighted correlation matrix. S33. Based on the weighted correlation matrix, perform dual-channel graph encoding to output low-order and high-order time series features; S34. Adaptively fuse low-order and high-order temporal features using a gating mechanism to calculate the gating matrix, and then obtain the comprehensive node representation matrix.
4. The automatic accounting and bookkeeping method based on multi-source document recognition according to claim 3, characterized in that, The weighted correlation matrix in S32 is shown in the following formula: ; In the formula, For compensation coefficient, For nodes Compared to hyperedge The compensation count.
5. The automatic accounting and bookkeeping method based on multi-source document recognition according to claim 4, characterized in that, S33 includes: S331. Constructing a low-order spatial feature matrix ; S332, Constructing a high-order spatial feature matrix ; S333, The low-order spatial feature matrix and higher-order spatial characteristic matrix Two GRU cells with mutually isolated parameter spaces are input separately, and independent GRU timing evolution is performed: ; ; in, and The low-order and high-order channel GRU units are respectively located at the current time step. Updated timing hidden state; and The low-order and high-order channel GRU cells were respectively located at the previous time step. The timing hidden state of 1.
6. The automatic accounting and bookkeeping processing method based on multi-source document recognition according to claim 5, characterized in that, In S34, the gate matrix As shown in the following formula: ; in, This represents vector concatenation. For learnable gated weight matrix, For bias terms, Use the Sigmoid activation function; This leads to the comprehensive node representation matrix. As shown in the following formula: ; in, For element-wise multiplication, 1 represents an all-one matrix.
7. The automatic accounting and bookkeeping method based on multi-source document recognition according to claim 6, characterized in that, In step S4, the healthy self-supervised encoder is trained using the contrast-reconstruction joint loss as the training objective, as shown in the following equation: ; In the formula, To normalize the temperature-scaled cross-entropy contrast loss, For input With reconstruction output The mean square error between them is calculated using the following two formulas: ; ; In the formula, For cosine similarity, For temperature parameters, and Encoding representation of two enhanced views for the same set of accounts without abnormalities. For the first The feature vector of each input sample For encoder-decoder pairs The reconstructed output, The total number of nodes. To reconstruct the loss weight coefficients.
8. The automatic accounting and bookkeeping method based on multi-source document recognition according to claim 7, characterized in that, The dynamic threshold in S4 is shown in the following formula: In the formula, The initial baseline threshold, For shape parameters, For scale parameters, As for risk tolerance, This represents the total number of samples with abnormal ratings. For exceeding the initial baseline threshold The number of samples.
9. The automatic accounting and bookkeeping method based on multi-source document recognition according to claim 8, characterized in that, The test statistic in S6 is shown in the following formula: ; In the formula, The empirical cumulative distribution function of the features within the reference window, Let be the empirical cumulative distribution function of the features within the current window. This indicates that for all independent variables Take the supremum.
10. A system applied to the automatic accounting and bookkeeping processing method based on multi-source document identification as described in any one of claims 1-9, characterized in that, include: The system includes a data acquisition module, a multimodal document parsing module, a full-link graph construction module, a gating fusion module, a monitoring and anomaly tracing module, a report output and early warning module, a storage and access control module, and a concept drift monitoring module.
