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

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

Info

Publication number
CN111339114A
CN111339114A CN202010128866.6A CN202010128866A CN111339114A CN 111339114 A CN111339114 A CN 111339114A CN 202010128866 A CN202010128866 A CN 202010128866A CN 111339114 A CN111339114 A CN 111339114A
Authority
CN
China
Prior art keywords
access
block chain
data
block
data object
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.)
Granted
Application number
CN202010128866.6A
Other languages
Chinese (zh)
Other versions
CN111339114B (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Quality & Reliability (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Automation & Control Theory (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data access method, a data access device, data access equipment and a storage medium, and relates to the technical field of block chains. The method is performed by a block link point deployed with at least two block chains, 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 block chain belongs is determined to exist, initiating an access operation aiming at the data object to be accessed in the block prohibited 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. According to the embodiment of the application, data sharing among different block chains is realized, and the data which can be accessed is limited to the data in the block which is prohibited from rolling back, so that the validity and the stability of the access result are improved, and further the validity and the stability of the execution result of the source transaction request are 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 application relates to computer technologies, and in particular, to the field of block chain technologies, and in particular, to a data access method, apparatus, device, and storage medium.
Background
The block chain is essentially a distributed shared account book and a database, and has the characteristics of decentralization, no tampering, trace retaining in the whole process, traceability, collective maintenance, openness and transparency and the like.
However, different block chains run independently, data are highly heterogeneous, and the difficulty in cooperation between the chains is high, so that the interoperability between the block chains is lost, the problem of information isolated island exists, and the application space of the block chains is greatly limited.
In view of the above, it is an urgent problem to achieve data sharing between different block chains by using a cross-chain technology.
Disclosure of Invention
The embodiment of the application provides a data access method, a data access device, data access equipment and a storage medium, so that data sharing among different block chains is realized.
In a first aspect, an embodiment of the present application provides a data access method, which is performed by a block link point, where at least two block chains are deployed, and the method includes:
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 block chain belongs is determined to exist, initiating an access operation aiming at the data object to be accessed in the block which is prohibited 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, in the execution process of the source transaction request, when the access requirement of the data object to which the target block chain belongs is met, the access operation is initiated for the data object to be accessed in the block which is prohibited from rolling back in the target block chain, so that the source transaction request is processed based on the access result, and the data sharing among different block chains is realized. In addition, by limiting the accessible data to the data in the block prohibited from rolling back, the situation that the block where the data in the access result is located is rolled back, so that the execution result of the source transaction request is wrong or needs to be rolled back for execution can be avoided, the validity and the stability of the access result are improved, and the validity and the stability of the execution result of the source transaction request are further improved. Meanwhile, under the condition of obtaining the access result, the source transaction request is continuously executed, so that the waste of computing resources caused by unnecessary execution of the source transaction request is reduced.
Optionally, if the access failure is known, it is determined that the execution of the source transaction request fails.
In an optional implementation manner of the foregoing application, when it is known that the access fails, it is determined that the execution of the source transaction request fails, so that the execution of the source transaction request is terminated in time under the condition that the access fails, and waste of computing resources caused by invalid execution of the source transaction request can be reduced.
Optionally, initiating an access operation for a data object to be accessed in a block prohibited from rolling back in the target block chain includes:
initiating an access operation for a 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 in the block prohibited from rolling back is updated;
if so, access fails; otherwise, executing the access operation and feeding back an access result.
In an optional implementation manner in the foregoing application, when performing cross-link data access, the update condition of the subsequent block of the block prohibited from rolling back of the data object to be accessed is determined, and when the subsequent block is updated, the data access operation is terminated in time, so that occurrence of an error in the execution result of the source transaction request due to non-latest data in the access result is avoided.
Optionally, initiating an access operation for the data object to be accessed in the target block chain includes:
initiating a read operation for the data object to be accessed in a database where the block chain link points belong locally to a target block chain; alternatively, the first and second electrodes may be,
and initiating a target transaction request for accessing the data object to be accessed to a target block chain network.
In the above application, in each optional embodiment, a data object to be accessed in a target block chain is read in a local access manner or a target block chain access manner, so that data access manners are enriched.
Optionally, after initiating a target transaction request for accessing a data object to be accessed to a target block chain network, the method further includes:
executing the target transaction request to acquire a data value of the data object to be accessed from the block prohibited from rolling back in the target block chain as target access data, and executing access operation on the target access data; wherein the access operation comprises a read operation or a write operation.
In an optional implementation manner in the foregoing 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 block chain, so that an access manner and an access operation content of the chain access are further improved.
Optionally, initiating an access operation for a data object to be accessed in a block prohibited from rolling back in the target block chain, including:
initiating an access operation aiming at a data object to be accessed which is updated by a check point block in the target block chain; wherein blocks prior to the checkpoint block are prohibited from rolling back.
In an optional implementation manner of the foregoing application, by introducing the checkpoint block, validity of data stored in the block is differentiated, so that by accessing a data object to be accessed updated before the checkpoint block, it is ensured that the accessed data is not re-executed due to rollback operation, validity and stability of an access result are improved, and a foundation is laid for validity and stability of an execution result of a source transaction request. Meanwhile, the initiating mode of the access operation is improved.
Optionally, the method further includes:
taking the blocks with the set block number before the newest block in the target block chain as the check point blocks; alternatively, the first and second electrodes may be,
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 of the foregoing application, the check point block is determined according to the latest block and the number of set blocks, or the check point block is determined according to a consensus mechanism, so that the determination mechanism of the check point block is improved.
Optionally, determining that there is an access requirement of the data object to which the target blockchain belongs includes:
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 data level and chain level names, and the data identification further comprises contract level and network level names.
In an optional implementation manner in the above application, the determination of the access requirement of the data object to which the target intelligent contract belongs is performed according to the data identifier of the data object to be accessed, so that a determination mechanism of the access requirement is perfected. Meanwhile, the data objects are named through the data level names, the chain level names and further the contract level names and the network level names, and a foundation is laid for determining a target block chain to which the data objects belong based on the data identification.
Optionally, the source block chain and the target block chain belong to the same or different super-link networks.
In an optional implementation manner of the foregoing application, consistency between a source blockchain and a target blockchain is defined, and the data access method according to the present application is applied to an application scenario of cross-chain access in the same hyperchain network and an application scenario of cross-network access in different hyperchain networks, so that an application range of the data access method according to the present application is enriched.
Optionally, if the source block chain and the target block chain belong to different super-link networks, initiating an access operation for a data object to be accessed in a block prohibited from rolling back in the target block chain, including:
and the current block outlet node in the source block chain initiates a target transaction request for accessing the data object to be accessed to the trusted node in the super-link network where the target block chain is located.
In an optional implementation manner of the application, a target transaction request for accessing a data object to be accessed is initiated in a hyperchain network where a target block chain is located through a trusted node of a current block node in a source block chain under the condition of cross-network and cross-chain access, so that the reliability of a data access result is guaranteed.
Optionally, before initiating an access operation for a data object to be accessed in a block prohibited from rolling back in the target block chain, the method further includes:
and performing authority verification on the access requirement based on an authority control model deployed by the target block chain.
In an optional implementation manner of the foregoing application, the authority control model deployed by the target block chain is used to perform authority verification on the access requirement, so as to implement access authority control on the data object in the target block chain.
In a second aspect, an embodiment of the present application further provides a data access apparatus, configured to be configured at a block chain node, where at least two block chains are deployed in the block chain node, including:
a source transaction request obtaining module, configured to obtain a source transaction request initiated in a source block chain;
an access operation initiating module, configured to, in a process of executing the source transaction request, if it is determined that an access requirement of a data object to which a target block chain belongs exists, initiate an access operation for a data object to be accessed in a block prohibited from rolling back in the target block chain;
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 content of the first and second substances,
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute a data access method as provided in an embodiment of the first aspect.
In a fourth aspect, the present application further provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the data access method provided in the first aspect.
Other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a flow chart of a data access method according to a first embodiment of the present application;
FIG. 2 is a flowchart of a data access method according to a second embodiment of the present application;
FIG. 3 is a flowchart of a data access method in the 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 the data access method of the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those 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 one
Fig. 1 is a flowchart of a data access method according to an embodiment of the present application. The method and the device are suitable for the cross-chain access condition of the data objects to which different block chains belong in the super block chain network. In the blockchain system, intelligent contracts for realizing different functions can be deployed, each intelligent contract comprises a combination of programs, and set function processing is completed in the process of running the programs. The smart contract may involve generating some data and reading some data, such as user data, business data, etc., which may be referred to as data objects. Each intelligent contract can manage storage and read-write access of the data objects based on the set data storage model to form a data object set. Generally speaking, the data object sets between different intelligent contracts do not overlap and cannot access each other. When different intelligent 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 crossing block chains. 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 a blockchain node. The block link point is deployed with at least two block chains, that is, a system program and data, such as a communication mechanism, a consensus mechanism, and the like, deployed in the operation block chain.
A data access method as shown in fig. 1, comprising:
s101, acquiring a source transaction request initiated in a source block chain.
When a user has a service function requirement, a source transaction request for executing the service function is initiated in a source block chain; accordingly, the block link point receives and executes the source transaction request due to the deployment of the data of the active block chain.
S102, in the process of executing the source transaction request, if the access requirement of the data object to which the target block chain belongs is determined to exist, initiating an access operation aiming at the data object to be accessed in the block which is prohibited to roll back in the target block chain.
In the process of executing the source transaction request, if there is a case of performing auxiliary processing by using the data value of the data object stored in the target block chain, at this time, an access operation needs to be initiated for the target block chain to obtain an access result. When the access operation is performed on the data object to be accessed in the target block chain, because the data values of the data objects to be accessed in different blocks are different for the same data object to be accessed, possibly 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 block chain, due to the fluctuation of the communication capacity of the out-block node, the block is rolled back, and at this time, if the storage block of the data object to be accessed is rolled back, the value in the previous access result may be updated again due to the rolling back operation, and thus the change occurs.
In order to ensure the validity and the correctness of the data value of the data object to be accessed in the access result, the method and the device divide the blocks in the target block chain into the blocks prohibited from rolling back and the blocks not prohibited from rolling back in the running process of the target block chain, so as to distinguish the rolling back condition of the blocks in the target block chain. Correspondingly, when the access operation of the data object to be accessed is initiated, the access operation is initiated only aiming at the data object to be accessed in the block prohibited to roll back in the target block chain, so that the effectiveness of the acquired data value is ensured.
Wherein the block prohibited from rolling back may be a continuous or discontinuous block in the target block chain. It will be appreciated that to facilitate management of data for each block in the target block chain, typically the block for which rollback is prohibited is set as a contiguous block.
Illustratively, the rollback inhibited status of a block may be differentiated by marking the block. Optionally, the blocks that are prohibited from rolling back are marked differently from the blocks that are not prohibited from rolling back, for example, only the blocks that are prohibited from rolling back are marked.
In an optional implementation manner of the embodiment of the present application, a checkpoint (checkpoint) block mechanism may be further introduced, and is configured to mark a stored block in the target block chain, so that a block before the marked block is prohibited from rolling back. Wherein, the marked blocks are the checking point blocks.
Correspondingly, when it is determined that the access requirement of the data object to which the target blockchain belongs exists, an access operation is initiated for the data object to be accessed, which is updated before the check point block in the target blockchain, so that the latest data values of the data object to be accessed in the check point block and the block before the check point block can be obtained.
Optionally, the determining process of the checkpoint block may be implemented in the following manner: the block with the block number set before the newest block in the target block chain is used as the check point block. The set block number may be a specific value of the set block number agreed in the deployment data when the target block chain is created; the specific value of the block number may also be specified by a management node or a maintenance node of the block chain. Illustratively, the set number of tiles may be 5. Correspondingly, in the determination of the checking point blocks, the position of the checking point block at the current moment is determined according to the difference between the latest block and the set block number.
For example, the newest block of the target block chain is the [1000] th block, the number of blocks is set to be 5, and correspondingly, the [0995] th block is used as the check point block.
Alternatively, the determination process of the checkpoint block may be implemented as follows: and determining a check point block in the target block chain according to a consensus mechanism in the target block chain.
For example, the timing of the check point block determination may be determined randomly or specified according to a certain policy. It is understood that, in order to facilitate the normal operation and management of the target block chain, the checkpoint blocks in the target block chain are usually 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-of-block frequency of the block chain, e.g. every new block generated.
Optionally, the check point blocks and the non-check point blocks may be distinguished by establishing a hash table. For example, each blockchain node in the network deployed by the target blockchain can maintain a unified blockchain flag table in advance for each blockchain, so as to record whether each blockchain identifier is a check point blockor only record the blockchain identifier currently belonging to the check point blockor not. Accordingly, by looking up the block flag table, it is able to know which block the check point block in the target block chain is.
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 is specifically which checkpoint block may be obtained from a source transaction request; after determining the target block chain to which the data object to be accessed belongs, the local node queries and determines the current check point block of the target block chain from the block mark table of the locally stored target block chain; and the access address provided by the data object to be accessed in the source transaction request can be used as the address of the latest data. Alternatively, only access operations to the data objects to be accessed are initiated, and when cross-chain access is identified by a node of the target blockchain, then access operations to the most recent data prior to the checkpoint 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, the source transaction request is continuously executed according to the access result, so that a corresponding service function is provided for a user; and when the source block chain does not receive the access result within the set time period or learns that the access fails, rejecting the execution of the source transaction request and determining that the execution of the source transaction request fails. Further, the reason of the execution failure may also be fed back to the user together. The time length of the set time period may be determined when the deployment data of the blockchain is deployed.
For example, learning of access failure may be that, when performing an access operation on a data object to be accessed in a target block chain, an initiator of a source transaction request does not have an access right to the data object to be accessed in the target block chain.
Illustratively, before initiating the access operation, the access requirement can be subjected to authority verification based on an authority control model deployed by the target block chain; if the verification is successful, initiating an access operation 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, the permission verification of the access requirement based on the permission control model deployed by the target block chain may be: and verifying the data access authority of the initiator of the source transaction request according to an authority control table set when a target intelligent contract to which the data object to be accessed belongs is deployed in the target block chain.
The authority control table is used for controlling the calling authority of the user account to the target intelligent contract. The calling authority control strategy of the target intelligent contract is recorded in the authority control table: at least one of a threshold policy, an endorsement policy, and a fixed account policy. And authenticating the user account for calling the 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 policy is used for determining a calling authentication passing result according to the relationship between the sum of the weights of the authorized accounts contained in the source transaction request and a set calling threshold; the endorsement strategy is used for determining a calling authentication passing result according to the number or the proportion of the authorized accounts contained in the source transaction request; and the account strategy is used for determining the authentication passing result according to the relationship between the initiating user of the source transaction request and the preset authorization account or the preset access forbidding account. The authorized account is a user account with target intelligent contract invoking authority. The forbidden account is a user account without target intelligent contract invoking authority. When the target intelligent contract is deployed by different authorized accounts, corresponding calling weight values are preset. The authorized accounts, the forbidden accounts and the calling weight values of the authorized accounts can be adjusted by the contract management account of the target intelligent contract according to needs after the target intelligent contract is deployed.
Optionally, the authority control policy is invoked to authenticate a user account for invoking the target intelligent contract, where the authority control policy is: determining a sum of weights of authorized accounts contained in the source transaction request; if the sum is larger than the set calling threshold, the authentication is passed. Or alternatively, determining the number of authorized accounts contained in the source transaction request; if the number is larger than the set number threshold value, the authentication is passed. Or optionally, determining a proportion of authorized accounts contained in the source transaction request, and if the proportion is greater than a set proportion threshold, passing the authentication. Or optionally, determining whether the initiating user of the source transaction request is a preset authorization account or an associated account of the preset authorization account; if yes, the authentication is passed. Or optionally, determining whether the initiating user of the source transaction request is a preset banned account or an associated account of the preset banned account; if not, the authentication is passed. 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, in the execution process of the source transaction request, when the access requirement of the data object to which the target block chain belongs is met, the access operation is initiated for the data object to be accessed in the block which is prohibited from rolling back in the target block chain, so that the source transaction request is processed based on the access result, and the data sharing among different block chains is realized. In addition, by limiting the accessible data to the data in the block prohibited from rolling back, the situation that the block where the data in the access result is located is rolled back, so that the execution result of the source transaction request is wrong or needs to be rolled back for execution can be avoided, the validity and the stability of the access result are improved, and the validity and the stability of the execution result of the source transaction request are further improved. Meanwhile, under the condition of obtaining the access result, the source transaction request is continuously executed, so that 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 the 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 block chain belongs exists is refined into operation of determining that the data object to be accessed belongs to different block chains according to the data identifier of the data object to be accessed in the source transaction request, and then determining that the access requirement of the data object to which the target block chain belongs exists; wherein the data identification at least comprises names of a data level and a chain level, and the data identification further comprises names of a contract level and a network level, so as to complete 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 data level and chain level names, and the data identification further comprises contract level and network level names.
Illustratively, in the operation process of the block chain system, when data objects are stored, 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. Correspondingly, when accessing data in the block chain, a target block chain to which a data object to be accessed belongs can be determined according to the data identifier, or a super chain network to which the block chain belongs is further determined.
For example, a block chain root chain exists in the hyperchain network xuper, and a variable value corresponding to the variable user is stored in the root chain. User can name the variable user as the unique data identification of the variable in the blockchain system. Correspondingly, when the data object is accessed, the block chain root and/or the block network xupper to which the data object to be accessed belongs are determined through the data identifier "xuper.
It should be noted that, in order to ensure the uniqueness of the data object in the blockchain system and prevent the occurrence of data collision, in the blockchain system, the name of the intelligent contract is unique in the same blockchain; in the same block chain network, the name of a block chain is unique; in the same blockchain system, the network name of the super-chain is unique. In the actual application process, the hyperchain network can be maintained by different main bodies, so a uniform network name registration mechanism can be set in the blockchain system to ensure the uniqueness of the hyperchain network name. Illustratively, the network name of the super-link network can be determined by presetting a network name registration alliance and by means of offline negotiation of alliance members, and name distribution is carried out.
In an optional implementation manner of the embodiment of the present application, intelligent contracts that implement different functions are deployed in a blockchain system, and each intelligent contract may manage storage and read-write access of an associated data object based on a set data storage model, so that when a data object is stored, a contract-level name may also be added to a data identifier.
For example, a block chain root chain exists in the hyperchain network xuper, an intelligent contract account is deployed in the root chain, and a variable value corresponding to the variable user is stored in a database corresponding to the intelligent contract account. Then, the variable user can be named through xuper. Correspondingly, when the data object is accessed, the block chain root and/or the hyperlink network xuper to which the data object to be accessed belongs are determined through the data identifier xuper.
Correspondingly, in order to ensure the uniqueness of the data objects in the block chain system and prevent data collision, the names of the intelligent contracts are unique in the same block chain in the block chain system; in the same block chain network, the name of a block chain is unique; in the same blockchain system, the network name of the super-chain is unique.
Optionally, when a target block chain to which a data object to be accessed belongs and a source block chain initiating a source transaction request belong to the same hyperchain network, determining a cross-chain access requirement for storing the data object to which the target block chain belongs; and when the target block chain to which the data object to be accessed belongs and the source block chain which initiates the source transaction request belong to different hyperchain networks, determining the cross-network access requirement for storing the data object to which the target block chain belongs.
In order to ensure the accuracy and the reliability of the data access result, when the source block chain and the target block chain belong to different hyperchain networks, that is, when a cross-network access requirement exists, an access operation is initiated for a data object to be accessed in a block prohibited from rolling back in the target block chain, which may be: a current block outlet 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-link network where a target block chain is located; correspondingly, the current out-block node in the target block chain receives and executes the transaction request, so that the access operation is executed from the block which is prohibited from rolling back in the target block chain, and the access result is fed back to the current out-block node in the source block chain.
Illustratively, when at least two hyperchain networks exist in the blockchain system, in order to realize data sharing in different hyperchain networks, at least one blockchain node in one hyperchain network sets at least one trusted node in another hyperchain network.
Optionally, the trusted node may be determined according to at least one of communication capability, data calculation capability, and the number of retained coins of 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 normal operation of cross-network access in the blockchain system, update operations such as addition, deletion, and rewriting of the trusted nodes in the trusted node list can also be performed in real time or at regular time according to the operating conditions of the trusted nodes.
S203, if the access requirement of the data object to which the target block chain belongs is determined to exist, initiating an access operation aiming at the data object to be accessed in the block prohibited to roll back in the target block chain.
And 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, the access requirement determining operation is refined into the data identification of the data object to be accessed in the source transaction request, and the memory access requirement is determined to exist when the target block chain and the source block chain are determined to be different block chains. The data identification comprises the names of a data level and a chain level, so that a target block chain to which the data object to be accessed belongs can be positioned; meanwhile, the target block chain is compared with the source block chain to determine whether a cross-chain access requirement of the data is met, and under the condition that the cross-chain access requirement is met, a cross-chain access operation of executing the data is triggered, so that the application scene of data access is enriched. Further, a network level name is added in the data identifier, and whether the super-link networks to which the target block chain and the source block chain belong are the same or not is further determined, so that whether cross-network access requirements exist or not is determined, and when the cross-network access requirements exist, a cross-network access operation of data is executed, so that application scenarios of data access are further enriched. Furthermore, the contract level name can be added in the data identification, so that the intelligent contract to which the data object to be accessed belongs is determined, and a foundation is laid for the access based on the intelligent contract.
EXAMPLE III
Fig. 3 is a flowchart of a data access method in the 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 "initiating an access operation for the data object to be accessed in the block prohibited from rolling back in the target block chain" is refined to "initiating an 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 in the block prohibited from rolling back is updated; if so, access fails; otherwise, the access operation is executed and the access result is fed back, thereby perfecting the initiating mode of the access operation.
A data access method as shown in fig. 3, comprising:
s301, a source transaction request initiated in the source block chain is obtained.
S302, in the process of executing the source transaction request, if the access requirement of the data object to which the target block chain belongs is determined to exist, an access operation is initiated aiming at the data object to be accessed in the target block chain.
In an optional implementation manner of the embodiment of the present application, the initiating of the access operation for the data object to be accessed in the target block chain may be initiating a read operation for the data object to be accessed in a database where the block chain node is locally owned by the target block chain, so as to read a data value of the data object to be accessed in the target block chain and feed the read data value as an access result back to the source block chain of the source transaction request, so as to be used when executing the source transaction request.
Because of the cross access barrier of the data stored in different block chains, when the source transaction request is executed in the source block chain, the access operation cannot be directly executed from the data object in the target block chain. At this time, optionally, a read operation of the data object to be accessed needs to be performed from the target block chain by means of a bridge function (XuperBridge). Illustratively, a bridge function is called, and if the bridge function determines that the call type is local read, a read operation of the data object to be accessed is initiated in the database where the block link point is locally attributed to the target block chain.
The bridging function is deployed in the blockchain system and used for calling an intelligent contract in the blockchain network.
Illustratively, the intelligent contract in the source blockchain network may create a bridging instance based on a bridging module in the blockchain network, and implement the invocation of the bridging function by running the bridging instance.
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 where the block chain node is locally attributed to the target block chain, which may be by calling a bridge function to call the target intelligent contract to which the data object to be accessed belongs, thereby implementing the read operation of the data object to be accessed.
It can be understood that, after the data in the local database of the blockchain node is changed, the data stored by other nodes in the target blockchain network does not know the change, and therefore, the storage content of the corresponding data object is not updated based on the change, and the situation that the blockchain data stored by different blockchain nodes in the target blockchain network are different occurs, which violates the principle that the blockchain stored data is publicly and transparently traceable. Therefore, when the local access is performed on the data object to be accessed, only the read operation of the data object can be performed, and the write operation on the data object cannot be performed.
In order to ensure the traceability of the data access process in the target block chain, the access operation of the data object to be accessed can be initiated in a chain access mode. Wherein the access operation comprises a read operation or a write operation.
In an optional implementation manner of the embodiment of the present application, initiating an access operation for a data object to be accessed in the target block chain may be to initiate a target transaction request for accessing the data object to be accessed to a target block chain network, so that a block generation node in the target block chain executes the target transaction request, thereby obtaining a data value of the data object to be accessed as target access data from a block prohibited to be rolled back in the target block chain, and executing the access operation on the target access data; wherein the access operation comprises a read operation or a write operation.
When performing data access operations, the block link points at which the source transaction request is executed and the target transaction request is executed may be the same or different block chain nodes.
In order to obtain a data access result in time and improve data access efficiency, when the same super-link network performs cross-link access of data, that is, when a source block chain and a target block chain are different and belong to the same super-link network, a node where the source block chain and the target block chain are deployed at the same time may be used as a current block output node.
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 executing of the access operation on the data object to be accessed may be: and calling the bridging function, 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, executing the target transaction request by requesting the blockchain network, and executing the access operation on the data object to be accessed.
When the access operation comprises a read operation, reading a data object to be accessed, and feeding back a data value of the read data object to a source block chain to which a 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 into the target data value by calling the target intelligent contract. Where the source data value may be a default data value or a currently stored data value. The default data value is the content stored when no data is stored, and may be, for example, a null value. Of course, it is also possible to include only the target value of the write operation in the target transaction request, and the source data value may be determined by lookup.
In one embodiment, the call type is determined to be determined by a data access mode and an operation mode, and when the data access mode is local access and the operation mode is read operation, the call type is determined to be local read; otherwise, determining the calling type as non-local reading.
Illustratively, the access mode may be implemented by: the access mode is specified by a user, randomly determined, selected according to the execution time of the source transaction request, or determined according to a consensus mechanism in the block chain.
S303, if the access operation is a cross-chain access operation, judging whether the subsequent block of the data object to be accessed in the block prohibited from rolling back is updated or not.
Illustratively, if the access operation is a cross-chain access operation, it indicates that a data access operation needs to be performed on a data object to be accessed in a block prohibited from rolling back in the target block chain. At this time, if a subsequent block of the block whose rollback is prohibited is updated, when data access is performed on the data object to be accessed in the block whose rollback is prohibited, since the data read in the read operation has been updated or the data overwritten in the write operation has been updated in the write operation, the data access operation will become invalid access, which may affect the accuracy of the execution result of the source transaction request and the accuracy of the data stored in the target block chain.
In order to ensure the accuracy of the result of the source transaction request and the accuracy of the access result, before initiating the access operation, it is necessary to determine the update condition of the data object to be accessed in the subsequent block of the block prohibited from rolling back.
The determination of the cross-chain access operation can be determined according to the data identifier of the data object to be accessed in the source transaction request; and if the target block chain to which the data object to be accessed belongs is different from the source block chain, indicating that cross-chain access operation needs to be performed. The data identification comprises names of a data level and a chain level.
In an optional implementation manner of the embodiment of the present application, in the process of initiating an access operation for a data object to be accessed that is updated before a check point block in a target block chain, it may be determined whether the data object to be accessed is updated in a subsequent block of the check point block; if so, access fails; otherwise, executing the access operation and feeding back the access result. Wherein blocks prior to the check point block are prohibited from rolling back.
For example, whether the subsequent block of the data object to be accessed at the check point block is updated or not may be determined by sequentially traversing the blocks from the newest block in the target block chain, determining whether the block is the block before the check point block, and determining whether an update operation of the data object to be accessed exists.
The operation of determining the checkpoint block can refer to the foregoing embodiments, and is not described herein again.
S304, if yes, the access fails; otherwise, executing the access operation and feeding back an access result.
If the data object to be accessed is updated in the subsequent block of the block prohibited from rolling back, the access fails, and the subsequent execution operation of 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 operation of the source transaction request can be aborted, and the source transaction request is continuously executed when the data storage block with the latest updated data to be accessed is changed into the block which is prohibited from rolling back.
If the data object to be accessed is not updated in the subsequent block of the block prohibited from rolling back, it indicates that the data object to be accessed in the block prohibited from rolling back is the latest data in the target block chain, so that the accuracy of the accessed data can be ensured; since the storage block of the data object to be accessed is located in the rollback-prohibited block, the validity of the accessed data can be ensured. At this time, the access result may be fed back to the source block chain, so that the out-block node of the source block chain performs subsequent source transaction request execution operations according to the access result.
S305, if the access result is obtained, continuing to execute the source transaction request according to the access result.
The method comprises the steps that the initiating operation of the access operation is refined into the initiating operation of the access operation 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 in the block prohibited from rolling back is updated; if so, access fails; 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 subsequent blocks of the block prohibited from rolling back, so that the accuracy of the execution result of the source transaction request is guaranteed.
Example four
Fig. 4 is a structural diagram of a data access apparatus in a fourth embodiment of the present application, and the embodiment of the present application is applied to a cross-chain access situation of data objects to which different blockchains belong 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. At least two block chains are deployed at the block chain link node.
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 content of the first and second substances,
a source transaction request obtaining module 401, configured to obtain a source transaction request initiated in a source block chain;
an access operation initiating module 402, configured to, in a process of executing the source transaction request, if it is determined that there is an access requirement for a data object to which a target block chain belongs, initiate an access operation for a data object to be accessed in a block prohibited from rolling back in the target block chain;
an access result obtaining module 403, configured to, if an access result is obtained, continue to execute the source transaction request according to the access result.
In the embodiment of the application, a source transaction request initiated in a source block chain is acquired through a source transaction request acquisition module; in the process of executing the source transaction request, if the access requirement of the data object to which the target block chain belongs is determined to exist, an access operation is initiated for the data object to be accessed in the block prohibited from rolling back in the target block chain; and when the access result is obtained through the access result obtaining module, the source transaction request is continuously executed according to the access result. In the embodiment of the application, in the execution process of the source transaction request, when the access requirement of the data object to which the target block chain belongs is met, the access operation is initiated for the data object to be accessed in the block which is prohibited from rolling back in the target block chain, so that the source transaction request is processed based on the access result, and the data sharing among different block chains is realized. In addition, by limiting the accessible data to the data in the block prohibited from rolling back, the situation that the block where the data in the access result is located is rolled back, so that the execution result of the source transaction request is wrong or needs to be rolled back for execution can be avoided, the validity and the stability of the access result are improved, and the validity and the stability of the execution result of the source transaction request are further improved. Meanwhile, under the condition of obtaining the access result, the source transaction request is continuously executed, so that the waste of computing resources caused by unnecessary execution of the source transaction request is reduced.
Further, the apparatus also 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, when executing an access operation for a data object to be accessed in a block prohibited from rolling back in the target block chain, is specifically configured to:
initiating an access operation for a 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 in the block prohibited from rolling back is updated;
if so, access fails; otherwise, executing the access operation and feeding back an access result.
Further, when the access operation initiating module 402 is configured to initiate an access operation for the data object to be accessed in the target block chain, specifically:
initiating a read operation for the data object to be accessed in a database where the block chain link points belong locally to a target block chain; alternatively, the first and second electrodes may be,
and initiating a target transaction request for accessing the data object to be accessed to a target block chain network.
Further, the apparatus 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 block chain network, executing the target transaction request, so as to obtain a data value of the data object to be accessed from a block prohibited to roll back in the target block chain as target access data, and executing access operation on the target access data; wherein the access operation comprises a read operation or a write operation.
Further, the access operation initiating module 402, when executing an access operation for a data object to be accessed in a block prohibited from rolling back in the target block chain, is specifically configured to:
initiating an access operation aiming at a data object to be accessed which is updated by a check point block in the target block chain; wherein blocks prior to the checkpoint block are prohibited from rolling back.
Further, the apparatus further includes a checkpoint block determining module configured to:
taking the block with the set block number before the newest block in the target block chain as a check point block; alternatively, the first and second electrodes may be,
and determining a check point block in the target block chain according to a consensus mechanism in the target block chain.
Further, when determining that there is an access requirement for the data object to which the target blockchain belongs, the access operation initiating module 402 is specifically configured to:
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 data level and chain level names, and the data identification further comprises contract level and network level names.
Further, the source block chain and the target block chain belong to the same or different super-chain networks.
Further, if the source block chain and the target block chain belong to different super-link networks, the access operation initiating module 402, when executing an access operation for a data object to be accessed in a block prohibited from rolling back in the target block chain, is specifically configured to:
and the current block outlet node in the source block chain initiates a target transaction request for accessing the data object to be accessed to the trusted node in the super-link network where the target block chain is located.
Further, the apparatus further comprises a permission verification module, configured to:
and before initiating an access operation for the data object to be accessed in the block which is prohibited from rolling back in the target block chain, performing authority verification on the access requirement based on an authority control model deployed by the target block chain.
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 an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 5 is a block diagram of an electronic device implementing the data access method according to the embodiment of the present application. 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 phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 5, the electronic apparatus includes: one or more processors 501, memory 502, and interfaces for connecting the various 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 for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 5, one processor 501 is taken as an example.
Memory 502 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by 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 methods provided herein.
The memory 502, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the data access method in the embodiments of the present application (for example, the source transaction request acquisition module 401, the access operation initiation module 402, and the access result acquisition module 403 shown in fig. 4). 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 executing non-transitory software programs, instructions, and modules stored in the memory 502.
The memory 502 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of the electronic device implementing the data access method, and the like. Further, the 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 optionally includes 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, the memory 502, the input device 503 and the output device 504 may be connected by a bus or other means, and fig. 5 illustrates the connection by a bus as an example.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function control of an electronic apparatus implementing the data access method, such as an input device such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or the like. The output devices 504 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating 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 can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. 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 a pointing device (e.g., a mouse or a 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 can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end 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 back-end, 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 clients and servers. A client and server are generally 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, in the execution process of the source transaction request, when the access requirement of the data object to which the target block chain belongs is met, the access operation is initiated for the data object to be accessed in the block which is prohibited from rolling back in the target block chain, so that the source transaction request is processed based on the access result, and the data sharing among different block chains is realized. In addition, by limiting the accessible data to the data in the block prohibited from rolling back, the situation that the block where the data in the access result is located is rolled back, so that the execution result of the source transaction request is wrong or needs to be rolled back for execution can be avoided, the validity and the stability of the access result are improved, and the validity and the stability of the execution result of the source transaction request are further improved. Meanwhile, under the condition of obtaining the access result, the source transaction request is continuously executed, so that the waste of computing resources caused by unnecessary execution of the source transaction request is reduced.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (14)

1. A data access method performed by a block link point in which at least two block chains are deployed, 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 to which the target block chain belongs is determined to exist, initiating an access operation aiming at the data object to be accessed in the block which is prohibited 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.
2. The method of claim 1, further comprising:
if the access failure is known, determining that the execution of the source transaction request fails.
3. The method according to claim 1 or 2, wherein initiating an access operation for a data object to be accessed in a block of the target block chain for which rollback is prohibited comprises:
initiating an access operation for a 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 in the block prohibited from rolling back is updated;
if so, access fails; otherwise, executing the access operation and feeding back an 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 where the block chain link points belong locally to a target block chain; alternatively, the first and second electrodes may be,
and initiating a target transaction request for accessing the data object to be accessed to a target block chain network.
5. The method of claim 4, wherein after initiating a target transaction request to the target blockchain network for access to the data object to be accessed, further comprising:
executing the target transaction request to acquire a data value of the data object to be accessed from the block prohibited from rolling back in the target block chain as target access data, and executing access operation on the target access data; wherein the access operation comprises 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 block chain for which rollback is prohibited comprises:
initiating an access operation aiming at a data object to be accessed which is updated by a check point block in the target block chain; wherein blocks prior to the checkpoint block are prohibited from rolling back.
7. The method of claim 6, further comprising:
taking the block with the set block number before the newest block in the target block chain as a check point block; alternatively, the first and second electrodes may be,
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 determining that there is a need to access a data object to which the target blockchain belongs comprises:
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 data level and chain level names, and the data identification further comprises contract level and network level names.
9. The method of claim 8, wherein the source block chain and the target block chain belong to the same or different hyperchain networks.
10. The method according to claim 9, wherein if the source block chain and the target block chain belong to different hyperchain networks, initiating an access operation for a data object to be accessed in a block of the target block chain for which rollback is prohibited, comprises:
and the current block outlet node in the source block chain initiates a target transaction request for accessing the data object to be accessed to the trusted node in the super-link 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 block chain that is prohibited from rolling back, the method further comprises:
and performing authority verification on the access requirement based on an authority control model deployed by the target block chain.
12. A data access device configured to a block chain node, at least two block chains being disposed in the block chain node, comprising:
a source transaction request obtaining module, configured to obtain a source transaction request initiated in a source block chain;
an access operation initiating module, configured to, in a process of executing the source transaction request, if it is determined that an access requirement of a data object to which a target block chain belongs exists, initiate an access operation for a data object to be accessed in a block prohibited from rolling back in the target block chain;
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.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
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 claimed in any one of claims 1 to 11.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform a data access method as claimed in any one of claims 1 to 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 true CN111339114A (en) 2020-06-26
CN111339114B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286643A (en) * 2020-12-24 2021-01-29 北京百度网讯科技有限公司 Transaction processing method, device, equipment, program and medium of Etheng virtual machine
CN112306648A (en) * 2020-10-29 2021-02-02 平安科技(深圳)有限公司 Transaction calling method and device, electronic equipment and storage medium
US20210314138A1 (en) * 2020-04-07 2021-10-07 Baidu International Technology (Shenzhen) Co., Ltd. Transaction processing method, apparatus, device and system for multi-chain system

Citations (12)

* 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
US20180373776A1 (en) * 2017-04-12 2018-12-27 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability for Fast and Low-Cost Payment and Transaction Processing
US20190018887A1 (en) * 2017-04-12 2019-01-17 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability, Decentralization, and Security for Fast and Low-Cost Payment and Transaction Processing
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

Patent Citations (12)

* 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
US20180373776A1 (en) * 2017-04-12 2018-12-27 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability for Fast and Low-Cost Payment and Transaction Processing
US20190018887A1 (en) * 2017-04-12 2019-01-17 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability, Decentralization, and Security for Fast and Low-Cost Payment and Transaction Processing
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
T CAI,H J CAI,H WANG,X CHENG,L WANG: "Analysis of blockchain system with token-based bookkeeping method", 《IEEE》 *
李芳,李卓然,赵赫: "区块链跨链技术进展研究", 《软件学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210314138A1 (en) * 2020-04-07 2021-10-07 Baidu International Technology (Shenzhen) Co., Ltd. Transaction processing method, apparatus, device and system for multi-chain system
US11588618B2 (en) * 2020-04-07 2023-02-21 Baidu International Technology (Shenzhen) Co., Ltd. Transaction processing method, apparatus, device and system for multi-chain system
CN112306648A (en) * 2020-10-29 2021-02-02 平安科技(深圳)有限公司 Transaction calling method and device, electronic equipment and storage medium
CN112286643A (en) * 2020-12-24 2021-01-29 北京百度网讯科技有限公司 Transaction processing method, device, equipment, program and medium of Etheng virtual machine

Also Published As

Publication number Publication date
CN111339114B (en) 2023-05-09

Similar Documents

Publication Publication Date Title
CN111324425B (en) Data access method, device, equipment and storage medium
EP3622687B1 (en) Enclave pool management
US11290281B2 (en) Asset management method and apparatus, and electronic device
US11042876B2 (en) Transaction method and system based on centralized settlement and blockchain deposit certificates
CN110915166B (en) Block chain
AU2019221574B2 (en) Asset management system, method, apparatus, and electronic device
CN111741026B (en) Cross-chain transaction request processing method, device, equipment and storage medium
EP3622661B1 (en) Cryptlet identity
US20180365686A1 (en) Smart contract lifecycle management
EP3622433B1 (en) Enclave pool shared key
CN111630830A (en) Distributed blockchain data storage under account model
CN111400112B (en) Writing method and device of storage system of distributed cluster and readable storage medium
CN111782669B (en) Method and device for realizing distributed lock and electronic equipment
CN111352706A (en) Data access method, device, equipment and storage medium
US10884845B2 (en) Increasing processing capacity of processor cores during initial program load processing
CN111339114A (en) Data access method, device, equipment and storage medium
CN111339187A (en) Data processing method, device, equipment and storage medium based on intelligent contract
CN111339202B (en) Data access method, device, equipment and storage medium
US10884818B2 (en) Increasing processing capacity of virtual machines
CN111316256A (en) Taking snapshots of blockchain data
US10127270B1 (en) Transaction processing using a key-value store
US20160072923A1 (en) Client system communication with a member of a cluster of server systems
KR102454665B1 (en) Resource processing method and device for block chain, equipment and medium
CN110765210B (en) Authentication method, device, equipment and medium based on block chain
CN111858089A (en) Method and device for calling Ether house node

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