CN115204872A - Interaction method based on block chain, block chain and interaction system - Google Patents

Interaction method based on block chain, block chain and interaction system Download PDF

Info

Publication number
CN115204872A
CN115204872A CN202210768687.8A CN202210768687A CN115204872A CN 115204872 A CN115204872 A CN 115204872A CN 202210768687 A CN202210768687 A CN 202210768687A CN 115204872 A CN115204872 A CN 115204872A
Authority
CN
China
Prior art keywords
target
client
sending
push message
target data
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
CN202210768687.8A
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.)
Zhejiang eCommerce Bank Co Ltd
Original Assignee
Zhejiang eCommerce Bank 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 Zhejiang eCommerce Bank Co Ltd filed Critical Zhejiang eCommerce Bank Co Ltd
Priority to CN202210768687.8A priority Critical patent/CN115204872A/en
Publication of CN115204872A publication Critical patent/CN115204872A/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/386Payment protocols; Details thereof using messaging services or messaging apps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The specification discloses an interaction method based on a block chain, the block chain and an interaction system. The method comprises the following steps: the method comprises the steps that a first client side sends a first transaction request to a blockchain, the first transaction request carries an address of a target intelligent contract and target sending execution parameters, the target sending execution parameters comprise target data and a second client side identification, and the target intelligent contract is used for generating a corresponding push message aiming at the data in the sending execution parameters and sending the push message to a client side corresponding to the client side identification in the sending execution parameters. And the first client calls the target intelligent contract to send the push message of the target data to the second client when the first transaction is identified and executed. And the second client acquires the target data based on the push message of the target data.

Description

