CN110417857B - Block chain protocol processing device, processing method and block chain - Google Patents

Block chain protocol processing device, processing method and block chain Download PDF

Info

Publication number
CN110417857B
CN110417857B CN201910533349.4A CN201910533349A CN110417857B CN 110417857 B CN110417857 B CN 110417857B CN 201910533349 A CN201910533349 A CN 201910533349A CN 110417857 B CN110417857 B CN 110417857B
Authority
CN
China
Prior art keywords
interface
block chain
input parameters
mapping relation
output parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910533349.4A
Other languages
Chinese (zh)
Other versions
CN110417857A (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 CN201910533349.4A priority Critical patent/CN110417857B/en
Publication of CN110417857A publication Critical patent/CN110417857A/en
Application granted granted Critical
Publication of CN110417857B publication Critical patent/CN110417857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • 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
    • 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
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • 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/133Protocols for remote procedure calls [RPC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to the field of cloud computing, and discloses a block chain protocol processing device, a processing method and a block chain. The processing device comprises: the intelligent contract integration development system comprises a first interface conversion module, a second interface conversion module and a third interface conversion module, wherein the first interface conversion module is used for converting input parameters of a first interface into input parameters of a second interface based on a first mapping relation between the input parameters of the first interface and the input parameters of the second interface in a block chain in an intelligent contract integration development environment, and the first interface and the second interface are both configured for realizing a call request; and the second interface conversion module is used for converting the output parameter of the second interface corresponding to the call request into the output parameter of the first interface based on a second mapping relation between the output parameter of the second interface and the output parameter of the first interface. The block chain protocol processing device can shield the difference of the protocol and the interface between the intelligent contract IDE and the block chain network, thereby economically and effectively realizing the decoupling of the interactive calling of the intelligent contract IDE and the block chain network and being suitable for the production environment.

Description

Block chain protocol processing device, processing method and block chain
Technical Field
The invention relates to the field of cloud computing, in particular to a block chain protocol processing device, a processing method and a block chain.
Background
In current industry-level project collaboration across vendors, processes, ownership of application data is a number of organizations that belong in the entire collaboration link. The distributed storage of data of the block chain, and all transaction signatures and verification mechanisms can well solve the trust problem among a plurality of structures, so that all data on the block chain are real and credible. In order to properly manage data on the blockchain, the collaborators need to write special intelligent contracts. At present, there are Remix, ethfile, Truffle, etc. in more commonly used upper layer intelligent contract Integrated Development environments (IDE for short), and there are ether houses, fabics, EOS, etc. in more popular implementations of the bottom layer block chain.
In the Development of the current intelligent contracts, an Integrated Development Environment (IDE) at an upper layer and a blockchain network are tightly coupled, that is, a certain IDE can only debug and compile the intelligent contracts on a specific blockchain network. Therefore, IDE and blockchain network fragmentation cannot be considered when making technology selection.
For different blockchain network types, the following two approaches are mainly adopted in the prior art to solve the above problems:
1. rewriting an existing intelligent contract IDE, wherein the overhead of the mode is basically equal to that of rewriting the existing intelligent contract IDE so as to adapt to the new blockchain network type; even if the rewriting is completed, a developer needs to independently maintain a copy of the intelligent contract IDE, and the secondary migration cost of the new function of the original intelligent contract IDE is extremely high;
2. the method of rewriting the nodes of the block chain network to adapt to the intelligent IDE has strong aggressivity to codes of the nodes of the block chain, damages the original stability of the nodes, and basically cannot be realized for the noninductive and lossless updating and upgrading of the existing nodes in the production network, so the method is not suitable for the production environment.
Disclosure of Invention
Embodiments of the present invention provide a device and a method for processing a block chain protocol, and a block chain, which can shield a difference between a protocol and an interface between an intelligent contract IDE and a block chain network, so as to economically and effectively decouple an interactive call between the intelligent contract IDE and the block chain network, and is suitable for a production environment.
In order to achieve the above object, an embodiment of the present invention provides a block chain protocol processing apparatus, including: the intelligent contract integration development system comprises a first interface conversion module, a second interface conversion module and a third interface conversion module, wherein the first interface conversion module is used for converting input parameters of a first interface into input parameters of a second interface in a block chain based on a first mapping relation between the input parameters of the first interface and the input parameters of the second interface in the block chain, and the first interface and the second interface are both configured to realize a call request; and the second interface conversion module is used for converting the output parameter of the second interface corresponding to the call request into the output parameter of the first interface based on a second mapping relation between the output parameter of the second interface and the output parameter of the first interface.
Optionally, the device for processing a block chain protocol further includes: the screening module is used for traversing an interface set of a block chain to screen the second interface corresponding to the first interface; the first mapping relation establishing module is used for establishing the first mapping relation according to the input parameters of the first interface and the input parameters of the second interface; and the second mapping relation establishing module is used for establishing the second mapping relation according to the output parameters of the first interface and the output parameters of the second interface.
Optionally, the second interface includes: a functional block or a combination of functional blocks.
Optionally, the device for processing a block chain protocol further includes: and the database is used for storing the first mapping relation and the second mapping relation.
Optionally, the device for processing a block chain protocol further includes: and the file loader is used for loading the block chain to be connected.
Correspondingly, an embodiment of the present invention further provides a method for processing a block chain protocol, where the method for processing a block chain protocol includes: converting input parameters of a first interface into input parameters of a second interface in a block chain based on a first mapping relation between the input parameters of the first interface and the input parameters of the second interface in an intelligent contract integrated development environment, wherein the first interface and the second interface are both configured to implement a call request; and converting the output parameter of the second interface corresponding to the call request into the output parameter of the first interface based on a second mapping relation between the output parameter of the second interface and the output parameter of the first interface.
Optionally, the method for processing a block chain protocol further includes: traversing a set of interfaces of a blockchain to screen the second interface corresponding to the first interface; establishing the first mapping relation according to the input parameters of the first interface and the input parameters of the second interface; and establishing the second mapping relation according to the output parameters of the first interface and the second interface.
Optionally, the second interface includes: a functional block or a combination of functional blocks.
Accordingly, the embodiment of the present invention also provides a machine-readable storage medium, which stores instructions for causing a machine to execute the above-mentioned block chain protocol processing method.
Correspondingly, the embodiment of the present invention further provides a block chain, and the block chain is configured with the above block chain protocol processing apparatus.
Through the technical scheme, the input parameters of the first interface for realizing the call request in the intelligent contract IDE are converted into the input parameters of the corresponding second interface in the block chain creatively through the first mapping relation, and the output parameters of the second interface corresponding to the call request are converted into the output parameters of the first interface through the second mapping relation, so that the difference of protocols and interfaces between the intelligent contract IDE and the block chain network can be shielded, the decoupling of the interactive call of the intelligent contract IDE and the block chain network is realized economically and effectively, and the method is suitable for the production environment.
Additional features and advantages of embodiments of the invention will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the embodiments of the invention without limiting the embodiments of the invention. In the drawings:
FIG. 1A is a diagram illustrating a prior art communication between a blockchain network A and an intelligent contract IDE A;
FIG. 1B is a diagram illustrating a prior art communication between a blockchain network B and an intelligent contract IDE B;
FIG. 2 is a diagram of the interaction between an EtherFang blockchain network and a Remix IDE in the prior art;
fig. 3 is a block chain protocol processing apparatus according to an embodiment of the present invention;
fig. 4 is a block chain protocol processing apparatus according to an embodiment of the present invention;
FIG. 5 is a diagram of the interaction between the blockchain network hyperchain and the Remix IDE, as provided by an embodiment of the present invention; and
fig. 6 is a flowchart of a block chain protocol processing method according to an embodiment of the present invention.
Description of the reference numerals
1 first interface 2 second interface
10 first interface conversion module 20 second interface conversion module
30 screening module 40 first mapping relation establishing module
50 second mapping relation establishing module 60 database
70 file loader 80 client
100 block chain protocol processing device
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating embodiments of the invention, are given by way of illustration and explanation only, not limitation.
In the development of the current intelligent contract, the intelligent contract IDE and the blockchain network are tightly coupled, and the communication protocols used by the intelligent contract IDE and the blockchain network are consistent, so that the intelligent contract IDE and the blockchain network cannot be split into consideration when technology selection is performed.
Specifically, as shown in fig. 1A, in the blockchain network a, the nodes directly communicate using the protocol a, the intelligent contract IDE a communicates with the nodes in the blockchain network a using the protocol a, and a developer first writes the intelligent contract in the IDE a, generates a bytecode after the intelligent contract is compiled, and deploys the bytecode to the network a. As shown in fig. 1B, the intelligent contract IDE B and the blockchain network B are developed in the same manner. Taking the interaction relationship between the mainstream Remix IDE and the ethernet blockchain network shown in fig. 3 as an example, since the Remix IDE is originally part of the ethernet project and compatibility with other blockchain networks is not considered, the Remix IDE communicates with the ethernet nodes using the jsonrpc protocol, and each ethernet node also exposes a calling interface to the Remix IDE using the jsonrpc protocol, i.e., the Remix IDE and the ethernet network are tightly coupled, i.e., the input parameters and the output parameters of the corresponding interfaces configured for the same calling request in the Remix IDE and the ethernet network are completely consistent.
If the protocol used by the intelligent contract IDE is different from the protocol of the underlying blockchain network, the intelligent contract IDE does not have cross-platform properties, e.g., the intelligent contract IDE B cannot run on the blockchain network a, and vice versa. For example, in the development of the blockchain network super-link, the main remixtide needs to be migrated to the blockchain network super-link, but the migration process cannot be directly realized because the communication protocols used by the remixtide and the super-link are not consistent.
Specifically, although the implementation manners of different blockchain networks are various, the technologies adopted by these blockchain networks have certain similarities in core concepts, such as Block (Block), Transaction (Transaction), Account (Account), Token (Token), and the like. However, the intelligent contract IDE is not intended for the complex underlying logical implementation of these concepts, but only focuses on the interface invocation of these concepts, and the interfaces on which the intelligent contract IDE relies heavily are: a) and account inquiry: a list of accounts that the IDE may use; b) account balance inquiry: how many tokens are available for a particular account; c) query of blockchain base state: inquiring the latest block ID, the block-out time and the like; d) transaction release: issuing the compiled intelligent contract to a specific block chain network, or executing specific call on the block chain network; e) and inquiring a transaction result: inquiring whether a certain transaction is successful or not and the output result.
For example, taking the interaction process between the Remix IDE and the blockchain network super-link as an example, the Remix IDE uses jsonrpc protocol to communicate with the ethernet node, and the blockchain network super-link uses grpc protocol to expose the call interface to the Remix IDE, as shown in fig. 5. Specifically, an account balance inquiry and transmission interface of the RemixIDE adopts a jsonrpc protocol, namely an Etherhouse address is used as an input parameter and an output parameter; and a grpc protocol adopted by an account balance inquiry interface of the block chain network super chain is that a super chain address is used as an input parameter and an output parameter. Because the protocols adopted by the two interfaces are inconsistent, the communication between the remix ide and the block chain network super chain cannot be directly realized, namely the account balance inquiry process cannot be realized.
Aiming at the defect of tight coupling between an intelligent contract IDE and a block chain network in the prior art, the block chain protocol processing device provided by the invention has the core view of shielding the difference of protocols and interfaces between the IDE and the block chain network so as to decouple the interactive calling of the intelligent contract IDE and the block chain network. The processing device adopts an adapter design mode, and can match the interface of the intelligent contract IDE with the interface in the block chain network, so that the originally incompatible interfaces can work together.
Fig. 3 is a block chain protocol processing apparatus according to an embodiment of the present invention. As shown in fig. 3, the block chain protocol processing apparatus 100 may include: a first interface conversion module 10, configured to convert an input parameter of a first interface 1 into an input parameter of a second interface 2 in a block chain based on a first mapping relationship between the input parameter of the first interface 1 and the input parameter of the second interface 2 in an intelligent contract integrated development environment, where the first interface 1 and the second interface 2 are both configured to implement a call request; and a second interface conversion module 20, configured to convert, based on a second mapping relationship between the output parameter of the second interface 2 and the output parameter of the first interface 1, the output parameter of the second interface 2 corresponding to the call request into the output parameter of the first interface 1.
Taking the interaction process between the Remix IDE and the blockchain network hyperchain as an example, the Remix IDE calls the first interface 1 through jsonrpc, and the input parameter list of the first interface 1 is (param)1,param2,…,paramn) The output parameter is listed as (out)1,out2,…,outm) Wherein, the input parameter and the output parameter are both expressed in a Taifang address mode; the block chain network super chain calls a second interface 2 through a grpc protocol, and an input parameter list of the second interface 1 is (param)1′,param2′,…,paramx') and the output parameter list is (out)1′,out2′,…,outy') wherein the input parameters and output parameters are represented by means of hyperchain addresses. Wherein, the input parameter and the input parameter may be different in type (e.g., shape, character string or date, etc.) and/or sequence.
Specifically, the following explains and explains the procedure of processing the blockchain protocol between the account balance query sending interface of the Remix IDE and the account balance query interface of the blockchain network hyperlink, which is involved in the execution of the account balance (e.g., rmb) query request of the user.
The first case: the Remix IDE calls an account balance inquiry and sending interface through a jsonrpc protocol, an input parameter list of the account balance inquiry and sending interface is a name, the input parameter name is an Ethern address which substantially represents a user name, and the parameter type of the input parameter name is a character type; the output parameter list is "balance (RMB)"), the output parameter "balance (RMB)" is substantially an Etherhouse address representing account balance (RMB), and the parameter type of the output parameter "balance (RMB)" is integer. The method comprises the steps that account balance inquiry is realized on a block chain network super-link, the block chain network super-link calls an account balance inquiry interface through a grpc protocol, an input parameter list is an 'identity card number', the input parameter 'identity card number' is a super-link address which substantially represents a user identity card number, and the input parameter 'identity card number' is of an integer type; the output parameter list is "balance (RMB)"), the output parameter "balance (RMB)" is essentially a hyperlink address representing account balance (RMB), and the parameter type of the output parameter is integer.
And (3) processing a block chain protocol: a user initiates an account balance inquiry request, and after receiving the account balance inquiry request, the RemixIDE calls an account balance inquiry transmitting interface through a jsonrpc protocol; next, the account balance query sending interface calls the blockchain protocol processing apparatus 100, and the first interface conversion module 10 in the blockchain protocol processing apparatus 100 converts the input parameter ("name") of the account balance query sending interface of the remix ide into the input parameter ("identity card number") of the account balance query sending interface of the blockchain network super-link based on the first mapping relationship Map1 ("mapping relationship between name" - "identity card number"); then, the block chain network hyperchain calls an account balance inquiry interface through a grpc protocol, and the account balance inquiry interface acquires a calling result (account balance) corresponding to the calling request based on the converted input parameters; then, the account balance inquiry interface calls the blockchain protocol processing apparatus 100, and the second interface conversion module 20 in the blockchain protocol processing apparatus 100 converts an output parameter ("balance (rmb)") of the account balance inquiry interface corresponding to a call result into an output parameter ("balance (rmb)") of the account balance inquiry transmission interface based on the second mapping Map2 ("balance (rmb)" (ethernet address) - "balance (rmb)"); finally, the account balance inquiry transmitting interface returns the converted output parameter ("balance (RMB)") to the user. For other interfaces in the remix ide and the blockchain network hyperchain, similar methods can be used to complete the communication between the corresponding interfaces configured to implement the same call request, which is not described herein again.
The second case: the RemixIDE calls an account balance inquiry and sending interface through a jsonrpc protocol, an input parameter list of the account balance inquiry and sending interface is (name (Chinese)), the input parameter (name (Chinese)) is substantially an ether house address representing the Chinese name of a user, and the parameter type of the input parameter (name (Chinese)) is a character type; the output parameter list is "balance (RMB)"), the output parameter "balance (RMB)" is substantially an Etherhouse address representing account balance (RMB), and the parameter type of the output parameter "balance (RMB)" is integer. The method comprises the steps that account balance inquiry is realized on a blockchain network super-link, the blockchain network super-link calls an account balance inquiry interface through a grpc protocol, an input parameter list is (name (English)), the input parameter (name (English)) is a super-link address which substantially represents an English name of a user, and the parameter type of the input parameter (name (English)) is a character type; the list of output parameters is "balance (dollars)", which is essentially a hyperlink address representing the account balance (dollars), and the parameter type of the output parameter is integer.
For the processing procedure of the blockchain protocol in the second scenario, reference may be made to the processing procedure of the blockchain protocol in the first scenario, which is not described herein again.
The first mapping relationship Map1 between the input parameters and the second mapping relationship Map2 between the output parameters of the two interfaces may be determined manually, or may be determined by a screening module, a first mapping relationship establishing module, and a second mapping relationship establishing module, which are described below.
In the above embodiment, although the RemixIDE and the blockchain network hyperchain cannot directly interact, the "session" between the two can be translated by the blockchain protocol processing apparatus 100. Assuming that the interface set on which the Remix IDE depends is a, which includes function modules (or functions) { a1, a2, …, an }, and the interface set of the hyperchain is B, which includes function modules { B1, B2, …, bm }, the block chain protocol processing apparatus 100 is implemented by using the interface set B to simulate the interface set a, so that the Remix IDE still assumes that the interface set is a taifang network, as shown in fig. 5.
The first mapping relation and the second mapping relation can be determined by a screening module, a first mapping relation establishing module and a second mapping relation establishing module. As shown in fig. 4, the device 100 for processing a block chain protocol may further include: a screening module 30, configured to traverse an interface set of a block chain to screen the second interface corresponding to the first interface; a first mapping relationship establishing module 40, configured to establish the first mapping relationship according to the input parameter of the first interface and the input parameter of the second interface; and a second mapping relationship establishing module 50, configured to establish the second mapping relationship according to the output parameter of the first interface and the output parameter of the second interface. Wherein the second interface may include: a functional block or a combination of functional blocks.
For an account balance query request initiated by a user, an account balance query sending interface configured for implementing the request in the remixtide is a function module a1, when the function module a1 calls the blockchain protocol processing apparatus 100, the screening module 30 in the blockchain protocol processing apparatus 100 traverses the interface set of the blockchain network hyperchain, checks whether there is a function module therein cooperating with the function module a1 to implement the request, and if there is a function module b1, the first mapping relation establishing module 40 is based on an input parameter (param) of the function module a11,param2,…,paramn) And the input parameter (param) of the function block b11′,param2′,…,paramx'), establishing a first mapping Map1 between the input parameters of the two modules; and the second mapping relation establishing module 50 outputs a parameter (out) based on the function module a11,out2,…,outm) And the output parameter (out) of the function block b11′,out2′,…,outy') a second mapping Map2 between the output parameters of the two modules is established.If not, interface b 1' configured to fulfill the account balance inquiry request is simulated by a combination of multiple function modules, or by a combination of multiple function modules and adding a new interface (i.e., business logic).
For example, for a request issued by a transaction (e.g., a transfer) initiated by a user, the transaction sending interface configured to implement the request in the remix ide is function module a1, when function module a1 calls the blockchain protocol processing apparatus 100, the screening module 30 in the blockchain protocol processing apparatus 100 traverses the interface set of the blockchain network hyperchain, checks that there is no function module b1 cooperating with function module a1 to implement the request, but function module c1 can implement the transaction generating function and function module d1 can implement the transaction executing function, that is, the issuance of the transaction can be implemented by the combination of function module c1 and function module d1 (equivalent to the transaction issuing interface). The input parameter list of the function module a1 is (transfer account "," amount "," user signature "), the input parameters" transfer account "," amount "and" user signature "substantially represent the ether house address of the transfer account, the transfer amount and the user signature, and the parameter types of the input parameters are character type, integer type and character type respectively; the output list is the 'transaction number', the output parameter 'transaction number' is the Ethern address which essentially represents the transaction number, and the parameter type of the output parameter is character type. The input parameter list of the function module c1 is (transfer account, amount, user signature), the input parameters ' transfer account, amount ' and user signature ' are essentially hyperlink addresses representing transfer account, transfer amount and user signature, and the parameter types of the input parameters are character type, integer type and character type respectively; the output parameter list is ("transaction to be executed"), the output parameter "transaction to be executed" is essentially a hyperlink address representing the transaction to be executed, and the parameter type of the output parameter is a custom type. The input parameter list of the function module d1 is ("transaction to be executed"), the input parameter "transaction to be executed" is essentially a hyperlink address representing the transaction to be executed, and the parameter type of the input parameter is a custom type; the output parameter is the 'transaction number', the output parameter 'transaction number' is essentially a hyperlink address representing the transaction number, and the parameter type of the output parameter is character type.
For this case, the first mapping relationship establishing module 40 establishes a first mapping relationship Map1 between the input parameters of the two modules (i.e. the mapping relationship between the house ethernet addresses and the hyperlink addresses representing the transfer accounts, amounts and user signatures) based on the list of input parameters of function module a1 ("transfer account", "amount", "user signature") and the list of input parameters of function module c1 ("transfer account", "amount", "user signature"); and the second mapping relationship establishing module 50 establishes a second mapping relationship Map2 (i.e. a mapping relationship between the ethernet address representing the transaction number and the hyperlink address) between the output parameters of the two modules based on the output parameter ("transaction number") of the function module a1 and the output parameter ("transaction number") of the function module d1, that is, on the hyperlink side of the blockchain network, the input parameters of the function module (e.g. the function module c1) which executes the tasks for the first time are the input parameters of the second interface 2 according to the order of executing the transaction releases; the output parameter of the function module that finally executes the task (e.g., function module d1) is the output parameter of the second interface 2. The processing procedure of the blockchain protocol for transaction issuance is described in detail below.
In the above process of checking whether there is a function module that can implement the user request matching with the function module a1, the filter module 30 may check the function description about the function module in the interface document; if the document is missing, the definition of the function module (such as the function signature) is checked.
After the first mapping relationship and the second mapping relationship are established, the mapping relationships may be stored for subsequent use. Thus, as shown in fig. 5, the block chain protocol processing apparatus may further include: a database 60 for storing the first mapping relationship and the second mapping relationship. The database 60 may be a lightweight key-value pair database (level DB) that enables light and fast storage of mapping relationships.
In the process of executing the account balance inquiry request of the user, the block chain protocol processing device needs to determine the information of the block chain network to be connected, can smoothly complete the connection between the block chain protocol processing device and the block chain network, and executes the protocol conversion between the intelligent contract IDE and the block chain network and the calling process corresponding to the request. As shown in fig. 5, the block chain protocol processing apparatus may further include: and a file loader 70 for loading the blockchain to be connected. In addition, the file loader 70 may also be used to load other configuration files of the local user, for example, public and private key files of the user test account; and/or for signing transactions to verify that they are legitimate (e.g., a certificate for a blockchain network, which is allowed to execute only if the certificate is legitimate).
Each blockchain network needs to be configured with a unique client for defining an interface between nodes of the blockchain network to allow communication between the nodes using the defined interface. As shown in fig. 5, the block chain protocol processing apparatus 100 may further include: and the client 80 is used for defining and realizing the interface of the blockchain network. For example, for a blockchain network hyperchain, the client 80 specifies its interface as one that employs the grpc protocol. The client 80 may send the output result of the first interface conversion module 10 to the super link node of the blockchain network without processing; similarly, the output result of the block chain network hyperlink node may be sent to the second interface conversion module 20 without processing. Of course, the first interface conversion module 10 and the second interface conversion module 20 can directly communicate with the blockchain network hyperlink node.
In particular, the process of executing a transaction (e.g., a transfer) issue request is explained and illustrated in detail using the interaction diagram between the blockchain network hyperchain and the Remix IDE shown in fig. 5 as an example.
The first mapping relation Map1 and the second mapping relation Map2 (see the above content in detail) are determined in advance by the screening module 30, the first mapping relation establishing module 40 and the second mapping relation establishing module 50 (not shown), and the first mapping relation Map1 and the second mapping relation Map2 are stored in the database 60.
In the case that the first mapping Map1 and the second mapping Map2 are stored in advance, a user initiates a request for issuing a transaction (e.g., a transfer), and after receiving the request, the Remix IDE calls a transaction issuing and sending interface through a jsonrpc protocol; then, the transaction issuance dispatch interface calls the blockchain protocol processing device 100, and the first interface conversion module 10 in the blockchain protocol processing device 100 converts the input parameters ("transfer account", "amount", "user signature") of the transaction issuance dispatch interface into the input parameters ("transfer account", "amount", "user signature") of the function module c1 in the transaction issuance interface, which is responsible for transaction generation task, based on the first mapping Map1 (i.e., the mapping between the etherhouse address and the hyperlink address representing the transfer account, amount and user signature); then, the client 80 receives the input parameters of the function module c1 and forwards them to the function module c1 of the blockchain network hyperchain without processing, and based on the converted input parameters, the function module c1 outputs the transaction to be executed; then, the function module d1 in the transaction issuing interface, which is responsible for the transaction execution task, executes the corresponding transaction issuing and obtains the call result (transaction number) corresponding to the request based on the transaction to be executed; then, the client forwards the call result to the second interface conversion module 20 in the blockchain protocol processing apparatus 100 without processing, and based on the second mapping Map2, the second interface conversion module 20 converts the output parameter ("transaction number") corresponding to the call result of the transaction issue interface of the blockchain network hyperchain into the output parameter (transaction number) of the transaction issue sending interface of the Remix IDE; and finally, the transaction issuing and sending interface of the Remix IDE returns the converted output parameters to the user.
In summary, the present invention creatively converts the input parameters of the first interface for implementing the call request in the intelligent contract IDE into the input parameters of the corresponding second interface in the blockchain through the first mapping relationship, and converts the output parameters of the second interface corresponding to the call request into the output parameters of the first interface through the second mapping relationship, so as to shield the difference of the protocol and the interface between the intelligent contract IDE and the blockchain network, thereby economically and effectively implementing the decoupling of the interactive call of the intelligent contract IDE and the blockchain network, and is suitable for the production environment.
Accordingly, fig. 6 is a flowchart of a block chain protocol processing method according to an embodiment of the present invention. As shown in fig. 6, the block chain protocol processing method may include the following steps: step S601, based on a first mapping relationship between an input parameter of a first interface in an intelligent contract integrated development environment and an input parameter of a second interface in a block chain, converting the input parameter of the first interface into an input parameter of the second interface. Wherein the first interface and the second interface are both configured to implement a call request; and step S602, converting the output parameter of the second interface corresponding to the call request into the output parameter of the first interface based on a second mapping relationship between the output parameter of the second interface and the output parameter of the first interface.
Optionally, the method for processing a block chain protocol further includes: traversing a set of interfaces of a blockchain to screen the second interface corresponding to the first interface; establishing the first mapping relation according to the input parameters of the first interface and the input parameters of the second interface; and establishing the second mapping relation according to the output parameters of the first interface and the second interface.
Optionally, the second interface includes: a functional block or a combination of functional blocks.
Accordingly, the embodiment of the present invention also provides a machine-readable storage medium, which stores instructions for causing a machine to execute the above-mentioned block chain protocol processing method.
Accordingly, an embodiment of the present invention further provides a processor, configured to execute a program, where the program is executed to perform the above processing method for a blockchain protocol.
Correspondingly, the embodiment of the present invention further provides a block chain, and the block chain is configured with the above block chain protocol processing apparatus.
Of course, the blockchain may include all blockchain networks based on blockchain technology, such as blockchain network hyperchains, and the like.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement the target information store by any method or technology. The target information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store target information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A device for processing a block chain protocol, the device comprising:
the intelligent contract integration development system comprises a first interface conversion module, a second interface conversion module and a third interface conversion module, wherein the first interface conversion module is used for converting input parameters of a first interface into input parameters of a second interface in a block chain based on a first mapping relation between the input parameters of the first interface and the input parameters of the second interface in the block chain, and the first interface and the second interface are both configured to realize a call request; and
and the second interface conversion module is used for converting the output parameter of the second interface corresponding to the call request into the output parameter of the first interface based on a second mapping relation between the output parameter of the second interface and the output parameter of the first interface.
2. The device according to claim 1, wherein said device further comprises:
the screening module is used for traversing an interface set of a block chain to screen the second interface corresponding to the first interface;
the first mapping relation establishing module is used for establishing the first mapping relation according to the input parameters of the first interface and the input parameters of the second interface; and
and the second mapping relation establishing module is used for establishing the second mapping relation according to the output parameters of the first interface and the output parameters of the second interface.
3. The device according to claim 2, wherein said second interface comprises: a functional block or a combination of functional blocks.
4. The device according to claim 1, wherein said device further comprises:
and the database is used for storing the first mapping relation and the second mapping relation.
5. The device according to claim 1, wherein said device further comprises:
and the file loader is used for loading the block chain to be connected.
6. A method for processing a block chain protocol is characterized in that the method for processing the block chain protocol comprises the following steps:
converting input parameters of a first interface into input parameters of a second interface in a block chain based on a first mapping relation between the input parameters of the first interface and the input parameters of the second interface in an intelligent contract integrated development environment, wherein the first interface and the second interface are both configured to implement a call request; and
and converting the output parameter of the second interface corresponding to the call request into the output parameter of the first interface based on a second mapping relation between the output parameter of the second interface and the output parameter of the first interface.
7. The blockchain protocol processing method of claim 6, wherein the blockchain protocol processing method further comprises:
traversing a set of interfaces of a blockchain to screen the second interface corresponding to the first interface;
establishing the first mapping relation according to the input parameters of the first interface and the input parameters of the second interface; and
and establishing the second mapping relation according to the output parameters of the first interface and the second interface.
8. The method of claim 7, wherein the second interface comprises: a functional block or a combination of functional blocks.
9. A machine-readable storage medium having stored thereon instructions for causing a machine to perform the method for block chain protocol processing according to any one of claims 6-8.
10. A blockchain, characterized in that the blockchain is configured with blockchain protocol processing means according to any of claims 1-5.
CN201910533349.4A 2019-06-19 2019-06-19 Block chain protocol processing device, processing method and block chain Active CN110417857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910533349.4A CN110417857B (en) 2019-06-19 2019-06-19 Block chain protocol processing device, processing method and block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910533349.4A CN110417857B (en) 2019-06-19 2019-06-19 Block chain protocol processing device, processing method and block chain

Publications (2)

Publication Number Publication Date
CN110417857A CN110417857A (en) 2019-11-05
CN110417857B true CN110417857B (en) 2021-08-10

Family

ID=68359383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910533349.4A Active CN110417857B (en) 2019-06-19 2019-06-19 Block chain protocol processing device, processing method and block chain

Country Status (1)

Country Link
CN (1) CN110417857B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941676B (en) * 2019-11-27 2021-12-21 腾讯科技(深圳)有限公司 Configuration method, device, equipment and medium
CN111179086B (en) * 2019-12-31 2024-01-02 杭州趣链科技有限公司 Intelligent contract virtual machine based on WebAsssemly
CN114978786B (en) * 2022-05-30 2023-08-22 广州宸祺出行科技有限公司 Method and device for converting third party interface into system standard interface
CN115334172B (en) * 2022-07-20 2024-04-19 新疆丝路智汇信息科技有限公司 Block chain protocol processing system and processing method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694701A (en) * 2012-06-13 2012-09-26 青岛海信传媒网络技术有限公司 Testing method and system based on message
CN108108439A (en) * 2017-12-21 2018-06-01 北京奇艺世纪科技有限公司 A kind of data query method, apparatus and electronic equipment
CN108959402A (en) * 2018-06-06 2018-12-07 广州链块科技有限公司 A kind of device and method that block chain is developed based on SQL engine
CN109614823A (en) * 2018-10-26 2019-04-12 阿里巴巴集团控股有限公司 Data processing method, device and equipment
CN109756508A (en) * 2019-01-22 2019-05-14 深圳壹账通智能科技有限公司 Message Agent method and relevant device based on multi-protocols access block chain network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10977629B2 (en) * 2017-09-29 2021-04-13 Oracle Financial Services Software Limited Computerized messaging module for blockchain networks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694701A (en) * 2012-06-13 2012-09-26 青岛海信传媒网络技术有限公司 Testing method and system based on message
CN108108439A (en) * 2017-12-21 2018-06-01 北京奇艺世纪科技有限公司 A kind of data query method, apparatus and electronic equipment
CN108959402A (en) * 2018-06-06 2018-12-07 广州链块科技有限公司 A kind of device and method that block chain is developed based on SQL engine
CN109614823A (en) * 2018-10-26 2019-04-12 阿里巴巴集团控股有限公司 Data processing method, device and equipment
CN109756508A (en) * 2019-01-22 2019-05-14 深圳壹账通智能科技有限公司 Message Agent method and relevant device based on multi-protocols access block chain network

Also Published As

Publication number Publication date
CN110417857A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
CN110417857B (en) Block chain protocol processing device, processing method and block chain
KR102225973B1 (en) Test platform for blockchain networks
RU2744322C2 (en) "function-as-service" platform (faas) in housing network
CN109656538A (en) Generation method, device, system, equipment and the medium of application program
CN111240732B (en) Method, device, equipment and storage medium for distributing distributed microservice
JP2023532959A (en) A privacy-preserving architecture for permissioned blockchains
CN112232961B (en) Data processing method and device based on block chain system and electronic equipment
US10817284B2 (en) Melding of mediation flow service component architecture (SCA) components
CN109559229A (en) The method of the intelligent contract group of update based on block chain
CN110262777B (en) Block chain application framework
CN112835985B (en) Spatial data sharing system and method based on distributed account book
US20220383222A1 (en) Anonymous distributed consensus regarding the verification of protocols
WO2023185058A1 (en) Method and system for deploying chain code in consortium blockchain
CN114610598A (en) Test method, test device, electronic equipment and computer readable storage medium
CN112148284A (en) General type block chain software development kit
CN111813836A (en) Method for improving Ethereum block chain system expansibility
WO2023185055A1 (en) Method and system for deploying chaincode in alliance chain
CN116450107A (en) Method and device for secondary development of software by low-code platform and electronic equipment
CN114115982A (en) Code issuing method, device, equipment and storage medium
US20210110485A1 (en) System and method for implementing an international demand deposit account branch migration tool
US11736525B1 (en) Generating access control policies using static analysis
US20230281054A1 (en) Computer System Execution Environment Builder Tool
US20230097203A1 (en) System and method for generating blockchain token support from a set of declarations
US11275569B1 (en) Techniques and architectures for providing continuous integration (CI) and/or continuous delivery (CD) in a data lake environment
KR102227442B1 (en) Method for the settlement of personal information

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