Disclosure of Invention
The present specification provides a credit record sharing method based on a block chain, including:
target node equipment in the block chain collects user credit records which are broadcast and issued to the block chain by each node equipment in the block chain in the current accounting period and are verified by each node equipment in the block chain together;
initiating consensus processing of the collected user credit records in the blockchain to determine a billing node device;
and if the target node device is determined to be a billing node, issuing a block broadcast created based on the collected user credit records to the block chain for storage in a distributed database of the block chain.
Optionally, the method further includes:
acquiring a user credit record to be issued;
broadcasting and issuing the user credit record in a block chain, so that other node equipment verifies the user credit record, and other node equipment broadcasts and issues a verification result in the block chain; and the number of the first and second groups,
and when receiving the user credit records broadcast and issued by other node equipment, verifying the user credit records, and broadcasting and issuing verification results in the block chain.
Optionally, the user credit record that is verified by each node device in the block chain together includes: verifying the passing user credit records by node equipment with a preset proportion in each node equipment in the block chain;
the collecting user credit records broadcast and issued to the blockchain by each node device in the blockchain in the current accounting period and verified by each node device in the blockchain together comprises:
collecting user credit records broadcast and issued to the block chain by each node device in the block chain in the current accounting period; each node device in the block chain broadcasts the verification result of the user credit record issued to the block chain in the current accounting period;
and screening out user credit records which are broadcast and issued to the block chain by each node device in the block chain in the current accounting period and pass verification by the node devices in the preset proportion in each node device.
Optionally, the initiating, in the blockchain, consensus processing on the collected user credit records to determine a billing node device includes:
determining the issuer node equipment corresponding to the collected user credit records;
counting the number of the user credit records issued by each issuing party node device in the current accounting period;
and determining the issuing party node equipment with the largest number of the user credit records issued in the current accounting period as the accounting node equipment.
Optionally, the counting the number of the user credit records issued by each issuer node device in the current accounting period includes:
and counting the number of the user credit records which are issued by each issuing party node device in the current accounting period and have no corresponding repeated record in the distributed database of the block chain.
Optionally, the method further includes:
if the target node equipment is determined as an accounting node, acquiring a preset number of virtual resources generated by the block chain, and issuing the virtual resources to an account address corresponding to the target node equipment; or,
if the user credit records issued by the target node equipment are stored in the distributed database of the block chain, acquiring a preset number of virtual resources generated by the block chain, and issuing the virtual resources to account addresses corresponding to the target node equipment;
wherein the virtual resource is used for obtaining the use authority of the user credit record stored in the distributed database of the block chain.
Optionally, the method further includes:
receiving a data query request for the distributed database;
and responding to the data query request, calling an intelligent contract corresponding to the data query, and deducting a preset amount of virtual resources from an account address corresponding to the target node equipment.
Optionally, the virtual resource is a virtual integral.
Optionally, the blockchain comprises a backbone; and, a plurality of daughter strands anchored to the backbone;
the publishing of the tile broadcast created based on the collected user credit records to the tile chain comprises:
broadcasting a block created based on user credit records collected in the current accounting period and verified by all node devices in the main chain to the main chain of the block chain if the target node device is the node device in the main chain;
and if the target node device is the node device in the sub-chain, issuing a block broadcast created based on the collected user credit records which are verified by all the node devices in the sub-chain together in the current accounting period to the main chain of the block chain.
Optionally, the block chain is a federation chain formed by a plurality of merchant node devices; the federation chain includes a main chain; and, a plurality of daughter strands anchored to the backbone; wherein, different sub-chains respectively correspond to different merchant types.
The present specification also provides a block chain-based credit record sharing apparatus, including:
the collection module is used for collecting user credit records which are broadcasted and issued to the block chain by each node device in the block chain in the current accounting period and are verified by each node device in the block chain together;
a consensus module initiating consensus processing of the collected user credit records in the blockchain to determine a billing node device;
and the issuing module is used for issuing the block broadcast created based on the collected user credit record to the block chain to be stored in a distributed database of the block chain if the target node device corresponding to the device is determined as an accounting node.
Optionally, the apparatus further comprises:
the acquisition module acquires a user credit record to be issued; broadcasting and issuing the user credit record in a block chain, so that other node equipment verifies the user credit record, and other node equipment broadcasts and issues a verification result in the block chain;
and the receiving module is used for verifying the user credit record when receiving the user credit record broadcast and issued by other node equipment, and broadcasting and issuing the verification result in the block chain.
Optionally, the user credit record that is verified by each node device in the block chain together includes: verifying the passing user credit records by node equipment with a preset proportion in each node equipment in the block chain;
the collection module:
collecting user credit records broadcast and issued to the block chain by each node device in the block chain in the current accounting period; each node device in the block chain broadcasts the verification result of the user credit record issued to the block chain in the current accounting period;
and screening out user credit records which are broadcast and issued to the block chain by each node device in the block chain in the current accounting period and pass verification by the node devices in the preset proportion in each node device.
Optionally, the consensus module:
determining the issuer node equipment corresponding to the collected user credit records;
counting the number of the user credit records issued by each issuing party node device in the current accounting period;
and determining the issuing party node equipment with the largest number of the user credit records issued in the current accounting period as the accounting node equipment.
Optionally, the consensus module further:
and counting the number of the user credit records which are issued by each issuing party node device in the current accounting period and have no corresponding repeated record in the distributed database of the block chain.
Optionally, the publishing module further:
if the target node equipment corresponding to the device is determined as an accounting node, acquiring a preset number of virtual resources generated by the block chain, and issuing the virtual resources to an account address corresponding to the target node equipment; or, if the user credit record issued by the target node device is stored in the distributed database of the block chain, acquiring a preset number of virtual resources generated by the block chain, and issuing the virtual resources to an account address corresponding to the target node device; wherein the virtual resource is used for obtaining the use authority of the user credit record stored in the distributed database of the block chain.
Optionally, the apparatus further comprises:
the query module receives a data query request aiming at the distributed database; and responding to the data query request, calling an intelligent contract corresponding to the data query, and deducting a preset amount of virtual resources from an account address corresponding to the target node equipment.
Optionally, the virtual resource is a virtual integral.
Optionally, the blockchain comprises a backbone; and, a plurality of daughter strands anchored to the backbone;
the release module:
if the target node device corresponding to the device is the node device in the main chain, broadcasting and issuing a block created based on user credit records which are collected in the current accounting period and verified by all the node devices in the main chain and all the sub chains to the main chain of the block chain;
and if the target node device corresponding to the device is the node device in the sub-chain, broadcasting and issuing a block broadcast created by each node device in the sub-chain based on the collected current accounting period to the sub-chain and the user credit records verified by each node device in the sub-chain together to a main chain of the block chain.
Optionally, the block chain is a federation chain formed by a plurality of merchant node devices; the federation chain includes a main chain; and, a plurality of daughter strands anchored to the backbone; wherein, different sub-chains respectively correspond to different merchant types.
This specification also proposes an electronic device including:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory corresponding to control logic shared with blockchain based blockchain credit records, the processor is caused to:
collecting user credit records which are broadcast and issued to the block chain by each node device in the block chain in the current accounting period and are verified by each node device in the block chain together;
initiating consensus processing of the collected user credit records in the blockchain to determine a billing node device;
and if the electronic equipment is determined to be a billing node, issuing the block broadcast created based on the collected user credit records to the block chain to be stored in a distributed database of the block chain.
Detailed Description
The credit closed-loop service refers to that for some merchants engaged in services related to user credit, data related to the user credit can be shared to a credit evaluator, the credit evaluator generates a user credit record based on the information, and the generated user credit record is maintained; the credit evaluator can reach the user based on the maintained credit record and the channel of the credit evaluator, reversely supervise and promote the user to actively perform, and further continuously accumulate the maintained user credit record to form a service closed-loop service mode.
In the present specification, a credit record sharing platform is built by using a block chain technology in a business context of a credit closed-loop business, so that each node device (merchant) joining a block chain can share a credit record quickly and in a decentralized manner by depending on an architecture of the block chain.
In implementation, an operator of a block chain may set up a block chain network formed by a plurality of merchant node devices in advance, and deploy a credit closed-loop service by relying on the block chain network, so that the merchant node devices joining the block chain network can share user credit records in different merchants by broadcasting and issuing the user credit records to a distributed database (i.e., a distributed account book) of the block chain.
For each merchant node device in the block chain, the user credit records broadcast and issued to the block chain by each merchant node device in the current accounting period and passing through the common verification of each node device may be collected, a candidate block may be created based on the collected user credit records, and then a consensus process may be initiated in the block chain on the basis of a consensus algorithm supported by the block chain network to "compete" for the accounting authority.
If the merchant node device is determined not to be a booked node after the consensus is completed, the merchant node device may broadcast the candidate block as a latest block to the blockchain network, and add the latest block to the distributed database of the blockchain.
On one hand, since the block chain has historical traceability and non-tamper property, in this way, the user credit records generated in a period of time can be truly recorded on the block chain, and all the user credit records can be traced on the block chain; moreover, as the user credit record is verified and maintained by all the node devices together, the user credit record is tampered by controlling most of the node devices, so that the fairness of the user credit record can be ensured;
on the other hand, because the user credit records generated by each node device in the block chain are shared, each node device can obtain the user credit records issued by other node devices by inquiring on the chain, so that the credit closed loop can not be concentrated in one node device, and each node device can be mutually shared and supervised; and when the credit closed-loop service is deployed, channels reaching the users are correspondingly increased, and the plurality of node devices can jointly supervise and promote the users to actively perform through joint payment promotion, joint punishment, joint excitation and the like on the users by using the credit records of the users on the chain.
The present specification is described below with reference to specific embodiments and specific application scenarios.
Referring to fig. 1, fig. 1 is a block chain-based credit record sharing method according to an embodiment of the present disclosure, which performs the following steps:
102, target node equipment in a block chain collects user credit records which are broadcast and issued to the block chain by each node equipment in the block chain in the current accounting period and are verified by each node equipment in the block chain together;
104, initiating consensus processing on the collected user credit records in the block chain to determine accounting node equipment;
and 106, if the target node device is determined to be a billing node, issuing the block broadcast created based on the collected user credit records to the block chain to be stored in a distributed database of the block chain.
The blockchain described in this specification may specifically include any type of blockchain network.
For example, in one embodiment shown, the blockchain may be a federation chain consisting of several merchant node devices. Each merchant can rely on the alliance chain, publish some user credit records generated by the operated online or offline service related to the user credit in the blockchain, and record the user credit records in the distributed database of the blockchain, so as to realize the sharing of the user credit records of each merchant.
In an embodiment shown, the blockchain may specifically include a main chain and a plurality of sub-chains anchored to the main chain;
for example, taking the above block chain as an example of a federation chain formed by several merchant node devices, the federation chain may be divided into a main chain and several sub-chains anchored to the main chain, each corresponding to a different merchant type, based on a specific type of merchant (such as an industry type of service provided by the merchant) as a member of the federation.
The node device may include any type of electronic device that can join the blockchain as a member; for example, the electronic device may include, but is not limited to, a PC terminal, a mobile terminal, a server, etc. of a merchant.
The credit record may specifically include any form of data record capable of reflecting the credit status of the user; such as records of usage of credit-related services, records of performance, records of default, and so forth.
The accounting period refers to a time interval between any two blocks in the block chain and the distributed database of the block chain. Correspondingly, the current accounting period refers to a time interval from a time when the latest block on the distributed database of the block chain is linked to the distributed database to a time when the accounting node successfully links the next block to the distributed database. The specific value of the accounting period may be set by an operator of the block chain based on actual service requirements, and is not particularly limited in this specification; for example, the accounting period of the blockchain network of bitcoins is 10 minutes, and a new block is generated every 10 minutes.
The technical solution of the present specification is described in detail below by taking the target node device as a merchant node device and the block chain as an example of a federation chain formed by a plurality of merchant node devices.
Referring to fig. 2, fig. 2 is a schematic diagram of a federation chain shown in this specification.
As shown in fig. 2, an operator of a block chain may pre-build a federation chain consisting of several merchants engaged in services related to user credit, and the merchant node devices of the respective merchants may access the federation chain as federation chains.
In an embodiment shown, each merchant node device may be equipped with a key algorithm for generating a private key and a public key, and when the merchant node device is accessed as a member device in a federation chain, a pair of the private key and the public key may be created by generating hardware of the equipped private key and the public key or calling the equipped key algorithm. Or, in practical application, the private keys and the public keys held by the merchants can also be uniformly distributed and issued by the operator of the federation chain.
Then, each merchant node device may further construct a transaction (transfer) for initiating registration, sign the transaction based on the generated private key, and issue the transaction in the federation chain to apply for joining the federation chain. After receiving the transaction, the member node device partially specified in the federation chain may verify the signature of the transaction based on a public key corresponding to a private key used when signing the transaction, and after the signature verification passes, may perform consensus processing on the transaction, and after the consensus passes, allow the merchant node device to join the federation chain, and then may calculate the public key of the merchant node device to create an account address in the federation chain for the merchant node device. At this time, the merchant node device successfully joins the alliance chain as a member node device, and the account address generated for the merchant node device is the identity of the merchant node device in the alliance chain.
After the alliance chain formed by the plurality of merchant node devices is built, an operator of the alliance chain deploys credit closed-loop services by relying on the alliance chain. And the merchants joining the alliance chain can share the user credit records in different merchants by broadcasting and issuing the user credit records to the distributed database of the alliance chain through the merchant node equipment.
Referring to fig. 3, fig. 3 is a flowchart illustrating a process for sharing user credit records based on a federation chain by merchants according to the present specification.
As shown in fig. 3, the merchant node device may obtain the user credit record to be issued, and may then initiate billing to the federation chain based on the obtained user credit record.
The user credit record to be issued may be entered manually by a merchant through a merchant node device, or may be automatically generated by the merchant node device based on service data generated when a user is provided with a service related to credit. That is, the merchant node device may obtain the user credit record manually entered by the merchant as the user credit record to be issued; a user data record, automatically generated based on service data generated by the user, may also be obtained as the user credit record to be issued.
It should be noted that, the specific format of the user credit record is not particularly limited in this specification, and in practical applications, a standard data format may be customized for the federation chain by the operator of the federation chain based on actual requirements.
For example, in one embodiment shown, the user credit record may specifically be a data record composed of the following fields:
a timestamp field for populating a timestamp of entry or generation of the user credit record. The timestamp may be obtained by querying a deployed timestamp server.
And the type field is used for filling the type identification of the credit record of the user. The operator of the alliance chain can define various types of user credit records based on actual requirements; for example, in one example, an operator of a federation chain may define three types of user credit records, namely "service usage record", "service default record" and "service performance record", and define a corresponding type identifier for each of the three types of user credit records.
And a record content field for filling the specific content of the user information record.
The user identity field is used for filling the user identity corresponding to the user credit record; such as an identification number, social security code, etc.
A certification material field for filling certification material for certifying validity of the user credit record; for example, in the case that the user credit record is a "service fulfillment record", the certification material may specifically be user data capable of certifying that the user has completed fulfillment; for example, taking the "service fulfillment record" as the "fulfillment service record of the shared product" as an example, the certification material may be specifically order data, deposit payment record, and the like of the shared product planned by the user on schedule.
With reference to fig. 3, when initiating billing to the alliance chain based on the obtained user credit record, the merchant node device may specifically broadcast and issue the user credit record in the alliance chain.
In one embodiment, the merchant node device may construct a transaction using the user credit record to be issued as the transaction content, and then sign the transaction based on the held private key.
Please continue to refer to fig. 3, after receiving the transaction, the other node devices in the federation chain may verify the transaction, and broadcast and issue the verification result in the federation chain after the verification is passed;
in this specification, the verification of the transaction may specifically include the authentication of the issuer of the transaction and the verification of the transaction content; wherein, the verification of the transaction content further comprises the integrity verification of the transaction content and the validity verification of the transaction content,
in implementation, when the merchant node device signs the transaction, the merchant node device may generally calculate the transaction to obtain a content digest (such as a hash value), and then encrypt the content digest based on a held private key to obtain a digital signature. After receiving the signed transaction, other node devices can decrypt the digital signature based on the public key of the merchant node device; if the decryption is successful, the authentication of the merchant node equipment issuing the transaction is passed, and the transaction is a legal transaction issued by the merchant node equipment.
Secondly, other node devices can further recalculate the transaction to obtain a content abstract, and then match the recalculated content abstract with the original content abstract obtained by decrypting the digital signature; if the two are matched, the integrity verification of the transaction content is passed, and the transaction content of the transaction is not illegally tampered in the transaction transmission process.
Further, after the merchant node device completes the authentication of the issuer of the transaction and the integrity authentication of the transaction content, the validity authentication of the user credit record may be performed based on the information recorded in the user credit record as the transaction content. For example, the merchant node device may read the attestation material populated in the "attestation material field" in the user credit record to verify the validity of the user credit record.
Please refer to fig. 3, when the other node devices verify the transaction issued by the merchant node device, the verification result may be broadcast and issued in the federation chain; the other node devices may also sign the verification result based on the held private key, and the node device that receives the verification result may also verify the data signature of the verification result based on the public key corresponding to the private key, and specific implementation details are not described in this specification.
Correspondingly, after the other node devices acquire the user credit records to be distributed, the transaction can be constructed in the same way, and broadcast release is performed on the alliance chain; if the above-mentioned merchant node device receives the transaction issued by each other node device, the transaction may also be verified in the same manner, and then the verification result is broadcast to the alliance chain, which is not described in detail in this specification.
In this specification, the merchant node device may collect user credit records broadcast and issued to the federation chain by each node device in the blockchain (including the merchant node device) in the current accounting period, and verified by each node device in the federation chain together.
The common verification is that the node devices in the federation chain pass through verification. In other words, in the federation chain, as long as the user credit record is verified by most of the node devices in the federation chain and is recognized by the consensus of the most of the node devices in the federation chain, the user credit record is considered to be verified by all the node devices in the federation chain together.
In an embodiment shown, when the merchant node device collects the user credit records which are broadcast and issued to the federation chain by each node device in the block chain and are jointly verified by each node device in the federation chain in the current accounting period, specifically, the user credit records which are broadcast and issued to the federation chain by each node device (including the merchant node device) in the federation chain in the current accounting period may be collected; collecting the verification result of each node device in the alliance chain on the user credit record broadcasted to the block chain in the current accounting period; and then screening out user credit records which are broadcast and issued to the block chain by each node device in the block chain in the current accounting period and verified by the node devices in the preset proportion in each node device based on the collected information.
The value of the preset ratio is not particularly limited in this specification, and may be an arbitrary ratio greater than 50%; such as 51%, or 100%.
In this specification, after the merchant node device collects the user credit records broadcast by each node device in the block chain and issued to the federation chain in the current accounting period and the node devices in the federation chain jointly verify the passed user credit records, a candidate block may be constructed based on the collected user credit records, and then a consensus process is initiated in the federation chain on the user credit records included in the candidate block based on a consensus algorithm supported by the federation chain to "compete" for accounting authority.
The specific type of the consensus algorithm supported in the federation chain is not limited in this specification, and in practical applications, some classical consensus algorithms (such as a PBFT algorithm) suitable for use in the federation chain may be adopted, or some consensus algorithms capable of efficiently processing transactions may be customized by an operator of the federation chain based on actual business requirements.
In an illustrated embodiment, the consensus algorithm supported in the federation chain may specifically be a consensus algorithm customized by an operator of the federation chain, and based on a data amount of a user credit record issued by each merchant node device in a current accounting period, an issuer node device with the largest number of user credit records issued in the current accounting period is selected as an accounting node, and a candidate block is subjected to consensus processing.
When the method is implemented, when the merchant node device initiates consensus processing on the candidate block, firstly, issuer node devices corresponding to the collected user credit records can be determined; for example, the device identifier of the publisher node device may be added to the transaction carrying the user credit record; then, the number of user credit records issued by each issuing party node device in the current accounting period can be counted; finally, the issuer node device having the largest number of user credit records issued during the current accounting period may be determined as the accounting node device.
In practical application, some repeated records which are already stored in a distributed database of the federation chain may exist in user credit records issued by node devices in the federation chain, and in this case, the bookkeeping nodes which are commonly recognized through the common recognition algorithm may have an inaccurate problem; for example, some malicious node devices may issue a large number of repeated records to obtain the billing authority; in this case, according to the above consensus algorithm, such malicious node devices may be elected as accounting nodes.
Based on this, in one illustrated embodiment, in the consensus algorithm described above, the number of user credit records issued by each issuer node device during the current accounting period may be declared as the number of user credit records issued by each issuer node device during the current accounting period and for which there is no corresponding duplicate record in the distributed database of the federation chain.
In this case, when counting the number of user credit records issued by each issuer node device in the current accounting period, the merchant node device may initiate an inquiry to the distributed database of the federation chain to determine whether there is a duplicate record in the distributed database of the federation chain for the user credit record issued by each issuer node device;
for example, in implementation, it may be determined whether the user credit record is already included in a block of the block chain by calculating a hash value of the user credit record to be queried, locating a block containing the user credit record based on the hash value, and then traversing the hash value of the user credit record in a Merkle tree of the located block.
Further, the merchant node device may remove the user credit records with duplicate records in the federation chain from the candidate block, count the number of user credit records that are issued by each issuer node device in the current accounting period and have no corresponding duplicate record in the distributed database of the federation chain, and determine, based on the consensus algorithm, the issuer node device with the largest number of user credit records issued in the current accounting period as the accounting node device.
By the method, some malicious node devices can be avoided, and the problem of accounting authority can be solved by issuing a large number of repeated records.
Of course, the algorithm logic in the consensus algorithm may be, in addition to the above description, electing the issuer node device with the largest number of user credit records issued in the current accounting period as the accounting node, and in practical application, may also be another form of algorithm logic customized by the operator in the federation chain; for example, the merchant node equipment with the highest quality and the highest issuing speed of the user credit records issued in the current accounting period is elected as an accounting node; alternatively, the operator of the federation chain may designate a specific node in each node device as an accounting node based on a certain rule (e.g., in a certain order), which is not listed in this specification.
With continued reference to fig. 3, if the merchant node device is finally determined as an accounting node, at this time, the candidate block generated by the merchant node device passes the consensus, and the merchant node device may broadcast and issue the candidate block as the latest block in the federation chain. And each node device receiving the latest block can initiate accounting based on the latest block, link the latest block with the historical block, and further add the latest block into distributed data of the alliance chain for permanent storage.
In this specification, since the merchants as coalition members may correspond to different types of merchants, respectively; for example, services offered by various merchants joining a federation chain may be affiliated with different industries; in the credit closed-loop service, credit evaluation systems of different merchants may have certain differences; thus, in one embodiment, an operator of a federation chain may divide the federation chain into a main chain and a number of sub-chains anchored to the main chain that each correspond to a different merchant type based on the particular type of merchant that is a member of the federation.
For example, taking merchants joining a chain of the federation as examples, including chain hotels, supermarkets, and shared product service providers, the node devices of the merchants such as the chain hotels, supermarkets, and shared product service providers may be divided into different sub-chains and anchored with the main chain.
The main chain and the sub-chain in the federation chain can run in the same manner, and the issued user credit records in the sub-chain can be added to the main chain in a block form in the same manner as shown above.
On one hand, for the merchant node devices in the sub-chain, after collecting the user credit records that are broadcast and issued to the sub-chain by each node device in the sub-chain in the current accounting period and are verified together by each node device in the sub-chain, a candidate block may be created based on the collected user credit records, and after being determined as an accounting node, the candidate block may be broadcast and issued to the sub-chain as the latest block broadcast and added to the distributed database of the sub-chain, and the candidate block may also be broadcast and issued to the main chain and added to the main chain.
On the other hand, for the merchant node device in the main chain, after the user credit records issued by the main chain and the node devices in the sub-chains in the current accounting period are collected and verified together by the node devices in the main chain (namely, the user credit records issued in the sub-chains are verified by the node devices in the main chain), a candidate block can be created based on the collected user credit records, and after the candidate block is determined to be the accounting node, the candidate block is broadcast to the main chain and added into the main chain.
When the user credit records issued by the merchant node equipment are successfully recorded and stored in a distributed database of the alliance chain, each merchant node equipment can complete online or offline operation of the credit closed-loop service by inquiring the user credit records in the alliance chain, sharing the user credit records issued by other merchant node equipment with the user credit records issued by other merchant node equipment and using the user credit records recorded and stored in the alliance chain;
for example, a plurality of merchant node devices may perform joint payment promotion, joint punishment, joint excitation, and the like on a user based on user credit records recorded and stored in a federation chain, so as to jointly supervise and promote the user to actively perform, and implement business linkage between the same industry and cross-industry. For example, after obtaining the latest user credit records included in the alliance chain, a plurality of merchants can perform payment promotion, punishment, incentive and the like on the user based on channels of respective touch users.
In this specification, the federation chain described above may also incorporate a billing reward mechanism. The accounting reward mechanism is specifically a node device participating in accounting, and can obtain a reward distributed by the alliance chain.
The node devices participating in accounting may specifically include a node device that obtains accounting authority, and may also include all node devices that successfully record user credit records in the federation chain.
In an illustrated embodiment, if a merchant node device in a federation chain is determined to be a billing node, a preset number of virtual resources generated by the federation chain may be acquired, and then the acquired virtual resources are issued to an account address corresponding to the merchant node device for holding.
In another embodiment shown, if the user credit record issued by a merchant node device in the federation chain is finally successfully recorded and stored in a distributed database of the federation chain (that is, the node device is not a billing node, and the user credit record issued by the node device is successfully recorded and stored in the federation chain by the billing node), a preset number of virtual resources generated by the federation chain may be acquired, and then the acquired virtual resources are issued to an account address corresponding to the merchant node device for holding.
When the alliance chain generates the virtual resources, the alliance chain can be generated automatically by merchant node equipment participating in accounting based on an operation algorithm, or generated by designated node equipment in the alliance chain, and then uniformly issued; for example, an authoritative node device or a central node device may be designated in the node devices in the federation chain, and the node device is responsible for generating and issuing virtual resources as an accounting reward for each merchant node device participating in accounting.
The specific type of the virtual resource is not particularly limited in this specification; for example, in practical applications, the virtual resource may be a point, or other forms of virtual rewards similar to the point.
In this specification, the virtual resource is specifically used for acquiring the usage right of the user credit record stored in the distributed database of the federation chain. For a node device in a federation chain, it is necessary to "consume" a certain amount of virtual resources if it needs to use a user credit record that has been included and stored in a distributed database of the federation chain.
In implementation, an operator of a federation chain may define the amount of virtual resources in the federation chain that are "consumed" when using a user credit record in the federation chain.
In an illustrative embodiment, taking the virtual resources as the integral, an operator of the federation chain may issue an intelligent contract in advance in the federation chain related to the query for user credit records, and state in the intelligent contract the amount of virtual resources to be "consumed" in querying and using the user credit records in the federation chain. Meanwhile, virtual resource deduction logic related to the credit record use of the user can be declared in the intelligent contract; for example, the logic may "deduct" a certain amount of virtual resources from the account address of the inquiring party based on the amount of the user credit records to be inquired after receiving the data inquiry request for the user credit records in the distributed database.
When a merchant needs to use the user credit records recorded and stored in the alliance chain, a data query request (transaction) can be initiated to a distributed database of the alliance chain through merchant node equipment, after the merchant node equipment receives the data query request, the merchant node equipment can respond to the data query request and invoke the intelligent contract, the number of points to be consumed in the query is calculated based on the number of points to be consumed and the number of the user credit records to be queried in the intelligent contract when the user credit records in the alliance chain are used, and then the corresponding number of points is deducted from the account address corresponding to the merchant node equipment. Of course, if the number of points in the account address corresponding to the merchant node device is insufficient, the merchant node device may send a prompt to the user that the query is failed at this time.
In this way, only the merchant node equipment participating in accounting can acquire the accounting reward of the alliance chain, so that each merchant can be encouraged to share the user credit records generated by the online or offline service of the operation to other merchants by issuing the user credit records to the alliance chain, and the use authority of the user credit records recorded and stored in the alliance chain can be inclined to the merchants participating in accounting; meanwhile, the data query and use threshold in the alliance chain can be improved, and some merchants which do not participate in accounting or non-merchant users which are accessed to the alliance chain can be limited to acquire and use the user credit records shared by all the merchants.
As can be seen from the above embodiments, on one hand, since the block chain has historical traceability and non-tamper-ability, in this way, the user credit records generated in a period of time can be actually recorded on the block chain, and all the user credit records can be traced on the block chain; moreover, as the user credit record is verified and maintained by all the node devices together, the user credit record is tampered by controlling most of the node devices, so that the fairness of the user credit record can be ensured;
on the other hand, because the user credit records generated by each node device in the block chain are shared, each node device can obtain the user credit records issued by other node devices by inquiring on the chain, so that the credit closed loop can not be concentrated in one node device, and each node device can be mutually shared and supervised; and when the credit closed-loop service is deployed, channels reaching the users are correspondingly increased, and the plurality of node devices can jointly supervise and promote the users to actively perform through joint payment promotion, joint punishment, joint excitation and the like on the users by using the credit records of the users on the chain.
Corresponding to the above method embodiments, the present specification further provides an embodiment of a block chain-based credit record sharing apparatus. The embodiments of the block chain based credit record sharing apparatus of the present specification can be applied to electronic devices. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. From a hardware aspect, as shown in fig. 4, the hardware structure diagram of the electronic device where the block chain-based credit record sharing apparatus of this specification is located is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 4, the electronic device where the apparatus is located in the embodiment may also include other hardware according to an actual function of the electronic device, which is not described again.
Fig. 5 is a block diagram illustrating a block chain-based credit record sharing apparatus according to an exemplary embodiment of the present specification.
Referring to fig. 5, the block chain based credit record sharing apparatus 50 can be applied to the electronic device shown in fig. 5, and includes: a collection module 501, a consensus module 502, and a publication module 503.
The collecting module 501 is configured to collect user credit records that are broadcast and issued to the block chain by each node device in the block chain and are verified together by each node device in the block chain in the current accounting period;
a consensus module 502 initiating a consensus process on the collected user credit records in the blockchain to determine a billing node device;
the publishing module 503, if the target node device corresponding to the apparatus is determined as an accounting node, publishes the tile broadcast created based on the collected user credit records to the blockchain for storage in a distributed database of the blockchain.
In this embodiment, the apparatus 50 further comprises:
an obtaining module 504 (not shown in fig. 5) for obtaining a user credit record to be issued; broadcasting and issuing the user credit record in a block chain, so that other node equipment verifies the user credit record, and other node equipment broadcasts and issues a verification result in the block chain;
and the receiving module 505 (not shown in fig. 5) verifies the user credit record when receiving the user credit record broadcast and issued by each other node device, and broadcasts and issues the verification result in the block chain.
In this embodiment, the user credit record that is verified by each node device in the block chain together includes: verifying the passing user credit records by node equipment with a preset proportion in each node equipment in the block chain;
the collection module 501:
collecting user credit records broadcast and issued to the block chain by each node device in the block chain in the current accounting period; each node device in the block chain broadcasts the verification result of the user credit record issued to the block chain in the current accounting period;
and screening out user credit records which are broadcast and issued to the block chain by each node device in the block chain in the current accounting period and pass verification by the node devices in the preset proportion in each node device.
In this embodiment, the consensus module 502:
determining the issuer node equipment corresponding to the collected user credit records;
counting the number of the user credit records issued by each issuing party node device in the current accounting period;
and determining the issuing party node equipment with the largest number of the user credit records issued in the current accounting period as the accounting node equipment.
In this embodiment, the consensus module 502 further:
and counting the number of the user credit records which are issued by each issuing party node device in the current accounting period and have no corresponding repeated record in the distributed database of the block chain.
In this embodiment, the publishing module 503 further:
if the target node equipment corresponding to the device is determined as an accounting node, acquiring a preset number of virtual resources generated by the block chain, and issuing the virtual resources to an account address corresponding to the target node equipment; or, if the user credit record issued by the target node device is stored in the distributed database of the block chain, acquiring a preset number of virtual resources generated by the block chain, and issuing the virtual resources to an account address corresponding to the target node device; wherein the virtual resource is used for obtaining the use authority of the user credit record stored in the distributed database of the block chain.
In this embodiment, the apparatus further includes:
a query module 505 (not shown in FIG. 5) that receives a data query request directed to the distributed database; and responding to the data query request, calling an intelligent contract corresponding to the data query, and deducting a preset amount of virtual resources from an account address corresponding to the target node equipment.
In this embodiment, the virtual resource is a virtual integral.
In this embodiment, the blockchain includes a main chain; and, a plurality of daughter strands anchored to the backbone;
the release module:
if the target node device corresponding to the device is the node device in the main chain, broadcasting and issuing a block created based on user credit records which are collected in the current accounting period and verified by all the node devices in the main chain and all the sub chains to the main chain of the block chain;
and if the target node device corresponding to the device is the node device in the sub-chain, broadcasting and issuing a block broadcast created by each node device in the sub-chain based on the collected current accounting period to the sub-chain and the user credit records verified by each node device in the sub-chain together to a main chain of the block chain.
In this embodiment, the block chain is a federation chain formed by a plurality of merchant node devices; the federation chain includes a main chain; and, a plurality of daughter strands anchored to the backbone; wherein, different sub-chains respectively correspond to different merchant types.
The implementation process of the functions and actions of each module in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or modules illustrated in the above embodiments may be implemented by a computer chip or an entity, or by an article of manufacture with certain functionality. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
Corresponding to the method embodiment, the present specification also provides an embodiment of an electronic device. The electronic device includes: a processor and a memory for storing machine executable instructions; wherein the processor and the memory are typically interconnected by an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, the processor is caused to:
collecting user credit records which are broadcast and issued to the block chain by each node device in the block chain in the current accounting period and are verified by each node device in the block chain together;
initiating consensus processing of the collected user credit records in the blockchain to determine a billing node device;
and if the electronic equipment is determined to be a billing node, issuing the block broadcast created based on the collected user credit records to the block chain to be stored in a distributed database of the block chain.
In this embodiment, the processor is caused to:
acquiring a user credit record to be issued;
broadcasting and issuing the user credit record in a block chain, so that other node equipment verifies the user credit record, and other node equipment broadcasts and issues a verification result in the block chain; and the number of the first and second groups,
and when receiving the user credit records broadcast and issued by other node equipment, verifying the user credit records, and broadcasting and issuing verification results in the block chain.
In this embodiment, the user credit record that is verified by each node device in the block chain together includes: verifying the passing user credit records by node equipment with a preset proportion in each node equipment in the block chain;
by reading and executing machine-executable instructions stored by the memory corresponding to control logic shared with blockchain-based credit records, the processor is caused to:
collecting user credit records broadcast and issued to the block chain by each node device in the block chain in the current accounting period; each node device in the block chain broadcasts the verification result of the user credit record issued to the block chain in the current accounting period;
and screening out user credit records which are broadcast and issued to the block chain by each node device in the block chain in the current accounting period and pass verification by the node devices in the preset proportion in each node device.
In this embodiment, the processor is caused to:
determining the issuer node equipment corresponding to the collected user credit records;
counting the number of the user credit records issued by each issuing party node device in the current accounting period;
and determining the issuing party node equipment with the largest number of the user credit records issued in the current accounting period as the accounting node equipment.
In this embodiment, the processor is caused to:
and counting the number of the user credit records which are issued by each issuing party node device in the current accounting period and have no corresponding repeated record in the distributed database of the block chain.
In this embodiment, the processor is caused to:
if the target node equipment is determined as an accounting node, acquiring a preset number of virtual resources generated by the block chain, and issuing the virtual resources to an account address corresponding to the target node equipment; or,
if the user credit records issued by the target node equipment are stored in the distributed database of the block chain, acquiring a preset number of virtual resources generated by the block chain, and issuing the virtual resources to account addresses corresponding to the target node equipment;
wherein the virtual resource is used for obtaining the use authority of the user credit record stored in the distributed database of the block chain.
In this embodiment, the processor is caused to:
receiving a data query request for the distributed database;
and responding to the data query request, calling an intelligent contract corresponding to the data query, and deducting a preset amount of virtual resources from an account address corresponding to the target node equipment.
Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
It will be understood that the present description is not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.