Financial business testing method and device based on blockchain, and electronic equipment
By using smart contracts and pre-set business interaction rules in the blockchain network, the problems of low security and high cost in joint testing of financial services are solved, efficient and secure financial business testing is achieved, and the risk of production data leakage is reduced.
Patent Information
- Application Number
- CN202111437352.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2041-11-29
AI Technical Summary
In joint testing of financial services, the existing technology has problems of low security and high cost, especially when financial institutions and third parties jointly testing, the application procedures are cumbersome, requiring high human and material costs, and there is a risk of production data leakage.
Automation and security of financial business testing by using smart contracts and pre-set business interaction rules in the blockchain network. The specific steps include receiving service test requests in the alliance chain network, matching node permissions, completing business interactions with other alliance chain nodes based on the smart contract, and broadcasting the contract execution results to complete business tests.
It reduces the problems of low security and high cost in joint testing of financial services, improves the security and efficiency of testing, reduces the risk of production data leakage, and realizes the automatic reconciliation function.
Smart Images

Figure CN114240614B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based financial business testing method and device, and electronic equipment. Background Art
[0002] Currently, the internal development and testing networks of financial institutions, third-party companies, and card organizations are not connected. For scenarios involving third-party company applications and joint testing of card organizations, both parties need to open firewalls and apply for VPN channels, or third-party companies and card organizations need to work on-site at the internal development site of the financial institution to conduct joint testing. The application procedures are cumbersome and require high human and material costs, which increases the difficulty of verifying end-to-end simulated production scenarios.
[0003] In the related technology, in financial business testing, such as in bank installment payment business testing, there are often scenarios where it is necessary to connect to a third-party company's production environment to obtain data or authentication. For example, the identity authentication system conducts online ID card verification, the People's Bank of China's credit reporting system, the personal credit comprehensive scoring system, etc. There is a risk of production data leakage when simply opening a network interconnection. In addition, in the bank installment payment business testing, each transaction involves the payment and collection processing of the cardholder, the financial institution, and the merchant. The account testing is the top priority of the installment business, and the testing is difficult. There is an urgent need for a low-cost and highly secure testing method and device that can connect all the joint testing parties and automatically reconcile the accounts.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a blockchain-based financial business testing method and device, as well as an electronic device, to at least solve the technical problems of low security and high cost in related technologies when conducting joint testing of financial business.
[0006] According to one aspect of an embodiment of the present invention, there is provided a blockchain-based financial business testing method, which is applied to a first alliance chain node connected to a business processing system, and a plurality of the alliance chain nodes form an alliance chain network, including: receiving a business test request from a second alliance chain node in the alliance chain network, wherein the business test request includes at least: a test business message and node permissions; when the node permissions of the second alliance chain node match the permission table of the first alliance chain node, based on a pre-deployed smart contract and the test business message, completing business interaction with the second alliance chain node to obtain a contract execution result; broadcasting the business information containing the contract execution result to the alliance chain network to complete the business test.
[0007] Optionally, based on the pre-deployed smart contract and the test business message, the step of completing business interaction with the second alliance chain node to obtain the contract execution result includes: calling the smart contract when confirming that the second alliance chain node has the authority to access the first alliance chain node; obtaining the consensus mechanism type in the smart contract and the consensus algorithm corresponding to the consensus mechanism type; executing the consensus algorithm, completing business interaction with the second alliance chain node, and obtaining the contract execution result.
[0008] Optionally, after receiving the business test request from the second alliance chain node in the alliance chain network, it also includes: using pre-set business interaction rules to verify the message data in the test business message to obtain an account verification result; broadcasting the business information containing the account verification result to each alliance chain in the alliance chain network.
[0009] Optionally, a step of using pre-set business interaction rules to check the message data in the test business message to obtain an account reconciliation result includes: when the business interaction rule is an installment payment business rule, using the installment payment business rule to automatically check the debit and credit information in the test business message and the account information of each subject account to obtain an account reconciliation result.
[0010] Optionally, after obtaining the account verification result, it also includes: obtaining business information of business interaction between the first alliance chain node and the second alliance chain node; adding a timestamp to the business information; and broadcasting the business information with the timestamp to multiple alliance chain nodes in the alliance chain network.
[0011] Optionally, the first alliance chain node of the business processing system initiates an alliance chain access application, wherein, after receiving the alliance chain access application, the alliance chain network assigns a device identification and node permissions to the first alliance chain node, and the device identification is encrypted and saved in the local memory of the business processing system; receives the device identification and the node permissions assigned by the alliance chain network; encrypts the node permissions and registers the encrypted node permissions in a permission management table; and broadcasts the permission management table to each alliance chain node of the alliance chain network.
[0012] Optionally, the types of the smart contract include: a business contract using the test business message, a business risk level contract, and a business authorization contract.
[0013] Optionally, the types of the business processing system include: installment payment business system, merchant account processing system, payment platform account processing system, identity information verification system, credit reporting system, and third-party credit scoring system.
[0014] According to another aspect of an embodiment of the present invention, a blockchain-based financial business testing device is also provided, characterized in that it is applied to a first alliance chain node connected to a certain business processing system, and multiple alliance chain nodes form an alliance chain network, and the alliance chain node includes: a smart contract management unit, and the contract execution module in the smart contract management unit is used to execute the following method: receiving a business test request from a second alliance chain node in the alliance chain network, wherein the business test request at least includes: a test business message and node permissions; when the node permissions of the second alliance chain node match the permission table of the first alliance chain node, based on the pre-deployed smart contract and the test business message, completing business interaction with the second alliance chain node to obtain a contract execution result; broadcasting the business information containing the contract execution result to the alliance chain network to complete the business test.
[0015] Optionally, the contract execution module includes: an account verification module, which uses pre-set installment payment business rules to automatically verify the loan information in the test business message and the account information of each subject account to obtain an account verification result.
[0016] Optionally, the smart contract management unit also includes: a contract construction module for setting the consensus mechanism type; a contract deployment module for deploying a consensus algorithm corresponding to the consensus mechanism type, wherein the consensus algorithm is one of the following: a Byzantine fault tolerance mechanism, or a hybrid mechanism of a share authorization proof mechanism and a Byzantine fault tolerance mechanism.
[0017] Optionally, the smart contract management unit also includes: a permission management module, which is used to manage the permission management table of the first alliance chain node of the business processing system, wherein the permission management table stores the encrypted node permissions of each alliance chain node; and a local memory, which stores the encrypted device identification of each of the business processing systems.
[0018] Optionally, the smart contract management unit also includes: a broadcast module, used to obtain business information of business interaction between the first alliance chain node and the second alliance chain node, add a timestamp to the business information, and broadcast the business information with the timestamp to multiple alliance chain nodes in the alliance chain network.
[0019] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned blockchain-based financial business testing methods.
[0020] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned blockchain-based financial business testing methods.
[0021] In the present disclosure, a business test request of the second alliance chain node in the alliance chain network is received. When the node authority of the second alliance chain node matches the authority table of the first alliance chain node, the business interaction is completed with the second alliance chain node based on the pre-deployed smart contract and test business message, and the contract execution result is obtained. The business information containing the contract execution result is broadcast to the alliance chain network to complete the business test. In this application, the business processing systems participating in the financial business test can be formed into an alliance chain network so that each system can be interconnected, and business tests are performed in the alliance chain network based on the pre-deployed smart contract. This not only solves the problem of cumbersome application procedures and manpower and material costs for joint testing between financial institutions and third parties during business testing, but also reduces the risk of production data leakage during joint testing, improves the security of the test, and thus solves the technical problems of low security and high cost in the related technology when conducting joint testing of financial services. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0023] Figure 1 is a flowchart of an optional blockchain-based financial business testing method according to an embodiment of the present invention;
[0024] Figure 2 is a schematic diagram of an optional blockchain-based financial business testing system structure according to an embodiment of the present invention;
[0025] Figure 3 is a schematic diagram of an optional application system node device according to an embodiment of the present invention;
[0026] Figure 4 is a schematic diagram of an optional smart contract management module according to an embodiment of the present invention;
[0027] Figure 5 is a schematic diagram of an optional financial service testing device according to an embodiment of the present invention;
[0028] Figure 6It is a flow chart of an optional blockchain-based joint test between a financial institution system and a third-party system according to an embodiment of the present invention;
[0029] Figure 7 is a schematic diagram of an optional transaction message management specification according to an embodiment of the present invention;
[0030] Figure 8 It is a hardware structure block diagram of an electronic device (or mobile device) for implementing a blockchain-based financial business testing method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] To facilitate those skilled in the art to understand the present invention, some terms or nouns involved in the embodiments of the present invention are explained below:
[0034] Blockchain system: It is a decentralized distributed accounting system that links blocks using cryptographic methods. It has the characteristics of openness, transparency, immutability, and traceability, and can effectively ensure the authenticity of transactions.
[0035] It should be noted that the blockchain-based financial business testing method and device in the present disclosure can be used in the field of blockchain technology when testing financial business, and can also be used in any field outside the field of blockchain technology when testing financial business. The present disclosure does not limit the application field of the blockchain-based financial business testing method and device.
[0036] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0037] The following embodiments of the present invention can be applied to various systems / applications / devices for testing financial services, and the financial services involved include but are not limited to: installment payment services, loan services, etc. The present invention utilizes the identity identification of the blockchain to conveniently realize the identity authentication of transaction participants, thereby realizing the transaction authorization of devices or users, and based on the alliance chain jointly participated by several institutions, it has a high degree of trust in the joining nodes, and can realize the characteristics of data sharing between institutions. A financial business testing method based on a regional chain is proposed, which can effectively connect the various joint testing parties, solve the problem of cumbersome application procedures for joint testing between financial institutions and third parties during the testing process, and consume manpower and material costs, reduce the risk of production data leakage during the joint testing process, and can also realize the automatic reconciliation function.
[0038] Embodiment 1
[0039] According to an embodiment of the present invention, an embodiment of a financial business testing method based on blockchain is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0040] A blockchain-based financial business testing method provided by an embodiment of the present invention can be applied to a first alliance chain node connected to a business processing system, and multiple alliance chain nodes constitute an alliance chain network.
[0041] Figure 1 is a flowchart of an optional blockchain-based financial business testing method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0042] Step S101, receiving a service test request from a second alliance chain node in the alliance chain network, wherein the service test request at least includes: a test service message and node authority.
[0043] Step S102, when the node authority of the second alliance chain node matches the authority table of the first alliance chain node, based on the pre-deployed smart contract and test business message, complete the business interaction with the second alliance chain node to obtain the contract execution result.
[0044] Step S103, broadcast the business information including the contract execution results to the alliance chain network to complete the business test.
[0045] Through the above steps, the business test request of the second alliance chain node in the alliance chain network can be received. When the node authority of the second alliance chain node matches the authority table of the first alliance chain node, the business interaction with the second alliance chain node is completed based on the pre-deployed smart contract and the test business message, and the contract execution result is obtained. The business information containing the contract execution result is broadcast to the alliance chain network to complete the business test. In an embodiment of the present invention, the business processing systems participating in the financial business test can be formed into an alliance chain network so that each system can be interconnected, and based on the pre-deployed smart contract, the business test is performed in the alliance chain network, which not only solves the problem of cumbersome application procedures and manpower and material costs for joint testing between financial institutions and third parties during business testing, but also reduces the risk of production data leakage during joint testing, improves the security of the test, and thus solves the technical problems of low security and high cost in the related technology when conducting joint testing of financial services.
[0046] The embodiment of the present invention is described in detail below in combination with the above steps.
[0047] Figure 2 is a schematic diagram of an optional blockchain-based financial business test system structure according to an embodiment of the present invention, such as Figure 2 As shown, the system structure tests financial services through an alliance chain composed of blockchain nodes 1-N represented by application system node devices 1-N. Figure 3 is a schematic diagram of an optional application system node device according to an embodiment of the present invention, such as Figure 3 As shown, the application system node device includes: encryption and decryption module, smart contract module, broadcast module, permission management table, test result display module, and the business processing system is connected to the alliance chain through the application system node device. The types of business processing systems include but are not limited to: installment payment business system, merchant account processing system, payment platform account processing system, identity information verification system, credit reporting system, third-party credit scoring system, etc.
[0048] In the embodiment of the present invention, multiple alliance chain nodes form an alliance chain network (the network may be a wide area network or a local area network, etc.).
[0049] Optionally, the first alliance chain node of the business processing system initiates an alliance chain access application, wherein, after receiving the alliance chain access application, the alliance chain network assigns a device identification and node permissions to the first alliance chain node, and the device identification is encrypted and saved in the local memory of the business processing system; receives the device identification and node permissions assigned by the alliance chain network; encrypts the node permissions and registers the encrypted node permissions in the permission management table; and broadcasts the permission management table to each alliance chain node of the alliance chain network.
[0050] In an embodiment of the present invention, any business processing system needs to be connected to the alliance chain through an application system node device. The application system node device can join the alliance chain only after application (that is, the first alliance chain node of the business processing system needs to initiate an alliance chain access application before it can join the alliance chain). Each node in the chain (that is, each first alliance chain node) has a unique device identifier (in this embodiment, a digital ID is used as the device identifier for illustrative purposes, but it is not limited to the digital ID, and it can also be a MAC address or a digital string, etc.), which is used for device verification and authorization when a transaction is initiated. In addition, all device identifiers and the scope of permissions that the device can access (that is, node permissions) exist in the permission management table of each node (that is, after receiving the alliance chain access application, the alliance chain network allocates a device identifier and node permissions to the first alliance chain node, and the device identifier is encrypted and stored in the local memory of the business processing system).
[0051] Since some application system nodes (i.e., the first alliance chain nodes) are directly connected to the alliance chain in the production environment, for example, key data systems such as the user identity network verification system and the credit reporting system, there is a risk of data leakage and tampering, and user operation permissions (i.e., node permissions) need to be strictly controlled. Therefore, after receiving the device identification and node permissions assigned by the alliance chain network, the node permissions are encrypted, and the encrypted node permissions are registered in the permission management table, and the permission management table is broadcast to each alliance chain node in the alliance chain network.
[0052] Step S101, receiving a service test request from a second alliance chain node in the alliance chain network, wherein the service test request at least includes: a test service message and node authority.
[0053] In an embodiment of the present invention, each business processing system that needs to participate in the test can be connected to the alliance chain network, so that each business processing system corresponds to an alliance chain node. When a business test request is received from a second alliance chain node in the alliance chain network, the alliance chain network can be used to perform business testing.
[0054] The service test request includes: test service message and node authority, etc., wherein the test service message needs to be encrypted by the encryption and decryption module before being uploaded to the alliance chain network. The encryption algorithms used by the encryption and decryption module include but are not limited to: DES, 3DES, SM9 and other encryption algorithms. This embodiment takes SM9 as an example for detailed description. The SM9 algorithm is based on the 256-bit BN elliptic curve, using the prime field Fp and the finite field Fp2, and the bilinear pairing uses R-ate. The curve parameters mainly include: elliptic curve equation: y2=x3+b, equation parameter b, parameter t, base field feature q, group order N, cofactor cf, group 1 generator P1=(xp1,yp1), group 2 generator P2=(xp2,yp2).
[0055] The specific process is as follows:
[0056] The key using the SM9 algorithm can be generated by KGC (Key Generation Center), which mainly includes the KGC encryption master key pair and the user's private key, the data encryption master key pair: its private key is a random number in the range of [1, N-1]; the public key is a multiple of the base point P1 of the G1 group, and the multiple is the private key.
[0057] The public and private keys of the master key pair are used in different scenarios, where the master private key is only used to query the user's private key; the master public key is made public by KGC and used on the chain. The query user's private key is generated by KGC, including the signature private key and the encryption private key; the signature private key: is a multiple of the base point P1 of the G1 group, and the signature private key is only used in digital signatures; the encryption private key: is a multiple of the base point P2 of the G2 group, and the encryption private key is used for key unsealing, decryption and key exchange. KGC uses the master private key and the user identity (hereinafter referred to as ID, sent to the group through the database auxiliary device) to generate the user's private key.
[0058] The encryption process is as follows: let the production data to be encrypted be M, menl be the bit length of M, K1_len be the bit length of the block cipher algorithm K1, K2_len be the bit length of the key K2 in the function MAC(K2, Z), the encryption master public key Ppub-e, the identifier hid, and the query user ID.
[0059] The operation is as follows:
[0060] (1) Calculate the element QB in group G1 = [H1(ID||hid,N)]P1+Ppub-e;
[0061] (2) Generate a random number r in the range [1, N-1];
[0062] (3) Calculate the element C1=[r]QB in the group G1 and convert the data type of C1 into a bit string;
[0063] (4) Calculate the element g=e(Ppub-e,P2) in the group Gr;
[0064] (5) Calculate the rth power of the element w=g in Gr, and convert the data type of w into a bit string;
[0065] (6) Calculate by encryption method: If the encryption method is a key-derived sequence cipher algorithm, calculate the integer klen=mlen+K2_len, then calculate K=KDF(C1||w||ID,klen), let K1 be the leftmost menl bits of K, K2 be the remaining K2_len bits, if K1 is a string of all 0 bits, return to 2 and re-execute, otherwise calculate C2 as the XOR of M and K1; If the encryption method is a key-derived block cipher algorithm, calculate the integer klen=K1_len+K2_len, then calculate K=KDF(C1||w||ID,klen), let K1 be the leftmost K1_len bits of K, K2 be the remaining K2_len bits, if K1 is a string of all 0 bits, return to 2 and re-execute, otherwise calculate C2=Enc(K1,M);
[0066] (7) Calculate C3 = MAC (K2, C2);
[0067] (8) Output ciphertext C=C1||C2||C3.
[0068] The decryption process is: let mlen be the bit length of C2 in the ciphertext C=C1||C2||C3, K1_len be the bit length of the key K1 in the block cipher algorithm, and K2_len be the bit length of the key K2 in the function MAC(K2,Z).
[0069] (1) Extract the bit string C1 from C, convert the data type of C1 into a point on the elliptic curve, and verify whether C1 is in G1. If not, report an error and exit;
[0070] (2) Calculate the element w'=e(C1, deg) in the group Gr, and convert the data type of w' into a bit string;
[0071] (3) Classification and calculation according to the method of encrypting plaintext:
[0072] 1) If the method for encrypting plaintext is a serial cipher algorithm based on a key derivation function, then calculate the integer klen=menl+K2_len, and then calculate K'=KDF(C1||w'||ID,klen), let K1' be the leftmost mlen bits of K', and K2' be the remaining K2_len bits. If K1' is a string of all 0 bits, then report an error and exit, otherwise calculate M' as the exclusive OR of C2 and K1';
[0073] 2) If the method for encrypting plaintext is a block cipher algorithm based on a key derivation function, calculate the integer klen=K1_len+K2_len, and then calculate K'=KDF(C1||w'||ID,klen), let K1' be the leftmost K1_len bits of K', and K2' be the remaining K2_len bits. If K1' is a string of all 0 bits, report an error and exit, otherwise calculate M'=Dec(K1',C2).
[0074] (4) Calculate u = MAC (K2', C2), extract the bit string C3 from C. If u is not equal to C3, report an error and exit;
[0075] (5) Output plaintext M'.
[0076] After the message data is encrypted, the public key encrypted message data is sent to the chain, and the decryption key is stored in the corresponding application system node device. The user decrypts the encrypted message data with the obtained private key.
[0077] For node permissions, they also need to be encrypted by the encryption and decryption module before being uploaded to the alliance chain network, and the node permissions need to be attached to the test business message and uploaded to the alliance chain network together with the test business message.
[0078] Optionally, after receiving the business test request from the second alliance chain node in the alliance chain network, it also includes: using pre-set business interaction rules to verify the message data in the test business message to obtain the account verification result; broadcasting the business information containing the account verification result to each alliance chain in the alliance chain network.
[0079] In an embodiment of the present invention, business interaction rules can be set in advance, for example, the "basic principles of accounting": there must be a debit for every credit, and the debit and credit must be equal; trial balance of amount (vertical): the total debit amount of all accounts in this period = the total credit amount of all accounts in this period; trial balance of balance (horizontal): the total beginning balance of accounts under the same subject + the total amount of accounts under the same subject in this period = the total ending balance of accounts under the same subject in this period. Based on the set business interaction rules, the message data in the test business message (for example, the debit and credit amounts, the balances of each account) is checked to obtain the account verification results, and the business information of the account verification results can be broadcast to each alliance chain in the alliance chain network to achieve consistency of the ledger information of each node on the alliance chain to prevent tampering.
[0080] Optionally, a step is performed to use pre-set business interaction rules to check message data in the test business message to obtain an account reconciliation result, including: when the business interaction rule is an installment payment business rule, the installment payment business rule is used to automatically check the debit and credit information in the test business message and the account information of each subject account to obtain an account reconciliation result.
[0081] In an embodiment of the present invention, if the business interaction rules are installment payment business rules (i.e., "basic principles of accounting verification"), the debit and credit amounts (i.e., debit and credit information) and the balances of each subject account (i.e., account information of each subject account) in the test business message can be automatically checked, and the transaction results and account verification results can be displayed in real time in the test result display module.
[0082] Optionally, after obtaining the account verification result, it also includes: obtaining business information of business interaction between the first alliance chain node and the second alliance chain node; adding a timestamp to the business information; and broadcasting the business information with the timestamp to multiple alliance chain nodes in the alliance chain network.
[0083] In an embodiment of the present invention, when any node initiates a transaction operation, the broadcast module can add an unalterable timestamp to each record (that is, a timestamp can be added to the acquired business information), and notify the entire network (that is, broadcast the timestamped business information to multiple alliance chain nodes in the alliance chain network) to verify the authenticity of the transaction. The underlying layer of the entire blockchain network (that is, the alliance chain network) is an alliance chain. Based on the Fabric data synchronization mechanism, the consistency of the ledger information of each alliance chain node on the alliance chain can be achieved to prevent tampering.
[0084] Step S102, when the node authority of the second alliance chain node matches the authority table of the first alliance chain node, based on the pre-deployed smart contract and test business message, complete the business interaction with the second alliance chain node to obtain the contract execution result.
[0085] Figure 4 is a schematic diagram of an optional smart contract management module according to an embodiment of the present invention, such as Figure 4 As shown, the smart contract management module includes: a contract construction module, a contract deployment module, and a contract execution module.
[0086] In an embodiment of the present invention, the consensus mechanism type, response conditions, and response rules (i.e., pre-deploy smart contracts) can be pre-set through the contract construction module, where the types of smart contracts include but are not limited to: transaction message specification contracts, transaction risk level contracts, transaction authorization contracts, etc. The subjects participating in the transaction (i.e., the business processing system) participate in the consensus verification of the alliance chain through the corresponding alliance chain nodes. The consensus node only obtains the transaction results and transaction terminal information, but not all the account book data, to prevent the consensus node from leaking user identity authentication data and personal credit score data. After the consensus verification is completed, the business interaction can be completed with the second alliance chain node based on the pre-deployed smart contract and test business message to obtain the contract execution result.
[0087] Optionally, based on the pre-deployed smart contract and test business message, the step of completing business interaction with the second alliance chain node to obtain the contract execution result includes: calling the smart contract after confirming that the second alliance chain node has the authority to access the first alliance chain node; obtaining the consensus mechanism type in the smart contract and the consensus algorithm corresponding to the consensus mechanism type; executing the consensus algorithm, completing business interaction with the second alliance chain node, and obtaining the contract execution result.
[0088] In an embodiment of the present invention, a consensus algorithm corresponding to the consensus mechanism type can be deployed through a contract deployment module (i.e., the consensus mechanism type in the smart contract and the consensus algorithm corresponding to the consensus mechanism type are obtained), wherein the consensus algorithm includes but is not limited to: a practical Byzantine fault tolerance mechanism PBFT (Practical Byzantine Fault Tolerance), a delegated proof of stake mechanism DPoS (Delegated Proof of Stake) and a hybrid mechanism of PBFT, etc. In order to reduce transaction costs while reducing energy consumption in the consensus algorithm process, a POA (proof of activity) consensus algorithm can also be selected, and the consensus mechanism type can also be customized according to actual conditions, which is not limited in this embodiment.
[0089] This embodiment is described in detail by taking the Byzantine fault tolerance mechanism PBFT as an example. When the Byzantine fault tolerance mechanism PBFT is adopted, the system limits the damage that may be caused by failed clients through access control, audits clients and prevents clients from initiating operations that they are not authorized to perform. At the same time, the service can provide operations to change the access rights of a client, because the algorithm ensures that the permission revocation operation can be observed by all clients. This method can provide a powerful mechanism to recover from failed client attacks.
[0090] Moreover, after the smart contract is generated, this embodiment can be published and spread through the P2P (peer-to-peer network) network and stored in the alliance chain.
[0091] In an embodiment of the present invention, when a message request (i.e., a test business message) is received from a consortium chain node, it is possible to first check whether its authority matches the authority table of this node (i.e., the first consortium chain node). If they do not match, the transaction is rejected. If they match, it is determined whether the node has the authority to access this node. If it does not have the authority, the transaction is rejected. If it has the authority (i.e., after confirming that the second consortium chain node has the authority to access the first consortium chain node), the smart contract is called through the contract execution module to obtain the consensus mechanism type in the smart contract (i.e., obtain the consensus mechanism type in the smart contract and the consensus algorithm corresponding to the consensus mechanism type), execute the corresponding consensus algorithm, complete the business interaction with the second consortium chain node, and obtain the contract execution result.
[0092] Optionally, the types of smart contracts include: business contracts using test business messages, business risk level contracts, and business authorization contracts.
[0093] Step S103, broadcast the business information including the contract execution results to the alliance chain network to complete the business test.
[0094] In an embodiment of the present invention, the contract execution result can be broadcasted in the alliance chain network through the broadcast module (that is, the business information containing the contract execution result is broadcasted to the alliance chain network) to complete the business test.
[0095] The embodiment of the present invention forms a consortium chain network with business processing systems participating in financial business testing so that each system can be interconnected, and conducts business testing in the consortium chain network based on a pre-deployed smart contract. This not only solves the problem of cumbersome application procedures for joint testing between financial institutions and third parties and the waste of manpower and material resources during business testing, but also reduces the risk of production data leakage during the joint testing process, improves the security of the test, and can also realize the function of automatic reconciliation of accounts in the consortium chain network.
[0096] Embodiment 2
[0097] Figure 5 is a schematic diagram of an optional financial service testing device according to an embodiment of the present invention, such as Figure 5 As shown, the test device includes: a smart contract management unit, wherein the smart contract management unit includes: a contract execution module, an account verification module, a contract construction module, a contract deployment module, a permission management module, a local memory, and a broadcast module.
[0098] An embodiment of the present invention is applied to a first alliance chain node connected to a business processing system, and multiple alliance chain nodes form an alliance chain network. The alliance chain node includes: a smart contract management unit, and a contract execution module in the smart contract management unit is used to execute the following method: receiving a business test request from a second alliance chain node in the alliance chain network, wherein the business test request at least includes: a test business message and node permissions; when the node permissions of the second alliance chain node match the permission table of the first alliance chain node, based on the pre-deployed smart contract and test business message, completing business interaction with the second alliance chain node to obtain a contract execution result; broadcasting the business information containing the contract execution result to the alliance chain network to complete the business test.
[0099] Optionally, the contract execution module includes: an account verification module, which uses pre-set installment payment business rules to automatically verify the debit and credit information in the test business message and the account information of each subject account to obtain the account verification result.
[0100] Optionally, the smart contract management unit also includes: a contract construction module, used to set the consensus mechanism type; a contract deployment module, used to deploy a consensus algorithm corresponding to the consensus mechanism type, wherein the consensus algorithm is one of the following: a Byzantine fault tolerance mechanism, or a hybrid mechanism of a share authorization proof mechanism and a Byzantine fault tolerance mechanism.
[0101] In an embodiment of the present invention, the contract construction module in the smart contract management unit is used to set the consensus mechanism type, preset response conditions, and preset response rules, including but not limited to: transaction message specification contract, transaction risk level contract, transaction authorization contract, etc. The subject participating in the transaction (business processing system) participates in the consensus verification of the alliance chain through the corresponding alliance chain node. The consensus node only obtains the transaction results and transaction terminal information, and does not obtain all the ledger data, so as to prevent the leakage of user identity authentication data and personal credit score data from the consensus node.
[0102] The contract signing module in the smart contract management unit is used to deploy a consensus algorithm corresponding to the consensus mechanism type, where the consensus algorithm includes but is not limited to: Practical Byzantine Fault Tolerance (PBFT), Delegated Proof of Stake (DPoS) and a hybrid mechanism of PBFT. In order to reduce transaction costs and energy consumption during the consensus algorithm process, the POA consensus algorithm can also be selected. In addition, the consensus mechanism type can also be customized according to actual conditions, which is not limited in this embodiment.
[0103] This embodiment is described in detail by taking the Byzantine fault tolerance mechanism PBFT as an example. When the Byzantine fault tolerance mechanism PBFT is adopted, the system limits the damage that may be caused by failed clients through access control, audits clients and prevents clients from initiating operations that they are not authorized to perform. At the same time, the service can provide operations to change the access rights of a client, because the algorithm ensures that the permission revocation operation can be observed by all clients. This method can provide a powerful mechanism to recover from failed client attacks.
[0104] Furthermore, after the smart contract is generated, the smart contract can be published and spread through the P2P network and stored in the alliance chain.
[0105] The contract execution module in the smart contract management unit calls the smart contract, obtains the consensus mechanism type in the smart contract, and executes the corresponding consensus algorithm. When the contract execution module receives a message request (i.e., a business test request) from the alliance chain node, it first checks whether its authority matches the authority table of this node. If it does not match, the transaction is rejected. If it matches, it determines whether it has the authority to access this node. If it does not have the authority, the transaction is rejected. If it has the authority, the business processing system is called to return the contract execution result to the requester.
[0106] The specific execution method of the contract execution module is as follows: receiving a business test request from the second alliance chain node in the alliance chain network, wherein the business test request includes at least: test business messages and node permissions; when the node permissions of the second alliance chain node match the permission table of the first alliance chain node, based on the pre-deployed smart contract and test business messages, completing business interaction with the second alliance chain node to obtain the contract execution result; broadcasting the business information containing the contract execution result to the alliance chain network to complete the business test.
[0107] In addition, the contract execution module includes: an account verification module, which uses the pre-set installment payment business rules to automatically verify the loan information in the test business message and the account information of each subject account to obtain the account verification result, wherein the installment payment business rules can be set as follows:
[0108] There must be a debit for every credit, and the debit and credit must be equal; trial balance of amounts (vertical): the total debit amounts of all accounts in this period = the total credit amounts of all accounts in this period; trial balance of balances (horizontal): the total beginning balances of accounts under the same subject + the total amounts of accounts under the same subject in this period = the total ending balances of accounts under the same subject in this period.
[0109] Based on the set installment payment business rules, the debit and credit information in the test business message and the account information of each subject account can be automatically checked to obtain the account verification result.
[0110] Optionally, the smart contract management unit also includes: a permission management module, which is used to manage the permission management table of the first alliance chain node of the business processing system, in which the encrypted node permissions of each alliance chain node are stored; and a local memory, which stores the encrypted device identification of each business processing system.
[0111] In the embodiment of the present invention, the permission management module in the smart contract management unit is used for the permission management and control of the alliance chain nodes, implements access and exit control of the nodes in the alliance chain network, and defines the operable scope of users on each member node. In this embodiment, after the node applies to join the alliance chain, each node in the chain has a unique digital ID as a device identifier, which is used for device verification and authorization when the transaction is initiated. All device identifiers and the scope of permissions that the device can access exist in the permission management table of each node. When trading, the access rights of the node are attached to the transaction message. Only when the permission message of the sending node matches the permission message of the receiving node, the sending node is allowed to access the receiving node, otherwise, the receiving node refuses to respond.
[0112] Since some application system nodes are directly connected to the alliance chain in the production environment, for example, key data systems such as the user identity network verification system and the credit reporting system, there is a risk of data leakage and tampering. User operation permissions need to be strictly controlled, and the permission management table needs to be encrypted and stored in each node of the alliance chain. When reading, the node's private key is used for decryption.
[0113] Optionally, the smart contract management unit also includes: a broadcast module, used to obtain business information of business interaction between the first alliance chain node and the second alliance chain node, add a timestamp to the business information, and broadcast the business information with the timestamp to multiple alliance chain nodes in the alliance chain network.
[0114] In an embodiment of the present invention, the broadcast module in the smart contract management unit can broadcast a new permission table in the alliance chain when a new node joins or an old node exits, and the receiving node updates the permission table of each node. At the same time, when any node initiates a transaction operation, the module adds an unalterable timestamp to each record, and notifies the entire network to verify the authenticity of the transaction.
[0115] The embodiments of the present invention adopt a blockchain-based financial business testing device to perform business testing, which not only solves the problem of complicated application procedures for joint testing between financial institutions and third parties and the waste of manpower and material resources during business testing, but also reduces the risk of production data leakage during the joint testing process, improves the security of the test, and can also realize the function of automatic reconciliation of accounts in the alliance chain network.
[0116] Embodiment 3
[0117] Figure 6is a flowchart of an optional blockchain-based joint test between a financial institution system and a third-party system according to an embodiment of the present invention, such as Figure 6 As shown, the specific steps are as follows:
[0118] S601, the application system node device initiates an alliance chain access application, allocates a unique digital ID as a device identifier, allocates permissions and registers a permission table. The digital ID is connected to the alliance chain for registration and generation before the initial launch, and is encrypted by the encryption and decryption module and saved locally in the application system node as the identity credential of the node.
[0119] S602, set the permissions of the newly added node into the permission table, encrypt it through the encryption and decryption module, broadcast the new permission table in the alliance chain, and the receiving node updates the permission table of each node.
[0120] S603, the application system node device initiates a transaction request, according to the pre-set authority management specification C300, such as Figure 7 As shown, the authority management specification C300 includes: user query application division principle C310, user query data volume principle C320, etc. Use the private key to call the encryption and decryption module for decryption. First, check whether its authority matches the authority table of this node. If not, the transaction is rejected. If it matches, determine whether it has the authority to access this node. If not, the transaction is rejected. If with authority, call the business processing system and call the encryption and decryption module to encrypt the contract execution result.
[0121] S604, at the same time, according to the pre-set installment transaction specification C400, such as Figure 7 As shown, the installment transaction specification C400 includes: lending institution C410, account data C420, etc. According to the "basic principles of accounting verification", the debit and credit amounts in the transaction message and the balances of each account are automatically verified, and the transaction results and account verification results are displayed in real time in the test result display module.
[0122] S605, the broadcast module adds an unalterable timestamp to each record, notifies the entire network, verifies the authenticity of the transaction, and records the transaction information in the alliance chain.
[0123] The embodiments of the present invention test financial services through a joint testing method between a financial institution system and a third-party system based on blockchain, which not only solves the problem of cumbersome application procedures and waste of manpower and material resources for joint testing between financial institutions and third parties during business testing, but also reduces the risk of production data leakage during the joint testing process, improves the security of the test, and can also realize the function of automatic reconciliation of accounts in the alliance chain network.
[0124] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned blockchain-based financial business testing methods.
[0125] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned blockchain-based financial business testing methods.
[0126] Figure 8 1 is a hardware structure block diagram of an electronic device (or mobile device) for implementing a blockchain-based financial service testing method according to an embodiment of the present invention. Figure 8 As shown, the electronic device may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 8 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 8 More or fewer components as shown, or with Figure 8 Different configurations are shown.
[0127] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0128] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0129] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0130] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0131] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0132] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0133] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A financial business testing method based on blockchain, characterized in that: The first alliance chain node used to connect to a business processing system. Multiple alliance chain nodes form an alliance chain network. The business processing system participates in the consensus verification of the alliance chain through the corresponding alliance chain node. The consensus node only obtains the transaction results and transaction terminal information, and does not obtain all the ledger data, including: The first alliance chain node of the business processing system initiates an alliance chain access application, wherein the alliance chain network allocates a device identification and node authority to the first alliance chain node after receiving the alliance chain access application, and the device identification is encrypted and stored in the local memory of the business processing system; receives the device identification and the node authority allocated by the alliance chain network; encrypts the node authority and registers the encrypted node authority in the authority management table; broadcasts the authority management table to each alliance chain node of the alliance chain network; Receiving a service test request from a second alliance chain node in the alliance chain network, wherein the service test request at least includes: a test service message and node authority; When the node authority of the second alliance chain node matches the authority table of the first alliance chain node, based on the pre-deployed smart contract and the test business message, the business interaction is completed with the second alliance chain node to obtain the contract execution result; The business information containing the contract execution result is broadcast to the alliance chain network to complete the business test.
2. The financial service testing method according to claim 1, characterized in that: The step of completing business interaction with the second alliance chain node based on the pre-deployed smart contract and the test business message to obtain the contract execution result includes: In the case of confirming that the second alliance chain node has the authority to access the first alliance chain node, calling the smart contract; Obtain the consensus mechanism type in the smart contract and the consensus algorithm corresponding to the consensus mechanism type; Execute the consensus algorithm, complete business interaction with the second alliance chain node, and obtain the contract execution result.
3. The financial service testing method according to claim 1, characterized in that: After receiving the service test request of the second alliance chain node in the alliance chain network, the method further includes: Using the pre-set business interaction rules, the message data in the test business message is checked to obtain the account checking result; The business information including the account verification result is broadcast to each alliance chain of the alliance chain network.
4. The financial service testing method according to claim 3, characterized in that: The step of using a preset business interaction rule to check the message data in the test business message to obtain an account checking result includes: In the case where the business interaction rule is an installment payment business rule, the installment payment business rule is used to automatically check the debit and credit information in the test business message and the account information of each subject account to obtain an account checking result.
5. The financial service testing method according to claim 3, characterized in that: After obtaining the account verification results, it also includes: Obtaining business information of business interaction between the first alliance chain node and the second alliance chain node; Adding a timestamp to the business information; The business information with the timestamp added is broadcast to multiple alliance chain nodes in the alliance chain network.
6. The financial service testing method according to any one of claims 1 to 5, characterized in that: The types of smart contracts include: business contracts using the test business message, business risk level contracts, and business authorization contracts.
7. The financial service testing method according to any one of claims 1 to 5, characterized in that: The types of business processing systems include: installment payment business system, merchant account processing system, payment platform account processing system, identity information verification system, credit reporting system, and third-party credit scoring system.
8. A financial business testing device based on blockchain, characterized in that: A first alliance chain node used for docking with a certain business processing system, wherein a plurality of the alliance chain nodes form an alliance chain network, and the alliance chain nodes include: The first alliance chain node of the business processing system initiates an alliance chain access application, wherein the alliance chain network allocates a device identification and node authority to the first alliance chain node after receiving the alliance chain access application, and the device identification is encrypted and stored in the local memory of the business processing system; receives the device identification and the node authority allocated by the alliance chain network; encrypts the node authority and registers the encrypted node authority in the authority management table; broadcasts the authority management table to each alliance chain node of the alliance chain network; A smart contract management unit, wherein the contract execution module in the smart contract management unit is used to execute the following method: receiving a business test request from a second alliance chain node in the alliance chain network, wherein the business test request at least includes: a test business message and a node authority; when the node authority of the second alliance chain node matches the authority table of the first alliance chain node, based on the pre-deployed smart contract and the test business message, completing business interaction with the second alliance chain node to obtain a contract execution result; broadcasting the business information containing the contract execution result to the alliance chain network to complete the business test; Among them, the business processing system participates in the consensus verification of the alliance chain through the corresponding alliance chain nodes. The consensus nodes only obtain transaction results and transaction terminal information, but not all ledger data.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the blockchain-based financial business testing method described in any one of claims 1 to 8.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the blockchain-based financial business testing method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Operation data processing method and device in block chain, electronic equipment and storage medium
CN110390524A
Asset management method and device based on blockchain, and electronic equipment
CN111383120A
Block chain-based data sharing platform system, equipment and data sharing method
CN112583802A