CN111339114B - Data access method, device, equipment and storage medium - Google Patents

Data access method, device, equipment and storage medium Download PDF

Info

Publication number
CN111339114B
CN111339114B CN202010128866.6A CN202010128866A CN111339114B CN 111339114 B CN111339114 B CN 111339114B CN 202010128866 A CN202010128866 A CN 202010128866A CN 111339114 B CN111339114 B CN 111339114B
Authority
CN
China
Prior art keywords
access
data
target
data object
accessed
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
CN202010128866.6A
Other languages
Chinese (zh)
Other versions
CN111339114A (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010128866.6A priority Critical patent/CN111339114B/en
Publication of CN111339114A publication Critical patent/CN111339114A/en
Application granted granted Critical
Publication of CN111339114B publication Critical patent/CN111339114B/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/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Abstract

The application discloses a data access method, a device, equipment and a storage medium, and relates to the technical field of blockchain. The method is performed by a blockchain link point deployed with at least two blockchains, comprising: acquiring a source transaction request initiated in a source block chain; in the process of executing the source transaction request, if the access requirement of the data object to which the target blockchain belongs is determined to exist, initiating access operation for the data object to be accessed in the block which is forbidden to roll back in the target blockchain; and if the access result is obtained, continuing to execute the source transaction request according to the access result. According to the embodiment of the application, the sharing of the data among different block chains is realized, and the data which can be accessed is limited to the data in the block which is forbidden to roll back, so that the effectiveness and the stability of the access result are improved, and the effectiveness and the stability of the execution result of the source transaction request are further improved. Meanwhile, the waste of computing resources caused by unnecessary execution of the source transaction request is reduced.

Description

Data access method, device, equipment and storage medium
Technical Field
The present disclosure relates to computer technologies, and in particular, to the field of blockchain technologies, and in particular, to a data access method, apparatus, device, and storage medium.
Background
The blockchain is essentially a distributed shared ledger and database, and has the characteristics of decentralization, non-falsification, whole trace, traceability, collective maintenance, disclosure transparency and the like.
However, because different blockchains run independently of each other, data are highly heterogeneous, the difficulty of collaboration between the chains is large, the interoperability between the blockchains is lost, the problem of information island exists, and the application space of the blockchains is greatly limited.
In view of this, implementing data sharing between different block chains through a cross-chain technology is a problem to be solved.
Disclosure of Invention
The embodiment of the application provides a data access method, a device, equipment and a storage medium, so as to realize data sharing among different block chains.
In a first aspect, embodiments of the present application provide a data access method performed by a block link point having at least two block chains deployed therein, the method comprising:
acquiring a source transaction request initiated in a source block chain;
in the process of executing the source transaction request, if the access requirement of the data object of the target block chain exists, initiating access operation aiming at the data object to be accessed in the block which is forbidden to roll back in the target block chain;
And if the access result is obtained, continuing to execute the source transaction request according to the access result.
In the embodiment of the application, when the access requirement of the data object of the target blockchain is met in the execution process of the source transaction request, the access operation is initiated for the data object to be accessed in the block which is forbidden to roll back in the target blockchain, so that the processing of the source transaction request is performed based on the access result, and the sharing of data among different blockchains is realized. In addition, by limiting the accessible data to the data in the block which is forbidden to be rolled back, the situation that the block where the data in the access result is rolled back and the source transaction request execution result is wrong or needs to be rolled back and executed can be avoided, the effectiveness and the stability of the access result are improved, and the effectiveness and the stability of the source transaction request execution result are further improved. Meanwhile, under the condition that the access result is obtained, the source transaction request is continuously executed, and the waste of computing resources caused by unnecessary execution of the source transaction request is reduced.
Optionally, if access failure is known, determining that the execution of the source transaction request fails.
In an optional embodiment of the foregoing application, when the access failure is known, the execution failure of the source transaction request is determined, so that the execution of the source transaction request is terminated in time under the condition of the access failure, and the waste of computing resources caused by invalid execution of the source transaction request can be reduced.
Optionally, for a data object to be accessed in a block of the target blockchain that is prohibited from rolling back, initiating an access operation includes:
initiating access operation for a data object to be accessed in the target blockchain;
if the access operation is a cross-chain access operation, judging whether a subsequent block of the data object to be accessed, which is forbidden to roll back, is updated or not;
if yes, access failure occurs; otherwise, executing the access operation and feeding back the access result.
In an optional implementation manner in the above application, when cross-chain data access is performed, the update condition of a subsequent block of the block which is forbidden to roll back is determined for the data object to be accessed, and when the subsequent block is updated, the data access operation is terminated in time, so that the situation that the execution result of the source transaction request is wrong due to the fact that the data in the access result is not the latest data is avoided.
Optionally, initiating an access operation for the data object to be accessed in the target blockchain includes:
initiating a read operation for the data object to be accessed in a database locally attributed to the target blockchain by the blockchain node; or alternatively, the process may be performed,
a target transaction request to access a data object to be accessed is initiated to a target blockchain network.
In each optional implementation manner in the above application, the data object to be accessed in the target blockchain is read by a local access or an access manner on the target blockchain, so that the data access manner is enriched.
Optionally, after initiating the target transaction request for accessing the data object to be accessed to the target blockchain network, the method further includes:
executing the target transaction request, taking the data value of the data object to be accessed as target access data from the blocks forbidden to roll back in the target block chain, and executing access operation on the target access data; wherein the access operation includes a read operation or a write operation.
In an optional implementation manner in the above application, by executing the target transaction request, a read operation or a write operation is performed on the data object to be accessed in the target blockchain, so that the access mode and the access operation content of the on-chain access are further improved.
Optionally, initiating an access operation for a data object to be accessed in a block of the target blockchain that is prohibited from rolling back, including:
initiating access operation for a data object to be accessed, which is updated before a check point block in the target block chain; wherein blocks preceding the checkpoint block are prohibited from rolling back.
According to an optional implementation manner in the application, the check point blocks are introduced to distinguish the validity of the data stored in the blocks, so that access to the data object to be accessed updated before the check point blocks ensures that the accessed data cannot be re-executed due to rollback operation, improves the validity and stability of an access result, and lays a foundation for the validity and stability of the execution result of the source transaction request. Meanwhile, the initiating mode of the access operation is perfected.
Optionally, the method further comprises:
setting the blocks with the block number in front of the latest block in the target block chain as check point blocks; or alternatively, the process may be performed,
and determining a check point block in the target block chain according to a consensus mechanism in the target block chain.
In an optional implementation manner in the above application, the check point block is determined according to the latest block and the set number of blocks, or the check point block is determined according to the consensus mechanism, so as to perfect the determination mechanism of the check point block.
Optionally, determining that there is an access requirement for the data object to which the target blockchain belongs includes:
according to the data identification of the data object to be accessed in the source transaction request, determining that the data object to be accessed belongs to different block chains, and determining that the access requirement of the data object to which the target block chain belongs exists;
Wherein the data identification comprises at least a name of a data level and a name of a chain level, and the data identification further comprises a name of a contract level and a name of a network level.
In an optional implementation manner in the above application, the determination mechanism of the access requirement is perfected by determining the access requirement of the data object to which the target smart contract belongs according to the data identifier of the data object to be accessed. Meanwhile, the data object is named through the data level name, the chain level name, the contract level name and the network level name, and a foundation is laid for determining the target blockchain to which the data object belongs based on the data identification.
Optionally, the source blockchain and the target blockchain belong to the same or different super-chain networks.
In an optional embodiment of the above application, by defining the consistency of the source blockchain and the target blockchain, the application range of the data access method related in the application is enriched by applying the data access method related in the application scenario of cross-link access in the same super-link network and the application scenario of cross-network access in different super-link networks.
Optionally, if the source blockchain and the target blockchain belong to different super-chain networks, initiating an access operation for a data object to be accessed in a block prohibited from rolling back in the target blockchain, including:
And the current block-out node in the source block chain initiates a target transaction request for accessing the data object to be accessed to a trusted node in a super-chain network where the target block chain is located.
In an optional implementation manner in the above application, under the condition of cross-network cross-chain access, a target transaction request for accessing a data object to be accessed is initiated in a super-chain network where a target blockchain is located through a trusted node of a current block-out node in a source blockchain, so that the credibility of a data access result is ensured.
Optionally, before initiating an access operation for a data object to be accessed in a block of the target blockchain that is prohibited from rolling back, the method further includes:
and carrying out authority verification on the access requirement based on an authority control model of target blockchain deployment.
In an optional embodiment of the above application, the authority verification is performed on the access requirement through an authority control model deployed by the target blockchain, so as to realize the access authority control on the data object in the target blockchain.
In a second aspect, an embodiment of the present application further provides a data access apparatus, configured to a blockchain node, where at least two blockchains are disposed in the blockchain node, including:
The source transaction request acquisition module is used for acquiring a source transaction request initiated in a source block chain;
the access operation initiating module is used for initiating access operation for the data object to be accessed in the block which is forbidden to roll back in the target block chain if the access requirement of the data object which the target block chain belongs to exists in the process of executing the source transaction request;
and the access result acquisition module is used for continuing to execute the source transaction request according to the access result if the access result is acquired.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a data access method as provided by the embodiments of the first aspect.
In a fourth aspect, embodiments of the present application also provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform a data access method provided by the embodiments of the first aspect.
Other effects of the above alternative will be described below in connection with specific embodiments.
Drawings
The drawings are for better understanding of the present solution and do not constitute a limitation of the present application. Wherein:
FIG. 1 is a flow chart of a method of data access in accordance with a first embodiment of the present application;
FIG. 2 is a flow chart of a data access method in a second embodiment of the present application;
FIG. 3 is a flow chart of a method of data access in a third embodiment of the present application;
fig. 4 is a block diagram of a data access device in a fourth embodiment of the present application;
fig. 5 is a block diagram of an electronic device for implementing a data access method of an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Example 1
Fig. 1 is a flowchart of a data access method provided in an embodiment of the present application. The embodiment of the application is suitable for the cross-chain access condition of the data objects of different blockchains in the super blockchain network. In a blockchain system, intelligent contracts that implement different functions may be deployed, each comprising a combination of programs, with set functional processing being completed during execution of the programs. The generation of some data and the reading of some data, such as user data, business data, etc., which may be referred to as data objects, may be involved in the execution of the smart contract. Each smart contract may manage storage and read-write access of the data objects of interest based on a set data storage model, forming a set of data objects. In general, the sets of data objects between different smart contracts do not overlap and cannot be accessed to each other. When different smart contracts are located in different blockchains, then there is a barrier to cross access. Aiming at the problem, the embodiment of the application provides a method for accessing data objects by a cross-region block chain. The method is performed by a data access device, which is implemented in software and/or hardware and is specifically configured in an electronic device carrying blockchain nodes. The blockchain node is deployed with at least two blockchains, i.e., system programs and data deployed to run the blockchain, such as programs and data for communication mechanisms, consensus mechanisms, etc.
A method of data access as shown in fig. 1, comprising:
s101, acquiring a source transaction request initiated in a source block chain.
When a user has service function requirements, a source transaction request for executing the service functions is initiated in a source block chain; accordingly, the blockchain node receives and executes the source transaction request due to the deployment of the active blockchain data.
S102, in the process of executing the source transaction request, if the access requirement of the data object of the target blockchain exists, initiating access operation for the data object to be accessed in the block which is forbidden to roll back in the target blockchain.
In the process of executing the source transaction request, if there is a case of performing auxiliary processing by means of the data value of the data object stored in the target blockchain, at this time, an access operation needs to be initiated for the target blockchain to obtain an access result. When the data objects to be accessed in the target block chain are accessed, as the data values of the same data object to be accessed in different blocks possibly are different due to the fact that the data is updated and the like, the data objects to be accessed in different blocks are accessed, and different access results can be obtained. In addition, when data is stored in the blockchain, because of fluctuation of the communication capability of the block-out node, there is a case that the block is rolled back, and if the storage block of the data object to be accessed is rolled back, then the value in the previous access result may be updated again and changed due to the rolling back operation.
In order to ensure validity and correctness of a data value of a data object to be accessed in an access result, in a target blockchain operation process, the method divides blocks in the target blockchain into blocks which are forbidden to roll back and blocks which are not forbidden to roll back, so that rolling back conditions of the blocks in the target blockchain are distinguished. Accordingly, when an access operation of a data object to be accessed is initiated, the access operation is initiated only for the data object to be accessed in the block which is forbidden to roll back in the target block chain, so that the validity of the acquired data value is ensured.
Wherein the blocks that are prohibited from rolling back may be consecutive or non-consecutive blocks in the target blockchain. It will be appreciated that to facilitate management of the data of each block in the target blockchain, the blocks that are prohibited from rolling back are typically set to be consecutive blocks.
Illustratively, the rollback disabled state of a tile may be differentiated by the way the tile is marked. Optionally, blocks that are not roll-back are marked differently from blocks that are not roll-back, e.g., only roll-back disabled blocks are marked.
In an alternative implementation of the embodiment of the present application, a checkpoint (checkpoint) block mechanism may also be introduced for marking stored blocks in the target blockchain, such that blocks preceding the marked blocks are prohibited from rolling back. The marked block is the check point block.
Accordingly, when it is determined that there is an access requirement of the data object to which the target blockchain belongs, an access operation is initiated for the data object to be accessed updated before the check point block in the target blockchain, so that the latest data value of the data object to be accessed in the check point block and the block before the check point block can be obtained.
Alternatively, the checkpointing block determination process may be implemented in the following manner: the blocks in the target blockchain, which are located before the latest block, are set to be the check point blocks. The method comprises the steps that when a target blockchain is created, specific values of the number of the set blocks are appointed in deployment data; the specific value for the number of set blocks may also be specified by a management node or maintenance node of the blockchain. The set number of blocks may be 5, for example. Correspondingly, in determining the check point block, the position of the check point block at the current moment is determined according to the difference between the latest block and the set block number.
For example, the latest block of the target blockchain is the [1000] th block, the number of the set blocks is 5, and the [0995] th block is used as the check point block.
Or alternatively, the checkpointed block determination process may be implemented in the following manner: the checkpoint blocks in the target blockchain are determined based on a consensus mechanism in the target blockchain.
Illustratively, the timing of the checkpointed blocks may be randomly determined or specified according to a policy. It will be appreciated that to facilitate proper operation and management of the target blockchain, checkpoint blocks in the target blockchain are typically updated according to a set frequency. Wherein the set frequency may be a set time frequency, such as daily; it may also be the out-block frequency of the blockchain, e.g., every newly generated block.
Alternatively, the checkpointed blocks and non-checkpointed blocks may be distinguished by creating a hash table. For example, each blockchain node in the network where the target blockchain is deployed can maintain in advance a unified blockflag table for each blockchain for recording whether each blockid is a checkpointed block or only the blockid currently belonging to the checkpointed block. Accordingly, by querying the block flag table, it is possible to know which block is the check point block in the target block chain.
In an optional implementation manner of the embodiment of the present application, when an access operation is initiated, a data value that is updated before a data object to be accessed, specifically, which checkpoint block, may be obtained from a source transaction request; the local node can also query and determine the current check point block of the target block chain from the block mark table of the target block chain stored locally after determining the target block chain to which the data object to be accessed belongs; the address of the access provided by the data object to be accessed may also be used as the address of the latest data in accordance with the source transaction request. Alternatively, only access operations for the data object to be accessed are initiated, and upon identifying a cross-chain access by a node of the target blockchain, access operations for the most current data prior to the checkpointed block are provided.
S103, if the access result is obtained, continuing to execute the source transaction request according to the access result.
When an access result is obtained from the target block chain, continuing to execute a source transaction request according to the access result, thereby providing corresponding service functions for a user; and when the source blockchain does not receive the access result in a set time period or is informed of the access failure, rejecting the source transaction request and determining that the source transaction request fails to be executed. Further, the cause of the execution failure may be fed back to the user. Wherein the length of time of the set time period may be determined when deploying the deployment data of the blockchain.
Illustratively, knowing that the access fails may be that the source transaction request's initiator does not have access to the data object to be accessed in the target blockchain when performing the access operation to the data object to be accessed in the target blockchain.
Illustratively, the access requirements may be validated based on a rights control model of the target blockchain deployment prior to initiating the access operation; if the verification is successful, an access operation is initiated to access the data value of the data object to be accessed; if the verification fails, determining that the access fails, terminating the execution of the source transaction request, and determining that the execution of the source transaction request fails.
Illustratively, performing rights verification on the access requirements based on the rights control model of the target blockchain deployment may be: and verifying the data access authority of the initiator of the source transaction request according to an authority control table set when the target intelligent contract to which the data object to be accessed belongs is deployed in the target blockchain.
The permission control table is used for controlling the calling permission of the user account to the target intelligent contract. The permission control table records the calling permission control strategy of the target intelligent contract: at least one of a threshold policy, an endorsement policy, and a fixed account policy. And authenticating the user account of the calling target intelligent contract by calling the authority control strategy, and calling the target intelligent contract to execute access operation when the authentication is passed.
The threshold strategy is used for determining a call authentication passing result according to the relation between the sum of the weights of the authorized accounts contained in the source transaction request and the set call threshold; an endorsement policy for determining a call authentication passing result according to the number or proportion of authorized accounts contained in the source transaction request; and the account policy is used for determining an authentication passing result according to the relation between the initiating user of the source transaction request and a preset authorized account or a preset forbidden account. The authorized account is a user account with the target intelligent contract calling authority. The forbidden right account is a user account which does not have the target intelligent contract calling right. When the target intelligent contract is deployed, corresponding calling weight values are preset for different authorized accounts. The authorization account, the forbidden account and the calling weight value of each authorization account can be adjusted by the contract management account of the target intelligent contract according to the need after the target intelligent contract is deployed.
Optionally, authenticating the user account of the invoking target smart contract by invoking the rights control policy may be: determining a sum of weights of the authorized accounts contained in the source transaction request; if the sum is greater than the set call threshold, the authentication passes. Or, alternatively, determining the number of authorized accounts contained in the source transaction request; if the number is greater than the set number threshold, authentication is passed. Or alternatively, determining the proportion of the authorized account contained in the source transaction request, and if the proportion is greater than a set proportion threshold, passing the authentication. Or alternatively, determining whether the initiating user of the source transaction request is a preset authorized account or an associated account of the preset authorized account; if yes, the authentication passes. Or alternatively, determining whether the initiating user of the source transaction request is a preset forbidden account or an associated account of the preset forbidden account; if not, the authentication passes. Wherein, the associated account of the account can be understood as a parent account or a child account of the account.
In the embodiment of the application, when the access requirement of the data object of the target blockchain is met in the execution process of the source transaction request, the access operation is initiated for the data object to be accessed in the block which is forbidden to roll back in the target blockchain, so that the processing of the source transaction request is performed based on the access result, and the sharing of data among different blockchains is realized. In addition, by limiting the accessible data to the data in the block which is forbidden to be rolled back, the situation that the block where the data in the access result is rolled back and the source transaction request execution result is wrong or needs to be rolled back and executed can be avoided, the effectiveness and the stability of the access result are improved, and the effectiveness and the stability of the source transaction request execution result are further improved. Meanwhile, under the condition that the access result is obtained, the source transaction request is continuously executed, and the waste of computing resources caused by unnecessary execution of the source transaction request is reduced.
Example two
Fig. 2 is a flowchart of a data access method in a second embodiment of the present application. The embodiment of the application is optimized and improved on the basis of the technical scheme of each embodiment.
Further, the operation of determining that the access requirement of the data object to which the target blockchain belongs exists is refined to be "determining that the data object to be accessed belongs to different blockchains according to the data identifier of the data object to be accessed in the source transaction request, and determining that the access requirement of the data object to which the target blockchain belongs exists; wherein the data identifier at least comprises names of a data level and a chain level, and the data identifier further comprises names of a contract level and a network level so as to perfect a determination mechanism of the access requirement.
A data access method as shown in fig. 2, comprising:
s201, acquiring a source transaction request initiated in a source block chain;
s202, in the process of executing the source transaction request, determining that the data object to be accessed belongs to different block chains according to the data identification of the data object to be accessed in the source transaction request, and determining that the access requirement of the data object to which the target block chain belongs exists.
Wherein the data identification comprises at least a name of a data level and a name of a chain level, and the data identification further comprises a name of a contract level and a name of a network level.
Illustratively, when the data object is stored in the running process of the blockchain system, a data identifier of the data object to be stored is generated through a network level name, a chain level name, a contract level name and a data level name, and the data object to be stored is named and distinguished. Accordingly, when accessing the data in the blockchain, the target blockchain to which the data object to be accessed belongs can be determined according to the data identifier, or the super-chain network to which the blockchain belongs can be further determined.
For example, there is a blockchain root chain in the super-chain network xuper, and a variable value corresponding to the variable user is stored in the root chain. Then, the variable user may be named by xupper. Correspondingly, when the data object is accessed, determining the block chain root and/or the block network xuper to which the data object to be accessed belongs through a data identifier of "xuper.
In order to ensure the uniqueness of the data objects in the blockchain system and prevent data collision, in the blockchain system, the name of the intelligent contract in the same blockchain is unique; in the same blockchain network, the name of the blockchain is unique; in the same blockchain system, the name of the super-chain network is unique. In the practical application process, the super-link network can be maintained by different main bodies, so that a unified network name registration mechanism can be set in the blockchain system to ensure the uniqueness of the naming of the super-link network. Illustratively, the federation may be registered by presetting a network name, determining the network name of the hyperlink network by means of offline negotiation of the members of the federation, and performing name allocation.
In an optional implementation manner of the embodiment of the application, intelligent contracts for realizing different functions are deployed in the blockchain system, and each intelligent contract can manage storage and read-write access of the data object based on a set data storage model, so that when the data object is stored, a contract level name can be added in the data identifier.
For example, there is a blockchain root chain in the super-chain network xuper, an intelligent contract account is deployed in the root chain, and a variable value corresponding to a variable user is stored in a database corresponding to the intelligent contract account. Then, the variable user can be named by xupper. Correspondingly, when the data object is accessed, the block chain root and/or the super chain network xuper to which the data object to be accessed belongs is determined through the data identifier "xuper.
Accordingly, in order to ensure the uniqueness of the data objects in the blockchain system and prevent data collision, in the blockchain system, the name of the intelligent contract is unique in the same blockchain; in the same blockchain network, the name of the blockchain is unique; in the same blockchain system, the name of the super-chain network is unique.
Optionally, when the target blockchain to which the data object to be accessed belongs and the source blockchain from which the source transaction request is initiated belong to the same super-chain network, determining a cross-chain access requirement for storing the data object to which the target blockchain belongs; when the target blockchain to which the data object to be accessed belongs and the source blockchain from which the source transaction request is initiated belong to different super-chain networks, determining the cross-network access requirement for storing the data object to which the target blockchain belongs.
In order to ensure the accuracy and the reliability of the data access result, when the source blockchain and the target blockchain belong to different super-chain networks, that is, when the cross-network access requirement exists, the access operation is initiated for the data object to be accessed in the block which is forbidden to roll back in the target blockchain, which can be: a current block-out node in a source block chain initiates a target transaction request for accessing a data object to be accessed to a trusted node in a super chain network where a target block chain is located; accordingly, the transaction request is received and executed by the current outbound block node in the target blockchain, thereby performing an access operation from the rollback disabled blocks in the target blockchain, and feeding back the access result to the current outbound block node of the source blockchain.
Illustratively, when there are at least two hyperlinks in a blockchain system, at least one blockchain node in one of the hyperlinks is configured with at least one trusted node in the other of the hyperlinks in order to enable data sharing in the different hyperlinks.
Optionally, the trusted node may be determined according to at least one of communication capability, data computing capability, and number of tokens held by the node, and may be set by the blockchain manager or the node holder.
In an embodiment, each node may locally maintain a trusted node list, and when cross-network access is required, the trusted node list may be queried to select a trusted node.
It can be understood that in order to ensure the normal running of cross-network access in the blockchain system, the updating operations such as adding, deleting, rewriting and the like can be performed on the trusted nodes in the trusted node list in real time or at a fixed time according to the running condition of the trusted nodes.
S203, if it is determined that the access requirement of the data object of the target blockchain exists, an access operation is initiated for the data object to be accessed in the block which is forbidden to roll back in the target blockchain.
S204, if the access result is obtained, continuing to execute the source transaction request according to the access result.
According to the method and the device for determining the access requirements, the access requirements are determined to exist when the target blockchain and the source blockchain are determined to be different blockchains according to the data identification of the data object to be accessed in the source transaction request through refinement of the access requirements determining operation. Because the data identifier comprises the names of the data level and the chain level, the target block chain to which the data object to be accessed belongs can be positioned; and meanwhile, the target block chain is compared with the source block chain to determine whether the cross-chain access requirement of the data is met, and under the condition that the cross-chain access requirement is met, the cross-chain access operation of the data is triggered and executed, so that the application scene of the data access is enriched. Further, a network level name is added in the data identifier, and whether the super-link network to which the target block chain and the source block chain belong is determined to be the same, so that whether the cross-network access requirement exists is determined, and the cross-network access operation of the data is executed when the data is provided, so that the application scene of the data access is further enriched. Further, a contract-level name can be added to the data identifier, so that an intelligent contract to which the data object to be accessed belongs is determined, and a foundation is laid for access based on the intelligent contract.
Example III
Fig. 3 is a flowchart of a data access method in a third embodiment of the present application. The embodiment of the application is optimized and improved on the basis of the technical scheme of each embodiment.
Further, the operation of initiating access operation for the data object to be accessed in the block which is forbidden to roll back in the target block chain is thinned into the operation of initiating access operation for the data object to be accessed in the target block chain; if the access operation is a cross-chain access operation, judging whether a subsequent block of the data object to be accessed, which is forbidden to roll back, is updated or not; if yes, access failure occurs; otherwise, executing the access operation and feeding back the access result ", thereby perfecting the initiation mode of the access operation.
A data access method as shown in fig. 3, comprising:
s301, acquiring a source transaction request initiated in a source block chain.
S302, in the process of executing the source transaction request, if the access requirement of the data object to which the target blockchain belongs is determined to exist, an access operation is initiated for the data object to be accessed in the target blockchain.
In an optional implementation manner of the embodiment of the present application, the access operation is initiated for the data object to be accessed in the target blockchain, which may be that in the database locally belonging to the target blockchain by the blockchain node, a read operation for the data object to be accessed is initiated, so as to read the data value of the data object to be accessed in the target blockchain, and feed back the data value as an access result to the source blockchain of the source transaction request, so as to be used when executing the source transaction request.
Because of the cross access barrier of data stored in different blockchains, access operations cannot be performed directly from data objects in the target blockchain when a source transaction request is performed in the source blockchain. At this point, optionally, a read operation of the data object to be accessed from the target blockchain needs to be performed by means of a bridging function (XuperBridge). Illustratively, a bridging function is invoked, and if the bridging function determines that the type of invocation is a local read, a read operation of the data object to be accessed is initiated in a database locally attributed to the target blockchain by the blockchain node.
The bridging function is deployed in the blockchain system for calling the intelligent contract in the blockchain network.
Illustratively, the intelligent contracts in the source blockchain network may be based on bridging modules in the blockchain network, create bridging instances, and implement the invocation of bridging functions by running the bridging instances.
For example, if the data object to be accessed is generated based on the target intelligent contract, the read operation of the data object to be accessed is initiated in the database locally belonging to the target blockchain by the blockchain node, and the target intelligent contract to which the data object to be accessed belongs is called by calling the bridge function, so that the read operation of the data object to be accessed is realized.
It can be understood that, after the data in the local database of the blockchain node changes, the data stored by other nodes in the target blockchain network will not know the change, so that the corresponding data object storage content will not be updated based on the change, and the situation that the blockdata stored by different blockchain nodes in the target blockchain network are different will occur, which violates the transparent traceability principle of the blockchain storage data disclosure. Therefore, when the data object to be accessed is locally accessed, only the read operation of the data object can be performed, and the write operation of the data object cannot be performed.
In order to ensure traceability of the data access process in the target blockchain, an access operation for the data object to be accessed can be initiated in a link access mode. Wherein the access operation includes a read operation or a write operation.
In an optional implementation manner of the embodiment of the present application, the initiating an access operation for the data object to be accessed in the target blockchain may be initiating a target transaction request for accessing the data object to be accessed to the target blockchain network, so that a block generating node in the target blockchain executes the target transaction request, thereby acquiring, from a block prohibited from rolling back in the target blockchain, a data value of the data object to be accessed as target access data, and executing the access operation on the target access data; wherein the access operation comprises a read operation or a write operation.
The blockchain nodes that execute the source transaction request and the target transaction request may be the same or different blockchain nodes when performing the data access operation.
In order to facilitate timely obtaining of data access results and improve data access efficiency, when the same super-link network performs cross-link access of data, namely, when the source block chain and the target block chain are different and belong to the same super-link network, nodes of the source block chain and the target block chain can be used as current block-out nodes.
For example, if the data object to be accessed is generated based on the target intelligent contract, a target transaction request for accessing the data object to be accessed is initiated in the target blockchain network to request the target blockchain network to execute the target transaction request, and the data object to be accessed executes an access operation, which may be: and calling a bridging function, and if the bridging function determines that the calling type is non-local reading, initiating a target transaction request for accessing the data object to be accessed based on the target intelligent contract to request the blockchain network to execute the target transaction request, and executing the access operation on the data object to be accessed.
When the access operation comprises a read operation, the data object to be accessed can be read, and the data value of the read data object is fed back to the source block chain to which the source transaction request belongs through a bridging function so as to be used for executing the source transaction request; when the access operation comprises a write operation, the target transaction request comprises a source data value and a target data value of the write operation; and updating the source data value of the data object to be accessed to the target data value by calling the target intelligent contract. Wherein the source data value may be a default data value or a currently stored data value. The default data value may be, for example, a null value, which is stored when no data is stored. Of course, it is also possible to include only the target numerical value of the write operation in the target transaction request, and the source data value may be determined by a lookup.
In an embodiment, the determining call type may be determined by a data access manner and an operation manner, where the data access manner is a local access and the operation manner is a read operation, and determining the call type is a local read; otherwise, the call type is determined to be a non-native read.
Illustratively, the access manner may be implemented by: the access manner is specified by the user, randomly determined, selected based on the execution time of the source transaction request, or determined based on a consensus mechanism in the blockchain.
S303, if the access operation is a cross-chain access operation, judging whether the subsequent block of the block of which the rollback is forbidden for the data object to be accessed is updated or not.
For example, if the access operation is a cross-chain access operation, it indicates that the data access operation needs to be performed on the data object to be accessed in the block in the target blockchain that is prohibited from rolling back. At this time, if the subsequent block of the block prohibited from rolling back is updated, when data access is performed to the data object to be accessed in the block prohibited from rolling back, since the data read at the time of the read operation has been updated or the data covered at the time of the write operation has been updated, the data access operation becomes invalid access, which affects the accuracy of the execution result of the source transaction request and the accuracy of the stored data in the target blockchain.
In order to ensure the accuracy of the source transaction request result and the accuracy of the access result, before the access operation is initiated, the update condition of the following blocks of the block of which the rollback is forbidden to be processed to the data object to be accessed needs to be judged.
The determination of the cross-chain access operation may be determined according to a data identifier of the data object to be accessed in the source transaction request; if the target blockchain to which the data object to be accessed belongs is different from the source blockchain, the cross-chain access operation is required. Wherein the data identifier comprises names of a data level and a chain level.
In an optional implementation manner of the embodiment of the present application, in a process of initiating an access operation for a data object to be accessed that is updated before a checkpoint block in a target blockchain, whether a subsequent block of the checkpoint block is updated for the data object to be accessed may be determined; if yes, access failure occurs; otherwise, executing the access operation and feeding back the access result. Wherein blocks preceding the checkpointed block are prohibited from rolling back.
For example, determining whether the data object to be accessed is updated in a subsequent block of the checkpointed block may be sequentially traversing each block from the latest block in the target blockchain, determining whether the block is a block preceding the checkpointed block, and whether there is an update operation of the data object to be accessed.
The determination operation of the check point block can be referred to the previous embodiments, and will not be described herein.
S304, if yes, access failure occurs; otherwise, executing the access operation and feeding back the access result.
If the data object to be accessed is updated in the subsequent block of the block which is forbidden to roll back, the access fails, and the subsequent execution operation on the source transaction request is terminated, so that the waste of computing resources caused by invalid execution of the source transaction request is avoided. Alternatively, the execution of the source transaction request may be aborted and the source transaction request may continue to be executed when the data storage block to be accessed for which data update is most recently changed to a block that is prohibited from rolling back.
If the data object to be accessed is not updated in the subsequent blocks of the block which is forbidden to roll back, the data object to be accessed in the block which is forbidden to roll back at the moment is the latest data in the target block chain, so that the accuracy of the accessed data can be ensured; since the memory block of the data object to be accessed is located in the prohibited rollback block, the validity of the accessed data can be ensured. At this time, the access result may be fed back to the source blockchain, so that the block-out node of the source blockchain performs a subsequent source transaction request execution operation according to the access result.
S305, if the access result is obtained, continuing to execute the source transaction request according to the access result.
According to the embodiment of the application, the initiating operation of the access operation is refined to be initiated aiming at the data object to be accessed in the target block chain; if the access operation is a cross-chain access operation, judging whether a subsequent block of the data object to be accessed, which is forbidden to roll back, is updated or not; if yes, access failure occurs; otherwise, executing the access operation and feeding back the access result. According to the technical scheme, the accuracy of the access result can be determined by updating and judging the follow-up blocks of the blocks which are forbidden to roll back, so that the accuracy of the execution result of the source transaction request is guaranteed.
Example IV
Fig. 4 is a block diagram of a data access apparatus in a fourth embodiment of the present application, which is applicable to a cross-chain access situation for data objects belonging to different blockchains in a super blockchain network. The device is realized by software and/or hardware and is specifically configured in the electronic equipment carrying the blockchain node. The blockchain link point blockchain node is deployed with at least two blockchains.
A data access apparatus 400 as shown in fig. 4, comprising: a source transaction request acquisition module 401, an access operation initiation module 402, and an access result acquisition module 403. Wherein, the liquid crystal display device comprises a liquid crystal display device,
A source transaction request acquisition module 401, configured to acquire a source transaction request initiated in a source blockchain;
an access operation initiating module 402, configured to initiate an access operation for a data object to be accessed in a block prohibited from rolling back in the target blockchain if it is determined that there is an access requirement of the data object to which the target blockchain belongs in the process of executing the source transaction request;
and the access result obtaining module 403 is configured to, if an access result is obtained, continue to execute the source transaction request according to the access result.
According to the embodiment of the application, the source transaction request initiated in the source block chain is acquired through the source transaction request acquisition module; in the process of executing the source transaction request, if the access requirement of the data object of the target blockchain exists, an access operation is initiated for the data object to be accessed in the block which is forbidden to roll back in the target blockchain; and when the access result is acquired by the access result acquisition module, continuing to execute the source transaction request according to the access result. In the embodiment of the application, when the access requirement of the data object of the target blockchain is met in the execution process of the source transaction request, the access operation is initiated for the data object to be accessed in the block which is forbidden to roll back in the target blockchain, so that the processing of the source transaction request is performed based on the access result, and the sharing of data among different blockchains is realized. In addition, by limiting the accessible data to the data in the block which is forbidden to be rolled back, the situation that the block where the data in the access result is rolled back and the source transaction request execution result is wrong or needs to be rolled back and executed can be avoided, the effectiveness and the stability of the access result are improved, and the effectiveness and the stability of the source transaction request execution result are further improved. Meanwhile, under the condition that the access result is obtained, the source transaction request is continuously executed, and the waste of computing resources caused by unnecessary execution of the source transaction request is reduced.
Further, the apparatus further includes an execution failure module configured to:
if the access failure is known, determining that the execution of the source transaction request fails.
Further, the access operation initiating module 402 is specifically configured to, when executing the initiation of the access operation for the data object to be accessed in the block prohibited from rolling back in the target blockchain:
initiating access operation for a data object to be accessed in the target blockchain;
if the access operation is a cross-chain access operation, judging whether a subsequent block of the data object to be accessed, which is forbidden to roll back, is updated or not;
if yes, access failure occurs; otherwise, executing the access operation and feeding back the access result.
Further, the access operation initiating module 402 is specifically configured to, when executing an access operation for a data object to be accessed in the target blockchain:
initiating a read operation for the data object to be accessed in a database locally attributed to the target blockchain by the blockchain node; or alternatively, the process may be performed,
a target transaction request to access a data object to be accessed is initiated to a target blockchain network.
Further, the apparatus further includes a target transaction request execution module configured to:
After a target transaction request for accessing a data object to be accessed is initiated to a target blockchain network, executing the target transaction request, acquiring a data value of the data object to be accessed from a block which is forbidden to roll back in the target blockchain as target access data, and executing access operation on the target access data; wherein the access operation includes a read operation or a write operation.
Further, the access operation initiating module 402 is specifically configured to, when executing the initiation of the access operation for the data object to be accessed in the block prohibited from rolling back in the target blockchain:
initiating access operation for a data object to be accessed, which is updated before a check point block in the target block chain; wherein blocks preceding the checkpoint block are prohibited from rolling back.
Further, the apparatus further comprises a checkpoint block determining module configured to:
setting the blocks with the block number before the latest block in the target block chain as check point blocks; or alternatively, the process may be performed,
and determining a check point block in the target block chain according to a consensus mechanism in the target block chain.
Further, the access operation initiation module 402 is specifically configured to, when executing the determination that there is an access requirement of the data object to which the target blockchain belongs:
According to the data identification of the data object to be accessed in the source transaction request, determining that the data object to be accessed belongs to different block chains, and determining that the access requirement of the data object to which the target block chain belongs exists;
wherein the data identification comprises at least a name of a data level and a name of a chain level, and the data identification further comprises a name of a contract level and a name of a network level.
Further, the source blockchain and the target blockchain belong to the same or different super-chain networks.
Further, if the source blockchain and the target blockchain belong to different super-chain networks, the access operation initiation module 402 is specifically configured to, when executing an access operation for a data object to be accessed in a block that is prohibited from rolling back in the target blockchain,:
and the current block-out node in the source block chain initiates a target transaction request for accessing the data object to be accessed to a trusted node in a super-chain network where the target block chain is located.
Further, the device also comprises a right verification module for:
and before an access operation is initiated for the data object to be accessed in the block prohibited from rolling back in the target blockchain, performing authority verification on the access requirement based on an authority control model deployed by the target blockchain.
The data access device can execute the data access method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of executing the data access method.
Example five
According to embodiments of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 5, a block diagram of an electronic device implementing a data access method according to an embodiment of the present application is shown. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 5, the electronic device includes: one or more processors 501, memory 502, and interfaces for connecting components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 501 is illustrated in fig. 5.
Memory 502 is a non-transitory computer readable storage medium provided herein. Wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the data access methods provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the data access method provided by the present application.
The memory 502 is used as a non-transitory computer readable storage medium, and may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules (e.g., the source transaction request obtaining module 401, the access operation initiating module 402, and the access result obtaining module 403 shown in fig. 4) corresponding to the data access method in the embodiments of the present application. The processor 501 executes various functional applications of the server and data processing, i.e., implements the data access method in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 502.
Memory 502 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created by use of an electronic device implementing the data access method, and the like. In addition, memory 502 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 502 may optionally include memory located remotely from processor 501, which may be connected via a network to an electronic device implementing the data access method. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device implementing the data access method may further include: an input device 503 and an output device 504. The processor 501, memory 502, input devices 503 and output devices 504 may be connected by a bus or otherwise, for example in fig. 5.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device implementing the data access method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, etc. input devices. The output devices 504 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
In the embodiment of the application, when the access requirement of the data object of the target blockchain is met in the execution process of the source transaction request, the access operation is initiated for the data object to be accessed in the block which is forbidden to roll back in the target blockchain, so that the processing of the source transaction request is performed based on the access result, and the sharing of data among different blockchains is realized. In addition, by limiting the accessible data to the data in the block which is forbidden to be rolled back, the situation that the block where the data in the access result is rolled back and the source transaction request execution result is wrong or needs to be rolled back and executed can be avoided, the effectiveness and the stability of the access result are improved, and the effectiveness and the stability of the source transaction request execution result are further improved. Meanwhile, under the condition that the access result is obtained, the source transaction request is continuously executed, and the waste of computing resources caused by unnecessary execution of the source transaction request is reduced.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (14)

1. A data access method performed by a block link point having at least two block chains disposed therein, the method comprising:
acquiring a source transaction request initiated in a source block chain;
in the process of executing the source transaction request, if the access requirement of the data object of the target block chain exists, initiating access operation aiming at the data object to be accessed in the block which is forbidden to roll back in the target block chain;
If the access result is obtained, continuing to execute the source transaction request according to the access result;
wherein the determining that the access requirement of the data object to which the target blockchain belongs exists includes:
and determining that the data object to be accessed belongs to different block chains according to the data identification of the data object to be accessed in the source transaction request, and determining that the access requirement of the data object to which the target block chain belongs exists.
2. The method as recited in claim 1, further comprising:
if the access failure is known, determining that the execution of the source transaction request fails.
3. The method of claim 1 or 2, wherein initiating an access operation for a data object to be accessed in a block of the target blockchain that is prohibited from rolling back comprises:
initiating access operation for a data object to be accessed in the target blockchain;
if the access operation is a cross-chain access operation, judging whether a subsequent block of the data object to be accessed, which is forbidden to roll back, is updated or not;
if yes, access failure occurs; otherwise, executing the access operation and feeding back the access result.
4. The method of claim 3, wherein initiating an access operation for a data object to be accessed in the target blockchain comprises:
Initiating a read operation for the data object to be accessed in a database locally attributed to the target blockchain by the blockchain node; or alternatively, the process may be performed,
a target transaction request to access a data object to be accessed is initiated to a target blockchain network.
5. The method of claim 4, further comprising, after initiating a target transaction request to the target blockchain network to access the data object to be accessed:
executing the target transaction request, taking the data value of the data object to be accessed as target access data from the blocks forbidden to roll back in the target block chain, and executing access operation on the target access data; wherein the access operation includes a read operation or a write operation.
6. The method of claim 1, wherein initiating an access operation for a data object to be accessed in a block of the target blockchain that is prohibited from rolling back comprises:
initiating access operation for a data object to be accessed, which is updated before a check point block in the target block chain; wherein blocks preceding the checkpoint block are prohibited from rolling back.
7. The method of claim 6, wherein the method further comprises:
Setting the blocks with the block number before the latest block in the target block chain as check point blocks; or alternatively, the process may be performed,
and determining a check point block in the target block chain according to a consensus mechanism in the target block chain.
8. The method of claim 1, wherein the data identification includes at least a name of a data level and a chain level, the data identification further including names of a contract level and a network level.
9. The method of claim 1, wherein the source blockchain and the target blockchain belong to the same or different super-chain network.
10. The method of claim 9, wherein if the source blockchain and the target blockchain belong to different super-chain networks, initiating an access operation for a data object to be accessed in a block of the target blockchain that is prohibited from rolling back comprises:
and the current block-out node in the source block chain initiates a target transaction request for accessing the data object to be accessed to a trusted node in a super-chain network where the target block chain is located.
11. The method of claim 1, wherein prior to initiating an access operation for a data object to be accessed in a block of the target blockchain that is prohibited from rolling back, the method further comprises:
And carrying out authority verification on the access requirement based on an authority control model of target blockchain deployment.
12. A data access apparatus configured at a blockchain node having at least two blockchains disposed therein, comprising:
the source transaction request acquisition module is used for acquiring a source transaction request initiated in a source block chain;
the access operation initiating module is used for initiating access operation for the data object to be accessed in the block which is forbidden to roll back in the target block chain if the access requirement of the data object which the target block chain belongs to exists in the process of executing the source transaction request;
the access result acquisition module is used for continuing to execute the source transaction request according to the access result if the access result is acquired;
the access operation initiating module is specifically configured to, when executing the determination that there is an access requirement of the data object to which the target blockchain belongs:
and determining that the data object to be accessed belongs to different block chains according to the data identification of the data object to be accessed in the source transaction request, and determining that the access requirement of the data object to which the target block chain belongs exists.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a data access method according to any one of claims 1-11.
14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform a data access method of any one of claims 1-11.
CN202010128866.6A 2020-02-28 2020-02-28 Data access method, device, equipment and storage medium Active CN111339114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010128866.6A CN111339114B (en) 2020-02-28 2020-02-28 Data access method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010128866.6A CN111339114B (en) 2020-02-28 2020-02-28 Data access method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111339114A CN111339114A (en) 2020-06-26
CN111339114B true CN111339114B (en) 2023-05-09

Family

ID=71185668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010128866.6A Active CN111339114B (en) 2020-02-28 2020-02-28 Data access method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111339114B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488202B (en) * 2020-04-07 2023-08-15 百度国际科技(深圳)有限公司 Transaction processing method, device, equipment, system and medium of multi-chain system
CN112286643B (en) * 2020-12-24 2021-04-20 北京百度网讯科技有限公司 Transaction processing method, device, equipment and medium for Ether house virtual machine

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105573828A (en) * 2015-12-17 2016-05-11 布比(北京)网络技术有限公司 Operation processing method and device
CN106899698A (en) * 2017-04-11 2017-06-27 张铮文 A kind of across chain mutual operation method between block chain
CN107085810A (en) * 2017-04-19 2017-08-22 朱皞罡 Across the chain operating method and block chain management system of a kind of block chain
CN108288159A (en) * 2018-03-07 2018-07-17 物数(上海)信息科技有限公司 Across chain method of commerce, system, equipment and storage medium based on multi-tiling chain
CN108596588A (en) * 2018-04-28 2018-09-28 百度在线网络技术(北京)有限公司 A kind of processing method of block data, device, computing device and storage medium
CN108961052A (en) * 2018-06-25 2018-12-07 百度在线网络技术(北京)有限公司 Verification method, storage method, device, equipment and the medium of block chain data
CN109471744A (en) * 2018-11-21 2019-03-15 北京蓝石环球区块链科技有限公司 The more subchain system architectures of main chain adduction row based on block chain
CN109951547A (en) * 2019-03-15 2019-06-28 百度在线网络技术(北京)有限公司 Transactions requests method for parallel processing, device, equipment and medium
CN109981679A (en) * 2019-04-08 2019-07-05 上海点融信息科技有限责任公司 The method and apparatus of affairs are executed in block chain network
CN110766410A (en) * 2019-10-24 2020-02-07 杭州趣链科技有限公司 Method and equipment for constructing and verifying credible cross-chain event based on Mercker tree

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10255342B2 (en) * 2017-04-12 2019-04-09 Vijay K. Madisetti Method and system for tuning blockchain scalability, decentralization, and security for fast and low-cost payment and transaction processing
US10102265B1 (en) * 2017-04-12 2018-10-16 Vijay K. Madisetti Method and system for tuning blockchain scalability for fast and low-cost payment and transaction processing

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105573828A (en) * 2015-12-17 2016-05-11 布比(北京)网络技术有限公司 Operation processing method and device
CN106899698A (en) * 2017-04-11 2017-06-27 张铮文 A kind of across chain mutual operation method between block chain
CN107085810A (en) * 2017-04-19 2017-08-22 朱皞罡 Across the chain operating method and block chain management system of a kind of block chain
CN108288159A (en) * 2018-03-07 2018-07-17 物数(上海)信息科技有限公司 Across chain method of commerce, system, equipment and storage medium based on multi-tiling chain
CN108596588A (en) * 2018-04-28 2018-09-28 百度在线网络技术(北京)有限公司 A kind of processing method of block data, device, computing device and storage medium
CN108961052A (en) * 2018-06-25 2018-12-07 百度在线网络技术(北京)有限公司 Verification method, storage method, device, equipment and the medium of block chain data
CN109471744A (en) * 2018-11-21 2019-03-15 北京蓝石环球区块链科技有限公司 The more subchain system architectures of main chain adduction row based on block chain
CN109951547A (en) * 2019-03-15 2019-06-28 百度在线网络技术(北京)有限公司 Transactions requests method for parallel processing, device, equipment and medium
CN109981679A (en) * 2019-04-08 2019-07-05 上海点融信息科技有限责任公司 The method and apparatus of affairs are executed in block chain network
CN110766410A (en) * 2019-10-24 2020-02-07 杭州趣链科技有限公司 Method and equipment for constructing and verifying credible cross-chain event based on Mercker tree

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Analysis of blockchain system with token-based bookkeeping method;T Cai,H J Cai,H Wang,X Cheng,L Wang;《IEEE》;全文 *
区块链跨链技术进展研究;李芳,李卓然,赵赫;《软件学报》;全文 *

Also Published As

Publication number Publication date
CN111339114A (en) 2020-06-26

Similar Documents

Publication Publication Date Title
CN111930852B (en) Data processing method, device and equipment based on block chain and storage medium
CN111741026B (en) Cross-chain transaction request processing method, device, equipment and storage medium
EP3816910A1 (en) Blockchain-based transaction processing method and apparatus, and electronic device
EP3816922A1 (en) Blockchain-based transaction processing method and apparatus, and electronic device
JP2021512380A (en) Asset management methods and equipment, as well as electronic devices
CN111324425B (en) Data access method, device, equipment and storage medium
CN111782669B (en) Method and device for realizing distributed lock and electronic equipment
US11201870B2 (en) Using commit tokens to coordinate permissions submissions to address transaction conflict in blockchain systems
US11250395B2 (en) Blockchain-based transaction processing methods and apparatuses and electronic devices
TW201229795A (en) Web service patterns for globally distributed service fabric
CN111339114B (en) Data access method, device, equipment and storage medium
EP2357560B1 (en) Method and system for managing by a controller a generic data lock to a data object
WO2020051312A1 (en) Blockchain timeclock system
CN110866740A (en) Processing method and device for block chain transaction request, electronic equipment and medium
CN111565204B (en) Block chain operation method, device, equipment and storage medium
US20230401241A1 (en) System for lightweight objects
CN111352706B (en) Data access method, device, equipment and storage medium
CN111260474A (en) Cross-block-chain asset transaction method, device, equipment, system and storage medium
CN114942847A (en) Method for executing transaction and block link point
US10242042B2 (en) Copy-on-write update-triggered consistency
CN111339202B (en) Data access method, device, equipment and storage medium
CN114936092A (en) Method for executing transaction in block chain and main node of block chain
CN111339187A (en) Data processing method, device, equipment and storage medium based on intelligent contract
US20140189715A1 (en) Conversion of lightweight object to a heavyweight object
CN104199976A (en) Method for integrating native transaction and logical transaction

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