CN113162848B - Method, device, gateway and medium for realizing block chain gateway - Google Patents

Method, device, gateway and medium for realizing block chain gateway Download PDF

Info

Publication number
CN113162848B
CN113162848B CN202010074581.9A CN202010074581A CN113162848B CN 113162848 B CN113162848 B CN 113162848B CN 202010074581 A CN202010074581 A CN 202010074581A CN 113162848 B CN113162848 B CN 113162848B
Authority
CN
China
Prior art keywords
contract
block chain
request
structure content
intelligent contract
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
CN202010074581.9A
Other languages
Chinese (zh)
Other versions
CN113162848A (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 CN202010074581.9A priority Critical patent/CN113162848B/en
Publication of CN113162848A publication Critical patent/CN113162848A/en
Application granted granted Critical
Publication of CN113162848B publication Critical patent/CN113162848B/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
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the application discloses a method, a device, a gateway and a medium for realizing a block chain gateway, and relates to the technical field of block chains. The specific implementation scheme is as follows: the contract analysis unit analyzes the acquired service request and encodes the service request based on the method name and the parameters of the target intelligent contract to be called so as to generate contract structure content; transmitting the contract structure content to the block chain nodes through the intelligent contract calling bridge so as to request the block chain nodes to call a target intelligent contract according to the contract structure content to execute service processing; calling an execution result after a bridging receiving block chain node calls a target intelligent contract through the intelligent contract; and analyzing the execution result and responding to the service request. According to the method and the device, the operation difficulty and the technical threshold for technical personnel to call the service logic deployed in the blockchain network are reduced, the call mode of the blockchain intelligent contract is further optimized, and the convenience for calling the intelligent contract is improved.

Description

Method, device, gateway and medium for realizing block chain gateway
Technical Field
The embodiment of the application relates to the field of computer computing, in particular to a block chain technology.
Background
The Ethernet workshop is a block chain network widely used at present, and a development user serving as a service function provider can deploy own service logic to the Ethernet workshop in an intelligent contract mode to operate so as to achieve the purposes of data disclosure transparency and non-tampering.
At present, the difficulty of developing a program interface provided by an ethernet house for a user to manage business logic deployed on a blockchain is relatively high. The development user needs to encode and sign the called intelligent contracts and parameters according to the encoding rule of the Etherhouse, and needs to send the business transaction request to the blockchain node based on the Etherhouse through a series of complex operations.
Therefore, the prior art wants to invoke the intelligent contracts through the ether house block link points, which has high requirements on technical personnel and is inconvenient to operate.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a medium for realizing a block chain gateway, so as to optimize the calling mode of a block chain intelligent contract and make the block chain intelligent contract more convenient to operate.
In a first aspect, an embodiment of the present application provides a method for implementing a blockchain gateway, including:
the contract analysis unit analyzes the acquired service request, and codes the service request based on the method name and parameters of the target intelligent contract to be called so as to generate contract structure content;
the contract analysis unit transmits the contract structure content to a block chain node through an intelligent contract calling bridge so as to request the block chain node to call the target intelligent contract according to the contract structure content to execute service processing;
the contract analysis unit receives an execution result of the block chain link point calling the target intelligent contract through the intelligent contract calling bridge;
and the contract analysis unit analyzes the execution result and responds to the service request.
In the embodiment of the application, the contract analysis unit analyzes the acquired service request, and codes the service request based on the method name and the parameters of the target intelligent contract with call to generate contract structure content; transmitting the contract structure content to the block chain nodes through the intelligent contract calling bridge so as to request the block chain nodes to call a target intelligent contract according to the contract structure content to execute business processing; and the contract analysis unit analyzes the execution result and responds to the service request. According to the technical scheme, the business request is automatically analyzed and coded through the contract analysis unit to obtain the contract structure content, so that the block chain network can directly call the target intelligent contract for processing, the execution result of calling the target intelligent contract through the block chain link points received by the intelligent contract calling bridge is analyzed through the contract analysis unit, the business request is responded, the operation difficulty of calling the business logic deployed in the block chain network by technical personnel is reduced, the technical threshold of calling the intelligent contract by the technical personnel is lowered, the calling mode of the block chain intelligent contract is further optimized, and the convenience of calling the intelligent contract is improved.
Optionally, the service request includes a service uplink request and a service query request.
In an optional embodiment of the foregoing application, the service request is refined to include the service uplink request and the service query request, so as to enrich the types of the invoked intelligent contract.
Optionally, before the contract parsing unit parses the obtained service request, the method further includes: the contract analysis unit is used as a server and acquires the service request from a corresponding client;
correspondingly, the contract parsing unit parses the execution result, and responding to the service request includes:
and the contract analysis unit analyzes the execution result and feeds back the analysis result to the client initiating the service request.
In an optional implementation manner of the above application, before the contract analysis unit analyzes the service request, the service request is obtained from the client corresponding to the contract analysis unit, so that the client incapable of directly invoking the block chain intelligent contract can send the service request to the corresponding contract analysis unit, and then the intelligent contract is invoked through the contract analysis unit, and the feedback of the execution result of the intelligent contract provides possibility for the client incapable of directly invoking the block chain intelligent contract.
Optionally, if the service request is a transaction request of a transaction type, the method further includes:
the contract analysis unit sends the transaction request to a block chain node through the intelligent contract calling bridge;
the contract analysis unit receives a transaction hash value of a transaction request synchronously returned by the intelligent contract calling bridge, and determines whether the transaction is completed or not through a receipt of the transaction hash value.
In an optional implementation manner of the application, when the acquired monthly clearance is a transaction request of a transaction type, the contract analysis unit is added to send the transaction request to the block link point through the intelligent contract invoking bridge, and the transaction hash value of the fed back transaction request is received, so that whether the transaction is completed is determined according to the receipt of the fed back transaction hash value, the related content of invoking the intelligent contract to execute the transaction request is enriched, and meanwhile, the execution condition of the transaction request is effectively monitored.
Optionally, the contract parsing unit, before transmitting the contract structure content to the block chain node through the intelligent contract invoking bridge, further includes:
the node management unit acquires the state information of at least one block chain node in the node pool;
and the node management unit determines a block chain node for processing the current contract structure content according to the state information.
In an optional embodiment of the foregoing application, before the contract structure content is transmitted to the block link points through the intelligent contract invoking bridge, the node management unit additionally acquires the state information of the block link nodes, and determines the block link points that process the current contract structure content according to the acquired state information, thereby perfecting a determination mechanism of the block link points and providing guarantee for balanced distribution of tasks executed by each block link node in the block link network.
Optionally, the status information includes: load state information of the block chain nodes and communication state information of the block chain nodes;
the node management unit acquires the state information of at least one block chain node in the node pool, and the method comprises the following steps:
the node management unit communicates with a plurality of block chain nodes in a block chain network according to a set rule so as to acquire state information of each block chain node.
In an optional implementation manner of the foregoing application, the additional node management unit communicates with a plurality of nodes in the blockchain network according to a set rule to collect state information of each blockchain node, so as to provide a reference for determining a blockchain link point that processes a current contract structure content.
Optionally, the method further includes:
and if the node management unit monitors that the state information of the abnormal block chain link points occurs, initiating abnormal reminding.
In an optional implementation manner in the foregoing application, when the node management unit detects that there is an abnormality in the state information of the block link point, an abnormality is prompted, so as to timely control the condition of the abnormal block link node.
Optionally, the contract parsing unit invokes a bridge through an intelligent contract, and before transmitting the contract structure content to a block chain node, the method further includes:
the counting management unit determines a current counting value according to a previous counting value of the initiator account, and adds the current counting value to the contract structure content;
the initiator account corresponds to the initiator of the service request in a one-to-one or one-to-many way; the count value is sequentially incremented.
In an optional implementation manner of the foregoing application, before transmitting the contract structure content to the block link node through the intelligent contract invoking bridge, the count management unit determines the current count value according to the previous count value of the initiator account, and adds the current count value to the contract structure content, thereby avoiding repeated propagation or repeated execution of the contract structure content in the block link network, and meanwhile, the current count value is set for each initiator account, so as to provide a guarantee for the block link node to sequentially execute the service request initiated by the initiator account.
Optionally, the method further includes:
the counting management unit initiates a counting value correction query request to a block chain node through the intelligent contract invoking bridge so as to query the latest counting value recorded by the initiator account in the block chain;
and the counting management unit updates the local previous counting value according to the latest counting value.
In an optional implementation manner of the foregoing application, the count management unit invokes the bridge to send a count correction query request to the block link points through an intelligent contract, so as to obtain a latest count value, thereby performing local update correction of a previous count value according to the latest count value, and providing a guarantee for accuracy of the count value of each initiator account.
Optionally, the contract parsing unit invokes a bridge through an intelligent contract, and before transmitting the contract structure content to a block chain node, the method further includes:
if the service request is a service uplink request, the transaction management unit starts monitoring on the contract structure content to be uplink;
correspondingly, after the contract structure content is transmitted to the blockchain node, the method further comprises the following steps:
the transaction management unit acquires a transaction identifier of transaction data generated after the block link point calls the target intelligent contract to execute service processing according to the contract structure content;
the transaction management unit monitors the uplink state of the transaction data according to the transaction identifier;
and if the business data uplink fails or the execution is overtime, retransmitting the contract structure content to a block link point.
In an optional implementation manner of the foregoing application, before the contract structure content is transmitted to the block link point through the intelligent contract invoking bridge, the transaction management unit is additionally used to monitor the execution of the contract structure content and the result uplink condition of the service uplink request, and when the uplink fails or the execution times out, the contract structure content is retransmitted to ensure the effective execution of the service uplink request.
Optionally, the contract parsing unit invokes a bridge through an intelligent contract, and before transmitting the contract structure content to a block chain node, the method further includes:
the transaction management unit detects a count value in the contract structure content and judges whether a discontinuous empty count value exists or not;
if an empty count value exists, the transaction management unit invokes a bridge request block link point through the intelligent contract to generate an empty transaction request corresponding to the empty count value.
In an optional implementation manner of the foregoing application, before the intelligent contract invoking bridge transmits the contract structure content to the block chain node, the additional transaction management unit detects a count value in the contract structure content, and when a discontinuous null count value exists, the transaction management unit requests the block chain node to generate a null transaction request corresponding to the null count value through the intelligent contract invoking bridge, so as to provide a guarantee for continuity of the count value of each initiator account.
Optionally, the method further includes:
if the service request is a service query request, the event subscription unit records the service query request into a subscription pool, registers a query monitoring event to the block link points, and feeds back when the query event meeting the conditions occurs in the block link points;
the event subscription unit provides the fed-back query data as an execution result to the contract analysis unit.
In an optional implementation manner of the above application, the event subscription unit monitors and registers events related to the service query request, and when a query event meeting conditions occurs in a block chain node, feeds query data of the query event back to the contractable parsing unit for a user to view, thereby providing a guarantee for the user to effectively monitor the execution condition of a certain type of request in the block chain node.
In a second aspect, an embodiment of the present application further provides an apparatus for implementing a blockchain gateway, including:
the contract analysis unit is used for analyzing the acquired service request and coding the service request based on the method name and the parameters of the target intelligent contract to be called so as to generate contract structure content;
the contract analysis unit is also used for transmitting the contract structure content to a block chain node through an intelligent contract calling bridge so as to request the block chain node to call the target intelligent contract to execute business processing according to the contract structure content;
the contract analysis unit is also used for receiving an execution result after the block chain link point calls the target intelligent contract through the intelligent contract calling bridge;
and the contract analysis unit is also used for analyzing the execution result and responding to the service request.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute a method for implementing a blockchain gateway provided in the embodiments of the first aspect.
In a fourth aspect, the present application further provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the implementation method of the blockchain gateway provided in the first aspect.
Other effects of the above alternatives will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be considered limiting of the present application. Wherein:
FIG. 1A is a block chain system according to an embodiment of the present disclosure;
fig. 1B is a flowchart of a method for implementing a blockchain gateway according to a first embodiment of the present application;
fig. 2 is a flowchart of a method for implementing a blockchain gateway according to a second embodiment of the present application;
fig. 3 is a flowchart of a method for implementing a blockchain gateway in the third embodiment of the present application;
fig. 4 is a flowchart of a method for implementing a blockchain gateway in the fourth embodiment of the present application;
fig. 5 is a structural diagram of an implementation apparatus of a blockchain gateway in a fifth embodiment of the present application;
fig. 6 is a block diagram of an electronic device for implementing a method for implementing a blockchain gateway according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In order to clearly introduce the technical solutions of the embodiments of the present application, a software architecture applied to the embodiments of the present application is first described.
Referring to fig. 1A, a block chain system is shown, which comprises: a gateway system 10, an intelligent contract invocation bridge 20 and a blockchain network 30; intelligent contract invocation bridge 20 is communicatively coupled to gateway system 10 and blockchain network 30, respectively.
Wherein, gateway system 10 includes: the contract analysis unit 11 is used for analyzing and encoding parameters required by the service request to be executed when the intelligent contract is called to obtain encoded data and performing inverse analysis on the intelligent contract execution result;
the block chain link points 31 deployed in the block chain network 30 receive the coded data and call an intelligent contract to obtain a corresponding execution result;
the intelligent contract invokes the bridge 20 for data transfer between the gateway system 10 and the blockchain network 30.
Further, the gateway system 10 further includes: at least one of the node management unit 12, the count management unit 13, the transaction management unit 14, and the event subscription unit 15.
The node management unit 12 is configured to manage each block link point 31 included in the block chain network 30;
a count management unit 13, configured to add a count value to the encoded data obtained by the contract parsing unit 11 to identify an execution order of the service request corresponding to the encoded data;
a transaction management unit 14, configured to manage execution of a transaction request in the blockchain network 30;
an event subscription unit 15 is used to listen to specific events in the blockchain network 30.
Example one
Fig. 1B is a flowchart of an implementation method of a blockchain gateway in a first embodiment of the present application, and the embodiment of the present application is applicable to a case where an intelligent contract deployed in a blockchain network is called by the gateway system 10 shown in fig. 1A. The method is performed by an implementation apparatus of a blockchain gateway, which is implemented by software and/or hardware and is specifically configured in an electronic device. The electronic device may be a conventional computing device or may be a computing device carrying a blockchain node.
A method for implementing a blockchain gateway as shown in fig. 1B includes:
s101, analyzing the obtained service request by a contract analyzing unit, and coding the service request based on a method name and parameters of a target intelligent contract to be called so as to generate contract structure content.
The service request may be a service request directly initiated by a development user through an electronic device with a gateway, or may be a service request acquired from a corresponding client by using the electronic device with the gateway including a contract parsing unit as a server. That is, a common user generates a service request through a client; and the service end acquires the service request from the client.
The service request comprises a service uplink request and a service inquiry request. It should be noted that, the service query request may directly obtain the query result, and may also uplink store the entire query process.
Illustratively, the contract parsing unit parses the service request to obtain service requirement association information of the service request; determining a target intelligent contract to be called according to the business demand correlation information; determining a function signature and input parameters based on the method name and parameters of the target intelligent contract to be called; the function signature and the input parameters are encoded to generate contract structure content such that the generated content is capable of adapting to a format required by an intelligent contract invocation supported by the blockchain network.
It should be noted that a development user may be understood as a user who develops and deploys the intelligent contracts on the blockchain network, or further manages the intelligent contracts. A generic user may be understood as a user who has the intelligent contract invocation requirements to handle a service request.
S102, the contract analysis unit transmits the contract structure content to a block chain node through an intelligent contract calling bridge so as to request the block chain node to call the target intelligent contract according to the contract structure content to execute service processing.
The intelligent contract invoking bridge may be understood as a Software interface, and communicates with nodes in the ethernet block chain network by using an SDK (Software Development Kit) in the ethernet official language, initiates a transaction request of an intelligent contract, and feeds back an execution result of the intelligent contract.
The contract analysis unit sends the contract structure content to the intelligent contract calling bridge; the intelligent contract invoking bridge transmits the received contract structure content to at least one blockchain node in the blockchain network to request the blockchain node to invoke the target intelligent contract to execute business processing according to the contract structure content.
For example, the block link point calls a target intelligent contract according to the contract structure content to perform business processing, and may be: and the block link point encapsulates the contract structure content into a transaction request, invokes a target intelligent contract according to the transaction request to execute the transaction request, obtains an execution result, packages the execution result into the block, and sends the transaction request and the execution result to other nodes for the other nodes to execute and verify.
Or, optionally, after encapsulating the contract structure content into a transaction request, the block link node may also transmit the transaction request to the block link network, receive the transaction request by another node in the block link network, and invoke the target intelligent contract according to the transaction request to obtain an execution result.
It can be understood that, because one intelligent contract invoking bridge can communicate with the contract parsing units of multiple gateways at the same time, when the contract parsing unit generates the contract structure content, the gateway signature of the contract parsing unit can be added, which is convenient for the intelligent contract invoking bridge to accurately feed back the execution result according to the gateway signature. Alternatively, the contract address of the intelligent contract deployed in the blockchain by the gateway can be added to the contract structure content, so that the intelligent contract calling bridge accurately calls the intelligent contract and gets feedback.
And S103, the contract analysis unit receives an execution result of the block chain node after the target intelligent contract is called through the intelligent contract calling bridge.
When the block chain link points call the target intelligent contract to execute the service processing, and after an execution result is obtained, the execution result is sent to an intelligent contract calling bridge; and the intelligent contract invoking bridge feeds back the execution result to the contract analysis unit.
And S104, the contract analysis unit analyzes the execution result and responds to the service request.
And when the contract analysis unit receives the execution result, analyzing the execution result into a result in a user readable form, and presenting the analyzed execution result to the user.
It can be understood that, when the service request is directly sent out by the development user through the electronic device with the gateway, the analyzed execution result is directly presented through the electronic device; when the service request is initiated to the service end with the gateway by the common user through the client, the service end with the contract analysis unit feeds back the analysis result to the client initiating the service request, and the client presents the service request to the common user.
When the service request is a transaction request of a transaction type, after contract structure content is generated, the contract analysis unit transmits the contract structure content to a block chain node through an intelligent contract calling bridge, receives a transaction hash value of the transaction request synchronously returned through the intelligent contract calling bridge, and determines whether the transaction is finished or not through receipt of the transaction hash value. For example, a chain inquiry may be made as to whether the transaction has been linked.
In the embodiment of the application, the acquired service request is analyzed by the contract analysis unit, and the service request is coded based on the method name and the parameters of the target intelligent contract to be called so as to generate contract structure content; transmitting the contract structure content to the blockchain node through the intelligent contract calling bridge to request the blockchain node to call a target intelligent contract to execute business processing according to the contract structure content; and the contract analysis unit analyzes the execution result and responds to the service request. According to the technical scheme, the service request is automatically analyzed and coded through the contract analysis unit to obtain the contract structure content, so that the block chain network can directly call the target intelligent contract for processing, the execution result of the block chain link point call target intelligent contract received by the intelligent contract call bridge is analyzed through the contract analysis unit, the service request is responded, the operation difficulty of technical personnel for calling the service logic deployed in the block chain network is reduced, the technical threshold of the technical personnel for calling the intelligent contract is lowered, the call mode of the block chain intelligent contract is further optimized, and the convenience for calling the intelligent contract is improved.
On the basis of the technical solutions of the above embodiments, when a service request is a service query request, in order to facilitate a service request initiator to obtain rich and comprehensive information in time, the service query request may also be recorded into a subscription pool by an event subscription unit, and a query monitoring event is registered to a block link point to request feedback when a query event meeting a condition occurs in the block link point; the event subscription unit provides the fed-back query data as an execution result to the contract analysis unit.
Specifically, the event subscription unit maintains an event subscription pool, when a user initiates a subscription, a service query request is added to the subscription pool, the subscription pool creates a Websocket monitor on a block chain node for each subscription, the subscription pool receives event data after the event is triggered, the event subscription unit feeds the event data back to the contract analysis unit, and the contract analysis unit analyzes the event data and then pushes the event data to the subscription user.
Illustratively, registering the snoop event to the block chain node may be the event subscribing unit itself, registering the snoop of the event associated with the service query request to the block chain node, or registering the snoop of the event associated with the service query request to the block chain node through an intelligent contract invoking bridge. The association event may be an execution event of at least one of requests of the same type as the service query request, requests of the same content, requests associated with the content of the service query request, and requests associated with the service query request initiator or the target inquirer.
Example two
Fig. 2 is a flowchart of a method for implementing a blockchain gateway in the second embodiment of the present application, where the second embodiment of the present application performs optimization and improvement on the basis of the technical solutions of the foregoing embodiments.
Further, after the contract analysis unit transfers the contract structure content to the block chain node through the intelligent contract call bridge, the node management unit is added to acquire the state information of at least one block chain node in the node pool; and the node management unit determines the block chain link points' for processing the current contract structure content according to the state information so as to enrich the node determination function of the gateway.
A method for implementing a blockchain network as shown in fig. 2 includes:
s201, the contract analysis unit analyzes the acquired service request, and codes the service request based on the method name and the parameters of the target intelligent contract to be called so as to generate contract structure content.
S202, the node management unit acquires the state information of at least one block chain node in the node pool.
The gateway system locally maintains a node pool for recording a plurality of block chain nodes which have communication relations with the gateway system. Wherein the communication relationship is implemented by the intelligent contract invocation bridge bi-directional communication between the gateway system and the blockchain network.
It will be appreciated that when the intelligent contract invoking bridge is capable of communicating with different blockchain networks, the blockchain nodes in the node pool may be from the same blockchain network or from different blockchain networks.
In an optional implementation manner of the embodiment of the present application, the obtaining of the state information of at least one block chain node in the node pool may be: the node management unit communicates with a plurality of block chain link points in a block chain network according to a set rule to acquire state information of each block chain node.
Illustratively, a polling manner may be adopted to send a heartbeat signal to at least one blockchain node, and the state information of each blockchain node is determined according to a feedback result of the heartbeat signal.
And S203, the node management unit determines a block chain node for processing the current contract structure content according to the state information.
Optionally, the state information includes load state information of the blockchain node, and is used to characterize a current data throughput of the blockchain node. When the current data processing amount is large, it indicates that overload may occur when the block link point continues to add service processing, and the service processing efficiency will be reduced, and at this time, it is not suitable to use the block link point to perform service processing of the service request; when the current data processing amount is small, it indicates that the influence of the continuous service addition of the block link point on the service processing efficiency is not large, so that the service processing of the service request can be performed.
It can be understood that, determining the block chain node for processing the current contract structure content according to the load state information of each block chain node is beneficial to load balancing in the block chain network, thereby ensuring the service processing efficiency of the block chain network.
Optionally, the state information may further include communication state information of the blockchain node, so as to characterize a current accessible condition of the blockchain node. When the communication state information of the block chain node is not obtained or is obtained to be abnormal, the abnormal conditions that the block chain node is not started or offline and the like are shown, and normal communication with the electronic equipment bearing the gateway system cannot be carried out, so that the block chain node is not suitable for carrying out service processing of the service request; when the obtained communication state information of the block chain node is in a normal state, the communication channel between the block chain node and the electronic equipment bearing the gateway system is indicated to be normal, so that the block chain node can be adopted to perform service processing of the service request.
It can be understood that, according to the communication state information of each block chain node, the block chain link point for processing the current contract structure content is determined, so that the condition that the contract structure content cannot be sent to the block chain link point with a poor communication state or an abnormal communication state is avoided, and the time cost for resending the contract structure content for multiple times due to the fact that the contract structure content cannot be executed smoothly is reduced.
In an optional implementation manner of the embodiment of the present application, in order to enable a user to effectively control the current state of each block chain node, when a block chain node point with abnormal state information is monitored, the node management unit may further initiate an abnormal alert. For example, a blockchain node disconnects communication.
And S204, the contract analysis unit transmits the contract structure content to a block chain node through an intelligent contract calling bridge so as to request the block chain node to call the target intelligent contract according to the contract structure content to execute service processing.
And S205, the contract analysis unit receives an execution result of the block chain node after the target intelligent contract is called by the intelligent contract calling bridge.
And S206, the contract analysis unit analyzes the execution result and responds to the service request.
In the embodiment of the application, before the contract analysis unit transmits the contract structure content to the block chain nodes through the intelligent contract calling bridge, the state information of at least one block chain node in the node pool is acquired through the node management unit; the node management unit determines a blockchain node for processing the current contract structure content according to the state information. According to the technical scheme, the node management unit is deployed to determine the block chain link points for processing the current contract structure content, so that data support is provided for the destination for sending the contract structure content by the intelligent contract calling bridge, the determination mechanism of the block chain link points is perfected, and guarantee is provided for balanced distribution of tasks executed by each block chain node in the block chain network.
EXAMPLE III
Fig. 3 is a flowchart of an implementation method of a blockchain gateway in the third embodiment of the present application, and the embodiment of the present application performs optimization and improvement on the basis of the technical solutions of the foregoing embodiments.
Further, before the contract analysis unit transfers the contract structure content to the block chain node through the intelligent contract invoking bridge, a count management unit is added to determine a current count value according to a previous count value of an initiator account, and the current count value is added to the contract structure content; the initiator account corresponds to the initiator of the service request in a one-to-one or one-to-many way; the counting value is sequentially increased in order to enrich the node counting function of the gateway.
A method for implementing a blockchain gateway shown in fig. 3 includes:
s301, the contract analysis unit analyzes the acquired service request, and codes the service request based on the method name and parameters of the target intelligent contract to be called so as to generate contract structure content.
S302, the counting management unit determines the counting value of the current time according to the previous counting value of the initiator account, and adds the counting value of the current time to the contract structure content.
The initiator account corresponds to the initiator of the service request in a one-to-one or one-to-many way; the count value is sequentially incremented.
The initiator account may be understood as an account corresponding to the gateway system and registered in the blockchain, and the initiator of the service request may be understood as a general user using the gateway system. When the electronic device bearing the gateway system provides a service for an account of a certain common user as a platform to provide service for other common users, the account of the initiator and the initiator of the service request may be in a one-to-one or one-to-many relationship.
Illustratively, the count management unit obtains a previous count value (nonce) of the initiator account after the contract parsing unit generates the contract structure content, and adds one to the previous count value to determine the current count value; the count value is added into the contract structure content to identify the execution sequence of the contract structure content, so that the sequential execution of the service requests is ensured under the condition that the same initiator account sequentially initiates a plurality of service requests, and the condition that the execution of the subsequent service request is blocked because the prior service request is not executed when the execution of the subsequent service request needs the execution result of the prior service request is avoided. In addition, under the condition of high concurrency of service requests, the counting value with the sequential ascending characteristic can be introduced to ensure that each service request can be effectively processed.
Optionally, the gateway system locally caches a count value of the initiator account in the count management unit, and when the initiator account initiates a request again, accumulates the count value in the cache and adds the count value to the contract structure content.
Because the same initiator account can access the block chain network through different gateway systems, the previous count value cached locally by the count management unit may not be accurate, and therefore, a count value updating mechanism can be introduced to ensure the accuracy of the count value of each initiator account.
Optionally, the count management unit initiates a count value correction query request to a block link point through the intelligent contract invoking bridge to query a latest count value recorded by the initiator account in the block chain; and the counting management unit updates the local previous counting value according to the latest counting value.
And S303, the contract analysis unit transmits the contract structure content to a block chain node through an intelligent contract calling bridge so as to request the block chain node to call the target intelligent contract according to the contract structure content to execute service processing.
And S304, the contract analysis unit receives an execution result of the block chain node after the target intelligent contract is called through the intelligent contract calling bridge.
S305, the contract analysis unit analyzes the execution result and responds to the service request.
According to the technical scheme of the embodiment of the application, before the contract analysis unit transfers the contract structure content to the block chain node through the intelligent contract calling bridge, the count management unit is added to determine the count value according to the previous count value of the initiator account, the count value is added to the related content of the contract structure content, and the sequential execution of the contract structure content in the block chain network is guaranteed through the characteristic that the count value is sequentially increased.
Example four
Fig. 4 is a flowchart of an implementation method of a blockchain gateway in the fourth embodiment of the present application, and the embodiment of the present application performs optimization and improvement on the basis of the technical solutions of the foregoing embodiments.
Further, before the contract analysis unit transfers the contract structure content to a block chain node through an intelligent contract call bridge, additionally monitoring the contract structure content to be chain-linked by the transaction management unit if the service request is a service chain-linking request; correspondingly, after executing the contract structure content transmitted to the block chain node, the transaction management unit is added to obtain the transaction identifier of the transaction data generated after the block chain node calls the target intelligent contract according to the contract structure content to execute service processing; the transaction management unit monitors the uplink state of the transaction data according to the transaction identifier; and if the business data uplink fails or the execution times out, retransmitting the contract structure content to a block link point so as to enrich the business management function of the gateway.
A method for implementing a blockchain gateway as shown in fig. 4 includes:
s401, the contract analysis unit analyzes the acquired service request, and codes the service request based on the method name and the parameters of the target intelligent contract to be called so as to generate contract structure content.
S402, if the service request is a service uplink request, the transaction management unit starts monitoring on the contract structure content to be uplink.
It should be noted that, when the service request is a service uplink request, after the contract structure content corresponding to the service uplink request is generated, the transaction management unit starts monitoring to monitor a processing procedure of the contract structure content, that is, a service uplink procedure, so as to ensure effective execution of the service uplink request. Wherein, the uplink service request can be a transaction type transaction request.
And S403, the contract analysis unit transmits the contract structure content to a block chain node through an intelligent contract calling bridge so as to request the block chain node to call the target intelligent contract according to the contract structure content to execute service processing.
S404, the transaction management unit acquires the transaction identifier of the transaction data generated after the block chain node calls the target intelligent contract to execute the service processing according to the contract structure content.
After the block chain node processes the uplink transaction request of the business, generating transaction data and a transaction identifier of the transaction data, and feeding back the transaction identifier to the transaction management unit; the transaction management unit obtains the transaction identification.
S405, the transaction management unit monitors the uplink state of the transaction data according to the transaction identifier.
The transaction management unit inquires the transaction identifier from the blockchain or inquires the transaction identifier from the blockchain through an intelligent contract calling bridge so as to monitor the uplink state of the transaction data.
S406, if the uplink of the transaction data fails or the execution times out, retransmitting the contract structure content to a block link point.
When the transaction identifier can be queried in the blockchain, indicating that the uplink service request is successfully executed; when the transaction identifier is not queried, it indicates that the service uplink request is executed inefficiently due to the conditions of execution failure or execution timeout, and so on, and therefore the contract analysis unit needs to call the bridge through the intelligent contract to resend the contract structure content to the block chain node for execution until the execution is successful.
And S407, the contract analysis unit receives an execution result of the block chain node after the target intelligent contract is called by the intelligent contract calling bridge.
And S408, the contract analysis unit analyzes the execution result and responds to the service request.
In the embodiment of the application, before the contract analysis unit can transfer the contract structure content to the block chain node through the intelligent contract transfer bridge and the intelligent contract transfer bridge, when the service request is a service uplink request, the transaction management unit starts monitoring on the contract structure content with the uplink, and after the contract structure content is transferred to the block chain node, the transaction management unit acquires a transaction identifier of transaction data generated after the block chain node transfers a target intelligent contract according to the contract structure content to execute service processing, so that the execution of the contract structure content and the uplink condition of an execution result are monitored according to the transaction identifier; the contract structure content is retransmitted to the block chain node when the uplink fails or the execution time is out, so as to ensure the effective execution of the business uplink request.
On the basis of the technical solutions of the above embodiments, there may be a phenomenon that the count value is discontinuous. In order to avoid the above situation, the transaction management unit may monitor the continuous condition of the count value in advance, and when the discontinuous condition of the count value is monitored, supplement the count value of the discontinuous part, that is, generate an empty transaction request, so as to ensure normal processing of the contract structure content and reduce the waiting time.
Illustratively, the transaction management unit monitors the count value in the contract structure content and determines whether there is a discontinuous empty count value; if an empty count value exists, the transaction management unit invokes a bridge request block link point through the intelligent contract to generate an empty transaction request corresponding to the empty count value.
EXAMPLE five
Fig. 5 is a block diagram of an implementation apparatus of a blockchain gateway in the fifth embodiment of the present application, and the embodiment of the present application is applied to a case where an intelligent contract deployed in a blockchain network is called by the gateway system 10 shown in fig. 1A. The apparatus is implemented by software and/or hardware, and is specifically configured in an electronic device. The electronic device may be a conventional computing device or may be a computing device carrying a blockchain node.
An apparatus 500 for implementing a blockchain gateway as shown in fig. 5 includes: a contract parsing unit 501. Wherein, the first and the second end of the pipe are connected with each other,
a contract parsing unit 501, configured to parse the obtained service request, and encode the service request based on a method name and parameters of a target intelligent contract to be called, so as to generate contract structure content;
the contract analysis unit 501 is further configured to transmit the contract structural content to a block chain node through an intelligent contract invoking bridge, so as to request the block chain node to invoke the target intelligent contract according to the contract structural content to perform service processing;
the contract analysis unit 501 is further configured to receive an execution result after the block link point calls the target intelligent contract through the intelligent contract calling bridge;
the contract parsing unit 501 is further configured to parse the execution result and respond to the service request.
In the embodiment of the application, the acquired service request is analyzed by the contract analysis unit, and the service request is coded based on the method name and the parameters of the target intelligent contract with call to generate contract structure content; transmitting the contract structure content to the blockchain node through the intelligent contract calling bridge to request the blockchain node to call a target intelligent contract according to the contract structure content to execute business processing; and analyzing the execution result and responding to the service request. According to the technical scheme, the service request is automatically analyzed and coded through the contract analysis unit to obtain the contract structure content, so that the block chain network can directly call the target intelligent contract for processing, the execution result of the block chain link point call target intelligent contract received by the intelligent contract call bridge is analyzed through the contract analysis unit, the service request is responded, the operation difficulty of technical personnel for calling the service logic deployed in the block chain network is reduced, the technical threshold of the technical personnel for calling the intelligent contract is lowered, the call mode of the block chain intelligent contract is optimized, and the convenience for calling the intelligent contract is improved.
Further, the service request includes a service uplink request and a service inquiry request.
Further, the contract parsing unit 501 is further configured to:
before analyzing the obtained service request, the service request is obtained from a corresponding client as a server;
correspondingly, the contract parsing unit 501, when parsing the execution result and responding to the service request, is specifically configured to:
and analyzing the execution result, and feeding back the analysis result to the client initiating the service request.
Further, if the service request is a transaction request of a transaction type, the contract parsing unit 501 is further configured to:
sending the transaction request to a blockchain node through the intelligent contract invoking bridge;
and receiving a transaction hash value of the transaction request synchronously returned by the intelligent contract calling bridge, and determining whether the transaction is finished or not through a receipt of the transaction hash value.
Further, the apparatus further includes a node management unit, configured to:
before the contract analysis unit 501 transfers the contract structure content to the blockchain node through the intelligent contract transfer bridge, state information of at least one blockchain node in the node pool is acquired;
and determining a block chain node for processing the current contract structure content according to the state information.
Further, the status information includes: load state information of the block chain nodes and communication state information of the block chain nodes;
correspondingly, when executing the acquiring of the state information of at least one block chain node in the node pool, the node management unit is specifically configured to:
and communicating with a plurality of block chain nodes in the block chain network according to a set rule so as to acquire the state information of each block chain node.
Further, the node management unit is further configured to:
and initiating an abnormal prompt at the block link point where the state information is monitored to be abnormal.
Further, the apparatus further comprises a count management unit configured to:
before the contract analysis unit 501 transfers the contract structure content to the block link point through the intelligent contract transfer bridge, determining a current count value according to a previous count value of an initiator account, and adding the current count value to the contract structure content;
the initiator account corresponds to the initiator of the service request in a one-to-one or one-to-many way; the count value is sequentially incremented.
Further, the count management unit is further configured to:
initiating a count value correction query request to a block chain node through the intelligent contract calling bridge to query the latest count value recorded by the initiator account in the block chain;
and updating the local previous count value according to the latest count value.
Further, the apparatus further comprises a transaction management unit configured to:
before the contract analysis unit 501 transmits the contract structure content to a block chain node through an intelligent contract calling bridge, when the service request is a service chaining request, monitoring is started on the contract structure content to be chained;
correspondingly, the transaction management unit is further configured to:
after the contract analysis unit 501 transmits the contract structure content to a block chain node, acquiring a transaction identifier of transaction data generated after the block chain node invokes the target intelligent contract according to the contract structure content to perform service processing;
monitoring the uplink state of the transaction data according to the transaction identifier;
and retransmitting the contract structure content to a block link point when the business data uplink fails or is executed in time-out.
Further, the transaction management unit is further configured to:
before the contract analysis unit 501 transfers the contract structure content to a block chain node through an intelligent contract calling bridge, monitoring a count value in the contract structure content, and judging whether a discontinuous empty count value exists;
and when the null count value exists, invoking a bridge request block chain link point through the intelligent contract to generate a null transaction request corresponding to the null count value.
Further, the apparatus further includes an event subscription unit, configured to:
when the service request is a service query request, recording the service query request into a subscription pool, and registering a query monitoring event to the block chain nodes to request feedback when the query event meeting the conditions occurs in the block chain nodes;
and providing the fed-back query data as an execution result to the contract analysis unit.
The device for implementing the blockchain gateway can execute the method for implementing the blockchain gateway provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects for executing the method for implementing the blockchain gateway.
Example six
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 6 is a block diagram of an electronic device implementing a method for implementing a block chain gateway according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 6, the electronic apparatus includes: one or more processors 601, memory 602, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing some of the necessary operations (e.g., as an array of servers, a group of blade servers, or a multi-processor system). In fig. 6, one processor 601 is taken as an example.
The memory 602 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the method for implementing a blockchain gateway provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform an implementation method of a blockchain gateway provided by the present application.
The memory 602, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules (e.g., the contract parsing unit 501 shown in fig. 5) corresponding to the implementation method of the blockchain gateway in the embodiments of the present application. The processor 601 executes various functional applications and data processing of the server by running non-transitory software programs, instructions and modules stored in the memory 602, that is, implements the implementation method of the blockchain gateway in the above method embodiments.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of an electronic device implementing the block chain gateway, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 602 optionally includes memory located remotely from the processor 601, and these remote memories may be connected over a network to an electronic device implementing the method of blockchain gateway. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device implementing the method for implementing a blockchain gateway may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected by a bus or other means, and fig. 6 illustrates the connection by a bus as an example.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function control of an electronic apparatus implementing the implementation method of the blockchain gateway, such as an input device like a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer, one or more mouse buttons, a track ball, a joystick, etc. The output devices 604 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
In the embodiment of the application, the contract analysis unit analyzes the acquired service request, and codes the service request based on the method name and the parameters of the target intelligent contract with call to generate contract structure content; transmitting the contract structure content to the block chain nodes through the intelligent contract calling bridge so as to request the block chain nodes to call a target intelligent contract according to the contract structure content to execute business processing; and the contract analysis unit analyzes the execution result and responds to the service request. According to the technical scheme, the business request is automatically analyzed and coded through the contract analysis unit to obtain the contract structure content, so that the block chain network can directly call the target intelligent contract for processing, the execution result of calling the target intelligent contract through the block chain link points received by the intelligent contract calling bridge is analyzed through the contract analysis unit, the business request is responded, the operation difficulty of calling the business logic deployed in the block chain network by technical personnel is reduced, the technical threshold of calling the intelligent contract by the technical personnel is lowered, the calling mode of the block chain intelligent contract is further optimized, and the convenience of calling the intelligent contract is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (14)

1. A method for implementing a blockchain gateway includes:
the contract analysis unit analyzes the acquired service request, and codes the service request based on the method name and parameters of the target intelligent contract to be called so as to generate contract structure content;
the counting management unit determines a current counting value according to a previous counting value of the initiator account, and adds the current counting value to the contract structure content; the initiator account corresponds to the initiator of the service request in a one-to-one or one-to-many way; the counting value is sequentially increased and used for identifying the execution sequence of the contract structure content;
the contract analysis unit transmits the contract structure content to a block chain node through an intelligent contract calling bridge so as to request the block chain node to call the target intelligent contract according to the contract structure content to execute service processing;
the contract analysis unit receives an execution result of the block chain link point calling the target intelligent contract through the intelligent contract calling bridge;
and the contract analysis unit analyzes the execution result and responds to the service request.
2. The method of claim 1, wherein the service request comprises a service uplink request and a service query request.
3. The method according to claim 1 or 2, characterized in that:
before the contract analysis unit analyzes the acquired service request, the method further comprises the following steps: the contract analysis unit is used as a server and acquires the service request from a corresponding client;
correspondingly, the contract parsing unit parses the execution result, and responding to the service request includes:
and the contract analysis unit analyzes the execution result and feeds back the analysis result to the client initiating the service request.
4. The method of claim 2, wherein if the service request is a transaction request of a transaction type, the method further comprises:
the contract analysis unit sends the transaction request to a block chain node through the intelligent contract invoking bridge;
the contract analysis unit receives a transaction hash value of a transaction request synchronously returned by the intelligent contract calling bridge, and determines whether the transaction is completed or not through a receipt of the transaction hash value.
5. The method of claim 1, wherein the contract parsing unit, prior to transmitting the contract structure content to blockchain nodes via an intelligent contract invocation bridge, further comprises:
the node management unit acquires the state information of at least one block chain node in the node pool;
the node management unit determines a blockchain node for processing the current contract structure content according to the state information.
6. The method of claim 5, wherein the status information comprises: load state information of the block link nodes and communication state information of the block link nodes;
the node management unit acquires the state information of at least one block chain node in the node pool, and the method comprises the following steps:
the node management unit communicates with a plurality of block chain nodes in a block chain network according to a set rule so as to acquire state information of each block chain node.
7. The method of claim 6, further comprising:
and if the node management unit monitors that the state information of the abnormal block chain link points occurs, initiating abnormal reminding.
8. The method of claim 1, further comprising:
the counting management unit initiates a counting value correction query request to a block chain link point through the intelligent contract invoking bridge so as to query the latest counting value recorded by the initiator account in the block chain;
and the counting management unit updates the local previous counting value according to the latest counting value.
9. The method of claim 2, wherein the contract parsing unit, prior to transmitting the contract structure content to blockchain nodes via an intelligent contract invocation bridge, further comprises:
if the service request is a service uplink request, the transaction management unit starts monitoring on the contract structure content to be uplink;
correspondingly, after the contract structure content is transmitted to the blockchain node, the method further comprises the following steps:
the transaction management unit acquires a transaction identifier of transaction data generated after the block link point calls the target intelligent contract to execute service processing according to the contract structure content;
the transaction management unit monitors the uplink state of the transaction data according to the transaction identifier;
and if the business data uplink fails or the execution times out, retransmitting the contract structure content to a block link point.
10. The method of claim 9, wherein the contract parsing unit further comprises, before transmitting the contract structure content to a blockchain node via an intelligent contract invocation bridge:
the transaction management unit monitors the count value in the contract structure content and judges whether a discontinuous empty count value exists or not;
if an empty count value exists, the transaction management unit invokes a bridge request block link point through the intelligent contract to generate an empty transaction request corresponding to the empty count value.
11. The method of claim 2, further comprising:
if the service request is a service query request, the event subscription unit records the service query request into a subscription pool, registers a query monitoring event to the block link points, and feeds back when the query event meeting the conditions occurs in the block link points;
the event subscription unit provides the fed-back query data as an execution result to the contract analysis unit.
12. An apparatus for implementing a blockchain gateway, comprising:
the contract analysis unit is used for analyzing the acquired service request and coding the service request based on the method name and the parameters of the target intelligent contract to be called so as to generate contract structure content;
the contract analysis unit is further used for transmitting the contract structure content to a block chain node through an intelligent contract calling bridge so as to request the block chain node to call the target intelligent contract according to the contract structure content to execute business processing;
the counting management unit is used for determining a current counting value according to the previous counting value of the initiator account and adding the current counting value into the contract structure content; the initiator account corresponds to the initiator of the service request in a one-to-one or one-to-many manner; the counting value is sequentially increased and used for identifying the execution sequence of the contract structure content;
the contract analysis unit is also used for receiving an execution result after the block chain link point calls the target intelligent contract through the intelligent contract calling bridge;
and the contract analysis unit is also used for analyzing the execution result and responding to the service request.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of implementing a blockchain gateway as claimed in any one of claims 1 to 11.
14. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform a method of implementing a blockchain gateway according to any one of claims 1 to 11.
CN202010074581.9A 2020-01-22 2020-01-22 Method, device, gateway and medium for realizing block chain gateway Active CN113162848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010074581.9A CN113162848B (en) 2020-01-22 2020-01-22 Method, device, gateway and medium for realizing block chain gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010074581.9A CN113162848B (en) 2020-01-22 2020-01-22 Method, device, gateway and medium for realizing block chain gateway

Publications (2)

Publication Number Publication Date
CN113162848A CN113162848A (en) 2021-07-23
CN113162848B true CN113162848B (en) 2022-11-01

Family

ID=76881620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010074581.9A Active CN113162848B (en) 2020-01-22 2020-01-22 Method, device, gateway and medium for realizing block chain gateway

Country Status (1)

Country Link
CN (1) CN113162848B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626524A (en) * 2021-08-12 2021-11-09 浙江网商银行股份有限公司 Data processing method and device and data checking system
CN113766034B (en) * 2021-09-15 2024-02-02 城云科技(中国)有限公司 Business processing method and device based on block chain
CN113973115B (en) * 2021-10-28 2024-02-27 南方电网科学研究院有限责任公司 Custom certificate circulation method and related device thereof
CN115208956B (en) * 2022-06-23 2023-06-02 北京链道科技有限公司 Implementation method of block chain gateway

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109376541A (en) * 2018-09-21 2019-02-22 上海点融信息科技有限责任公司 For running the method, apparatus and computer storage medium of intelligent contract
CN109683869A (en) * 2018-12-29 2019-04-26 北京阿斯特时代科技有限公司 The development approach and device of DAPP
CN110177079A (en) * 2019-04-17 2019-08-27 北京百度网讯科技有限公司 The calling system and call method of intelligent contract

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10491375B2 (en) * 2017-10-05 2019-11-26 Accenture Global Solutions Limited Secure verification of conditions of a contract using a set of verification tools
US11475422B2 (en) * 2018-03-28 2022-10-18 Bank Of America Corporation Blockchain-based property management

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109376541A (en) * 2018-09-21 2019-02-22 上海点融信息科技有限责任公司 For running the method, apparatus and computer storage medium of intelligent contract
CN109683869A (en) * 2018-12-29 2019-04-26 北京阿斯特时代科技有限公司 The development approach and device of DAPP
CN110177079A (en) * 2019-04-17 2019-08-27 北京百度网讯科技有限公司 The calling system and call method of intelligent contract

Also Published As

Publication number Publication date
CN113162848A (en) 2021-07-23

Similar Documents

Publication Publication Date Title
CN113162848B (en) Method, device, gateway and medium for realizing block chain gateway
CN111831420B (en) Method for task scheduling, related device and computer program product
KR102415845B1 (en) Internet of Things Resource Subscription Methods, Devices, and Systems
KR20220079958A (en) Blockchain message processing method and device, computer and readable storage medium
US10454795B1 (en) Intermediate batch service for serverless computing environment metrics
CN111858248A (en) Application monitoring method, device, equipment and storage medium
CN101448004A (en) Method, server and system based on instant messaging for releasing user state
JP2023520057A (en) METHOD, APPARATUS, ELECTRONIC DEVICE, SYSTEM AND STORAGE MEDIUM FOR MICROSERVICE COMPOSITION
CN112491617B (en) Link tracking method, device, electronic equipment and medium
EP3457668B1 (en) Clustering in unified communication and collaboration services
CN111200606A (en) Deep learning model task processing method, system, server and storage medium
CN110874666A (en) Method, system, equipment and storage medium for distributing articles
CN114827280A (en) Request processing method, device, equipment and medium
CN111770176B (en) Traffic scheduling method and device
CN111510480B (en) Request sending method and device and first server
US9703646B2 (en) Centralized database system
CN110727736A (en) Data synchronization method and device, electronic equipment and storage medium
WO2023147716A1 (en) Flow control and billing methods, apparatuses and system, electronic device, medium and product
CN110659184B (en) Health state checking method, device and system
US8892746B2 (en) Asynchronous invocation mechanism in session initiation protocol (SIP) server clusters
CN113923258A (en) Data processing method and data processing system
US20110167006A1 (en) Method and system for a real-time case exchange in a service management environment
CN113254097A (en) Configuration information issuing method and device, electronic equipment and storage medium
US9338248B2 (en) Parameter driven value conversion framework in client/server architectures
US20160034919A1 (en) Collection and aggregation of large volume of metrics

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