Blockchain-based transaction method and device
Through blockchain technology and abnormal transaction warning models, combined with smart contracts and convolutional neural networks, the security and convenience issues of traditional transaction systems are solved, and efficient and reliable transaction processing is achieved.
Patent Information
- Application Number
- CN202311266566.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2043-09-27
AI Technical Summary
Traditional anti-fraud methods are difficult to adapt to the complex and changing strategies of abnormal transactions and cannot provide users with higher security and a convenient transaction environment.
Utilize the blockchain-based abnormal transaction warning model and smart contracts, combined with convolutional neural networks for transaction information processing, select heterogeneous blockchains or dual blockchains for transaction processing, and achieve cross-chain identity authentication, asset locking and transaction confirmation.
It improves the security and tamper-proof capabilities of transactions, ensures transaction transparency and traceability, reduces fraud risks, and enhances user trust and transaction convenience.
Smart Images

Figure CN119762071B_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, fraud is becoming increasingly complex and diverse, and abnormal transactions are constantly changing their strategies and methods. Traditional fraud prevention methods are unable to adapt to this new situation. While current methods for handling abnormal transactions ensure the security and transparency of customer funds, they struggle to provide higher security for transfers and remittances, and fail to create a more trustworthy and convenient transaction environment for users. Summary of the Invention
[0003] In response to the problems existing in the prior art, the main purpose of the embodiments of the present invention is to provide a blockchain-based transaction method and device to improve the accuracy of abnormal transaction warnings and create a more trustworthy and convenient transaction environment for customers.
[0004] To achieve the above objectives, an embodiment of the present invention provides a blockchain-based transaction method, comprising:
[0005] Obtain 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] Establishing a smart contract using the transaction information further 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, historical records, identity authentication mechanism, exception handling mechanism and upgrade and update mechanism.
[0010] Optionally, in one embodiment of the present invention, the abnormal transaction early warning model is established 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 feature matrix and label array are used to train a 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.
[0013] Optionally, in one embodiment of the present invention, the transaction information is processed using a pre-established abnormal transaction warning model, and the abnormal transaction warning result obtained includes:
[0014] Input the transaction information into the abnormal transaction early warning model to make predictions and obtain the prediction results;
[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 based on the transaction type and utilizing a smart contract for transaction processing includes:
[0017] If the transaction type is an 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, selecting a heterogeneous blockchain and utilizing smart contracts 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 inter-bank transfer transaction processing includes:
[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 based on the transaction type and utilizing a smart contract for transaction processing includes:
[0023] If the transaction type is an intra-bank transfer, dual blockchains will be selected, and smart contracts and dual blockchains will be used to process intra-bank transfer transactions.
[0024] An embodiment of the present invention further provides a blockchain-based transaction device, comprising:
[0025] The abnormality prediction module is used to obtain transaction information input by customers and process the transaction information using the pre-established abnormal transaction warning model to obtain abnormal transaction warning results;
[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 based on 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 apparatus further includes:
[0031] The historical data module is used to obtain historical transaction data sets and determine the feature matrix and label array corresponding to the historical transaction data sets;
[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] The 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 early warning result unit is used to compare the prediction result with a preset threshold to obtain the abnormal transaction early 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 authentication unit is used to authenticate the user's identity using the cross-chain authentication mechanism in heterogeneous blockchains and smart contracts;
[0039] The cross-chain request unit 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;
[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 further 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 storing a computer program for executing the above method on a computer.
[0044] The present invention also provides a computer program product, comprising a computer program / instructions, which implement the steps of the above method when executed by a processor.
[0045] The present invention utilizes the abnormal transaction early warning model and blockchain technology, and applies blockchain technology to the field of transaction processing, thereby enhancing the security and tamper-proofing of transactions, ensuring the transparency and traceability of transactions. All participants can view transaction records, making the transaction process more credible, and the source and destination of each transaction can be traced. 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 following briefly introduces the drawings required for describing the embodiments. 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 any creative work.
[0047] Figure 1 This is a flowchart of a blockchain-based transaction method 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 Flowchart of obtaining abnormal transaction warning results in an embodiment of the present invention;
[0050] Figure 4 This is a flow chart of an inter-bank transfer transaction process according to an embodiment of the present invention;
[0051] Figure 5 This is a flowchart of a blockchain-based transaction method 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 Schematic diagram of the structure of a blockchain-based transaction device in another embodiment of the present invention;
[0054] Figure 8 Schematic diagram of the structure of an abnormality prediction module in an embodiment of the present invention;
[0055] Figure 9 This is a schematic diagram of the structure of a transaction processing module in an embodiment of the present invention;
[0056] Figure 10 A schematic structural diagram 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 clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0059] like Figure 1The flowchart of a blockchain-based transaction method according to an embodiment of the present invention is shown. The execution subject of the blockchain-based transaction method provided by the embodiment of the present invention includes but is not limited to a computer. The present invention utilizes an abnormal transaction 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 trustworthy and tracing the source and destination of each transaction. Blockchain-based transaction processing improves transaction efficiency and increases customer transaction security authentication before the transaction, reducing the risk of customer fraud and improving the customer experience. The method shown in the figure includes:
[0060] Step S1: Acquire transaction information input by the customer, and use the pre-established abnormal transaction warning model to process the transaction information to obtain abnormal transaction warning results.
[0061] The transaction information entered by the user through a user terminal, such as a smart mobile terminal, is obtained. Transaction information includes transaction initiator information, transaction recipient information, and transaction status. 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.
[0062] Furthermore, before a transaction is made, a determination is made as to whether an abnormal transaction warning model has been triggered, and an abnormal transaction warning result is obtained. If the abnormal transaction warning result indicates an abnormal transaction, the model is triggered and the transaction is terminated. If the abnormal transaction warning result indicates 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] 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 information about the transaction participants: the identity information of the participants, such as the transfer initiator and recipient, the transfer amount and currency type, the transfer conditions and triggering events, the transfer fee, the contract execution logic, digital signatures and identity verification, the transfer confirmation and confirmation mechanism, the exception handling and rollback mechanism, events and notifications, privacy and security protection, the contract status and history, and the smart contract upgrade and update mechanism.
[0065] Furthermore, the transaction type can 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 the transaction.
[0067] Different transaction types utilize different blockchains for completion. For example, intra-bank transfers utilize dual blockchains, while inter-bank transfers utilize heterogeneous blockchains. When utilizing blockchain for transaction processing, the integration of pre-built smart contracts ensures efficient transaction processing and ensures accuracy and security.
[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, historical records, identity authentication mechanism, exception handling mechanism and 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 Figure 1, the abnormal transaction warning model is established using the following steps:
[0072] Step S4: Obtain a historical transaction dataset and determine a feature matrix and label array corresponding to the historical transaction dataset;
[0073] In step S5, the preset initial convolutional neural network model is trained 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.
[0074] A convolutional neural network (CNN) is used to build an abnormal transaction warning model. First, the necessary libraries are imported and a fictitious historical transaction dataset is created, including a feature matrix and corresponding label array. Next, the CNN model is constructed by adding a convolutional layer and a pooling layer for feature extraction and dimensionality reduction. A fully connected layer is added to pass the features extracted by the convolutional layer to the hidden layer of the neural network. Finally, an output layer is added for binary classification, determining whether a transaction is fraudulent. The neural network model is compiled, specifying the binary cross entropy loss function. Finally, the model is trained using the features and labels of the training set (i.e., the feature matrix and label array), performing multiple iterations and batch training. This results in an abnormal transaction warning model, which can then be used for predictions.
[0075] Furthermore, based on a big data environment, this invention uses convolutional neural networks to establish a highly accurate abnormal transaction model, reducing the risk of fraud for bank users. Simultaneously, blockchain technology is applied to the remittance and transfer industry, ensuring the secure flow of customer funds and transparency. This not only provides higher security for remittances, but also creates a more trustworthy and convenient transaction environment for users, bringing positive changes to the financial sector.
[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: Compare the prediction result with the preset threshold to obtain an abnormal transaction warning result.
[0079] The output layer of the abnormal transaction warning model is used for binary classification, determining whether a transaction is fraudulent. A Sigmoid activation function is used to output predicted probabilities, mapping the prediction results to a range between 0 and 1. In the model's prediction results, a probability value close to 0 indicates a high probability that the model considers the transaction normal, while a probability value close to 1 indicates a high probability that the model considers the transaction fraudulent. A threshold n is pre-set during use. When the prediction result is greater than the threshold n, the probability of fraud is high; when the prediction result is less than the threshold n, the probability of fraud 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 and heterogeneous blockchain interoperability technology is utilized to realize cross-bank transfers. 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 to perform cross-chain identity authentication, cross-chain asset locking and unlocking, and cross-chain transaction confirmation and verification to complete inter-bank transfer transaction processing, including:
[0083] Step S31: Authenticate the user's identity using the cross-chain authentication mechanism in the heterogeneous blockchain and smart contract;
[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, sends the cross-chain request to the corresponding contract address of the other chain to complete the inter-bank transfer transaction processing.
[0086] Interbank transfers utilize heterogeneous blockchains, combined with pre-built smart contracts, to complete interbank transaction processing. Specifically, users are required to undergo identity verification before initiating a transfer request. A cross-chain identity verification mechanism ensures that only legitimate users can initiate transfers. Users construct cross-chain transfer transactions on their own chain, including information such as the transfer amount and recipient address, and digitally sign the transaction. Transactions are locked using a cross-chain asset locking mechanism. The smart contract on the own chain locks the transfer amount to prevent double-spending on the chain.
[0087] Furthermore, after the transaction is locked, a cross-chain request containing cross-chain transfer information is generated and transmitted to the other chain. Using the cross-chain communication protocol, the cross-chain request is sent to the corresponding contract address of the other 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 the dual blockchain to process the intra-bank transfer transaction.
[0089] Among them, smart contracts are used and dual blockchains are used 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 improve 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, thereby completing the intra-bank transfer transaction processing.
[0091] The abnormal transaction early warning model based on convolutional neural networks in this 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, creating a more trustworthy and convenient transaction environment for customers.
[0092] In the remittance sector, blockchain technology is integrated with an abnormal transaction warning model to create a secure and efficient transaction ecosystem. The decentralized nature of blockchain ensures the transparency and immutability of transaction data, providing a strong barrier to fraud. Before a transaction begins, a CNN model is used to verify fraudulent activity based on customer transaction information, ensuring the security of customer funds. Digital and multi-factor authentication ensures the authenticity of transaction participants and prevents fraudulent transactions. The automated execution mechanism of smart contracts not only streamlines the transaction process but also automatically triggers additional verification steps based on the analysis results of the abnormal transaction warning model, ensuring 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 fields are 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; real data is required for practical applications.
[0112] Build a convolutional neural network model: Create a sequential model, adding different layers in order. First, add a convolutional 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. Here, ReLU is used as the activation function.
[0114] Output layer for binary classification: Add an output layer for binary classification, that is, to determine whether the transaction is fraudulent. Here, a Sigmoid activation function is used to output the predicted probability, mapping the prediction result to a range between 0 and 1. In the model prediction results, a probability value close to 0 indicates that the model believes the transaction is highly likely to be normal, while a probability value close to 1 indicates that the model believes the transaction is highly likely to be fraudulent. During use, a threshold n is set. When the prediction result is greater than the threshold n, the probability of fraud is high; when the prediction result is less than the threshold n, the probability of fraud is low.
[0115] Compile Model: Compile a 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, transaction 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: The smart contract contains the identity information of the participants, such as the transfer initiator, recipient, etc.
[0123] Transfer amount and currency type: The contract contains information about the transfer amount and currency type.
[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 validation 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 the transaction.
[0131] Privacy and security protection: If sensitive information is involved, the contract can stipulate how to protect privacy and security.
[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 (border) transfers.
[0136] 1) Standardized cross-chain protocols: Develop a universal cross-chain protocol for communication and data exchange between different blockchain networks. This protocol should define the transfer request format, encryption methods, verification mechanisms, etc. to ensure the consistency and security of cross-chain transfer operations.
[0137] 2) Cross-chain authentication: Design a cross-chain authentication mechanism that allows users on different blockchain networks to conduct cross-chain transfers. This can include using digital identity verification and multi-factor authentication to ensure the legitimacy and 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 cross-chain asset transfers.
[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 to ensure that the exchange of assets on different chains occurs simultaneously.
[0140] 5) Cross-chain data sharing: Design a mechanism to enable transfer data 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 undergo identity authentication before initiating a transfer request to ensure that only legitimate users can initiate transfers.
[0145] 2) Constructing 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 the other 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 begins to process 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, sending the assets to the recipient's address.
[0153] 4) Confirm the transaction: After the transfer is successful, the contract on the chain will generate a record to confirm the transaction, ensuring that the transfer operation has been executed.
[0154] 5) Feedback to the original chain: After the cross-chain transfer is completed, the transaction confirmation information can be returned to the original chain to inform the users 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, the demand for intra-bank transfers is high. A blockchain may experience transaction delays and high fees due to transaction congestion. In order to improve 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] Furthermore, remittances often involve sensitive financial information. Dual blockchains can store private transaction data (such as the amount and parties involved) on a dedicated private blockchain, while maintaining an immutable record of the transaction on a public blockchain. This allows transaction participants to enjoy enhanced privacy protection on the private blockchain while still being able to verify the validity and integrity of the transaction on the public blockchain.
[0158] Privacy protection:
[0159] 1) Privacy Chain Processing Sensitive Data: In a dual blockchain, one chain can be dedicated to processing transactions involving sensitive data, such as transfer amounts and personal identity information. This privacy chain can use privacy-preserving technology such as Zero-Knowledge Proofs to ensure that only legitimate parties involved in the transaction can access the data.
[0160] 2) Identity Protection: Privacy chains 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: Privacy chains 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: Privacy chains can implement strict permission control, and only authorized users can access sensitive information of specific transactions.
[0163] Traceability:
[0164] 1) Public chain records transaction history: On another public chain, transaction summaries can be recorded. These summaries can be used to verify the integrity and authenticity of transactions without exposing 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 private chain. This approach can provide sufficient information to verify transactions while protecting sensitive information.
[0167] Step 8, transaction completed.
[0168] This invention applies blockchain technology to the remittance sector by combining an abnormal transaction early warning model with blockchain-based remittance technology. This enhances the security and tamper-proofing of remittances, while ensuring transparency and traceability, with all participants able to access transaction records. This transparency enhances the trustworthiness of the transaction process and allows the tracing of the source and destination of each transaction. Blockchain-based remittance improves transfer efficiency while also providing pre-transfer verification for customer transactions, reducing the risk of fraud for internal users and enhancing customer confidence in the bank.
[0169] like Figure 6 FIG2 is a schematic diagram of the structure of a blockchain-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 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;
[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 abnormality 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 Figure 9 As shown, the transaction processing module 30 includes:
[0183] The identity verification unit 31 is used to authenticate the user's identity by using the 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 aforementioned blockchain-based transaction method, the present invention also provides the aforementioned blockchain-based transaction device. Because the principles underlying the blockchain-based transaction device and the blockchain-based transaction method are similar, the implementation of the blockchain-based transaction device can be referenced to the implementation of the blockchain-based transaction method, and any repetitions will not be repeated.
[0188] The present invention utilizes the abnormal transaction early warning model and blockchain technology, and applies blockchain technology to the field of transaction processing, thereby enhancing the security and tamper-proofing of transactions, ensuring the transparency and traceability of transactions. All participants can view transaction records, making the transaction process more credible, and the source and destination of each transaction can be traced. 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 / instructions, which implement the steps of the above method when executed by a processor.
[0191] The present invention also provides a computer-readable storage medium storing a computer program for executing the above method on a computer.
[0192] like Figure 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 Figure 10 In addition, the electronic device 600 may also include all components shown in Figure 10 For components not shown, reference may be made to the prior art.
[0193] like Figure 10 As shown, the central processing unit 100 is sometimes also referred to as a controller or an operation control unit, and may include a microprocessor or other processor device and / or logic device. The central processing unit 100 receives inputs and controls the operations of various components of the electronic device 600 .
[0194] Memory 140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information and may also store programs that execute the relevant information. The CPU 100 may execute the programs stored in memory 140 to implement information storage or processing.
[0195] The input unit 120 provides input to the CPU 100. The input unit 120 may be, for example, a keypad or touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to 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), or a SIM card. Alternatively, it may be a memory that retains information even when power is off, can be selectively erased, and is provided with more data. Examples of such memory are sometimes referred to as EPROMs. 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 for storing application programs and function programs or processes for executing the operations of the electronic device 600 via the central processing unit 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 driver programs 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 in 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 local area network 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 audio output via the speaker 131 and receive audio input from the microphone 132, thereby implementing common telecommunication functions. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. Furthermore, the audio processor 130 is coupled to the central processing unit 100, enabling local recording via the microphone 132 and playback of stored audio via the speaker 131.
[0200] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, 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 magnetic 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 flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, 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 flowcharts and / or block diagrams. 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 that can direct a computer or other programmable data processing device to work 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 The 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 operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0204] Specific embodiments are used in the present invention 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 ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. A transaction method based on blockchain, characterized in that: The method comprises: Obtain 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; Selecting a heterogeneous blockchain or dual blockchain based on the transaction type and utilizing the smart contract to process the transaction; 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; Using the feature matrix and label array, a preset initial convolutional neural network model is trained 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; Selecting a heterogeneous blockchain or a dual blockchain according to the transaction type and utilizing 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; Selecting a heterogeneous blockchain or a dual blockchain according to the transaction type and utilizing 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.
2. The method according to claim 1, characterized in that The transaction information includes transaction initiator information, transaction recipient information and transaction status; Establishing a smart contract using the transaction information further 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.
3. 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.
4. The method according to claim 1, wherein 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 inter-bank transfer transaction processing includes: Utilizing the cross-chain authentication mechanism in the heterogeneous blockchain and the smart contract to authenticate the user’s 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.
5. A blockchain-based transaction device for executing the method according to any one of claims 1 to 4, characterized in that: The device comprises: The abnormality prediction module is used to obtain 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; A transaction type module is configured 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; A 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.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
7. 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 4.
8. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.