Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
To facilitate understanding of the invention by those skilled in the art, some terms or nouns referred to in the embodiments of the invention are explained below:
the block chain system: the distributed accounting system is a decentralized distributed accounting system, blocks are related by a cryptography method, and the distributed accounting system has the characteristics of openness, transparency, no tampering, traceability and the like, and can effectively ensure the authenticity of transactions.
It should be noted that the block chain based financial service testing method and apparatus thereof in the present disclosure may be used in the block chain technical field for testing financial services, and may also be used in any field except the block chain technical field for testing financial services.
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 presentation, analyzed data, etc.) referred to in the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
The following embodiments of the present invention may be applied to various systems/applications/devices for testing financial transactions, including but not limited to: installment payment service, loan service, etc. The invention can conveniently realize the identity authentication of transaction participants by utilizing the identity identification of the block chain, further realize the transaction authorization of equipment or users, has higher trust degree on joining nodes based on the alliance chain in which a plurality of mechanisms participate together, can realize the data sharing among the mechanisms and the like, provides the financial service testing method based on the area chain, can effectively communicate all joint testing parties, solves the problems of complicated application procedures and labor cost consumption of joint testing of the financial mechanism and a third party in the testing process, reduces the risk of production data leakage in the joint testing process, and can also realize the automatic account checking function.
Example one
In accordance with an embodiment of the present invention, there is provided a blockchain-based financial transaction testing method embodiment, it is noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different than that described herein.
The financial service testing method based on the block chain provided by the embodiment of the invention can be applied to a first alliance chain node which is in butt joint with a certain service processing system, and a plurality of alliance chain nodes form an alliance chain network.
Fig. 1 is a flowchart of an alternative method for testing financial services based on a blockchain according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S101, receiving a service test request of a second alliance chain node in the alliance chain network, wherein the service test request at least comprises the following steps: and testing the service message and the node authority.
And step S102, under the condition that the node authority of the second alliance link node is matched with the authority table of the first alliance link node, completing service interaction with the second alliance link node based on a pre-deployed intelligent contract and a test service message to obtain a contract execution result.
Step S103, broadcasting the service information containing the contract execution result to the alliance chain network to complete the service test.
Through the steps, the service test request of the second alliance chain node in the alliance chain network can be received, under the condition that the node authority of the second alliance chain node is matched with the authority table of the first alliance chain node, service interaction with the second alliance chain node is completed based on the pre-deployed intelligent contract and the test service message, a contract execution result is obtained, and the service information containing the contract execution result is broadcasted to the alliance chain network to complete service test. In the embodiment of the invention, the business processing systems participating in the financial business test form the alliance chain network, so that the systems can be mutually communicated, and the business test is carried out in the alliance chain network based on the pre-deployed intelligent contract, so that the problems of complicated application procedures and manpower and material cost consumption of a financial institution and a third party in the business test process are solved, the risk of production data leakage in the joint test process is reduced, the test safety is improved, and the technical problems of low safety and high cost in the related technology in the process of carrying out the financial business joint test are solved.
The following will explain the embodiments of the present invention in detail with reference to the above steps.
Fig. 2 is a schematic diagram of an alternative architecture of a block chain-based financial transaction testing system according to an embodiment of the present invention, which performs a financial transaction test through a federation chain consisting of block link points 1-N characterized by application system node devices 1-N, as shown in fig. 2. Fig. 3 is a schematic diagram of an alternative application system node apparatus according to an embodiment of the present invention, and as shown in fig. 3, the application system node apparatus includes: the system comprises an encryption and decryption module, an intelligent contract module, a broadcast module, a permission management table and a test result display module, wherein a service processing system is accessed into a alliance chain through an application system node device, and the types of the service processing system include but are not limited to: the system comprises an installment payment service system, a merchant account processing system, a payment platform account processing system, an identity information checking system, a credit investigation system, a third party credit granting scoring system and the like.
In the embodiment of the invention, a plurality of alliance link nodes form an alliance link network (the network can be a wide area network or a local area network and the like).
Optionally, a first alliance link node of the service processing system initiates an alliance link entry application, wherein after receiving the alliance link entry application, an alliance link network allocates an equipment identifier and a node authority to the first alliance link node, and the equipment identifier is encrypted and stored in a local memory of the service processing system; receiving equipment identification and node authority distributed by a alliance chain network; encrypting the node authority, and registering the encrypted node authority in an authority management table; and broadcasting the authority management table to each alliance chain node of the alliance chain network.
In the embodiment of the present invention, any service processing system needs to access to a federation chain through an application system node device, the application system node device can join the federation chain after applying for the application (that is, a first federation link node of the service processing system needs to initiate a federation link access application to join the federation chain), each node of the access chain (that is, each first federation link node) has a unique device identifier (in this embodiment, a digital ID is used as a device identifier for illustration, but not limited to the digital ID, and may also be a MAC address or a digital character string, etc.), and is used for device verification and authorization when a transaction is initiated, and all device identifiers and authority ranges (that is, node authorities) that can be accessed by the device exist in an authority management table of each node (that is, after the federation link network receives the federation link access application, allocates the device identifier and the node authority for the first federation link node, the device identifier is encrypted and stored in the local memory of the service processing system).
Since some application system nodes (i.e. first alliance link nodes) directly access the alliance link in the production environment, for example, a user identity networking check system, a credit investigation system and other heavy data systems, there is a risk of data leakage and tampering, and user operation permissions (i.e. node permissions) need to be strictly controlled, after receiving the device identifier and the node permissions allocated by the alliance link network, the node permissions are encrypted, the encrypted node permissions are registered in the permission management table, and the permission management table is broadcast to all the alliance link nodes of the alliance link network.
Step S101, receiving a service test request of a second alliance chain node in the alliance chain network, wherein the service test request at least comprises the following steps: and testing the service message and the node authority.
In the embodiment of the present invention, each service processing system that needs to participate in the test may be accessed to the alliance chain network, so that each service processing system corresponds to one alliance chain node, and when receiving a service test request of a second alliance chain node in the alliance chain network, the alliance chain network may be used to perform a service test.
The service test request comprises: testing service messages, node permissions and the like, wherein the testing service messages need to be encrypted through an encryption and decryption module before being uploaded to a alliance-link network, and encryption algorithms used by the encryption and decryption module include but are not limited to: encryption algorithms such as DES, 3DES, SM9, etc., in this embodiment, the SM9 is taken as an example for detailed description, the SM9 algorithm is based on a 256-bit BN elliptic curve, a prime field Fp and a finite field Fp2 are used, a bilinear pair uses R-ate, and curve parameters mainly include: elliptic curve equation: y2 ═ x3+ b, equation parameter b, parameter t, base domain feature q, order N of the group, cofactor cf, generator P1 of group 1 ═ xp1, yp1, generator P2 of group 2 ═ xp2, yp 2.
The specific process is as follows:
the key using the SM9 algorithm may be generated by KGC (key generation center), and mainly includes an encryption master key pair of KGC and a private key of a user, and the data encryption master key pair: the private key is a random number in the range of [1, N-1 ]; the public key is a multiple point of a base point P1 of the G1 group, the multiple being the private key.
The public and private keys of the master key pair are used in different scenes, wherein the master private key is only used for inquiring the private key of the user; the master public key is published by KGC and used on the chain. The inquiry user private key is generated by KGC and comprises a signature private key and an encryption private key; signature private key: is a multiple of the base point P1 of the G1 group, and the signature private key is only used in the digital signature; encrypting a private key: which is a multiple of the base point P2 of the G2 group, the encrypted private key is used as the private key in key unsealing, decryption, and key exchange. The KGC generates the user's private key using the master private key and the user identity (hereinafter ID, sent to the group through the database-assisted device).
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 block cipher algorithm K1, and K2_ len be the bit length of key K2 in function MAC (K2, Z), encryption master public key Ppub-e, identifier hid, and query user ID.
The operation is as follows:
(1) calculating element QB ═ H1(ID | | hid, N) ] P1+ Ppub-e in group G1;
(2) generating a random number r in the range of [1, N-1 ];
(3) calculating an element C1 ═ r ] QB in the group G1, and converting the data type of C1 into a bit string;
(4) calculating the element g ═ e in group Gr (Ppub-e, P2);
(5) calculating the power of the opening r of the element w which is g in the Gr, and converting the data type of w into a bit string;
(6) and (3) classifying and calculating according to a plaintext encryption method: if the plaintext encryption method is based on a key-derived sequential cipher algorithm, calculating an integer klen + mlen + K2_ len, then calculating K KDF (C1| | w | | | ID, klen), making K1 be the leftmost menl bit of K, K2 be the remaining K2_ len bits, if K1 is a full 0-bit string, returning to 2 for re-execution, otherwise calculating C2 as the exclusive or of M and K1; if the method for encrypting the plaintext is based on a key-derived block cipher algorithm, calculating an integer klen ═ K1_ len + K2_ len, then calculating K ═ KDF (C1| | | w | | | ID, klen), making K1 be the leftmost K1_ len bit of K, and K2 be the remaining K2_ len bit, if K1 is an all-0 bit string, returning to 2 for re-execution, otherwise calculating C2 ═ Enc (K1, M);
(7) calculating C3 ═ MAC (K2, C2);
(8) and outputting the ciphertext C-1C 2C 3.
The decryption process is as follows: let mlen be the bit length of C2 in ciphertext C ═ C1| | | C2| | C3, K1_ len be the bit length of key K1 in the block cipher algorithm, and K2_ len be the bit length of key K2 in function MAC (K2, Z).
(1) Extracting a bit string C1 from C, converting the data type of C1 into a point on an elliptic curve, and verifying whether C1 is in G1 or not, and if not, then reporting an error and exiting;
(2) calculating an element w '═ e (C1, deg) in the group Gr, and converting the data type of w' into a bit string;
(3) and (3) classifying and calculating according to a plaintext encryption method:
1) if the plaintext encryption method is based on a key derivation function sequential cryptographic algorithm, calculating an integer klen + menl + K2_ len, and then calculating K '═ KDF (C1| | w' | ID, klen), making K1 'be the leftmost mlen bit of K', and K2 'be the remaining K2_ len bits, if K1' is an all-0 bit string, an error is reported and quit, otherwise, M 'is calculated as an exclusive or of C2 and K1';
2) if the plaintext encryption method is based on the key derivation function block cipher algorithm, the integer klen ═ K1_ len + K2_ len is calculated, and then K ═ KDF (C1| | | w | | | ID, klen) is calculated, let K1 ' be the leftmost K1_ len bit of K ', and K2 ' be the remaining K2_ len bit, if K1 ' is a full 0-bit string, an error is reported and quit is performed, otherwise, M ═ Dec is calculated (K1 ', C2).
(4) Calculating u-MAC (K2', C2), taking out bit string C3 from C, if u is not equal to C3, then reporting error and exiting;
(5) the plaintext M' is output.
After the message data is encrypted, the message data encrypted by the public key is sent to the chain, the key for decryption is stored in the corresponding application system node device, and the user decrypts the encrypted message data by the obtained private key.
For the node authority, before uploading to the alliance-link network, encryption needs to be performed through an encryption/decryption module, and the node authority needs to be attached to the test service message and uploaded to the alliance-link network together with the test service message.
Optionally, after receiving a service test request of a second federation chain node in the federation chain network, the method further includes: checking message data in the test service message by adopting a preset service interaction rule to obtain an account checking result; and broadcasting the business information containing the financial checking result to each alliance chain of the alliance chain network.
In the embodiment of the present invention, a business interaction rule, for example, "basic principle of accounting" may be preset: borrowing must have a loan, and borrowing must be equal; trial balance of occurrence (vertical): the sum of the generation amount of the borrowers of all accounts in the current period is equal to the sum of the generation amount of the lenders of all accounts in the current period; balance trial balance (horizontal): the initial balance sum of the same subject account and the current generation amount sum of the same subject account are the current end balance sum of the same subject account, based on the set business interaction rule, the message data (for example, the loan amount and the balance of each subject account) in the test business message is checked to obtain the account checking result, and the business information of the account checking result can be broadcasted to each alliance chain of the alliance chain network to realize the consistency of the account information of each node on the alliance chain and prevent falsification.
Optionally, the step of checking the message data in the test service message by using a preset service interaction rule to obtain an account checking result includes: and under the condition that the service interaction rule is an installment service rule, automatically checking the loan information in the test service message and the account information of each subject account by adopting the installment service rule to obtain an account checking result.
In the embodiment of the present invention, if the business interaction rule is an installment business rule (i.e., "basic principle of accounting), the debit amount (i.e., debit and credit information) and the balance of each account (i.e., account information of each account) in the test business message may be automatically checked, and the transaction result and the accounting check result are displayed in the test result display module in real time.
Optionally, after obtaining the result of the accounting check, the method further includes: acquiring service information for service interaction between the first alliance link node and the second alliance link node; adding a timestamp on the service information; broadcasting the time-stamped service information to a plurality of federation chain nodes in the federation chain network.
In the embodiment of the present invention, when any node initiates a transaction operation, the broadcast module may add a non-falsifiable timestamp to each record (that is, may add a timestamp to the obtained service information), and perform network notification (that is, broadcast the service information to which the timestamp is added to a plurality of federation chain nodes in a federation chain network), verify authenticity of the transaction, where the bottom layer of the entire block chain network (that is, the federation chain network) is a federation chain, and based on a Fabric data synchronization mechanism, consistency of the ledger information of each federation chain node in the federation chain may be achieved, and falsification is prevented.
And step S102, under the condition that the node authority of the second alliance link node is matched with the authority table of the first alliance link node, completing service interaction with the second alliance link node based on a pre-deployed intelligent contract and a test service message to obtain a contract execution result.
Fig. 4 is a schematic diagram of an alternative intelligent contract management module according to an embodiment of the invention, and as shown in fig. 4, the intelligent contract management module includes: the contract deploying system comprises a contract constructing module, a contract deploying module and a contract executing module.
In the embodiment of the present invention, the type of the consensus mechanism, the response condition, and the response rule may be preset by the contract construction module (i.e. the intelligent contract is deployed in advance), where the type of the intelligent contract includes but is not limited to: the main body (namely a business processing system) participating in the transaction participates in the consensus verification of the alliance chain through the corresponding alliance chain node, the consensus node only acquires the transaction result and transaction terminal information and does not acquire all account book data, the user identity authentication data and personal credit score data leakage of the consensus node is prevented, and after the consensus verification is completed, business interaction with the second alliance chain node can be completed based on the pre-deployed intelligent contract and test business message, and a contract execution result is obtained.
Optionally, the step of completing service interaction with the second federation link node based on the pre-deployed intelligent contract and test service packet to obtain a contract execution result includes: calling an intelligent contract under the condition that the second alliance chain node is confirmed to have the authority of accessing the first alliance chain node; acquiring a consensus mechanism type in an intelligent contract and a consensus algorithm corresponding to the consensus mechanism type; and executing a consensus algorithm, and finishing service interaction with the second union link node to obtain a contract execution result.
In the embodiment of the present invention, a consensus algorithm corresponding to a consensus mechanism type (that is, obtaining the consensus mechanism type in the intelligent contract and the consensus algorithm corresponding to the consensus mechanism type) may be deployed through a contract deployment module, where the consensus algorithm includes, but is not limited to: in order to reduce the transaction cost and reduce the energy consumption in the consensus algorithm process, a POA (Proof of activity) consensus algorithm may also be selected, and the type of the consensus mechanism may also be customized according to the actual situation, which is not limited herein.
The embodiment is described in detail by taking a byzantine fault tolerance mechanism PBFT as an example, and in the case of adopting the byzantine fault tolerance mechanism PBFT, the system limits the damage possibly caused by a failed client through access control, audits the client and prevents the client from initiating an operation that is not authorized to be executed, and meanwhile, the service can provide an operation to change the access authority of one client, because the algorithm ensures that the authority revocation operation can be observed by all clients, the method can provide a strong mechanism for recovering from the attack of the failed client.
In addition, after the intelligent contract is generated, the diffusion can be distributed through a P2P (peer-to-peer network) network and stored in a federation chain.
In the embodiment of the present invention, when a request for a message (i.e., a test service message) sent by a federation chain node is received, it may be checked whether its authority is matched with an authority table of the node (i.e., a first federation chain node), if not, the transaction is rejected, if so, it is determined whether the node has the authority to access the node, if not, the transaction is rejected, if so, the second federation chain node has the authority to access the first federation chain node, the intelligent contract is invoked through the contract execution module, the type of the consensus mechanism in the intelligent contract is obtained (i.e., the type of the consensus mechanism in the intelligent contract and the consensus algorithm corresponding to the type of the consensus mechanism are obtained), the corresponding consensus algorithm is executed, and service interaction is completed with the second federation chain node, so as to obtain a contract execution result.
Optionally, the types of smart contracts include: and using a service contract, a service risk level contract and a service authorization contract of the test service message.
Step S103, broadcasting the service information containing the contract execution result to the alliance chain network to complete the service test.
In the embodiment of the present invention, the contract execution result may be broadcast in the alliance-link network through the broadcasting module (i.e. service information including the contract execution result is broadcast to the alliance-link network), and the service test is completed.
According to the embodiment of the invention, the business processing systems participating in the financial business test form the alliance chain network, so that the systems can be mutually communicated, and the business test is carried out in the alliance chain network based on the pre-deployed intelligent contract, so that the problems of complicated application procedures and manpower and material cost consumption of a financial institution and a third party in the business test process are solved, the risk of production data leakage in the joint test process is reduced, the test safety is improved, and the automatic account checking function of the account in the alliance chain network can be realized.
Example two
Fig. 5 is a schematic diagram of an alternative financial transaction testing apparatus according to an embodiment of the present invention, as shown in fig. 5, the testing apparatus includes: an intelligent contract management unit, wherein the intelligent contract management unit comprises: the system comprises a contract execution module, an accounting check module, a contract construction module, a contract deployment module, a permission management module, a local memory and a broadcast module.
The embodiment of the invention is applied to a first alliance link node which is in butt joint with a certain service processing system, a plurality of alliance link nodes form an alliance link network, and the alliance link node comprises: the intelligent contract management unit is used for executing the following method by a contract execution module in the intelligent contract management unit: receiving a service test request of a second alliance chain node in the alliance chain network, wherein the service test request at least comprises the following steps: testing service messages and node permissions; under the condition that the node authority of the second alliance link node is matched with the authority table of the first alliance link node, service interaction is completed with the second alliance link node based on a pre-deployed intelligent contract and a test service message, and a contract execution result is obtained; and broadcasting the service information containing the contract execution result to the alliance chain network to complete the service test.
Optionally, the contract execution module includes: and the accounting checking module is used for automatically checking the debit and credit information in the test service message and the account information of each subject account by adopting a preset installment service rule to obtain an accounting checking result.
Optionally, the intelligent contract management unit further includes: the contract construction module is used for setting a consensus mechanism type; the contract deployment module is used for deploying a consensus algorithm corresponding to the type of the consensus mechanism, wherein the consensus algorithm is one of the following algorithms: a byzantine fault tolerance mechanism, or a hybrid of a share authorization attestation mechanism and a byzantine fault tolerance mechanism.
In the embodiment of the present invention, the contract construction module in the intelligent contract management unit is configured to set a consensus mechanism type, preset response conditions, and preset response rules, including but not limited to: the transaction message specification contract, the transaction risk level contract, the transaction authorization contract and the like are participated in the consensus verification of the alliance chain by a main body (a business processing system) participating in the transaction through a corresponding alliance chain node, the consensus node only acquires the transaction result and the transaction terminal information and does not acquire all the account book data, and the user identity authentication data and the personal credit scoring data leakage of the consensus node is prevented.
A contract signing module in the intelligent contract management unit, for deploying consensus algorithms corresponding to the consensus mechanism types, wherein the consensus algorithms include, but are not limited to: a mixed mechanism of a Byzantine Fault tolerance mechanism PBFT (actual Byzantine Fault permission), a share authorization certification mechanism dpos (delayed Proof of stop), and PBFT, in order to reduce the transaction cost and reduce the energy consumption in the consensus algorithm process, a POA consensus algorithm may also be selected, and the type of the consensus mechanism may also be customized according to the actual situation, which is not limited herein.
The embodiment is described in detail by taking a byzantine fault tolerance mechanism PBFT as an example, and in the case of adopting the byzantine fault tolerance mechanism PBFT, the system limits the damage possibly caused by a failed client through access control, audits the client and prevents the client from initiating an operation that is not authorized to be executed, and meanwhile, the service can provide an operation to change the access authority of one client, because the algorithm ensures that the authority revocation operation can be observed by all clients, the method can provide a strong mechanism for recovering from the attack of the failed client.
In addition, after the intelligent contract is generated, the diffusion can be issued through the P2P network and stored in the federation chain.
And a contract execution module in the intelligent contract management unit calls the intelligent contract to acquire the consensus mechanism type in the intelligent contract and executes a corresponding consensus algorithm. When receiving a message request (namely a service test request) sent by a alliance link node, a contract execution module firstly checks whether the authority of the contract execution module is matched with the authority table of the node, if not, the contract execution module refuses the transaction, if so, the contract execution module judges whether the authority of the contract execution module is matched with the authority table of the node, if not, the contract execution module judges whether the contract execution module has the authority of accessing the node, if not, the contract execution module refuses the transaction, and if so, a service processing system is called, and a contract execution result is returned to a requesting party.
The specific execution method of the contract execution module is as follows: receiving a service test request of a second alliance chain node in the alliance chain network, wherein the service test request at least comprises the following steps: testing service messages and node permissions; under the condition that the node authority of the second alliance link node is matched with the authority table of the first alliance link node, service interaction is completed with the second alliance link node based on a pre-deployed intelligent contract and a test service message, and a contract execution result is obtained; and broadcasting the service information containing the contract execution result to the alliance chain network to complete the service test.
And, the contract execution module includes: the accounting checking module adopts a preset installment service rule to automatically check the debit and credit information in the test service message and the account information of each subject account to obtain an accounting checking result, wherein the installment service rule can be set as the following rule:
borrowing must have a loan, and borrowing must be equal; trial balance of occurrence (vertical): the sum of the generation amount of the borrowers of all accounts in the current period is equal to the sum of the generation amount of the lenders of all accounts in the current period; balance trial balance (horizontal): the initial balance of the same subject account is added and the current generation amount of the same subject account is added, namely the current end balance of the same subject account is added.
And based on the set installment service rule, automatically checking the loan information in the test service message and the account information of each subject account to obtain an account checking result.
Optionally, the intelligent contract management unit further includes: the authority management module is used for managing an authority management table of a first alliance link node of the service processing system, and node authority of each encrypted alliance link node is stored in the authority management table; and the local memory stores the encrypted equipment identification of each service processing system.
In the embodiment of the invention, the authority management module in the intelligent contract management unit is used for authority control of the alliance chain nodes, access and exit control of the nodes in the alliance chain network is realized, and the operable range of the user on each member node is defined. In this embodiment, after a node applies for joining a federation chain, each node in the joining chain has a unique digital ID as a device identifier, and is used for device verification and authorization when a transaction is initiated, all device identifiers and an authority range accessible by the device exist in an authority management table of each node, and during the transaction, an access authority of the node is attached to a transaction message, only when the authority message of a sending node is matched with the authority message of a receiving node, a party allows the sending node to access the receiving node, and otherwise, the receiving node rejects a response.
Because some application system nodes directly access the alliance chain in a production environment, for example, a user identity networking check system, a credit investigation system and other heavy-point data systems, the risk of data leakage and tampering exists, the operation authority of a user needs to be strictly controlled, an authority management table needs to be encrypted and then stored in each node of the alliance chain, and when the authority management table is read, the node is decrypted by using a private key of the node.
Optionally, the intelligent contract management unit further includes: and the broadcasting module is used for acquiring service information for service interaction between the first alliance link node and the second alliance link node, adding a timestamp to the service information, and broadcasting the service information added with the timestamp to a plurality of alliance link nodes in the alliance link network.
In the embodiment of the invention, the broadcasting module in the intelligent contract management unit can broadcast a new authority list in a alliance chain when a new node is added or an old node is withdrawn, the receiving node updates the authority list of each node, and meanwhile, when any node initiates a transaction operation, the module adds a non-falsifiable timestamp to each record and notifies and verifies the authenticity of the transaction through the whole network.
According to the embodiment of the invention, the financial business testing device based on the block chain is adopted for business testing, so that the problems of complicated application procedure and manpower and material cost consumption of a financial institution and a third party in a business testing process are solved, the risk of production data leakage in the joint testing process is reduced, the testing safety is improved, and the function of automatically checking accounts in a alliance chain network can be realized.
EXAMPLE III
Fig. 6 is a flowchart of an alternative block chain-based financial institution system and third-party system joint test according to an embodiment of the present invention, as shown in fig. 6, the specific steps are as follows:
s601, the application system node device initiates an alliance link access application, assigns a unique digital ID as an equipment identifier, assigns an authority and registers an authority table, the digital ID is accessed to the alliance link before the initial release for registration and generation, and then is encrypted by an encryption and decryption module and stored in the local application system node to be used as an identity certificate of the node.
S602, the authority of the newly added node is set in the authority list, the encryption is carried out through the encryption and decryption module, the new authority list is broadcasted in the alliance chain, and the authority list of each node is updated by the receiving node.
S603, the application system node device initiates a transaction request, and according to the preset rights management specification C300, as shown in fig. 7, the rights management specification C300 includes: the user inquires an application division principle C310, a user inquiry data volume principle C320 and the like, uses a private key, calls an encryption and decryption module to decrypt, firstly checks whether the authority of the user is matched with the authority table of the node, refuses the transaction if the authority of the user is not matched with the authority table of the node, judges whether the user has the authority of accessing the node if the authority of the user is matched with the authority table of the node, refuses the transaction if the authority of the user is not matched with the authority table of the node, calls a service processing system if the authority of the user is not matched with the authority table of the node, and calls the encryption and decryption module to encrypt the contract execution result.
S604, meanwhile, according to the pre-set staging transaction specification C400, as shown in fig. 7, the staging transaction specification C400 includes: the deposit institution C410, the accounting data C420 and the like automatically check the debit amount in the transaction message and the balance of each account according to the basic principle of accounting checking, and display the transaction result and the accounting checking result in the test result display module in real time.
And S605, adding a non-tampable time stamp to each record by the broadcasting module, notifying and verifying the authenticity of the transaction through the whole network, and recording the transaction information into a alliance chain.
According to the embodiment of the invention, the financial business is tested by the block chain-based financial institution system and third-party system joint test method, so that the problems of complicated application procedure and manpower and material cost consumption of the financial institution and the third-party joint test in the business test process are solved, the risk of production data leakage in the joint test process is reduced, the test safety is improved, and the function of automatically checking accounts in a alliance chain network can be realized.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program runs, the apparatus where the computer-readable storage medium is located is controlled to execute any one of the above methods for testing financial services based on a block chain.
According to another aspect of embodiments of the present invention, there is also provided an electronic device, including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the blockchain-based financial transaction testing method of any one of the above.
Fig. 8 is a block diagram of a hardware structure of an electronic device (or a mobile device) for implementing a method for testing financial services based on a blockchain according to an embodiment of the present invention. As shown in fig. 8, the electronic device may include one or more (shown as 102a, 102b, … …, 102 n) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), andmemory 104 for storing data. Besides, the method can also comprise the following steps: 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 will be understood by those skilled in the art that the structure shown in fig. 8 is only an illustration and is not intended to limit the structure of the electronic device. For example, the electronic device may also include more or fewer components than shown in FIG. 8, or have a different configuration than shown in FIG. 8.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.