Interaction method based on block chain, block chain and interaction system
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to an interaction method, a blockchain, and an interaction system based on blockchains.
Background
The traditional multi-mechanism cooperation mode mainly carries out interaction in various modes such as interfaces, files, messages and the like. In order to ensure the security of data transmission, some transmission protocols are usually agreed between organizations to realize the encryption of communication. For most organizations, a special line is often required to be opened, which causes that the notification coupling of the interfaces, the files and the messages for the multi-party dependency relationship needs to take a long time to construct, and causes higher investment cost.
Therefore, how to provide a more simplified and efficient interaction mode under the condition of meeting the communication security among multiple mechanisms is a problem which needs to be solved urgently at present.
Disclosure of Invention
The embodiment of the specification provides an interaction method, a block chain and an interaction system based on the block chain, which can realize interaction among multiple mechanisms in a more simplified and efficient manner under the condition of meeting the communication security among the multiple mechanisms.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
in a first aspect, an interaction method based on a block chain is provided, including:
the block chain receives a first transaction sent by a first client, wherein the first transaction carries an address of a target intelligent contract and a target sending execution parameter, the target sending execution parameter comprises target data and a second client identifier, and the target intelligent contract is used for generating a corresponding push message aiming at the data in the sending execution parameter and sending the push message to the client corresponding to the client identifier in the sending execution parameter;
and when the first transaction is identified and executed, the block chain calls the target intelligent contract to send a push message of the target data to a second client, wherein the second client acquires the target data based on the push message of the target data.
In a second aspect, a blockchain is provided, including:
the system comprises a transaction receiving module, a first transaction processing module and a second transaction processing module, wherein the transaction receiving module receives a first transaction sent by a first client, the first transaction carries an address of a target intelligent contract and a target sending execution parameter, the target sending execution parameter comprises target data and a second client identifier, and the target intelligent contract is used for generating a corresponding push message aiming at data in the sending execution parameter and sending the push message to a client corresponding to the client identifier in the sending execution parameter;
and the intelligent contract calling module is used for calling the target intelligent contract to send the push message of the target data to a second client when the first transaction is identified and executed, wherein the second client acquires the target data based on the push message of the target data.
In a third aspect, an interactive system is provided, which includes: the system comprises a first client, a second client and a block chain, wherein the first client and the second client are both provided with Software Development Kits (SDKs) for establishing connection with the block chain locally, and the SDKs are configured with at least one of a gateway protocol, an interface language and an access node of the block chain, wherein:
the first client sends a first transaction to the blockchain based on a local SDK, the first transaction carries an address of a target intelligent contract and target sending execution parameters, the target sending execution parameters comprise target data and a second client identifier, and the target intelligent contract is used for generating a corresponding push message for data in the sending execution parameters and sending the push message to a client corresponding to the client identifier in the sending execution parameters;
when the block chain finishes consensus on the first transaction and executes the consensus on the first transaction, the target intelligent contract is called, so that a push message of the target data is sent to a second client;
and the second client acquires the push message of the target data based on the local SDK and acquires the target data based on the push message of the target data.
According to the scheme of the embodiment of the specification, the execution code for transmitting data between the clients is written into the target intelligent contract, after the sending mechanism registers as the client of the block chain, the sending mechanism can request the block chain to call the target intelligent contract by initiating a transaction to the block chain, and the push message of the target data needing interaction is sent to the client of the receiving mechanism according to the transmission execution logic in the target intelligent contract, so that the client of the receiving mechanism obtains the target data based on the received push message. The whole scheme realizes the safe transmission of data between mechanisms by means of the advantages of decentralization, non-falsification and traceability of the block chain, a transmission line and an encryption protocol do not need to be independently designed and deployed, a large amount of investment cost and development time are saved for the mechanisms, the reliability is guaranteed, and meanwhile, the interaction process is simplified, so that the block chain has high practicability.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
fig. 1 is a first flowchart of an interaction method based on a blockchain according to an embodiment of the present disclosure.
Fig. 2 is a first flowchart of an interaction method based on a blockchain according to an embodiment of the present disclosure.
Fig. 3 is a first flowchart of an interaction method based on a blockchain according to an embodiment of the present disclosure.
Fig. 4 is a schematic structural diagram of an interactive system provided in an embodiment of the present specification.
Fig. 5 is a first schematic diagram of constructing an interactive system according to an embodiment of the present disclosure.
Fig. 6 is a second schematic diagram of constructing an interactive system according to an embodiment of the present disclosure.
Fig. 7 is a third schematic diagram of constructing an interactive system according to an embodiment of the present disclosure.
Fig. 8 is a schematic structural diagram of a block chain provided in an embodiment of the present specification.
Fig. 9 is a schematic structural diagram of an electronic device provided in an embodiment of this specification.
Detailed Description
In order to make the purpose, technical solutions and advantages of this document more clear, the technical solutions of this specification will be clearly and completely described below with reference to specific embodiments of this specification and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of this document, and not all embodiments. All other embodiments obtained by a person skilled in the art without making any inventive step based on the embodiments in this description belong to the protection scope of this document.
As mentioned above, the multi-organization collaboration mode mainly interacts in various ways such as interface, file, message, etc. In order to ensure the security of data transmission, some protocols are usually agreed between organizations to implement communication encryption, such as File Transfer Protocol (FTP), hypertext Transfer Protocol over secure Layer (HTTPS), and the like, so that the notification coupling of multi-way interaction between the organizations needs to be established for a long time, and related performance tests such as communication association and communication encryption among multiple parties are involved, which results in high investment cost.
In view of this, the present specification provides a simplified and efficient interaction mode suitable for multiple organizations from the viewpoint of practicability, aiming at satisfying the security of communication between multiple organizations.
Fig. 1 is a flowchart of an interaction method based on a blockchain according to an embodiment of the present disclosure, where the method shown in fig. 1 may be performed by the following corresponding blockchain, and specifically includes the following steps:
and S102, receiving a first transaction sent by a first client by a block link, wherein the first transaction carries an address of a target intelligent contract and a target sending execution parameter, the target sending execution parameter comprises target data and a second client identifier, and the target intelligent contract is used for generating a corresponding push message aiming at the data in the sending execution parameter and sending the push message to the client corresponding to the client identifier in the sending execution parameter.
The intelligent contract is a program which is driven by events and runs on a block chain and can be automatically executed according to preset conditions.
In the embodiment of the specification, the execution code for transmitting the data between the clients is written into the target intelligent contract, and in the same way, after the mechanism registers as the client of the block chain, the mechanism can request the block chain to call the target intelligent contract by initiating a transaction to the block chain, so as to send the data needing interaction to the client of the receiver mechanism.
And S104, when the first transaction is identified and executed, the blockchain calls the target intelligent contract to send the push message of the target data to the second client, wherein the second client acquires the target data based on the push message of the target data.
Specifically, the blockchain in this step may send the push message of the target data to one or more blockchain nodes, and after the client accesses one of the blockchain nodes, the push message provided by the blockchain node may be obtained.
Wherein, the block link point responsible for providing the push message may be pre-agreed. For example, if the target intelligent contract is deployed by the blockchain for the target subscription service, the blockchain may further configure at least one dedicated blockchain node for the target subscription service, and set information of the dedicated blockchain nodes in the target intelligent contract. When the subsequent block chain calls the target intelligent contract, the push message of the target data can be sent to each dedicated block chain node set in the target intelligent contract. Correspondingly, the second client can access any one exclusive block link point access block chain to acquire the push message of the target data.
In this embodiment, the block chain may directly send the target data to the second client, or may wait for the second client to actively access the block chain to obtain the target data.
Taking the former as an example, the push message of the target data may directly include the target data, and the second client directly parses the target data from the push message after receiving the push message. Taking the latter as an example, the push message of the target data may be the block information of the target data, and after receiving the push message, the second client analyzes the block information of the target data from the push message, and then calls the target data to the block chain based on the block information.
Here, the block information of the target data is evidence information of the target data corresponding to the block chain, and indicates a block in the block chain, where the target data is stored. When the block chain initiates the consensus of the first transaction, the block chain generates a block storing the target data to propose, and after the consensus is achieved, the proposed audit is completed on the block storing the target data.
Specifically, if the second client actively calls the target data to the blockchain, the second client may also call the target smart contract to obtain the target data from the blockchain by initiating a transaction, that is:
and after receiving the push message, the second client determines that target data needing to be received exists, and sends a second transaction to the block link. The second transaction carries the address of the target intelligent contract and target receiving execution parameters, and the target receiving execution parameters comprise block information of target data. In an embodiment of the present specification, the target intelligent contract is further configured to extract corresponding data from the blockchain based on the blockchain information in the received execution parameters.
And then, when the second transaction is identified and executed, the block chain calls the target intelligent contract to extract target data in the corresponding block based on the block information of the target receiving execution parameter, and sends the target data to the second client.
In practical applications, the second client is not limited to one, and when there are a plurality of second clients, that is, the first client may implement a "point-to-multipoint" data transmission manner.
In addition, the block chain may also support a "multipoint to one point" or "multipoint to multipoint" data transmission scheme. These transmission modes can be realized by writing corresponding transmission rules in the target intelligent contract.
That is, the intelligent contract exemplified in this specification is provided with sending rules of multiple types of push messages, and a target sending execution parameter of the first transaction needs to carry one of target sending rules adopted by target data; in this step, when the block chain calls the target intelligent contract, the push message of the target data may be sent to the second client according to the target sending rule indicated by the target sending execution parameter.
The following describes how a target intelligent contract implements "multipoint-to-point", "multipoint-to-multipoint", "point-to-multipoint", and "point-to-point" data transmission.
Specifically, the embodiments of the present specification classify "multipoint-to-point" and "multipoint-to-multipoint" into the same category, where the target data belongs to a part of data that the second client needs to receive, that is, the second client needs to receive data sent from different other clients, whether it is one or more.
For such a case, a first sending rule may be set in the target intelligent contract, where the target sending execution parameter provided by the first client includes information indicating the first sending rule and a batch identifier to which the target data belongs, and when the block chain invokes the target intelligent contract, a push message of the target data and first indication information including the batch identifier are associated and sent to the second client according to the first sending rule, where the first indication information is used to indicate that the target data is part of data that the second client needs to receive for the batch identifier. In this way, the second client may summarize the data acquired from the blockchain according to the batch identifier in the first indication information, and finally obtain all the data under the complete batch identifier.
Similarly, in the embodiments of the present specification, the "point-to-multipoint" and the "point-to-point" are classified into the same category, and in this category, the target data belongs to all data that the second client needs to receive, that is, the second client can end the receiving process as long as the target data is available, regardless of whether one or more second clients exist.
In view of the above situation, a second sending rule may be set in the target intelligent contract, in which the first client provides that the target sending execution parameter includes information indicating the second sending rule, and when the block chain invokes the target intelligent contract, a push message of the target data and the second indication information are associated and sent to the second client according to the first sending rule, where the second indication information is used to indicate that the target data is all data that the second client needs to receive. In this way, after receiving the target data, the second client directly determines that the data has been completely received according to the second indication information, and stops the receiving process.
It should be understood that the above is an exemplary description of the capability of implementing different sending rules for a target intelligent contract, and the sending rules in practical application are not limited to the first sending rule and the second sending rule described above. For example, for a push message with time to send a request, a time-based sending rule is written into the target intelligent contract, or for a push message with a priority order request, a priority order-based sending rule may also be written into the target intelligent contract, which is not illustrated herein. It should be understood that by setting different sending rules in the intelligent contract, data push of simple sending relations and complex sending relations can be realized.
It can be seen that, in the method of the embodiment of the present specification, an execution code for transmitting data between clients is written into a target intelligent contract, after a sending side mechanism registers as a client of a blockchain, a blockchain may be requested to invoke the target intelligent contract by initiating a transaction to the blockchain, and a push message of target data that needs to be interacted is sent to a client of a receiving side mechanism according to a transmission execution logic in the target intelligent contract, so that the client of the receiving side mechanism obtains the target data based on the received push message. The whole scheme realizes the safe transmission of data between mechanisms by means of the advantages of decentralization, non-falsification and traceability of the block chain, a transmission line and an encryption protocol do not need to be independently designed and deployed, a large amount of investment cost and development time are saved for the mechanisms, the reliability is guaranteed, and meanwhile, the interaction process is simplified, so that the block chain has high practicability.
On the basis, in order to further improve the data security, the client needs to check the tags through the blockchain before sending and receiving the data. Specifically, after the mechanism registers the client side which becomes the block chain, the mechanism provides the key for verifying the signature information of the mechanism to the block chain, and meanwhile background personnel of the block chain writes execution logic for verifying the signature information of the client side based on the key of the client side into the target intelligent contract, so that the intelligent contract can verify the signature information of the client sides of the sender and the receiver.
In the above-described first transaction of the sending party as an example, the target sending execution parameter of the first transaction further includes signature information of the first client, and the intelligent contract of the embodiment of the present disclosure is specifically configured to verify the signature information in the sending execution parameter, generate a corresponding push message for data in the sending execution parameter after the verification is passed, and send the push message to the client corresponding to the client identifier in the sending execution parameter. Correspondingly, when the block chain finishes the consensus and executes the first transaction, the block chain calls the target intelligent contract, firstly, the verification is initiated on the signature information of the target sending execution parameter, and after the verification is passed, the push message of the target data is sent to the second client. And if the verification is not passed, refusing to send the push message of the target data.
In the above-described second transaction of the sender as an example, the target receiving execution parameter of the second transaction further includes signature information of the second client, and the target smart contract of this embodiment is specifically configured to check the signature information in the receiving execution parameter, and extract corresponding data from the blockchain based on the chunk information in the receiving execution parameter after the check is passed. Correspondingly, when the block chain finishes the consensus and executes the second transaction, the target intelligent contract is called, the signature information of the target receiving execution parameter is verified, after the verification is passed, the target data is obtained based on the block information of the target receiving execution parameter, and the target data is sent to the second client.
In addition, on the basis of the above, the blockchain of the embodiment of the present invention may also provide different subscription services for the client, where each subscription service is configured with a dedicated intelligent contract. And a mechanism needing data interaction is arranged, and the registration of the subscription service can be completed through the block chain.
Here, assuming that the target intelligent contract is deployed for the target subscription service by the blockchain, the target intelligent contract may be provided with a client identifier list of the registered target subscription service, and may perform verification of the registered user on the client identifier in the sending execution parameter based on the client identifier list of the target subscription service, and after the verification is passed, generate a corresponding push message for the data in the sending execution parameter, and send the push message to the client corresponding to the client identifier in the sending execution parameter.
Taking the first transaction of the sender as an example, when the block chain completes consensus and executes the first transaction, calling a target intelligent contract, checking a second client identifier in target sending execution parameters, if the second client identifier belongs to a client identifier list of target subscription service, determining that the checking is passed, and sending a push message of target data to the second client; and if the second client identification does not belong to the client identification list of the target subscription service, determining that the verification fails, and directly refusing to send the push message of the target data to the second client.
It can be seen that only registered users belonging to the target subscription service can receive the push message of the data through the target intelligent contract of the target subscription service, so that the management of client transmission is realized by the subscription service.
For example, the client 1 has an interaction requirement with the client 2 for the service a, and has an interaction requirement with the client 3 for the service B, and in order to implement correct data transmission through the blockchain, the client 1 and the client 2 may apply for the service a to create a subscription service to the blockchain and become a registered user of the subscription service of the service a, so as to transmit data between the client 1 and the client 2 by means of an intelligent contract for invoking the subscription service of the service a; similarly, the client 1 and the client 3 may apply for the service B to create a subscription service to the blockchain, and become registered users of the subscription service of the service B, so as to transmit data between the client 1 and the client 3 by means of an intelligent contract for invoking the subscription service of the service a. Obviously, by means of the intelligent contract isolation of the service a and the service B, data transmission between the client 2 and the client 3 is not possible, and it is ensured that the interactive data for the service a between the client 1 and the client 2 is not sent to the client 3, and meanwhile the interactive data for the service B between the client 1 and the client 3 is not sent to the client 2.
In addition, the sending execution parameter may further include a client identifier as the sender, and the intelligent contract may also check the client identifier of the sender based on the client identifier of the subscription service to which the intelligent contract belongs, and send the push message of the data of the sender to the client of the receiver only after the check is passed. Since the principle is the same, it is not described herein in detail.
The following describes a flow of the interaction method according to the embodiment of the present specification with reference to different implementation manners.
Implementation mode one
In the first implementation manner, a first client that is used as a sender submits target data that needs to be sent to a blockchain in a transaction manner, the blockchain invokes a target intelligent contract that is deployed for a target subscription service, and pushes block information of the target data to a second client that is used as a receiver, and the second client receives a push message and needs to actively acquire the target data from the blockchain, where the flow is shown in fig. 2, and includes:
the first client sends a first transaction carrying an address of a target intelligent contract and target sending execution parameters to the blockchain, wherein the target sending execution parameters comprise target data, target sending rules adopted by the target data, signature information of the first client, the target data and a second client identifier.
After the block link receives the first transaction, common identification is initiated on the first transaction, when the first transaction is executed after the common identification is completed, the target intelligent contract is called, the signature information of the first client side is checked, and whether the first client side is a legal client side or not is determined.
Assuming that the signature information of the first client passes the verification, the block chain continues to call the target intelligent contract, and the second client identifier is verified based on the client identifier list of the registered target subscription service to determine whether the second client belongs to the registered user of the target subscription service.
It is assumed here that the second client passes the verification of the identifier, the block chain continues to call the target intelligent contract, and the push message carrying the block information of the target data is sent to the second client according to the target sending rule.
And after receiving the block information of the target data, the second client determines that the target data needing to be received exists, and sends a second transaction carrying the address of the target intelligent contract and target receiving execution parameters to the block chain, wherein the target receiving execution parameters comprise the block information of the target data and the signature information of the second client.
And after the block link receives the second transaction, initiating consensus on the second transaction, calling a target intelligent contract when the second transaction is executed after the consensus is completed, checking the signature information of the second client, and determining whether the second client is a legal client.
Assuming that the signature information of the second client passes the verification, the blockchain extracts the target data from the corresponding blocks based on the block information of the target data and sends the target data to the second client.
Implementation mode two
In the second implementation manner, the first client as the sending end submits the target data to be sent to the blockchain in a transaction manner, the blockchain invokes the target intelligent contract deployed for the target subscription service, and directly sends the target data to the second client, that is, the second client passively obtains the target data, where the process is shown in fig. 3 and includes:
the first client sends a first transaction carrying an address of a target intelligent contract and target sending execution parameters to the blockchain, wherein the target sending execution parameters comprise target data, target sending rules adopted by the target data, signature information of the first client, the target data, a first client identifier and a second client identifier.
After the block link receives the first transaction, a consensus is initiated on the first transaction, and when the first transaction is executed after the consensus is completed, a target intelligent contract is called, the signature information of the first client is checked, and whether the first client is a legal client is determined.
Assuming that the verification of the signature information of the first client is passed, the block chain continues to call the target intelligent contract, and the first client identifier and the second client identifier are verified based on the client identifier list of the registered target subscription service to determine whether the first client and the second client belong to the registered users of the target subscription service.
It is assumed here that the check of the first client identifier and the second client identifier passes, the blockchain continues to invoke the target intelligent contract, and the push message carrying the target data is sent to the second client according to the target sending rule.
FIG. 4 is a block diagram of an interactive system 400 according to one embodiment of the present description, including: the system comprises a first client 410, a second client 220 and a blockchain 430, wherein the first client 410 and the second client 420 are both locally provided with Software Development Kits (SDKs) for establishing connection with the blockchain 430, and the SDKs are configured with gateway protocols, interface languages, access nodes and the like of the blockchain, wherein:
the first client 410 sends a first transaction to the blockchain 430 based on the local SDK, where the first transaction carries an address of a target intelligent contract and a target sending execution parameter, the target sending execution parameter includes target data and an identifier of the second client 420, and the target intelligent contract is configured to generate a corresponding push message for data in the sending execution parameter, and send the push message to a client corresponding to the client identifier in the sending execution parameter;
when the block chain 430 recognizes and executes the first transaction, the target intelligent contract is called to send the push message of the target data to the second client 420;
the second client 420 obtains the push message of the target data based on the local SDK, and obtains the target data based on the push message of the target data.
The construction process of the interactive system in the embodiment of the present specification is as follows:
mechanism parking:
as shown in fig. 5, at this stage, the mechanism submits an application for creating a subscription service to a platform of a blockchain (hereinafter, referred to as a blockchain platform), where the information submitted by the application mainly includes: the system comprises a key for verifying authority signature information, data push requirements, interface authorization application and the like.
Block chain allocation:
as shown in fig. 6, in this stage, a service person of the blockchain platform checks the application of the organization, and after the check is passed, a subscription service is configured for the blockchain, and the related contents include: intelligent contract development (satisfying data push requirements of the organization side), recording a client identification list for registering subscription services, and interface authorization for the organization side.
And (3) SDK configuration:
as shown in fig. 7, the mechanism develops the SDK of the local access block chain by applying for the subscription service, and this SDK includes the gateway protocol, interface language, and access node (block link point) of the block chain.
After the SDK configuration is completed, the mechanism can access a block chain node in the block chain through the local SDK, and initiates intelligent contract calling of subscription service to the block chain, so that data interaction is realized by means of the block chain.
Through the construction process of the interactive system, the whole system can be put into use only by providing data push requirements and relevant authentication information for mechanisms and then completing development of intelligent contracts and local SDKs by matching with a block chain platform side. The intelligent contracts and the local SDKs are relatively simple in logic and do not input excessive time as described in the introduction, so that the development process and the cost are greatly simplified.
Corresponding to the method shown in fig. 1, an embodiment of the present disclosure further provides a block chain, and fig. 8 is a schematic structural diagram of the block chain 800, including:
the transaction receiving module 810 is configured to receive a first transaction sent by a first client, where the first transaction carries an address of a target intelligent contract and a target sending execution parameter, the target sending execution parameter includes target data and a second client identifier, and the target intelligent contract is configured to generate a corresponding push message for data in the sending execution parameter, and send the push message to a client corresponding to the client identifier in the sending execution parameter;
and the intelligent contract invoking module 820 invokes the target intelligent contract to send the push message of the target data to the second client when the first transaction is completed and identified and executed, wherein the second client acquires the target data based on the push message of the target data.
The block chain in the embodiment of the present specification writes an execution code for transmitting data between clients into a target intelligent contract, and after registering as a client of the block chain, a sending side mechanism may request the block chain to call the target intelligent contract by initiating a transaction to the block chain, and send a push message of target data to be interacted to a client of a receiving side mechanism according to a transmission execution logic in the target intelligent contract, so that the client of the receiving side mechanism obtains the target data based on the received push message. The whole scheme realizes the safe transmission of data between mechanisms by means of the advantages of decentralization, non-falsification and traceability of the block chain, a transmission line and an encryption protocol do not need to be independently designed and deployed, a large amount of investment cost and development time are saved for the mechanisms, the reliability is guaranteed, and meanwhile, the interaction process is simplified, so that the block chain has high practicability.
Optionally, the target intelligent contract is provided with sending rules of multiple types of push messages, and the target sending execution parameter of the first transaction includes a target sending rule adopted by the target data, where the target sending rule belongs to the sending rules of the multiple types of information; the intelligent contract invoking module 820 specifically invokes the target intelligent contract, and sends the push message of the target data to the second client according to the target sending rule.
Optionally, the plurality of sending rules include: the target data is used as a first sending rule of partial data that needs to be received by the second client, if the target rule is the first sending rule, the target sending execution parameter further includes a batch identifier to which the target data belongs, and the intelligent contract invoking module 820 specifically sends a push message of the target data and first indication information including the batch identifier to the second client in an associated manner, where the first indication information is used to indicate that the target data is used as partial data that needs to be received by the second client for the batch identifier.
Optionally, the plurality of sending rules further includes: and if the target rule is the second sending rule, the intelligent contract invoking module 820 associates a push message of the target data with second indication information to send to the second client, where the second indication information is used to indicate that the target data is used as all data that the second client needs to receive.
Optionally, the target sending execution parameter of the first transaction further includes signature information of the first client, and the target intelligent contract is specifically configured to check the signature information in the sending execution parameter, generate a corresponding push message for data in the sending execution parameter after the check is passed, and send the push message to the client corresponding to the client identifier in the sending execution parameter; correspondingly, the intelligent contract invoking module 820 invokes the target intelligent contract, and initiates verification on the signature information of the target sending execution parameter, so as to send the push message of the target data to the second client after the verification is passed.
Optionally, the push message of the target data includes the target data, or the push message of the target data is block information of the target data, where the block information of the target data is determined by consensus of the first transaction.
If the push message of the target data is the block information of the target data, the transaction receiving module 810 is further configured to: receiving a second transaction sent by the second client, where the second transaction is sent by the second client after receiving the push message of the target data, and carries an address of the target intelligent contract and target receiving execution parameters, where the target receiving execution parameters include block information of the target data and signature information of the second client, and the target intelligent contract is further configured to check the signature information in the receiving execution parameters, and after the check is passed, extract corresponding data from the block chain based on the block information in the receiving execution parameters; the intelligent contract invoking module 820 is further configured to: and when the second transaction is identified and executed, calling the target intelligent contract, initiating verification on the signature information of the target receiving execution parameter, acquiring the target data based on the block information of the target receiving execution parameter after the verification is passed, and sending the target data to the second client.
Optionally, the key used by the target smart contract to verify the signature information of the client is provided by the client at the time of registration of the blockchain and is set in the target smart contract.
Optionally, the target intelligent contract is deployed by the block chain for a target subscription service, the target intelligent contract is provided with a client identifier list registered with the target subscription service, and the target intelligent contract is further configured to check a client identifier in the sending execution parameter based on the client identifier list, generate a corresponding push message for data in the sending execution parameter after the check is passed, and send the push message to a client corresponding to the client identifier in the sending execution parameter; the intelligent contract invoking module 820 invokes the target intelligent contract, and initiates verification on the second client identifier of the target sending execution parameter, so as to send the push message of the target data to the second client after the verification is passed.
It should be understood that the blockchain of the embodiment of the present invention can be used as the execution subject of the method shown in fig. 1, and therefore, the functions of the method shown in fig. 1 can be realized. Since the principle is the same, it is not described herein again.
Fig. 9 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification. Referring to fig. 9, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other by an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs, forming the above-mentioned block chain on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
receiving a first transaction sent by a first client, wherein the first transaction carries an address of a target intelligent contract and a target sending execution parameter, the target sending execution parameter comprises target data and a second client identifier, and the target intelligent contract is used for generating a corresponding push message aiming at the data in the sending execution parameter and sending the push message to the client corresponding to the client identifier in the sending execution parameter.
And when the first transaction is identified and executed, calling the target intelligent contract to send a push message of the target data to a second client, wherein the second client acquires the target data based on the push message of the target data.
By adopting the electronic device provided by the embodiment of the specification, the execution code for transmitting data between clients can be written into the target intelligent contract, after the sending mechanism registers as the client of the block chain, the sending mechanism can request the block chain to call the target intelligent contract by initiating a transaction to the block chain, and the push message of the target data needing interaction is sent to the client of the receiving mechanism according to the transmission execution logic in the target intelligent contract, so that the client of the receiving mechanism obtains the target data based on the received push message.
The method disclosed in the embodiment of fig. 1 in this specification can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in one or more embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may also perform the method shown in fig. 1, which is not described herein again.
Of course, besides the software implementation, the electronic device in this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, are capable of causing the portable electronic device to perform the method of the embodiment shown in fig. 1, and in particular to perform the following:
the method comprises the steps of receiving a first transaction sent by a first client, wherein the first transaction carries an address of a target intelligent contract and a target sending execution parameter, the target sending execution parameter comprises target data and a second client identifier, and the target intelligent contract is used for generating a corresponding push message aiming at data in the sending execution parameter and sending the push message to a client corresponding to the client identifier in the sending execution parameter.
And when the first transaction is identified and executed, calling the target intelligent contract to send a push message of the target data to a second client, wherein the second client acquires the target data based on the push message of the target data.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present disclosure should be included in the scope of protection of one or more embodiments of the present disclosure.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (11)

