A method and system for processing trusted mobile payment data based on blockchain
By adopting a trusted data processing method based on blockchain in the mobile payment system, using an isolated forest model to detect abnormal transactions and make credibility judgments, the shortcomings of existing mobile payment systems in terms of security and credibility are solved, and more efficient risk identification and payment security are achieved.
Patent Information
- Application Number
- CN202411477915.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2044-10-22
AI Technical Summary
While ensuring transaction convenience, existing mobile payment systems are difficult to effectively improve the security and transaction credibility of payment systems, especially in POS transactions, there is a risk of bank cards being stolen and fraudulent transactions.
The blockchain-based mobile payment trusted data processing method is adopted, and the historical POS transaction data of the current payment request is obtained, the pre-configured isolated forest model is used to detect abnormal transaction data, and the editing distance is calculated to make the first round of credibility judgment. Finally, the banking system performs transaction processing operations based on the judgment results.
It realizes accurate detection of abnormal transaction behaviors, ensures efficient risk identification during the payment process, enhances the security of the payment system and transaction credibility, reduces the probability of misjudgment and misjudgment, and optimizes the payment experience and transaction success rate.
Smart Images

Figure CN119477309B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of financial payment, and more specifically, to a method and system for processing trusted mobile payment data based on blockchain. Background Art
[0002] In modern payment systems, mobile payment methods are gradually becoming the mainstream, and users make payments through methods such as QR codes and NFC. However, with the improvement of the convenience of payment methods, payment security issues have become increasingly severe. Especially in POS machine transactions, risks such as bank card skimming and fraudulent transactions are increasing continuously. Therefore, how to effectively improve the security and transaction credibility of the payment system while ensuring transaction convenience has become an important research direction in the current financial technology field.
[0003] Traditional payment security systems usually rely on password or signature verification to judge the legality and risk of transactions. However, these methods have obvious defects. For example, contactless payment may lead to the risk of users' cards being skimmed, and signature-based verification methods are also difficult to effectively identify potential fraud behaviors. In addition, the detection of abnormal transactions in POS transactions usually relies on simple rule judgments and lacks sufficient intelligent analysis capabilities, resulting in frequent misjudgments or missed judgments, which in turn affects the operation efficiency and user experience of the payment system. Summary of the Invention
[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a method and system for processing trusted mobile payment data based on blockchain.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A method for processing trusted mobile payment data based on blockchain, the blockchain includes a first blockchain for storing first historical POS transaction data, and the method includes:
[0007] Obtain a current payment request initiated by a user through a mobile payment method on a target POS device at the current moment, and retrieve first historical POS transaction data from the first blockchain according to the current payment request; the current payment request includes information about the target bank card bound to the user's mobile payment method and current POS transaction data;
[0008] Use a pre-configured first isolation forest model to obtain first historical abnormal POS transaction data about the target bank card from the first historical POS transaction data; the first historical POS transaction data includes multiple historical POS transaction records about the target bank card; the first historical abnormal POS transaction data includes at least one historical abnormal POS transaction record about the target bank card;
[0009] Calculate the first edit distance between the current POS transaction data and the first abnormal POS transaction data, and perform the first round of credibility judgment on the current POS transaction data according to the size of the first edit distance to obtain the first judgment result; the first judgment result includes one of trustworthy data and fraudulent data;
[0010] The banking system associated with the target bank card performs a transaction processing operation on the current payment request according to the trustworthy data or the fraudulent data, and uploads the trustworthy data or the fraudulent data to the first blockchain for storage; the transaction processing operation includes one of transaction approval or rejection.
[0011] Furthermore, the obtaining of the first historical abnormal POS transaction data about the target bank card from the first historical POS transaction data includes:
[0012] Input the first historical POS transaction data into a pre-configured first isolation forest model to obtain the anomaly score for each historical POS transaction record about the target bank card;
[0013] Compare the anomaly score with a preset anomaly score threshold. If the anomaly score is greater than or equal to the anomaly score threshold, mark the corresponding historical POS transaction record about the target bank card as a historical abnormal POS transaction record;
[0014] Among them, the obtaining logic of the anomaly score is as follows:
[0015] Extract the path lengths of each isolation tree in the first isolation forest model, and calculate the average value of the path lengths of all isolation trees to obtain the average path length;
[0016] Calculate the anomaly score for each historical POS transaction record about the target bank card according to the average path length;
[0017] Count all the historical abnormal POS transaction records about the target bank card to obtain the first historical abnormal POS transaction data in the form of a set.
[0018] Furthermore, the generation process of the pre-configured first isolation forest model is as follows:
[0019] Initialize the isolation forest model and determine each model parameter of the isolation forest model;
[0020] According to the initialized isolation forest model with the determined model parameters, randomly select some samples from the first historical POS transaction data as the training data set;
[0021] Introduce a preset feature selection mechanism to randomly select a target transaction feature from the training dataset as the splitting basis, and within the value range of the selected target transaction feature, determine to select a splitting point;
[0022] Perform binary partitioning based on the feature value of the target transaction feature and the splitting point to obtain two child nodes, namely the left child node and the right child node;
[0023] Repeat the above steps for each child node until the preset stopping condition is met, at which point stop further partitioning of the child nodes to obtain a single isolated tree;
[0024] Among them, the preset stopping condition includes any one of only one sample remaining in the node or reaching the preset maximum splitting depth;
[0025] Repeat the above process of constructing a single isolated tree to generate m isolated trees, and combine the m isolated trees to obtain the first isolated forest model, where m is an integer greater than zero.
[0026] Furthermore, the introducing a preset feature selection mechanism to randomly select a target transaction feature from the training dataset as the splitting basis includes:
[0027] Obtain all historical POS transaction records of the target bank card in the training dataset, and extract multiple transaction features from the historical POS transaction records;
[0028] Under each transaction feature, use the K-means algorithm to perform data clustering on all historical POS transaction records of the target bank card to obtain multiple data clusters under each transaction feature;
[0029] Count the number of multiple data clusters under each transaction feature, and compare the number of data clusters with the preset quantity threshold; if the number of data clusters is less than or equal to the quantity threshold, mark the corresponding transaction feature as the target transaction feature; if the number of data clusters is greater than the quantity threshold, mark the corresponding transaction feature as a non-target transaction feature;
[0030] Count all target transaction features to form a target transaction feature set, and use any one target transaction feature in the target transaction feature set as the splitting basis.
[0031] Furthermore, the performing the first-round credibility judgment on the current POS transaction data includes:
[0032] Extract each historical abnormal POS transaction record of the target bank card in the first abnormal POS transaction data;
[0033] Use the hash algorithm to perform hash processing on each historical abnormal POS transaction record of the target bank card to obtain multiple first strings;
[0034] Perform a hashing process on the current POS transaction data using a hashing algorithm to obtain a second string;
[0035] Calculate the edit distance between each first string and the second string to obtain multiple first edit distances;
[0036] Sort the multiple first edit distances in ascending order of value, and compare the first edit distance ranked first with a preset first edit distance threshold;
[0037] If the first edit distance ranked first is less than or equal to the first edit distance threshold, mark the current POS transaction data as fraudulent data, and use the fraudulent data as the first judgment result for the first round of credibility judgment;
[0038] If the first edit distance ranked first is greater than the first edit distance threshold, mark the current POS transaction data as trustworthy data, and use the trustworthy data as the first judgment result for the first round of credibility judgment.
[0039] Further, after performing the first round of credibility judgment on the current POS transaction data, it includes:
[0040] When the first judgment result is trustworthy data, call the second blockchain containing a preset smart contract; the preset smart contract contains standard verification data;
[0041] Among them, the standard verification data includes, but is not limited to, one of the pre-stored correct password, correct fingerprint, and correct face image;
[0042] Use the second blockchain containing a preset smart contract to perform compliance verification on the trustworthy data to obtain a compliance verification result; the compliance verification result includes one of compliance or non-compliance.
[0043] Further, after obtaining the first historical abnormal POS transaction data regarding the user's target bank card, it includes:
[0044] Retrieve the pre-configured second isolation forest model;
[0045] Use the pre-configured second isolation forest model to obtain second historical abnormal POS transaction data from the second historical POS transaction data; the second historical abnormal POS transaction data includes at least one historical abnormal POS transaction record of the target bank card on the target POS device;
[0046] Perform a second round of credibility judgment on the current POS transaction data according to the second historical abnormal POS transaction data to obtain a second judgment result; the second judgment result includes one of trustworthy data and fraudulent data.
[0047] Further, the secondary round of credibility judgment on the current POS transaction data includes:
[0048] Extract each historical abnormal POS transaction record of the target bank card on the target POS device from the second historical abnormal POS transaction data;
[0049] Use the hash algorithm to perform hash processing on each historical abnormal POS transaction record of the target bank card on the target POS device to obtain multiple third strings;
[0050] Calculate the edit distance between each third string and the second string to obtain multiple second edit distances;
[0051] Sort the multiple second edit distances in ascending order of value, and compare the second edit distance ranked first with a preset second edit distance threshold;
[0052] If the second edit distance ranked first is less than or equal to the second edit distance threshold, mark the current POS transaction data as fraudulent data, and use the fraudulent data as the second judgment result of the secondary round of credibility judgment;
[0053] If the second edit distance ranked first is greater than the second edit distance threshold, mark the current POS transaction data as trustworthy data, and use the trustworthy data as the second judgment result of the secondary round of credibility judgment.
[0054] A mobile payment trusted data processing system based on blockchain, including:
[0055] A data acquisition module, configured to acquire a current payment request initiated by a user through a mobile payment method on a target POS device at the current moment, and retrieve first historical POS transaction data from the first blockchain according to the current payment request; the current payment request includes a target bank card bound to the user's mobile payment method and current POS transaction data;
[0056] An anomaly detection module, configured to obtain first historical abnormal POS transaction data of the target bank card from the first historical POS transaction data by using a pre-configured first isolation forest model; the first historical POS transaction data includes multiple historical POS transaction records of the target bank card; the first historical abnormal POS transaction data includes at least one historical abnormal POS transaction record of the target bank card;
[0057] A trusted verification module, configured to calculate the first edit distance between the current POS transaction data and the first abnormal POS transaction data, and perform a first round of credibility judgment on the current POS transaction data according to the size of the first edit distance to obtain a first judgment result; the first judgment result includes one of trustworthy data and fraudulent data;
[0058] A transaction processing module is used for a bank system associated with a target bank card to perform a transaction processing operation on a current payment request according to trusted data or fraud data, and upload the trusted data or fraud data to a first blockchain for storage; the transaction processing operation includes either transaction approval or rejection.
[0059] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0060] The present application discloses a method and system for processing trusted data of mobile payment based on blockchain, including: retrieving first historical POS transaction data from a first blockchain according to a current payment request; obtaining first historical abnormal POS transaction data about a target bank card from the first historical POS transaction data by using a pre-configured first isolation forest model; calculating a first edit distance between the current POS transaction data and the first abnormal POS transaction data, and performing a first-round credibility judgment on the current POS transaction data according to the size of the first edit distance; performing a transaction processing operation on the current payment request according to trusted data or fraud data; based on the above features, the present invention realizes precise detection of abnormal transaction behaviors by adopting an isolation forest model, ensures efficient risk identification during the payment process, and enhances the security of the payment system; the system not only based on the historical transaction data of the user's bank card, but also combines the transaction characteristics of specific POS devices, adopts a multi-round credibility judgment mechanism, improves the accuracy of judgment, and effectively reduces the probability of misjudgment and missed judgment; in the initial stage of system operation, even in the case of insufficient data, the present invention ensures the stable operation of the system through dynamic adjustment and multi-layer judgment strategies, and further optimizes the model performance with the continuous accumulation of transaction data; while ensuring the convenience of transactions, it effectively improves the security and transaction credibility of the payment system, reduces interference during the user's payment process, optimizes the payment experience, and improves the transaction success rate and user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a flowchart of a method for processing trusted data of mobile payment based on blockchain provided by the present invention;
[0062] Figure 2 It is a schematic diagram of the module structure of a system for processing trusted data of mobile payment based on blockchain provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0063] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0064] Example 1
[0065] Please refer to Figure 1 As shown, this embodiment discloses a method for processing trusted data of mobile payment based on blockchain. The blockchain includes a first blockchain for storing first historical POS transaction data. The method includes:
[0066] S101: Obtain the current payment request initiated by the user through the mobile payment method on the target POS device at the current moment, and retrieve the first historical POS transaction data from the first blockchain according to the current payment request; the current payment request includes the target bank card bound to the user's mobile payment method and the current POS transaction data;
[0067] S102: Use the pre-configured first isolation forest model to obtain the first historical abnormal POS transaction data of the target bank card from the first historical POS transaction data; the first historical POS transaction data includes multiple historical POS transaction records of the target bank card; the first historical abnormal POS transaction data includes at least one historical abnormal POS transaction record of the target bank card;
[0068] S103: Calculate the first edit distance between the current POS transaction data and the first abnormal POS transaction data, and perform the first round of credibility judgment on the current POS transaction data according to the size of the first edit distance to obtain the first judgment result; the first judgment result includes one of trusted data and fraud data;
[0069] S104: The bank system associated with the target bank card performs a transaction processing operation on the current payment request according to the trusted data or fraud data, and uploads the trusted data or fraud data to the first blockchain for storage; the transaction processing operation includes one of transaction passing or rejection;
[0070] It should be noted that: the current payment request initiated by the user through the mobile payment method on the target POS device at the current moment. Among them, the mobile payment method may include, but is not limited to, one of payment methods such as QR code or NFC, etc. However, no matter which mobile payment method is used, only the bank card (including debit card and credit card, etc.) associated with the mobile payment method adopted by the current payment request will be used as the target bank card; for example, if the user's mobile payment method is associated with multiple bank cards, namely Card 1 and Card 2, etc., but the current payment request uses Card 1, then Card 1 will be used as the target bank card;
[0071] Among them, multiple historical POS transaction records of the user regarding the use of the target bank card are stored in the first historical POS transaction data. Each historical POS transaction record records transaction characteristics in multiple dimensions, including but not limited to user ID, transaction amount, transaction time, transaction location, and the unique identifier of the target POS device (such as a machine code in digital form), etc.;
[0072] Therefore, it can be understood that when retrieving the first historical POS transaction data from the first blockchain according to the current payment request, the first historical POS transaction data regarding the target bank card can be retrieved from the first blockchain through the card number of the target bank card;
[0073] In implementation, obtaining the first historical abnormal POS transaction data regarding the target bank card from the first historical POS transaction data includes:
[0074] Inputting the first historical POS transaction data into a pre-configured first isolation forest model to obtain the anomaly score for each historical POS transaction record regarding the target bank card;
[0075] Specifically, the generation process of the pre-configured first isolation forest model is as follows:
[0076] Initialize the isolation forest model and determine each model parameter of the isolation forest model;
[0077] For example, n_estimators: 100 (number of isolation trees); max_samples: 256 (number of samples per tree); contamination: 0.05 (it is expected that 5% of the samples are abnormal); random_state: 42 (to ensure the consistency of the results);
[0078] According to the initialized isolation forest model with the determined model parameters, randomly extract some samples from the first historical POS transaction data as the training data set;
[0079] Introduce a preset feature selection mechanism to randomly select a target transaction feature from the training data set as the splitting basis, and within the value range of the selected target transaction feature, determine to select a splitting point;
[0080] Specifically, introducing a preset feature selection mechanism to randomly select a target transaction feature from the training data set as the splitting basis includes:
[0081] Obtain all historical POS transaction records regarding the target bank card in the training data set, and extract multiple transaction features in the historical POS transaction records;
[0082] Under each transaction feature, the K-means algorithm is used to cluster the data of all historical POS transaction records regarding the target bank card, and multiple data clusters are obtained under each transaction feature;
[0083] It should be understood that when clustering the historical POS transaction records according to each transaction feature, if more data clusters are obtained under this transaction feature, it means that this transaction feature is difficult to quickly distinguish abnormal POS transaction records. On the contrary, the fewer the data clusters, the faster this transaction feature can distinguish abnormal POS transaction records;
[0084] Exemplarily, assume that the POS transaction amount of a certain user's bank card is usually below 100. If two data clusters of POS transaction amounts are divided by the K-means algorithm, namely the data cluster above 100 and the data cluster below 100. Therefore, transactions can be quickly divided by the POS transaction amount. However, if the POS transaction amount of this user's bank card is usually between 100 and 1000, this will increase the number of data clusters under the POS transaction amount. Therefore, if you want to distinguish abnormal transaction data, multiple rounds of analysis are still required, which greatly reduces the processing speed of the credibility verification;
[0085] Count the number of multiple data clusters under each transaction feature, and compare the number of data clusters with a preset number threshold; if the number of data clusters is less than or equal to the number threshold, mark the corresponding transaction feature as the target transaction feature; if the number of data clusters is greater than the number threshold, mark the corresponding transaction feature as the non-target transaction feature;
[0086] Count all the target transaction features to form a target transaction feature set, and use any one of the target transaction features in the target transaction feature set as the segmentation basis;
[0087] Among them, it is artificially set by technicians according to experimental data or experience. For example, the target transaction feature is the transaction amount. If the transaction amount is between 80 and 5000 yuan, 150 yuan is selected as the segmentation point;
[0088] Perform binary partitioning according to the feature value of the target transaction feature and the segmentation point to obtain two child nodes, namely the left child node and the right child node;
[0089] For example, the left child node is the sample with the feature value of the transaction amount less than 150 yuan; the right child node is the sample with the feature value of the transaction amount greater than or equal to 150 yuan;
[0090] Repeat the above steps for each child node until the preset stop condition is met, and then stop the continuous partitioning of the child nodes to obtain a single isolated tree;
[0091] Among them, the preset stopping condition includes any one of only one sample remaining in the node or reaching the preset maximum splitting depth;
[0092] Repeat the above process of constructing a single isolated tree to generate m isolated trees, and combine the m isolated trees to obtain the first isolated forest model, where m is an integer greater than zero;
[0093] Compare the anomaly score with the preset anomaly score threshold. If the anomaly score is greater than or equal to the anomaly score threshold, mark the historical POS transaction record corresponding to the target bank card as the historical abnormal POS transaction record of the target bank card;
[0094] Among them, the acquisition logic of the anomaly score is as follows:
[0095] Extract the path lengths of each isolated tree in the first isolated forest model, and calculate the average value of the path lengths of all isolated trees to obtain the average path length;
[0096] Calculate the anomaly score of each historical POS transaction record of the target bank card according to the average path length;
[0097] Among them, the calculation formula of the anomaly score is In the formula: S(x) is the anomaly score, E(h(x)) is the average path length, c(n) is a normalization constant related to the number n of historical POS transaction records, which is a correction term based on the harmonic number, so that the path lengths of the isolated forest under different sample numbers are consistent;
[0098] Count all the historical abnormal POS transaction records of the target bank card to obtain the first historical abnormal POS transaction data in the form of a set;
[0099] It should be understood that: The Isolation Forest Algorithm is an unsupervised learning algorithm for anomaly detection. It isolates abnormal data points from normal data points by constructing decision trees; the core idea of the isolation forest is that abnormal points are easier to be isolated than normal points, that is, under fewer splitting operations, abnormal points can be distinguished; therefore, applying it to POS transaction verification can quickly complete the credibility evaluation of each POS transaction of users. Compared with traditional methods, it can ensure the security of POS transactions while effectively guaranteeing the speed of credibility verification of POS transactions;
[0100] In implementation, the first-round credibility judgment on the current POS transaction data includes:
[0101] Extract each historical abnormal POS transaction record regarding the target bank card from the first abnormal POS transaction data;
[0102] Use the hash algorithm to perform hash processing on each historical abnormal POS transaction record regarding the target bank card to obtain multiple first strings;
[0103] Use the hash algorithm to perform hash processing on the current POS transaction data to obtain a second string;
[0104] Calculate the edit distance between each first string and the second string to obtain multiple first edit distances;
[0105] Sort the multiple first edit distances in ascending order of value, and compare the first edit distance ranked first with a preset first edit distance threshold;
[0106] It should be noted that: the hash algorithm is specifically one of the algorithms such as MD5 or SHA256, etc. The first edit distance, also known as the Levenshtein distance, is used to measure the difference degree between two strings, and it represents the minimum number of edit operations required to convert one string into another string; when the first edit distance is smaller, it means the two hash strings are more similar; if the distance is 0, it means the two hash strings are exactly the same;
[0107] If the first edit distance ranked first is less than or equal to the first edit distance threshold, mark the current POS transaction data as fraudulent data, and use the fraudulent data as the first judgment result for the first round of credibility judgment;
[0108] If the first edit distance ranked first is greater than the first edit distance threshold, mark the current POS transaction data as trustworthy data, and use the trustworthy data as the first judgment result for the first round of credibility judgment;
[0109] In some specific embodiments, after performing the first round of credibility judgment on the current POS transaction data, it includes:
[0110] When the first judgment result is trustworthy data, call the second blockchain containing the preset smart contract; the preset smart contract contains standard verification data;
[0111] Among them, the standard verification data includes but is not limited to one of the pre-stored correct password, correct fingerprint, and correct face image;
[0112] Use the second blockchain containing the preset smart contract to perform compliance verification on the trustworthy data to obtain a compliance verification result; the compliance verification result includes one of compliance or non-compliance;
[0113] Specifically, the compliance verification of the trusted data using the second blockchain including a preset smart contract includes:
[0114] Extract the actual verification data in the current payment request according to the trusted data, and the actual verification data includes but is not limited to one of the input password, input fingerprint, and input face image;
[0115] Use the smart contract containing the standard verification data to compare the actual verification data with the standard verification data;
[0116] If the actual verification data is exactly the same as the standard verification data, it is determined that the trusted data is compliant;
[0117] If the actual verification data is not exactly the same as the standard verification data, it is determined that the trusted data is non-compliant;
[0118] It should be noted that: exactly the same means that the actual verification data and the standard verification data are completely the same. For example, if the actual verification data is the input password (such as the PIN password), then the correct password stored in the smart contract of the second blockchain is retrieved according to the target bank card, and it is compared whether the characters and positions of the correct password and the input password are exactly the same. If they are exactly the same, it means that the actual verification data and the standard verification data are completely the same. On the contrary, it means that the actual verification data and the standard verification data are not exactly the same;
[0119] It can be understood that: in order to promote consumption and improve the transaction success rate, existing merchants will let users set up passwordless payment or signature verification (that is, credit card transactions may only require the cardholder's signature to complete the transaction). Although this method provides convenience, it also increases the risk of the bank card being stolen and swiped. Therefore, the present invention limits users to perform identity authentication in the initial stage, which can effectively guarantee the credibility of the initial POS transaction data, and then is beneficial to the payment security in the subsequent passwordless payment or signature verification scenarios and improves the effective analysis data basis;
[0120] It also needs to be noted that: in the initial stage of the system input, or in the early stage of user use, since the historical POS transaction records stored in the first blockchain are relatively few, and for the isolation forest model, relatively few historical POS transaction records mean relatively few training data, which will cause misjudgment or missed judgment in the initial stage of the present invention. With the continuous enrichment of the historical POS transaction records, this problem can be effectively solved. However, if no certain automatic intervention is carried out in the early stage, it will cause a large detection deviation in the subsequent isolation forest model;
[0121] Therefore, by adapting the second blockchain including the preset smart contract in the initial stage, the normal and correct operation of the system in the initial stage can be effectively guaranteed. At the same time, it is beneficial to ensure the accuracy of the historical POS transaction records uploaded to the first blockchain for storage;
[0122] In some specific embodiments, after obtaining the first historical abnormal POS transaction data regarding the user's target bank card, it includes:
[0123] Retrieve the pre-configured second isolation forest model;
[0124] Use the pre-configured second isolation forest model to obtain the second historical abnormal POS transaction data from the second historical POS transaction data; at least one historical abnormal POS transaction record regarding the target bank card on the target POS device is included in the second historical abnormal POS transaction data;
[0125] Among them, the second historical abnormal POS transaction data, like the first historical abnormal POS transaction data, is pre-stored in the first blockchain in advance. The difference is that the second historical abnormal POS transaction data is multiple historical transaction records regarding the target bank card on the target POS device;
[0126] In addition, the training and processing logic of the pre-configured second isolation forest model is the same as that of the above-mentioned first isolation forest model. For details, refer to the relevant content of the above-mentioned first isolation forest model, and no more elaboration will be made here;
[0127] It should be noted that: the target POS device refers to the POS device where the current payment request is initiated. In other words, it refers to using the POS device where the target bank card is used at the current moment as the target POS device;
[0128] Exemplarily, continuing the above assumption, Card 1 is the target bank card. Assume there are multiple POS devices, namely POS device A and POS device B, etc. Among them, POS device A is the POS device where the target bank card is used at the current moment. Then, POS device A is used as the target POS device. Further, when obtaining the second historical abnormal POS transaction data, multiple historical transaction records of Card 1 on POS device A are retrieved;
[0129] It should be understood that by retrieving the second historical abnormal POS transaction data of the target bank card on the target POS device, that is, multiple historical transaction records of the target bank card on the target POS device (i.e., a specific POS device), the behavioral characteristics of the target bank card on the target POS device (i.e., a specific POS device) can be captured. Subsequently, by combining the similarity between the first historical abnormal POS transaction data and the current POS transaction data, and the similarity between the second historical abnormal POS transaction data and the current POS transaction data, the accuracy of the credibility judgment for the current POS transaction data can be effectively improved. Compared with solely using the similarity between the first historical abnormal POS transaction data and the current POS transaction data for credibility judgment, the accuracy of the credibility judgment is further improved, the probability of misjudging or missing fraudulent data is reduced, the security of each POS transaction implemented by the user is greatly enhanced, and the possibility of the user's bank card being stolen and swiped is avoided;
[0130] Perform a secondary round of credibility judgment on the current POS transaction data according to the second historical abnormal POS transaction data to obtain a second judgment result; the second judgment result includes one of credible data and fraudulent data;
[0131] In some other specific embodiments, the performing a secondary round of credibility judgment on the current POS transaction data includes:
[0132] Extract each historical abnormal POS transaction record of the target bank card on the target POS device from the second historical abnormal POS transaction data;
[0133] Use the hash algorithm to perform hash processing on each historical abnormal POS transaction record of the target bank card on the target POS device to obtain multiple third strings;
[0134] Calculate the edit distance between each third string and the second string to obtain multiple second edit distances;
[0135] Sort the multiple second edit distances in ascending order of value, and compare the second edit distance ranked first with a preset second edit distance threshold;
[0136] If the second edit distance ranked first is less than or equal to the second edit distance threshold, mark the current POS transaction data as fraudulent data, and use the fraudulent data as the second judgment result of the secondary round of credibility judgment;
[0137] If the second edit distance ranked first is greater than the second edit distance threshold, mark the current POS transaction data as credible data, and use the credible data as the second judgment result of the secondary round of credibility judgment;
[0138] In some other specific embodiments, the content of step S104 is only executed after obtaining the second judgment result, and then the operation of passing or rejecting the transaction for the current payment request is completed;
[0139] By combining the historical abnormal POS transaction records of the target bank card and the historical abnormal POS transaction records of the target bank card on a specific POS device, the present invention can accurately and effectively capture fraudulent or risky POS transaction behaviors, and thus maximize the protection of the payment security of users or merchants and improve the payment credibility.
[0140] Embodiment 2
[0141] Please refer to Figure 2 As shown, based on the same inventive concept, this embodiment discloses and provides a mobile payment trusted data processing system based on a blockchain. For the content not detailed in this embodiment, please refer to the description of the relevant part in Embodiment 1. The system includes:
[0142] A data acquisition module 210, configured to acquire a current payment request initiated by a user through a mobile payment method on a target POS device at the current moment, and retrieve first historical POS transaction data from a first blockchain according to the current payment request; the current payment request includes a target bank card bound to the user's mobile payment method and current POS transaction data;
[0143] An anomaly detection module 220, configured to obtain first historical abnormal POS transaction data about the target bank card from the first historical POS transaction data by using a pre-configured first isolation forest model; the first historical POS transaction data includes multiple historical POS transaction records about the target bank card; the first historical abnormal POS transaction data includes at least one historical abnormal POS transaction record about the target bank card;
[0144] A trusted verification module 230, configured to calculate a first edit distance between the current POS transaction data and the first abnormal POS transaction data, and perform a first-round credibility judgment on the current POS transaction data according to the magnitude of the first edit distance, so as to obtain a first judgment result; the first judgment result includes one of trusted data and fraudulent data;
[0145] A transaction processing module 240, configured to, by a banking system associated with the target bank card, perform a transaction processing operation on the current payment request according to the trusted data or the fraudulent data, and upload the trusted data or the fraudulent data to the first blockchain for storage; the transaction processing operation includes one of passing or rejecting the transaction.
[0146] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data for software simulation to get a formula that is closest to the actual situation. The preset parameters, weights, and threshold selection in the formulas are set by those skilled in the art according to the actual situation.
[0147] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired or wireless network. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more collections of available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.
[0148] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present invention can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0149] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be repeated here.
[0150] In several embodiments provided by the present invention, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only one way, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0151] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0152] In addition, the functional units in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0153] As mentioned above, the above are only the specific implementation manners of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
[0154] Finally: The above are only the preferred embodiments of the present invention and are not used to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should all be included in the protection scope of the present invention.
Claims
1. A method for processing trusted data of mobile payment based on blockchain, wherein the blockchain comprises a first blockchain for storing first historical POS transaction data, characterized in that: The method comprises: Obtaining a current payment request initiated by the user at the current moment on the target POS device through a mobile payment method, and retrieving first historical POS transaction data from the first blockchain according to the current payment request; the current payment request includes the target bank card bound to the user's mobile payment method and the current POS transaction data; Acquire first historical abnormal POS transaction data about a target bank card from first historical POS transaction data using a preconfigured first isolation forest model; the first historical POS transaction data includes a plurality of historical POS transaction records about the target bank card; the first historical abnormal POS transaction data includes at least one historical abnormal POS transaction record about the target bank card; The step of acquiring first historical abnormal POS transaction data about the target bank card from the first historical POS transaction data includes: Inputting the first historical POS transaction data into a preconfigured first isolation forest model to obtain an anomaly score for each historical POS transaction record related to the target bank card; The abnormality score is compared with a preset abnormality score threshold. If the abnormality score is greater than or equal to the abnormality score threshold, the historical POS transaction record of the target bank card is marked as abnormal. The logic for obtaining the abnormality score is as follows: Extract the path length of each isolated tree in the first isolation forest model, and calculate the mean of the path lengths of all isolated trees to obtain the average path length; Calculate the anomaly score of each historical POS transaction record about the target bank card based on the average path length; Count all historical abnormal POS transaction records about the target bank card to obtain first historical abnormal POS transaction data in a collection form; The generation process of the preconfigured first isolation forest model is as follows: Initialize the isolation forest model and determine the various model parameters of the isolation forest model; According to the initialized isolation forest model with determined model parameters, a portion of samples are randomly selected from the first historical POS transaction data as a training data set; A preset feature selection mechanism is introduced to randomly select a target transaction feature from the training data set as the basis for segmentation, and a segmentation point is determined within the value range of the selected target transaction feature; Perform binary partitioning based on the characteristic value and split point of the target transaction feature to obtain two child nodes, namely the left child node and the right child node; Repeat the above steps for each child node until the preset stop condition is met, then stop dividing the child nodes and get a single isolated tree; The preset stop condition includes any one of the following: there is only one sample left in the node or the preset maximum segmentation depth has been reached; Repeat the above single isolated tree construction process to generate m isolated trees, and combine the m isolated trees to obtain the first isolation forest model, where m is an integer greater than zero; Calculating a first edit distance between current POS transaction data and first abnormal POS transaction data, and performing a first round of credibility judgment on the current POS transaction data according to the first edit distance to obtain a first judgment result; the first judgment result includes one of credible data and fraudulent data; The bank system associated with the target bank card performs a transaction processing operation on the current payment request according to the trusted data or the fraud data, and uploads the trusted data or the fraud data to the first blockchain for storage; the transaction processing operation includes one of transaction approval or rejection.
2. The blockchain-based mobile payment trusted data processing method according to claim 1 is characterized in that: The introduction of a preset feature selection mechanism to randomly select a target transaction feature from the training data set as a segmentation basis includes: Obtain all historical POS transaction records about the target bank card in the training data set, and extract multiple transaction features from the historical POS transaction records; Under each transaction feature, the K-means algorithm is used to cluster all historical POS transaction records of the target bank card to obtain multiple data clusters under each transaction feature; Count the number of multiple data clusters under each transaction feature, and compare the number of data clusters with a preset number threshold; if the number of data clusters is less than or equal to the number threshold, mark the corresponding transaction feature as a target transaction feature; if the number of data clusters is greater than the number threshold, mark the corresponding transaction feature as a non-target transaction feature; All target transaction features are counted to form a target transaction feature set, and any target transaction feature in the target transaction feature set is used as a basis for segmentation.
3. The blockchain-based mobile payment trusted data processing method according to claim 2 is characterized in that: The first round of credibility judgment on the current POS transaction data includes: Extracting each historical abnormal POS transaction record about the target bank card from the first abnormal POS transaction data; Using a hash algorithm to perform hash processing on each historical abnormal POS transaction record of the target bank card to obtain multiple first character strings; The current POS transaction data is hashed using a hash algorithm to obtain a second character string; Calculate the edit distance between each first character string and the second character string to obtain multiple first edit distances; Sorting the plurality of first edit distances in ascending order of value, and comparing the first edit distance at the top of the order with a preset first edit distance threshold; If the first edit distance of the first ranked item is less than or equal to the first edit distance threshold, the current POS transaction data is marked as fraudulent data, and the fraudulent data is used as the first judgment result of the first round of credibility judgment; If the first edit distance of the first ranked item is greater than the first edit distance threshold, the current POS transaction data is marked as credible data, and the credible data is used as the first judgment result of the first round of credibility judgment.
4. The blockchain-based mobile payment trusted data processing method according to claim 3 is characterized in that: After the first round of credibility judgment is performed on the current POS transaction data, including: When the first judgment result is credible data, calling a second blockchain including a preset smart contract; the preset smart contract includes standard verification data; Wherein, the standard verification data includes but is not limited to one of a pre-stored correct password, a correct fingerprint, and a correct face image; A second blockchain including a preset smart contract is used to perform compliance verification on the trusted data to obtain a compliance verification result; the compliance verification result includes one of compliance or non-compliance.
5. The blockchain-based mobile payment trusted data processing method according to claim 4 is characterized in that: After obtaining the first historical abnormal POS transaction data about the user's target bank card, including: Retrieve the preconfigured second isolation forest model; Acquire second historical abnormal POS transaction data from the second historical POS transaction data using a preconfigured second isolation forest model; the second historical abnormal POS transaction data includes at least one historical abnormal POS transaction record of a target bank card on a target POS device; A second round of credibility judgment is performed on the current POS transaction data according to the second historical abnormal POS transaction data to obtain a second judgment result; the second judgment result includes one of credible data and fraudulent data.
6. The blockchain-based mobile payment trusted data processing method according to claim 5 is characterized in that: The performing of a second round of credibility judgment on the current POS transaction data includes: Extracting each historical abnormal POS transaction record about the target bank card on the target POS device from the second historical abnormal POS transaction data; Using a hash algorithm to perform hash processing on each historical abnormal POS transaction record of the target bank card on the target POS device to obtain multiple third character strings; Calculate the edit distance between each third character string and the second character string to obtain multiple second edit distances; Sorting the plurality of second edit distances in ascending order of value, and comparing the second edit distance ranked first in the sorting with a preset second edit distance threshold; If the second edit distance of the first ranked item is less than or equal to the second edit distance threshold, the current POS transaction data is marked as fraudulent data, and the fraudulent data is used as the second judgment result of the second round of credibility judgment; If the second edit distance of the first ranked data is greater than the second edit distance threshold, the current POS transaction data is marked as credible data, and the credible data is used as the second judgment result of the second round of credibility judgment.
7. A blockchain-based mobile payment trusted data processing system, implemented based on the blockchain-based mobile payment trusted data processing method described in any one of claims 1-6, characterized in that: include: A data acquisition module, used to acquire a current payment request initiated by a user at the current moment on a target POS device through a mobile payment method, and retrieve first historical POS transaction data from the first blockchain according to the current payment request; the current payment request includes the target bank card bound to the user's mobile payment method and the current POS transaction data; an anomaly detection module, used for obtaining first historical abnormal POS transaction data about a target bank card from first historical POS transaction data by using a preconfigured first isolation forest model; the first historical POS transaction data includes a plurality of historical POS transaction records about the target bank card; the first historical abnormal POS transaction data includes at least one historical abnormal POS transaction record about the target bank card; a credible verification module, configured to calculate a first edit distance between current POS transaction data and first abnormal POS transaction data, and perform a first round of credibility judgment on the current POS transaction data according to the first edit distance to obtain a first judgment result; the first judgment result includes one of credible data and fraudulent data; A transaction processing module is used by the bank system associated with the target bank card to perform a transaction processing operation on the current payment request according to the trusted data or the fraud data, and upload the trusted data or the fraud data to the first blockchain for storage; the transaction processing operation includes one of transaction approval or rejection.
Citation Information
Patent Citations
Fraudulent behavior identification method and device
CN118052594A
Supply chain financial application method based on supervisible block chain private transaction
CN118229420A