Machine learning based financial to account allocation and anomaly detection method and system
By constructing a causal graph model and combining it with a temporal attention weight matrix for weighted fusion, the shortcomings of existing financial reconciliation systems in discrepancy identification and attribution are solved, realizing automated and intelligent financial reconciliation and improving efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-14
- Publication Date
- 2026-04-10
AI Technical Summary
Existing financial reconciliation systems struggle to accurately identify and attribute discrepancies when faced with complex and ever-changing business environments. They also lack adaptive learning capabilities, resulting in low efficiency and excessive manual intervention.
A causal graph model is constructed and weighted fusion is performed using a temporal attention weight matrix. Causal reasoning and reinforcement learning are used to generate attribution results for discrepancies, and the processing strategy is optimized to improve reconciliation efficiency and accuracy.
It has automated and made the reconciliation process more intelligent, improved the accuracy and interpretability of attributing discrepancies, reduced human intervention, and enhanced the scientific nature and foresight of financial management.
Smart Images

Figure CN120894164B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to machine learning technology, and in particular to a machine learning-based financial account allocation and anomaly detection method and system. BACKGROUND
[0002] In the field of financial management and accounting audit, bank reconciliation is a fundamental and critical task, which involves matching and checking the internal financial records of an enterprise with the bank-provided transaction records to ensure the accuracy and completeness of financial data. Traditional reconciliation methods mainly rely on manual checking, which is inefficient and prone to errors when dealing with large amounts of data. As the size of enterprises expands and the complexity of business increases, the complexity of reconciliation work also increases, especially when dealing with multi-account, multi-currency, and multi-channel financial data, the identification and attribution of reconciliation differences become increasingly difficult.
[0003] In recent years, with the development of artificial intelligence and machine learning technology, automated reconciliation systems have gradually been applied in the financial field. These systems attempt to automate the reconciliation process through rule matching, pattern recognition, and other methods to improve reconciliation efficiency and reduce human error. However, existing technologies still have some obvious shortcomings in practical application.
[0004] Firstly, existing reconciliation systems mostly use simple rule matching or statistical learning methods, which are difficult to effectively capture the complex relationship between financial data and bank transaction records, especially when dealing with unstructured data or abnormal transaction patterns, the matching accuracy is often unsatisfactory.
[0005] Secondly, traditional reconciliation methods lack the ability to analyze the causes of differences in depth, and can only identify the existence of differences, but cannot automatically derive the specific reasons for the differences, which leads to accountants still spending a lot of time on difference attribution and explanation work.
[0006] Thirdly, existing reconciliation systems lack adaptive learning ability and cannot dynamically adjust processing strategies according to historical reconciliation experience and different business scenarios, making it difficult to cope with complex and changing business environments, and the processing suggestions are often too simple to meet the actual business needs SUMMARY
[0007] The embodiments of the present application provide a machine learning-based financial account allocation and anomaly detection method and system, which can solve the problems in the prior art.
[0008] In a first aspect, the embodiments of the present application provide a machine learning-based financial account allocation and anomaly detection method, comprising:
[0009] obtaining a set of financial data to be reconciled and a set of bank transaction data, and based on the set of financial data and the set of bank transaction data, constructing a causal graph model;
[0010] According to the time sequence characteristics of the causal graph model, a time sequence attention weight matrix is generated by using a conditional random field, the time sequence attention weight matrix is weighted and fused with an edge set in the causal graph model, a fused causal graph model is obtained, causal reasoning between nodes is performed based on the fused causal graph model, a causal link of the reconciliation difference is generated, and a credibility of each causal link is calculated, the difference reason is attributed according to the credibility, and a difference reason attribution result is obtained;
[0011] Based on the difference reason attribution result, a reconciliation difference feature vector is generated, a reinforcement learning method is used to process the reconciliation difference feature vector, the reconciliation difference feature vector is mapped into a state vector, a processing strategy is generated based on the state vector, an effect of the processing strategy is evaluated by using a set reward function, the processing strategy is optimized according to the evaluation result, a difference processing suggestion and a risk assessment result are generated, and a difference processing scheme is generated according to the difference processing suggestion and the risk assessment result.
[0012] According to the time sequence characteristics of the causal graph model, a time sequence attention weight matrix is generated by using a conditional random field, the time sequence attention weight matrix is weighted and fused with an edge set in the causal graph model, a fused causal graph model is obtained, causal reasoning between nodes is performed based on the fused causal graph model, a causal link of the reconciliation difference is generated, and a credibility of each causal link is calculated, the difference reason is attributed according to the credibility, and a difference reason attribution result is obtained;
[0013] A conditional random field is constructed based on the time sequence characteristics of the causal graph model, the causal graph model includes a plurality of time sequence segments, a corresponding feature extraction unit is set for each time sequence segment, and a corresponding time sequence local feature is generated;
[0014] The time sequence local features are cooperatively calculated, the time sequence local features are integrated by using adaptive weights, and a time sequence global feature is generated;
[0015] The time sequence global feature is dynamically evaluated, the time sequence dependence relationship of the time sequence global feature is optimized based on the evaluation result, and an optimized time sequence global feature is generated;
[0016] A time sequence attention weight matrix is constructed based on the optimized time sequence global feature, and the time sequence attention weight matrix is used for time sequence weight distribution of an edge set in the causal graph model;
[0017] The time sequence attention weight matrix is weighted and fused with the edge set of the causal graph model, each edge in the edge set is weighted and distributed according to the time sequence attention weight matrix, and a fused causal graph model is obtained.
[0018] performing causal reasoning between nodes based on the fused causal graph model, generating a causal link of the account difference, calculating a credibility of each causal link, attributing a difference cause according to the credibility, and obtaining a difference cause attribution result including:
[0019] generating a heterogeneous feature representation of the node based on the fused causal graph model, dynamically calculating the correlation strength between the nodes based on the heterogeneous feature representation, scoring the importance of the edges in the fused causal graph model according to the correlation strength, and filtering the causal propagation path higher than the pre-set confidence threshold based on the importance score;
[0020] generating a temporal rationality score based on the temporal relationship of adjacent nodes according to the causal propagation path; non-linearly combining the temporal rationality score and the importance score to obtain a comprehensive credibility of the causal link, sorting and filtering the causal propagation path based on the comprehensive credibility, and obtaining an optimal causal link set;
[0021] constructing a counterfactual reasoning module based on the optimal causal link set, intervening each causal link in the optimal causal link set through the counterfactual reasoning module, evaluating the contribution degree of each causal link to the difference, and generating a difference cause attribution result.
[0022] constructing a counterfactual reasoning module based on the optimal causal link set, intervening each causal link in the optimal causal link set through the counterfactual reasoning module, evaluating the contribution degree of each causal link to the difference, and generating a difference cause attribution result including:
[0023] The counterfactual reasoning module dynamically adjusts the update amplitude of the node state by using an update gate and a reset gate, performs multi-dimensional intervention on each causal link in the optimal causal link set based on the counterfactual reasoning module, sets a checkpoint array on the causal link, the checkpoint array calculates a state offset vector based on the state change trend of the node, and dynamically modulates the propagation feature of the node by using the state offset vector;
[0024] decomposing the dynamically modulated propagation feature in different frequency domains, respectively evaluating the contribution degree of each frequency component to the difference; fusing the contribution degrees of each frequency component through a hierarchical attention network, the hierarchical attention network allocates attention weights according to the importance of different frequency components, generates a final contribution degree score of the causal link, and generates a difference cause attribution result based on the contribution degree score.
[0025] The difference reason attribution result is used to generate an account difference feature vector, a reinforcement learning method is used to process the account difference feature vector, the account difference feature vector is mapped to a state vector, and a processing strategy is generated based on the state vector, including:
[0026] The amount matching degree, the time sequence correlation and the subject association degree are taken as feature dimensions based on the difference reason attribution result, and a feature vector reflecting the attributes of the account difference is generated;
[0027] The feature vector is processed by double-layer mapping, the first layer mapping extracts the static account attributes in the feature vector to generate a static state representation, the second layer mapping generates a dynamic state representation based on the analysis of the change process of the difference feature based on the static state representation, and the static state representation and the dynamic state representation are fused to generate an enhanced state vector;
[0028] The difference processing direction is determined according to the static account attributes in the enhanced state vector, and a specific processing action is generated according to the dynamic attributes in the enhanced state vector and the difference processing direction;
[0029] The strategy evaluation index is dynamically adjusted according to the execution effect of the processing action, the processing action is iteratively optimized based on the strategy evaluation index, and a final account processing strategy is generated.
[0030] The effect of the processing strategy is evaluated by a set reward function, the processing strategy is optimized according to the evaluation result, a difference processing suggestion and a risk assessment result are generated; and a difference processing scheme is generated according to the difference processing suggestion and the risk assessment result, including:
[0031] An instant score is calculated based on the execution efficiency and resource consumption of the processing strategy, a credit allocation value is calculated based on the cumulative effect of the historical processing strategy, and the instant score and the credit allocation value are combined to obtain a strategy evaluation score;
[0032] Multi-scene risk analysis is performed based on the strategy evaluation score, the risk propagation path of the processing strategy is sampled by Monte Carlo tree search, the sampling path is classified according to the risk influence degree and the propagation speed, and the risk propagation probability is calculated based on the classification result;
[0033] The processing strategy is optimized according to the risk propagation probability, an exploration factor is introduced in the optimization process to adjust the strategy execution order and execution parameters, the adaptability of the strategy is improved through multiple rounds of iterative optimization, and multiple groups of difference processing suggestions are generated;
[0034] A feasibility assessment is performed on multiple sets of the difference processing suggestions, a risk level of each set of the difference processing suggestions is quantified based on the risk propagation probability, and a processing suggestion with the lowest risk level and the highest executability is selected as a final difference processing scheme.
[0035] Based on the policy evaluation score, a multi-scenario risk analysis is performed, the risk propagation path of the processing strategy is sampled through Monte Carlo tree search, the sampled path is classified according to the risk influence degree and the propagation speed, and the risk propagation probability is calculated based on the classification result, including:
[0036] Based on the policy evaluation score, a scenario weight is calculated, the scenario weight is divided into multiple level intervals according to the risk degree, a temperature decay curve is set in each level interval, the scenario distribution is adaptively adjusted according to the temperature decay curve, and a scenario distribution vector containing risk propagation characteristics is generated;
[0037] Based on the scenario distribution vector, a Monte Carlo search tree is constructed, a time series access feature is calculated by exponentially smoothing average calculation of the access frequency of nodes based on the Monte Carlo search tree, the time series access feature is hierarchically mapped with the scenario distribution vector to obtain a node dynamic weight, the Monte Carlo search tree is expanded according to the node dynamic weight, and a search space containing multiple layers of risk propagation paths is generated;
[0038] Adaptive path sampling is performed in the search space, a basic sampling probability is set according to the scenario weight, the basic sampling probability is adjusted by a negative exponential function of path length, the node dynamic weight is used as a direction guide factor to realize double constraint of sampling depth and sampling direction, and multiple representative risk propagation paths are obtained;
[0039] Risk propagation analysis is performed on each of the risk propagation paths, a forgetting factor is introduced in the risk propagation path to attenuate the historical risk state, a time series risk value of the path is calculated by layer-by-layer recursion, and a risk propagation probability reflecting the risk propagation law is generated according to the time series risk value.
[0040] In a second aspect of the embodiment of the present application, a financial account allocation and anomaly detection system based on machine learning is provided, including:
[0041] A first unit is configured to acquire a set of financial data to be reconciled and a set of bank flow data, and construct a causal diagram model based on the set of financial data and the set of bank flow data.
[0042] a second unit configured to generate a time sequence attention weight matrix using a conditional random field according to a time sequence characteristic of the causal graph model, weight and fuse the time sequence attention weight matrix with a set of edges in the causal graph model to obtain a fused causal graph model, perform causal reasoning between nodes based on the fused causal graph model to generate a causal link of the reconciliation difference, calculate a credibility of each causal link, attribute a difference reason according to the credibility, and obtain a difference reason attribution result;
[0043] a third unit configured to generate a reconciliation difference feature vector based on the difference reason attribution result, process the reconciliation difference feature vector using a reinforcement learning method, map the reconciliation difference feature vector to a state vector, generate a processing strategy based on the state vector, evaluate an effect of the processing strategy through a set reward function, optimize the processing strategy according to an evaluation result, generate a difference processing suggestion and a risk assessment result, and generate a difference processing scheme according to the difference processing suggestion and the risk assessment result.
[0044] In a third aspect, an electronic device is provided, including:
[0045] a processor;
[0046] a memory for storing processor-executable instructions;
[0047] The processor is configured to invoke the instructions stored in the memory to execute the method described above.
[0048] In a fourth aspect, a computer-readable storage medium is provided, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the method described above.
[0049] The present application has the following advantages:
[0050] By constructing a causal graph model and combining a time sequence attention weight matrix for weighted fusion, the causal relationship between financial data and bank flow data can be accurately captured, so that the root cause of the reconciliation difference can be accurately identified, and the accuracy and interpretability of the difference reason attribution in the reconciliation process are improved.
[0051] The reinforcement learning method is used to process the reconciliation difference feature vector, so that the system can adaptively learn the optimal difference processing strategy, the processing scheme is continuously optimized through the reward function, the difference processing scheme is more scientific and reasonable, and the efficiency and accuracy of the financial reconciliation work are greatly improved.
[0052] The method deeply integrates machine learning technology and financial reconciliation business, realizes the automation and intelligentization of the reconciliation process, reduces manual intervention and human error rate, and can also identify potential risks in advance, providing reliable technical support and decision basis for enterprise financial management. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 A flowchart of a financial account allocation and anomaly detection method based on machine learning according to an embodiment of the present application is shown in
[0054] Figure 2 A complete flowchart of node causal reasoning based on a fused causal graph model according to an embodiment of the present application is shown in
[0055] Figure 3 A complete flowchart of multi-scenario risk analysis based on a policy evaluation score according to an embodiment of the present application is shown in DETAILED DESCRIPTION
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in connection with the drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0057] The technical solutions of the present application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in some embodiments.
[0058] Figure 1 A flowchart of a financial account allocation and anomaly detection method based on machine learning according to an embodiment of the present application is shown in Figure 1 The method comprises:
[0059] obtaining a set of financial data to be reconciled and a set of bank flow data, constructing a causal graph model based on the set of financial data and the set of bank flow data;
[0060] According to the time sequence characteristics of the causal graph model, a time sequence attention weight matrix is generated using a conditional random field, the time sequence attention weight matrix is weighted and fused with an edge set in the causal graph model to obtain a fused causal graph model, causal reasoning between nodes is performed based on the fused causal graph model, a causal link of a reconciliation difference is generated, the credibility of each causal link is calculated, the difference reason is attributed according to the credibility, and a difference reason attribution result is obtained;
[0061] The difference processing scheme is generated according to the difference processing suggestion and the risk assessment result.
[0062] In an optional implementation, according to the time sequence characteristics of the causal graph model, a conditional random field is used to generate a time sequence attention weight matrix, the time sequence attention weight matrix is fused with an edge set in the causal graph model by weighting, and a fused causal graph model is obtained.
[0063] A conditional random field is constructed based on the time sequence characteristics of the causal graph model, the causal graph model includes a plurality of time sequence segments, a corresponding feature extraction unit is set for each time sequence segment, and a corresponding time sequence local feature is generated.
[0064] The time sequence local features are cooperatively calculated, the time sequence local features are integrated by adaptive weights, and a time sequence global feature is generated.
[0065] The time sequence global feature is dynamically evaluated, the time sequence dependence relationship of the time sequence global feature is optimized based on the evaluation result, and an optimized time sequence global feature is generated.
[0066] A time sequence attention weight matrix is constructed based on the optimized time sequence global feature, and the time sequence attention weight matrix is used for time sequence weight distribution of an edge set in the causal graph model.
[0067] The time sequence attention weight matrix is fused with the edge set of the causal graph model by weighting, each edge in the edge set is weighted according to the time sequence attention weight matrix, and a fused causal graph model is obtained.
[0068] The conditional random field constructed based on the time sequence characteristics of the causal graph model is a basic link for realizing time sequence weight calculation. The causal graph model represents the association relationship between financial data and bank flow data, wherein a node represents a data entity, and an edge represents a causal relationship between entities. In the financial reconciliation scenario, these entities include transaction records, fund flow, account information, etc.
[0069] When constructing the conditional random field, the system first performs time sequence segmentation on the causal graph model, and divides the complete causal graph into multiple time sequence segments according to the time dimension. The time sequence segment division can adopt a fixed time window or an adaptive mode based on business events. The fixed time window is divided in units of days or weeks, for example, the financial data of a month is divided into 4 week-level segments; while the adaptive mode dynamically adjusts the window size according to the business event density, using a smaller time window, such as one day, in the transaction-intensive period, and a larger window, such as one week, in the transaction-sparse period. In a certain enterprise financial system, the system divides the data of a quarter into 12 time sequence segments, the first 8 of which are week-level segments, and the last 4 are double-week-level segments, to adapt to the transaction density changes in different periods.
[0070] A corresponding feature extraction unit is set for each time sequence segment to generate time sequence local features. The feature extraction unit adopts a graph convolution network structure, including two layers of graph convolution layers and one layer of fully connected layers. The first layer of graph convolution uses 32 convolution kernels, and the second layer uses 64 convolution kernels. The output dimension of the fully connected layer is 128. The input is the node feature matrix and the adjacency matrix in the time sequence segment. The node features include transaction amount, transaction time, transaction counterparty and other attributes. The graph convolution operation aggregates the information of each node and its neighbors to capture local structural features. For example, for a node representing a payment by a certain supplier, its features include transaction amount of 50,000 yuan, transaction date of the 3rd day of the month, frequency of 1 time per month, etc. After graph convolution processing, the features of this node are enhanced to a 128-dimensional vector containing its own and related transaction information. To enhance the expression ability of the model, the feature extraction unit also introduces residual connection and batch normalization techniques to improve the training stability and convergence speed.
[0071] The time sequence local features are collaboratively calculated to generate time sequence global features through adaptive weight integration. The collaborative calculation considers the relevance and importance difference between different time sequence segments, and uses an attention mechanism to realize adaptive weight allocation. The system constructs an attention network, the input of which is the local features of all time sequence segments, and the output is the corresponding attention weight. The attention network includes a single-layer feedforward network with 64 hidden units, and uses a softmax function to normalize the output weight.
[0072] For time sequence segments with high information content and strong relevance, higher weights are assigned; for segments with more noise or weak relevance, lower weights are assigned. For example, in a certain financial reconciliation task, the system calculates the attention weights of the 12 time sequence segments as [0.05, 0.07, 0.12, 0.15, 0.18, 0.13, 0.09, 0.06, 0.04, 0.03, 0.04, 0.04], indicating that the middle period segments (4th-6th segments) contain more important information and obtain higher weights.
[0073] The time sequence global feature is generated by weighted summation, that is, the local feature of each time sequence segment is multiplied by the corresponding attention weight, and then summed to obtain the final global feature. In order to preserve the time sequence order information, the system also introduces a position encoding technology to embed the position information into the feature representation. The position encoding is generated using sine and cosine functions, and the dimension is the same as the feature vector, which is fused into the original feature by addition. The time sequence global feature processed in this way contains both the content information of each segment and the time sequence position information, providing a complete foundation for subsequent time sequence dependence modeling. The dimension of the time sequence global feature is the same as the local feature, which is 128 dimensions. For example, the global feature representation of a certain financial reconciliation task is [0.73, 0.68, 0.82,..., 0.56], which encodes the key features of the entire time sequence process.
[0074] The time sequence global feature is dynamically evaluated, and the time sequence dependence relationship is optimized based on the evaluation results. The dynamic evaluation uses a bidirectional long short-term memory network (BiLSTM) to capture long-term dependencies and bidirectional associations in the feature sequence. The BiLSTM network contains a single-layer structure with a hidden state dimension of 64 and an input of a time sequence global feature sequence. The network processes the feature sequence from both forward and reverse directions, and outputs an enhanced feature representation after fusing the bidirectional information. This bidirectional processing can consider the influence of historical information and future information on the current state at the same time, and more comprehensively model the time sequence dependence relationship.
[0075] To further improve performance, the system introduces a gating mechanism to control information flow using an update gate and a reset gate. The update gate determines how much previous state information to retain, and the reset gate determines how much previous state information to ignore. The value range of these two gates is 0 to 1, which is obtained through the sigmoid function mapping. For example, for a feature at a certain time point, if its update gate value is 0.8 and its reset gate value is 0.3, it means that 80% of the previous state information is retained, while 70% of the historical information is reset to better adapt to the current input.
[0076] The optimization process also considers time sequence anomaly detection to identify and adjust the influence of abnormal time sequence points. The system calculates an anomaly score for each time sequence point based on its deviation from neighboring time sequence points. The anomaly score is calculated using the reconstruction error, that is, using an autoencoder to reconstruct the time sequence feature, and calculating the Euclidean distance between the original feature and the reconstructed feature. The greater the distance, the stronger the abnormality. For abnormal time sequence points, the system reduces their weight in dependence modeling through a soft threshold method, rather than completely excluding them to retain useful information. For example, if the transaction pattern of a certain week is detected to have an abnormality score of 0.85 (higher than the threshold of 0.7), the system adjusts its influence weight in dependence modeling to 30% of the original. After this series of processing, the system generates an optimized time sequence global feature that more accurately represents the essential features and dependence relationships of time sequence data.
[0077] The time sequence attention weight matrix is constructed based on the optimized time sequence global features. The time sequence attention weight matrix represents the importance of each edge in the causal graph under different time sequence conditions, and its dimension is edge number x time sequence length. The construction process first calculates the attention score of each edge at each time sequence point, and then organizes these scores into a matrix form. The attention score calculation considers three factors: static importance of the edge, time sequence correlation, and context consistency.
[0078] The static importance is calculated based on the node features connected by the edge; the time sequence correlation assesses the matching degree of the edge with the current time sequence point; and the context consistency checks the coordination degree of the edge in the overall causal structure. The three factors are combined through weighted averaging to obtain the final attention score, and the weights are determined through cross-validation. The typical configuration is static importance 0.4, time sequence correlation 0.4, and context consistency 0.2. In practical applications, for a causal graph containing 200 edges and 12 time sequence points, the constructed time sequence attention weight matrix has a dimension of 200x12, and each element in the matrix represents the importance score of a specific edge at a specific time sequence point, with a value range of 0 to 1.
[0079] To improve computational efficiency, the system uses sparse representation and batch processing technology. Sparse representation only stores non-zero attention weights, which can significantly reduce storage requirements for large-scale causal graphs. Batch processing technology groups multiple edges for processing, taking advantage of GPU parallel computing capabilities to improve processing speed. For example, when processing financial data of a certain enterprise, the original weight matrix needs to store 200x12=2400 floating-point numbers. After using sparse representation, since only 20% of the edges have significant weights at each time sequence point on average, only about 480 valid values need to be stored, greatly reducing storage and computing overhead.
[0080] The time sequence attention weight matrix is fused with the edge set of the causal graph model by weighted fusion. The fusion process assigns each edge in the causal graph a corresponding time sequence weight, enhancing the model's sensitivity to time sequence changes. The specific implementation is to extract the weight vector w(i,j) of each edge e(i,j) in the time sequence attention weight matrix, and then fuse the weight vector with the original attribute vector of the edge. The fusion method uses weighted summation or a gating mechanism. Weighted summation directly multiplies the weight vector by a predetermined coefficient and adds it to the attribute vector; the gating mechanism uses the weight vector to control the retention proportion of the original attributes. For example, if the original attribute vector of an edge is [0.8, 0.6, 0.7] and the corresponding time sequence attention weight is 0.85, using weighted summation fusion (coefficient 0.5), the fused attribute vector is [0.8, 0.6, 0.7] + 0.5x0.85 = [1.225, 1.025, 1.125]. The same fusion operation is performed on all edges to obtain the fused causal graph model.
[0081] The fused causal graph model retains the topology of the original graph, but the properties of the edges are enhanced with temporal attention. This enhancement allows the model to dynamically adjust the importance of causal relationships based on temporal context, improving the ability to model temporal patterns. When performing inference tasks on the fused model, the system prioritizes information transmitted through high-weight edges and reduces the influence of low-weight edges, resulting in more accurate causal inferences. For example, when analyzing an abnormal transaction, the fused model identifies a high-weight connection (weight 0.92) between the transaction and recent supplier information changes, while the connection weight with historical payment patterns is low (weight 0.35), thus attributing the abnormality to supplier information changes rather than payment pattern changes.
[0082] To verify the effectiveness of the fused model, the system conducted comparative experiments on real financial data. Using three months of financial data and bank transaction records from a certain enterprise, containing about 12,000 transactions, the system constructed a causal graph model containing 850 nodes and 2,300 edges. After generating the temporal attention weight matrix using the above method and fusion, in the account reconciliation discrepancy identification task, the accuracy of the fused model reached 92.5%, an increase of 15 percentage points compared to the non-fused base model; in the discrepancy cause attribution task, the accuracy reached 87.3%, an increase of 21 percentage points. This shows that the introduction of temporal attention weights significantly enhances the model's ability to capture temporal dependencies, improving the accuracy and interpretability of financial reconciliation.
[0083] Through the above technical implementation, the system successfully fused the temporal attention weight matrix generated by the conditional random field with the causal graph model, enhancing the model's ability to express temporal characteristics and providing a reliable foundation for subsequent causal reasoning and discrepancy attribution. This temporal-enhanced causal modeling method is not only applicable to financial reconciliation scenarios, but can also be extended to other business fields that require consideration of temporal causal relationships.
[0084] In an optional implementation, based on the fused causal graph model, causal reasoning is performed between nodes to generate causal links of the account reconciliation discrepancy, and the credibility of each causal link is calculated. According to the credibility, the discrepancy cause is attributed, and the discrepancy cause attribution result is obtained, including:
[0085] Based on the fused causal graph model, transaction amounts, transaction frequencies, and subject attributes are fused to generate heterogeneous feature representations of nodes. Based on the heterogeneous feature representations, the association strength between nodes is dynamically calculated, and the importance of the edges in the fused causal graph model is scored according to the association strength. Based on the importance scoring, causal propagation paths higher than a pre-set confidence threshold are selected;
[0086] generate a time sequence rationality score according to a time sequence relationship of the adjacent nodes based on the causal propagation path; perform nonlinear combination of the time sequence rationality score and the importance score to obtain a comprehensive credibility of the causal link, sort and screen the causal propagation path based on the comprehensive credibility, and obtain an optimal causal link set;
[0087] construct an counterfactual reasoning module based on the optimal causal link set, intervene each causal link in the optimal causal link set through the counterfactual reasoning module, evaluate a contribution degree of each causal link to the difference, and generate a difference cause attribution result.
[0088] As shown in Figure 2 the method comprises:
[0089] Based on the fused causal graph model, inter-node causal reasoning is performed. This process fuses three types of core information, including transaction amount, transaction frequency, and subject attribute, to construct multi-dimensional node features. The transaction amount information includes three sub-dimensions: transaction amount value, amount change rate, and amount abnormality. For the transaction amount value, the system uses logarithmic normalization processing to map different magnitudes of amounts to a comparable range. For example, for a transaction with an amount of 58,760 yuan, it is converted to 4.77 after logarithmic processing; for a transaction with an amount of 5,876,000 yuan, it is converted to 6.77. The amount change rate is calculated by comparing the difference between the current transaction and the historical average transaction amount, and is expressed as a relative change percentage. For example, if the historical average transaction amount of a supplier is 52,000 yuan, and the current transaction is 58,760 yuan, the change rate is 13%. The amount abnormality is calculated based on the statistical distribution characteristics, and is represented by the deviation of the transaction amount in the historical distribution. The system calculates the Z-score of the transaction amount, and the abnormality of the transaction with a deviation of more than 3 standard deviations from the mean is 0.99, the abnormality of the transaction with a deviation of 2-3 standard deviations is 0.8-0.9, the abnormality of the transaction with a deviation of 1-2 standard deviations is 0.5-0.8, and the abnormality of the transaction with a deviation of less than 1 standard deviation is 0-0.5.
[0090] Transaction frequency information captures the temporal pattern characteristics of transactions, including three sub-dimensions: transaction interval length, transaction regularity, and frequency abnormality. The transaction interval length records the time difference between adjacent transactions, with the unit of days. Regularity is calculated by analyzing the periodic characteristics of the transaction time series, with a value range of 0 to 1, and 1 representing complete regularity. The system uses autocorrelation analysis to detect periodic patterns in the time series. For a supplier who makes payments on a fixed date every month, the regularity score reaches 0.95; for a temporary customer who transacts at random times, the regularity is only 0.2. Frequency abnormality reflects the deviation of the current transaction frequency from the historical pattern, which is calculated by comparing the current transaction interval with the average transaction interval. For example, if a customer has an average transaction every 30 days, and the current transaction is only 15 days away from the last one, the frequency abnormality is 0.75; if it is 45 days away, the abnormality is 0.5.
[0091] Account attribute information describes the accounting and business attributes of transactions, including three sub-dimensions: account type, account level, and cross-account correlation. Account type is represented using one-hot encoding, such as asset class account encoded as [1, 0, 0, 0, 0], liability class as [0, 1, 0, 0, 0], and so on. Account level reflects the hierarchical depth of the account in the accounting system, with a value of 1 for first-level accounts, 2 for second-level accounts, and so on. Cross-account correlation measures the degree of correlation between the accounts involved in the transaction, calculated by the frequency of co-occurrence of accounts in historical transaction data. For example, the correlation between "accounts receivable" and "sales revenue" is 0.9, while the correlation with "management expenses" is only 0.1.
[0092] The system combines the above three types of information to form the heterogeneous feature representation of the node, using feature splicing and nonlinear transformation. Taking a transaction node as an example, its heterogeneous feature representation is [4.77, 0.13, 0.6, 15, 0.8, 0.3, 1, 0, 0, 0, 0, 2, 0.9], containing information of all sub-dimensions. To enhance the feature expression ability, the system uses a multi-layer perceptron to perform nonlinear transformation on the spliced features, outputting a 64-dimensional latent feature vector. The conversion network contains two hidden layers with node numbers of 128 and 96, respectively, using ReLU activation function, and the network parameters are obtained by pre-training on historical data.
[0093] Based on the heterogeneous feature representation, the system dynamically calculates the correlation strength between nodes. The correlation strength calculation uses an attention mechanism, considering the similarity and complementarity of node features. In the calculation process, the system first calculates the dot product similarity of the feature vectors of each pair of nodes, and then normalizes it through the softmax function to obtain the original correlation score. To capture the nonlinear relationship between nodes, the system further introduces a bilinear transformation, using a parameter matrix to map the features of one node to the feature space of another node, and calculates the similarity after transformation. The original correlation score and the similarity after transformation are weighted and averaged to obtain the final correlation strength. For two nodes in the financial system, such as "bank entry record" and "accounts receivable record", their heterogeneous feature vectors are v1 and v2 respectively, the original correlation score calculated is 0.73, the similarity after transformation is 0.81, and the weight is set to 0.4 and 0.6. Then the final correlation strength is 0.73x0.4+0.81x0.6=0.778.
[0094] According to the correlation strength, the edges in the fused causal graph model are scored for importance. The importance scoring not only considers the correlation strength between nodes, but also combines the temporal attribute and causal direction consistency of the edges. The temporal attribute reflects the temporal relationship between the two nodes connected by the edge, which is evaluated by calculating the timestamp difference. The causal direction consistency checks whether the direction of the edge is consistent with the business logic and data flow. The system combines these three factors and uses weighted summation to calculate the importance score of the edge. The weights are adjusted according to the specific business scenario, and the typical configuration is that the correlation strength weight is 0.5, the temporal attribute weight is 0.3, and the causal consistency weight is 0.2. Taking a causal edge as an example, the correlation strength is 0.778, the temporal attribute score is 0.9 (indicating complete compliance with the temporal relationship), and the causal consistency is 0.85. The calculated importance score is 0.778x0.5+0.9x0.3+0.85x0.2=0.389+0.27+0.17=0.829.
[0095] The system filters the causal propagation paths with a higher pre-set confidence threshold based on the importance scoring. The confidence threshold is set according to business needs, usually between 0.65 and 0.8. In the filtering process, the system first identifies all the reverse paths starting from the difference node, and then calculates the geometric mean of the importance scores of all edges in each path as the path score. The geometric mean uses the multiplication of the edge importance scores, and then calculates the nth power (n is the number of edges), avoiding the excessive influence of a single high-score edge on the overall path score. The system retains the paths with scores higher than the threshold as candidate causal propagation paths. For example, in a certain financial reconciliation scenario, the system sets the confidence threshold to 0.7, and filters out 23 candidate causal propagation paths from the initial 87 paths, greatly reducing the complexity of subsequent analysis.
[0096] For the filtered causal propagation paths, the system further generates a temporal rationality score based on the temporal relationship of adjacent nodes. Temporal rationality evaluation checks whether the time sequence of nodes on the path is logical. The system first extracts the timestamps of each node on the path and calculates the time difference of adjacent nodes. A positive causal relationship requires the cause node to be earlier than the effect node, and the closer the time difference is to the business expectation, the higher the score. The system uses an exponential decay function to map the time difference into a rationality score, with a standard time difference getting a full score of 1, and too large or too small time difference resulting in a lower score. For each path, the system calculates the weighted average of the temporal rationality scores of all adjacent node pairs as the temporal rationality score of the entire path. In a certain case, a path containing 4 nodes has a temporal rationality score of 0.863 for the weighted average of 3 adjacent node pairs, which are 0.95, 0.88 and 0.76 respectively.
[0097] The system non-linearly combines the temporal rationality score with the importance score to obtain the comprehensive credibility of the causal link. The non-linear combination adopts the form of weighted product, considering the relative importance of the two scores and emphasizing that both need to reach a high level to obtain high credibility. The combination function uses the product of the importance score and the temporal rationality score, and then performs a non-linear transformation through an exponential function, and finally normalizes it to the 0-1 interval. The combination weight is determined through cross-validation, and for the financial reconciliation system, the typical configuration is an importance score weight of 0.6 and a temporal rationality score weight of 0.4. For a path with an importance score of 0.829 and a temporal rationality score of 0.863, its comprehensive credibility is calculated as 0.829 0.6 × 0.863 0.4 = 0.843.
[0098] Based on the comprehensive credibility, the system sorts and filters the causal propagation paths to obtain the optimal causal link set. The sorting adopts descending order of comprehensive credibility, and the filtering sets a credibility threshold and a diversity requirement. The credibility threshold is usually set to 0.8 to ensure that the selected causal link has a high enough reliability. The diversity requirement prevents the selection of too many similar links, and the system calculates the similarity between links (based on the proportion of shared nodes), and when the similarity between two links exceeds 75%, only the one with higher credibility is retained. Through sorting and filtering, the system finally selects 8 optimal causal links from the 23 candidate paths to form the optimal causal link set. These links cover different types of potential causes and have a high enough credibility.
[0099] Based on the optimal set of causal links, the system constructs a counterfactual reasoning module to evaluate the intervention of each causal link. The counterfactual reasoning module quantifies the contribution of the link to the difference by simulating the scenario of "what if this link did not exist, how would the difference change". Specifically, the system applies intervention to the key nodes on the link, modifies their state or cuts off their connection with other nodes, and then recalculates the difference value. The intervention methods include node state replacement, link cutting, and noise injection. State replacement replaces the node value with a reference value; link cutting removes specific edges on the link; noise injection adds random disturbances to the node state. The system applies these three interventions to each link respectively, records the change in difference value before and after intervention, and the larger the change, the higher the contribution of the link.
[0100] For example, for a causal link representing "supplier coding error -- transaction matching failure -- incorrect fund allocation -- final difference", the system performs state replacement on the "supplier coding error" node, replacing the error code "S10086" with the correct code "S10085", and then propagates along the link to calculate the final difference change. If the original difference is 5,000 yuan, the difference after intervention is reduced to 500 yuan, a decrease of 90%, then the contribution score of this link is 0.9. Similarly, the system performs the same process on other links to obtain the contribution score of each link.
[0101] Based on the contribution score, the system generates the difference attribution result, which includes primary causes, secondary causes, and reasons, corresponding to high, medium, and low contribution links respectively. The system usually classifies links with a contribution score greater than 0.7 as primary causes, 0.4-0.7 as secondary causes, and 0.2-0.4 as reasons. The attribution result is presented in the form of visualization and text description, detailing the formation path, contribution, and processing suggestions of each cause. In a certain enterprise financial reconciliation system, through the analysis of 100 difference cases by this method, the accurate attribution rate reaches 94.5%, which is 23 percentage points higher than the traditional method, greatly improving the reconciliation efficiency and accuracy.
[0102] To further enhance the explainability of the attribution result, the system also provides attribution evidence chain and confidence interval. The evidence chain shows the key data points and logical reasoning process that support the attribution result, for example, for the attribution of "supplier coding error", the system lists the occurrence time, error pattern, and impact range of the coding error as evidence. The confidence interval quantifies the uncertainty of the attribution result, and by multiple sampling, it calculates the 95% confidence interval, providing users with a reference for the reliability of the result. For example, the contribution score of a certain link is 0.9, and the 95% confidence interval is [0.86, 0.94], indicating that the evaluation result has high stability.
[0103] Through the above technical means, the inter-node causal reasoning process based on the fused causal graph model realizes accurate attribution of the financial reconciliation difference, providing a reliable basis for subsequent difference processing. The method combines the structured expression capability of the graph model and the causal analysis advantage of the counterfactual reasoning, and can not only identify surface differences, but also deeply mine root causes, significantly improving the intelligent level and business value of the financial reconciliation system.
[0104] In an optional implementation, a counterfactual reasoning module is constructed based on the optimal causal link set, each causal link in the optimal causal link set is intervened through the counterfactual reasoning module, the contribution degree of each causal link to the difference is evaluated, and a difference cause attribution result is generated.
[0105] The counterfactual reasoning module dynamically adjusts the update amplitude of the node state by using an update gate and a reset gate, multi-dimensionally intervenes each causal link in the optimal causal link set based on the counterfactual reasoning module, sets a checkpoint array on the causal link, the checkpoint array calculates a state offset vector based on the state change trend of the node, and dynamically modulates the propagation feature of the node by using the state offset vector;
[0106] The propagation feature after the dynamic modulation is decomposed in different frequency domains, the contribution degree of each frequency component to the difference is respectively evaluated, the contribution degrees of the frequency components are fused through a hierarchical attention network, the hierarchical attention network allocates attention weights according to the importance of different frequency components, generates a final contribution degree score of the causal link, and generates a difference cause attribution result based on the contribution degree score.
[0107] The construction of the counterfactual reasoning module is a key link in the reconciliation difference cause attribution process. The module is based on the optimal causal link set, evaluates the contribution degree of each link to the difference formation by intervening and analyzing the causal link. The counterfactual reasoning module adopts a gating structure, including two core components of an update gate and a reset gate. The update gate controls the update amplitude of the node state, and the value range of the update gate is 0 to 1. The closer the value is to 1, the greater the update amplitude. For a node in the financial reconciliation system, the state of the node includes multi-dimensional features such as transaction amount, transaction time, and transaction counterparty. The update gate sets different update coefficients for different dimensions. For example, for a node representing an error in the bank flow amount, the update gate value of the amount dimension is 0.9, and the update gate value of the time dimension is 0.3, indicating that the influence of the amount change will be considered in the intervention analysis.
[0108] The reset gate controls the degree of resetting the historical state information of the node, with a value range of 0 to 1. The closer the value is to 0, the higher the degree of resetting the historical information. In the counterfactual analysis, the reset gate helps the module simulate the hypothetical scenario of "if the node state is completely changed". The setting of the reset gate is based on the criticality and uncertainty of the node. The reset gate value of a critical node is usually low to fully evaluate its impact. For example, for a node representing "supplier information entry error", if the certainty is as high as 95%, the reset gate value is set to 0.1, meaning that the historical state of the node will be significantly reset in the counterfactual analysis to evaluate the impact of this error on the overall difference.
[0109] In actual implementation, the calculation of the update gate and the reset gate uses the node feature vector as input, and generates the gate value through a two-layer neural network. The first layer uses 64 hidden units, and the second layer outputs values with the same dimension as the node state, which are then mapped to the 0-1 interval through the sigmoid function. The network parameters are obtained by pre-training on historical reconciliation data. For example, for a certain financial difference case, the system extracts 500 similar cases from historical data to train the gate network. The trained network can automatically generate reasonable update gate and reset gate values based on node features.
[0110] The multi-dimensional intervention of the counterfactual reasoning module on each causal link in the optimal causal link set is the core step of evaluating the contribution of the link. Multi-dimensional intervention refers to simultaneously applying changes in multiple dimensions of the causal link and observing the impact of these changes on the final difference. The system sets a checkpoint array on each causal link, and these checkpoints are located at key nodes on the link. For example, for a causal link containing 5 nodes, the system sets checkpoints at nodes 1, 3, and 5, and the distance between checkpoints is adjusted adaptively according to the importance of the nodes. In areas with high importance, the density of checkpoints is higher, for example, the number of nodes between adjacent checkpoints is only 1-2; while in areas with low importance, the distance between checkpoints is expanded to 3-5 nodes.
[0111] The checkpoint array calculates the state offset vector based on the state change trend of the node. The state offset vector reflects the degree and direction of change in the node state before and after intervention. The calculation process first records the initial state, then applies intervention at the checkpoint and records the state after intervention, and the difference between the two is the state offset vector. The intervention methods include value replacement, noise addition, and state reset. Value replacement replaces a certain dimension of the node value with a preset value; noise addition adds random disturbance to the original value; state reset completely replaces the node state with a reference state. For example, for the "supplier information entry error" node, the system uses value replacement to change the supplier code from the error value "S10086" to the correct value "S10085" and observes the impact of this change on subsequent nodes.
[0112] The state offset vector is used to dynamically modulate the propagation characteristics of the nodes, which refer to how the state of a node affects the characteristics of downstream nodes, including propagation strength, propagation direction, and propagation speed. The dynamic modulation process adjusts the parameters of the propagation characteristics according to the size and direction of the state offset vector. The specific implementation method is to multiply the state offset vector and the propagation parameter matrix to obtain the modulated propagation characteristics. In a certain financial reconciliation case, the state offset vector recorded by the checkpoint is [0.25, -0.18, 0.32, 0.05, -0.41], representing the state changes in 5 dimensions. The propagation parameter matrix is learned from historical data and has a dimension of 5x3, corresponding to three propagation characteristics. Multiplying the two matrices gives the modulated propagation characteristics [0.15, -0.22, 0.37], representing the modulated propagation strength, direction, and speed, respectively.
[0113] Decomposing the dynamically modulated propagation characteristics in different frequency domains is an important means of in-depth analysis of causal effects. The system uses wavelet transform to decompose the propagation characteristics into high-frequency, medium-frequency, and low-frequency components. The high-frequency component corresponds to short-term, rapid changes, the medium-frequency component corresponds to medium-term effects, and the low-frequency component corresponds to long-term, persistent effects. In the financial reconciliation scenario, the high-frequency component reflects the immediate impact of a single transaction error, the medium-frequency component reflects the cumulative deviation over a period of time, and the low-frequency component represents systemic problems in long-term accounting policies or processing flows. Frequency decomposition of the above propagation characteristics [0.15, -0.22, 0.37] gives high-frequency components [0.08, -0.15, 0.12], medium-frequency components [0.05, -0.05, 0.15], and low-frequency components [0.02, -0.02, 0.10].
[0114] The system evaluates the contribution of each frequency component to the difference, applies the propagation characteristics of a single frequency component to the propagation process of the causal link, and observes the degree of change in the final difference. The contribution calculation considers the absolute and relative values of the difference change, as well as whether the direction of the change is consistent with the original difference. For example, in a certain case, the original difference amount is 5,000 yuan, and after using the propagation characteristics of the high-frequency component, the difference becomes 3,200 yuan, a decrease of 1,800 yuan, with a contribution of 36%; using the medium-frequency component, the difference becomes 4,100 yuan, with a contribution of 18%; using the low-frequency component, the difference becomes 4,700 yuan, with a contribution of 6%. This indicates that the high-frequency component (representing data entry errors) has the greatest impact on the difference.
[0115] The contribution of each frequency component is fused by a hierarchical attention network, which contains two levels of attention mechanisms: frequency-level attention and dimension-level attention. The frequency-level attention assigns weights according to the importance of different frequency components, which is evaluated by the contribution and stability of the frequency components. The frequency-level attention network contains a single-layer network with 32 hidden units, outputting 3 attention weights corresponding to high, medium, and low frequencies. The dimension-level attention further distinguishes the importance of each dimension feature, using a similar structure but outputting the same dimension as the feature dimension. In the above case, the weight calculated by the frequency-level attention is [0.65, 0.25, 0.1], indicating that the high-frequency component has the largest weight; the dimension-level attention is [0.4, 0.35, 0.25], indicating that the importance of the three dimensions decreases.
[0116] The training of the attention network uses supervised learning, using cases with known attribution results in historical reconciliation data as labels. The training data includes the contribution of each frequency component and the final confirmed attribution result, and the network is optimized by minimizing the cross-entropy loss function between the predicted attribution and the actual attribution. In a certain enterprise financial system, the attention network is trained using 800 historical cases, with a validation set accuracy of 92.3%, indicating that the network can effectively learn the importance patterns of different frequency components and dimension features.
[0117] Through attention-weighted fusion, the system generates the final contribution score of the causal link, and the fusion process first applies attention weights at the frequency level to obtain frequency-weighted contribution, and then applies attention weights at the dimension level to obtain the final comprehensive contribution score. The score range is 0 to 1, and the higher the value, the greater the contribution of the causal link to the difference. In a certain reconciliation difference case, the system analyzed 5 potential causal links, and the final contribution scores were 0.82, 0.65, 0.47, 0.31, and 0.23, respectively, indicating that the first link (representing "Supplier information error - Transaction matching failure - Funds allocation error - Final difference") has the largest contribution.
[0118] Based on the contribution score, the system generates the difference reason attribution result, which includes the main reason, the secondary reason, and the reason at three levels, corresponding to different intervals of the contribution score. Causal links with a contribution score greater than 0.7 are identified as the main reason, those with a score between 0.4 and 0.7 are identified as the secondary reason, and those with a score between 0.2 and 0.4 are identified as the reason. For the causal link with the highest score, the system further extracts the key nodes as the specific attribution result. In the above case, the system identifies "Supplier information error" as the main reason (contribution 0.82), "Transaction matching algorithm parameter setting improper" as the secondary reason (contribution 0.65), and "Bank flow import delay" as the reason (contribution 0.47).
[0119] The presentation of the attribution results employs visualization, marking causal links with different colors for different contribution levels, and provides an interactive interface for users to explore detailed information of each link. The system also generates natural language explanations describing the formation process and impact of the main causes. For example: "The main cause of this reconciliation discrepancy (82% contribution) is supplier information error, specifically, the supplier code S10086 was mistakenly recorded as S10085, leading to transaction matching failure and further causing a 5,000 yuan fund allocation error. It is recommended to correct the supplier information and re-execute the matching process."
[0120] Through the above counterfactual reasoning and multi-dimensional analysis, the system realizes accurate attribution of the causes of financial reconciliation discrepancies, providing a reliable basis for subsequent discrepancy processing. Practical application shows that this method improves the attribution accuracy from 76% of traditional methods to 94%, greatly reducing the time input of financial personnel in cause analysis, while improving the pertinence and effectiveness of discrepancy processing.
[0121] In an alternative embodiment, a reconciliation discrepancy feature vector is generated based on the discrepancy cause attribution results, a reinforcement learning method is used to process the reconciliation discrepancy feature vector, the reconciliation discrepancy feature vector is mapped to a state vector, and a processing strategy is generated based on the state vector, including:
[0122] Based on the discrepancy cause attribution results, the amount matching degree, the time sequence correlation, and the subject association degree are taken as feature dimensions to generate a feature vector reflecting the attributes of the reconciliation discrepancy;
[0123] The feature vector is processed by double-layer mapping, the first layer mapping extracts the static reconciliation attributes in the feature vector to generate a static state representation, the second layer mapping generates a dynamic state representation based on the analysis of the change process of the discrepancy features based on the static state representation, and the static state representation and the dynamic state representation are fused to generate an enhanced state vector;
[0124] The discrepancy processing direction is determined according to the static reconciliation attributes in the enhanced state vector, and the specific processing action is generated according to the dynamic attributes in the enhanced state vector and the discrepancy processing direction;
[0125] The strategy evaluation index is dynamically adjusted according to the execution effect of the processing action, the processing action is iteratively optimized based on the strategy evaluation index, and the final reconciliation processing strategy is generated.
[0126] Based on the attribution results of the differences, the system generates an account difference feature vector, and a multi-dimensional feature extraction framework is constructed. The framework first extracts the amount matching degree index from the attribution results, which reflects the consistency of the financial data and the bank flow data in the amount dimension. The amount matching degree is calculated by comparing the ratio of the absolute difference of the two sides of the data to the benchmark amount. For example, for a transaction with a financial system record amount of 50,000 yuan and a bank flow record of 48,500 yuan, the amount difference rate is 3%, and the converted amount matching degree is 0.97. The system sets different matching tolerances for different amount intervals, with a tolerance of 1% for small transactions (less than 10,000 yuan), a tolerance of 3% for medium transactions (10,000 yuan to 100,000 yuan), and a tolerance of 0.5% for large transactions (more than 100,000 yuan). When the difference exceeds the tolerance, the system will reduce the matching degree score and mark potential abnormalities.
[0127] The time sequence correlation dimension captures the consistency of transaction time and time sequence pattern, and the system records the occurrence time, entry time and settlement time of the transaction, and analyzes the relationship and delay pattern between these time points. The time sequence correlation index includes two parts: time matching degree and time sequence pattern matching degree. The time matching degree calculates the time difference between the financial record and the bank flow record, and maps it to a score in the 0-1 interval. For example, a time difference of 0 days scores 1, a time difference of 1 day scores 0.9, a time difference of 2 days scores 0.8, and so on. The time sequence pattern matching degree is evaluated by analyzing the degree of conformity of the historical transaction time pattern with the current transaction. For a regular payment to a supplier, historical data shows that it is usually completed within 3 days before and after the 15th of each month, if the current transaction occurs on the 13th, the time sequence pattern matching degree score is 0.95; if it occurs on the 20th, the score decreases to 0.75.
[0128] The subject correlation degree dimension analyzes the corresponding relationship between the financial subject and the transaction type, and the system establishes a detailed subject mapping table to record the standard corresponding relationship between different transaction types and financial subjects. The subject correlation degree is calculated by comparing the consistency of the subject classification of the current transaction with the standard classification expected by the system. For example, for a collection transaction from customer A, the financial system record is under the "accounts receivable - customer A" subject, which conforms to the standard subject correspondence, and the subject correlation degree score is 1.0; if it is recorded under the "prepaid accounts - customer A" subject, the correlation degree score decreases to 0.6; if it is recorded under a completely unrelated subject such as "other receivables", the correlation degree score is only 0.2. The system also considers the hierarchical relationship and semantic similarity between subjects, and even if it is not a complete match, it can give a reasonable correlation degree score.
[0129] Based on the eigenvalues of the above three dimensions, the system generates a reconciliation difference feature vector. For a certain transaction, its feature vector is [0.97, 0.9, 0.85, 0.78, 0.92], where 0.97 represents the amount matching degree, 0.9 and 0.85 represent the time matching degree and the timing pattern matching degree respectively, 0.78 represents the subject correlation degree, and 0.92 represents the transaction party information matching degree (as a supplementary dimension). Through this multi-dimensional feature representation, the system comprehensively characterizes the essential features of the reconciliation difference.
[0130] The double-layer mapping processing of the feature vector extracts the static reconciliation attributes in the first layer, focusing on the inherent features of the transaction itself. This layer uses a multi-layer perceptron network structure, with the original feature vector as the input, and performs feature conversion and dimension reduction through two hidden layers (with 64 and 32 nodes respectively). Finally, a 16-dimensional static state representation is output. The network uses the ReLU activation function to enhance the non-linear expression ability, and uses the batch normalization technique to improve the training stability. For example, for the input feature vector [0.97, 0.9, 0.85, 0.78, 0.92], after the first layer mapping, the static state representation [0.82, 0.75, 0.63, 0.91, 0.88, 0.72, 0.65, 0.79, 0.84, 0.77, 0.68, 0.83, 0.76, 0.69, 0.81, 0.74] is obtained. These values represent the projection of the transaction in different latent feature spaces, capturing the complex relationships between the amount feature, the time feature, and the subject feature.
[0131] The second layer mapping analyzes the change process of the difference features and generates a dynamic state representation. This layer uses a recurrent neural network structure to consider the timing relationship between the current transaction and the historical related transactions. The system maintains a transaction history window of length 10, recording the static state representation of the historical transactions related to the current transaction. The recurrent network uses a gated recurrent unit structure, with a hidden state dimension of 16 and a sequence length of 10 (including the current transaction and 9 historical related transactions). The network outputs a 16-dimensional dynamic state representation, reflecting the historical evolution pattern of the transaction features. For example, for a series of transactions of a certain customer, the system detects that the amount matching degree of recent transactions gradually decreases from 0.98, 0.96, 0.95 to the current 0.97. This change trend is encoded in the dynamic state representation as a potential risk signal.
[0132] The fusion of static state representation and dynamic state representation adopts attention mechanism to generate an enhanced state vector. The attention mechanism calculates the correlation degree of each dimension of the static representation and the dynamic representation to generate attention weights. The dimensions with high correlation degree obtain higher weights in the fusion process. The fusion process is realized by weighted summation, and the output is an enhanced state vector with 16 dimensions. For example, for static state [0.82, 0.75,...] and dynamic state [0.68, 0.73,...], the attention weights are [0.12, 0.08,...], and the enhanced state vector after fusion is [0.804, 0.748,...]. The enhanced state vector contains both the static attributes and the dynamic evolution characteristics of the transaction, providing a comprehensive information basis for the subsequent processing strategy generation.
[0133] Based on the enhanced state vector, the difference processing direction is determined, and the system identifies the main difference type and processing priority by analyzing the static reconciliation attributes in the state vector. The determination of the processing direction adopts a multi-classification method, which maps the enhanced state vector to the pre-defined processing direction categories. The main processing directions include "amount adjustment", "time re-matching", "subject re-classification", "transaction splitting", "transaction merging" and "abnormal marking", etc. The system uses a support vector machine model to realize classification, the kernel function is selected as radial basis function, the penalty parameter C is set to 10, and the decision threshold is 0.75. For the state vector [0.804, 0.748,...], the system identifies that the probability of "amount adjustment" is 0.82, the probability of "time re-matching" is 0.12, and the probabilities of other directions are low, so the main processing direction is determined as "amount adjustment".
[0134] According to the determined processing direction and the dynamic attributes in the enhanced state vector, the system generates specific processing actions. The processing action is the specific implementation strategy of the processing direction, including operation type, operation parameter and operation sequence. The system uses a strategy network to generate the processing action, the network input is the enhanced state vector and the one-hot encoding of the processing direction, and the output is the probability distribution on the action space. The action space is dynamically adjusted according to the processing direction, for example, the action space of "amount adjustment" direction includes "precise matching adjustment", "proportion matching adjustment", "rounding matching adjustment", etc. The system selects the action with the highest probability as the execution strategy. For a certain transaction amount difference, the specific processing action generated by the system is "proportion matching adjustment", and the parameter setting is "adjustment proportion 0.97, adjustment threshold 5000 yuan, automatic processing upper limit 2000 yuan".
[0135] The system defines a comprehensive policy evaluation index system, including accuracy indicators (match accuracy, error rate), efficiency indicators (processing time, manual intervention rate), and risk indicators (abnormal detection rate, compliance score). For each processing action, the system records detailed effect data. For example, for the "proportional matching adjustment" action, the effect data for a certain execution is: match accuracy 92%, error rate 3%, average processing time 2.3 seconds per item, manual intervention rate 15%, abnormal detection rate 2%, and compliance score 0.95. The system compares these indicators with the preset target, calculates the reward signal, and uses it for policy network optimization.
[0136] The policy optimization uses a deep Q-learning method, accumulates training samples through an experience replay mechanism, and maintains an experience pool with a capacity of 10000, storing state-action-reward-next state four-tuples. Each policy update randomly samples a batch of data (batch size 64) from the experience pool, uses a double network architecture to reduce estimation bias. The learning rate is set to 0.001, the discount factor is 0.95, the exploration rate is initially set to 0.3 and linearly decays to a minimum value of 0.05 as training progresses. For example, when processing a certain type of reconciliation difference, the system initially tends to use the "precise matching adjustment" action, but through multiple iterations of optimization, it finds that the "proportional matching adjustment" action is more effective in most cases, and the policy network gradually adjusts the output probability distribution to increase the selection probability of the "proportional matching adjustment" action.
[0137] After iterative optimization, the system finally generates a processing strategy library for each type of reconciliation difference, with each difference type corresponding to a set of processing strategies, and the strategy library effectively covers various common and abnormal situations. For example, for the amount difference of supplier payment transactions, the final strategy is: when the difference rate is less than 2% and the amount is less than 5000 yuan, use "proportional matching adjustment" for automatic processing; when the difference rate is between 2% and 5% or the amount is between 5000 and 10000 yuan, use "precise matching adjustment" and submit for manual review; when the difference rate exceeds 5% or the amount exceeds 10000 yuan, mark it as a high-risk difference and require a designated person to verify and contact the supplier for confirmation. This hierarchical processing strategy effectively balances the needs of automation efficiency and risk control.
[0138] Through the above technical implementation, the system successfully converts the reconciliation difference feature vector into an executable processing strategy, realizing a closed-loop process from difference detection to automatic processing. In actual application, this method improves the automation processing rate of financial reconciliation from the original 65% to 88%, and the difference processing accuracy rate reaches 95.5%, greatly reducing the demand for manual intervention and processing cost. Especially for small and medium-sized transaction differences, the processing efficiency is improved by 3.5 times, saving a lot of repetitive work time for financial personnel. The adaptive learning ability of the system enables it to continuously adapt to new business scenarios and difference patterns, realizing continuous optimization and value improvement.
[0139] In an optional implementation, the effect of the processing strategy is evaluated by a set reward function, the processing strategy is optimized according to the evaluation result, and a difference processing suggestion and a risk assessment result are generated; and a difference processing scheme is generated according to the difference processing suggestion and the risk assessment result, including:
[0140] An instant score is calculated based on the execution efficiency and resource consumption of the processing strategy, a credit allocation value is calculated based on the cumulative effect of the historical processing strategy, and a strategy evaluation score is obtained by weighted combination of the instant score and the credit allocation value;
[0141] Multi-scenario risk analysis is performed based on the strategy evaluation score, the risk propagation path of the processing strategy is sampled by Monte Carlo tree search, the sampling path is classified according to the risk influence degree and propagation speed, and the risk propagation probability is calculated based on the classification result;
[0142] The processing strategy is optimized according to the risk propagation probability, and an exploration factor is introduced in the optimization process to adjust the strategy execution order and execution parameters, and the adaptability of the strategy is improved through multiple rounds of iterative optimization to generate multiple sets of difference processing suggestions;
[0143] The feasibility of the multiple sets of difference processing suggestions is evaluated, the risk level of each set of difference processing suggestions is quantified based on the risk propagation probability, and the processing suggestion with the lowest risk level and the highest executability is selected as the final difference processing scheme.
[0144] The processing strategy evaluation link first establishes a reward function evaluation framework, which is divided into two parts: instant score and credit allocation. The instant score mainly considers the execution efficiency and resource consumption of the processing strategy. The calculation process involves multiple indicators. The execution efficiency indicators include the time consumption of strategy execution, the success rate of account matching, and the accuracy of processing exceptions. For time consumption, the system records the time required for the strategy to complete from start to finish, which is standardized and converted to an efficiency score between 0 and 1. The shorter the execution time, the higher the score. For example, a certain strategy completes the processing of 100 transactions in 15 seconds, compared with the benchmark time of 25 seconds, its time efficiency score is 0.85. The success rate of account matching is calculated by dividing the number of successfully matched transactions by the total number of transactions. For example, 87 transactions are successfully matched, with a matching success rate of 87%, which is converted to a matching score of 0.87. The accuracy of exception handling is determined by the ratio of the number of correctly identified and handled exceptions to the total number of exceptions. For example, 11 out of 12 exceptions are correctly handled, with an accuracy score of 0.92.
[0145] The resource consumption indicators mainly include system memory usage, processor usage, and network request times. The system monitors these resource indicators in real time and compares them with the preset threshold to obtain the resource consumption score. For example, during the execution of a certain strategy, the average memory usage is 12% of the total system memory, the processor usage is 15%, and the network request times are 32. According to the resource consumption evaluation function, the resource consumption score is calculated as 0.76. The final instant score is calculated by combining the efficiency score and the resource consumption score. For example, in the above case, the efficiency indicator weight is 0.6, and the resource consumption indicator weight is 0.4. The calculated instant score is 0.85 x 0.87 x 0.92 x 0.6 + 0.76 x 0.4 = 0.415 + 0.304 = 0.719.
[0146] The credit allocation value calculation involves the cumulative effect evaluation of historical processing strategies. The system maintains a historical performance database of processing strategies, recording the execution results of each strategy in different scenarios. The credit allocation calculation adopts a time decay mechanism, giving higher weights to the results of recently executed strategies. For example, for a certain processing strategy, the instant scores of its last 5 executions are 0.72, 0.68, 0.75, 0.71, and 0.69, respectively. Using a decay factor of 0.8, the calculated credit allocation value is 0.72 x 1 + 0.68 x 0.8 + 0.75 x 0.8 2 + 0.71 x 0.8 3 + 0.69 x 0.8 4 = 0.72 + 0.544 + 0.48 + 0.363 + 0.282 = 2.389. The credit allocation value is standardized and mapped to the interval of 0 to 1 to obtain the final credit score of 0.81.
[0147] The weighted combination of instant score and credit allocation value adopts a dynamic weight adjustment mechanism. The system automatically adjusts the weight ratio of the two according to the characteristics of the current business scenario. For high-frequency transaction reconciliation scenarios, the instant score weight is higher, while for complex exception handling scenarios, the credit allocation value weight is higher. Taking a certain financial exception handling task as an example, the system determines it as a medium complexity scenario, sets the instant score weight to 0.35 and the credit allocation value weight to 0.65, and calculates the strategy evaluation score as 0.719*0.35+0.81*0.65=0.252+0.527=0.779.
[0148] Based on the strategy evaluation score, the system performs multi-scenario risk analysis. The risk analysis first constructs a Monte Carlo tree search model, with the root node representing the current handling strategy and the child nodes representing the risk evolution direction. The system sets the initial tree depth to 4 layers and the average number of branches per node to 3. The tree nodes store state information related to financial exceptions, including transaction amount, transaction counterparty, transaction time, difference type, and other key attributes. For example, for a supplier payment of 56,789 yuan, a difference of 65,789 yuan is generated due to bank flow, and its node state contains these difference information and handling direction.
[0149] During the Monte Carlo tree search process, the system performs a large number of simulation samples to explore the risk propagation path of the handling strategy. Each simulation starts from the root node, selects child nodes according to certain strategies, and stops until it reaches the leaf node or reaches the preset depth limit. The number of simulations is set to 1000 to ensure sufficient coverage of risk paths. In the node selection process, the system adopts a mechanism that balances exploration and utilization, and new nodes have a certain probability of being visited to discover potential risk paths. For example, the system performs Monte Carlo tree search on a certain financial difference and identifies 15 main risk propagation paths after 1000 simulations, with the top 3 paths having visit frequencies of 217, 185, and 156.
[0150] The sampling paths are classified according to risk impact degree and propagation speed. The risk impact degree is based on the change amplitude of financial indicators, such as the impact on key indicators such as cash flow, profit, and asset-liability ratio. The propagation speed is calculated based on the time required for the risk to spread to related business links. For example, a certain risk path causes a 15-day delay in accounts receivable, affecting cash flow by 2%, and taking 5 working days to spread to 3 related business links. The system classifies it as a "medium impact, medium speed propagation" category. The system classifies sampling paths into six categories: high impact, fast propagation, high impact, slow propagation, medium impact, fast propagation, medium impact, slow propagation, low impact, fast propagation, and low impact, slow propagation.
[0151] Based on the classification results, the system calculates the risk propagation probability. For each category, the system counts the frequency of the category path appearing and divides it by the total simulation times to get the base probability. For example, the high-impact rapid propagation category path appears 85 times, and its base probability is 0.085. The system further considers the adjustment of the probability by the policy evaluation score. The higher the evaluation score, the lower the probability of high-risk categories. For the case of a policy evaluation score of 0.779, the adjustment coefficient of the high-impact rapid propagation category is 0.8, and the adjusted risk propagation probability is 0.085 x 0.8 = 0.068. The system finally generates a complete risk propagation probability matrix containing the probability values of all categories, such as [0.068, 0.092, 0.121, 0.225, 0.279, 0.215].
[0152] According to the risk propagation probability, the system optimizes the processing strategy. The optimization process introduces an exploration factor, allowing the strategy to vary within a certain range to explore better solutions. The initial value of the exploration factor is set to 0.3, which decays with the increase of optimization rounds, and the minimum value is 0.05. The system adjusts the execution order and execution parameters of the strategy, such as adjusting the processing priority of abnormal transactions, modifying the parameter threshold of the matching algorithm, and changing the fund allocation ratio. For the case of supplier payment differences, the system adjusts the difference identification threshold from the default 1% to 2%, and improves the processing priority of such differences, while adjusting the similarity calculation weight of the automatic matching algorithm.
[0153] Through multiple rounds of iterative optimization, the adaptability of the strategy is improved. Each round of iteration includes three steps of strategy adjustment, simulation execution, and effect evaluation, and the number of iterations is set to 20 rounds. For example, after the first round of iteration, the policy evaluation score increases from 0.779 to 0.792, and the high-risk propagation probability decreases to 0.062; after the fifth round of iteration, the evaluation score reaches 0.831, and the high-risk propagation probability decreases to 0.047; after the tenth round, the evaluation score is 0.857, and the high-risk propagation probability is 0.038; after the twentieth round, the evaluation score reaches 0.882, and the high-risk propagation probability decreases to 0.029. The system finally generates 5 sets of difference processing suggestions, each containing processing order, matching algorithm parameters, and abnormal processing rules.
[0154] For the generated multiple sets of difference processing suggestions, the system performs a feasibility assessment, which considers multiple factors: technical implementation difficulty, required resources, operation complexity, compliance, etc. The system assigns weights to each factor and calculates a feasibility score. For example, a certain processing suggestion has a technical implementation difficulty score of 0.85 (relatively easy to implement), a required resource score of 0.72 (moderate resource demand), an operation complexity score of 0.91 (simple operation), and a compliance score of 0.95 (fully compliant with regulations). The comprehensive feasibility score is 0.85 x 0.25 + 0.72 x 0.3 + 0.91 x 0.25 + 0.95 x 0.2 = 0.212 + 0.216 + 0.228 + 0.19 = 0.846.
[0155] The risk level of each set of difference processing suggestions is quantified based on the risk propagation probability. The risk level calculation considers the weighted sum of various risks, with weights related to the impact and propagation speed of the risks. For example, for the third set of processing suggestions, the risk propagation probability is [0.029, 0.048, 0.115, 0.257, 0.301, 0.25], and the corresponding risk weights are [1.0, 0.8, 0.6, 0.4, 0.3, 0.2]. The calculated risk level is 0.029 x 1.0 + 0.048 x 0.8 + 0.115 x 0.6 + 0.257 x 0.4 + 0.301 x 0.3 + 0.25 x 0.2 = 0.029 + 0.0384 + 0.069 + 0.1028 + 0.0903 + 0.05 = 0.3795.
[0156] The processing suggestion with the lowest risk level and the highest feasibility is selected as the difference processing scheme. By comparing the risk levels and feasibility scores of the five sets of suggestions, the system selects the third set of suggestions with a risk level of 0.3795 and a feasibility score of 0.846 as the final scheme. This scheme includes specific execution steps: first, handle transactions with an amount difference exceeding 5000 yuan, use a fuzzy matching algorithm (similarity threshold set to 0.85) to match bank flow and financial records, use historical transaction pattern-based anomaly detection rules for supplier transactions, and set the threshold for automatic processing and manual review. The system generates detailed execution guidelines, including parameter configuration, operation process, and expected results, for financial personnel to execute. Practice has proven that this difference processing scheme improves the efficiency of financial reconciliation anomaly handling by 37%, increases the accuracy rate to 95.7%, and significantly reduces financial risks.
[0157] In an alternative embodiment, multiple-scenario risk analysis is performed based on the policy evaluation score. The risk propagation paths of the processing strategies are sampled through Monte Carlo tree search, and the sampled paths are classified according to risk impact and propagation speed. The risk propagation probability is calculated based on the classification results, including:
[0158] The scene weight is calculated based on a policy evaluation score, the scene weight is divided into multiple level intervals according to a risk degree, a temperature decay curve is set in each level interval, the scene distribution is adaptively adjusted according to the temperature decay curve, and a scene distribution vector containing a risk propagation characteristic is generated;
[0159] A Monte Carlo search tree is constructed based on the scene distribution vector, a time sequence access feature is calculated by performing an exponential moving average calculation on the access frequency of a node based on the Monte Carlo search tree, the time sequence access feature is hierarchically mapped with the scene distribution vector to obtain a node dynamic weight, the Monte Carlo search tree is expanded according to the node dynamic weight, and a search space containing multiple layers of risk propagation paths is generated;
[0160] Adaptive path sampling is performed in the search space, a basic sampling probability is set according to the scene weight, the basic sampling probability is adjusted by a negative exponential function of path length, the node dynamic weight is taken as a direction guide factor, double constraints on sampling depth and sampling direction are realized, and multiple representative risk propagation paths are obtained;
[0161] Risk transfer analysis is performed on each of the risk propagation paths, a forgetting factor is introduced in the risk propagation path to attenuate the historical risk state, a time sequence risk value of the path is calculated by layer-by-layer recursion, and a risk propagation probability reflecting the risk propagation law is generated according to the time sequence risk value.
[0162] As shown in Figure 3 The method comprises:
[0163] In an actual business scenario, a risk analysis link comprehensively evaluates the risk of a processing strategy by using a policy evaluation score. This embodiment first calculates a scene weight, obtains a basic risk value of each scene by deeply analyzing historical financial data and bank flow records. For example, the basic weight of the cross-month reconciliation inconsistency scene can be set to 0.78, and the basic weight of the frequent small-amount transaction mismatch scene in a short period of time can be set to 0.65. The system divides the scene weight into five level intervals, i.e., a high-risk interval (0.8-1.0), a medium-high-risk interval (0.6-0.8), a medium-risk interval (0.4-0.6), a low-risk interval (0.2-0.4), and an extremely low-risk interval (0-0.2) according to a risk degree.
[0164] For each risk level interval, the corresponding temperature decay curve control parameter is set. The high-risk interval adopts a slower linear decay with a decay rate of 0.05 per cycle; the medium-high-risk interval adopts exponential decay with an initial decay rate of 0.1 per cycle; the medium-risk interval adopts exponential decay with an initial decay rate of 0.15 per cycle; the low-risk and very low-risk intervals adopt fast decay with decay rates of 0.2 per cycle and 0.25 per cycle, respectively. For a certain financial abnormal scenario, the initial risk value is 0.76, belonging to the medium-high-risk interval. After 5 decay cycles, the risk value is adjusted to 0.76 x (1-0.1) 5 ≈0.45, indicating that the risk level of the scenario has decreased.
[0165] The temperature decay curve is self-adaptively adjusted according to the real-time observed risk event frequency. When the system detects an increase of more than 15% in the risk event frequency for three consecutive cycles, the decay rate of the corresponding scenario is reduced by 20%; conversely, when the risk event frequency decreases by more than 15% for three consecutive cycles, the decay rate increases by 10%. Through this dynamic adjustment mechanism, the system generates a more accurate scenario distribution vector to assign a corresponding risk weight element to each business scenario. Taking 15 typical business scenarios of a certain enterprise financial system as an example, the generated scenario distribution vector is [0.82, 0.76, 0.61, 0.58, 0.55, 0.49, 0.47, 0.42, 0.38, 0.36, 0.29, 0.25, 0.22, 0.18, 0.12].
[0166] Based on the scenario distribution vector, the system constructs a Monte Carlo search tree model to analyze the risk propagation path. The root node of the search tree represents the initial risk state, and the child nodes represent the risk evolution direction. For the initial risk state of bank flow and financial account mismatch, its evolution direction includes multiple branches such as fund freezing risk, cash flow disruption risk, and financial statement distortion risk. The initial depth of the search tree is set to 4 layers, and the average branch number of each node is 3-5.
[0167] The system counts the node access frequency in the search tree and applies the exponential moving average algorithm to calculate the time series access feature. The smoothing factor α of the exponential moving average is set to 0.8. For a certain node, if the access frequencies of the previous three simulations are 5, 8, and 4 respectively, then the time series access feature value is 5 x 0.8 3 +8 x 0.8 2 +4 x 0.8 ≈ 8.728. The time series access feature reflects the importance of the node in the risk propagation process. A node with high access frequency usually means that this risk path is more likely to occur.
[0168] The time sequence access feature is hierarchically mapped to the scene distribution vector to obtain the node dynamic weight. During the mapping process, the system designs a multi-level weight distribution mechanism. The top node weight is mainly affected by the high-risk elements in the scene distribution vector, and the weight proportion is 65%; the middle node weight is affected by the medium-risk elements, and the proportion is 25%; and the bottom node weight is affected by the low-risk elements, and the proportion is 10%. For example, for a node in the second layer, if its time sequence access feature value is 8.728, and the average of the high-risk elements in the corresponding scene distribution vector is 0.73, then the dynamic weight of the node is 8.728*0.73*0.65≈4.14.
[0169] Based on the node dynamic weight, the system extends the Monte Carlo search tree, preferentially expands the high-weight nodes, and increases the depth by 1-2 layers each time until the preset maximum depth of 8 layers is reached. The expansion process uses a priority queue to store the nodes to be expanded, and the upper limit of the queue length is 100. In each iteration, the top 10% of the nodes are selected for expansion. For example, in a certain expansion, the system selects a node with a dynamic weight of 4.14 for expansion, adding two child nodes representing the "supplier payment delay" and "internal approval process blockage" risk propagation situations. Through multiple rounds of expansion, the system generates a search space containing 285 nodes, covering the main risk propagation paths.
[0170] In the generated search space, the system performs adaptive path sampling, and sets the basic sampling probability according to the scene weight. The basic sampling probability of the high-risk interval (0.8-1.0) is set to 0.6, the medium-high risk interval (0.6-0.8) is 0.25, the medium-risk interval (0.4-0.6) is 0.1, and the low-risk and below interval is 0.05. For a path of length L, the system adjusts the basic sampling probability by a negative exponential function e (-0.2×L) The basic sampling probability is adjusted. For example, for a high-risk path with a length of 5, the adjusted sampling probability is 0.6*e (-0.2×5) ≈0.18.
[0171] During the sampling process, the system uses the node dynamic weight as a directional guide factor, and the sampling tends to select nodes with high dynamic weights. The specific implementation is as follows: at each branch point, the selection probability is allocated according to the dynamic weight proportion of the child nodes. If a branch point has three child nodes with dynamic weights of 4.14, 2.56 and 1.78, the probability proportion of selecting these three nodes is 4.14:2.56:1.78, which is converted to percentage as 49%:30%:21%. Through 1000 sampling iterations, the system obtains 32 representative risk propagation paths from the search space, covering more than 95% of the high-risk propagation situations.
[0172] For the risk propagation path obtained by sampling, the system performs risk transmission analysis, and a forgetting factor is introduced in the analysis process to decay the historical risk state. The forgetting factor γ is set to 0.85, which means that the risk influence of the last layer is attenuated by 15% for each layer of propagation. For a certain risk propagation path with a length of 6, the initial risk values of each node are 0.82, 0.75, 0.68, 0.71, 0.64, and 0.58, respectively. Considering the forgetting factor, the actual risk contribution of each layer is 0.82, 0.75*0.85≈0.64, 0.68*0.85 2 ≈0.49, 0.71*0.85 3 ≈0.44, 0.64*0.85 4 ≈0.33, 0.58*0.85 5 ≈0.26.
[0173] Through layer-by-layer recursive calculation, the system obtains the time sequence risk value of the path, that is, the cumulative risk value at each time point along the path propagation. Taking the above path as an example, the first layer time sequence risk value is 0.82, the second layer is 0.82+0.64=1.46, the third layer is 1.46+0.49=1.95, and so on. The final overall time sequence risk value of the path is 3.98. The system compares the time sequence risk values and risk growth rates of different paths to identify key risk nodes and high-risk propagation paths.
[0174] Based on the time sequence risk value, the system generates a risk propagation probability reflecting the risk propagation law. For each path, the risk propagation probability is positively correlated with the time sequence risk value and negatively correlated with the path length. Taking 32 sampled paths as an example, the system extracts the overall time sequence risk values [3.98, 3.85, 3.76,...] and path lengths [6, 5, 7,...] of each path, and obtains the risk propagation probability distribution [0.086, 0.082, 0.078,...] through normalization processing. These probability values are directly applied to the risk warning system. When the initial node of a certain risk propagation path is triggered, the system immediately calculates the risk evolution probability of the path and issues a warning message when the probability exceeds a certain threshold (usually 0.05), prompting financial personnel to take appropriate risk control measures.
[0175] Through the above multi-scene risk analysis method, the enterprise financial system can accurately evaluate the risk propagation characteristics of various financial abnormal conditions, predict the risk evolution trend in advance, and effectively improve the financial risk control capability. Practice shows that this method can identify 94.2% of high-risk propagation paths in the financial reconciliation process, which is 23.5 percentage points higher than the traditional method, greatly reducing the chain risk caused by financial errors.
[0176] In a second aspect of the embodiments of the present application, a financial account allocation and abnormality detection system based on machine learning is provided, comprising:
[0177] The first unit is configured to acquire a financial data set and a bank flow data set to be reconciled, and construct a causal graph model based on the financial data set and the bank flow data set.
[0178] The second unit is configured to generate a time sequence attention weight matrix by using a conditional random field according to a time sequence characteristic of the causal graph model, weight and fuse the time sequence attention weight matrix and an edge set in the causal graph model to obtain a fused causal graph model, perform causal reasoning between nodes based on the fused causal graph model, generate a causal link of a reconciliation difference, calculate a credibility of each causal link, attribute a difference reason according to the credibility, and obtain a difference reason attribution result.
[0179] The third unit is configured to generate a reconciliation difference feature vector based on the difference reason attribution result, process the reconciliation difference feature vector by using a reinforcement learning method, map the reconciliation difference feature vector to a state vector, generate a processing strategy based on the state vector, evaluate an effect of the processing strategy by using a set reward function, optimize the processing strategy according to an evaluation result, generate a difference processing suggestion and a risk evaluation result, and generate a difference processing scheme according to the difference processing suggestion and the risk evaluation result.
[0180] The third aspect of the embodiment of the present application provides an electronic device, comprising:
[0181] a processor;
[0182] a memory for storing processor-executable instructions;
[0183] The processor is configured to invoke the instructions stored in the memory to execute the method described above.
[0184] The fourth aspect of the embodiment of the present application provides a computer readable storage medium, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the method described above.
[0185] The present application can be a method, device, system and / or computer program product. The computer program product can include a computer readable storage medium having computer readable program instructions loaded thereon for performing various aspects of the present application.
[0186] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A machine learning based financial credit allocation and anomaly detection method, characterized in that, The method comprises the following steps: obtaining a set of financial data and a set of bank flow data to be reconciled, and constructing a causal graph model based on the set of financial data and the set of bank flow data; generating a time sequence attention weight matrix using conditional random field according to the time sequence characteristics of the causal graph model, weighting and fusing the time sequence attention weight matrix and the edge set in the causal graph model to obtain a fused causal graph model, performing causal reasoning between nodes based on the fused causal graph model to generate a causal link of the reconciliation difference, calculating the credibility of each causal link, attributing the difference reason according to the credibility, and obtaining a difference reason attribution result; generating a reconciliation difference feature vector based on the difference reason attribution result, processing the reconciliation difference feature vector using reinforcement learning method, mapping the reconciliation difference feature vector to a state vector, generating a processing strategy based on the state vector, evaluating the effect of the processing strategy through a set reward function, optimizing the processing strategy according to the evaluation result, generating a difference processing suggestion and a risk assessment result; generating a difference processing scheme according to the difference processing suggestion and the risk assessment result, comprising: calculating an instant score based on the execution efficiency and resource consumption of the processing strategy, calculating a credit allocation value based on the cumulative effect of the historical processing strategy, and weighting and combining the instant score and the credit allocation value to obtain a strategy evaluation score; performing multi-scenario risk analysis based on the strategy evaluation score, sampling the risk propagation path of the processing strategy through Monte Carlo tree search, classifying the sampling path according to the risk impact degree and propagation speed, and calculating the risk propagation probability based on the classification result; optimizing the processing strategy according to the risk propagation probability, adjusting the strategy execution order and execution parameters by introducing an exploration factor in the optimization process, improving the adaptability of the strategy through multiple rounds of iterative optimization, and generating multiple sets of difference processing suggestions; performing feasibility evaluation on multiple sets of the difference processing suggestions, quantifying the risk level of each set of the difference processing suggestions based on the risk propagation probability, and selecting the processing suggestion with the lowest risk level and the highest executability as the final difference processing scheme.
2. The method of claim 1, wherein, According to the time sequence characteristics of the causal graph model, a time sequence attention weight matrix is generated using conditional random field, and the time sequence attention weight matrix is weighted and fused with the edge set in the causal graph model to obtain a fused causal graph model, comprising: constructing a conditional random field based on the time sequence characteristics of the causal graph model, the causal graph model containing multiple time sequence segments, setting a corresponding feature extraction unit for each time sequence segment, and generating a corresponding time sequence local feature; performing collaborative calculation on the time sequence local feature, integrating the time sequence local feature through adaptive weight, and generating a time sequence global feature; performing dynamic evaluation on the time sequence global feature, optimizing the time sequence dependency relationship of the time sequence global feature based on the evaluation result, and generating an optimized time sequence global feature; constructing a time sequence attention weight matrix based on the optimized time sequence global feature, the time sequence attention weight matrix being used for time sequence weight distribution of an edge set in the causal graph model; performing weighted fusion of the time sequence attention weight matrix and the edge set of the causal graph model, performing weight distribution on each edge in the edge set according to the time sequence attention weight matrix, and obtaining a fused causal graph model.
3. The method of claim 1, wherein, performing causal reasoning between nodes based on the fused causal graph model, generating a causal link of the reconciliation difference, calculating a credibility of each causal link, attributing a difference cause according to the credibility, and obtaining a difference cause attribution result including: fusing transaction amount, transaction frequency and subject attribute based on the fused causal graph model to generate a heterogeneous feature representation of a node; dynamically calculating the correlation strength between nodes based on the heterogeneous feature representation; performing importance scoring on the edges in the fused causal graph model according to the correlation strength; and filtering causal propagation paths higher than a pre-set credibility threshold based on the importance scoring; generating a time sequence rationality score according to the time sequence relationship of adjacent nodes based on the causal propagation path; performing nonlinear combination of the time sequence rationality score and the importance score to obtain a comprehensive credibility of the causal link; sorting and filtering the causal propagation paths based on the comprehensive credibility to obtain an optimal causal link set; constructing a counterfactual reasoning module based on the optimal causal link set, intervening each causal link in the optimal causal link set through the counterfactual reasoning module, evaluating the contribution degree of each causal link to the difference, and generating a difference cause attribution result.
4. The method of claim 3, wherein, constructing a counterfactual reasoning module based on the optimal causal link set, intervening each causal link in the optimal causal link set through the counterfactual reasoning module, evaluating the contribution degree of each causal link to the difference, and generating a difference cause attribution result including: The counterfactual reasoning module dynamically adjusts the update amplitude of the node state by using an update gate and a reset gate, performs multi-dimensional intervention on each causal link in the optimal causal link set based on the counterfactual reasoning module, and dynamically modulates the propagation feature of the node by setting a checkpoint array on the causal link, wherein the checkpoint array calculates a state offset vector based on the state change trend of the node, and the state offset vector is used to dynamically modulate the propagation feature of the node; decomposing the dynamically modulated propagation feature in different frequency domains, respectively evaluating the contribution degree of each frequency component to the difference; fusing the contribution degrees of the frequency components through a hierarchical attention network, the hierarchical attention network allocating attention weights according to the importance of different frequency components to generate a final contribution degree score of the causal link, and generating a difference cause attribution result based on the contribution degree score.
5. The method of claim 1, wherein, generating a reconciliation difference feature vector based on the difference cause attribution result, processing the reconciliation difference feature vector by using a reinforcement learning method, mapping the reconciliation difference feature vector into a state vector, and generating a processing strategy based on the state vector including: The amount matching degree, the time sequence correlation and the subject association degree are taken as feature dimensions based on the difference cause result, and a feature vector reflecting the account reconciliation difference attribute is generated; The feature vector is subjected to double-layer mapping processing, a first layer mapping extracts static account reconciliation attributes in the feature vector to generate a static state representation, and a second layer mapping generates a dynamic state representation based on the static state representation and analysis of the change process of the difference features, and the static state representation and the dynamic state representation are fused to generate an enhanced state vector; The difference processing direction is determined according to the static account reconciliation attributes in the enhanced state vector, and a specific processing action is generated according to the dynamic attributes in the enhanced state vector and the difference processing direction; The strategy evaluation index is dynamically adjusted according to the execution effect of the processing action, and the processing action is iteratively optimized based on the strategy evaluation index to generate a final account reconciliation processing strategy.
6. The method of claim 1, wherein, Based on the strategy evaluation score, multi-scene risk analysis is performed, the risk propagation path of the processing strategy is sampled through Monte Carlo tree search, the sampling path is classified according to the risk influence degree and the propagation speed, and the risk propagation probability is calculated based on the classification result, including: Based on the strategy evaluation score, the scene weight is calculated, the scene weight is divided into multiple level intervals according to the risk degree, a temperature decay curve is set in each level interval, the scene distribution is adaptively adjusted according to the temperature decay curve, and a scene distribution vector containing risk propagation characteristics is generated; Based on the scene distribution vector, a Monte Carlo search tree is constructed, the time sequence access feature is calculated by exponentially smoothing the access frequency of the nodes based on the Monte Carlo search tree, the node dynamic weight is obtained by layering mapping the time sequence access feature and the scene distribution vector, the Monte Carlo search tree is expanded according to the node dynamic weight, and a search space containing multiple layers of risk propagation paths is generated; Adaptive path sampling is performed in the search space, the basic sampling probability is set according to the scene weight, the basic sampling probability is adjusted by the negative exponential function of the path length, the node dynamic weight is taken as the direction guide factor to realize the dual constraint of sampling depth and sampling direction, and multiple representative risk propagation paths are obtained; Risk propagation analysis is performed on each of the risk propagation paths, a forgetting factor is introduced in the risk propagation path to attenuate the historical risk state, the time sequence risk value of the path is calculated by layer-by-layer recursion, and the risk propagation probability reflecting the risk propagation law is generated according to the time sequence risk value.
7. A machine learning based financial-to-account allocation and anomaly detection system for implementing the method of any of the preceding claims 1-6, characterized by, The first unit is configured to obtain a set of financial data and a set of bank flow data to be reconciled, and construct a causal diagram model based on the set of financial data and the set of bank flow data; The second unit is configured to perform double-layer mapping processing on the feature vector, a first layer mapping extracts static account reconciliation attributes in the feature vector to generate a static state representation, and a second layer mapping generates a dynamic state representation based on the static state representation and analysis of the change process of the difference features, and the static state representation and the dynamic state representation are fused to generate an enhanced state vector; The second unit is configured to generate a time sequence attention weight matrix using a conditional random field according to a time sequence characteristic of the causal graph model, weight and fuse the time sequence attention weight matrix with a set of edges in the causal graph model to obtain a fused causal graph model, perform causal reasoning between nodes based on the fused causal graph model, generate a causal link of the account difference, calculate a credibility of each causal link, attribute a difference reason according to the credibility, and obtain a difference reason attribution result. The third unit is configured to generate an account difference feature vector based on the difference reason attribution result, process the account difference feature vector using a reinforcement learning method, map the account difference feature vector to a state vector, generate a processing strategy based on the state vector, evaluate an effect of the processing strategy through a set reward function, optimize the processing strategy according to an evaluation result, generate a difference processing suggestion and a risk evaluation result, and generate a difference processing scheme according to the difference processing suggestion and the risk evaluation result.
8. An electronic device, comprising: The computer program instructions are executed by the processor to implement the method in any one of claims 1 to 6. The computer program instructions are executed by the processor to implement the method in any one of claims 1 to 6. The computer program instructions are executed by the processor to implement the method in any one of claims 1 to 6. 9. A computer-readable storage medium having stored thereon computer program instructions, wherein,
Citation Information
Patent Citations
Financial data anomaly detection method and system based on artificial intelligence
CN118673430A
Financial abnormal data analysis method and system based on artificial intelligence
CN119762259A
Tourism company financial risk evaluation system
CN120298129A