CN110232569B - Method and device for reading transaction record and storage medium - Google Patents

Method and device for reading transaction record and storage medium Download PDF

Info

Publication number
CN110232569B
CN110232569B CN201910376422.1A CN201910376422A CN110232569B CN 110232569 B CN110232569 B CN 110232569B CN 201910376422 A CN201910376422 A CN 201910376422A CN 110232569 B CN110232569 B CN 110232569B
Authority
CN
China
Prior art keywords
blockchain
transaction
reading
information
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910376422.1A
Other languages
Chinese (zh)
Other versions
CN110232569A (en
Inventor
杨天
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910376422.1A priority Critical patent/CN110232569B/en
Publication of CN110232569A publication Critical patent/CN110232569A/en
Application granted granted Critical
Publication of CN110232569B publication Critical patent/CN110232569B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Abstract

The invention provides a method, a device and a storage medium for reading transaction records, wherein the method comprises the following steps: acquiring a reading request initiated by a first initiator by using first equipment, wherein the first equipment is any external equipment of a block chain network, and the reading request is used for requesting to read a transaction record of a first block chain; judging whether the first initiator has a reading right for reading the transaction record; under the condition that a first initiator has a reading authority, acquiring a transaction record corresponding to the reading request; and outputting a reading result of the reading request according to the transaction record. Therefore, under the scene that the setting of the viewing permission is preset for the transaction data, the permission of the reading request can be verified by using the second block chain which is set in an associated mode with the first block chain, the reading result is output, the permission setting of the data is realized on the block chain network, the privacy protection is further carried out on the data, the security of the transaction data is improved, and the flexibility of the block chain network is expanded.

Description

Method and device for reading transaction record and storage medium
Technical Field
The present invention relates to a method and an apparatus for reading transaction records, and a storage medium, which belongs to the field of block chain technology.
Background
The blockchain technique is a chronologically recorded, distributed ledger technique with non-tamper-able and de-centralization features. The block chain technology can calculate and store the same transaction data in a whole chain, ensure that the transaction data is public and transparent, simplify data sharing operation and improve transaction reliability. For example, the method is widely applied to scenes such as digital asset certification, asset transaction, supply chain tracing, cross-border settlement, public welfare credit and the like.
In the prior art, the blockchain network can ensure that the transaction record is not tampered after being written, such as bitcoin, ether house, etc., but at the same time, no specific limitation is made to the reading operation of the transaction record. Due to the public transparency of the blockchain, a large amount of data generated by the service based on the blockchain technology is not disclosed completely, and thus, the confidentiality of the data cannot be realized.
Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus and a storage medium for reading a transaction record, which provide an effective computing mechanism to solve or at least partially solve the problem of lack of privacy of data caused by unlimited reading operation of the transaction record in the prior art.
According to a first aspect of the present invention, there is provided a method for reading a transaction record, applied to a blockchain network having at least one first blockchain and at least one second blockchain, the method being performed on the second blockchain associated with at least one of the first blockchains, the method including:
acquiring a read request initiated by a first initiator by using a first device, wherein the first device is any external device of the blockchain network, and the read request is used for requesting to read a transaction record stored on the first blockchain;
judging whether the first initiator meets the reading permission for reading the transaction record;
under the condition that the first initiator has the reading authority, acquiring a transaction record corresponding to the reading request from the first blockchain;
and outputting a reading result of the reading request according to the transaction record.
According to a second aspect of the present invention, there is provided a transaction record reading apparatus for use in a blockchain network having at least one first blockchain and at least one second blockchain, the apparatus being arranged in the second blockchain associated with at least one of the first blockchains, the apparatus comprising:
a request obtaining module, configured to obtain a read request initiated by a first initiator using a first device, where the first device is any external device of the blockchain network, and the read request is used to request to read a transaction record stored in the first blockchain;
the condition judgment module is used for judging whether the first initiator has a reading right for reading the transaction record;
a record obtaining module, configured to obtain, from the first blockchain, a transaction record corresponding to the read request when the first initiator has the read permission;
and the result output module is used for outputting the reading result of the reading request according to the transaction record.
According to a third aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of reading a transaction record according to the first aspect.
Aiming at the prior art, the invention has the following advantages:
a second block chain which is preset in a block chain network and is associated with at least one first block chain is utilized, so that whether the first initiator has a reading permission for reading a transaction record or not is judged according to an obtained reading request; then under the condition that the first initiator has the reading authority, acquiring a transaction record corresponding to the reading request; and outputting the reading result of the reading request according to the transaction record. Therefore, after the authority of the reading request is confirmed, the reading result corresponding to the reading request with the reading authority is output, and privacy protection of data in a block chain environment is realized by presetting viewing authority setting or other limits on transaction data, so that the security of the transaction data is improved, and the flexibility of a block chain network is expanded; in addition, the authorization verification and the data check of the transaction data are realized through the second block chain associated with the first block chain, the operation of directly recording, inquiring and outputting the first block chain can be avoided, the operation pressure of the first block chain is reduced, and the stability and the operation speed of the first block chain are further improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flowchart illustrating steps of a method for reading transaction records according to an embodiment of the present invention;
FIG. 2 is a block chain structure according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating steps of a method for reading transaction records according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating steps of a method for reading a transaction record according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating steps of a method for reading a transaction record according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating steps of a method for reading a transaction record according to an embodiment of the present invention;
FIG. 7 is a block diagram of a device for reading transaction records according to an embodiment of the present invention;
FIG. 8 is a block diagram of a device for reading transaction records according to an embodiment of the present invention;
FIG. 9 is a block diagram of a condition determining module according to an embodiment of the present invention;
FIG. 10 is a block diagram of a result output module provided by embodiments of the present invention;
fig. 11 is a block diagram of an association module according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 is a flowchart of steps of a method for reading a transaction record, according to an embodiment of the present invention, as shown in fig. 1, applied to a blockchain network having at least one first blockchain and at least one second blockchain, where the method is performed on the second blockchain associated with the at least one first blockchain, and the method may include:
step 101, a read request initiated by a first initiator using a first device is obtained.
Wherein the first device is any external device of the blockchain network and the read request is for requesting reading of a transaction record stored on the first blockchain.
Illustratively, the read request includes transaction information corresponding to the transaction record to be read by the first initiator, such as transaction ID, transaction party information, transaction device information, and storage information (such as stored blockchain information), so that, in the case where a plurality of second blockchains are included in the blockchain network, the second blockchain corresponding to the read operation to be performed can be determined according to the transaction information included in the read request, and the corresponding second blockchain receives the read request and correspondingly performs the operations of the following steps.
Fig. 2 is a schematic structural diagram of a block chain network according to an embodiment of the present invention, which includes a first block chain and two second block chains, where the second block chain is used as a side chain of the first block chain, and the second block chain (i.e., the side chain) is associated with a block in the first block chain (i.e., the main chain) through metadata of the block. In a specific application, the blockchain network may be an ethernet, an EOS (english: Enterprise Operation System; chinese: Enterprise operating System) or a federation chain or a private chain of a super book, the first blockchain is used to confirm and record information of a user Operation, the user Operation may be a credit transaction, an Operation of storing a certain license certificate or an authentication certificate on the first blockchain is also referred to as a credit transaction, transaction information (including transaction entry information, for example) generated by the credit transaction is recorded on the first blockchain, and the second blockchain is used as a side chain of the first blockchain and may be used to confirm and record that the user reads the transaction entry information stored on the first blockchain, and one or more first blockchains and one or more second blockchains included in one blockchain network support automatic or manual flexible capacity expansion of the blockchain network, and automatic or manual flexible capacity expansion or capacity reduction of the internal nodes of the block chain network.
The read request is a read request sent by a first initiator (which may be a certain user) by using an external device of the blockchain network, and is an off-chain request; the first device for sending the read request may be any terminal or server device that can perform data communication with the second blockchain, and after receiving the read request, the second blockchain may correspondingly perform a read operation, and then return a result of the read operation to an external device, that is, the first device.
It should be noted that fig. 2 is only an example of the first blockchain and the second blockchain, and is not used to limit the first blockchain number and the second blockchain number and the association relationship between the second blockchain and the first blockchain.
Step 102, determining whether the first initiator has a read right to read the transaction record.
In a specific application, the read right of the first initiator may be verified according to payment information corresponding to the read request included in the read request or identity information corresponding to the first initiator, where the verification of the identity information may be based on pre-authorization information, such as a user information list or a device information list having the read right; the payment information is information generated by the first initiator operating to read the transaction record for a resource attribute value, such as a token value. That is, when the user sets the read right for the transaction information in the blockchain network, after receiving an external read request, the second blockchain first performs verification of the read right. For example, the preset conditions that can read the transaction entry information in the blockchain network are: paying or prepaying a corresponding token value, and thus, when the first initiator has paid or prepayed the token value required by the reading request correspondingly, determining that the first initiator has the reading authority; and/or the first initiator is any user in a user information list included in the pre-authorized information, or the first device used by the first initiator is any device in a device information list included in the pre-authorized information, so that the reading right of the first initiator can be judged, and the acquisition of the transaction record in the following steps can be performed.
Step 103, under the condition that the first initiator has the reading right, obtaining the transaction record corresponding to the reading request from the first blockchain.
In a specific application, the second blockchain responds to the read request, obtains the transaction entry information from the first blockchain, and returns the transaction entry information to an external request initiator as a read result of the read request. Data interaction can be carried out between the first block chain and the second block chain according to a preset data communication protocol, the second block chain is used for expanding the function of the first block chain, the reading request is sent to the first block chain by using a data interface corresponding to the data communication protocol after the reading request is obtained, and after the transaction item information corresponding to the reading request is found on the first block chain, the transaction record comprising the transaction item information is returned to the second block chain by using the data interface, so that the second block chain can carry out the operation in the following step 104, and the reading result is returned to the first requester.
In addition, when the second blockchain is associated with a plurality of first blockchains, the read request may further include information of the first blockchain storing the transaction record corresponding to the read request, for example, blockchain ID information, so that the second blockchain can perform data interaction with the corresponding first blockchain to obtain the transaction record.
And 104, outputting a reading result of the reading request according to the transaction record.
In a specific application, after the transaction record is obtained through the above steps, the transaction record can be directly used as a reading result and output to an initiator of the reading request.
Optionally, the transaction record may further include transaction entry information and associated identity information, that is, after the second blockchain receives the transaction record, the second blockchain performs identity verification on the first blockchain that sends the transaction entry information according to the associated identity information, and may compare metadata associated with the first blockchain and the second blockchain, so as to determine whether the associated identity information is consistent with metadata stored in advance in the founding block; if the transaction items are consistent, the identity authentication is passed, and the transaction item information in the transaction record can be output to the first initiator; otherwise, under the condition of inconsistency, it is indicated that the identity of the first block chain which sends the transaction entry information is wrong, that is, the sent transaction entry information is not the information corresponding to the read request, and the correct transaction entry information needs to be obtained again.
It will be appreciated that the above-described authentication operation is used to verify the first blockchain identity to avoid the situation where the first blockchain identity is tampered or forged due to an illegal attack, generating false transaction entry information.
According to the technical scheme provided by the invention, the operations of obtaining and authorizing verification of the reading request and reading and outputting the transaction record are carried out by utilizing the second block chain which is associated with at least one first block chain through data in the block chain network, so that the authority limit of the transaction record in the block chain network is realized, the confidentiality of the data is ensured, and the flexibility of the block chain network is improved. In addition, the authority verification and the data check of the transaction data are realized through the second block chain, the operation that the first block chain directly records, inquires and outputs can be avoided, extra operation pressure can not be caused on the first block chain, and the stability and the running speed of the first block chain are further improved.
In summary, according to the method for reading a transaction record provided by the present invention, a second blockchain associated with at least one first blockchain is preset in a blockchain network, so as to first determine whether a read request has a read permission to read the transaction record according to an obtained read request; then under the condition that the first initiator has the reading authority, acquiring a transaction record corresponding to the reading request from the first blockchain; and outputting the reading result of the reading request according to the transaction record. Therefore, the permission of the read request can be verified by using the second blockchain which is set in an associated manner with the first blockchain, and the read result corresponding to the read request with the read permission is output, so that privacy protection under a blockchain scene is realized, the security of transaction data is improved, and the flexibility of a blockchain network is expanded.
Optionally, fig. 3 is a flowchart illustrating specific steps of a method for reading a transaction record according to an embodiment of the present invention, as shown in fig. 3, before step 101, the method may include:
in the case of initialization, generating attached data of the created block of the second blockchain by using the metadata of the first blockchain, so as to associate the second blockchain with one or more blocks on the first blockchain, step 105.
In a specific application, when the second blockchain is initialized, since one blockchain includes a plurality of blocks, creating a first block of the second blockchain is referred to as initializing the second blockchain, and using metadata of a block of the first blockchain to which the first blockchain is to be associated, or using metadata of blocks of the first blockchain to which the first blockchain is to be associated as adjunct data of an established block of the second blockchain, which may or may not be encrypted, so as to associate the second blockchain with one or more corresponding first blockchains. The first block created earliest in the block chain is called a created block, and has a unique ID number.
Due to the fact that the side chain (namely the second block chain) is associated with the main chain (namely the first block chain) through metadata, a user can achieve operations which cannot be achieved on the main chain through the side chain; and because the side chain is an independent block chain and has a node network of the side chain, and the code and the data are relatively independent, the related side chain does not increase the burden of a main chain in the operation process, and the condition of excessive expansion of the data is avoided. In the embodiment of the invention, the second block chain is used as a side chain to be associated with the first block chain as a main chain, so that the operation which is originally required to be executed on the first block chain is distributed to the second block chain to be executed, the service pressure of the first block chain is reduced to ensure the execution efficiency of the operation, and the stability of a block chain system is improved; in addition, the association method of the second block chain and the first block chain in the embodiment of the present invention is to associate the second block chain with one or more blocks in the first block chain, that is, to adopt an association form with finer data particles, so as to reduce the complexity of association between blocks in the block chain system.
In addition, it should be noted that, the second blockchain proposed in the present invention is different from the blockchain in the existing blockchain network, and besides the function of the second blockchain in the blockchain network in the prior art can be implemented, for example, the second blockchain can be anchored in both directions in the blockchain network, the read operation of the transaction record and the save operation of the read record can also be performed on the associated first blockchain, the read authority of the transaction record can be set by verifying the read authority of the first requester, and the read and output operation can be set on the second blockchain, so as to reduce the operation pressure generated on the first blockchain.
Alternatively, as shown in fig. 4, step 105 may include the following sub-steps:
step 1051, obtain target metadata from the first blockchain.
Wherein the target metadata comprises metadata of one or more blocks of the first blockchain associated with the second blockchain.
Step 1052, the target metadata is used as the attached data of the created block of the second block chain.
Step 1053, hash value conversion is performed on the target metadata to obtain the attached data of the created block of the second block chain.
That is, in order to ensure the security of the metadata of the first block chain, the metadata may be encrypted, for example, by using a hash value algorithm, and the generated hash value is used as the attached data of the created block, so as to implement the association operation with the first block chain.
In a specific application, when a plurality of blocks are associated with the second blockchain, the metadata of the one or more blocks may be packaged so as to convert the metadata (i.e., the target metadata) into a hash value, thereby implementing the association operation between the one or more blocks of the first blockchain and the second blockchain. In addition, when the second blockchain is associated with a plurality of first blockchains, metadata of a plurality of blocks corresponding to the plurality of first blockchains may be packed, i.e., as described above. Or, the blocks used for association on each first block chain may be separately packaged, and the ID information of the first block chain is used to distinguish the blocks used for association, that is, metadata of one or more blocks associated with one first block chain is combined into a hash value, and the hash value is marked by the ID information of the first block chain, so that when the identity information is verified in a subsequent step, the corresponding metadata can be obtained to perform the identity verification of the first block chain.
Optionally, fig. 5 is a flowchart illustrating specific steps of a method for reading a transaction record according to an embodiment of the present invention, as shown in fig. 5, the determining whether the read request has a read right to read the transaction record in step 102 may include:
step 1021, obtaining the attribute information of the first initiator included in the read request.
For example, a certain first blockchain in the blockchain network may set pre-authorization information for limiting the right to read all transaction records on the first blockchain, such as a right list. The corresponding attribute information may be information indicating the identity of the first initiator, such as a user ID of the first initiator or a device ID of the first device used, and may also be payment information of the first initiator for the read request.
And 1022, verifying the attribute information according to a preset verification condition.
Exemplarily, in the case that the attribute information is identity information, the pre-authorized information corresponding thereto is: a list of device IDs and/or a list of user IDs with read rights, and the corresponding authentication conditions are: any initiator in the user ID list meets the verification condition and/or any device in the device ID list meets the verification condition, namely the first initiator is determined to have the reading authority; and if the first device is not in the device ID list or the first initiator is not an initiator in the user ID list, the authentication condition is not satisfied, that is, the read right is not provided. And/or, in case the attribute information is payment information, the verification condition includes that the first initiator has paid or prepaid the reading cost of the transaction record. For example, after the first initiator pays the reading cost, transaction record information of successful payment is generated in the blockchain network, and a transaction success message corresponding to the reading request is used as the payment information, or a preset switch for indicating the successful transaction is triggered, that is, the transaction record information is used as the payment information, and the verification condition is indicated to be met under the condition that the payment information exists; when the reading cost required by the reading request is not paid, no payment information is generated, that is, the verification condition is not met, and the operation of step 103 cannot be performed.
Further, in the case where the attribute information includes both the identity information and the payment information of the read request, that is, the authentication is performed in step 1022, that is, the identity information and the payment information are authenticated. For example, the verification condition may include: under the condition that the user ID of the first initiator belongs to the user ID list and the first initiator pays the corresponding reading cost; or, when the device ID of the first device belongs to the devices in the device ID list and the first initiator pays the corresponding reading cost, it is determined that the verification condition is met, and the embodiment of the present invention is not limited.
In step 1023, in the case that the attribute information meets the verification condition, it is determined that the first initiator has the read right.
For example, in the case that the attribute information meets the verification condition, the operation of step 103, that is, acquiring the corresponding transaction record, may be performed. Otherwise, the reading request cannot continuously execute the reading operation, and an error message is returned, which indicates that the inquiry of the transaction record cannot be carried out.
Optionally, fig. 6 is a flowchart illustrating specific steps of a method for reading a transaction record according to an embodiment of the present invention, as shown in fig. 6, the outputting a reading result of a reading request according to a transaction record in step 104 may include:
step 1041, obtaining a matching degree between the associated identity information and the attached data of the created block of the second block chain.
Wherein the associated identity information comprises metadata of a block on the first blockchain for storing the transaction entry information.
Step 1042, determining the transaction record as a legal record when the matching degree between the associated identity information and the attached data of the created block of the second block chain exceeds a preset threshold.
In an example, the transaction record obtained from the first blockchain further includes associated identity information, that is, metadata of a block on the first blockchain storing the transaction record is subjected to similarity calculation of data content with attached data stored in an created block of the second blockchain at initialization, so as to serve as a matching degree between the associated identity information and the attached data of the created block of the second blockchain, and thus it is determined whether the sent transaction record is legal or not and whether the associated identity information is tampered or not according to the matching degree.
It should be noted that, when the second blockchain is bound to a block in the first blockchain, the corresponding preset threshold is 100%, that is, only when the associated identity information (i.e., metadata of the block) is completely consistent with the attached data of the created block of the second blockchain, that is, the matching degree is 100%, the transaction record is determined to be a legal record, and the read result can be output; otherwise, any inconsistency exists, which indicates that the transaction record has the possibility of tampering and cannot be output.
Or, when the second blockchain is associated with a plurality of blocks of the first blockchain or a plurality of blocks of one first blockchain and metadata of the plurality of blocks are packed together, the corresponding preset threshold is related to the number of the associated blocks, that is, the associated identity information needs to be consistent with a part of the attached data of the created block of the second blockchain (i.e., the part corresponding to the first blockchain), that is, the matching degree exceeds the corresponding preset threshold, that is, the transaction record can be determined to be legal. If the metadata of the blocks of the associated first block chains are separately packaged, the corresponding metadata in the auxiliary data of the created block is acquired according to the ID information of the first block chains, so as to compare the associated identity information with the auxiliary data of the created block.
And step 1043, determining a reading result according to the transaction entry information under the condition that the transaction record is a legal record.
In specific application, the transaction item information included in the transaction record determined as a legal record is used as a reading result to be output to an initiator of the reading request, so that the reading operation of the transaction record of this time is completed.
Or, optionally, the step may further include:
substep A1: and encrypting the transaction item information of the first blockchain.
Substep A2: and outputting the encrypted transaction item information of the first block chain as a reading result.
Namely, the transaction entry information in the transaction record is encrypted and then output, so that the security of the transaction entry information needing to be kept secret is ensured, encryption transmission is carried out, and the data confidentiality is further improved.
And step 1044, outputting the reading result.
Illustratively, after determining that the transaction record is a legitimate record, the transaction entry information is returned to the first initiator, i.e. the transaction entry information is sent back to the first initiator directly as a read result. Alternatively, the above sub-steps may be performed on the transaction entry information to ensure the security of the data, and the embodiment of the present invention is not limited.
In addition, it should be noted that, after determining that the transaction record is a legal record, the method may further include:
in step 1045, the read transaction information generated by the read request is recorded.
The read transaction information includes information of the first initiator and transaction entry information.
For example, the reading operation of one transaction record is taken as one reading transaction, after one reading transaction is completed, the information of the reading transaction is recorded, and the reading transaction information corresponding to the reading transaction is generated and stored on the second block chain, so that the reading transaction information can be conveniently viewed. Or, when a read request consistent with the information in the read transaction is received again, the information of the read transaction stored on the second blockchain can be directly output, so that the read operation of the transaction information is simplified, and the data storage and data reading pressure of the first blockchain is reduced. The transaction entry information of the transaction record may include information such as the original transaction party and the transaction content of the transaction record.
Fig. 7 is a block diagram of a device for reading transaction records according to an embodiment of the present invention, which is applied to a blockchain network having at least one first blockchain and at least one second blockchain, and is disposed on the second blockchain associated with the at least one first blockchain, as shown in fig. 7, where the device 700 includes:
a request obtaining module 710, configured to obtain a read request initiated by a first initiator using a first device, where the first device is any external device of the blockchain network, and the read request is used to request to read a transaction record stored on the first blockchain.
And a condition determining module 720, configured to determine whether the first initiator has a read right to read the transaction record.
The record obtaining module 730 is configured to obtain the transaction record corresponding to the read request from the first blockchain when the first initiator has the read right.
And a result output module 740, configured to output a reading result of the reading request according to the transaction record.
Optionally, on the basis of fig. 7, as shown in fig. 8, the apparatus 700 further includes:
an associating module 750, configured to generate, before the step of obtaining the read request initiated by the first initiator using the first device, attached data of a created block of the second blockchain using the metadata of the first blockchain under the condition of initialization, so as to associate the second blockchain with one or more blocks of the first blockchain.
Optionally, fig. 9 is a block diagram of a condition determining module according to an embodiment of the present invention, where the condition determining module 720, as shown in fig. 9, includes:
the information obtaining sub-module 721 is configured to obtain attribute information of the first initiator included in the read request.
The condition verifying submodule 722 is configured to verify the attribute information according to a preset verifying condition.
And the authority determination sub-module 723 is used for determining that the first initiator has the read authority if the attribute information meets the verification condition.
Optionally, the transaction record includes transaction entry information and associated identity information, fig. 10 is a block diagram of a result output module according to an embodiment of the present invention, as shown in fig. 10, the result output module 740 includes:
the matching degree obtaining sub-module 741 is configured to obtain a matching degree between the associated identity information and the attached data of the created block of the second block chain, where the associated identity information includes metadata of a block used for storing the transaction entry information on the first block chain.
A record determining sub-module 742 is configured to determine that the transaction record is a legal record if a matching degree between the associated identity information and the attached data of the created block of the second block chain exceeds a preset threshold.
A result determining submodule 743, configured to determine, when the transaction record is a legal record, a reading result according to the transaction entry information.
And a result output sub-module 744 for outputting the read result.
Optionally, the result determination submodule 743 includes:
an encryption unit 7431, configured to encrypt the transaction entry information of the first blockchain;
a determining unit 7432, configured to output the encrypted transaction entry information of the first block chain as a reading result.
Optionally, as shown in fig. 10, the result output module 740 may further include:
the information recording sub-module 745 is configured to record read transaction information generated by the read request after determining that the transaction record is a legal record when the associated identity information is consistent with the attached data of the created block of the second block chain, where the read transaction information includes information of the first requester and transaction entry information.
Optionally, fig. 11 is a block diagram of an association module according to an embodiment of the present invention, and as shown in fig. 11, the association module 750 includes:
the data obtaining sub-module 751 is configured to obtain target metadata, where the target metadata includes metadata of one or more blocks on a first blockchain associated with a second blockchain.
A data generation submodule 752, configured to use the target metadata as attached data of the created block of the second block chain; alternatively, the first and second electrodes may be,
the data generating sub-module 752 is further configured to perform hash value conversion on the target metadata to obtain attached data of the created block of the second block chain.
In addition, an embodiment of the present invention further provides a terminal, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the above-mentioned method for reading a transaction record, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned transaction record reading method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
For the above device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As is readily imaginable to the person skilled in the art: any combination of the above embodiments is possible, and thus any combination between the above embodiments is an embodiment of the present invention, but the present disclosure is not necessarily detailed herein for reasons of space.
The reading methods of transaction records provided herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The structure required to construct a system incorporating aspects of the present invention will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the method of the invention should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor may be used in practice to implement some or all of the functions of some or all of the components of the method of reading a transaction record according to an embodiment of the invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (15)

1. A method for reading a transaction record, applied to a blockchain network having at least one first blockchain and at least one second blockchain, the method being performed on the second blockchain associated with at least one of the first blockchains, the method comprising:
acquiring a read request initiated by a first initiator by using a first device, wherein the first device is any external device of the blockchain network, and the read request is used for requesting to read a transaction record stored on the first blockchain;
judging whether the first initiator has a reading right for reading the transaction record;
under the condition that the first initiator has the reading authority, acquiring a transaction record corresponding to the reading request from the first blockchain;
and outputting a reading result of the reading request according to the transaction record.
2. The method of claim 1, wherein prior to the step of obtaining a read request initiated by a first initiator with a first device, the method further comprises:
in the case of initialization, generating attached data of the founder block of the second blockchain by using the metadata of the first blockchain to associate the second blockchain with one or more blocks on the first blockchain.
3. The method of claim 1 or 2, wherein the determining whether the first initiator has read rights to read the transaction record comprises:
acquiring attribute information of the first initiator included in the reading request;
verifying the attribute information according to a preset verification condition;
determining that the first initiator has the read right if the attribute information meets the verification condition.
4. The method according to claim 1 or 2, wherein the transaction record includes transaction entry information and associated identity information, and the outputting the read result of the read request according to the transaction record includes:
acquiring a matching degree between the associated identity information and attached data of a founder block of the second block chain, wherein the associated identity information comprises metadata of a block used for storing the transaction entry information on the first block chain;
determining the transaction record as a legal record under the condition that the second blockchain is bound with one block on one first blockchain, and the associated identity information is consistent with the affiliated data of the created block of the second blockchain, or under the condition that the second blockchain is bound with blocks of a plurality of first blockchains or the second blockchain is bound with a plurality of blocks of one first blockchain, and the matching degree between the associated identity information and the affiliated data of the created block of the second blockchain exceeds a preset threshold value;
under the condition that the transaction record is a legal record, determining the reading result according to the transaction item information;
and outputting the reading result.
5. The method of claim 4, wherein determining the reading result according to the transaction entry information in the case that the transaction record is a legal record comprises:
encrypting the transaction item information;
and taking the encrypted transaction item information as the reading result.
6. The method according to claim 5, wherein, after determining that the transaction record is a legal record in a case where the second blockchain is bound to one block on one first blockchain and the associated identity information is consistent with the attached data of the founder block of the second blockchain, or in a case where the second blockchain is bound to a plurality of blocks of the first blockchain or the second blockchain is bound to a plurality of blocks of one first blockchain and the degree of matching between the associated identity information and the attached data of the founder block of the second blockchain exceeds a preset threshold, the method further comprises:
and recording read transaction information generated by the read request, wherein the read transaction information comprises the information of the first initiator and the transaction item information.
7. The method according to claim 2, wherein generating the auxiliary data of the created block of the second blockchain by using the metadata of the first blockchain in case of initialization comprises:
obtaining target metadata from the first blockchain, the target metadata including metadata of one or more blocks of the first blockchain associated with the second blockchain;
taking the target metadata as adjunct data of the created blocks of the second block chain; or, performing hash value conversion on the target metadata to obtain the attached data of the created block of the second block chain.
8. A device for reading transaction records, applied to a blockchain network having at least one first blockchain and at least one second blockchain, the device being arranged at the second blockchain associated with at least one of the first blockchains, the device comprising:
a request obtaining module, configured to obtain a read request initiated by a first initiator using a first device, where the first device is any external device of the blockchain network, and the read request is used to request to read a transaction record stored in the first blockchain;
the condition judgment module is used for judging whether the first initiator has a reading right for reading the transaction record;
a record obtaining module, configured to obtain, from the first blockchain, a transaction record corresponding to the read request when the first initiator has the read permission;
and the result output module is used for outputting the reading result of the reading request according to the transaction record.
9. The apparatus of claim 8, further comprising:
an associating module, configured to generate, before the step of obtaining the read request initiated by the first initiator using the first device, attached data of a created block of the second blockchain by using the metadata of the first blockchain under the condition of initialization, so as to associate the second blockchain with one or more blocks on the first blockchain.
10. The apparatus according to claim 8 or 9, wherein the condition determining module comprises:
an information obtaining submodule, configured to obtain attribute information of the first initiator included in the read request;
the condition verification submodule is used for verifying the attribute information according to a preset verification condition;
and the authority determining submodule is used for determining that the first initiator has the reading authority under the condition that the attribute information meets the verification condition.
11. The apparatus of claim 8 or 9, wherein the transaction record includes transaction entry information and associated identity information, and the result output module includes:
a matching degree obtaining sub-module, configured to obtain a matching degree between the associated identity information and attached data of an ancestry block of the second block chain, where the associated identity information includes metadata of a block on the first block chain, where the block is used to store the transaction entry information;
a record determining sub-module, configured to determine that the transaction record is a legal record when the second blockchain is bound to a block on one of the first blockchains and the associated identity information is consistent with attached data of an established block of the second blockchain, or when the second blockchain is bound to blocks of a plurality of the first blockchains or the second blockchain is bound to a plurality of blocks of one of the first blockchains and a matching degree between the associated identity information and the attached data of the established block of the second blockchain exceeds a preset threshold;
the result determining submodule is used for determining the reading result according to the transaction item information under the condition that the transaction record is a legal record;
and the result output submodule is used for outputting the reading result.
12. The apparatus of claim 11, wherein the result determination submodule comprises:
the encryption unit is used for carrying out encryption processing on the transaction item information;
and the determining unit is used for taking the encrypted transaction item information of the first block chain as the reading result.
13. The apparatus of claim 12, wherein the result output module further comprises:
an information recording sub-module, configured to record read transaction information generated by the read request after determining that the transaction record is a valid record when the second blockchain is bound to a block on one of the first blockchains and the associated identity information is consistent with attached data of an established block of the second blockchain, or when the second blockchain is bound to blocks of a plurality of the first blockchains or the second blockchain is bound to a plurality of blocks of one of the first blockchain and a matching degree between the associated identity information and attached data of an established block of the second blockchain exceeds a preset threshold, where the read transaction information includes information of the first initiator and the transaction entry information.
14. The apparatus of claim 9, wherein the associating module comprises:
a data obtaining sub-module, configured to obtain target metadata from the first blockchain, where the target metadata includes metadata of one or more blocks of the first blockchain associated with the second blockchain;
a data generation submodule, configured to use the target metadata as attached data of a created block of the second block chain; alternatively, the first and second electrodes may be,
and the data generation sub-module is further configured to perform hash value conversion on the target metadata to obtain attached data of the created block of the second block chain.
15. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of reading a transaction record according to any one of claims 1 to 7.
CN201910376422.1A 2019-05-07 2019-05-07 Method and device for reading transaction record and storage medium Active CN110232569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910376422.1A CN110232569B (en) 2019-05-07 2019-05-07 Method and device for reading transaction record and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910376422.1A CN110232569B (en) 2019-05-07 2019-05-07 Method and device for reading transaction record and storage medium

Publications (2)

Publication Number Publication Date
CN110232569A CN110232569A (en) 2019-09-13
CN110232569B true CN110232569B (en) 2021-04-16

Family

ID=67860423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910376422.1A Active CN110232569B (en) 2019-05-07 2019-05-07 Method and device for reading transaction record and storage medium

Country Status (1)

Country Link
CN (1) CN110232569B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826095B (en) * 2019-10-22 2021-09-21 中国人民大学 Block chain data encryption method and system
CN111327623A (en) * 2020-02-28 2020-06-23 上海哈世科技有限公司 Alliance link information transmission method, device, equipment and storage medium
CN112019603B (en) * 2020-08-10 2022-04-08 中国联合网络通信集团有限公司 Transaction data processing method and device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169865A (en) * 2017-04-24 2017-09-15 北京果仁宝科技有限公司 Asset data processing system based on block chain technology
CN107464106A (en) * 2017-07-25 2017-12-12 北京果仁宝科技有限公司 The method and system merchandised between block chain main chain and side chain
WO2017223540A1 (en) * 2016-06-24 2017-12-28 PokitDok, Inc. System and method for cryptographically verified data driven contracts
CN107679857A (en) * 2017-10-10 2018-02-09 马晶瑶 Across the chain method of commerce and storage medium of block chain
CN108563788A (en) * 2018-04-27 2018-09-21 腾讯科技(深圳)有限公司 Data query method, apparatus, server and storage medium based on block chain
CN108616539A (en) * 2018-05-03 2018-10-02 东莞市翔实信息科技有限公司 A kind of method and system that block chain transaction record accesses
CN108632268A (en) * 2018-04-28 2018-10-09 腾讯科技(深圳)有限公司 The method for authenticating and device, storage medium, electronic device that block chain accesses
CN108712257A (en) * 2018-04-03 2018-10-26 阿里巴巴集团控股有限公司 The authentication method and device, electronic equipment of transregional piece of chain
CN109493221A (en) * 2018-10-26 2019-03-19 全链通有限公司 Transaction record time slot scrambling, equipment, network and storage medium in block chain
CN109685486A (en) * 2018-11-28 2019-04-26 杭州云象网络技术有限公司 A kind of polymeric chain framework based on block chain technology

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790431B (en) * 2016-12-05 2020-11-27 同济大学 Cloud manufacturing service transaction information recording system and method based on block chain
CN108712395B (en) * 2018-04-27 2022-01-07 腾讯科技(深圳)有限公司 Account management method, device, server and storage medium based on block chain
CN109347955B (en) * 2018-10-19 2021-03-02 北京奇艺世纪科技有限公司 Block chain network system and information processing method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017223540A1 (en) * 2016-06-24 2017-12-28 PokitDok, Inc. System and method for cryptographically verified data driven contracts
CN107169865A (en) * 2017-04-24 2017-09-15 北京果仁宝科技有限公司 Asset data processing system based on block chain technology
CN107464106A (en) * 2017-07-25 2017-12-12 北京果仁宝科技有限公司 The method and system merchandised between block chain main chain and side chain
CN107679857A (en) * 2017-10-10 2018-02-09 马晶瑶 Across the chain method of commerce and storage medium of block chain
CN108712257A (en) * 2018-04-03 2018-10-26 阿里巴巴集团控股有限公司 The authentication method and device, electronic equipment of transregional piece of chain
CN108563788A (en) * 2018-04-27 2018-09-21 腾讯科技(深圳)有限公司 Data query method, apparatus, server and storage medium based on block chain
CN108632268A (en) * 2018-04-28 2018-10-09 腾讯科技(深圳)有限公司 The method for authenticating and device, storage medium, electronic device that block chain accesses
CN108616539A (en) * 2018-05-03 2018-10-02 东莞市翔实信息科技有限公司 A kind of method and system that block chain transaction record accesses
CN109493221A (en) * 2018-10-26 2019-03-19 全链通有限公司 Transaction record time slot scrambling, equipment, network and storage medium in block chain
CN109685486A (en) * 2018-11-28 2019-04-26 杭州云象网络技术有限公司 A kind of polymeric chain framework based on block chain technology

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
发布区块链标准应用模型及应用部署技术研究;白杰,李东云,吴先锋;《信息技术与网络安全》;20180914;第38卷(第8期);第13-18页 *

Also Published As

Publication number Publication date
CN110232569A (en) 2019-09-13

Similar Documents

Publication Publication Date Title
US10958436B2 (en) Methods contract generator and validation server for access control of contract data in a distributed system with distributed consensus
CN110046996B (en) Data processing method and device
CN111723383B (en) Data storage and verification method and device
US20180294957A1 (en) System for Recording Ownership of Digital Works and Providing Backup Copies
KR102255287B1 (en) Physical identity management system using One-time-password on Blockchain
CN110232569B (en) Method and device for reading transaction record and storage medium
CN106991298B (en) Access method of application program to interface, authorization request method and device
CN113656780B (en) Cross-chain access control method and device
EP1886204B1 (en) Transaction method and verification method
CN113472720B (en) Digital certificate key processing method, device, terminal equipment and storage medium
CN110071813B (en) Account permission changing method and system, account platform and user terminal
CN111566647B (en) Identity recognition system based on block chain
CN111932261A (en) Asset data management method and device based on verifiable statement
Chen et al. A novel DRM scheme for accommodating expectations of personal use
CN110445751B (en) Distributed information sharing method and system based on re-encryption
CN109063461B (en) Third-party password-free login method and system
US8755521B2 (en) Security method and system for media playback devices
JP2003076611A (en) Memory card having security function
CN113159940A (en) Transaction method, system and computer equipment for enhanced bit currency wallet
JP2017079419A (en) Server authentication system, terminal, server, server authentication method, program
KR102550994B1 (en) Method and system for temporal leasing digital contents by use of NFT
CN112737790B (en) Data transmission method and device, server and client terminal
CN112544057B (en) Block chain node equipment, authentication method and device thereof and storage medium
CN109474624B (en) Application program authentication system and method
CN113032816B (en) Encrypted file searching method, device and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant