CN110827037A - Data interaction method and device based on block chain - Google Patents

Data interaction method and device based on block chain Download PDF

Info

Publication number
CN110827037A
CN110827037A CN201911082643.4A CN201911082643A CN110827037A CN 110827037 A CN110827037 A CN 110827037A CN 201911082643 A CN201911082643 A CN 201911082643A CN 110827037 A CN110827037 A CN 110827037A
Authority
CN
China
Prior art keywords
target
block chain
intelligent contract
data
blockchain
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.)
Pending
Application number
CN201911082643.4A
Other languages
Chinese (zh)
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 Haiyi Tongzhan Information Technology Co Ltd
Original Assignee
Beijing Haiyi Tongzhan Information 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 Haiyi Tongzhan Information Technology Co Ltd filed Critical Beijing Haiyi Tongzhan Information Technology Co Ltd
Priority to CN201911082643.4A priority Critical patent/CN110827037A/en
Publication of CN110827037A publication Critical patent/CN110827037A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the disclosure discloses a data interaction method and device based on a block chain. One embodiment of the method comprises: acquiring identification information of a target block chain; acquiring interaction rule information of a target intelligent contract from the target block chain through a pre-installed universal block chain application based on the identification information of the target block chain, wherein the interaction rule information is used for representing an interaction rule of data interaction between a user and the target intelligent contract; and performing data interaction with the target block chain based on the interaction rule information and the universal block chain application. According to the implementation method, the user performs data interaction with the target intelligent contract deployed on the target block chain through the installed universal block chain application according to the interaction rule information of the target intelligent contract, the user can browse and trade the intelligent contract without developing an interaction system of the client and the intelligent contract, and the use cost of the block chain is reduced.

Description