1. An interaction method based on a blockchain comprises the following steps:
the block chain receives a first transaction sent by a first client, wherein the first transaction carries an address of a target intelligent contract and a target sending execution parameter, the target sending execution parameter comprises target data and a second client identifier, and the target intelligent contract is used for generating a corresponding push message aiming at the data in the sending execution parameter and sending the push message to the client corresponding to the client identifier in the sending execution parameter;
and when the first transaction is identified and executed, the block chain calls the target intelligent contract to send a push message of the target data to a second client, wherein the second client acquires the target data based on the push message of the target data.
2. The method of claim 1, wherein the first and second light sources are selected from the group consisting of,
the target intelligent contract is provided with sending rules of various types of push messages, and target sending execution parameters of the first transaction comprise target sending rules adopted by the target data, wherein the target sending rules belong to the sending rules of various types of information;
invoking the target intelligent contract to send the push message of the target data to a second client, including:
and calling the target intelligent contract, and sending the push message of the target data to a second client according to the target sending rule.
3. The method of claim 2, wherein the first and second light sources are selected from the group consisting of,
the plurality of sending rules include: the target data is used as a first sending rule of partial data required to be received by the second client;
if the target rule is the first sending rule, the target sending execution parameter further includes a batch identifier to which the target data belongs, and sending a push message of the target data to a second client according to the target sending rule includes:
and sending a push message of target data and first indication information containing the batch identifier to the second client in an associated manner, wherein the first indication information is used for indicating the target data as partial data which needs to be received by the second client for the batch identifier.
4. The method of claim 2, wherein the first and second light sources are selected from the group consisting of,
the plurality of sending rules further includes: the target data is used as a second sending rule of all data required to be received by the second client;
if the target rule is the second sending rule, sending the push message of the target data to a second client according to the target sending rule, including:
and sending a push message of target data and second indication information to the second client in an associated manner, wherein the second indication information is used for indicating the target data as all data required to be received by the second client.
5. The method as set forth in claim 1, wherein,
the target sending execution parameter of the first transaction also comprises signature information of the first client, and the target intelligent contract is specifically used for verifying the signature information in the sending execution parameter, generating a corresponding push message for data in the sending execution parameter after the verification is passed, and sending the push message to the client corresponding to the client identifier in the sending execution parameter;
invoking the target intelligent contract to send the push message of the target data to a second client, including:
and calling the target intelligent contract, initiating verification on the signature information of the target sending execution parameter, and sending the push message of the target data to a second client after the verification is passed.
6. The method of claim 5, wherein the first and second light sources are selected from the group consisting of,
the push message of the target data includes the target data, or the push message of the target data is block information of the target data, where the block information of the target data is determined by consensus of the first transaction.
7. The method of claim 6, wherein the first and second light sources are selected from the group consisting of,
if the push message of the target data is the block information of the target data, after the push message of the target data is sent to a second client, the method includes:
the block chain receives a second transaction sent by the second client, the second transaction is sent by the second client after receiving a push message of the target data and carries an address of the target intelligent contract and target receiving execution parameters, the target receiving execution parameters comprise block information of the target data and signature information of the second client, the target intelligent contract is further used for verifying the signature information in the receiving execution parameters, and after the verification is passed, corresponding data are extracted from the block chain based on the block information in the receiving execution parameters;
and when the second transaction is identified and executed, the block chain calls the target intelligent contract, and initiates verification on the signature information of the target receiving execution parameter, so as to obtain the target data based on the block information of the target receiving execution parameter after the verification is passed, and send the target data to the second client.
8. The method of claim 7, wherein the first and second light sources are selected from the group consisting of,
the key used by the target intelligent contract for verifying the signature information of the client is provided by the client when the client registers in the block chain and is arranged in the target intelligent contract.
9. The method of claim 8, wherein the first and second light sources are selected from the group consisting of,
the target intelligent contract is deployed by the block chain aiming at a target subscription service, the target intelligent contract is provided with a client identification list registered with the target subscription service, and the target intelligent contract is also used for verifying the client identification in the sending execution parameter based on the client identification list, generating a corresponding push message aiming at the data in the sending execution parameter after the verification is passed, and sending the push message to the client corresponding to the client identification in the sending execution parameter;
invoking the target intelligent contract to send the push message of the target data to a second client, including:
and calling the target intelligent contract, initiating verification on the second client identification of the target sending execution parameter, and sending the push message of the target data to the second client after the verification is passed.
10. A blockchain, comprising:
the system comprises a transaction receiving module, a first transaction processing module and a second transaction processing module, wherein the transaction receiving module receives a first transaction sent by a first client, the first transaction carries an address of a target intelligent contract and a target sending execution parameter, the target sending execution parameter comprises target data and a second client identifier, and the target intelligent contract is used for generating a corresponding push message aiming at data in the sending execution parameter and sending the push message to a client corresponding to the client identifier in the sending execution parameter;
and the intelligent contract calling module is used for calling the target intelligent contract to send the push message of the target data to a second client when the first transaction is identified and executed, wherein the second client acquires the target data based on the push message of the target data.
11. An interactive system, comprising: the system comprises a first client, a second client and a block chain, wherein the first client and the second client are both provided with Software Development Kits (SDKs) for establishing connection with the block chain locally, and the SDKs are configured with at least one of a gateway protocol, an interface language and an access node of the block chain, wherein:
the first client sends a first transaction to the blockchain based on a local SDK, the first transaction carries an address of a target intelligent contract and target sending execution parameters, the target sending execution parameters comprise target data and a second client identifier, and the target intelligent contract is used for generating a corresponding push message for data in the sending execution parameters and sending the push message to a client corresponding to the client identifier in the sending execution parameters;
when the block chain finishes consensus on the first transaction and executes the consensus, the target intelligent contract is called to send a push message of the target data to a second client;
and the second client acquires the push message of the target data based on the local SDK and acquires the target data based on the push message of the target data.
CN202210768687.8A 2022-07-01 2022-07-01 Interaction method based on block chain, block chain and interaction system Pending CN115204872A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210768687.8A CN115204872A (en) 2022-07-01 2022-07-01 Interaction method based on block chain, block chain and interaction system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210768687.8A CN115204872A (en) 2022-07-01 2022-07-01 Interaction method based on block chain, block chain and interaction system

