CN110390525B - Direct access method for block chain world state and block chain node - Google Patents

Direct access method for block chain world state and block chain node Download PDF

Info

Publication number
CN110390525B
CN110390525B CN201910702807.2A CN201910702807A CN110390525B CN 110390525 B CN110390525 B CN 110390525B CN 201910702807 A CN201910702807 A CN 201910702807A CN 110390525 B CN110390525 B CN 110390525B
Authority
CN
China
Prior art keywords
data
world state
request message
key value
request
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
CN201910702807.2A
Other languages
Chinese (zh)
Other versions
CN110390525A (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201910702807.2A priority Critical patent/CN110390525B/en
Publication of CN110390525A publication Critical patent/CN110390525A/en
Application granted granted Critical
Publication of CN110390525B publication Critical patent/CN110390525B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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 application provides a block chain world state direct access method and a block chain node, wherein the method comprises the following steps: receiving a request message and verifying a user identity corresponding to the request message, wherein the request message comprises: the method comprises the steps of identifying a user ID, a target contract unique identifier, a target data key value, a data value and signature information; if the request type of the verified request message is determined to be query world state data, splicing the unique target contract identifier and a target data key value into a complete query key value; and querying the world state data of the block chain by applying the complete query key value. According to the method and the device, the data of the world state can be directly accessed, and the operation and maintenance support capability of the block chain system is further improved.

Description

Direct access method for world state of block chain and block chain link point
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a method for directly accessing a global state of a blockchain and a blockchain node.
Background
The intelligent contract technology realizes the expansion of the blockchain application from the single encrypted digital currency field to other fields, such as supply chain finance, cross-border payment, asset securitization, commodity source tracing, digital copyright and the like, greatly widens the application range of the blockchain, and is turning over a subversive revolution.
In traditional system deployment, an application server and a database server are generally deployed independently, and operations on data can be added, deleted, modified and checked through a database management tool. However, the network is built by the block chain in a node mode, a kv-type database is integrated in each node, a complete data book is possessed, and the access to the data can be realized only through an intelligent contract interface. There are two drawbacks to this data access mechanism: firstly, when the intelligent contract does not realize the required data query function, the data of the world state cannot be acquired, which is not beneficial to the operation and maintenance of the system and the service support; secondly, if the codes for checking the world state data are written in each set of intelligent contracts, the codes related to the non-business functions are integrated in the intelligent contracts, so that a large amount of code redundancy is caused, and the upgrading and the maintenance of the subsequent intelligent contracts are not facilitated.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a block chain world state direct access method and a block chain node, which can directly access data of the world state, and further can improve the operation and maintenance support capability of a block chain system.
In order to solve the technical problem, the present application provides the following technical solutions:
in a first aspect, the present application provides a method for directly accessing a blockchain world state, including:
receiving a request message and verifying a user identity corresponding to the request message, wherein the request message comprises: the method comprises the steps of identifying a user ID, a target contract unique identifier, a target data key value, a data value and signature information;
if the request type of the verified request message is determined to be query world state data, splicing the unique target contract identifier and a target data key value into a complete query key value;
and querying the world state data of the block chain by applying the complete query key value.
Further, after receiving the request packet and verifying the user identity corresponding to the request packet, the method further includes: if the user identity authentication is passed and the request type of the request message is a write-in world state type, carrying out Byzantine fault-tolerant consensus on the request message; splicing the target contract unique identification and the target data key value of the request message passing through the Byzantine fault-tolerant consensus into a complete write-in key value; and writing the corresponding data value into the world state data of the block chain by using the complete write key value.
Further, after receiving the request packet and verifying the user identity corresponding to the request packet, the method further includes: and if the verification is passed and the request type of the request message is a service transaction type, calling an intelligent contract container to realize service functions and read-write operation of data by executing a target contract.
Further, after the receiving the request message and verifying the user identity corresponding to the request message, the method further includes: and if the verification is not passed, stopping the access to the world state data of the block chain.
Further, the unique target contract identifier is an identifier for distinguishing different target contracts, and includes: letters and numbers.
In a second aspect, the present application provides a block link point comprising:
a receiving request module, configured to receive a request packet and verify a user identity corresponding to the request packet, where the request packet includes: the method comprises the steps of identifying a user ID, a target contract unique identifier, a target data key value, a data value and signature information;
the first splicing module is used for splicing the unique target contract identifier and the target data key value into a complete query key value if the request type of the verified request message is determined to be the query world state data;
and the query module is used for querying the world state data of the block chain through the complete query key value.
Further, the block link point further includes:
the consensus management module is used for receiving a request message and verifying the user identity corresponding to the request message, and if the user identity passes the user identity verification and the request type of the request message is a write-in world state type, performing Byzantine fault-tolerant consensus on the request message; the second splicing module is further used for splicing the target contract unique identifier and the target data key value of the request message passing through the Byzantine fault-tolerant consensus into a complete write-in key value; and the write-in module is used for writing the corresponding data value into the world state data of the block chain by using the complete write-in key value.
Further, the block link point further includes: and the service function module is used for receiving the request message and verifying the user identity corresponding to the request message, and calling the intelligent contract container to realize service functions and read-write operation of data by executing a target contract if the verification is passed and the request type of the request message is the service transaction type.
Further, the block link point further includes:
and the access stopping module is used for stopping accessing the world state data of the block chain if the access is not passed through the verification after receiving the request message and verifying the user identity corresponding to the request message.
Further, the unique target contract identifier is an identifier for distinguishing different target contracts, and includes: letters and numbers.
In a third aspect, the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the direct access method for the blockchain world state when executing the program.
In a fourth aspect, the present application further provides a computer readable storage medium having stored thereon computer instructions which, when executed, implement the steps of the method for direct access to blockchain world states.
As can be seen from the foregoing technical solutions, an embodiment of the present invention provides a method for directly accessing a global state of a block chain and a node of the block chain, where the method includes: receiving a request message and verifying a user identity corresponding to the request message, wherein the request message comprises: the method comprises the steps of identifying a user ID, a target contract unique identifier, a target data key value, a data value and signature information; if the request type of the request message passing the verification is determined to be the query world state data, splicing the target contract unique identifier and the target data key value into a complete query key value; the global state data of the block chain is inquired by applying the complete inquiry key value, the complete key value for accessing the global state can be assembled at the bottom layer of the block chain, inquiry transaction is directly executed or target data is written, the access to the global state by bypassing an intelligent contract is realized, the dependence of data access on the intelligent contract is decoupled, and the access capability and flexibility to the global state data are improved. In the aspect of operation and maintenance of the block chain system, in order to access the relevant data of the world state, the implementation is not required to be realized by writing an intelligent contract code, the situation that the data cannot be acquired due to the lack of the intelligent contract function is avoided, and the robustness of the whole block chain system is improved; in the aspect of intelligent contract application development, a large number of service independence codes do not need to be integrated in the intelligent contract, and the intelligent contract code quality and subsequent maintenance work are optimized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart illustrating a method for directly accessing a world state of a block chain according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a method for direct access to a global state of a blockchain according to another embodiment of the present application;
fig. 3 is a flowchart illustrating steps 100, 500, and 600 of a method for direct access to a global state of a blockchain according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a blockchain node according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a blockchain node according to another embodiment of the present application;
FIG. 6 is a block diagram illustrating a system architecture for direct access to world state of blockchains in an exemplary embodiment of the present invention;
FIG. 7 is a diagram illustrating a client architecture in an exemplary embodiment of the present application;
FIG. 8 is a block diagram of an integrated front end unit according to an exemplary embodiment of the present disclosure;
FIG. 9 is a diagram of an application server in an exemplary application of the present application;
FIG. 10 is a block link point diagram according to an embodiment of the present application;
FIG. 11 is a block diagram of a transaction management unit in an exemplary embodiment of the present application;
FIG. 12 is a block diagram of a data management unit provided in an exemplary embodiment of the present application;
FIG. 13 is a flowchart illustrating a process of querying world state data in an exemplary embodiment of the present application;
FIG. 14 is a flow chart illustrating a process of writing world state data in an exemplary embodiment of the present application;
fig. 15 is a block diagram schematically illustrating a system configuration of an electronic device 9600 according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Based on this, in order to reduce the dependence of data access on an intelligent contract, directly query data of a world state, improve the access capability and flexibility of the data of the world state, and further improve the operation and maintenance support capability of a block chain system, the present application provides an embodiment of a direct access method of a block chain world state in which an execution subject is a block chain node, where the direct access method of the block chain world state, see fig. 1, specifically includes the following contents:
step 100: receiving a request message and verifying a user identity corresponding to the request message, wherein the request message comprises: the user ID, the target contract unique identifier, the target data key value, the data value and the signature information.
Specifically, the unique target contract identifier is an identifier for distinguishing different target contracts, and includes: letters and numbers. The user identity corresponding to the request message is verified, that is, the local pre-storage includes a corresponding relationship between the user ID and the user identity, and the received request message includes the user ID, so as to verify whether the user ID matches the corresponding relationship between the user ID and the user identity in the local pre-storage.
Step 200: and if the request type of the verified request message is determined to be query world state data, splicing the unique target contract identifier and the target data key value into a complete query key value.
Step 300: and querying the world state data of the block chain by applying the complete query key value.
In order to further improve the capability of directly writing the data of the world state, in one or more embodiments of the present application, after step 100, referring to fig. 2, further comprising:
step 400: and if the user identity authentication is passed and the request type of the request message is a write-in world state type, performing Byzantine fault-tolerant consensus on the request message.
Specifically, the Byzantine fault-tolerant consensus meets the existing Byzantine fault-tolerant consensus mechanism.
Step 401: and splicing the target contract unique identification and the target data key value of the request message passing through the Byzantine fault-tolerant consensus into a complete write key value.
Step 402: and writing the corresponding data value into the world state data of the block chain by using the complete write key value.
In order to further improve the flexibility of the direct access method for the blockchain world state, in one or more embodiments of the present application, referring to fig. 3, after step 100, the method further includes:
step 500: and if the verification is passed and the request type of the request message is a service transaction type, calling an intelligent contract container to realize service functions and read-write operation of data by executing a target contract.
In order to save resource consumption for accessing the blockchain world state data, in the embodiment of the present application, after the step 100, the method further includes:
step 600: and if the verification is not passed, stopping the access to the world state data of the block chain.
In terms of software, in order to reduce the dependency of data access on an intelligent contract, directly query data of a world state, improve the access capability and flexibility of the data of the world state, and further improve the operation and maintenance support capability of a blockchain system, the present application provides a blockchain link point of all or part of contents in a direct access method of a blockchain world state, which is shown in fig. 4 and specifically includes the following contents:
a receiving request module 10, configured to receive a request message and verify a user identity corresponding to the request message, where the request message includes: the user ID, the target contract unique identifier, the target data key value, the data value and the signature information.
Specifically, the unique target contract identifier is an identifier for distinguishing different target contracts, and includes: letters and numbers.
And the first splicing module 20 is configured to splice the target contract unique identifier and the target data key into a complete query key if it is determined that the request type of the verified request message is query world state data.
And the query module 30 is configured to query the world state data of the block chain by using the complete query key value.
In order to implement direct writing of the world state data of the blockchain, in the embodiment of the present application, referring to fig. 5, the blockchain node further includes:
the consensus management module 40 is configured to, after receiving a request packet and verifying a user identity corresponding to the request packet, perform a byzantine fault-tolerant consensus on the request packet if the user identity passes the user identity verification and the request type of the request packet is a write-in world state type.
The second splicing module 50 is further configured to splice the target contract unique identifier of the request packet passing through the byzantine fault-tolerant consensus and the target data key into a complete write key.
And a writing module 60, configured to write the corresponding data value into the world state data of the block chain by using the complete write key value.
In order to improve the flexibility of the blockchain node, in this embodiment of the present application, the blockchain node further includes:
the service function module 70 is configured to, after receiving the request message and verifying the user identity corresponding to the request message, if the verification is passed and the request type of the request message is the service transaction type, invoke an intelligent contract container to implement a service function and read-write operation on data by executing a target contract.
In order to improve the efficiency of accessing the world state data, in this embodiment of the present application, the blockchain node further includes:
an access stopping module 80, configured to, after receiving the request packet and verifying the user identity corresponding to the request packet, stop accessing the world state data of the block chain if the user identity does not pass the verification.
Based on the direct access method of the block chain world state and the block chain node, in the embodiment of the present application, a process of directly accessing the block chain world state may be performed through the block chain node, in order to reduce the dependency of data access on an intelligent contract, data of the world state is directly queried, and the access capability and flexibility of the data of the world state are improved, so as to further improve the operation and maintenance support capability of the block chain system.
In this application, a system for directly accessing a world state of a blockchain is provided, the system comprising: the system comprises a client, a comprehensive front-end device, an application server, an application database cluster, a block link node group, a wired/wireless internet and a private network. After a user logs in the system through a client, the client receives a transaction request of the user, encrypts and signs a request message and sends the encrypted request message to the comprehensive prepositive device through the Internet, the comprehensive prepositive device performs format conversion on the request message, the validity of the transaction request is verified and then the encrypted request message is sent to the application server through a private network, the application server performs decryption, signature verification and transaction validity verification on the request message, an application database cluster is started to store transaction details, and the transaction request is sent to the block link node group. And the block link node group receives the request message, performs security verification and authority check on the user identity, and calls an intelligent contract container or directly accesses the world state according to the request type. If the request type is service transaction, the verification node calls an intelligent contract container to execute a target contract, and service functions and data read-write operation are realized. If the request type is to query the world state data, the verification node assembles a complete query key value according to the unique identifier of the target contract and the query condition of the world state data, and then directly executes the query function to obtain the world state data. And if the request type is write-in world state data, the verification node assembles a complete data key value according to the unique identifier of the target contract and the data key value, and directly executes a write-in function and stores the write-in function into the world state data.
Specifically, referring to fig. 6, the system comprises:
the system comprises a client 1, an integrated front-end device 2, an application server 3, an application database cluster 4, a block link point cluster 5, a wireless/wired network 6 and a private network 7. The client 1 is connected with the comprehensive preposition device 2 through a wireless/wired network 6, the comprehensive preposition device 2 is connected with the application server 3 through a proprietary network 7, and the application server 3 is connected with the application database cluster 4 through the proprietary network 7 and is connected with the block chain node group 5 through the proprietary network 7.
The client 1 is used for receiving a transaction request of a user, encrypting and signing transaction data, and interacting with the comprehensive prepositive device through the Internet.
The comprehensive prepositive device 2 is used for receiving a transaction request submitted by a client, completing transaction validity verification and safety access control, completing data format conversion between cross systems, and interacting with an application server through a proprietary network.
The application server 3 is used for realizing decryption, signature verification and validity verification of transaction data, recording transaction logs and interacting with the block link point group through a proprietary network.
And the application database cluster 4 is used for storing data such as transaction logs, keys and user information and interacting with the application server through a private network.
The block chain link point group 5 is used for processing a transaction request, and finishing key services such as transaction identity verification, transaction authority control, service transaction execution, world state data inquiry, world state data writing and the like. The block link point group comprises 4 nodes, each node is provided with a set of server, but in practical application, the node is not limited to be provided with 4 nodes. Any node of the node group can receive the transaction request, execute different transactions according to the request type, and call the intelligent contract container to execute the target program for the service transaction; for the query world state, assembling a global query key value according to the unique target contract identifier and the data key value, and directly executing query transaction on the bottom layer of the block chain without passing through an intelligent contract; and for the write world state, assembling a global write key value according to the target unique identifier and the data key value, and directly executing write transaction at the bottom layer of the block chain without passing an intelligent contract.
The wireless/wired network 6 is a wireless communication network or an INTERNET communication network provided by an operator.
The private network 7 is a private network within the system.
Fig. 7 is a diagram of a client structure, and the client 1 includes an access request unit 11, an encryption/decryption unit 12, a signature unit 13, a service transaction request unit 14, an inquiry world state request unit 15, and a write world state request unit 16. The access request unit 11 is responsible for receiving and verifying the data of the user. The encryption and decryption unit 12 is responsible for encrypting the transaction data sent to the integrated front-end device and decrypting the data returned by the integrated front-end device. The signature unit 13 is responsible for encrypting the summary information with the private key of the user and sending the encrypted summary information and the original text of the transaction data to the comprehensive preposition device. The transaction request unit 14 is responsible for sending a service transaction request submitted by a user to the integrated front-end device. The query world state request unit 15 is responsible for sending a query world state request submitted by a user to the integrated front-end device. The write world state request unit 16 is responsible for sending a write world state request submitted by a user to the integrated lead device. After receiving and verifying the data submitted by the user, the access request unit 11 delivers the data to the service transaction request unit 14, the query world state request unit 15 and the write world state request unit 16, respectively, according to the type of the request (including the service transaction, the query world state transaction and the write world state transaction).
Fig. 8 is a configuration diagram of the integrated front-end device, and the integrated front-end device 2 includes a transaction data conversion unit 21, a transaction validity verification unit 22, a transaction flow control unit 23, a transaction security authentication unit 24, and a transaction data management unit 25. The data conversion unit 21 is responsible for protocol conversion and message conversion between different service subsystems, and realizes data interaction between different systems. The transaction validity verification unit 22, the transaction flow control unit 23, and the transaction security authentication unit 24 are responsible for preprocessing the validity, and transaction range of the transaction, and rejecting illegal transactions, canceling overtime transactions, rejecting out-of-range transactions, and the like, so as to reduce the load of the core system. The transaction data management unit 25 is responsible for recording transaction flow, counting transaction data, and the like.
Fig. 9 is a configuration diagram of the application server, and the application server 3 includes a security management unit 31, a signature management unit 32, an authority management unit 33, a transaction log storage unit 34, and a request receiving unit 35. The security management unit 31 is responsible for encrypting and decrypting transaction data. The signature management unit 32 is responsible for verifying the signature, using the public key of the user to verify the signature. The right management unit 33 is responsible for setting and verifying the operation right of the user for the transaction. The transaction log storage unit 34 is responsible for recording transaction logs and calling the application database cluster to complete data storage. The request receiving unit 35 is responsible for receiving the transaction request sent by the integrated front-end device 2 and forwarding the request to the block link point group 5.
Fig. 10 is a block link point structure diagram, and the block link point includes a transaction management unit 51, a member management unit 52, an event management unit 53, a consensus management unit 54, a data management unit 55, and a chain code management unit 56. The transaction management unit 51 is responsible for receiving transaction requests forwarded by the application server 3. The membership management unit 52 is responsible for verifying the identity legitimacy of the blockchain node. The event management unit 53 is responsible for handling and responding to event messages between nodes of the chain of blocks. The consensus management unit 54 is responsible for managing the consensus algorithm of the block chain, providing a pluggable and dynamically switchable consensus mechanism. The data management unit 55 is responsible for data consistency check, data synchronization, and data persistence operations among the blockchain nodes, and offline archive the historical blockchain data. The chain code management unit 56 is responsible for managing the intelligent contracts deployed in the blockchain system, and invoking corresponding intelligent contract containers according to the target contract unique identifier.
Fig. 11 is a structure diagram of the transaction management unit, and the transaction management unit 51 includes a request receiving module 511, a service transaction processing module 512, an inquiry world state processing module 513, and a write world state processing module 514. The request receiving module 511 is responsible for receiving the transaction request forwarded by the application server 3, and respectively invokes the service transaction processing module 512, the query world state processing module 513 and the write world state processing module 514 according to different request types (including service transaction, query world state transaction and write world state transaction).
Fig. 12 is a diagram showing a structure of a data management unit, and the data management unit 55 includes a data backup module 551, a data restore module 552, a data synchronization module 553, a data write module 554, and a data query module 555. The data backup module 551 is responsible for archiving historical data to the data warehouse system in an offline manner, the data recovery module 552 is responsible for recovering data to a latest state after the block link points are restarted, the data synchronization module 553 is responsible for maintaining data consistency and integrity among the block link points, the data write-in module 554 is responsible for persisting a current world state copy generated during transaction execution from a memory to a disk account book, and the data query module 555 reads the block link database according to a query key value to acquire corresponding world state data.
In order to improve the independent access capability of the bottom layer of the block chain to the world state data and further improve the operation and maintenance support capability of the block chain system, the direct access method of the block chain world state is specifically described by combining the system capable of directly accessing the block chain world state.
Process for inquiring data of world state
Assuming that the ID of a certain user a is U001, the target contract unique identifier of the world state to be queried is C0001, and the target data key value is D0000000001, the technical implementation details of querying the world state data will be described with reference to fig. 13.
Step S801: the access request unit 11 receives the transaction request of the user a and calls the query world state request unit 15 (the request message contains the user ID: U001, the target contract unique identifier: C0001, the target data key value: D0000000001, and the signature information: SIGNDATA1), the query world state request unit 15 performs validity check on the request message, and sends the transaction request of the user a to the integrated front-end device 2 through the internet 6.
Step S802: the transaction effectiveness verification unit 22, the transaction flow control unit 23 and the transaction security authentication unit 24 of the integrated front-end device 2 verify the effectiveness, validity and security of the request for inquiring the world state of the user, the transaction data management unit 25 records a transaction log, and the transaction data conversion unit 21 converts the data format and the code and then sends the converted data to the application server 3 through the private network 7.
Step S803: the security management unit 31 decrypts the transaction data to obtain the plaintext of the transaction data, and then calls the signature management unit 32.
Step S804: the signature management unit 32 checks the integrity of the transaction data and compares the transaction data with the signature information SIGNDATA1 to confirm that the transaction data has not been tampered, and calls the rights management unit 33 after the verification is passed.
Step S805: the authority management unit 33 checks the transaction operation authority of the user a, and calls the blockchain master node of the blockchain node group 5 through the private network 7 after the transaction operation authority passes.
Step S806: the request receiving module 511 of the transaction management unit 51 receives the world state query request of the user a and invokes the query world state processing module 513.
Step S807: the query world state processing module 513 calls the member management unit 52 to perform block link point identity verification, and calls the data management unit 55 to perform data query after the verification is passed.
Step S808: the data query module 555 of the data management unit 55 splices the unique identifier C0001 and the world state query condition D0000000001 according to the target contract into a complete query key value, and performs a read operation to obtain world state data. Taking HyperLegend Fabric as an example, the implementation process of querying world state data is detailed below:
the splicing rule of the complete query key value is as follows:
Kf=Kc+Kd
wherein K isfFor the complete query of key values, KcIs a target contract unique identifier, KdAnd data key values are distributed inside the intelligent contracts. In this embodiment, the unique identifier of the target contract is C0001, and the data key value is D0000000001, then the assembled complete query key value is C0001D0000000001, and the data query module 555 executes the getState (C0001D0000000001) method with this key value to obtain the target data.
(II) Process of writing world State data
Assuming that the ID of a certain user B is U002, the target contract unique identifier of the world state to be written is C0002, the target data key value is D0000000002, and the data value is value, the technical implementation details of writing world state data will be described with reference to fig. 14.
Step S901: the access request unit 11 receives the transaction request of the user B and calls the write world state request unit 16 (the request message contains the user ID: U002, the target contract unique identifier: C0002, the target data key value: D0000000002, the data value: value, and the signature information: SIGNDATA2), the write world state request unit 16 performs validity check on the request message, and sends the transaction request of the user B to the integrated front-end device 2 through the internet 6.
Step S902: the transaction validity verification unit 22, the transaction flow control unit 23 and the transaction security authentication unit 24 of the integrated front-end device 2 verify validity, validity and security of a request for querying the world state of a user, the transaction data management unit 25 records transaction logs, and the transaction data conversion unit 21 converts data formats and codes and then sends the converted data to the application server 3 through the private network 7.
Step S903: the security management unit 31 decrypts the transaction data to obtain the plaintext of the transaction data, and then calls the signature management unit 32.
Step S904: the signature management unit 32 checks the integrity of the transaction data and compares the transaction data with the signature information SIGNDATA2 to confirm that the transaction data has not been tampered, and calls the rights management unit 33 after the verification is passed.
Step S905: the authority management unit 33 checks the transaction operation authority of the user B, and calls the blockchain master node of the blockchain node group 5 through the private network 7 after the transaction operation authority passes.
Step S906: the request receiving module 511 of the transaction management unit 51 receives the world state write request of the user B and calls the write world state processing module 514.
Step S907: the write world state processing module 514 calls the member management unit 52 to perform block link point identity verification, calls the consensus management unit 54 to perform Byzantine fault-tolerant consensus after the verification is passed, and calls the data management unit 55 to perform data writing after the consensus is passed.
Step S908: the data write module 554 of the data management unit 55 assembles the unique identifier C0002 according to the target contract and the world state query condition D0000000002 into a complete write key value, and performs a write operation to store the transaction data value into the world state. Taking HyperLegend Fabric as an example, the following details the implementation process of writing world state data:
the splicing rule of the complete written key value is as follows:
Kf=Kc+Kd
wherein KfFor complete writing of key values, KcIs a target contract unique identifier, KdAnd data key values are distributed inside the intelligent contract. In this example, the unique target contract is C0002, the data key is D0000000002, and the data value is value, then the assembled complete write key is C0002D0000000002, and the data write module 554 will execute putState with this key (C0002D0000000002,&value) method, write the value to the world state.
According to the method, the application layer sends a transaction request for inquiring world state data to the blockchain, the blockchain verification node does not call the intelligent contract container to execute transaction to obtain data, a complete inquiry key value is assembled according to a unique target contract identifier and a data inquiry condition sent by the transaction request, and an inquiry function is directly executed at the bottom layer of the blockchain to access the blockchain database, so that a data access mechanism for directly inquiring the world state without an intelligent contract interface is realized, data access and intelligent contract decoupling can be realized, the independent access capability of the bottom layer of the blockchain to the world state data can be solved, and the operation and maintenance support capability of a blockchain system can be improved.
In order to directly query the world state data and further improve the operation and maintenance support capability of the blockchain system, the present application provides an embodiment of an electronic device for all or part of contents in a method for directly accessing a blockchain world state, where the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between the block chain node and the user terminal and other related equipment; the electronic device may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the electronic device may be implemented with reference to the embodiment of the direct access method for implementing the blockchain world state and the embodiment of the blockchain node for implementing the direct access method for implementing the blockchain world state in the embodiment, and the contents thereof are incorporated herein, and repeated details are not repeated here.
Fig. 15 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 15, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 15 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one or more embodiments of the present application, the direct access function of the blockchain world state may be integrated into the central processor 9100. The central processor 9100 may be configured to control as follows:
step 100: receiving a request message and verifying a user identity corresponding to the request message, wherein the request message comprises: the user ID, the target contract unique identifier, the target data key value, the data value and the signature information.
Step 200: and if the request type of the verified request message is determined to be query world state data, splicing the unique target contract identifier and the target data key value condition into a complete query key value.
Step 300: and querying the world state data of the block chain by using the complete query key value.
As can be seen from the above description, the electronic device provided in the embodiments of the present application is capable of directly querying data of a world state, so as to further improve operation and maintenance support capability of a block chain system.
As shown in fig. 15, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 15; further, the electronic device 9600 may further include components not shown in fig. 15, which can be referred to in the related art.
As shown in fig. 15, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes referred to as an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording of sounds locally through the microphone 9132 and enabling playing of sounds stored locally through the speaker 9131.
As can be seen from the above description, the electronic device provided in the embodiments of the present application can directly query data of a world state, so as to improve operation and maintenance support capability of a block chain system.
Embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps in the direct access method of the blockchain world state in the above embodiments, where the computer-readable storage medium stores thereon a computer program, and when the computer program is executed by a processor, the computer program implements all the steps in the direct access method of the blockchain world state in the above embodiments, for example, the processor implements the following steps when executing the computer program:
step 100: receiving a request message and verifying a user identity corresponding to the request message, wherein the request message comprises: the user ID, the target contract unique identifier, the target data key value, the data value and the signature information.
Step 200: and if the request type of the verified request message is determined to be query world state data, splicing the unique target contract identifier and the target data key value into a complete query key value.
Step 300: and querying the world state data of the block chain by applying the complete query key value.
As can be seen from the above description, the computer readable storage medium provided in the embodiments of the present application can directly query data of a world state, so as to improve an operation and maintenance support capability of a block chain system.
In the present application, each embodiment of the method is described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. Reference is made to the description of the method embodiments.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the present application are explained by applying specific embodiments in the present application, and the description of the above embodiments is only used to help understanding the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (8)

1. A method for direct access to a blockchain world state, comprising:
receiving a request message and verifying a user identity corresponding to the request message, wherein the request message comprises: the method comprises the steps of identifying a user ID, a target contract unique identifier, a target data key value, a data value and signature information;
if the request type of the verified request message is determined to be query world state data, splicing the unique target contract identifier and a target data key value into a complete query key value;
applying the complete query key value, executing a query function to query the world state data of the block chain so as to directly query the world state data without an intelligent contract interface;
after receiving the request message and verifying the user identity corresponding to the request message, the method further comprises:
if the user identity authentication is passed and the request type of the request message is a write-in world state type, carrying out Byzantine fault-tolerant consensus on the request message;
splicing the target contract unique identification and the target data key value of the request message passing through the Byzantine fault-tolerant consensus into a complete write-in key value;
and executing a putState method to write the corresponding data value into the world state data of the block chain by using the complete write key value so as to directly write the world state data without an intelligent contract interface.
2. The method of claim 1, wherein after receiving the request message and verifying the user identity corresponding to the request message, the method further comprises:
and if the verification is not passed, stopping the access to the world state data of the block chain.
3. The method for direct access to a world state of a blockchain according to claim 1, wherein the target contract unique identifier is an identifier for distinguishing different target contracts, and the method comprises the following steps: letters and numbers.
4. A block link point, comprising:
a receiving request module, configured to receive a request packet and verify a user identity corresponding to the request packet, where the request packet includes: the method comprises the steps of identifying a user ID, a target contract unique identifier, a target data key value, a data value and signature information;
the first splicing module is used for splicing the unique target contract identifier and the target data key value into a complete query key value if the request type of the verified request message is determined to be query world state data;
the query module is used for executing a query function to query the world state data of the block chain through the complete query key value so as to directly query the world state data without an intelligent contract interface;
the consensus management module is used for receiving a request message and verifying a user identity corresponding to the request message, and if the user identity passes the user identity verification and the request type of the request message is a write-in world state type, performing Byzantine fault-tolerant consensus on the request message;
the second splicing module is further used for splicing the target contract unique identifier and the target data key value of the request message passing through the Byzantine fault-tolerant consensus into a complete write-in key value;
and the write-in module is used for executing a putState method to write the corresponding data value into the world state data of the block chain by using the complete write-in key value so as to realize direct write-in of the world state data without an intelligent contract interface.
5. The blockchain node of claim 4, further comprising:
and the access stopping module is used for stopping the world state data of the access block chain if the access block chain does not pass the verification after receiving the request message and verifying the user identity corresponding to the request message.
6. The blockchain node of claim 4, wherein the target contract unique identifier is an identifier that distinguishes between different target contracts, including: letters and numbers.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method for direct access of blockchain world states of any one of claims 1 to 3 when executing the program.
8. A computer readable storage medium having stored thereon computer instructions, wherein said instructions when executed perform the steps of the method for direct access to blockchain world states of any of claims 1 to 3.
CN201910702807.2A 2019-07-31 2019-07-31 Direct access method for block chain world state and block chain node Active CN110390525B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910702807.2A CN110390525B (en) 2019-07-31 2019-07-31 Direct access method for block chain world state and block chain node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910702807.2A CN110390525B (en) 2019-07-31 2019-07-31 Direct access method for block chain world state and block chain node

Publications (2)

Publication Number Publication Date
CN110390525A CN110390525A (en) 2019-10-29
CN110390525B true CN110390525B (en) 2022-05-20

Family

ID=68288186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910702807.2A Active CN110390525B (en) 2019-07-31 2019-07-31 Direct access method for block chain world state and block chain node

Country Status (1)

Country Link
CN (1) CN110390525B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110443075B (en) * 2019-08-05 2021-05-25 中国工商银行股份有限公司 Method and device for verifying and deploying block chain intelligent contracts
CN111083223B (en) * 2019-12-18 2020-09-01 安徽兆尹信息科技股份有限公司 Block chain interconnection system for asset securitization processing sub-platform and interconnection data communication method thereof
CN111340470B (en) * 2020-02-24 2023-04-18 中国工商银行股份有限公司 Block chain transaction processing method, node and contract container
CN111680067A (en) * 2020-05-28 2020-09-18 中国工商银行股份有限公司 Data processing method, device and system based on block chain
CN111797142A (en) * 2020-07-06 2020-10-20 北京荷月科技有限公司 Method and system for auditing data on link
CN111813866B (en) * 2020-07-30 2021-03-16 河南中盾云安信息科技有限公司 Improved block chain account book synchronization method
CN114390062A (en) * 2021-12-30 2022-04-22 卓尔智联(武汉)研究院有限公司 Calling method and device based on block chain, electronic equipment and storage medium
EP4216490A1 (en) * 2022-01-25 2023-07-26 The Nest Company S.r.l. Computerized platform for interacting with a data archive
CN115065695B (en) * 2022-08-17 2022-11-18 湖南大学 Cloud chain data exchange method based on intelligent contract and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109194665A (en) * 2018-09-17 2019-01-11 盛科网络(苏州)有限公司 A kind of generation method that message finds key value and device
CN109213797A (en) * 2018-09-30 2019-01-15 中国联合网络通信集团有限公司 A kind of querying method and device of block chain
CN109325855A (en) * 2018-08-16 2019-02-12 北京京东尚科信息技术有限公司 Block chain network, dispositions method and storage medium
CN109359084A (en) * 2018-08-27 2019-02-19 深圳壹账通智能科技有限公司 Abnormality diagnostic method, device, equipment and storage medium in the processing of block chain information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10586210B2 (en) * 2016-11-30 2020-03-10 International Business Machines Corporation Blockchain checkpoints and certified checkpoints

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109325855A (en) * 2018-08-16 2019-02-12 北京京东尚科信息技术有限公司 Block chain network, dispositions method and storage medium
CN109359084A (en) * 2018-08-27 2019-02-19 深圳壹账通智能科技有限公司 Abnormality diagnostic method, device, equipment and storage medium in the processing of block chain information
CN109194665A (en) * 2018-09-17 2019-01-11 盛科网络(苏州)有限公司 A kind of generation method that message finds key value and device
CN109213797A (en) * 2018-09-30 2019-01-15 中国联合网络通信集团有限公司 A kind of querying method and device of block chain

Also Published As

Publication number Publication date
CN110390525A (en) 2019-10-29

Similar Documents

Publication Publication Date Title
CN110390525B (en) Direct access method for block chain world state and block chain node
CN110442652B (en) Cross-chain data processing method and device based on block chain
US10972274B2 (en) Trusted identity solution using blockchain
CN109472696B (en) Asset transaction method, device, storage medium and computer equipment
CN111461723B (en) Data processing system, method and device based on block chain
EP3816923A1 (en) Blockchain-based private transactions and usage method and apparatus therefor
KR101936756B1 (en) Apparatus for Supporting Sharing Economy using Blockchain
CN109614813B (en) Privacy transaction method and device based on block chain and application method and device thereof
CN111066047A (en) Implementing a blockchain based workflow
CN111314172B (en) Block chain-based data processing method, device, equipment and storage medium
AU2019380381A1 (en) Smart logistics management using blockchain
CN104937904A (en) Copy offload for disparate offload providers
KR101962288B1 (en) Apparatus for Sharing Economy using Blockchain
CN111597567A (en) Data processing method, data processing device, node equipment and storage medium
CN111416709B (en) Voting method, device, equipment and storage medium based on block chain system
CN114884674A (en) Block chain-based user data transfer method, device and equipment
CN115705571A (en) Protecting privacy of auditable accounts
CN111311259A (en) Bill processing method, device, terminal and computer readable storage medium
CN113221165B (en) User element authentication method and device based on block chain
CN112860805A (en) Block chain data interaction method and system
CN109818965B (en) Personal identity verification device and method
CN111311341A (en) Bill processing method, apparatus and medium
US20230198760A1 (en) Verified presentation of non-fungible tokens
CN113949632B (en) Dynamic node configuration method and device for block chain
CN113987062A (en) Data uplink storage method, system, device and storage 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