Data interaction method and device based on block chain
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a data interaction method and device based on a block chain.
Background
With the development and improvement of blockchain technology, more and more fields adopt blockchain technology in collaboration services, such as finance, medical treatment, supply chain, energy, judicial law, and the like. In the block chain-based cross-organization collaboration service, all service participants can firstly reach an agreement to generate an intelligent contract, then the intelligent contract is deployed in a block chain, and finally the block chain is responsible for common identification accounting and intelligent contract program execution.
In the related art, each participant of the intelligent contract needs to develop an interactive system between the client and the intelligent contract to realize data interaction between the participant and the intelligent contract at the client. Therefore, each participant of the intelligent contract needs to invest more capital and technology, so that the use cost of the block chain is high, which is hard to be borne by each participant (especially small and medium-sized enterprises).
Disclosure of Invention
The embodiment of the disclosure provides a data interaction method and device based on a block chain.
In a first aspect, an embodiment of the present disclosure provides a data interaction method based on a blockchain, where the method includes: acquiring identification information of a target block chain; acquiring interaction rule information of a target intelligent contract from the target block chain through a pre-installed universal block chain application based on the identification information of the target block chain, wherein the interaction rule information is used for representing an interaction rule of data interaction between a user and the target intelligent contract; and performing data interaction with the target block chain based on the interaction rule information and the universal block chain application.
In some embodiments, the data interaction with the target blockchain based on the interaction rule information and the universal blockchain application includes: generating operation information in response to the operation of the user on the universal blockchain application, wherein the operation information comprises transaction information, data acquisition information and data query information of the target intelligent contract; calling an access interface of a target block chain provided by middleware of a general block chain application, accessing a target intelligent contract through the access interface based on the operation information and the interaction rule information, and acquiring operation result data aiming at the target intelligent contract from the target block chain; and caching the acquired operation result data locally so as to display the operation result data to a user.
In some embodiments, the method further comprises: monitoring a target block chain through a general block chain application; in response to monitoring that the target intelligent contract executes the transaction event, determining whether the transaction event is relevant to the user based on user information of the user; the monitored snoop information is cached locally in response to determining that the transaction event is related to the user.
In some embodiments, the method further comprises: in response to receiving a transaction request of a target intelligent contract sent by a user through a universal blockchain application, acquiring transaction parameters in the transaction request; sending the transaction data to a target block chain so that the target block chain executes a transaction event corresponding to the transaction request in a target intelligent contract according to the acquired transaction parameters to obtain a transaction result; and acquiring a transaction result and storing the acquired transaction result locally.
In some embodiments, obtaining transaction results includes: obtaining verification and consensus results of the target intelligent contract from the target block chain; and obtaining a transaction result of the target intelligent contract in response to determining that the target intelligent contract is verified and agrees.
In some embodiments, the method further comprises: receiving a data query request of a target intelligent contract sent by a user, so that a target block chain selects data contained in the target intelligent contract corresponding to the data query request according to interaction rule information of the target intelligent contract; the selected data is retrieved from the target blockchain and presented to the user.
In some embodiments, the method further comprises: and acquiring a pre-generated general software installation package of the blockchain application, decompressing the general software installation package, and installing the general blockchain application.
In a second aspect, an embodiment of the present disclosure provides a data interaction device based on a blockchain, where the device includes: a first acquisition unit configured to acquire identification information of a target block chain; the second obtaining unit is configured to obtain interaction rule information of the target intelligent contract from the target blockchain through a pre-installed universal blockchain application based on the identification information of the target blockchain, wherein the interaction rule information is used for representing an interaction rule of data interaction between a user and the target intelligent contract; and the data interaction unit is configured to perform data interaction with the target blockchain based on the interaction rule information and the universal blockchain application.
In some embodiments, the data interaction unit is further configured to: generating operation information in response to the operation of the user on the universal blockchain application, wherein the operation information comprises transaction information, data acquisition information and data query information of the target intelligent contract; calling an access interface of a target block chain provided by middleware of a general block chain application, accessing a target intelligent contract through the access interface based on the operation information and the interaction rule information, and acquiring operation result data aiming at the target intelligent contract from the target block chain; and caching the acquired operation result data locally so as to display the operation result data to a user.
In some embodiments, the apparatus further comprises: a listening unit configured to listen to a target block chain through a general block chain application; a determination unit configured to determine whether the transaction event is related to the user based on user information of the user in response to monitoring that the target smart contract executes the transaction event; a caching unit configured to locally cache the monitored snoop information in response to determining that the transaction event is associated with the user.
In some embodiments, the apparatus further comprises: the third acquisition unit is configured to respond to a transaction request of a target intelligent contract sent by a user through a universal blockchain application, and acquire transaction parameters in the transaction request; the sending unit is configured to send the transaction data to the target blockchain, so that the target blockchain executes a transaction event corresponding to the transaction request in the target intelligent contract according to the obtained transaction parameters to obtain a transaction result; and the fourth acquisition unit is configured to acquire the transaction result and store the acquired transaction result locally.
In some embodiments, the fourth obtaining unit is further configured to: obtaining verification and consensus results of the target intelligent contract from the target block chain; and obtaining a transaction result of the target intelligent contract in response to determining that the target intelligent contract is verified and agrees.
In some embodiments, the apparatus further comprises: the receiving unit is configured to receive a data query request of a target intelligent contract sent by a user, so that a target block chain selects data contained in the target intelligent contract corresponding to the data query request according to interaction rule information of the target intelligent contract; a presentation unit configured to obtain the selected data from the target blockchain and present the selected data to a user.
In some embodiments, the apparatus further comprises: and the installation unit is configured to acquire a universal software installation package of the pre-generated blockchain application, decompress the universal software installation package and install the universal blockchain application.
According to the data interaction method and device based on the block chain, the identification information of the target block chain is obtained, the interaction rule information of the target intelligent contract is obtained from the target block chain through the pre-installed universal block chain application based on the identification information of the target block chain, and then data interaction can be carried out with the target block chain based on the obtained interaction rule information and the universal block chain application, so that a user can carry out data interaction with the target intelligent contract arranged on the target block chain through the installed universal block chain application according to the interaction rule information of the target intelligent contract, the user can browse and trade the intelligent contract without developing an interaction system of a client and the intelligent contract, and the use cost of the block chain is reduced.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which some embodiments of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a blockchain based data interaction method according to the present disclosure;
FIG. 3 is a schematic diagram of an application scenario of a blockchain-based data interaction method according to an embodiment of the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a blockchain-based data interaction method according to the present disclosure;
FIG. 5 is a block chain based data interaction device according to one embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 of a blockchain based data interaction method or blockchain based data interaction apparatus to which embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
Parties to the intelligent contract (e.g., small and medium enterprises) as users may interact with a server 105 via a network 104 using terminal devices 101, 102, 103 to receive or transmit data, etc. Various client applications may be installed on the terminal devices 101, 102, 103, such as a general blockchain application, a web browser application, a shopping-type application, a search-type application, an instant messaging tool, a mailbox client, social platform software, and the like. Server 105 may be a server for deploying blockchains.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting information input, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, such as a background server that processes target block chain identification information input by the user through the terminal devices 101, 102, 103 to obtain the intelligent contract interaction rule. The background server may analyze and process the received target block chain identification information and the like, and feed back a processing result (e.g., interaction rule information of an intelligent contract and the like) to the terminal device.
It should be noted that the data interaction method based on the block chain provided by the embodiment of the present disclosure may be executed by the terminal devices 101, 102, and 103. Accordingly, the data interaction device based on the block chain can be arranged in the terminal equipment 101, 102, 103.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules, for example, to provide distributed services, or as a single piece of software or software module. And is not particularly limited herein.
With continued reference to FIG. 2, a flow 200 of one embodiment of a blockchain-based data interaction method in accordance with the present disclosure is shown. The data interaction method based on the block chain comprises the following steps:
step 201, obtaining the identification information of the target block chain.
In this embodiment, after a user establishes a target intelligent contract with other users as participants, the target intelligent contract may be written into a target block chain. In order to enable the user to determine the target intelligent contract in the target blockchain network, the user needs to acquire identification information of the target blockchain. Therefore, an execution subject (for example, the terminal device shown in fig. 1) of the data interaction method based on the blockchain may obtain the identification information of the target blockchain where the target intelligent contract is located from the blockchain network or the like through a wired connection manner or a wireless connection manner.
It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
Step 202, based on the identification information of the target block chain, the interaction rule information of the target intelligent contract is obtained from the target block chain through the pre-installed general block chain application.
In this embodiment, the execution main body (for example, the terminal device shown in fig. 1) may install a general blockchain application in advance, and the execution main body may access the blockchain network in response to a user operating the general blockchain application. Therefore, based on the identification information of the target blockchain acquired in step 201, the execution subject may access the target blockchain in the blockchain network in response to the operation of the user on the general blockchain application, so that the interaction rule information of the target intelligent contract may be acquired from the target intelligent contract deployed on the target blockchain. It should be noted that the interaction rule information may be used to characterize rules for data interaction between the user and the target intelligent contract through the universal blockchain application. The interaction rule information can determine the display form of the target intelligent contract on the execution main body to a certain extent. By way of example, the data interaction rules may include a rule that a user should query relevant data of a target intelligent contract through a general block link (e.g., a rule that queries data by clicking a preset button or inputting a preset rule query keyword, etc.), and a rule that an intelligent contract returns query data (e.g., a rule that returns query data in the form of a table, etc.).
It will be appreciated that the blockchain may typically be written with one or more intelligent contracts, and thus the target blockchain may be written with a plurality of intelligent contracts, and a user may determine the target intelligent contract in which the user participates from the intelligent contracts on the target blockchain when accessing the target blockchain through a general blockchain application installed on the execution subject. If only the target intelligent contract is written in the target block chain, the execution main body can directly access the intelligent contract through the identification information of the target block chain.
In some optional implementation manners of this embodiment, the execution main body may further obtain identification information of a target intelligent contract that a user needs to access while obtaining identification information of the target block chain. Thus, even if multiple intelligent contracts are written on the target blockchain, the user can directly access the target intelligent contract deployed on the target blockchain through the identification information of the target intelligent contract and the general blockchain application. The implementation mode can improve the access speed of the intelligent contract and improve the efficiency of data interaction.
In some optional implementation manners of this embodiment, the execution main body may obtain a generic software installation package of a pre-generated blockchain application, then decompress the generic software installation package, and may install the generic blockchain application on the execution main body. The universal blockchain application can provide functions required by business processing such as state data browsing query of the intelligent contract and intelligent contract transaction execution for the user. Further, the target blockchain may be any blockchain in a blockchain network, the target contract may be any contract on the target blockchain, and it is seen that the universal blockchain application may provide an operating platform of a universal intelligent contract for a user.
In some optional implementations of the embodiment, the interaction rule information of the intelligent contract may be generated before the target intelligent contract is deployed on the target blockchain. The target intelligent contract and the interaction rule information of the target intelligent contract can be deployed on the target block chain at the same time. Therefore, the execution subject can acquire the rule information of the target intelligent contract from the target blockchain through the general blockchain application. The implementation mode binds the interaction rule information of the target intelligent contract and writes the interaction rule information into the block chain, so that the target intelligent contract and the interaction rule information can be simultaneously stored, the storage efficiency is improved, and a user can conveniently and quickly acquire the interaction rule information of the target intelligent contract when interacting with the target intelligent contract.
And 203, performing data interaction with the target block chain based on the interaction rule information and the universal block chain application.
In this embodiment, based on the interaction rule information of the target intelligent contract obtained in step 202, the user may perform data interaction, such as data query, intelligent contract transaction, and the like, with the target blockchain through the general blockchain application installed on the execution subject. Specifically, the executing agent may perform data interaction with a target intelligent contract on a target blockchain according to a rule definition in the acquired interaction rule information.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the data interaction method based on the blockchain according to the present embodiment. In the application scenario of fig. 3, for a target intelligent contract in which a user participates as a participant, after the user installs a general blockchain application on a terminal device, step 301 may be executed to obtain identification information of a target blockchain; then, the terminal device may execute step 302 to obtain interaction rule information of the target intelligent contract from the target blockchain through the installed general blockchain application based on the identification information of the target blockchain; finally, the terminal device may perform step 303 to perform data interaction with the target blockchain based on the acquired interaction rule information and the universal blockchain application installed thereon, as shown in fig. 3.
According to the data interaction method based on the block chain, provided by the embodiment of the disclosure, the interaction rule information of the target intelligent contract is acquired from the target block chain through the pre-installed universal block chain application by acquiring the identification information of the target block chain, and then the data interaction with the target block chain is performed based on the acquired interaction rule information and the universal block chain application, so that a user can perform the data interaction with the target intelligent contract deployed on the target block chain through the installed universal block chain application according to the interaction rule information of the target intelligent contract, the operations of browsing, trading and the like of the user on the intelligent contract can be realized without developing an interaction system of the client and the intelligent contract, and the use cost of the block chain is reduced.
With further reference to FIG. 4, a flow 400 of yet another embodiment of a blockchain-based data interaction method is shown. The flow 400 of the data interaction method based on the blockchain includes the following steps:
step 401, obtaining identification information of a target block chain.
In this embodiment, after a user establishes a target intelligent contract with other users as participants, the target intelligent contract may be written into a target block chain. In order to enable the user to determine the target intelligent contract in the target blockchain network, the user needs to acquire identification information of the target blockchain. Therefore, an execution subject (for example, the terminal device shown in fig. 1) of the data interaction method based on the blockchain may obtain the identification information of the target blockchain where the target intelligent contract is located from the blockchain network or the like through a wired connection manner or a wireless connection manner.
And 402, acquiring interaction rule information of the target intelligent contract from the target block chain through a pre-installed universal block chain application based on the identification information of the target block chain.
In this embodiment, the execution main body (for example, the terminal device shown in fig. 1) may install a general blockchain application in advance, and the execution main body may access the blockchain network in response to a user operating the general blockchain application. Therefore, based on the identification information of the target blockchain acquired in step 401, the execution subject may access the target blockchain in the blockchain network in response to the operation of the user on the general blockchain application, so that the interaction rule information of the target intelligent contract may be acquired from the target intelligent contract deployed on the target blockchain. It should be noted that the interaction rule information may be used to characterize rules for data interaction between the user and the target intelligent contract through the universal blockchain application. The interaction rule information can determine the display form of the target intelligent contract on the execution main body to a certain extent.
Step 403, in response to the operation of the user on the universal blockchain application, generating operation information.
In this embodiment, when the user performs operations such as clicking, browsing, text input, and the like on the universal blockchain application, the execution main body may generate corresponding operation information. Here, the operation information may include transaction information, data acquisition information, and data inquiry information of the target smart contract. The transaction information of the target intelligent contract can be information input by a user to enable the target intelligent contract to execute transaction, and the data acquisition information and the data query information can be information input by the user to enable the target intelligent contract to return acquired data or query data.
Step 404, an access interface of the target block chain provided by the middleware of the universal block chain application is called, the target intelligent contract is accessed through the access interface based on the operation information and the interaction rule information, and operation result data aiming at the target intelligent contract is obtained from the target block chain.
In this embodiment, the universal blockchain application may provide an interface for data acquisition and service data query, such as intelligent contract transaction and data interaction rule information, so that a user may interact with the blockchain network through the universal blockchain application. Based on the operation information generated in step 403, the execution agent may call an access interface of the target blockchain provided by the middleware of the universal blockchain application. Then, the executing body can access the target intelligent contract through the called access interface based on the operation information and the interaction rule information, so that operations such as transaction, data query, data acquisition and the like can be executed on the target intelligent contract according to the operation information. Finally, the execution subject may obtain operation result data for the target intelligent contract from the target blockchain. The operation result data may include a transaction result after transaction is performed according to the transaction information of the target intelligent contract, a data acquisition result obtained by performing data acquisition according to the data acquisition information, and a data query result obtained by performing data query according to the data query information.
Step 405, locally caching the acquired operation result data to display the operation result data to the user.
In this embodiment, based on the operation result data acquired in step 404, the execution main body may locally cache the acquired operation result data, so that the operation result data may be displayed to the user.
In some optional implementations of this embodiment, the execution main body may further listen to the target blockchain through a general blockchain application installed thereon. If the execution main body monitors the target intelligent contract execution transaction event, whether the transaction event is related to the user can be determined based on the user information of the user. If the transaction event is determined to be related to the user, the execution body can locally cache the monitored monitoring information. It will be appreciated that the universal blockchain application may also monitor other events than transaction events, and upon determining that the monitored event is an event associated with a user operating the universal blockchain application, may return the monitored information to the user. According to the implementation mode, the target intelligent contract is monitored through the universal block chain application, so that a user can check the transaction event related to the user in real time, and the user can know the transaction dynamic of the intelligent contract in real time.
In some optional implementation manners of this embodiment, the user may initiate a transaction request to the target intelligent contract through the universal blockchain application, at this time, the execution main body may obtain the transaction parameters in the transaction request, and then the execution main body may send the transaction data to the target blockchain. After receiving the transaction data, the target block chain may execute a transaction event corresponding to the transaction request in the target intelligent contract according to the transaction data and generate a transaction result. The execution agent may obtain a transaction result of the user request transaction from the target blockchain, and store the obtained transaction result locally. Further, the execution main body can also display the transaction result to the user through the universal block chain application. The universal block chain application in the implementation mode is convenient for a user to request a transaction from a target intelligent contract, and a transaction result can be quickly acquired and displayed through the universal block chain application.
In some optional implementations of this embodiment, the execution subject may obtain the transaction result by: obtaining verification and consensus results of the target intelligent contract from the target block chain; in response to determining that the target intelligent contract is validated and agrees, a trading result for the target intelligent contract may be obtained. The realization mode can send the transaction result of the intelligent contract after determining that the target intelligent contract passes the verification and achieves the consensus, thereby improving the safety of the intelligent contract.
In some optional implementations of this embodiment, the operation performed by the user on the universal blockchain application may be a data query operation. At this time, the execution main body may receive a data query request of a target intelligent contract sent by the user, and the target block chain may select data corresponding to the data query request according to interaction rule information of the target intelligent contract after acquiring the data query request. The execution agent may obtain the selected data from the target blockchain and present the selected data to the user through the universal blockchain application according to the interaction rule information. The implementation mode provides a general method for querying data through the general block chain application, intelligent contract participants do not need to separately develop related systems, and the use cost of the block chain is reduced.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the data interaction method based on blockchain in this embodiment highlights the step of performing data interaction with the target blockchain based on the interaction rule information and the common blockchain application. Therefore, the embodiment provides the operation method of the user on the target intelligent contract through the universal block chain application, and the operation result data is displayed through the universal block chain application after the operation result data is acquired.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of a data interaction device based on a block chain, where the embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device may be applied to various electronic devices in particular.
As shown in fig. 5, the data interaction apparatus 500 based on the block chain according to the present embodiment includes: a first acquisition unit 501, a second acquisition unit 502, and a data interaction unit 503. Wherein, the first obtaining unit 501 is configured to obtain identification information of a target block chain; the second obtaining unit 502 is configured to obtain interaction rule information of the target intelligent contract from the target blockchain through a pre-installed universal blockchain application based on the identification information of the target blockchain, wherein the interaction rule information is used for representing an interaction rule of data interaction between a user and the target intelligent contract; the data interaction unit 503 is configured to perform data interaction with the target blockchain based on the interaction rule information and the universal blockchain application.
In some optional implementations of this embodiment, the data interaction unit 503 is further configured to: generating operation information in response to the operation of the user on the universal blockchain application, wherein the operation information comprises transaction information, data acquisition information and data query information of the target intelligent contract; calling an access interface of a target block chain provided by middleware of a general block chain application, accessing a target intelligent contract through the access interface based on the operation information and the interaction rule information, and acquiring operation result data aiming at the target intelligent contract from the target block chain; and caching the acquired operation result data locally so as to display the operation result data to a user.
In some optional implementations of this embodiment, the apparatus 500 further includes: a listening unit configured to listen to a target block chain through a general block chain application; a determination unit configured to determine whether the transaction event is related to the user based on user information of the user in response to monitoring that the target smart contract executes the transaction event; a caching unit configured to locally cache the monitored snoop information in response to determining that the transaction event is associated with the user.
In some optional implementations of this embodiment, the apparatus 500 further includes: the third acquisition unit is configured to respond to a transaction request of a target intelligent contract sent by a user through a universal blockchain application, and acquire transaction parameters in the transaction request; the sending unit is configured to send the transaction data to the target blockchain, so that the target blockchain executes a transaction event corresponding to the transaction request in the target intelligent contract according to the obtained transaction parameters to obtain a transaction result; and the fourth acquisition unit is configured to acquire the transaction result and store the acquired transaction result locally.
In some optional implementations of this embodiment, the fourth obtaining unit is further configured to: obtaining verification and consensus results of the target intelligent contract from the target block chain; and obtaining a transaction result of the target intelligent contract in response to determining that the target intelligent contract is verified and agrees.
In some optional implementations of this embodiment, the apparatus 500 further includes: the receiving unit is configured to receive a data query request of a target intelligent contract sent by a user, so that a target block chain selects data contained in the target intelligent contract corresponding to the data query request according to interaction rule information of the target intelligent contract; a presentation unit configured to obtain the selected data from the target blockchain and present the selected data to a user.
In some optional implementations of this embodiment, the apparatus 500 further includes: and the installation unit is configured to acquire a universal software installation package of the pre-generated blockchain application, decompress the universal software installation package and install the universal blockchain application.
The units recited in the apparatus 500 correspond to the various steps in the method described with reference to fig. 2. Thus, the operations and features described above for the method are equally applicable to the apparatus 500 and the units included therein, and are not described in detail here.
Referring now to fig. 6, shown is a schematic diagram of an electronic device (e.g., terminal device in fig. 1) 600 suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure. It should be noted that the computer readable medium of the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring identification information of a target block chain; acquiring interaction rule information of a target intelligent contract from the target block chain through a pre-installed universal block chain application based on the identification information of the target block chain, wherein the interaction rule information is used for representing an interaction rule of data interaction between a user and the target intelligent contract; and performing data interaction with the target block chain based on the interaction rule information and the universal block chain application.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a first acquisition unit, a second acquisition unit, and a data interaction unit. Where the names of these units do not in some cases constitute a limitation on the unit itself, for example, the first acquisition unit may also be described as a "unit that acquires identification information of a target block chain".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A data interaction method based on a block chain comprises the following steps:
acquiring identification information of a target block chain;
acquiring interaction rule information of a target intelligent contract from the target block chain through a pre-installed universal block chain application based on the identification information of the target block chain, wherein the interaction rule information is used for representing an interaction rule of data interaction between a user and the target intelligent contract;
and performing data interaction with the target block chain based on the interaction rule information and the universal block chain application.
2. The method of claim 1, wherein the interacting data with the target blockchain based on the interaction rule information and the generic blockchain application comprises:
generating operation information in response to the operation of the user on the universal blockchain application, wherein the operation information comprises transaction information, data acquisition information and data query information of the target intelligent contract;
calling an access interface of the target block chain provided by middleware of the universal block chain application, accessing the target intelligent contract through the access interface based on the operation information and the interaction rule information, and acquiring operation result data aiming at the target intelligent contract from the target block chain;
and caching the acquired operation result data locally so as to display the operation result data to the user.
3. The method of claim 1, wherein the method further comprises:
monitoring the target block chain through the universal block chain application;
in response to monitoring that the target intelligent contract executes a transaction event, determining whether the transaction event is related to the user based on user information of the user;
in response to determining that the transaction event is relevant to the user, the monitored intercept information is cached locally.
4. The method of claim 2, wherein the method further comprises:
in response to receiving a transaction request of a target intelligent contract sent by the user through the universal blockchain application, acquiring transaction parameters in the transaction request;
sending the transaction data to the target block chain so that the target block chain executes a transaction event corresponding to the transaction request in the target intelligent contract according to the acquired transaction parameters to obtain a transaction result;
and acquiring the transaction result, and storing the acquired transaction result locally.
5. The method of claim 4, wherein said obtaining the transaction result comprises:
obtaining a verification and consensus result of the target intelligent contract from the target blockchain;
and obtaining a trading result of the target intelligent contract in response to determining that the target intelligent contract is verified and agrees.
6. The method of claim 2, wherein the method further comprises:
receiving a data query request of a target intelligent contract sent by the user, so that the target block chain selects data contained in the target intelligent contract corresponding to the data query request according to interaction rule information of the target intelligent contract;
obtaining the selected data from the target blockchain and presenting the selected data to the user.
7. The method of claim 1, wherein the method further comprises:
and acquiring a pre-generated general software installation package of the blockchain application, decompressing the general software installation package, and installing the general blockchain application.
8. A data interaction device based on a block chain comprises:
a first acquisition unit configured to acquire identification information of a target block chain;
the second obtaining unit is configured to obtain interaction rule information of a target intelligent contract from the target blockchain through a pre-installed universal blockchain application based on the identification information of the target blockchain, wherein the interaction rule information is used for representing an interaction rule of data interaction between a user and the target intelligent contract;
a data interaction unit configured to perform data interaction with the target blockchain based on the interaction rule information and the generic blockchain application.
9. An electronic device/terminal/server comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
CN201911082643.4A 2019-11-07 2019-11-07 Data interaction method and device based on block chain Pending CN110827037A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911082643.4A CN110827037A (en) 2019-11-07 2019-11-07 Data interaction method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911082643.4A CN110827037A (en) 2019-11-07 2019-11-07 Data interaction method and device based on block chain