Publications (1)

Publication Number Publication Date
CN115204872A true CN115204872A (en) 2022-10-18

Family

ID=83578584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210768687.8A Pending CN115204872A (en) 2022-07-01 2022-07-01 Interaction method based on block chain, block chain and interaction system

Country Status (1)

Country Link
CN (1) CN115204872A (en)

Similar Documents

Publication Publication Date Title
CN109033774B (en) Method and device for acquiring and feeding back user resources and electronic equipment
CN108665946B (en) Service data access method and device
CN110336797B (en) Enterprise authentication and authentication tracing method, device and equipment based on block chain
CN112564916A (en) Access client authentication system applied to micro-service architecture
CN110266764B (en) Gateway-based internal service calling method and device and terminal equipment
CN105592011B (en) Account login method and device
US11658963B2 (en) Cooperative communication validation
CN111045756B (en) Method, apparatus, computing device and medium for generating interface service
CN110839087B (en) Interface calling method and device, electronic equipment and computer readable storage medium
WO2018018697A1 (en) Method and system for identifying spam message from false base station
US20210014064A1 (en) Method and apparatus for managing user authentication in a blockchain network
CN111211911B (en) Collaborative signature method, device, equipment and system
WO2019174354A1 (en) Authentication method and apparatus
CN106921708B (en) Group management method and device
WO2017107653A1 (en) Mobile payment method, related device and system
CN111404695B (en) Token request verification method and device
CN111988418A (en) Data processing method, device, equipment and computer readable storage medium
CN109274699A (en) Method for authenticating, device, server and storage medium
CN111461878A (en) Block chain transaction processing method and system based on intelligent contracts outside chains
CN112734349A (en) Interface generation method, data calling method, device and electronic equipment
CN115204872A (en) Interaction method based on block chain, block chain and interaction system
CN113987598A (en) Block migration method and device
CN113836331A (en) Image query method, device and storage medium
WO2018133551A1 (en) Communication number verification method and device
CN110784551A (en) Data processing method, device, equipment and medium based on multiple tenants

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