Transaction method and device based on block chain
By establishing an abnormal transaction warning model and smart contract based on blockchain technology and selecting an appropriate blockchain network according to the transaction type, the problem of insufficient security guarantee for transfers and remittances in the existing technology is solved, and higher transaction security and user experience are achieved.
Patent Information
- Application Number
- CN202311266566.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2043-09-27
AI Technical Summary
The existing technology is difficult to provide higher security guarantees for transfers and remittances while ensuring the safety of customer funds flow and transparent process, and cannot provide users with a more trustworthy and convenient transaction environment.
A blockchain-based transaction method is adopted, and a transaction information input by the customer is obtained, and a pre-established abnormal transaction warning model is used for processing. If it is a non-abnormal transaction, a smart contract is established, and a heterogeneous blockchain or dual blockchain is selected for transaction processing according to the transaction type.
It improves the accuracy of abnormal transaction warning, enhances the security and tamper-proof of transactions, ensures the transparency and traceability of transactions, reduces the risk of customers being fraudulent, and improves customer experience.
Smart Images

Figure CN119762071A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a transaction method and device based on blockchain. Background Art
[0002] With the rapid development of information technology, fraudulent activities are becoming increasingly complex and varied, and abnormal transactions are constantly changing their strategies and methods. Traditional anti-fraud methods are difficult to adapt to the new situation. The current abnormal transaction processing methods, while ensuring the security of customer funds and the transparency of the process, are difficult to provide higher security for transfers and remittances, and cannot provide users with a more trustworthy and convenient transaction environment. Summary of the invention
[0003] In view of the problems existing in the prior art, the main purpose of the embodiments of the present invention is to provide a transaction method and device based on blockchain, so as to improve the accuracy of abnormal transaction warning and create a more trustworthy and convenient transaction environment for customers.
[0004] In order to achieve the above object, an embodiment of the present invention provides a transaction method based on blockchain, the method comprising:
[0005] Acquire transaction information input by the customer, and process the transaction information using a pre-established abnormal transaction warning model to obtain abnormal transaction warning results;
[0006] If the abnormal transaction warning result is a non-abnormal transaction, the transaction information is used to establish a smart contract and determine the transaction type corresponding to the transaction information;
[0007] Select heterogeneous blockchains or dual blockchains based on transaction types, and utilize smart contracts for transaction processing.
[0008] Optionally, in one embodiment of the present invention, the transaction information includes transaction initiator information, transaction recipient information and transaction status;
[0009] Using the transaction information to establish a smart contract further includes: using the transaction initiator information, transaction recipient information, transaction status and transaction type in the transaction information to establish a smart contract; wherein the smart contract includes a digital signature, a historical record, an identity authentication mechanism, an exception handling mechanism and an upgrade and update mechanism.
[0010] Optionally, in one embodiment of the present invention, the abnormal transaction early warning model is established by using the following steps:
[0011] Obtain a historical transaction data set, and determine a feature matrix and a label array corresponding to the historical transaction data set;
[0012] The preset initial convolutional neural network model is trained using the feature matrix and label array to obtain an abnormal transaction warning model; wherein the abnormal transaction warning model includes a convolution layer, a pooling layer, a fully connected layer and an output layer.
[0013] Optionally, in an embodiment of the present invention, the transaction information is processed using a pre-established abnormal transaction warning model to obtain an abnormal transaction warning result including:
[0014] Input the transaction information into the abnormal transaction early warning model for prediction and obtain the prediction result;
[0015] Compare the prediction results with the preset threshold to obtain abnormal transaction warning results.
[0016] Optionally, in one embodiment of the present invention, selecting a heterogeneous blockchain or a dual blockchain according to a transaction type, and using a smart contract to perform transaction processing includes:
[0017] If the transaction type is inter-bank transfer, a heterogeneous blockchain is selected, and smart contracts and the heterogeneous blockchain are used to perform cross-chain identity authentication, cross-chain asset locking and unlocking, and cross-chain transaction confirmation and verification to complete the inter-bank transfer transaction processing.
[0018] Optionally, in one embodiment of the present invention, a heterogeneous blockchain is selected, and smart contracts and heterogeneous blockchains are used to perform cross-chain identity authentication, cross-chain asset locking and unlocking, and cross-chain transaction confirmation and verification to complete the cross-bank transfer transaction processing, including:
[0019] Utilize cross-chain authentication mechanisms in heterogeneous blockchains and smart contracts to authenticate user identities;
[0020] After the user identity authentication is passed, a cross-chain transaction is constructed, and the cross-chain asset locking mechanism in the smart contract is used to lock the transaction and generate a cross-chain request;
[0021] Utilize the cross-chain communication protocol in the smart contract to send the cross-chain request to the corresponding contract address of another chain to complete the cross-bank transfer transaction processing.
[0022] Optionally, in one embodiment of the present invention, selecting a heterogeneous blockchain or a dual blockchain according to a transaction type, and using a smart contract to perform transaction processing includes:
[0023] If the transaction type is an intra-bank transfer, select dual blockchains, and use smart contracts and dual blockchains to process intra-bank transfer transactions.
[0024] The embodiment of the present invention further provides a transaction device based on blockchain, the device comprising:
[0025] The abnormality prediction module is used to obtain the transaction information input by the customer and process the transaction information using the pre-established abnormal transaction warning model to obtain the abnormal transaction warning result;
[0026] The transaction type module is used to establish a smart contract using the transaction information if the abnormal transaction warning result is a non-abnormal transaction, and determine the transaction type corresponding to the transaction information;
[0027] The transaction processing module is used to select heterogeneous blockchains or dual blockchains according to the transaction type and use smart contracts to process transactions.
[0028] Optionally, in one embodiment of the present invention, the transaction information includes transaction initiator information, transaction recipient information and transaction status;
[0029] Among them, the transaction type module is also used to establish a smart contract using the transaction initiator information, transaction recipient information, transaction status and transaction type in the transaction information; among them, the smart contract includes digital signatures, historical records, identity authentication mechanisms, exception handling mechanisms and upgrade and update mechanisms.
[0030] Optionally, in one embodiment of the present invention, the device further includes:
[0031] The historical data module is used to obtain the historical transaction data set and determine the feature matrix and label array corresponding to the historical transaction data set;
[0032] The model building module is used to use the feature matrix and label array to train the preset initial convolutional neural network model to obtain an abnormal transaction warning model; wherein the abnormal transaction warning model includes a convolution layer, a pooling layer, a fully connected layer and an output layer.
[0033] Optionally, in one embodiment of the present invention, the abnormality prediction module includes:
[0034] A prediction result unit is used to input the transaction information into the abnormal transaction early warning model for prediction and obtain the prediction result;
[0035] The warning result unit is used to compare the prediction result with a preset threshold to obtain the abnormal transaction warning result.
[0036] Optionally, in one embodiment of the present invention, the transaction processing module is also used to select a heterogeneous blockchain if the transaction type is an inter-bank transfer, and use smart contracts and heterogeneous blockchains to perform cross-chain identity authentication, cross-chain asset locking and unlocking, and cross-chain transaction confirmation and verification to complete the inter-bank transfer transaction processing.
[0037] Optionally, in one embodiment of the present invention, the transaction processing module includes:
[0038] The identity verification unit is used to verify the user's identity by using the cross-chain identity verification mechanism in heterogeneous blockchains and smart contracts;
[0039] The cross-chain request unit is used to build a cross-chain transaction after the user identity authentication is passed, and use the cross-chain asset locking mechanism in the smart contract to lock the transaction and generate a cross-chain request;
[0040] The request sending unit is used to use the cross-chain communication protocol in the smart contract to send the cross-chain request to the corresponding contract address of another chain to complete the cross-bank transfer transaction processing.
[0041] Optionally, in one embodiment of the present invention, the transaction processing module is also used to select dual blockchains if the transaction type is an intra-bank transfer, and use smart contracts and dual blockchains to perform intra-bank transfer transaction processing.
[0042] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the above method is implemented when the processor executes the program.
[0043] The present invention also provides a computer-readable storage medium, which stores a computer program for executing the above method by a computer.
[0044] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when the computer program / instruction is executed by a processor.
[0045] The present invention utilizes abnormal transaction early warning model and blockchain technology, and applies blockchain technology to the field of transaction processing, so as to enhance the security and tamper-proofness of transactions, ensure the transparency and traceability of transactions, and allow all participants to view transaction records, making the transaction process more credible, and to trace the source and destination of each transaction. Blockchain-based transaction processing improves transaction efficiency, while increasing customer transaction security authentication before transactions, reducing the risk of customer fraud, and improving customer experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 This is a flowchart of a transaction method based on blockchain according to an embodiment of the present invention;
[0048] Figure 2A flowchart of establishing an abnormal transaction early warning model in an embodiment of the present invention;
[0049] Figure 3 A flowchart of obtaining abnormal transaction warning results in an embodiment of the present invention;
[0050] Figure 4 Flow chart of inter-bank transfer transaction processing in an embodiment of the present invention;
[0051] Figure 5 This is a flowchart of a transaction method based on blockchain in a specific embodiment of the present invention;
[0052] Figure 6 This is a schematic diagram of the structure of a blockchain-based transaction device according to an embodiment of the present invention;
[0053] Figure 7 This is a schematic diagram of the structure of a transaction device based on blockchain in another embodiment of the present invention;
[0054] Figure 8 This is a schematic diagram of the structure of an abnormality prediction module in an embodiment of the present invention;
[0055] Fig. 9 This is a schematic diagram of the structure of a transaction processing module in an embodiment of the present invention;
[0056] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The embodiments of the present invention provide a blockchain-based transaction method and device, which can be used in the financial field and other fields. It should be noted that the blockchain-based transaction method and device of the present invention can be used in the financial field, and can also be used in any field other than the financial field. The application field of the blockchain-based transaction method and device of the present invention is not limited.
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] like Figure 1The flowchart of a transaction method based on blockchain in an embodiment of the present invention is shown. The execution subject of the transaction method based on blockchain provided in the embodiment of the present invention includes but is not limited to a computer. The present invention utilizes an abnormal transaction early warning model and blockchain technology, and applies blockchain technology to the field of transaction processing to enhance the security and tamper-proofness of transactions, ensure the transparency and traceability of transactions, and allow all participants to view transaction records, making the transaction process more credible, and the source and destination of each transaction can be traced. Transaction processing based on blockchain improves transaction efficiency, while increasing customer transaction security authentication before transactions, reducing the risk of customer fraud, and improving customer experience. The method shown in the figure includes:
[0060] Step S1, obtaining the transaction information input by the customer, and processing the transaction information using the pre-established abnormal transaction warning model to obtain an abnormal transaction warning result.
[0061] Among them, the transaction information entered by the user through the user terminal, such as a smart mobile terminal and other devices, is obtained, and the transaction information includes the transaction initiator information, the transaction recipient information and the transaction status. Specifically, the transaction information includes the initiator account address, the initiator name, the recipient account address, the recipient name, the transfer amount, the currency type, the transfer date and time, the transaction reference number, the transaction status, the transaction type, the transaction fee, the transaction remarks and additional information.
[0062] Furthermore, before the transaction, it is determined whether the abnormal transaction warning model is triggered to obtain the abnormal transaction warning result. If the abnormal transaction warning result is an abnormal transaction, the model is triggered and the transaction is terminated. If the abnormal transaction warning result is a non-abnormal transaction, the transaction continues.
[0063] Step S2: If the abnormal transaction warning result is a non-abnormal transaction, a smart contract is established using the transaction information, and the transaction type corresponding to the transaction information is determined.
[0064] Among them, if the abnormal transaction warning result is a non-abnormal transaction, a smart contract is constructed based on the transaction information. Specifically, the smart contract includes transaction participant information: the identity information of the participants, such as the transfer initiator, the recipient, etc., the transfer amount and currency type, the transfer conditions and trigger events, the transfer fee, the contract execution logic, the digital signature and identity authentication, the transfer confirmation and confirmation mechanism, the exception handling and rollback mechanism, the event and notification, the privacy and security protection, the contract status and history, the smart contract upgrade and update mechanism, etc.
[0065] Furthermore, the transaction type may be determined based on the transaction information. Specifically, the transaction type includes intra-bank transaction and inter-bank transaction, such as intra-bank transfer and inter-bank transfer.
[0066] Step S3: Select heterogeneous blockchain or dual blockchain according to the transaction type, and use smart contracts to process transactions.
[0067] Different transaction types use different blockchains to complete transactions. For example, intra-bank transfers use dual blockchains, and inter-bank transfers use heterogeneous blockchains. When using blockchain to process transactions, it is combined with the built smart contracts to efficiently complete transaction processing and ensure the accuracy and security of the transaction processing process.
[0068] As an embodiment of the present invention, the transaction information includes transaction initiator information, transaction recipient information and transaction status.
[0069] In this embodiment, establishing a smart contract using transaction information includes: establishing a smart contract using the transaction initiator information, transaction recipient information, transaction status and transaction type in the transaction information; wherein the smart contract includes a digital signature, a historical record, an identity authentication mechanism, an exception handling mechanism and an upgrade and update mechanism.
[0070] Specifically, transaction information includes the initiator's account address, initiator's name, recipient's account address, recipient's name, transfer amount, currency type, transfer date and time, transaction reference number, transaction status, transaction type, transaction fee, transaction notes and additional information.
[0071] As an embodiment of the present invention, Figure 2 As shown in the figure, the abnormal transaction early warning model is established using the following steps:
[0072] Step S4, obtaining a historical transaction data set, and determining a feature matrix and a label array corresponding to the historical transaction data set;
[0073] Step S5, using the feature matrix and the label array, train the preset initial convolutional neural network model to obtain an abnormal transaction warning model; wherein the abnormal transaction warning model includes a convolution layer, a pooling layer, a fully connected layer and an output layer.
[0074] Among them, a convolutional neural network (CNN) is used to establish an abnormal transaction warning model. First, the necessary libraries are imported and a virtual historical transaction data set is created, including a feature matrix and a corresponding label array. Secondly, a convolutional neural network model is constructed. First, a convolution layer and a pooling layer are added for feature extraction and dimensionality reduction; a fully connected layer is added to pass the features extracted by the convolution layer to the hidden layer of the neural network. Thirdly, an output layer is added for binary classification, that is, to determine whether it is a fraudulent transaction; the neural network model is compiled and the loss function is specified as binary cross entropy. Finally, the features and labels of the training set (i.e., the feature matrix and label array) are used to train the model for multiple iterations and batch training. In this way, an abnormal transaction warning model can be obtained, which can be used for prediction.
[0075] Furthermore, based on the big data environment, the present invention uses convolutional neural networks to establish a highly accurate abnormal transaction model to reduce the risk of fraud for users within the bank. At the same time, blockchain technology is applied to the field of remittance to ensure the safe circulation of customer funds and transparent processes, which not only provides higher security for remittance, but also creates a more trustworthy and convenient transaction environment for users, bringing positive changes to the financial field.
[0076] As an embodiment of the present invention, Figure 3 As shown, the transaction information is processed using the pre-established abnormal transaction warning model, and the abnormal transaction warning results obtained include:
[0077] Step S11, inputting the transaction information into the abnormal transaction early warning model for prediction to obtain the prediction result;
[0078] Step S12, comparing the prediction result with a preset threshold to obtain an abnormal transaction warning result.
[0079] Among them, the output layer in the abnormal transaction warning model is used for binary classification, that is, to determine whether it is a fraudulent transaction. The Sigmoid activation function can be used to output the predicted probability and map the predicted result to between 0 and 1. In the model prediction result, a probability value close to 0 indicates that the model believes that it is very likely to be a normal transaction, while a probability value close to 1 indicates that the model believes that it is very likely to be a fraudulent transaction. During use, a threshold value n is pre-set. When the predicted result is greater than the threshold value n, the possibility of a fraudulent transaction is high; when the predicted result is less than the threshold value n, the possibility of a fraudulent transaction is low.
[0080] As an embodiment of the present invention, a heterogeneous blockchain or a dual blockchain is selected according to the transaction type, and transaction processing is performed using a smart contract, including: if the transaction type is an inter-bank transfer, a heterogeneous blockchain is selected, and the smart contract and the heterogeneous blockchain are used to perform cross-chain identity authentication, cross-chain asset locking and unlocking, and cross-chain transaction confirmation and verification to complete the inter-bank transfer transaction processing.
[0081] Among them, smart contracts are used to realize cross-bank transfers by leveraging heterogeneous blockchain interoperability technology. The specific transaction processing includes: standardized cross-chain protocols, cross-chain identity authentication, cross-chain asset locking and unlocking, cross-chain transaction confirmation and verification, cross-chain data sharing and consistency and traceability, thereby completing the cross-bank transfer transaction processing.
[0082] In this embodiment, if Figure 4 As shown, heterogeneous blockchains are selected, and smart contracts and heterogeneous blockchains are used for cross-chain identity authentication, cross-chain asset locking and unlocking, and cross-chain transaction confirmation and verification to complete cross-bank transfer transaction processing, including:
[0083] Step S31, using the cross-chain identity authentication mechanism in heterogeneous blockchains and smart contracts to authenticate the user's identity;
[0084] Step S32: after the user identity authentication is passed, a cross-chain transaction is constructed, and the cross-chain asset locking mechanism in the smart contract is used to lock the transaction and generate a cross-chain request;
[0085] Step S33, using the cross-chain communication protocol in the smart contract, the cross-chain request is sent to the corresponding contract address of another chain to complete the cross-bank transfer transaction processing.
[0086] Among them, inter-bank transfer transactions use heterogeneous blockchains and combine them with previously built smart contracts to complete inter-bank transaction processing. Specifically, users need to authenticate their identities before initiating a transfer request, and the cross-chain identity authentication mechanism ensures that only legitimate users can initiate transfers. Users construct cross-chain transfer transactions on this chain, including information such as the transfer amount and the recipient's address, and digitally sign the transaction. The cross-chain asset locking mechanism is used to lock transactions, and the smart contract on this chain will lock the transfer amount to ensure that assets will not be used twice on this chain.
[0087] Furthermore, after the transaction is locked, a cross-chain request containing cross-chain transfer information is generated, which will be transmitted to another chain. Using the cross-chain communication protocol, the cross-chain request is sent to the corresponding contract address of another chain to complete the cross-bank transfer transaction processing.
[0088] As an embodiment of the present invention, selecting a heterogeneous blockchain or a dual blockchain according to the transaction type and using a smart contract to process the transaction includes: if the transaction type is an intra-bank transfer, selecting a dual blockchain, and using a smart contract and a dual blockchain to process the intra-bank transfer transaction.
[0089] Among them, smart contracts are used to utilize dual blockchains for intra-bank transfer processing. Due to reasons such as handling fees, the demand for intra-bank transfers is high. One blockchain may cause transaction delays and high fees due to transaction congestion. In order to increase transaction speed and scalability, by using dual blockchains, high-frequency small transactions can be placed on one blockchain, while large or low-frequency transactions can be placed on another blockchain to reduce congestion problems.
[0090] Furthermore, the specific transaction processing process includes the privacy chain processing of sensitive data, identity protection, data sharding and permission control, etc. This completes the intra-bank transfer transaction processing.
[0091] The abnormal transaction early warning model based on convolutional neural network in the present invention provides the first line of defense for intra-bank user transfers, and then implements a blockchain-based customer transfer and remittance transaction security authentication method to create a more trustworthy and convenient transaction environment for customers.
[0092] In the field of remittance, blockchain technology is integrated with the abnormal transaction warning model to build a safe and efficient transaction ecosystem. The decentralized nature of blockchain ensures the transparency and immutability of transaction data, providing an impenetrable guarantee for fraudulent behavior. Before the transaction begins, the CNN model is used to verify whether the current transaction is a fraudulent transaction based on the customer's transaction information to ensure the safety of customer funds. Through digital identity authentication and multi-factor identity authentication, the true identity of the transaction participants is ensured to prevent the occurrence of false transactions. The automatic execution mechanism of smart contracts not only simplifies the transaction process, but also automatically triggers additional verification steps based on the analysis results of the abnormal transaction warning model to ensure the security of high-risk transactions.
[0093] In a specific embodiment of the present invention, taking transfer as an example, Figure 5 The flowchart of the blockchain-based transaction method shown in FIG. 1 specifically includes:
[0094] Step 1, the customer enters the transfer information, the field information is as follows:
[0095] "sender_address": the sender's account address;
[0096] "sender_name": the name of the sender;
[0097] "receiver_address": recipient account address;
[0098] "receiver_name": recipient's name;
[0099] "amount": transfer amount;
[0100] "currency": currency type;
[0101] "transfer_date": transfer date and time;
[0102] "transaction_id": transaction reference number;
[0103] "transaction_status": transaction status;
[0104] "transaction_type": transaction type;
[0105] "transaction_fee": transaction fee;
[0106] "transaction_note": transaction notes;
[0107] "additional_info": Additional information.
[0108] Step 2: Before transferring money, determine whether the abnormal transaction warning model is triggered. If the model is triggered, the transaction is terminated. If not, the transaction continues.
[0109] Here, a convolutional neural network (CNN) is used to establish an early warning model for abnormal transfer and remittance transactions.
[0110] Import necessary libraries: Import the required Python libraries, including NumPy for numerical calculations and Keras for building neural network models.
[0111] Create a virtual transfer dataset: Generate a virtual transfer dataset, including the feature matrix X and the corresponding label array y. This is a simulated dataset, and real data is required in actual applications.
[0112] Build a convolutional neural network model: Create a sequential model and add different layers in order. First, add a convolution layer and a pooling layer for feature extraction and dimensionality reduction.
[0113] Add a fully connected layer: Add a fully connected layer to pass the features extracted by the convolutional layer to the hidden layer of the neural network. ReLU is used as the activation function here.
[0114] Output layer for binary classification: Add an output layer for binary classification, that is, to determine whether it is a fraudulent transaction. Here, the Sigmoid activation function is used to output the predicted probability, and the predicted result is mapped between 0 and 1. In the model prediction result, a probability value close to 0 indicates that the model believes that it is very likely to be a normal transaction, while a probability value close to 1 indicates that the model believes that it is very likely to be a fraudulent transaction. During use, a threshold n is set. When the predicted result is greater than the threshold n, the possibility of a fraudulent transaction is high; when the predicted result is less than the threshold n, the possibility of a fraudulent transaction is low.
[0115] Compile Model: Compile the neural network model, specify the loss function as binary cross entropy (for binary classification problems), the optimization algorithm as Adam, and the evaluation metric as accuracy.
[0116] Fit model: Use the features and labels of the training set to train the model for multiple iterations (epochs) and batch training (batch_size).
[0117] Use the model for prediction: Use the trained model to predict new samples and obtain the prediction results.
[0118] Output prediction results: Print the model's prediction results for new samples.
[0119] If the output prediction result is greater than the threshold n, the possibility of fraudulent transaction is high, and the transaction enters Step 3 and terminates; when the prediction result is less than the threshold n, the possibility of fraudulent transaction is low, and the transaction continues to Step 4.
[0120] Step 3, the transaction is terminated.
[0121] Step 4, create a smart contract. The smart contract created by the blockchain-based remittance exchange includes the following aspects:
[0122] Transaction participant information: Smart contracts contain the identity information of participants, such as the transfer initiator, recipient, etc.
[0123] Transfer amount and currency type: The contract contains information about the amount and currency type of the transfer.
[0124] Transfer conditions and triggering events: The contract can define the conditions that trigger a transfer, such as a specific time, a specific state change, etc.
[0125] Transfer Fees: The contract may stipulate a fee to be paid for transfers.
[0126] Contract execution logic: One of the most important parts, the contract should contain specific logic and conditions, describing under what circumstances the transfer will be executed and how it will be executed.
[0127] Digital signatures and authentication: Contracts can include digital signatures and authentication mechanisms to ensure the legitimacy and security of transactions.
[0128] Transfer confirmation and confirmation mechanism: The contract may define a mechanism for confirming transactions to ensure that transactions are verified and confirmed before execution.
[0129] Exception handling and rollback mechanism: The contract can specify how to handle and roll back transactions when abnormal situations occur.
[0130] Events and Notifications: A contract may define events and notifications related to a transaction, which helps monitor and track the status of a transaction.
[0131] Privacy and security protection: If sensitive information is involved, the contract can specify how privacy and security will be protected.
[0132] Contract status and history: Contracts may record changes in transaction status and history for auditing and tracking purposes.
[0133] Smart contract upgrade and update mechanism: Contracts can include upgrade and update mechanisms to adapt to changing business needs.
[0134] Step 5, determine whether the customer's transfer information is an intra-bank transfer. If it is an intra-bank transfer, proceed to Step 7; if it is an inter-bank transfer, proceed to Step 6. Inter-bank transfers include domestic inter-bank transfers and overseas inter-bank transfers.
[0135] Step 6: Use heterogeneous blockchain interoperability technology to achieve cross-bank (cross-border) transfers.
[0136] 1) Standardized cross-chain protocol: Develop a universal cross-chain protocol for communication and data exchange between different blockchain networks. This protocol should define the format, encryption method, verification mechanism, etc. of transfer requests to ensure the consistency and security of cross-chain transfer operations.
[0137] 2) Cross-chain identity verification: Design a cross-chain identity verification mechanism that allows users on different blockchain networks to perform cross-chain transfer operations. This can include using digital identity proofs, multi-factor authentication, etc. to ensure the legitimacy and identity authenticity of transaction participants.
[0138] 3) Cross-chain asset locking and unlocking: During cross-chain transfers, it is necessary to ensure the security of assets during the transfer process. Design smart contracts to lock assets on one blockchain and then unlock them on another blockchain to achieve seamless transfer of cross-chain assets.
[0139] 4) Cross-chain transaction confirmation and verification: Implement a mechanism to ensure that cross-chain transactions are confirmed and verified on different blockchains. This can include cross-chain atomic swaps technology to ensure that the exchange of assets on different chains occurs simultaneously.
[0140] 5) Cross-chain data sharing: Design a mechanism that enables data related to remittances to be shared between different chains. This can be achieved by storing transaction summaries or hashes on one chain and then verifying them on another chain.
[0141] 6) Consistency and traceability: To ensure the consistency and traceability of cross-chain transfer operations, a mechanism similar to two-phase commit can be used to ensure that transactions on different chains are correctly processed and confirmed.
[0142] The specific cross-border initiation process is as follows:
[0143] Phase 1: Transfer request initiated:
[0144] 1) User identity authentication: Users need to perform identity authentication before initiating a transfer request to ensure that only legitimate users can initiate transfers.
[0145] 2) Construct cross-chain transactions: Users construct cross-chain transfer transactions on this chain, including information such as the transfer amount and the recipient’s address, and digitally sign the transaction.
[0146] 3) Transaction lock: The smart contract on this chain will lock the transfer amount to ensure that the assets will not be used twice on this chain.
[0147] 4) Generate a cross-chain request: After the transaction is locked, the user generates a cross-chain request containing cross-chain transfer information, which will be transmitted to another chain.
[0148] 5) Cross-chain communication: Use a suitable cross-chain communication protocol to send cross-chain requests to the corresponding contract address of another chain.
[0149] Phase 2: Cross-chain transfer completed:
[0150] 1) Receiving a cross-chain request: After receiving the cross-chain request, the contract on the other chain starts processing the request.
[0151] 2) Verification and unlocking: On the receiving chain, the contract verifies the validity of the cross-chain request, including checking the digital signature, verifying the lock status, etc. Once the verification is passed, the contract unlocks the corresponding assets.
[0152] 3) Initiate a transfer: The contract uses the unlocked assets to perform a transfer operation on the chain and sends the assets to the recipient address.
[0153] 4) Confirm the transaction: After the transfer is successful, the contract on the chain will generate a record to confirm the transaction to ensure that the transfer operation has been executed.
[0154] 5) Feedback to this chain: After the cross-chain transfer is completed, the confirmation transaction information can be returned to the original chain to inform the user on the original chain of the status of the transfer operation.
[0155] Step 7: Dual blockchain intra-bank transfer technology solution
[0156] Due to reasons such as handling fees, there is a high demand for intra-bank transfers. A blockchain may experience transaction delays and high fees due to transaction congestion. In order to increase transaction speed and scalability, by using dual blockchains, high-frequency small transactions can be placed on one blockchain, while large or low-frequency transactions can be placed on another blockchain to reduce congestion problems.
[0157] In addition, remittances usually involve sensitive financial information. Dual blockchains can process private transaction data (such as amount, participants, etc.) on a dedicated private chain, while placing the unalterable record of the transaction on a public chain. In this way, the parties involved in the transaction can enjoy higher privacy protection on the private chain, while still being able to verify the validity and integrity of the transaction through the public chain.
[0158] Privacy protection:
[0159] 1) Privacy chain handles sensitive data: In a dual blockchain, one chain can be dedicated to processing transactions involving sensitive data, such as transfer amounts, personal identity information, etc. This privacy chain can use privacy protection technology: Zero-Knowledge Proofs to ensure that only legitimate participants in the transaction can access the data.
[0160] 2) Identity protection: The privacy chain can provide identity protection for transaction participants, ensuring that the information of transaction participants is not disclosed. This can be achieved by generating anonymous addresses.
[0161] 3) Data Sharding: The privacy chain can shard sensitive data so that each data fragment is stored in a different location, thereby increasing the privacy and security of the data.
[0162] 4) Permission control: The privacy chain can implement strict permission control, and only authorized users can access sensitive information of specific transactions.
[0163] Traceability aspects:
[0164] 1) Public chains record transaction history: On another public chain, transaction summaries can be recorded, which can be used to verify the integrity and authenticity of transactions without disclosing sensitive data.
[0165] 2) Verifiability: By placing the transaction summary on a public chain, anyone can verify the validity of the transaction and ensure that the transaction has not been tampered with.
[0166] 3) Metadata management: Metadata can be recorded on the public chain, while sensitive data is retained on the privacy chain. This approach can provide enough information to verify transactions while protecting sensitive information.
[0167] Step 8, the transaction is completed.
[0168] The present invention applies blockchain technology to the field of remittance through an abnormal transaction early warning model and a remittance technology based on blockchain, thereby enhancing the security and tamper-proofing of remittance, and ensuring the transparency and traceability of transactions, so that all participants can view transaction records. This transparency makes the transaction process more credible, and the source and destination of each transaction can be traced. Remittance based on blockchain improves transfer efficiency, while increasing customer transaction security authentication before transfer, reducing the risk of fraud of users within the bank, and enhancing customer confidence in the bank.
[0169] like Figure 6 FIG. 1 is a schematic diagram of a block chain-based transaction device according to an embodiment of the present invention. The device shown in the figure includes:
[0170] The abnormality prediction module 10 is used to obtain the transaction information input by the customer and process the transaction information using the pre-established abnormal transaction warning model to obtain the abnormal transaction warning result;
[0171] The transaction type module 20 is used to establish a smart contract using the transaction information and determine the transaction type corresponding to the transaction information if the abnormal transaction warning result is a non-abnormal transaction;
[0172] The transaction processing module 30 is used to select a heterogeneous blockchain or a dual blockchain according to the transaction type and use smart contracts to process the transaction.
[0173] As an embodiment of the present invention, the transaction information includes transaction initiator information, transaction recipient information and transaction status.
[0174] In this embodiment, the transaction type module is also used to establish a smart contract using the transaction initiator information, transaction recipient information, transaction status and transaction type in the transaction information; wherein the smart contract includes a digital signature, historical records, identity authentication mechanism, exception handling mechanism and upgrade and update mechanism.
[0175] As an embodiment of the present invention, Figure 7 As shown, the device also includes:
[0176] The historical data module 40 is used to obtain a historical transaction data set and determine a feature matrix and a label array corresponding to the historical transaction data set;
[0177] The model building module 50 is used to train the preset initial convolutional neural network model using the feature matrix and the label array to obtain an abnormal transaction warning model; wherein the abnormal transaction warning model includes a convolution layer, a pooling layer, a fully connected layer and an output layer.
[0178] As an embodiment of the present invention, Figure 8 As shown, the abnormal prediction module 10 includes:
[0179] The prediction result unit 11 is used to input the transaction information into the abnormal transaction early warning model for prediction and obtain the prediction result;
[0180] The warning result unit 12 is used to compare the prediction result with a preset threshold value to obtain an abnormal transaction warning result.
[0181] As an embodiment of the present invention, the transaction processing module is also used to select a heterogeneous blockchain if the transaction type is an inter-bank transfer, and use smart contracts and heterogeneous blockchains to perform cross-chain identity authentication, cross-chain asset locking and unlocking, and cross-chain transaction confirmation and verification to complete the inter-bank transfer transaction processing.
[0182] In this embodiment, if Fig. 9 As shown, the transaction processing module 30 includes:
[0183] An identity verification unit 31 is used to verify the identity of a user using a cross-chain identity verification mechanism in heterogeneous blockchains and smart contracts;
[0184] The cross-chain request unit 32 is used to construct a cross-chain transaction after the user identity authentication is passed, and use the cross-chain asset locking mechanism in the smart contract to lock the transaction and generate a cross-chain request;
[0185] The request sending unit 33 is used to use the cross-chain communication protocol in the smart contract to send the cross-chain request to the corresponding contract address of another chain to complete the cross-bank transfer transaction processing.
[0186] As an embodiment of the present invention, the transaction processing module is also used to select dual blockchains if the transaction type is an intra-bank transfer, and use smart contracts and dual blockchains to perform intra-bank transfer transaction processing.
[0187] Based on the same application concept as the above-mentioned blockchain-based transaction method, the present invention also provides the above-mentioned blockchain-based transaction device. Since the principle of solving the problem by the blockchain-based transaction device is similar to that of the blockchain-based transaction method, the implementation of the blockchain-based transaction device can refer to the implementation of the blockchain-based transaction method, and the repeated parts will not be repeated.
[0188] The present invention utilizes abnormal transaction early warning model and blockchain technology, and applies blockchain technology to the field of transaction processing, so as to enhance the security and tamper-proofness of transactions, ensure the transparency and traceability of transactions, and allow all participants to view transaction records, making the transaction process more credible, and to trace the source and destination of each transaction. Blockchain-based transaction processing improves transaction efficiency, while increasing customer transaction security authentication before transactions, reducing the risk of customer fraud, and improving customer experience.
[0189] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the above method is implemented when the processor executes the program.
[0190] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when the computer program / instruction is executed by a processor.
[0191] The present invention also provides a computer-readable storage medium, which stores a computer program for executing the above method by a computer.
[0192] like Fig.10 As shown, the electronic device 600 may further include: a communication module 110, an input unit 120, an audio processor 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily have to include Fig.10 In addition, the electronic device 600 may also include Fig.10 For components not shown, reference may be made to the prior art.
[0193] like Fig.10 As shown, the central processor 100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processor 100 receives inputs and controls the operations of various components of the electronic device 600.
[0194] The memory 140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 100 may execute the program stored in the memory 140 to implement information storage or processing.
[0195] The input unit 120 provides input to the CPU 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.
[0196] The memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 140 may also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 600 through the central processor 100.
[0197] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0198] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via an antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processor 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0199] Based on different communication technologies, multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide an audio output via the speaker 131 and receive an audio input from the microphone 132, thereby realizing a common telecommunication function. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 130 is also coupled to the central processor 100, so that the sound can be recorded on the local machine through the microphone 132, and the sound stored on the local machine can be played through the speaker 131.
[0200] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0201] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0202] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0203] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0204] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A transaction method based on blockchain, characterized in that: The method comprises: Acquire transaction information input by the customer, and process the transaction information using a pre-established abnormal transaction warning model to obtain abnormal transaction warning results; If the abnormal transaction warning result is a non-abnormal transaction, a smart contract is established using the transaction information, and the transaction type corresponding to the transaction information is determined; A heterogeneous blockchain or a dual blockchain is selected according to the transaction type, and the smart contract is used to process the transaction.
2. The method according to claim 1, characterized in that The transaction information includes transaction initiator information, transaction recipient information and transaction status; Using the transaction information to establish a smart contract further includes: using the transaction initiator information, transaction recipient information, transaction status and transaction type in the transaction information to establish a smart contract; wherein the smart contract includes a digital signature, a historical record, an identity authentication mechanism, an exception handling mechanism and an upgrade and update mechanism.
3. The method according to claim 1, characterized in that The abnormal transaction early warning model is established using the following steps: Obtain a historical transaction data set, and determine a feature matrix and a label array corresponding to the historical transaction data set; The preset initial convolutional neural network model is trained using the feature matrix and label array to obtain an abnormal transaction warning model; wherein the abnormal transaction warning model includes a convolution layer, a pooling layer, a fully connected layer and an output layer.
4. The method according to claim 1, characterized in that The transaction information is processed using a pre-established abnormal transaction warning model to obtain abnormal transaction warning results including: Inputting the transaction information into the abnormal transaction early warning model for prediction to obtain a prediction result; The prediction result is compared with a preset threshold to obtain the abnormal transaction warning result.
5. The method according to claim 1, characterized in that Selecting a heterogeneous blockchain or a dual blockchain according to the transaction type, and using the smart contract to process the transaction includes: If the transaction type is an inter-bank transfer, a heterogeneous blockchain is selected, and the smart contract and the heterogeneous blockchain are used to perform cross-chain identity authentication, cross-chain asset locking and unlocking, and cross-chain transaction confirmation and verification to complete the inter-bank transfer transaction processing.
6. The method according to claim 5, characterized in that The selecting of a heterogeneous blockchain and utilizing the smart contract and the heterogeneous blockchain to perform cross-chain identity authentication, cross-chain asset locking and unlocking, and cross-chain transaction confirmation and verification to complete the cross-bank transfer transaction processing includes: Utilizing the cross-chain identity authentication mechanism in the heterogeneous blockchain and the smart contract to authenticate the user identity; After the user identity authentication is passed, a cross-chain transaction is constructed, and the cross-chain asset locking mechanism in the smart contract is used to lock the transaction and generate a cross-chain request; Utilizing the cross-chain communication protocol in the smart contract, the cross-chain request is sent to the corresponding contract address of another chain to complete the cross-bank transfer transaction processing.
7. The method according to claim 1, characterized in that Selecting a heterogeneous blockchain or a dual blockchain according to the transaction type, and using the smart contract to process the transaction includes: If the transaction type is an intra-bank transfer, dual blockchains are selected, and the smart contract and the dual blockchains are used to process the intra-bank transfer transaction.
8. A transaction device based on blockchain, characterized in that: The device comprises: The abnormality prediction module is used to obtain the transaction information input by the customer and process the transaction information using the pre-established abnormal transaction warning model to obtain the abnormal transaction warning result; A transaction type module, used to establish a smart contract using the transaction information if the abnormal transaction warning result is a non-abnormal transaction, and determine the transaction type corresponding to the transaction information; The transaction processing module is used to select a heterogeneous blockchain or a dual blockchain according to the transaction type and use the smart contract to process the transaction.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for causing a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Design for supporting multi-chain architecture for banking
CN109102259A
Credit card abnormal transaction behavior judgment method and system based on deep learning
CN111985924A
Deep neural network-based cross-chain transaction anomaly detection and early warning method and system
CN112288566A
Business processing method and device applied to bank transaction block chain system
CN112330326A
Transaction risk assessment method and device based on blockchain
CN113435770A