Publications (1)

Publication Number Publication Date
CN110827037A true CN110827037A (en) 2020-02-21

Family

ID=69553487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911082643.4A Pending CN110827037A (en) 2019-11-07 2019-11-07 Data interaction method and device based on block chain

Country Status (1)

Country Link
CN (1) CN110827037A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112837043A (en) * 2021-03-04 2021-05-25 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and electronic equipment
CN113658003A (en) * 2021-08-17 2021-11-16 工银科技有限公司 Transaction method, device, equipment and storage medium based on block chain network

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140359116A1 (en) * 2013-05-31 2014-12-04 Hon Hai Precision Industry Co., Ltd. Electronic device and data tracking method
CN107147704A (en) * 2017-04-21 2017-09-08 杭州趣链科技有限公司 A kind of generic service middleware system towards block chain
CN108256866A (en) * 2016-12-29 2018-07-06 陈新 Digital asset wallet
CN108288157A (en) * 2018-01-25 2018-07-17 青岛闪收付信息技术有限公司 A kind of supply chain management method based on financial block chain technology
CN108596613A (en) * 2018-03-22 2018-09-28 深圳市网心科技有限公司 block chain transaction processing method, device and storage medium
CN108959335A (en) * 2017-12-08 2018-12-07 翟红鹰 Integral acquisition methods and system based on block chain technology
CN109101241A (en) * 2018-07-06 2018-12-28 深圳付贝科技有限公司 A kind of block chain installation kit generation method and its device, electronic equipment
CN109710627A (en) * 2018-12-29 2019-05-03 中国银联股份有限公司 A kind of Transaction Inquiries method and device based on block chain network
CN109818957A (en) * 2019-01-25 2019-05-28 上海淳麒金融信息服务有限公司 Intelligent contract call method, apparatus and system based on visualization interface

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140359116A1 (en) * 2013-05-31 2014-12-04 Hon Hai Precision Industry Co., Ltd. Electronic device and data tracking method
CN108256866A (en) * 2016-12-29 2018-07-06 陈新 Digital asset wallet
CN107147704A (en) * 2017-04-21 2017-09-08 杭州趣链科技有限公司 A kind of generic service middleware system towards block chain
CN108959335A (en) * 2017-12-08 2018-12-07 翟红鹰 Integral acquisition methods and system based on block chain technology
CN108288157A (en) * 2018-01-25 2018-07-17 青岛闪收付信息技术有限公司 A kind of supply chain management method based on financial block chain technology
CN108596613A (en) * 2018-03-22 2018-09-28 深圳市网心科技有限公司 block chain transaction processing method, device and storage medium
CN109101241A (en) * 2018-07-06 2018-12-28 深圳付贝科技有限公司 A kind of block chain installation kit generation method and its device, electronic equipment
CN109710627A (en) * 2018-12-29 2019-05-03 中国银联股份有限公司 A kind of Transaction Inquiries method and device based on block chain network
CN109818957A (en) * 2019-01-25 2019-05-28 上海淳麒金融信息服务有限公司 Intelligent contract call method, apparatus and system based on visualization interface

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112837043A (en) * 2021-03-04 2021-05-25 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and electronic equipment
CN112837043B (en) * 2021-03-04 2023-07-18 腾讯科技(深圳)有限公司 Block chain-based data processing method and device and electronic equipment
CN113658003A (en) * 2021-08-17 2021-11-16 工银科技有限公司 Transaction method, device, equipment and storage medium based on block chain network
CN113658003B (en) * 2021-08-17 2024-03-29 工银科技有限公司 Transaction method, device, equipment and storage medium based on blockchain network

