Block chain cross-border payment method and system based on micro-service architecture
By transforming the smart contracts in the blockchain cross-border payment system into microservices and adopting a microservice architecture, the problems of complexity of traditional cross-border payment methods and low efficiency of the blockchain system are solved, achieving efficient, scalable and secure Cross-border payment solutions.
Patent Information
- Application Number
- CN202410752124.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-27
AI Technical Summary
Traditional cross-border payment methods are complex and inefficient. The node smart contracts in the blockchain cross-border payment system have low execution efficiency, poor scalability, and lack of formal methods to verify code integrity, leading to security issues.
Using microservice architecture, the smart contracts in the blockchain cross-border payment system are constructed as loosely coupled microservices. Each contract microservice is responsible for specific business functions and can be deployed and expanded independently. The microservice architecture is deployed through Kubernetes to achieve lightweight level communication and containerized management.
It improves the execution efficiency, scalability and high availability of the blockchain cross-border payment system, reduces maintenance costs, enhances the security and flexibility of the system, and is suitable for large-scale applications and complex business needs.
Smart Images

Figure CN118710407A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain cross-border payment method and system based on a microservice architecture. Background Art
[0002] Traditional cross-border payment methods need to go through many financial institutions such as remitting banks, central banks, agent banks and receiving banks, and account settlement and processing will be carried out within each institution. At the same time, it takes a long time to establish agency relationships between institutions, making the entire cross-border payment process more complicated, with many intermediate links, long settlement cycles, slow processing speeds, high transit fees and other prominent problems, resulting in relatively low overall settlement efficiency.
[0003] At present, the cross-border payment system based on blockchain technology has attracted widespread attention in the financial industry. Blockchain technology has the characteristics of decentralization and irreversibility. The introduction of blockchain technology is expected to help the traditional cross-border payment system achieve decentralization, thereby building a faster, safer and more transparent cross-border payment model. As the status of global individual consumers and the private sector in cross-border payments increases year by year, cross-border payments are changing from traditional wholesale large-value payments to small-value retail payments. Therefore, when facing the increase in cross-border business volume and diversification of cross-border business, there is an urgent practical application demand for cross-border payment transactions based on blockchain technology with high execution efficiency, scalability and high availability.
[0004] The patent application with application number CN202111217180.5 discloses a cross-border payment method, system, device, and medium based on the Fabric alliance chain, including: obtaining a payment proposal, the payment proposal includes the payment currency and the payment amount; obtaining the exchange rate information pre-configured by the transit node, and determining the target transit node according to the payment currency, exchange rate information and the preset exchange rate optimal principle; sending the smart contract generated by the target transit node to the peer node, generating verification information through the peer node, and associating the verification information to the smart contract; the smart contract may include multiple sub-contracts, for example, it may include a user registration management contract, a fund management contract, an exchange rate management contract, and a payment management contract. The peer nodes usually include endorsement nodes and review nodes, which can review and verify the smart contract. When the smart contract meets the requirements of the Fabric alliance chain, the smart contract carrying the verification information is sent to the sorting node to create a transaction block, and the transaction block is broadcast to the peer node to execute payment. However, the problems with this patent application are: the deployment of smart contracts based on native methods results in a high coupling between node smart contracts and underlying consensus network nodes in the blockchain cross-border payment system, which requires full-node consensus for the execution of node smart contracts in the payment system, resulting in excessive time overhead and low execution efficiency; the scalability problem of the blockchain cross-border payment system is that as the cross-border payment business logic gradually becomes more complex, the scale of smart contracts is also increasing, and the logical coupling within the contracts is too large, making the update and maintenance of the payment system smart contracts extremely complicated; the security problem of on-chain code execution in the blockchain cross-border payment system is that there is a lack of formal methods to verify code integrity, which can easily cause payment system vulnerabilities and lead to property losses during cross-border payments. Summary of the invention
[0005] In order to overcome the defects of the above-mentioned prior art, the purpose of the present invention is to propose a blockchain cross-border payment method and system based on microservice architecture. By combining the concept of microservice architecture, the smart contracts of each node in the blockchain cross-border payment system are constructed as a series of loosely coupled microservices. Each contract microservice is responsible for a business function and is independently deployed in a single container. The upgrading of the business function will not affect the normal operation of other services. Each contract microservice is autonomous and can be independently developed, maintained and expanded, which solves the problems of low execution efficiency, scalability and high availability of node smart contracts in the cross-border payment system based on blockchain technology.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] A blockchain cross-border payment method based on microservice architecture, characterized by comprising the following steps:
[0008] S1: Build a blockchain cross-border payment network based on microservice architecture, which includes at least remitting bank nodes, receiving bank nodes, market maker nodes and consensus nodes:
[0009] The remittance node is used to remit the legal currency of the remitter;
[0010] The receiving bank node is used to remit the legal currency of the recipient;
[0011] Market maker nodes are used to exchange legal tender and digital currency according to exchange rate rules, and to establish corresponding transaction blocks and broadcast them to all nodes in the blockchain network;
[0012] Consensus nodes are used to verify the validity of transaction information according to the consensus mechanism, and store the verified transactions in the blockchain network in timestamp order;
[0013] S2: Microservice the smart contracts of each node in step S1 to build a series of loosely coupled contract microservices. Each contract microservice is designed, developed, deployed and expanded around a specific business function. It interacts through a lightweight communication mechanism to realize cross-border payment business and microservice the smart contracts of each node in the blockchain cross-border payment network.
[0014] S3: According to the microservices of the smart contracts of each node proposed in step S2, a series of loosely coupled contract microservices are constructed, and packaged in a containerized form and handed over to the cluster for unified management. Then, the node chain code method of the blockchain cross-border payment system with a microservice architecture is deployed based on Kubernetes for microservice blockchain cross-border payment.
[0015] The step S2 is specifically as follows:
[0016] S2.1: Split the business functions of the remitting bank node, receiving bank node, and market maker node, and deploy the account management contract, transfer contract, exchange rate query contract of the remitting bank node and receiving bank node, and the exchange rate management contract and exchange rate conversion contract of the market maker node in a single basic container and decouple them from the underlying consensus node, making the contract an independent module;
[0017] S2.2: Each node’s smart contract container provides a smart contract runtime environment, provides a more explicit interface to the outside world, builds a series of loosely coupled contract microservices, and packages them in a containerized form for unified management by the cluster;
[0018] S2.3: The node contract microservices constructed after the microservice transformation communicate through a lightweight communication mechanism; the lightweight communication mechanism includes a method based on remote procedure call or a method based on RESTFUL interface specification.
[0019] The step S2.3 is specifically as follows:
[0020] S2.3.1: The remitter initiates a remittance request through the remitting bank, which includes the remitter information, the remitting bank information, the remitting bank information, the beneficiary information and the contract amount;
[0021] S2.3.2: The remittance request of the remitter is obtained by the specific gateway of the microservice, which performs corresponding parsing and processing, repackages the remitter's request as information into a specific contract service message and sends it to the node of the receiving bank;
[0022] S2.3.3: After receiving the remittance request, the remitting bank node reviews it and checks the identity and credit of the payee to see if the remitting bank needs to know more about the remitter. If the review fails, the node returns the processing result to the gateway, which is then delivered to the remitting bank. If the review passes, the node returns the order information, cross-border payment fee, and relevant information of the payee to the gateway, which is then delivered to the remitting bank.
[0023] S2.3.4: After receiving the reply from the remitting bank node, the remitting bank node finds the market maker node that can provide the exchange of the legal currency remittance amount into the digital currency contract amount through the gateway, queries the market maker node for the current exchange rate, and returns the exchange rate to the remitting bank node;
[0024] S2.3.5: The remitting node delivers the details of the handling fee and the exchange rate of the market maker to the remitting party for confirmation and whether to accept the quotation and exchange rate;
[0025] S2.3.6: Based on the details, if the remitter confirms that he can accept the quotation, the remitting bank node sends a confirmation notice to the market maker node and the receiving bank node through the gateway;
[0026] S2.3.7: After receiving the remittance amount in legal currency from the remitting bank node, the market maker node converts the remittance amount in legal currency into the contract amount in digital currency according to the current exchange rate, thereby establishing a remittance transaction block including the remitter information, remitting bank information, contract amount, remitting bank information, and payee information, and broadcasts the block to the consensus node of the blockchain network;
[0027] S2.3.8: The consensus node verifies the validity of the remittance transaction based on the consensus mechanism. When the verification is passed, the remittance transaction is stored in the blockchain network in the order of timestamps.
[0028] S2.3.9: When the valid remittance transaction blocks are stored in the blockchain network in the order of timestamps, the market maker node converts the contract amount of digital currency into the legal currency of the receiving node according to the current exchange rate and pushes it to the receiving node, thereby establishing a transaction completion message block including remitter information, remitting bank information, contract amount, receiving bank information, payee information, remittance amount of legal currency of the remitting bank node, and legal currency of the receiving bank node, and broadcasting it to the blockchain network consensus node;
[0029] S2.3.10: The consensus node verifies the validity of the transaction completion message block based on the consensus mechanism. When the verification is successful, each node generates a transaction record based on the information recorded in the transaction completion message block.
[0030] The step S3 is specifically as follows:
[0031] S3.1: Initiate the installation chaincode command to the deployment node through the Kubernetes client CLI or SDK, and package the user-prepared chaincode file and the selected endorsement policy and send them to the specified Peer node;
[0032] S3.2: The Peer node uses Docker to pull the image to create a temporary container TempContainer for chaincode compilation, and compiles the chaincode into an executable file in the container;
[0033] S3.3: Move the compiled files from the temporary container to the directory specified by the container, and send a compilation completion notification to the Peer node;
[0034] S3.4: After receiving the notification that the file compilation is complete, the Peer node calls the image building interface to generate the chaincode image containing the target file and places the generated image in the local image repository of the node where the Kubernetes Node is located. The chaincode installation phase is completed.
[0035] S3.5: The Peer container receives the call chain code from the client or SDK, and the Peer initiates a command to create a pod service in the form of Deployment and Service to the Kube-apiserver, and starts the chain code container on the node where the Peer service is located through the nodeSelector in Kubernetes based on the image generated in step 3.4, and installs and instantiates the user chain code based on the chain code image generated in step 3.4;
[0036] S3.6: The chaincode container is started, and the chaincode Pod and Peer Pod complete the transmission of chaincode execution parameters through the communication protocol between Kubernetes Services, and then execute the chaincode.
[0037] The present invention also provides a blockchain cross-border payment system based on a microservice architecture. The overall architecture of the system has six layers, namely, access layer, service layer, storage layer, blockchain layer, scheduling layer and resource layer, specifically:
[0038] The access layer implements the system's front-end WebUI and interface access management, and configures the API gateway to call the corresponding service layer services;
[0039] The service layer is one of the core layers of the entire system architecture, including Kubernates cluster management service, disaster recovery management service and blockchain management service, and provides cluster resource management, deletion, addition, monitoring and display functions in the Kubernates cluster module; the disaster recovery module can realize persistent backup and recovery of on-chain data by calling the distributed file system of the storage layer, and at the same time, by calling the distributed key-value pair storage of the storage layer, it provides off-chain storage data, on-chain storage data hash, and off-chain and on-chain data collaborative verification to reduce the use of on-chain space and solve the performance and storage bottleneck problems of obtaining on-chain data; the blockchain management module provides management, calling and execution of blockchain layer chain code contracts, and also provides management of blockchain layer node channels and organization block management;
[0040] The storage layer includes distributed key-value pair storage, distributed file system, and distributed object storage. Business data and off-chain structured encrypted data are stored in distributed key-value pair storage, which not only realizes distributed high-availability encrypted storage of off-chain data, but also realizes the goal of deep integration of blockchain cross-border payment system and Kubernates, reduces the complexity of operation and maintenance management system, and enhances system high availability. Distributed object storage off-chain structured encrypted object data and distributed key-value pair storage together realize persistent storage of off-chain data; the distributed file system realizes one-click deployment of the blockchain system, and also realizes distributed persistent backup of blockchain data;
[0041] The blockchain layer, each node of which runs on Kubernates to provide a stable and efficient blockchain network for the blockchain cross-border payment system, completes the node chain code method of the blockchain cross-border payment system based on Kubernetes deployment of microservice architecture, transforms the chain code into a microservice so that it runs in an independent container, decouples the account management contract, transfer and remittance contract, exchange rate query contract, exchange rate management contract and exchange rate conversion contract in the receiving bank node, the remittance bank node and the market maker node from the node, so that each contract microservice and each network node, sorting node and Kafka run in an independent container respectively and are included in the Kubernates environment for monitoring and management;
[0042] The scheduling layer is one of the core layers of the overall system architecture. It configures highly available KubernetesMasters as the underlying foundation of the system to provide container scheduling, data storage, and system operation and maintenance support for the system. By adding high-availability technology, deep integration of on-chain and off-chain data storage with Kubernetes, and calling each contract microservice through load balancing (LoadBalance), the system's availability, executable, high availability, and security of off-chain data are improved;
[0043] The resource layer is the node platform deployed at the bottom of the system, including the cloud platform and virtual machines.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] 1. Step S2.1 of the present invention adopts the idea based on microservice architecture to deploy the account management contract, transfer contract, exchange rate query contract of the remittance bank node and the remittance bank node in the blockchain cross-border payment system, and the exchange rate management contract and exchange rate exchange contract of the market maker node in a single basic container and decouple it from the lower consensus node node to become an independent module, so that the smart contract has a single responsibility and only needs to complete its own business function. When there is a new business demand, only the business contract microservice needs to be developed, which will not affect other contract microservices, thereby improving the flexibility and scalability of the blockchain cross-border payment system.
[0046] 2. Step S2.2 of the present invention constructs a series of loosely coupled contract microservices by decoupling the smart contracts of the importing bank node, exporting bank node and market maker node, and packages them in a containerized form and gives them to the cluster for unified management. This makes the blockchain cross-border payment system more suitable for large-scale applications. Developers can increase or decrease the number of contract microservices according to actual needs to meet changing traffic requirements. Functions such as load balancing and failover can also be integrated into each service, thereby improving the availability and reliability of the blockchain cross-border payment system.
[0047] 3. Step S3 of the present invention, through the node chain code method of the blockchain cross-border payment system based on Kubernetes deployment microservice architecture, realizes the decoupling of smart contracts from network nodes, deploys them in independent containers, and incorporates them into the container cluster management system Kubernetes for hosting. Compared with the native blockchain chain code deployment, it reduces the daily development and maintenance costs and improves the efficiency of smart contract upgrade deployment.
[0048] In summary, the present invention combines the idea of microservice architecture to microservice the node smart contracts in the blockchain cross-border payment system, deploys them in the basic container, and forms microservice contracts one by one. As the status of global individual consumers and the private sector in cross-border payments increases year by year, cross-border payments are changing from traditional wholesale large-value payments to small-value retail payments, and there are higher realistic requirements for the overall performance of the cross-border payment system. Compared with the existing blockchain cross-border payment system, when facing the increase in cross-border transaction volume, the high transaction execution efficiency of the blockchain cross-border payment system based on the microservice architecture improves the overall high availability of the system; when facing the complex and diverse business needs of small-value retail payments for personal consumption, the cross-border payment-related smart contracts of the blockchain cross-border payment system nodes based on the microservice architecture can be independently developed, independently operated, independently deployed, and independently upgraded, which effectively improves the overall scalability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a schematic diagram of the timing of the blockchain cross-border payment network nodes based on the microservice architecture of the present invention.
[0050] Figure 2 This is a flow chart of the operation mode of the blockchain cross-border payment network based on the microservice architecture of the present invention.
[0051] Figure 3 The present invention is a blockchain cross-border payment system node chain code method and blockchain node schematic diagram based on Kubernetes deployment microservice architecture; wherein, Figure 3 (A) is a blockchain cross-border payment system node chain code method based on Kubernetes deployment of microservice architecture. Figure 3 (B) is a schematic diagram of a blockchain node.
[0052] Figure 4 This is a schematic diagram of the architecture of the blockchain cross-border payment system based on the microservice architecture of the present invention. DETAILED DESCRIPTION
[0053] In order to enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0054] A blockchain cross-border payment method based on a microservice architecture comprises the following steps:
[0055] S1: Figure 1 The embodiment shows a blockchain cross-border payment network node timing diagram based on a microservice architecture, and constructs a blockchain cross-border payment network based on a microservice architecture. The blockchain cross-border payment network at least includes a remitting bank node, a receiving bank node, a market maker node, and a consensus node:
[0056] The remittance node is used to remit the legal currency of the remitter;
[0057] The receiving bank node is used to remit the legal currency of the recipient;
[0058] Market maker nodes are used to exchange legal tender and digital currency according to exchange rate rules, and to establish corresponding transaction blocks and broadcast them to all nodes in the blockchain network;
[0059] Consensus nodes are used to verify the validity of transaction information according to the consensus mechanism, and store the verified transactions in the blockchain network in timestamp order;
[0060] S2: Microservice the smart contracts of each node in step S1 and build them into a series of loosely coupled contract microservices. Each contract microservice is designed, developed, deployed and expanded around a specific business function, and interacts through a lightweight communication mechanism to realize cross-border payment business. The smart contracts of each node in the blockchain cross-border payment network are microserviced.
[0061] The step S2 is specifically as follows:
[0062] S2.1: Split the business functions of the remitting bank node, receiving bank node, and market maker node, and deploy the account management contract, transfer contract, exchange rate query contract of the remitting bank node and receiving bank node, and the exchange rate management contract and exchange rate conversion contract of the market maker node in a single basic container and decouple them from the underlying consensus node, making the contract an independent module;
[0063] S2.2: Each node’s smart contract container provides a smart contract runtime environment, provides a more explicit interface to the outside world, builds a series of loosely coupled contract microservices, and packages them in a containerized form for unified management by the cluster;
[0064] S2.3: The microservices of each node contract built after microservice transformation are communicated through a lightweight communication mechanism; the lightweight communication mechanism includes a method based on remote procedure call or a method based on RESTFUL interface specification.
[0065] Figure 2 This is a flowchart of the operation mode of the blockchain cross-border payment network based on the microservice architecture. Figure 2 , the step S2.3 is specifically as follows:
[0066] S2.3.1: The remitter initiates a remittance request through the remitting bank, which includes the remitter information, the remitting bank information, the remitting bank information, the beneficiary information and the contract amount;
[0067] S2.3.2: The remittance request of the remitter is obtained by the specific gateway of the microservice, which performs corresponding parsing and processing, repackages the remitter's request as information into a specific contract service message and sends it to the node of the receiving bank;
[0068] S2.3.3: After receiving the remittance request, the remitting bank node reviews it and checks the identity and credit of the payee to see if the remitting bank needs to know more about the remitter. If the review fails, the node returns the processing result to the gateway, which is then delivered to the remitting bank. If the review passes, the node returns the order information, cross-border payment fee, and relevant information of the payee to the gateway, which is then delivered to the remitting bank.
[0069] S2.3.4: After receiving the reply from the remitting bank node, the remitting bank node finds the market maker node that can provide the exchange of the legal currency remittance amount into the digital currency contract amount through the gateway, queries the market maker node for the current exchange rate, and returns the exchange rate to the remitting bank node;
[0070] S2.3.5: The remitting node delivers the details of the handling fee and the exchange rate of the market maker to the remitting party for confirmation and whether to accept the quotation and exchange rate;
[0071] S2.3.6: Based on the details, if the remitter confirms that he can accept the quotation, the remitting bank node sends a confirmation notice to the market maker node and the receiving bank node through the gateway;
[0072] S2.3.7: After receiving the remittance amount in legal currency from the remitting bank node, the market maker node converts the remittance amount in legal currency into the contract amount in digital currency according to the current exchange rate, thereby establishing a remittance transaction block including the remitter information, remitting bank information, contract amount, remitting bank information, and payee information, and broadcasts the block to the consensus node of the blockchain network;
[0073] S2.3.8: The consensus node verifies the validity of the remittance transaction based on the consensus mechanism. When the verification is passed, the remittance transaction is stored in the blockchain network in the order of timestamps.
[0074] S2.3.9: When the valid remittance transaction blocks are stored in the blockchain network in the order of timestamps, the market maker node converts the contract amount of digital currency into the legal currency of the receiving node according to the current exchange rate and pushes it to the receiving node, thereby establishing a transaction completion message block including remitter information, remitting bank information, contract amount, receiving bank information, payee information, remittance amount of legal currency of the remitting bank node, and legal currency of the receiving bank node, and broadcasting it to the blockchain network consensus node;
[0075] S2.3.10: The consensus node verifies the validity of the transaction completion message block based on the consensus mechanism. When the verification is successful, each node generates a transaction record based on the information recorded in the transaction completion message block.
[0076] S3: According to the microservices of the smart contracts of each node proposed in step S2, a series of loosely coupled contract microservices are constructed, and packaged in a containerized form and handed over to the cluster for unified management. Then, the node chain code method of the blockchain cross-border payment system with a microservice architecture is deployed based on Kubernetes for microservice blockchain cross-border payment.
[0077] Figure 3 The node chain code method of the blockchain cross-border payment system based on Kubernetes deployment of microservice architecture and the schematic diagram of incorporating blockchain node chain code into the Kubernetes environment are given. This method can decouple the chain code from the node and incorporate it into the Kubernetes environment, monitor and manage the chain code, and achieve high availability and automated operation and maintenance with the help of the platform. Figure 3 (A) in the figure gives a node chain code method for a blockchain cross-border payment system based on Kubernetes deployment of a microservice architecture. The specific steps are:
[0078] S3.1: Initiate the installation chaincode command to the deployment node through the client CLI or SDK, and package the user-prepared chaincode file and the selected endorsement policy and send them to the specified Peer node;
[0079] S3.2: The Peer node uses Docker to pull the image to create a temporary container TempContainer for chaincode compilation, and compiles the chaincode into an executable file in the container;
[0080] S3.3: Move the compiled files from the temporary container to the directory specified by the container, and send a compilation completion notification to the Peer node;
[0081] S3.4: After receiving the notification that the file compilation is complete, the Peer node calls the image building interface to generate the chaincode image containing the target file and places the generated image in the local image repository of the node where the Kubernetes Node is located. The chaincode installation phase is completed.
[0082] S3.5: The Peer container receives the call chain code from the client or SDK, and the Peer initiates a command to create a pod service in the form of Deployment and Service to the Kube-apiserver. The image generated in step 4 starts the chain code container on the node where the Peer service is located through the nodeSelector in Kubernetes, and installs and instantiates the user chain code based on the chain code image generated in step 4.
[0083] S3.6: The chaincode container is started, and the chaincode Pod and Peer Pod complete the transmission of chaincode execution parameters through the communication protocol between Kubernetes Services, and then execute the chaincode.
[0084] According to the above blockchain cross-border payment chain code method based on Kubernetes deployment microservice architecture, Figure 3 (B) shows that the chain codes of each blockchain node are included in the Kubernetes environment for monitoring and management. According to the specific needs of the application, the number of each component of the cluster can be flexibly configured and adjusted. It is easy to expand and can well meet the requirements in this regard.
[0085] Figure 4 The schematic diagram of the blockchain cross-border payment system architecture based on the microservice architecture of the present invention is shown. The overall architecture of the system has six layers, namely, access layer, service layer, storage layer, blockchain layer, scheduling layer, and resource layer, specifically:
[0086] The access layer implements the system's front-end WebUI and interface access management, and configures the API gateway to call the corresponding service layer services;
[0087] The service layer is one of the core layers of the entire system architecture, including Kubernates cluster management service, disaster recovery management service, and blockchain management service. It provides cluster resource management, deletion, addition, monitoring and display functions in the Kubernates cluster module. The disaster recovery module can realize persistent backup and recovery of on-chain data by calling the distributed file system of the storage layer. At the same time, it provides off-chain storage data, on-chain storage data hash, and off-chain and on-chain data collaborative verification by calling the distributed key-value pair storage of the storage layer to reduce the use of on-chain space and solve the performance and storage bottleneck problems of obtaining on-chain data. The blockchain management module provides management, calling and execution of blockchain layer chain code contracts, and also provides management of blockchain layer node channels and organization block management.
[0088] The storage layer includes distributed key-value pair storage, distributed file system, and distributed object storage. Business data and off-chain structured encrypted data are stored in distributed key-value pair storage, which not only realizes distributed high-availability encrypted storage of off-chain data, but also realizes the goal of deep integration of blockchain cross-border payment system and Kubernates, reduces the complexity of operation and maintenance management system, and enhances system high availability. Distributed object storage off-chain structured encrypted object data and distributed key-value pair storage together realize persistent storage of off-chain data; the distributed file system realizes one-click deployment of the blockchain system, and also realizes distributed persistent backup of blockchain data;
[0089] The blockchain layer, each node of which runs on Kubernates to provide a stable and efficient blockchain network for the blockchain cross-border payment system, completes steps S3.1-S3.6 to transform the chain code into a microservice so that it runs in an independent container, decouples the account management contract, remittance contract, exchange rate query contract, exchange rate management contract and exchange rate conversion contract in the receiving bank node, the remittance bank node and the market maker node from the node, so that each contract microservice and each network node, sorting node and Kafka run in an independent container respectively and are included in the Kubernates environment for monitoring and management;
[0090] The scheduling layer is one of the core layers of the overall system architecture. It configures highly available KubernetesMasters as the underlying foundation of the system to provide container scheduling, data storage, and system operation and maintenance support for the system. By adding high-availability technology, deep integration of on-chain and off-chain data storage with Kubernetes, and calling each contract microservice through load balancing (LoadBalance), the system's availability, executable, high availability, and security of off-chain data are improved;
[0091] The resource layer is the node platform deployed at the bottom of the system, including the cloud platform and virtual machines.
Claims
1. A blockchain cross-border payment method based on microservice architecture, characterized in that: The following steps are involved: S1: Build a blockchain cross-border payment network based on microservice architecture, which includes at least remitting bank nodes, receiving bank nodes, market maker nodes and consensus nodes: The remittance node is used to remit the legal currency of the remitter; The receiving bank node is used to remit the legal currency of the recipient; Market maker nodes are used to exchange legal tender and digital currency according to exchange rate rules, and to establish corresponding transaction blocks and broadcast them to all nodes in the blockchain network; Consensus nodes are used to verify the validity of transaction information according to the consensus mechanism, and store the verified transactions in the blockchain network in timestamp order; S2: Microservice the smart contracts of each node in S1 and build a series of loosely coupled contract microservices. Each contract microservice is designed, developed, deployed and expanded around a specific business function. It interacts through a lightweight communication mechanism to realize cross-border payment business and microservice the smart contracts of each node in the blockchain cross-border payment network. S3: Based on the microservices of the smart contracts of each node proposed in S2, a series of loosely coupled contract microservices are constructed, and packaged in a containerized form and handed over to the cluster for unified management. Then, the node chain code method of the blockchain cross-border payment system with a microservice architecture is deployed based on Kubernetes for microservice blockchain cross-border payment.
2. According to a blockchain cross-border payment method based on microservice architecture according to claim 1, it is characterized in that: The step S2 is specifically as follows: S2.1: Split the business functions of the remitting bank node, receiving bank node, and market maker node, and deploy the account management contract, transfer contract, exchange rate query contract of the remitting bank node and receiving bank node, and the exchange rate management contract and exchange rate conversion contract of the market maker node in a single basic container and decouple them from the underlying consensus node, making the contract an independent module; S2.2: Each node’s smart contract container provides a smart contract runtime environment, provides a more explicit interface to the outside world, builds a series of loosely coupled contract microservices, and packages them in a containerized form for unified management by the cluster; S2.3: The microservices of each node contract built after microservice transformation are communicated through a lightweight communication mechanism; the lightweight communication mechanism includes a method based on remote procedure call or a method based on RESTFUL interface specification.
3. According to claim 2, a blockchain cross-border payment method based on microservice architecture is characterized in that: The step S2.3 is specifically as follows: S2.3.1: The remitter initiates a remittance request through the remitting bank, which includes the remitter information, the remitting bank information, the remitting bank information, the beneficiary information and the contract amount; S2.3.2: The remittance request of the remitter is obtained by the specific gateway of the microservice, which performs corresponding parsing and processing, repackages the remitter's request as information into a specific contract service message and sends it to the node of the receiving bank; S2.3.3: After receiving the remittance request, the remitting bank node reviews it and checks the identity and credit of the payee to see if the remitting bank needs to know more about the remitter. If the review fails, the node returns the processing result to the gateway, which is then delivered to the remitting bank. If the review passes, the node returns the order information, cross-border payment fee, and relevant information of the payee to the gateway, which is then delivered to the remitting bank. S2.3.4: After receiving the reply from the remitting bank node, the remitting bank node finds the market maker node that can provide the exchange of the legal currency remittance amount into the digital currency contract amount through the gateway, queries the market maker node for the current exchange rate, and returns the exchange rate to the remitting bank node; S2.3.5: The remitting node delivers the details of the handling fee and the exchange rate of the market maker to the remitting party for confirmation and whether to accept the quotation and exchange rate; S2.3.6: Based on the details, if the remitter confirms that he can accept the quotation, the remitting bank node sends a confirmation notice to the market maker node and the receiving bank node through the gateway; S2.3.7: After receiving the remittance amount in legal currency from the remitting bank node, the market maker node converts the remittance amount in legal currency into the contract amount in digital currency according to the current exchange rate, thereby establishing a remittance transaction block including the remitter information, remitting bank information, contract amount, remitting bank information, and payee information, and broadcasts the block to the consensus node of the blockchain network; S2.3.8: The consensus node verifies the validity of the remittance transaction based on the consensus mechanism. When the verification is passed, the remittance transaction is stored in the blockchain network in the order of timestamps. S2.3.9: When the valid remittance transaction blocks are stored in the blockchain network in the order of timestamps, the market maker node converts the contract amount of digital currency into the legal currency of the receiving node according to the current exchange rate and pushes it to the receiving node, thereby establishing a transaction completion message block including remitter information, remitting bank information, contract amount, receiving bank information, payee information, remittance amount of legal currency of the remitting bank node, and legal currency of the receiving bank node, and broadcasting it to the blockchain network consensus node; S2.3.10: The consensus node verifies the validity of the transaction completion message block based on the consensus mechanism. When the verification is successful, each node generates a transaction record based on the information recorded in the transaction completion message block.
4. According to a blockchain cross-border payment method based on microservice architecture according to claim 1, it is characterized in that: The S3 is specifically: S3.1: Initiate the installation chaincode command to the deployment node through the Kubernetes client CLI or SDK, and package the user-prepared chaincode file and the selected endorsement policy and send them to the specified Peer node; S3.2: The Peer node uses Docker to pull the image to create a temporary container Temp Container for chain code compilation, and compiles the chain code into an executable file in the container; S3.3: Move the compiled files from the temporary container to the directory specified by the container, and send a compilation completion notification to the Peer node; S3.4: After receiving the notification that the file compilation is complete, the Peer node calls the image building interface to generate the chaincode image containing the target file and places the generated image in the local image repository of the node where the Kubernetes Node is located. The chaincode installation phase is completed. S3.5: The Peer container receives the call chain code from the client or SDK, and the Peer initiates a command to create a pod service in the form of Deployment and Service to the Kube-apiserver, and starts the chain code container on the node where the Peer service is located through the nodeSelector in Kubernetes based on the image generated in step 3.4, and installs and instantiates the user chain code based on the chain code image generated in step 3.4; S3.6: The chaincode container is started, and the chaincode Pod and Peer Pod complete the transmission of chaincode execution parameters through the communication protocol between Kubernetes Services, and then execute the chaincode.
5. A blockchain cross-border payment system based on microservice architecture, used to implement the blockchain cross-border payment method described in claim 1, characterized in that: The overall architecture of the system has six layers, namely access layer, service layer, storage layer, blockchain layer, scheduling layer and resource layer, specifically: The access layer implements the system's front-end WebUI and interface access management, and configures the API gateway to call the corresponding service layer services; The service layer is one of the core layers of the entire system architecture, including Kubernetes cluster management service, disaster recovery management service and blockchain management service. It provides cluster resource management, deletion, addition, monitoring and display functions in the Kubernetes cluster module. The disaster recovery module can realize persistent backup and recovery of on-chain data by calling the distributed file system of the storage layer. At the same time, it provides off-chain storage data, on-chain storage data hash, and off-chain and on-chain data collaborative verification by calling the distributed key-value pair storage of the storage layer to reduce the use of on-chain space and solve the performance and storage bottleneck problems of obtaining on-chain data. The blockchain management module provides management, calling and execution of blockchain layer chain code contracts, as well as management of blockchain layer node channels and organization block management; The storage layer includes distributed key-value pair storage, distributed file system, and distributed object storage. Business data and off-chain structured encrypted data are stored in distributed key-value pair storage, which not only realizes distributed high-availability encrypted storage of off-chain data, but also realizes the goal of deep integration of blockchain cross-border payment system and Kubernates, reduces the complexity of operation and maintenance management system, and enhances system high availability. Distributed object storage off-chain structured encrypted object data and distributed key-value pair storage together realize persistent storage of off-chain data; the distributed file system realizes one-click deployment of the blockchain system, and also realizes distributed persistent backup of blockchain data; The blockchain layer, each node of which runs on Kubernates to provide a stable and efficient blockchain network for the blockchain cross-border payment system, completes the node chain code method of the blockchain cross-border payment system based on Kubernetes deployment of microservice architecture, transforms the chain code into a microservice so that it runs in an independent container, decouples the account management contract, transfer and remittance contract, exchange rate query contract, exchange rate management contract and exchange rate conversion contract in the receiving bank node, the remittance bank node and the market maker node from the node, so that each contract microservice and each network node, sorting node and Kafka run in an independent container respectively and are included in the Kubernates environment for monitoring and management; The scheduling layer is one of the core layers of the overall system architecture. It configures highly available Kubernetes Masters as the underlying foundation of the system to provide container scheduling, data storage, and system operation and maintenance support for the system. By adding high-availability technology, deep integration of on-chain and off-chain data storage with Kubernetes, and calling each contract microservice through load balancing, the system's availability, executability, high availability, and security of off-chain data are improved. The resource layer is the node platform deployed at the bottom of the system, including the cloud platform and virtual machines.
Citation Information
Cited By
Commodity tracing method and system for cross-border logistics
CN119359320A
A commodity traceability method and system for cross-border logistics
CN119359320B
Electric power spot market electricity charge settlement system and method fused with block chain technology
CN120875953A
Block chain public service system and method based on layered architecture
CN121567482A
