CN111131438A - Method and apparatus for accessing block chains - Google Patents

Method and apparatus for accessing block chains Download PDF

Info

Publication number
CN111131438A
CN111131438A CN201911328438.1A CN201911328438A CN111131438A CN 111131438 A CN111131438 A CN 111131438A CN 201911328438 A CN201911328438 A CN 201911328438A CN 111131438 A CN111131438 A CN 111131438A
Authority
CN
China
Prior art keywords
block chain
target
blockchain
server
node
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
CN201911328438.1A
Other languages
Chinese (zh)
Other versions
CN111131438B (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 Tongbang Zhuoyi Technology Co Ltd
Original Assignee
Beijing Tongbang Zhuoyi 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 Tongbang Zhuoyi Technology Co Ltd filed Critical Beijing Tongbang Zhuoyi Technology Co Ltd
Priority to CN201911328438.1A priority Critical patent/CN111131438B/en
Publication of CN111131438A publication Critical patent/CN111131438A/en
Application granted granted Critical
Publication of CN111131438B publication Critical patent/CN111131438B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • 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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

Embodiments of the present disclosure disclose methods and apparatus for accessing a blockchain. One embodiment of the method comprises: receiving a block chain data operation request sent by a target server, wherein the target server corresponds to a node in the block chain; selecting a node corresponding to the target server from the nodes of the block chain as a target node, wherein the block chain comprises sub chains with data isolated from each other; and calling the intelligent contract matched with the block chain data operation request on the target node. The implementation method improves the overall processing efficiency of the block chain and reduces the data security risk of each participant of the block chain.

Description

Method and apparatus for accessing block chains
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method and an apparatus for accessing a block chain.
Background
With the increasing development of internet technology, the block chain is used as a distributed shared account book and a database, and has the characteristics of decentralization, no tampering, trace leaving in the whole process, traceability, collective maintenance, public transparency and the like. Depending on the development object of the blockchain, the blockchain can be generally divided into three categories: public, private, and federation chains.
At present, with the increase of the demand for an honest and reliable transaction environment, the blockchain technology is increasingly applied to the financial fields of payment clearing, bills, insurance and the like and the entity economic fields of supply chain management, industrial internet, product traceability, copyright, energy and the like.
Disclosure of Invention
Embodiments of the present disclosure propose methods and apparatuses for accessing a blockchain.
In a first aspect, an embodiment of the present disclosure provides a method for accessing a blockchain, the method including: receiving a block chain data operation request sent by a target server, wherein the target server corresponds to a node in a block chain; selecting a node corresponding to a target server from the nodes of the block chain as a target node, wherein the block chain comprises sub chains with data isolated from each other; and calling an intelligent contract matched with the block chain data operation request on the target node.
In some embodiments, selecting a node corresponding to the target server from the nodes of the blockchain as the target node includes: extracting the identity information of a target server from the block chain data operation request; carrying out identity verification according to the identity information; and in response to determining that the target server passes the identity verification, selecting a node corresponding to the target server from the nodes of the block chain as a target node.
In some embodiments, the method further comprises: acquiring data isolation information, wherein the data isolation information is used for indicating the data sharing condition between nodes of a block chain; and constructing at least one sub-chain based on the nodes of the block chain according to the data isolation information.
In some embodiments, the above block chain data operation request is obtained by: a target server receives a request for a block chain operation, which is sent by a server which does not have a corresponding relation with nodes in a block chain; according to the request aiming at the block chain operation, the target server generates a block chain data operation request; and the target server side sends a block chain data operation request.
In a second aspect, an embodiment of the present disclosure provides an apparatus for accessing a blockchain, the apparatus including: the receiving unit is configured to receive a block chain data operation request sent by a target service end, wherein the target service end corresponds to a node in a block chain; the selecting unit is configured to select a node corresponding to a target server from nodes of a blockchain as a target node, wherein the blockchain comprises sub-chains with data isolated from each other; and the calling unit is configured to call the intelligent contract matched with the block chain data operation request on the target node.
In some embodiments, the selecting unit may include: the extraction module is configured to extract the identity information of the target server from the blockchain data operation request; the verification module is configured to perform identity verification according to the identity information; a selecting module configured to select a node corresponding to the target server from the nodes of the blockchain as a target node in response to determining that the target server passes the identity check.
In some embodiments, the apparatus further comprises: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire data isolation information, and the data isolation information is used for indicating data sharing conditions among nodes of a block chain; a construction unit configured to construct at least one child chain based on nodes of the blockchain according to the data isolation information.
In some embodiments, the above block chain data operation request is obtained by: a target server receives a request for a block chain operation, which is sent by a server which does not have a corresponding relation with nodes in a block chain; according to the request aiming at the block chain operation, the target server generates a block chain data operation request; and the target server side sends a block chain data operation request.
In a third aspect, an embodiment of the present disclosure provides a system for accessing a blockchain, the system including: a target server configured to receive a request for a blockchain operation, wherein the target server corresponds to a node in the blockchain; generating a block chain data operation request according to the request aiming at the block chain operation; sending a block chain data operation request to a gateway; a gateway configured to implement the method as described in any one of the implementations of the first aspect; a target node configured to execute an intelligent contract matching the blockchain data operation request.
In some embodiments, the system further comprises: and the peripheral server is configured to send a request for the block chain operation to the target server, wherein the peripheral server does not have a corresponding relation with the nodes in the block chain.
In some embodiments, the system further comprises: the target client is configured to respond to the detection of the target operation of the user and generate a request for the block chain operation, which is matched with the target operation; and sending a request for the blockchain operation to a target server.
In a fourth aspect, an embodiment of the present disclosure provides a server, including: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, which when executed by a processor implements the method as described in any of the implementations of the first aspect.
The method and the device for accessing the block chain provided by the embodiment of the disclosure firstly receive a block chain data operation request sent by a target server. And the target service end corresponds to a node in the block chain. And then, selecting a node corresponding to the target service end from the nodes of the block chain as a target node. The block chain comprises sub chains with data isolated from each other. And finally, calling an intelligent contract matched with the block chain data operation request on the target node. Therefore, the high efficiency of the block chain is ensured, and the service request of the server can be executed. In addition, the data security risk of each participant of the block chain is reduced by arranging the sub-chains with mutually isolated data on the block chain. Moreover, the gateway executes the method for accessing the block chain, so that the interaction between the service system of each server and the block chain network is realized, and the development, operation and maintenance of each system are facilitated.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a method for accessing a blockchain, according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a method for accessing a blockchain in accordance with an embodiment of the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a method for accessing a blockchain according to the present disclosure;
FIG. 5 is a block diagram of one embodiment of an apparatus for accessing a blockchain according to the present disclosure;
FIG. 6 is a timing diagram of interactions between various devices in one embodiment of a method for accessing a blockchain according to the present disclosure.
FIG. 7 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary architecture 100 to which the method for accessing a blockchain or the apparatus for accessing a blockchain of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include end devices 101, 102, 103, networks 104, 106, 108, a server 105, a gateway 107, and a blockchain 109 (including nodes 1091, 1092, 1093). The networks 104, 106, 108 are used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105, between the server 105 and the gateway 107, and between the gateway 107 and the blockchain, respectively. The networks 104, 106, 108 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 101, 102, 103 interact with a server 105 via a network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting communication, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 and the nodes 1091, 1092, 1093 of the blockchain 109 may be servers that provide various services. The server 105 may be, for example, a background server providing support for client applications displayed on the terminal devices 101, 102, 103.
Gateway 107 may provide support for protocol translation, etc. for information transfer between network 106 and network 108. The nodes 1091, 1092, 1093 of the blockchain 109 may be, for example, servers of organizations to which the federation chain corresponds. The gateway 107 may analyze and process the received blockchain data operation request of the backend server 105, and feed back a processing result (e.g., request response information) to the backend server 105.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the method for accessing the blockchain provided by the embodiment of the present disclosure is generally performed by the gateway 107, and accordingly, the apparatus for accessing the blockchain is generally disposed in the gateway 107.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, servers, gateways, and blockchains, as desired for an implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for accessing a blockchain is shown in accordance with the present disclosure. The method for accessing a blockchain comprises the following steps:
step 201, a block chain data operation request sent by a target server is received.
In this embodiment, an execution subject (such as the gateway 107 shown in fig. 1) of the method for accessing the blockchain may receive the blockchain data operation request sent by the target server in a wired connection manner or a wireless connection manner. The target server may correspond to a node in the block chain. The target server can be any server which is pre-designated according to the actual application requirement. The target server may also be a server determined according to a rule, such as a background server of an organization party participating in a federation chain. As an example, in an asset securitization flow, the above-mentioned service may include, but is not limited to, at least one of: the system comprises a server corresponding to a terminal used by a ticket holder, a server corresponding to a terminal used by a plan manager, a background server of a fund escrow mechanism, a background server of an investment mechanism and a background server of a supervision mechanism. The target server can be selected from the servers.
In this embodiment, the above-mentioned blockchain data operation request may include various requests for operations performed by the blockchain. As an example, the above-described blockchain data operation request may include a data query request. As yet another example, the above block chain operation request may include a data uplink request.
In some optional implementations of this embodiment, the above block chain data operation request may be obtained through the following steps:
firstly, a target server receives a request for a block chain operation, which is sent by a server which does not have a corresponding relation with nodes in the block chain.
In these implementations, the target server may receive, through a wired or wireless connection, a request for a blockchain operation, where the request is sent by a server that does not have a correspondence relationship with a node in a blockchain. The server that does not have a correspondence relationship with the node in the blockchain may include a background server of a party other than the party participating in the blockchain, for example, a background server of an organization other than the party participating in the alliance chain. As an example, in the asset securitization process, the above-mentioned server having no correspondence relationship with the node in the blockchain may include, but is not limited to, at least one of the following: the system comprises a background server of a rating mechanism, a background server of a law firm and a background server of an accounting firm. According to the business process, the target server can be a server corresponding to a terminal used by a plan manager.
And step two, according to the request aiming at the block chain operation, the target server generates a block chain data operation request.
In these implementations, the target server may generate the blockchain data operation request in various ways according to the request for the blockchain operation received in the first step. As an example, the target server may repackage the received request for blockchain operation to generate the blockchain data operation request.
And thirdly, the target server side sends a block chain data operation request.
In these implementations, the target server may send the blockchain data operation request generated in the second step to the execution main body of the method for accessing the blockchain.
Based on the alternative implementations described above. The server that does not have a correspondence relationship with the node in the blockchain may operate the data in the blockchain in a proxy manner through the target server. Therefore, on one hand, the safety of data on the blockchain can be guaranteed, and on the other hand, the transaction processing efficiency is improved by reducing the number of nodes on the blockchain.
Step 202, select a node corresponding to the target server from the nodes of the blockchain as a target node.
In this embodiment, the execution main body may select a node corresponding to the target server from the nodes of the blockchain in various manners, and use the selected node as the target node. The block chain may include sub-chains with data isolated from each other. In practice, taking a blockchain based on hyperlenger Fabric as an example, the sub-chains with data isolated from each other may be implemented by establishing channels (channels) between nodes of the blockchain.
In this embodiment, the target server may generally correspond to a node in the block chain. The execution main body can select the node corresponding to the target server according to the corresponding relation. As an example, the target server may be a backend server of a funds escrow institution. Therefore, the execution main body can select a node corresponding to the fund escrow mechanism background server from the block chain as a target node.
In some optional implementation manners of this embodiment, the execution main body may select a node corresponding to the target server from the nodes of the block chain as the target node according to the following steps:
firstly, extracting the identity information of a target server from the block chain data operation request.
In these implementations, the execution principal may extract the identity information of the target server from the blockchain data operation request in various ways. Generally, the above-mentioned blockchain data operation request may include identity information for identifying the identity of the sender of the request. The identity information may include, but is not limited to, an IP (Internet Protocol) address, a MAC (Media Access Control) address, and the like.
And secondly, performing identity verification according to the identity information.
In these implementations, the executing entity may perform identity verification in various ways according to the identity information of the target client extracted in the first step. As an example, the execution subject may match the identity information of the target client with an identity in a preset identity information base. The execution subject may determine whether the identity check is passed according to whether the identity information identical to the identity information exists in the preset identity information base.
And thirdly, in response to the fact that the target server passes the identity verification, selecting a node corresponding to the target server from the nodes of the block chain as a target node.
In these implementations, in response to determining that the target server passes the identity check, the execution principal may select a node corresponding to the target server from the nodes of the blockchain as the target node by using a method consistent with the foregoing method.
Step 203, calling an intelligent contract matched with the block chain data operation request on the target node.
In this embodiment, the execution subject may call an intelligent contract matching the blockchain data operation request on the target node to execute an operation corresponding to the blockchain data operation request. The intelligent contract may be oriented to all nodes in the block chain, or to a specific number of nodes in the block chain. Therefore, the target node can correspond to a plurality of intelligent contracts. The execution main body may first select an intelligent contract matched with the block chain data operation request from at least one intelligent contract corresponding to the target node, and then call the selected intelligent contract. As an example, the blockchain data operation request may include a data uplink request or a data query request. The matched intelligent contract can be a program for data chaining or data query, respectively.
In some optional implementation manners of this embodiment, based on that the block chain data operation request includes a data query request, the execution main body may continue to perform the following steps:
the first step is to receive data response information which is sent by a target node and matched with a data query request.
In these implementations, after the intelligent contract matching the blockchain data operation request is executed, the target node may further send data response information matching the data query request to the execution main body. The data response information may include a query result of the data to be queried indicated by the data query request. The execution main body can receive data response information which is sent by the target node and matched with the data query request in a wired or wireless connection mode.
And secondly, sending data response information to the target server.
In these implementations, the execution main body may further send the data response information matched with the data query request received in the first step to the target server, so as to complete the block chain data query.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of a method for accessing a blockchain according to an embodiment of the present disclosure. FIG. 3 illustrates the interaction of the participants applied to an asset securitization scenario. In the application scenario of fig. 3, the parties to the blockchain 300 described above may include a ticket holder party 301, a plan administrator party 302, a funds escrow authority 303, a regulatory authority 304, an investment authority 305. The ticket holder 301 may specifically include a client 3011, a background server 3012 corresponding to the client 3011, a gateway 3013, and a block link point 3014. The specific configuration architecture of other participants in the blockchain 300 may be consistent with that of the ticket holder 301, including the client, the server, the gateway, and the blockchain node, which is not described herein again (not shown in fig. 3).
In the block chain 300, sub-chains whose data are isolated from each other may be formed between nodes corresponding to the ticket holder 301, the plan manager 302, the fund escrow mechanism 303, the supervisor 304, and the investment institution 305 according to the fund plan. Alternatively, ratings authority 3021, law firm 3022, and accounting firm 3023 do not typically belong to the parties to the blockchain 300 described above. However, the subjects such as the rating agency 3021, the law firm 3022, and the accounting firm 3023 may participate in the block chain 300 in an agent manner through the plan manager 302.
During the issuance period, the ticket holder may interact with the client 3011 (e.g., click a data upload button on an interface to upload the underlying asset data). The server 3012 corresponding to the client 3011 used by the ticket holder may send a blockchain data operation request for uploading the basic asset data to the blockchain 300 to the gateway 3013. The gateway 3013 may select a node 3014 corresponding to the server 3012 from the blockchain 300 as a target node. The gateway 3013 may then invoke an intelligent contract on the node 3014 that matches the blockchain data operation request to upload the underlying asset data to each corresponding node in the blockchain 300. Optionally, the plan manager 302, the fund escrow institution 303, the regulatory agency 304, and the investment institution 305 may also complete the uplink or inquiry operation of the corresponding data (e.g., plan specification, escrow report, regulatory data, etc.) in the release period and the storage period by a method similar to the method described above.
Currently, one of the prior arts is to write related data directly into the blockchain system through multiple SPV (special purpose company) terminals. Since the multi-agent is directly used as a participant of the block chain, the overall processing efficiency of the block chain is not high. The method provided by the embodiment of the present disclosure, through the corresponding relationship between the server and the link points of the block, not only ensures higher efficiency of the block chain by limiting the number of nodes, but also can execute the service request of the server. And moreover, the sub-chains with mutually isolated data are arranged on the block chain, so that the data security risk of each participant of the block chain is reduced. In addition, the gateway executes the method for accessing the block chain, so that the interaction between the service system of each server and the block chain network is realized, and the development, operation and maintenance of each system are facilitated.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for accessing a blockchain is shown. The flow 400 of the method for accessing a blockchain includes the steps of:
step 401, data isolation information is obtained.
In this embodiment, an execution subject (for example, the gateway 107 shown in fig. 1) of the method for accessing the blockchain may acquire the data isolation information through a wired connection manner or a wireless connection manner. The data isolation information may be used to indicate a data sharing condition between nodes of the block chain. As an example, the data isolation information may include a resource management plan.
Step 402, according to the data isolation information, at least one sub chain is constructed based on the nodes of the block chain.
In this embodiment, the execution subject may construct at least one sub-chain based on nodes of the block chain in various ways according to the data isolation information obtained in step 401. Specifically, the execution body may divide the nodes that can share data into the same sub-chain and divide the nodes that cannot share data into different sub-chains according to the data sharing condition between the nodes of the block chain indicated in the data isolation information. It is understood that a sub-chain may include multiple nodes, and the same node may belong to multiple sub-chains. As an example, the execution subject may establish a channel between nodes on the blockchain corresponding to the related participants according to the acquired resource management plan to form at least one sub-chain.
Step 403, receiving a block chain data operation request sent by the target server.
Step 404, select a node corresponding to the target server from the nodes of the blockchain as a target node.
Step 405, calling an intelligent contract matched with the block chain data operation request on the target node.
Step 403, step 404, and step 405 are respectively consistent with step 201, step 202, step 203, and their optional implementations in the foregoing embodiments, and the above description on step 201, step 202, step 203, and their optional implementations also applies to step 403, step 404, and step 405, which is not described herein again.
As can be seen from fig. 4, a flow 400 of the method for accessing a blockchain in the present embodiment represents a step of constructing at least one sub-chain of the blockchain according to the acquired data isolation information. Therefore, the scheme described in this embodiment can meet the data isolation requirements for different organizations in different service scenarios by setting the sub-chains with mutually isolated data on the blockchain, thereby improving the security of the data on the blockchain on the basis of meeting the application scenarios of different data isolation.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an apparatus for accessing a block chain, which corresponds to the method embodiment shown in fig. 2, and which may be applied in various electronic devices in particular.
As shown in fig. 5, the apparatus 500 for accessing a block chain provided in this embodiment includes a receiving unit 501, a selecting unit 502, and a calling unit 503. The receiving unit 501 is configured to receive a block chain data operation request sent by a target server, where the target server corresponds to a node in a block chain; a selecting unit 502 configured to select a node corresponding to a target server from nodes of a blockchain as a target node, wherein the blockchain includes sub-chains with data isolated from each other; a calling unit 503 configured to call an intelligent contract matching the blockchain data operation request on the target node.
In the present embodiment, in the apparatus 500 for accessing a block chain: the specific processing of the receiving unit 501, the selecting unit 502, and the invoking unit 503 and the technical effects thereof can refer to the related descriptions of step 201, step 202, and step 203 in the corresponding embodiment of fig. 2, which are not repeated herein.
In some optional implementations of the present embodiment, the selecting unit 502 may include an extracting module (not shown in the figure), a verifying module (not shown in the figure), and a selecting module (not shown in the figure). The extracting module may be configured to extract the identity information of the target server from the blockchain data operation request. The verification module may be configured to perform identity verification according to the identity information. The selecting module may be configured to select a node corresponding to the target server from the nodes of the blockchain as the target node in response to determining that the target server passes the identity check.
In some optional implementations of this embodiment, the apparatus 500 for accessing a block chain may further include: an acquisition unit (not shown in the figure), a construction unit (not shown in the figure). Wherein the obtaining unit may be configured to obtain the data isolation information. The data isolation information may be used to indicate a data sharing condition between nodes of the block chain. The building unit may be configured to build at least one child chain based on nodes of the blockchain according to the data isolation information.
In some optional implementations of this embodiment, the above block chain data operation request may be obtained through the following steps: a target server receives a request for a block chain operation, which is sent by a server which does not have a corresponding relation with nodes in a block chain; according to the request aiming at the block chain operation, the target server generates a block chain data operation request; and the target server side sends a block chain data operation request.
The apparatus provided in the above embodiment of the present disclosure receives, through the receiving unit 501, a block chain data operation request sent by a target server. And the target service end corresponds to a node in the block chain. Then, the selecting unit 502 selects a node corresponding to the target server from the nodes of the blockchain as a target node. The block chain comprises sub chains with data isolated from each other. Finally, the calling unit 503 calls the intelligent contract matched with the blockchain data operation request on the target node. Therefore, the high efficiency of the block chain is ensured, and the service request of the server can be executed. In addition, the data security risk of each participant of the block chain is reduced by arranging the sub-chains with mutually isolated data on the block chain. Moreover, the gateway executes the method for accessing the block chain, so that the interaction between the service system of each server and the block chain network is realized, and the development, operation and maintenance of each system are facilitated.
With further reference to fig. 6, a timing sequence 600 of interactions between various devices in one embodiment of a method for accessing a blockchain is illustrated. The system for processing transactions may include: a target server (e.g., server 105 shown in FIG. 1), a gateway (e.g., gateway 107 shown in FIG. 1), a target node (e.g., node 1091 shown in FIG. 1). The target server can be configured to receive a request for a blockchain operation; generating a block chain data operation request according to the request aiming at the block chain operation; and sending a block chain data operation request to the gateway. The target server may correspond to a node in the block chain. The gateway described above may be configured to implement the method for accessing a blockchain as described in the previous embodiments. The target node may be configured to execute an intelligent contract matching the blockchain data operation request.
In some optional implementation manners of this embodiment, the system may further include a peripheral server. The peripheral server may be configured to send a request for a blockchain operation to the target server. The peripheral server may not have a corresponding relationship with a node in the block chain. As an example, the peripheral servers may include a background server corresponding to a main body such as a rating authority 3021, a law office 3022, and an accounting office 3023 shown in fig. 3.
In some optional implementations of this embodiment, the system may further include a target client (e.g., the terminals 101, 102, 103 shown in fig. 1) configured to generate, in response to detecting a target operation of the user, a request for a blockchain operation that matches the target operation; and sending a request for the blockchain operation to a target server.
As shown in fig. 6, in step 601, the target server receives a request for a blockchain operation.
In this embodiment, the target server may receive a request for a blockchain operation in various ways. The target server may correspond to a node in the block chain. As an example, the target server may receive a request for a blockchain operation sent by the peripheral server. As yet another example, the target server may receive a request for blockchain operations sent by the target client and generated based on the target operations of the user. The target operation of the user may be used to instruct to perform an operation on the block chain data, for example, to click "upload data".
In step 602, the target server generates a block chain data operation request according to the request for block chain operation.
In this embodiment, according to the request for the blockchain operation received in the first step, the target server may generate a blockchain data operation request in various ways. As an example, the target server may repackage the received request for blockchain operation to generate the blockchain data operation request.
In step 603, the target server sends a block chain data operation request to the gateway.
In this embodiment, the target server may send the blockchain data operation request generated in step 603 to the gateway.
In step 604, the gateway receives the blockchain data operation request sent by the target server.
In step 605, the gateway selects a node corresponding to the target server from the nodes of the blockchain as a target node.
In step 606, the gateway invokes an intelligent contract on the target node that matches the blockchain data operation request.
Step 604, step 605 and step 606 are respectively consistent with step 201, step 202 and step 203 in the foregoing embodiment and their optional implementations, and the above description on step 201, step 202 and step 203 and their optional implementations also applies to step 604, step 605 and step 606, which is not described herein again.
In step 607, the target node executes the intelligent contract that matches the blockchain data operation request.
In this embodiment, the target node may execute the intelligent contract matched with the blockchain data operation request called in step 606, and generate an execution result.
In some optional implementations of this embodiment, the target node may further send the generated execution result (e.g., data to be queried) to the gateway.
In the system for accessing a blockchain provided by the above-mentioned embodiment of the present application, first, a target server receives a request for a blockchain operation. And then, according to the request aiming at the block chain operation, the target service terminal generates and sends a block chain data operation request to the gateway. Next, the gateway receives a blockchain data operation request sent by the target server. Then, the gateway selects a node corresponding to the target server from the nodes of the block chain as a target node; and calling an intelligent contract matched with the block chain data operation request on the target node. Finally, the target node executes the intelligent contract matched with the block chain data operation request. Therefore, data access to the block chain is completed through interaction between each server and the block chain node. And the service end system and the block chain network are isolated through the gateway, so that the interaction between the service system of each service end and the block chain network is realized, and the development, operation and maintenance of the respective systems are facilitated.
Referring now to fig. 7, a schematic diagram of an electronic device (e.g., gateway server 107 of fig. 1) 700 suitable for use in implementing embodiments of the present disclosure is shown. The server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a keyboard, mouse, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the server; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: receiving a block chain data operation request sent by a target server, wherein the target server corresponds to a node in a block chain; selecting a node corresponding to a target server from the nodes of the block chain as a target node, wherein the block chain comprises sub chains with data isolated from each other; and calling an intelligent contract matched with the block chain data operation request on the target node.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor comprises a receiving unit, a selecting unit and a calling unit. The names of these units do not form a limitation to the unit itself under certain circumstances, for example, the receiving unit may also be described as a unit for receiving a blockchain data operation request sent by a target server, where the target server corresponds to a node in a blockchain.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A method for accessing a blockchain, comprising:
receiving a block chain data operation request sent by a target server, wherein the target server corresponds to a node in the block chain;
selecting a node corresponding to the target server from the nodes of the block chain as a target node, wherein the block chain comprises sub-chains with mutually isolated data;
and calling an intelligent contract matched with the block chain data operation request on the target node.
2. The method of claim 1, wherein the selecting a node corresponding to the target server from the nodes of the block chain as a target node comprises:
extracting the identity information of the target server from the block chain data operation request;
carrying out identity verification according to the identity information;
and in response to determining that the target server passes the identity verification, selecting a node corresponding to the target server from the nodes of the block chain as a target node.
3. The method of claim 1, wherein the method further comprises:
acquiring data isolation information, wherein the data isolation information is used for indicating the data sharing condition between nodes of a block chain;
and constructing at least one sub-chain based on the nodes of the block chain according to the data isolation information.
4. The method of any of claims 1-3, wherein the blockchain data operation request is obtained by:
the target server receives a request for the block chain operation, which is sent by a server which does not have a corresponding relation with the nodes in the block chain;
according to the request aiming at the block chain operation, the target server generates the block chain data operation request;
and the target server side sends the block chain data operation request.
5. An apparatus for accessing a blockchain, comprising:
the receiving unit is configured to receive a block chain data operation request sent by a target service end, wherein the target service end corresponds to a node in the block chain;
a selecting unit configured to select a node corresponding to the target server from nodes of the block chain as a target node, wherein the block chain includes sub-chains with data isolated from each other;
and the calling unit is configured to call the intelligent contract matched with the block chain data operation request on the target node.
6. A system for accessing a blockchain, comprising:
a target server configured to receive a request for a blockchain operation, wherein the target server corresponds to a node in the blockchain; generating a block chain data operation request according to the request aiming at the block chain operation; sending the block chain data operation request to a gateway;
the gateway configured to implement the method of any one of claims 1-4;
the target node is configured to execute an intelligent contract matched with the blockchain data operation request.
7. The system of claim 6, wherein the system further comprises:
a peripheral server configured to send a request for the blockchain operation to the target server, wherein the peripheral server does not have a correspondence with a node in the blockchain.
8. The system of claim 6, wherein the system further comprises:
the target client is configured to respond to the detection of the target operation of the user and generate a request for the block chain operation matched with the target operation; and sending the request for the block chain operation to the target server.
9. A server, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201911328438.1A 2019-12-20 2019-12-20 Method and apparatus for accessing block chains Active CN111131438B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911328438.1A CN111131438B (en) 2019-12-20 2019-12-20 Method and apparatus for accessing block chains

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911328438.1A CN111131438B (en) 2019-12-20 2019-12-20 Method and apparatus for accessing block chains

Publications (2)

Publication Number Publication Date
CN111131438A true CN111131438A (en) 2020-05-08
CN111131438B CN111131438B (en) 2023-04-07

Family

ID=70500834

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911328438.1A Active CN111131438B (en) 2019-12-20 2019-12-20 Method and apparatus for accessing block chains

Country Status (1)

Country Link
CN (1) CN111131438B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108564353A (en) * 2018-04-27 2018-09-21 数字乾元科技有限公司 Payment system based on block chain and method
CN108876403A (en) * 2018-05-31 2018-11-23 北京京东尚科信息技术有限公司 For obtaining the methods, devices and systems of information
CN109191108A (en) * 2018-08-07 2019-01-11 广东蓝蜜蜂信息技术有限公司 Two dimensional code polymerization payment system and its working method based on block chain
CN109873861A (en) * 2019-01-11 2019-06-11 平安科技(深圳)有限公司 The exchange method and device, storage medium and electronic equipment of transregional piece of chain node
CN110084059A (en) * 2019-03-21 2019-08-02 深圳壹账通智能科技有限公司 A kind of method, apparatus and computer equipment of banking system data configuration block chain
CN110135844A (en) * 2019-04-28 2019-08-16 阿里巴巴集团控股有限公司 Credit record, querying method and device and electronic equipment based on block chain
CN110310203A (en) * 2019-06-21 2019-10-08 普洛斯科技(重庆)有限公司 A kind of block chain method of commerce and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108564353A (en) * 2018-04-27 2018-09-21 数字乾元科技有限公司 Payment system based on block chain and method
CN108876403A (en) * 2018-05-31 2018-11-23 北京京东尚科信息技术有限公司 For obtaining the methods, devices and systems of information
CN109191108A (en) * 2018-08-07 2019-01-11 广东蓝蜜蜂信息技术有限公司 Two dimensional code polymerization payment system and its working method based on block chain
CN109873861A (en) * 2019-01-11 2019-06-11 平安科技(深圳)有限公司 The exchange method and device, storage medium and electronic equipment of transregional piece of chain node
CN110084059A (en) * 2019-03-21 2019-08-02 深圳壹账通智能科技有限公司 A kind of method, apparatus and computer equipment of banking system data configuration block chain
CN110135844A (en) * 2019-04-28 2019-08-16 阿里巴巴集团控股有限公司 Credit record, querying method and device and electronic equipment based on block chain
CN110310203A (en) * 2019-06-21 2019-10-08 普洛斯科技(重庆)有限公司 A kind of block chain method of commerce and device

Also Published As

Publication number Publication date
CN111131438B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
KR102526384B1 (en) Zero-Knowledge Proof Payments Using Blockchain
US10783545B2 (en) Reward point redemption for cryptocurrency
EP3559874B1 (en) Event-driven blockchain workflow processing
AU2016265837B2 (en) Virtual assistant in a communication session
CN109146490B (en) Block generation method, device and system
Liu et al. Elastic and cost-effective data carrier architecture for smart contract in blockchain
US20210241282A1 (en) Blockchain Transaction Processing
WO2020028197A1 (en) System and method for transaction account based micro-payments
AU2022279532A1 (en) Peer-to-peer money transfers
US20220188815A1 (en) Distributed ledger systems, methods and devices
CN112613877B (en) Intelligent contract triggering method and device applied to block chain network and related equipment
CN110400217A (en) The regular changing process method and device of intelligent contract
CN112202744B (en) Multi-system data communication method and device
CN112348326A (en) Bank business processing method and system
CN110572457B (en) Resource application method and device based on block chain, electronic equipment and storage medium
CN110955724A (en) Data processing method and device based on block chain, node equipment and storage medium
CN112035350A (en) Test method and device for block chain system and computer equipment
Garcia Bringas et al. BlockChain platforms in financial services: current perspective
CN112600830B (en) Service data processing method and device, electronic equipment and storage medium
CN110532810B (en) Information processing method and device, electronic equipment and readable storage medium
US11461772B2 (en) Digital wallet conversion engine
US9264532B2 (en) Technology for combating mobile phone criminal activity
CN109933508B (en) Method and apparatus for transmitting information
US10572116B2 (en) Methods, apparatuses and computer program products for detecting active usage of a group- based communication system and rendering a trigger component to an associated interface
CN111131438B (en) Method and apparatus for accessing block chains

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