Similar Documents

Publication Publication Date Title
CN110619078B (en) Method and device for pushing information
CN110781373B (en) List updating method and device, readable medium and electronic equipment
US20220043898A1 (en) Methods and apparatuses for acquiring information
CN111163324B (en) Information processing method and device and electronic equipment
CN110619100B (en) Method and apparatus for acquiring data
CN110619096B (en) Method and apparatus for synchronizing data
CN111443909B (en) Method and device for generating page
CN113505302A (en) Method, device and system for supporting dynamic acquisition of buried point data and electronic equipment
CN109218041B (en) Request processing method and device for server system
CN109992719B (en) Method and apparatus for determining push priority information
CN110827037A (en) Data interaction method and device based on block chain
CN111694629A (en) Information display method and device and electronic equipment
CN111597486A (en) Information processing method and device and electronic equipment
CN111813685B (en) Automatic test method and device
CN111596992B (en) Navigation bar display method and device and electronic equipment
CN111581664B (en) Information protection method and device
CN110619101B (en) Method and apparatus for processing information
CN112256221A (en) Information display method and device and electronic equipment
CN112256372A (en) Information processing method and device and electronic equipment
CN111612135A (en) Method and device for information interaction
CN109144864B (en) Method and device for testing window
CN114840379A (en) Log generation method, device, server and storage medium
CN110113416B (en) Method and device for displaying information
CN112685075A (en) Gray scale distribution method and device, electronic equipment and computer readable medium
CN111767486A (en) Method, device, electronic equipment and computer readable medium for displaying page

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200221

RJ01 Rejection of invention patent application after publication