Financial data processing method and system and storage medium
By constructing a candidate verification set and calculating the deviation value of the abnormal score, performing feature extraction and normalization processing, the problem of large fluctuations in abnormal scores in blockchain transactions is solved. Dynamic calibration and robustness improvement of abnormal scores are achieved, reducing the risk of misjudgment and improving the security and reliability of blockchain transactions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-03-13
AI Technical Summary
Blockchain transactions in a decentralized environment suffer from abnormally large fluctuations in scores and inconsistencies with binary consensus results, which prevents the system from self-correcting and increases the risk of financial fraud or the wrongful rejection of legitimate transactions.
By acquiring transaction data and behavioral data, a candidate verification set is constructed, and the deviation value of the abnormal score is calculated. If the deviation exceeds the threshold, feature extraction and normalization are performed to construct an effective verification set. The mean of the abnormal scores in the set is used to replace the current abnormal score. The security of the payment request is determined by comparing the replaced score with the preset abnormal threshold.
It achieves dynamic calibration and robustness improvement of abnormal scores, solves the problem of unstable output of abnormal models in complex transaction scenarios, reduces the risk of misjudgment, and improves the security and reliability of blockchain transactions.
Smart Images

Figure CN121660693A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial data risk assessment technology, and more specifically, this application relates to a financial data processing method system and storage medium. Background Technology
[0002] With the rapid development of blockchain technology, its applications in financial transactions, cross-border payments, and smart contracts are becoming increasingly widespread. However, blockchain transactions in a decentralized environment may lead to risk events due to malicious attacks, fraud, or system anomalies. How to conduct real-time and accurate risk assessments of transactions to prevent financial losses or data tampering has become an unresolved issue.
[0003] In existing financial data processing systems, when assessing payment security, the anomaly scores output by anomaly models often fluctuate significantly when new characteristics emerge in transaction or behavioral data, leading to inconsistencies with the binary consensus results generated based on blockchain consensus mechanisms. Furthermore, the lack of effective utilization of historical verification data for real-time calibration of anomaly scores means that when current anomaly scores deviate significantly from similar historical cases, the system cannot adaptively correct itself, thus increasing the risk of misjudgments in payment security decisions and raising the possibility of financial fraud or erroneous rejection of legitimate transactions. Therefore, we propose a financial data processing method system and storage medium to address this problem. Summary of the Invention
[0004] To address the aforementioned technical problems, a financial data processing method system and storage medium are provided. This technical solution resolves the issues raised in the background section.
[0005] To achieve the above objectives, the technical solution of the present invention is as follows:
[0006] Firstly, this application provides a financial data processing method for assessing blockchain transaction risks, including:
[0007] Obtain transaction data, behavioral data, and historical verification sets from both parties to the transaction. The historical verification sets include multiple consensus results and anomaly scores associated with the transaction data and behavioral data.
[0008] Construct a candidate validation set based on data from the historical validation set that are identical to the current consensus result;
[0009] The current transaction data and behavioral data are processed through the blockchain consensus mechanism to generate a binary consensus result;
[0010] A transaction relationship graph is constructed based on the current transaction data and behavioral data, and the transaction relationship graph is input into a pre-trained anomaly model to obtain anomaly scores.
[0011] Calculate the mean score of the abnormal scores in the candidate verification set, and then calculate the deviation value by comparing it with the current abnormal score. If the deviation value is greater than the preset deviation threshold, then perform feature extraction and normalization processing on the candidate verification set and the current transaction data and behavior data, and calculate the mean transaction value of the transaction data and the mean behavior value of the behavior data in the candidate verification set after processing.
[0012] The first transaction deviation value is calculated by the difference between the current transaction data and the transaction average, and the first behavior deviation value is calculated by the difference between the current behavior data and the behavior average.
[0013] The second transaction deviation value is calculated by the difference between the transaction data of the candidate validation set and the transaction mean, and the second behavior deviation value is calculated by the difference between the behavior data of the candidate validation set and the behavior mean.
[0014] Filter the candidate verification set for data where the second transaction deviation value is less than the first transaction deviation value and the corresponding second row deviation value is also less than the first row deviation value, and construct a valid verification set accordingly;
[0015] The current abnormal score is replaced with the mean of the abnormal scores in the valid verification set, and the security of the payment request is determined based on the comparison between the replaced abnormal score and the preset abnormal threshold.
[0016] Secondly, this application provides a financial data processing system for implementing any of the above-mentioned financial data processing methods, including:
[0017] The data acquisition module is used to acquire transaction data, behavioral data, and historical verification sets of both parties to the transaction. The historical verification sets include multiple consensus results and anomaly scores associated with the transaction data and behavioral data.
[0018] It is also used to construct a candidate validation set based on data from the historical validation set that are identical to the current consensus result;
[0019] The consensus verification and model processing module is used to process current transaction data and behavioral data through the blockchain consensus mechanism to generate a binary consensus result.
[0020] It is also used to construct a transaction relationship graph based on current transaction data and behavioral data, and input the transaction relationship graph into a pre-trained anomaly model to obtain anomaly scores;
[0021] The deviation value judgment module is used to calculate the average score of the abnormal scores in the candidate verification set, and then calculate the deviation value by comparing it with the current abnormal score.
[0022] The abnormal score substitution processing module is used to perform feature extraction and normalization processing on the candidate verification set and the current transaction data and behavior data if the deviation value is greater than the preset deviation threshold, and to calculate the transaction mean of the transaction data and the behavior mean of the behavior data in the candidate verification set after processing.
[0023] It is also used to calculate the first transaction deviation value by the difference between the current transaction data and the transaction mean, and to calculate the first behavior deviation value by the difference between the current behavior data and the behavior mean;
[0024] It is also used to calculate the second transaction deviation value by the difference between the transaction data of the candidate verification set and the transaction mean, and to calculate the second behavior deviation value by the difference between the behavior data of the candidate verification set and the behavior mean;
[0025] It is also used to filter data in the candidate verification set where the second transaction deviation value is less than the first transaction deviation value and the corresponding second row deviation value is also less than the first row deviation value, and to construct a valid verification set accordingly;
[0026] The security judgment module is used to replace the current abnormal score with the mean of the abnormal scores in the valid verification set, and to determine whether the payment request is secure based on the comparison between the abnormal score after replacement and the preset abnormal threshold.
[0027] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned financial data processing method.
[0028] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0029] This application constructs a candidate verification set based on data from the historical verification set that are identical to the current consensus result, and calculates transaction deviation value and behavior deviation value through feature extraction and normalization to screen the effective verification set. This solves the problem of poor adaptability of a single abnormal score in a dynamic blockchain transaction environment, realizes dynamic calibration and robustness improvement of abnormal scores, and uses deviation value control as a stable indicator for risk assessment.
[0030] This application solves the problem of unstable output of the anomaly model in complex transaction scenarios by replacing the current anomaly score with the mean of the anomaly scores in the valid verification set, and determining the security of the payment request based on the comparison result of the anomaly score after replacement with the preset anomaly threshold. It completes the comprehensive quantitative analysis of transaction data, behavioral data and historical consensus results, and identifies potential fraudulent behaviors and anomaly patterns in blockchain transactions. Attached Figure Description
[0031] The disclosure of this invention is illustrated with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Wherein:
[0032] Figure 1 This is a flowchart of a financial data processing method proposed in this invention;
[0033] Figure 2 This is a flowchart of the method for validating outlier scores in this invention;
[0034] Figure 3 This is a data flow diagram of the financial data processing method in this invention;
[0035] Figure 4 This is a structural block diagram of a financial data processing system proposed in this invention. Detailed Implementation
[0036] It is readily understood that, based on the technical solution of this invention, those skilled in the art can propose various interchangeable structural methods and implementations without altering the essential spirit of the invention. Therefore, the following detailed embodiments and accompanying drawings are merely illustrative examples of the technical solution of this invention and should not be considered as the entirety of the invention or as limitations or restrictions on the technical solution of this invention.
[0037] In existing technologies, blockchain transaction risk assessment suffers from problems such as large fluctuations in outlier scores and inconsistencies with binary consensus results, and lacks the ability to calibrate outlier scores in real time using historical verification data. This prevents the system from adaptively correcting biases, easily leading to misjudgments in payment security decisions and increasing the risk of financial fraud or the wrongful rejection of legitimate transactions.
[0038] To address the aforementioned issues, this application generates a binary consensus result by acquiring transaction data, behavioral data, and a historical verification set, and obtains anomaly scores based on a transaction relationship graph. Subsequently, a candidate verification set is constructed based on data with the same consensus result in the historical verification set, and the anomaly score deviation value is calculated. If the deviation exceeds a threshold, a valid verification set is constructed through feature extraction, normalization, and deviation comparison. The mean of the anomaly scores in this set is used to replace the current anomaly score. Finally, payment security is determined based on the comparison between the replaced score and the anomaly threshold. This application calibrates the anomaly score in real time using historical data, ensuring the accuracy and adaptability of risk assessment, solving the problem of score fluctuations and inconsistencies with consensus, reducing the risk of misjudgment, and improving the security and reliability of blockchain transactions.
[0039] like Figure 1 As shown, this application describes a process for financial data processing, including:
[0040] S1. Obtain transaction data, behavioral data, and historical verification sets from both parties to the transaction. The historical verification sets include multiple consensus results and anomaly scores associated with the transaction data and behavioral data.
[0041] S2. Construct a candidate verification set based on data from the historical verification set that are identical to the current consensus result;
[0042] S3. Process current transaction data and behavioral data through the blockchain consensus mechanism to generate a binary consensus result;
[0043] S4. Construct a transaction relationship graph based on the current transaction data and behavior data, and input the transaction relationship graph into the pre-trained anomaly model to obtain anomaly scores;
[0044] S5. Calculate the mean score of the outlier scores in the candidate verification set, and then calculate the deviation value by comparing it with the current outlier score.
[0045] S6. If the deviation value is greater than the preset deviation threshold, feature extraction and normalization are performed on the candidate verification set and the current transaction data and behavior data, and the transaction mean of the transaction data and the behavior mean of the behavior data in the candidate verification set after processing are calculated.
[0046] S7. Calculate the first transaction deviation value by the difference between the current transaction data and the transaction average, and calculate the first behavior deviation value by the difference between the current behavior data and the behavior average.
[0047] S8. Calculate the second transaction deviation value by the difference between the transaction data of the candidate verification set and the transaction mean, and calculate the second behavior deviation value by the difference between the behavior data of the candidate verification set and the behavior mean.
[0048] S9. Filter the candidate verification set for data where the second transaction deviation value is less than the first transaction deviation value and the corresponding second row deviation value is also less than the first row deviation value, and construct a valid verification set accordingly.
[0049] S10. Replace the current abnormal score with the mean of the abnormal scores in the valid verification set, and determine whether the payment request is secure based on the comparison result between the abnormal score after replacement and the preset abnormal threshold.
[0050] Regarding step S1:
[0051] The process of acquiring transaction data, behavioral data, and historical verification sets from both parties, where the historical verification sets include multiple consensus results and anomaly scores associated with the transaction data and behavioral data, includes:
[0052] Raw data related to transactions is collected in real time from multiple data sources, specifically including:
[0053] Transaction Data Acquisition: The system directly reads transaction data from both parties through a blockchain network interface. Transaction data includes, but is not limited to, transaction amount, transaction timestamp, transaction type, blockchain address information of the transaction participants, and additional metadata. This data originates from public transaction records on the blockchain or authorized access nodes on a private blockchain, ensuring data integrity and real-time performance.
[0054] Behavioral data acquisition: The system extracts behavioral data from a behavioral log database or a distributed storage system. Behavioral data includes the user's historical transaction frequency, transaction time distribution patterns, transaction object correlation, account activity metrics (such as login frequency and operation type), and abnormal behavior markers (such as multiple failed attempts). Behavioral data is generated by monitoring long-term user activity and stored in a time-series database for subsequent analysis.
[0055] Acquisition of Historical Validation Sets: The system accesses the historical validation database and retrieves pre-stored historical validation sets. Each historical validation set consists of multiple historical transaction instances, including historical transaction data, historical behavior data, corresponding consensus results, and anomaly scores. The consensus result is a binary result (e.g., "pass" or "reject") obtained by validating historical transactions through a blockchain consensus mechanism (such as Proof-of-Work or Proof-of-Stake). The anomaly score is a numerical score obtained by evaluating historical transactions using a pre-trained anomaly model, representing the degree of transaction anomaly. The construction of historical validation sets is based on accumulated transaction risk assessment records, ensuring that the data covers various transaction scenarios and risk types.
[0056] The acquired data is integrated, cleaned, and structured to generate standardized information that can be used for risk assessment, specifically including:
[0057] Processing of transaction and behavioral data: The system parses and normalizes raw transaction and behavioral data, including data format conversion, missing value imputation, and outlier removal. For example, transaction amounts are converted to standard currency units, transaction timestamps are standardized to the international standard time format, and frequency indicators in behavioral data are calculated as normalized values. This process ensures data consistency and comparability.
[0058] Processing of historical verification sets: The system indexes and categorizes historical verification sets, establishing query mappings based on consensus results and anomaly scores. For example, historical verification sets are grouped by consensus results (such as "pass" or "reject") and associated with corresponding transaction and behavioral data features. The processed historical verification sets are stored in a structured format (such as database tables or key-value pairs) for easy retrieval and matching.
[0059] The processed data will be output in a format that is available for subsequent use, specifically including:
[0060] Output of transaction and behavioral data: The processed transaction and behavioral data are encapsulated into data objects, including the node and edge information required for constructing the transaction relationship graph. For example, the transaction data output is a structure containing the identifiers of both parties and transaction attributes, while the behavioral data output is a feature vector containing user behavior sequences.
[0061] Output of the historical validation set: The output of the historical validation set forms the basis of the candidate validation set. Each historical instance includes transaction data, behavioral data, consensus results, and anomaly scores. The output data exists as a set, supporting subsequent bias calculations and filtering operations.
[0062] Through the above technical solutions, this application achieves real-time acquisition and efficient processing of transaction data, behavioral data, and historical verification sets, providing standardized and structured input for subsequent transaction risk assessment. By collecting and integrating raw data from multiple data sources, the integrity and real-time nature of the data are ensured. Simultaneously, the combination of historical verification sets and anomaly scores reduces the risk of misjudgment and missed judgment in transaction anomaly identification. Through data parsing, normalization, and indexing classification, the system's agility in responding to transaction status is preserved while improving the accuracy and reliability of risk assessment. Furthermore, normalization processing allows transaction data and behavioral data from different sources and formats to be processed within the same analytical framework, enhancing the system's scalability and adaptability.
[0063] Regarding step S2:
[0064] The process of constructing a candidate validation set based on the historical validation set and processing anomaly scores includes:
[0065] The process involves retrieving the baseline data and current processing data required to build the validation set from the storage facility. Specifically, this includes: retrieving the complete historical validation set from the historical validation database, which contains multiple historical transaction record instances, each instance including historical transaction data, historical behavior data, corresponding consensus results, and anomaly scores; retrieving the core data generated during the current transaction processing, including the current consensus results and current anomaly scores; reading the preset deviation threshold from the system configuration parameters, which serves as the benchmark for judging the reliability of anomaly scores; and retrieving the metadata information of the historical validation set, including data timestamps, data quality identifiers, and data source verification information.
[0066] The verification and correction of the current abnormal score is achieved through a multi-step processing procedure, specifically including:
[0067] The process of constructing the candidate verification set is as follows: Based on the current consensus result, data is filtered in the historical verification set: If the current consensus result is "verification passed", then all historical instances with the consensus result of "verification passed" are extracted from the historical verification set; if the current consensus result is "verification rejected", then all historical instances with the consensus result of "verification rejected" are extracted from the historical verification set.
[0068] Data integrity verification is performed on the selected historical instances: invalid instances with missing transaction data fields or empty anomaly scores are removed; the time validity of historical instances is verified, and expired instances that exceed the preset time window are excluded; the verified historical instances are organized into a candidate verification set, in which each instance contains complete transaction data, behavioral data and corresponding anomaly scores.
[0069] The process of constructing a candidate validation set based on the historical validation set and processing anomaly scores includes:
[0070] The process involves retrieving the baseline data and current processing data required to build the validation set from the storage facility. Specifically, this includes: retrieving the complete historical validation set from the historical validation database, which contains multiple historical transaction record instances, each of which includes historical transaction data, historical behavior data, corresponding consensus results, and anomaly scores; retrieving the core data generated during the current transaction processing, including the current consensus results and current anomaly scores; reading the preset deviation threshold from the system configuration parameters, which serves as the benchmark for judging the reliability of anomaly scores; and retrieving the metadata information of the historical validation set, including data timestamps, data quality identifiers, and data source verification information.
[0071] The verification and correction of the current abnormal score is achieved through a multi-step processing procedure, specifically including:
[0072] The process of constructing the candidate verification set is as follows: Based on the current consensus result, data is filtered in the historical verification set: If the current consensus result is "verification passed", then all historical instances with the consensus result of "verification passed" are extracted from the historical verification set; if the current consensus result is "verification rejected", then all historical instances with the consensus result of "verification rejected" are extracted from the historical verification set.
[0073] Data integrity verification is performed on the selected historical instances: invalid instances with missing transaction data fields or empty anomaly scores are removed; the time validity of historical instances is verified, and expired instances that exceed the preset time window are excluded; the verified historical instances are organized into a candidate verification set, in which each instance contains complete transaction data, behavioral data and corresponding anomaly scores.
[0074] Through the above technical solution, this application achieves reliability verification and intelligent correction of anomaly scores based on historical verification sets, providing an adaptive calibration mechanism for blockchain transaction risk assessment. By intelligently filtering historical consensus results and verifying data integrity, a high-quality candidate verification set is constructed, ensuring the accuracy and timeliness of the comparison benchmark.
[0075] Regarding step S3:
[0076] The process of generating binary consensus results through blockchain consensus mechanisms includes:
[0077] Obtain the required input data from step S1.
[0078] The acquired data is processed through distributed verification using a blockchain consensus mechanism. Specifically, this includes combining transaction data and behavioral data into transaction units to be verified and serializing and encapsulating the data according to the blockchain network protocol.
[0079] The consensus node network performs multiple rounds of verification on the encapsulated transaction data: In the proof-of-work mechanism, each verification node competitively verifies the validity of the transaction data by calculating a hash problem. In the proof-of-stake mechanism, verification nodes vote to verify the legality of the transaction based on their stake weight.
[0080] Consensus nodes review transactions based on a pre-defined set of verification rules, including:
[0081] Verification of the validity of digital signatures of transactions, compliance of address formats of both parties to the transaction, verification of the non-negativity of transaction amount and sufficiency of balance, verification of consistency of smart contract code execution results, and preliminary screening of abnormal patterns in behavioral data.
[0082] A clear binary decision is generated based on the consensus processing results. Specifically: when transaction data passes all consensus rules and receives confirmation from more than a preset threshold of consensus nodes, a first-order consensus result is output and marked as "verification passed"; when transaction data fails at any consensus rule verification stage or does not receive sufficient confirmation from consensus nodes, a second-order consensus result is output and marked as "verification rejected"; the generated binary consensus results are associated with the corresponding transaction data and behavioral data and stored in the database.
[0083] Through the aforementioned technical solutions, this application achieves efficient collection and multi-node collaborative verification of transaction data, behavioral data, and block context information, providing a reliable consensus mechanism for determining the legality of transactions in the blockchain network. By acquiring multi-source data from the distributed network in real time and constructing transaction units to be verified, the integrity and timeliness of the verification process are ensured. Through multi-round node verification and pre-set rule set review under the proof-of-work or proof-of-stake mechanism, the system's agility in judging transaction status is preserved, while the accuracy and credibility of the consensus results are improved. Furthermore, the unified serialization encapsulation and rule-based verification logic enable transaction data of different types and sources to be processed under the same consensus framework, enhancing the system's scalability and cross-chain adaptability.
[0084] Regarding step S4:
[0085] The process of constructing a transaction relationship graph and obtaining anomaly scores through anomaly modeling includes:
[0086] Collect various types of data required for constructing transaction relationship graphs and analyzing anomaly scores, specifically including: obtaining current complete transaction data, including transaction subject information, transaction object information, transaction chain path and transaction metadata; obtaining current behavioral data, including the behavioral sequence, interaction pattern characteristics and behavioral context information of the two parties in a specific time window; and obtaining historical transaction network topology data from the graph database, including address correlation, fund flow patterns and community division characteristics.
[0087] The raw data is transformed into outlier scores through a multi-step processing procedure, specifically including:
[0088] Transaction relationship graph construction and processing: The participants in the transaction data are abstracted as graph nodes, and the node attributes include address type, transaction frequency, and asset balance characteristics; the transaction relationships are abstracted as graph edges, and the edge attributes include transaction time, transaction amount, transaction type, and transaction success indicator;
[0089] Enriching graph structure features based on behavioral data: transforming interaction patterns in behavioral data into edge weight attributes; transforming temporal regularities in behavioral sequences into temporal dimension features of the graph.
[0090] Construct a transaction relationship graph data structure containing multi-level attributes, where:
[0091] The first layer represents direct transaction relationships, the second layer represents indirect association relationships, and the third layer represents relationships based on similar behavioral patterns.
[0092] Anomaly model handling: Input the completed transaction relationship graph into the pre-trained anomaly model.
[0093] The anomaly model uses a graph neural network architecture to perform deep feature extraction on the transaction relationship graph: it captures the local structural features of the transaction network through graph convolution operations; it identifies key nodes and abnormal connection patterns through graph attention mechanisms; and it detects abnormal fluctuations in the behavioral sequence through time series graph analysis.
[0094] The model calculates anomaly probabilities based on learned transaction pattern features, taking into account the following factors:
[0095] Transaction structure anomaly, including isolated abnormal connections, dense transaction loops, etc.; behavioral consistency anomaly, including the degree of deviation from historical behavioral patterns; and network global anomaly, including the degree of deviation relative to the entire transaction network.
[0096] The system generates quantitative results that characterize the degree of transaction risk. Specifically, the anomaly model outputs a numerical anomaly score, which is within a preset range. The higher the score, the greater the likelihood of an anomaly. It also outputs auxiliary analysis data, including the identification results of the main contributing factors to the anomaly and confidence indexes.
[0097] Through the above technical solutions, this application achieves deep feature extraction and anomaly risk quantification assessment based on transaction relationship graphs, providing accurate anomaly identification capabilities for blockchain transaction security. By fusing multi-source data and constructing a multi-layer graph structure, a comprehensive network representation from direct transaction relationships to behavioral pattern similarities is achieved. Through the collaborative analysis of graph neural networks and attention mechanisms, the system retains its sensitivity to local anomaly features while enhancing its perception of global transaction patterns, thereby reducing the risk of misjudgment and missed detection in anomaly identification.
[0098] This application also describes the process of constructing the anomaly model:
[0099] Obtain a training dataset containing historical transaction relationship graphs and their actual anomaly labels, and divide the training dataset into a model training subset and a model validation subset according to a preset ratio;
[0100] The transaction relationship graph data in the training subset is used as input data to the graph neural network model, and the corresponding normalized real anomaly label data is used as the target output data.
[0101] The internal parameters of the graph neural network model are iteratively adjusted using error backpropagation or gradient boosting algorithms, with the goal of reducing the loss function value between the model's predicted output data and the target output data during training iterations.
[0102] After each training iteration, the model in the current state is evaluated using a validation subset, and its prediction accuracy and mean absolute error are calculated.
[0103] When the accuracy no longer improves or the mean absolute error no longer decreases, stop the training process and output the trained model as an abnormal model.
[0104] Periodically obtain the average confidence level data of the anomaly model when processing recent data;
[0105] If the average confidence score data continues to be below the preset threshold, the model will be updated or retrained.
[0106] For example, the construction process of a graph neural network model is as follows:
[0107] During the model building phase, historical transaction relationship graphs and their corresponding true anomaly scores are obtained as training datasets. This dataset is divided into a model training subset and a model validation subset according to a preset ratio for supervised learning of the model.
[0108] And the internal parameters of the graph neural network model, including the weight matrix, bias vector, etc.
[0109] Standardize the node and edge attributes in the transaction graph to ensure consistent data scale.
[0110] The preprocessed transaction relationship graph is input into a graph neural network model, which learns features through multi-layer graph structure processing.
[0111] Node feature initialization: Use the original attribute vector of each node as the initial feature representation.
[0112] Neighborhood information aggregation: For each node, the model aggregates the feature information of its neighboring nodes, capturing the local structural features of the transaction network through graph convolution operations. Specifically, for a node... Its new feature representation is calculated in the following way:
[0113]
[0114] in Indicates the first Layer nodes eigenvectors, Represents a node The neighborhood group, The normalization constant is For the first The learnable weight matrix of the layer, It is a non-linear activation function.
[0115] By using graph attention mechanisms to identify key nodes and abnormal connection patterns, different attention weights are assigned to different neighbor nodes, thereby enhancing the model's ability to perceive important transaction relationships.
[0116] After processing by a multi-layer graph neural network, the model gradually extracts hierarchical feature representations of the transaction relationship graph from local to global.
[0117] Based on the learned graph structure features, the model calculates the anomaly probability through the output layer:
[0118]
[0119] in This represents the node features of the final layer. For prediction functions (such as fully connected layers and sigmoid activation functions), the output is... This is the anomaly score, a quantitative value representing the degree of anomaly in a transaction.
[0120] Through the above technical solutions, this application achieves the systematic construction and continuous optimization of anomaly models, providing reliable anomaly detection capabilities for blockchain transaction risk assessment. By dividing the training and validation sets and employing supervised learning of graph neural networks, a mapping from transaction relationship graphs to anomaly scores is established. The combined application of error backpropagation and early stopping mechanisms ensures both the efficiency of model training and effectively prevents overfitting. Furthermore, the confidence-monitoring-based model update mechanism enables the system to adapt to changes in data distribution, continuously maintaining the sensitivity and accuracy of anomaly detection, further enhancing the system's long-term applicability and the reliability of risk assessment.
[0121] like Figure 2 As shown, the process of validating outlier scores is introduced;
[0122] This application also describes the following steps after obtaining the outlier scores: validation of the outlier scores and weighting adjustments.
[0123] Obtain the consensus result corresponding to the current anomaly score, the set of valid historical anomaly scores generated by the anomaly model, and the set of historical consensus results corresponding to the set of historical anomaly scores;
[0124] A valid consensus result set is constructed based on the data in the historical consensus result set that are the same as the current consensus result, and a candidate anomaly score set is constructed based on the historical anomaly scores corresponding to the valid consensus result set.
[0125] Based on the statistical distribution of the candidate anomaly score set, determine its effective value range;
[0126] If the current outlier score is not within the valid range, calculate the mean of the outlier scores in the candidate outlier score set, and calculate the first deviation value by comparing it with the current outlier score.
[0127] The second deviation value is calculated by the difference between the abnormal scores and the mean score of the candidate abnormal score set;
[0128] Filter the data in the candidate anomaly score set whose second deviation value is less than the first deviation value, and construct the effective anomaly score set accordingly;
[0129] Replace the current outlier score with the mean of the outlier scores in the set of valid outlier scores.
[0130] After obtaining the outlier scores, the process also includes weighted adjustments to the outlier scores:
[0131] Obtain the confidence level of the outlier scores in the model output;
[0132] The confidence level of the outlier score is determined based on the preset confidence interval, and the outlier score is weighted and adjusted according to the level to generate a weighted outlier score.
[0133] For example, obtain the anomaly score, which currently indicates the degree of anomalousness of the transaction. and the confidence level corresponding to the current outlier score. .
[0134] Obtain a preset confidence interval to determine the confidence level. For example... ,in and For the preset confidence boundary value (e.g.) The confidence level is divided into three levels: low, medium, and high. The low confidence level corresponds to a specific weight. The weights corresponding to the medium confidence level The weight corresponding to the high confidence level .
[0135] The current outlier scores are weighted and adjusted based on the acquired data. The process includes:
[0136] Based on the current confidence level Based on a pre-defined confidence interval, determine its corresponding confidence level. Define the level determination function as follows:
[0137]
[0138] Determine the corresponding weighting coefficients based on the confidence level. .For example:
[0139]
[0140] Among them, the weighting coefficient For real numbers, it is usually set to 0. The value ranges from 0 to 2 to reflect the adjustment range of outlier scores under different confidence levels.
[0141] Use weighting coefficients For the current abnormal score Perform weighted adjustments to generate weighted outlier scores. The calculation formula is as follows:
[0142] .
[0143] Through the aforementioned technical solutions, this application achieves dual verification and dynamic optimization of abnormal scores, providing a more reliable basis for risk quantification in blockchain transaction risk assessment, thereby further improving the accuracy and robustness of system decision-making at the score output stage. By employing a valid value range verification and deviation screening mechanism based on historical consensus results, adaptive calibration of abnormal scores is achieved, reducing assessment bias caused by model fluctuations. By introducing a confidence-weighted score adjustment strategy, the reference value of the original model output is preserved while enhancing the distinguishability and credibility of scores at different confidence levels. Furthermore, the synergistic effect of the dual protection mechanisms enables the system to maintain stable risk assessment performance in complex and ever-changing transaction environments, further improving the security protection capabilities and decision reliability of the blockchain payment system.
[0144] Regarding step S5:
[0145] Processing of calculating the mean and deviation of scores:
[0146] Perform statistical analysis on the outlier scores in the candidate validation set: calculate the arithmetic mean of all outlier scores in the candidate validation set to obtain the score mean; analyze the distribution characteristics of outlier scores in the candidate validation set, including score range and central tendency.
[0147] Calculate the relative deviation between the current abnormal score and the mean score: Calculate the initial deviation based on the absolute difference between the current abnormal score and the mean score; standardize the initial deviation considering the dispersion of abnormal scores in the candidate validation set; output the standardized deviation value, which reflects the degree of abnormality of the current abnormal score relative to similar historical transactions.
[0148] Deviation detection and alternative triggering:
[0149] The calculated deviation value is compared and analyzed with the preset deviation threshold: when the deviation value is less than or equal to the deviation threshold, the current abnormal score is determined to be within a reasonable fluctuation range, and the original score is maintained unchanged; when the deviation value is greater than the deviation threshold, the current abnormal score is determined to be significantly abnormal, and the alternative processing mechanism is triggered.
[0150] Through the above technical solution, this application retains the system's agility in real-time verification of abnormal scores by calculating the mean of scores and analyzing the standardized deviation, while also improving the reliability and consistency of score evaluation, thereby effectively reducing the risk of misjudgment caused by model fluctuations or data noise.
[0151] Regarding step S6:
[0152] The process of feature extraction, normalization, and construction of an effective validation set:
[0153] The basic data required for processing is collected from relevant data sources, specifically including: obtaining all data instances of the candidate validation set, each instance containing historical transaction data, historical behavior data and corresponding anomaly scores; obtaining the complete feature set of the transaction data and behavior data that need to be evaluated; reading feature extraction rules and normalization parameter standards from the system configuration library; and obtaining feature weight coefficients and standardized benchmark values accumulated during historical data processing.
[0154] Feature optimization and effective data filtering are achieved through a multi-level processing workflow, specifically including:
[0155] Feature extraction and normalization: Structured feature extraction is performed on each data instance in the candidate validation set: key features are extracted from transaction data, including transaction amount features, transaction time features, transaction type features, transaction frequency features, and transaction correlation features; behavioral pattern features are extracted from behavioral data, including behavioral sequence features, behavioral intensity features, behavioral regularity features, behavioral diversity features, and behavioral stability features; the same feature extraction process is performed on the current transaction data and behavioral data to ensure consistency of feature dimensions.
[0156] All extracted features are normalized: the maximum-minimum normalization method is used to transform features of different dimensions into a unified numerical range; normalization parameters are calculated based on the distribution characteristics of historical data to ensure the rationality of data transformation; the effectiveness of normalized features is verified and abnormal transformation results are removed.
[0157] Mean calculation processing:
[0158] Perform feature central tendency analysis on the processed candidate validation set: calculate the transaction mean of transaction features by weighting the transaction features of all instances; calculate the behavior mean of behavior features by hierarchically aggregating the behavior features of all instances.
[0159] The mean calculation process considers the importance and reliability weights of features: high-frequency trading features are given higher calculation weights; stable behavior features are given larger aggregation weights.
[0160] Through the aforementioned technical solutions, this application achieves an integrated construction of the entire process from multi-source data acquisition to feature optimization processing, providing a high-quality data foundation and feature support for subsequent risk assessment, thereby ensuring the consistency and comparability of features from the initial stage of data processing. Multi-dimensional extraction and normalization of transaction and behavioral features improves the standardization of feature representation and computational efficiency. The mean calculation method based on a weighted strategy reflects both the differences in feature importance and enhances the representativeness of central trend measurement. Furthermore, the unified normalization framework and multi-source data integration mechanism enable features with different attributes to be processed collaboratively within the same analytical framework, improving the system's adaptability and decision reliability.
[0161] Regarding steps S7 and S8:
[0162] Deviation value calculation and processing:
[0163] Calculate the second transaction deviation value for each instance in the candidate validation set: For each instance's transaction features, calculate its relative deviation from the transaction mean, and generate the second transaction deviation value by comprehensively considering the deviations of multiple transaction features.
[0164] Calculate the second behavior bias value for each instance in the candidate validation set: For the behavior features of each instance, calculate the degree of difference between them and the behavior mean, comprehensively evaluate the differences of multiple behavior dimensions, and generate the second behavior bias value.
[0165] Calculate the first trading deviation value between the current trading data and the trading average: using the same calculation method, assess the degree of deviation of the current trading characteristics from historical trading patterns.
[0166] Calculate the first behavioral deviation value between the current behavioral data and the behavioral mean: using the same evaluation criteria, measure the degree of difference between the current behavioral characteristics and historical behavioral patterns.
[0167] Through the above technical solution, this application achieves accurate calculation of the bidirectional deviation value between the candidate validation set and the current transaction data, providing a reliable quantitative basis for the subsequent construction of the effective validation set, thereby realizing accurate identification of abnormal features. By calculating the deviation of transaction features and behavioral features in multiple dimensions, a comprehensive quantitative assessment of historical patterns and the current state is formed. The use of a unified comprehensive calculation method ensures both the consistency of the evaluation standards for transaction deviation and behavioral deviation, and guarantees the reliability and comparability of the calculation results. Furthermore, the application of a multi-feature comprehensive evaluation mechanism enables data from different dimensions to be integrated and analyzed within the same calculation framework, improving the system's adaptability to complex transaction scenarios and its calculation accuracy.
[0168] This application also describes the process for calculating the first and second transaction deviation values and the first and second line deviation values:
[0169] Get candidate validation set and the feature vector of the current transaction ;
[0170] The features are processed using the maximum-minimum normalization method;
[0171] Average transaction value calculate: ,in, Indicates the first The transaction feature vector of each instance, where N represents the number of candidate verification sets;
[0172] behavioral mean calculate: ,in, Indicates the first The behavioral feature vector of an instance;
[0173] Second trading deviation value calculate: ;
[0174] The second row shows the deviation value. calculate: ;
[0175] The first trading deviation value of the current transaction The first row is the deviation value. calculate: ,in, This represents the L2 norm of a vector.
[0176] Through the above technical solution, this application achieves precise quantitative calculation of the deviation values between transaction features and behavioral features, providing a reliable screening basis for the subsequent construction of an effective validation set, thereby completing the comparison of historical transaction patterns. By parallel calculation of transaction and behavioral deviations based on the L2 norm, a multi-dimensional difference assessment of the candidate validation set and the current transaction data is formed. The combination of maximum and minimum value normalization and vector distance measurement preserves the system's sensitivity to feature differences while improving the accuracy and consistency of deviation calculation. Furthermore, the unified normalization framework and vector space mapping mechanism enable collaborative analysis of transaction and behavioral features of different dimensions under the same measurement system, enhancing the system's computational efficiency and cross-scenario adaptability.
[0177] Regarding step S9:
[0178] Effective validation set construction process:
[0179] Data filtering is performed based on the deviation value comparison results: each data instance in the candidate validation set is traversed.
[0180] Filter data instances that simultaneously meet the following two conditions: the second transaction deviation value of the instance is less than the first transaction deviation value of the current transaction data, and the second row deviation value of the instance is less than the first row deviation value of the current row data.
[0181] Perform secondary verification on the screening results: check whether the number of data instances after screening meets the minimum effective set size requirement, and verify whether the quality indicators of the data instances after screening meet the preset standards.
[0182] The validated data instances are used to construct a valid validation set.
[0183] Through the above technical solution, this application achieves the construction of a high-quality and effective verification set based on dual-bias comparison, providing a reliable data benchmark for subsequent anomaly detection, thereby ensuring the representativeness and accuracy of the verification samples during the data screening stage. By using parallel screening conditions for transaction deviations and behavioral deviations, the correlation and comparability between the verification set and the current payment request are improved. The secondary verification mechanism, based on scale requirements and quality standards, ensures both the sufficiency of the verification data and the rigor of the set construction.
[0184] Regarding step S10:
[0185] Handling of outlier scores:
[0186] Calculate alternative values for outlier scores in the valid validation set: Calculate a reliability-weighted average of the outlier scores for all instances in the valid validation set, taking into account the time freshness and quality scores of the data instances.
[0187] Perform anomaly score replacement operation: Replace the current anomaly score with the mean of the anomaly scores in the valid validation set, and record the score difference before and after replacement and the basis for the replacement decision.
[0188] Safety assessment and handling:
[0189] The abnormal score after substitution is compared with a preset abnormal threshold: when the abnormal score is less than the abnormal threshold, the payment request is determined to be in a safe state; when the abnormal score is greater than or equal to the abnormal threshold, the payment request is determined to be at risk.
[0190] Confidence assessment of the judgment results: Based on the data quality and size of the valid validation set, calculate the reliability of the judgment results, and assess the stability of the final judgment by combining the adjustment range of the alternative processing.
[0191] Through the above technical solution, this application achieves dynamic substitution and high-confidence security decision-making for abnormal scores during payment risk assessment, providing reliable technical support for risk prevention and control in payment systems, thereby triggering accurate risk assessment in the early stages of transaction anomalies. The weighted average substitution mechanism based on an effective verification set improves the robustness and representativeness of abnormal score calculation. Accurate comparison of the substituted score with a preset threshold reduces the risk of misjudgment and missed judgment. Combining confidence assessment of data quality and scale ensures the credibility of the judgment results and enhances the system's adaptability to complex payment scenarios.
[0192] This application also describes the process of obtaining the anomaly threshold and validating its effectiveness:
[0193] Extract all historical anomaly scores from the historical verification set, and obtain a subset of historical anomaly scores that have the same consensus result as the current transaction;
[0194] The anomaly threshold is determined by statistically analyzing the distribution characteristics of a subset of historical anomaly scores.
[0195] For example, based on the current consensus result, all historical outlier scores with the same consensus result are selected from the historical verification set to form a subset of historical outlier scores. This subset is denoted as . ,in This represents the number of outlier scores in the subset, each... ( () is an abnormal score value.
[0196] For the obtained historical abnormal score subset Perform statistical distribution analysis to determine the outlier threshold. The processing includes:
[0197] Sorting process: Subset The abnormal scores are sorted in ascending order to obtain an ordered sequence. ,in It is the minimum value. It is the maximum value.
[0198] Distribution feature extraction: Based on ordered sequences, distribution features are calculated to determine anomaly thresholds. The system employs a percentile method, where percentile levels... These are preset parameters. Used to describe the value below which a specific percentage of data points in a set of data are, for example =95 indicates that the threshold corresponds to 95% of historical scores below this value.
[0199] Calculate the first Percentile as an outlier threshold The formula is as follows:
[0200]
[0201] For interpolation calculations, the position index is calculated first. :
[0202]
[0203] in It might not be an integer. Let for The integer part, for The decimal part, i.e. Then, the abnormal threshold. Calculated via linear interpolation:
[0204]
[0205] in and It is the th in the ordered sequence and the The abnormal score values.
[0206] After obtaining the anomaly threshold, the validity of the threshold is also verified.
[0207] Obtain data from the historical verification set that matches the current consensus result, and extract the anomaly scores of the data and their corresponding consensus results as the threshold verification dataset;
[0208] Each anomaly score in the threshold validation dataset is compared with the current anomaly threshold to generate the first validation result;
[0209] The first verification result is compared with the corresponding consensus result. Based on the result of the consistency comparison, the proportion of consistent verification in the threshold verification dataset is used as the threshold effectiveness rate.
[0210] If the threshold effectiveness rate is lower than the preset effectiveness rate threshold, the abnormal threshold will be recalculated.
[0211] Through the above technical solutions, this application achieves dynamic acquisition and closed-loop verification of anomaly thresholds, providing an adaptive judgment benchmark for blockchain transaction risk assessment, thereby continuously ensuring the rationality and effectiveness of threshold settings during system operation. Threshold calculation based on historical anomaly score distribution characteristics ensures the matching degree between the threshold and the current consensus result. Consistency comparison and efficiency statistics of the threshold verification dataset preserve the real-time nature of the system's threshold validity judgment while improving the reliability of the anomaly judgment benchmark. Furthermore, the recalculation trigger mechanism based on the efficiency threshold enables the system to automatically initiate an optimization process when threshold failure is detected, further enhancing the system's self-calibration capability and long-term robustness.
[0212] like Figure 3 The diagram shown illustrates the data flow of financial data processing in this invention:
[0213] To facilitate understanding of the above embodiments, a specific application scenario of the above embodiments will be used as an example for illustration below:
[0214] Scenario: A blockchain-based cryptocurrency exchange platform handles numerous transactions daily, processing multiple transactions across mainstream cryptocurrencies. To address the increasing risks of financial fraud (such as money laundering and illicit transfers), the platform integrates the financial data processing method described in this application to assess the security of each transaction in real time. This method calibrates anomaly scores using historical data, reducing false positives and improving transaction reliability.
[0215] Abnormal score range: 0 to 100, where 0 represents completely normal and 100 represents highly abnormal.
[0216] Deviation threshold: 15 (used to determine whether the current abnormal score deviates too much from the historical score average).
[0217] Anomaly threshold: 60 (used to determine whether a payment request is safe: a score below 60 is safe, and a score above or equal to 60 is risky).
[0218] Obtain transaction data, behavioral data, and historical verification sets:
[0219] Transaction data includes the transaction amount, timestamp, transaction type (e.g., transfer, exchange), and the blockchain addresses of both parties. For example, a transaction with an amount of 0.5 BTC and a timestamp of 20231001T12:00:00Z, where address A transfers funds to address B.
[0220] Behavioral data includes user login frequency (e.g., daily login count), transaction frequency (e.g., number of transactions in the past 30 days), and IP address change rate. For example, a user logs in an average of 2 times per day and has made 50 transactions in the past 30 days.
[0221] Historical verification set: This retrieves transaction records from the platform's database over the past 6 months, containing 100,000 instances. Each instance includes transaction data, behavioral data, consensus result ("verification passed" or "verification rejected"), and anomaly score (0 to 100). For example, the average anomaly score for historical instances with a consensus result of "verification passed" is 45.
[0222] Generate binary consensus results:
[0223] Transactions are verified using a Proof-of-Stake (PoS) consensus mechanism. For example, if a transaction passes a vote by a majority of validating nodes and meets all the rules (such as valid signature and sufficient balance), the output is "Verification passed"; otherwise, the output is "Verification rejected".
[0224] Construct a transaction relationship graph and obtain anomaly scores:
[0225] Graph neural network models are used to analyze transaction relationship graphs. For example, the current transaction is evaluated by the model as having an anomaly score of 70 (possibly due to unusually large transactions or sudden changes in behavior patterns).
[0226] Construct a candidate validation set:
[0227] Based on the current consensus result (assuming it is "verification passed"), all instances with a consensus result of "verification passed" are selected from the historical verification set to form a candidate verification set. For example, 50,000 instances are selected.
[0228] Calculate the deviation value and determine whether substitution is necessary:
[0229] Calculate the mean anomaly score of the candidate validation set (e.g., mean 45).
[0230] Calculate the deviation between the current outlier score (70) and the mean (45): |70-45|=25.
[0231] The deviation value 25 is greater than the deviation threshold 15, therefore the substitution process is triggered.
[0232] Feature extraction and normalization:
[0233] Features are extracted from the candidate verification set and the current data: transaction amount (normalized to 0 to 1), transaction frequency (normalized to 0 to 1), and behavior sequence (such as login frequency normalized to 0 to 1).
[0234] Calculate the transaction mean (e.g., normalized transaction amount mean 0.3) and the behavior mean (e.g., normalized behavior frequency mean 0.4).
[0235] Calculate the deviation value:
[0236] Calculate the transaction bias and behavior bias (relative to the transaction mean and behavior mean) for each instance in the candidate validation set.
[0237] Calculate the first trading deviation value (e.g., 0.6) between the current trading data and the trading average, and the first behavior deviation value (e.g., 0.7) between the current behavior data and the behavior average.
[0238] Constructing a valid validation set:
[0239] Filter the candidate validation set for instances where the second transaction deviation value is <0.6 and the second row deviation value is <0.7. For example, filter out 10,000 instances to form a valid validation set.
[0240] Replace abnormal scores and determine safety:
[0241] Calculate the mean anomaly score of the valid validation set (e.g., mean 50).
[0242] Replace the current outlier score of 70 with the mean of 50.
[0243] Comparing the score after substitution (50) with the anomaly threshold (60): 50 < 60, therefore the payment request is deemed secure.
[0244] Output result: Safe.
[0245] Example 2
[0246] like Figure 4 As shown, the present invention also provides a financial data processing system for implementing the above-described financial data processing method, comprising:
[0247] The data acquisition module 100 is used to acquire transaction data, behavioral data, and historical verification sets of both parties to the transaction. The historical verification sets include multiple consensus results and anomaly scores associated with the transaction data and behavioral data.
[0248] It is also used to construct a candidate validation set based on data from the historical validation set that are identical to the current consensus result;
[0249] The consensus verification and model processing module 200 is used to process current transaction data and behavioral data through the blockchain consensus mechanism to generate a binary consensus result.
[0250] It is also used to construct a transaction relationship graph based on current transaction data and behavioral data, and input the transaction relationship graph into a pre-trained anomaly model to obtain anomaly scores;
[0251] The deviation value judgment module 300 is used to calculate the average score of the abnormal scores in the candidate verification set, and then calculate the deviation value by comparing it with the current abnormal score.
[0252] The abnormal score replacement processing module 400 is used to perform feature extraction and normalization processing on the candidate verification set and the current transaction data and behavior data if the deviation value is greater than the preset deviation threshold, and to calculate the transaction mean of the transaction data and the behavior mean of the behavior data in the candidate verification set after processing.
[0253] It is also used to calculate the first transaction deviation value by the difference between the current transaction data and the transaction mean, and to calculate the first behavior deviation value by the difference between the current behavior data and the behavior mean;
[0254] It is also used to calculate the second transaction deviation value by the difference between the transaction data of the candidate verification set and the transaction mean, and to calculate the second behavior deviation value by the difference between the behavior data of the candidate verification set and the behavior mean;
[0255] It is also used to filter data in the candidate verification set where the second transaction deviation value is less than the first transaction deviation value and the corresponding second row deviation value is also less than the first row deviation value, and to construct a valid verification set accordingly;
[0256] The security judgment module 500 is used to replace the current abnormal score with the mean of the abnormal scores in the valid verification set, and to determine whether the payment request is secure based on the comparison result between the abnormal score after replacement and the preset abnormal threshold.
[0257] Example 3
[0258] This embodiment also provides a computer-readable storage medium storing a program that, when executed by a processor, implements a financial data processing method.
[0259] The storage medium proposed in this embodiment belongs to the same inventive concept as the financial data processing method proposed in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0260] From the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention essentially contributes to the prior art.
[0261] Some of these components may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0262] The technical scope of this invention is not limited to the content described above. Those skilled in the art can make various modifications and variations to the above embodiments without departing from the technical concept of this invention, and all such modifications and variations should fall within the protection scope of this invention.
Claims
1. A financial data processing method, characterized in that, Used to assess the risks of blockchain transactions, including: Obtain transaction data, behavioral data, and historical verification sets from both parties to the transaction. The historical verification sets include multiple consensus results and anomaly scores associated with the transaction data and behavioral data. Construct a candidate validation set based on data from the historical validation set that are identical to the current consensus result; The current transaction data and behavioral data are processed through the blockchain consensus mechanism to generate a binary consensus result; A transaction relationship graph is constructed based on the current transaction data and behavioral data, and the transaction relationship graph is input into a pre-trained anomaly model to obtain anomaly scores. Calculate the mean score of the abnormal scores in the candidate verification set, and then calculate the deviation value by comparing it with the current abnormal score. If the deviation value is greater than the preset deviation threshold, then perform feature extraction and normalization processing on the candidate verification set and the current transaction data and behavior data, and calculate the mean transaction value of the transaction data and the mean behavior value of the behavior data in the candidate verification set after processing. The first transaction deviation value is calculated by the difference between the current transaction data and the transaction average, and the first behavior deviation value is calculated by the difference between the current behavior data and the behavior average. The second transaction deviation value is calculated by the difference between the transaction data of the candidate validation set and the transaction mean, and the second behavior deviation value is calculated by the difference between the behavior data of the candidate validation set and the behavior mean. Filter the candidate verification set for data where the second transaction deviation value is less than the first transaction deviation value and the corresponding second row deviation value is also less than the first row deviation value, and construct a valid verification set accordingly; The current abnormal score is replaced with the mean of the abnormal scores in the valid verification set, and the security of the payment request is determined based on the comparison between the replaced abnormal score and the preset abnormal threshold.
2. The method according to claim 1, characterized in that, The process of constructing the anomaly model includes: Obtain a training dataset of historical transaction relationship graphs and their anomaly scores, and divide the training dataset into a model training subset and a model validation subset according to a preset ratio; The transaction relationship graph data in the training subset is used as input data to the graph neural network model, and the corresponding normalized anomaly score data is used as the target output data. The internal parameters of the graph neural network model are iteratively adjusted using an error backpropagation algorithm or a gradient boosting algorithm, with the goal of reducing the loss function value between the model's predicted output data and the target output data during training iterations. After each training iteration, the model in the current state is evaluated using the validation subset, and its prediction accuracy and mean absolute error are calculated. When the accuracy no longer improves or the mean absolute error no longer decreases, the training process is stopped, and the trained model is output as an abnormal model. The average confidence level of the anomaly model within the processing calibration time window is periodically obtained; If the average confidence level is lower than a preset threshold, the model will be updated or retrained.
3. The method according to claim 1, characterized in that, After obtaining the abnormal scores, the validity of the scores is also verified, including: Obtain the consensus result corresponding to the current anomaly score, the set of valid historical anomaly scores generated by the anomaly model, and the set of historical consensus results corresponding to the set of historical anomaly scores; A valid consensus result set is constructed based on the data in the historical consensus result set that are the same as the current consensus result, and a candidate anomaly score set is constructed based on the historical anomaly scores corresponding to the valid consensus result set. Based on the statistical distribution of the candidate anomaly score set, determine its effective value range; If the current outlier score is not within the valid range, calculate the mean of the outlier scores in the candidate outlier score set, and calculate the first deviation value by comparing it with the current outlier score. The second deviation value is calculated by the difference between the abnormal scores and the mean score of the candidate abnormal score set; Filter the data in the candidate anomaly score set whose second deviation value is less than the first deviation value, and construct the effective anomaly score set accordingly; Replace the current outlier score with the mean of the outlier scores in the set of valid outlier scores.
4. The method according to claim 3, characterized in that, After obtaining the abnormal scores, the process also includes a weighted adjustment of the abnormal scores, specifically: Obtain the confidence level of the outlier scores in the model output; The confidence level of the abnormal score is determined based on a preset confidence interval, and the abnormal score is weighted and adjusted according to the confidence level to generate a weighted abnormal score.
5. The method according to claim 1, characterized in that, The calculation process for the first transaction deviation value, the second transaction deviation value, the first line deviation value, and the second line deviation value includes: Get candidate validation set and the feature vector of the current transaction ; The feature vectors are processed using the min-max normalization method; Average transaction value calculate: ,in, Indicates the first The transaction feature vector of each instance, where N represents the number of data in the candidate validation set; behavioral mean calculate: ,in, Indicates the first The behavioral feature vector of an instance; Second trading deviation value calculate: ; The second row shows the deviation value. calculate: ; The first trading deviation value of the current transaction The first row is the deviation value. calculate: ,in, This represents the L2 norm of a vector.
6. The method according to claim 1, characterized in that, The process of obtaining the abnormal threshold includes: Extract all historical anomaly scores from the historical verification set, and obtain a subset of historical anomaly scores that have the same consensus result as the current transaction; The anomaly threshold is determined by statistically analyzing the distribution characteristics of the historical anomaly score subset.
7. The method according to claim 6, characterized in that, The process of determining the anomaly threshold by statistically analyzing the distribution characteristics of the aforementioned historical anomaly score subset includes: Based on the current consensus results, historical anomaly scores with the same consensus results are selected from the historical verification set to form a subset of historical anomaly scores. ,in, Indicates the number of subsets; subset The abnormal scores are sorted in ascending order to obtain an ordered sequence. ,in, It is the minimum value. It is the maximum value; Based on ordered sequences, percentiles are used. Calculate the abnormal threshold The formula is as follows: A value used to describe the value below which a specific percentage of data points in a set of data are: ; For interpolation calculations, the position index is calculated first. : ; make for The integer part, for The decimal part, i.e. ; Abnormal threshold Calculated via linear interpolation: ,in and It is the th in the ordered sequence and the The abnormal score values.
8. The method according to claim 6, characterized in that, After obtaining the anomaly threshold, the validity of the threshold is also verified. Each anomaly score in the candidate verification set is compared with the current anomaly threshold to generate a first verification result; The first verification result is compared with the corresponding consensus result. Based on the result of the consistency comparison, the proportion of consistent verifications in the candidate verification set is used as the threshold efficiency. If the threshold effectiveness rate is lower than the preset effectiveness rate threshold, the abnormal threshold will be recalculated.
9. A financial data processing system, characterized in that, A method for implementing the financial data processing method as described in any one of claims 1-8 includes: The data acquisition module is used to acquire transaction data, behavioral data, and historical verification sets of both parties to the transaction. The historical verification sets include multiple consensus results and anomaly scores associated with the transaction data and behavioral data. It is also used to construct a candidate validation set based on data from the historical validation set that are identical to the current consensus result; The consensus verification and model processing module is used to process current transaction data and behavioral data through the blockchain consensus mechanism to generate a binary consensus result. It is also used to construct a transaction relationship graph based on current transaction data and behavioral data, and input the transaction relationship graph into a pre-trained anomaly model to obtain anomaly scores; The deviation value judgment module is used to calculate the average score of the abnormal scores in the candidate verification set, and then calculate the deviation value by comparing it with the current abnormal score. The abnormal score substitution processing module is used to perform feature extraction and normalization processing on the candidate verification set and the current transaction data and behavior data if the deviation value is greater than the preset deviation threshold, and to calculate the transaction mean of the transaction data and the behavior mean of the behavior data in the candidate verification set after processing. It is also used to calculate the first transaction deviation value by the difference between the current transaction data and the transaction mean, and to calculate the first behavior deviation value by the difference between the current behavior data and the behavior mean; It is also used to calculate the second transaction deviation value by the difference between the transaction data of the candidate verification set and the transaction mean, and to calculate the second behavior deviation value by the difference between the behavior data of the candidate verification set and the behavior mean; It is also used to filter data in the candidate verification set where the second transaction deviation value is less than the first transaction deviation value and the corresponding second row deviation value is also less than the first row deviation value, and to construct a valid verification set accordingly; The security judgment module is used to replace the current abnormal score with the mean of the abnormal scores in the valid verification set, and to determine whether the payment request is secure based on the comparison between the abnormal score after replacement and the preset abnormal threshold.
10. A machine-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the financial data processing method as described in any one of claims 1-8.