CN113034146A - Block chain-based communication method, system, electronic device and storage medium - Google Patents

Block chain-based communication method, system, electronic device and storage medium Download PDF

Info

Publication number
CN113034146A
CN113034146A CN202110573040.5A CN202110573040A CN113034146A CN 113034146 A CN113034146 A CN 113034146A CN 202110573040 A CN202110573040 A CN 202110573040A CN 113034146 A CN113034146 A CN 113034146A
Authority
CN
China
Prior art keywords
block chain
sender
blockchain
transaction request
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110573040.5A
Other languages
Chinese (zh)
Other versions
CN113034146B (en
Inventor
姜勇
陈宇峰
冉洪
王泽伟
张思同
周昕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Yunxiang Network Technology Co Ltd
Original Assignee
Hangzhou Yunxiang Network 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 Hangzhou Yunxiang Network Technology Co Ltd filed Critical Hangzhou Yunxiang Network Technology Co Ltd
Priority to CN202110573040.5A priority Critical patent/CN113034146B/en
Publication of CN113034146A publication Critical patent/CN113034146A/en
Application granted granted Critical
Publication of CN113034146B publication Critical patent/CN113034146B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • 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/602Providing cryptographic facilities or services
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application relates to a communication method, a system, an electronic device and a storage medium based on a block chain, wherein the communication method based on the block chain comprises the following steps: a sending node corresponding to a sender in a block chain acquires a transaction request of the sender and sends the transaction request to all block chain nodes of the block chain, and the block chain nodes commonly identify the transaction request, wherein the transaction request is generated according to communication information between the sender and a receiver; after the block chain link point responds to the transaction request, the block chain transmits a transaction suspension command, generates suspension information and stops consensus, wherein at least one node in the block chain nodes acquires communication information according to the suspension information. By the method and the device, the problem that in the related art, communication processes among different nodes are realized based on block chain persistence, and storage resources of the block chains are consumed very greatly is solved, communication information does not need to be stored, the storage resources of the block chains are saved, and storage cost is reduced.

Description

Block chain-based communication method, system, electronic device and storage medium
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a communication method, system, electronic device and storage medium based on blockchain.
Background
Under a general condition, enterprises provide a guarantee mechanism for increasing credit of data assets through a block chain technology, and further, data collaboration and business collaboration among the enterprises can be achieved through a trusted network of a block chain. In the related art, a mechanism for implementing communication between enterprises through block chain nodes is as follows, based on the uplink process, each node of a block chain monitors the change of interested data, then pushes the changed data to a message middleware in the form of a message producer, and actively acquires the interested data by a consumer of the message middleware to finally implement message reception, wherein the consumer of the message middleware can be a business system of an enterprise.
However, since a complete response mechanism is required in the communication process to meet the most basic requirement of communication, and the resource of the blockchain is precious, each piece of persistent data occupies the storage resource in the blockchain, the method for implementing communication based on the blockchain persistence has low efficiency, and in both the scenarios of point-to-point communication and group communication, the storage cost and the network resource consumption of the whole blockchain are very large, which affects the throughput of service information.
At present, no effective solution is provided for the problem that the block chain storage resource consumption is very large in the related art that the communication process between different nodes is realized based on the block chain persistence.
Disclosure of Invention
The embodiment of the application provides a communication method, a communication system, an electronic device and a storage medium based on a block chain, so as to at least solve the problem that in the related art, the block chain persistence-based communication process between different nodes is very high in storage resource consumption of the block chain.
In a first aspect, an embodiment of the present application provides a communication method based on a block chain, including:
a sending node corresponding to a sender in a block chain acquires a transaction request of the sender and sends the transaction request to all block chain nodes of the block chain, and the block chain nodes identify the transaction request together, wherein the transaction request is generated according to communication information between the sender and a receiver;
after the block chain link point responds to the transaction request, the block chain transmits a transaction suspension command, generates suspension information and stops the consensus, wherein at least one node in the block chain nodes acquires the communication information according to the suspension information.
In some embodiments, the obtaining, by a sending node corresponding to a sender in the blockchain, a transaction request of the sender, and sending the transaction request to all blockchain nodes of the blockchain includes:
and the block chain acquires transaction requests of a plurality of senders according to the intelligent contract.
In some embodiments, before a sending node corresponding to a sender in the blockchain obtains a transaction request of the sender and sends the transaction request to all blockchain nodes of the blockchain, the method includes:
the sender determines at least one receiving node according to the smart contract, wherein the receiving node is capable of decrypting the communication information.
In some embodiments, before a sending node corresponding to a sender in the blockchain obtains a transaction request of the sender and sends the transaction request to all blockchain nodes of the blockchain, the method includes:
the sender acquires service information from the intelligent contract in the block chain, and acquires a service identifier corresponding to the service information according to the service information;
and the sender acquires the communication information based on the service identifier.
In some embodiments, before a sending node corresponding to a sender in the blockchain obtains a transaction request of the sender and sends the transaction request to all blockchain nodes of the blockchain, the method further includes:
the sender acquires the user information of the block chain node from the intelligent contract of the block chain;
and the sender acquires encryption information corresponding to the user information and encrypts at least part of the communication information according to the encryption information.
In some embodiments, the obtaining the communication information comprises:
and a receiving node in the block chain node decrypts at least part of the communication information according to a private key.
In some of these embodiments, after the ceasing the consensus, the method comprises:
and the block chain node rolls back the transaction.
In a second aspect, an embodiment of the present application provides a communication system based on a blockchain, including a blockchain, a sender, and a receiver:
a sending node corresponding to the sender in the block chain acquires a transaction request of the sender and sends the transaction request to all block chain nodes of the block chain, and the block chain nodes identify the transaction request commonly, wherein the transaction request is generated according to communication information between the sender and the receiver, and each block chain node comprises a receiving node corresponding to the receiver;
after the block chain link point responds to the transaction request, the block chain transmits a transaction suspension command, generates suspension information and stops the consensus, wherein at least one node in the block chain nodes acquires the communication information according to the suspension information.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor, when executing the computer program, implements the steps of the block chain based communication method according to the first aspect.
In a fourth aspect, the present application provides a storage medium, on which a computer program is stored, which when executed by a processor, implements the block chain based communication method as described in the first aspect above.
Compared with the related art, the block chain-based communication method provided by the embodiment of the application obtains the transaction request of the sender through the sending node corresponding to the sender in the block chain, and sends the transaction request to all block chain nodes of the block chain, and the block chain nodes share the transaction request, wherein the transaction request is generated according to communication information between the sender and the receiver; after the block chain link point responds to the transaction request, the block chain sends a transaction suspension command and generates suspension information, and the consensus is stopped, wherein at least one node in the block chain nodes acquires communication information according to the suspension information, so that the problem that the communication process among different nodes is realized based on the persistence of the block chain in the related art, the storage resource consumption of the block chain is very high is solved, the communication information does not need to be stored, the storage resource of the block chain is saved, and the storage cost is reduced.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flow chart of a block chain based communication method according to an embodiment of the present application;
fig. 2 is a flow chart of another block chain based communication method according to an embodiment of the present application;
fig. 3 is a flowchart of yet another block chain based communication method according to an embodiment of the present application;
fig. 4 is a block diagram of a hardware structure of a terminal according to the block chain-based communication method of the embodiment of the present application;
fig. 5 is a block diagram of a block chain based communication system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference herein to "a plurality" means greater than or equal to two. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
A blockchain is a distributed database in which data or information is stored that has the property of being unforgeable and traceable. The communication mode between blockchain nodes generally includes the following scenarios: 1. monitoring the change of the data by chaining the data concerned by each node, pushing the changed information into a message middleware in a message producer form, actively acquiring the concerned data by a consumer of the message middleware, and finally realizing message receiving, wherein the consumer of the message middleware can be a service system of each node; 2. all service access parties in the block chain periodically patrol own block chain link point service for a long time, screen transaction and intelligent contract data, acquire service variables and store the service variables in own systems when data concerned by the service access parties change, and then perform subsequent service steps; 3. in the alliance chain, member parties of the alliance chain break information isolated islands among original organizations by means of block chains, information sharing is achieved, and therefore business collaboration is conducted. In order to ensure the safety of data interaction, the original internet docking mode is often abandoned, and a block chain network becomes a unique channel for cooperation among organizations. For a federation chain, a proprietary communication network may be opened up for communication outside the blockchain network.
However, the above communication approaches all have problems, and for scenario 1, the communication itself is unreliable due to network failure and the like, and the communication needs a complete response mechanism to meet the most basic requirements. However, the storage resources of the blockchain are precious, if the service information and the communication information are stored in the blockchain at the same time, unstable communication information can be used as a part of the data assets after being persisted, and the validity of the data assets of all nodes on the blockchain can be affected because the communication information is easy to make mistakes. Further, the communication process is realized by means of block chain persistence, the communication efficiency is low, and in a scenario of both point-to-point communication and group communication, the storage cost consumption of the whole block chain and the consumption of network resources are very large, so that the service information throughput is affected. Taking the federation chain as an example, in order to save the storage cost of the federation chain as much as possible, a transaction structure with the minimum communication cost and the operation logic of the intelligent contract need to be designed. Through the method, the calculation power of access party service and block link point service brought by the round-robin node transaction information and the contract data can be reduced, but as a persistent communication information storage mode needs to be separately provided in the block chain to realize communication, the storage cost of communication information irrelevant to the service of the alliance chain is greatly increased along with the increase of access parties. Moreover, communication itself has instability, final consistency of data between the message middleware and the nodes cannot be guaranteed, reliability of message transmission cannot be guaranteed, multiple retries and response mechanisms are required to be matched for guaranteeing proper delivery of the messages, communication complexity is increased, and implementation cost is extremely high for a alliance chain.
For scenario 2, a service access party of a block link point needs to consume the node computing power to query the intelligent contract ledger and the transaction information for a long-time round trip, and the node computing power and service system resources are greatly consumed. Taking the alliance chain as an example, if the number of the nodes in the alliance chain is n, in order to obtain the changed service data which needs attention at every moment, the alliance chain needs to consume n times of the block chain node resources and n times of the sum of the service system resources.
For scenario 3, when communication is performed through a dedicated communication network outside the block chain, service information related to the block chain is transmitted through a public network, and a relatively complex inter-enterprise communication private network needs to be built around the block chain network on the basis that original communication is unreliable. Constructing a dedicated communication network outside the blockchain may cause communication information not to be linked with data on the blockchain, thereby greatly reducing service attributes of the communication network.
The communication method based on the block chain can be applied to a public block chain and can also be applied to a alliance chain, the problem that the storage resource consumption in the block chain is large can be solved while the unreliable communication process is solved.
The embodiment provides a communication method based on a block chain. Fig. 1 is a flowchart of a block chain based communication method according to an embodiment of the present application, and as shown in fig. 1, the method includes the following steps:
step S110, a sending node corresponding to a sending party in a block chain acquires a transaction request of the sending party and sends the transaction request to all block chain nodes of the block chain, and the block chain nodes identify the transaction request together, wherein the transaction request is generated according to communication information between the sending party and a receiving party.
When two or more parties needing to carry out business communication, one or more parties sending communication information are a sender, one or more parties receiving the communication information are a receiver, and all block chain nodes in a block chain can receive transaction requests including sending nodes corresponding to the sender. However, only some of the blockchain nodes may actually refer to the communication information in the transaction request, and of course, all of the blockchain nodes may also refer to the communication information, and the blockchain nodes that can actually refer to the communication information are the receiving nodes corresponding to the receiving party. The sender has a corresponding sending node in the blockchain to realize the forwarding of the transaction request, and the number of the sender and the number of the receiver in the application can be one or more. The node has voting qualification for the transaction on the blockchain, and can freely access and obtain the historical record and the execution result of the data in the blockchain for the server which participates in maintaining the unified data book together. The communication information comprises transaction information corresponding to the blockchain and service information stored in the intelligent contract, wherein the transaction information is a record of the blockchain on the transaction and can be a hash value obtained after calculation, and the service information is service data related to a sender and a receiver.
After the sending node receives the communication information from the sender, a transaction request is initiated to all the blockchain nodes, the communication process is started, and the sending node can also receive the transaction request. In the present application, it is required that all the block chain link points perform consensus on the communication process, where consensus is a voting mechanism, and is used to complete verification and confirmation of transactions in the block chain, and can be completed in a short time. It should be noted that all blockchain nodes receive the transaction request and agree on the transaction request.
Specifically, the transaction information corresponding to the transaction request includes communication information.
Step S120, after the block chain link point responds to the transaction request, the block chain sends a transaction suspension command and generates suspension information, and stops consensus, wherein at least one node in the block chain nodes acquires communication information according to the suspension information.
And after receiving the transaction request, the blockchain node responds to the transaction request through consensus. Specifically, each blockchain node performs consensus on the step of transaction request, and after the consensus is completed, all blockchain nodes are considered to have responded to the transaction request.
After the response of the receiving node to the transaction request is acquired, the processing center of the block chain sends a transaction termination command to each block chain link point, and the transaction process is terminated. The block chain generates the termination information from the communication information at the same time as transmitting the transaction termination command, and therefore the termination information includes the communication information. After each block chain node receives the transaction stopping command, at least one block chain node can acquire communication information through the stopping information, and then acquire service information according to the communication information to realize service operation. It should be noted that, after receiving the transaction suspension command, each block link node realizes consensus on the "suspension information" to stop consensus on the transaction process.
In the application, as the block chain link points do not know the whole transaction process, the data is prevented from falling to the ground, the transaction process is interrupted, and the persistence of the communication information in the block chain is prevented, so that the communication information is prevented from being stored in the block chain, and the storage space in the block chain is saved.
However, even if the consensus transaction process is interrupted, the block link node already acquires the communication information, so that part or all of the block link nodes can acquire the service information from the communication information, and finally, the service operation corresponding to the service information is completed.
It should be noted that, in the blockchain, the consensus on the transaction process includes a plurality of stages: for example, a transaction request initiating phase, a multi-round verification and confirmation phase of transaction data and a block chain submitting to realize a persistence phase of the transaction data. The transaction data can be stored in the blockchain, that is, the transaction data can be persisted, only after the last step of "finally submitting to the blockchain" is completed. Further, each step also requires a consensus among the nodes participating in the transaction, and after the consensus among the nodes is reached, the next step can be performed. Specifically, in the present application, a transaction request or a stage of performing multiple rounds of verification and confirmation on transaction data is completed, and a stage of submitting the transaction data to a block chain to implement persistence of the transaction data is not performed, so that the transaction data is not stored while the communication information is acquired.
In the present application, through the above step S110 and step S120, after the block link point responds to the transaction request, before the storage is confirmed, the block chain sends the transaction suspension command, the consensus of the block link point on the transaction process is stopped, and the communication information is prevented from being stored in the block chain.
The block chain-based communication method in the application is realized by depending on a consensus mechanism, but does not realize a complete consensus process, so the method can be called a 'semi-consensus' mechanism, the 'semi-consensus' mechanism only lacks a final data persistence process, so the reliability of the consensus mechanism is still provided, and meanwhile, the 'semi-consensus' mechanism prevents a non-service data storage uplink chain of communication information, so the consumption of storage resources in the whole block chain is reduced, and the storage cost is greatly reduced.
In some embodiments, the blockchain may obtain transaction requests of a plurality of senders according to a smart contract to enable communication between the plurality of senders and at least one receiver. In particular, each sender that needs to communicate may initiate a communication process to a recipient via a smart contract, which is a computer protocol that disseminates, validates, or executes contracts in an informational manner, while blockchains may also rely on smart contracts to receive transaction requests for communication from multiple initiators, which allow trusted transactions to be conducted without a third party, which transactions are traceable and irreversible.
Further, in some embodiments, since the intelligent contract records the blockchain node related to the service operation, the sender determines at least one receiving node according to the intelligent contract, where the receiving node can decrypt the communication information to implement the service operation, and finally implement the communication between the sender and the receiver. Therefore, the block chain based communication method in the application can realize one-to-one, one-to-many or many-to-many communication depending on the intelligent contract.
In some embodiments, fig. 2 is a flowchart of another block chain based communication method according to an embodiment of the present application, and as shown in fig. 2, the method further includes the following steps:
step S210, the sender obtains the service information from the intelligent contract in the block chain, and obtains the service identification corresponding to the service information according to the service information.
In general, the intelligent contract stores service information, and the service information corresponds to a service identifier, which is an index representing the service information, such as an Identifier (ID). Wherein the service identification can be directly stored in the intelligent contract.
In step S220, the sender obtains communication information based on the service identifier.
After obtaining the service identifier, the sender may generate communication information from the service identifier, and then communicate with the receiving node. Further, in other embodiments, the communication information may be generated from the service identification and the transaction information.
After receiving the communication information, the receiving node searches the corresponding service information in the intelligent contract according to the service identifier in the communication information, thereby completing the service operation.
Through the above steps S210 and S220, the sender generates communication information based on the service identifier, and since the data size of the service identifier is much smaller than that of the service information, the sender realizes minimum delivery of the sender without communicating and transmitting all service information, and can greatly reduce communication resources, such as bandwidth and a Central Processing Unit (CPU), consumed during communication between the sender and the receiving node, thereby reducing cost and improving data transmission efficiency and security.
In some embodiments, the sender can encrypt the communication information based on the user information in the intelligent contract to improve the security of the communication information. Specifically, the sender acquires user information of each user corresponding to the block link point from the intelligent contract of the block chain, where the user information is used to determine a permission for the user corresponding to the block link point to view the communication information, for example, the permission of some users determines that the users can only receive the communication information but cannot view the communication information, some users can view part of the communication information, some users can view all the communication information, where the user capable of viewing at least part of the communication information is a receiver of the communication information, and the block link point corresponding to the receiver is a receiving node. Specifically, the method for achieving the difference in the viewable ranges of the communication information by the different receiving parties is that the sending party acquires the encryption information corresponding to the user information, for example, a public key corresponding to the user information may be acquired from the smart contract, and then at least partially encrypts the communication information according to the encryption information.
Further, after each block link point receives the encrypted communication information, the receiving nodes in the block link points decrypt the communication information by using the private keys of the receiving nodes, and due to different user authorities, the decryption of the communication information by the receiving nodes is at least partially decrypted, that is, some receiving nodes can check all the communication information after decryption, some receiving nodes can only check part of the communication information after decryption, and the block link points outside the receiving nodes cannot decrypt the communication information. In this embodiment, according to the authority included in the user information, the communication information is encrypted to different degrees for different receiving nodes, so that a fine-grained encryption process of the communication information is realized, the communication information can be safely pushed to each receiving node, and the utilization rate of each receiving node is improved. It should be noted that the public key used when the initiator encrypts the communication information corresponds to the private key used when the receiver decrypts the communication information.
In some embodiments, fig. 3 is a flowchart of another block chain based communication method according to an embodiment of the present application, and as shown in fig. 3, the method includes the following steps:
step S310, a sending node corresponding to a sender acquires a public key of each block chain node through an intelligent contract and encrypts communication information according to the public key;
step S320, the sending node initiates an uplink request corresponding to the communication information to each block chain node;
step S330, each block link point responds to the uplink request;
step S340, after each block chain link point responds to the uplink request, the block chain sends an uplink termination command and generates termination information, the uplink process is terminated, and affair rollback is triggered through an intelligent contract; wherein, the pause information comprises communication information;
the transaction is a group of operations combined into a logical work unit, although errors may occur in the system, the transaction controls and maintains the consistency and integrity of each operation in the transaction, and the rollback refers to the state before the transaction is recovered;
in other embodiments, the blockchain may also send exception status to abort the transaction process;
step S350, after each block chain node receives the uplink termination command, the block chain nodes respond to the transaction rollback;
step S360, after the transaction rollback of the block link point is finished, the block link binds the uplink process;
step S370, in the transaction rollback state, the receiving node in the block chain node obtains the service information according to the communication information received in step S340, and implements the service operation through the intelligent contract.
Through the steps S310 to S370, based on the characteristic that the consensus persistence of each node in the block chain needs to be submitted last after multiple stages, when the transaction process in the block chain is about to be completed, the application drives the intelligent contract to give up the persistence, so as to prevent the persistence of the communication information between the sender and the receiver, and implement transaction rollback on the state of each block chain node. In the communication process, as each block link point does not complete the packaging and the dropping of the communication information, the accounting in the intelligent contract cannot be completed, the block link points do not pay storage cost for the communication information, and the whole communication process does not store pressure for the block link, so that the costless communication among the nodes on the block chain is realized.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.
The method embodiments provided in the present application may be executed in a terminal, a computer or a similar computing device. Taking the operation on the terminal as an example, fig. 4 is a hardware structure block diagram of the terminal of the communication method based on the block chain according to the embodiment of the present application. As shown in fig. 4, the terminal 40 may include one or more (only one shown in fig. 4) processors 402 (the processor 402 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 404 for storing data, and optionally may also include a transmission device 406 for communication functions and an input-output device 408. It will be understood by those skilled in the art that the structure shown in fig. 4 is only an illustration and is not intended to limit the structure of the terminal. For example, terminal 40 may also include more or fewer components than shown in FIG. 4, or have a different configuration than shown in FIG. 4.
The memory 404 may be used to store a control program, for example, a software program and a module of an application software, such as a control program corresponding to the communication method based on the blockchain in the embodiment of the present application, and the processor 402 executes various functional applications and data processing by running the control program stored in the memory 404, so as to implement the method described above. The memory 404 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 404 may further include memory located remotely from the processor 402, which may be connected to the terminal 40 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 406 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the terminal 40. In one example, the transmission device 406 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmitting device 406 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The present embodiment also provides a communication system based on a block chain, which is used to implement the foregoing embodiments and preferred embodiments, and the description of the system that has been already made is omitted. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a block chain based communication system according to an embodiment of the present application, and as shown in fig. 5, the system includes a block chain 51, a sender 52, and a receiver 53: a sending node corresponding to a sender 52 in a block chain 51 acquires a transaction request of the sender 52 and sends the transaction request to all block chain nodes of the block chain 51, and the block chain nodes identify the transaction request commonly, wherein the transaction request is generated according to communication information between the sender 52 and a receiver 53, and each block chain node comprises a receiving node corresponding to the receiver 53; after the block chain link point responds to the transaction request, the block chain 51 sends a transaction suspension command and generates suspension information, and stops consensus, wherein at least one of the block chain nodes acquires communication information according to the suspension information.
Through the system, after the block chain link point responds to the transaction request, the block chain sends the transaction stopping command before storing the communication information, the consensus of each block chain link point on the transaction process is stopped, the communication information is prevented from being stored in the block chain, the problem that the communication process among different nodes is realized based on the persistence of the block chain in the related technology is solved, the storage resource consumption of the block chain is very high, the communication information does not need to be stored, the storage resource of the block chain is saved, and the storage cost is reduced.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
The present embodiment also provides an electronic device comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, a sending node corresponding to a sender in a block chain acquires a transaction request of the sender and sends the transaction request to all block chain nodes of the block chain, and the block chain nodes agree the transaction request, wherein the transaction request is generated according to communication information between the sender and a receiver;
and S2, after the block chain link point responds to the transaction request, the block chain sends a transaction termination command, generates termination information and stops consensus, wherein at least one node in the block chain nodes acquires communication information according to the termination information.
It should be noted that, for specific examples in this embodiment, reference may be made to examples described in the foregoing embodiments and optional implementations, and details of this embodiment are not described herein again.
In addition, in combination with the block chain based communication method in the foregoing embodiments, the embodiments of the present application may provide a storage medium to implement. The storage medium having stored thereon a computer program; the computer program when executed by a processor implements the steps of any of the above embodiments of a blockchain based communication method.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A block chain based communication method, comprising:
a sending node corresponding to a sender in a block chain acquires a transaction request of the sender and sends the transaction request to all block chain nodes of the block chain, and the block chain nodes identify the transaction request together, wherein the transaction request is generated according to communication information between the sender and a receiver;
after the block chain link point responds to the transaction request, the block chain transmits a transaction suspension command, generates suspension information and stops the consensus, wherein at least one node in the block chain nodes acquires the communication information according to the suspension information.
2. The blockchain-based communication method according to claim 1, wherein a sending node in the blockchain corresponding to a sender obtains a transaction request of the sender, and sends the transaction request to all blockchain link points of the blockchain comprises:
and the block chain acquires transaction requests of a plurality of senders according to the intelligent contract.
3. The blockchain-based communication method according to claim 1 or 2, wherein before a sending node corresponding to a sender in the blockchain obtains a transaction request of the sender and sends the transaction request to all blockchain nodes of the blockchain, the method comprises:
the sender determines at least one receiving node according to the smart contract, wherein the receiving node is capable of decrypting the communication information.
4. The blockchain-based communication method according to claim 1, wherein before a sending node corresponding to a sender in the blockchain obtains a transaction request of the sender and sends the transaction request to all blockchain nodes of the blockchain, the method comprises:
the sender acquires service information from the intelligent contract in the block chain, and acquires a service identifier corresponding to the service information according to the service information;
and the sender acquires the communication information based on the service identifier.
5. The blockchain-based communication method according to claim 1, wherein before a sending node corresponding to a sender in the blockchain obtains a transaction request of the sender and sends the transaction request to all blockchain nodes of the blockchain, the method further comprises:
the sender acquires the user information of the block chain node from the intelligent contract of the block chain;
and the sender acquires encryption information corresponding to the user information and encrypts at least part of the communication information according to the encryption information.
6. The blockchain-based communication method according to claim 5, wherein the obtaining the communication information includes:
and a receiving node in the block chain node decrypts at least part of the communication information according to a private key.
7. The blockchain-based communication method according to claim 1, wherein after the stopping of the consensus, the method comprises:
and the block chain node rolls back the transaction.
8. A block chain based communication system is characterized by comprising a block chain, a sending party and a receiving party;
a sending node corresponding to the sender in the block chain acquires a transaction request of the sender and sends the transaction request to all block chain nodes of the block chain, and the block chain nodes identify the transaction request commonly, wherein the transaction request is generated according to communication information between the sender and the receiver, and each block chain node comprises a receiving node corresponding to the receiver;
after the block chain link point responds to the transaction request, the block chain transmits a transaction suspension command, generates suspension information and stops the consensus, wherein at least one node in the block chain nodes acquires the communication information according to the suspension information.
9. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the computer program to perform the blockchain based communication method of any one of claims 1 to 7.
10. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the steps of the blockchain based communication method of any one of claims 1 to 7 when executed.
CN202110573040.5A 2021-05-25 2021-05-25 Block chain-based communication method, system, electronic device and storage medium Active CN113034146B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110573040.5A CN113034146B (en) 2021-05-25 2021-05-25 Block chain-based communication method, system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110573040.5A CN113034146B (en) 2021-05-25 2021-05-25 Block chain-based communication method, system, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN113034146A true CN113034146A (en) 2021-06-25
CN113034146B CN113034146B (en) 2021-08-17

Family

ID=76455854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110573040.5A Active CN113034146B (en) 2021-05-25 2021-05-25 Block chain-based communication method, system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113034146B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105976231A (en) * 2016-06-24 2016-09-28 深圳前海微众银行股份有限公司 Asset management method based on intelligent block chain contracts and nodes
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
CN108737435A (en) * 2018-05-30 2018-11-02 阿里巴巴集团控股有限公司 A kind of account initial method and device
CN109117097A (en) * 2018-09-05 2019-01-01 深圳正品创想科技有限公司 A kind of date storage method and system based on block chain
CN110198233A (en) * 2019-05-09 2019-09-03 中国人民解放军国防科技大学 Block chain consensus method and system based on trusted execution environment and directed acyclic graph
CN110543788A (en) * 2019-09-11 2019-12-06 腾讯科技(深圳)有限公司 Data storage method, data storage device, computer-readable storage medium and computer equipment
CN110990855A (en) * 2019-12-02 2020-04-10 中国银行股份有限公司 Block chain information recording and inquiring method, device and system
CN111680050A (en) * 2020-05-25 2020-09-18 杭州趣链科技有限公司 Fragmentation processing method, device and storage medium for alliance link data
CN111865608A (en) * 2020-07-02 2020-10-30 南京邮电大学 Consensus mechanism operation method applied to alliance chain
CN112163240A (en) * 2020-10-21 2021-01-01 汪金玲 Block chain based distributed government affair architecture unifying method and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105976231A (en) * 2016-06-24 2016-09-28 深圳前海微众银行股份有限公司 Asset management method based on intelligent block chain contracts and nodes
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
CN108737435A (en) * 2018-05-30 2018-11-02 阿里巴巴集团控股有限公司 A kind of account initial method and device
CN109117097A (en) * 2018-09-05 2019-01-01 深圳正品创想科技有限公司 A kind of date storage method and system based on block chain
CN110198233A (en) * 2019-05-09 2019-09-03 中国人民解放军国防科技大学 Block chain consensus method and system based on trusted execution environment and directed acyclic graph
CN110543788A (en) * 2019-09-11 2019-12-06 腾讯科技(深圳)有限公司 Data storage method, data storage device, computer-readable storage medium and computer equipment
CN110990855A (en) * 2019-12-02 2020-04-10 中国银行股份有限公司 Block chain information recording and inquiring method, device and system
CN111680050A (en) * 2020-05-25 2020-09-18 杭州趣链科技有限公司 Fragmentation processing method, device and storage medium for alliance link data
CN111865608A (en) * 2020-07-02 2020-10-30 南京邮电大学 Consensus mechanism operation method applied to alliance chain
CN112163240A (en) * 2020-10-21 2021-01-01 汪金玲 Block chain based distributed government affair architecture unifying method and system

Also Published As

Publication number Publication date
CN113034146B (en) 2021-08-17

Similar Documents

Publication Publication Date Title
TWI662435B (en) Distributed system and message processing method
CN112994892B (en) Cross-chain interaction method, device, system and electronic equipment
CA2980911C (en) Systems and methods for guaranteeing delivery of pushed data to remote clients
TW201919363A (en) Method and system for quantum key distribution and data processing
CN110601816B (en) Lightweight node control method and device in block chain system
US20230123241A1 (en) Security authentication method and apparatus thereof, and electronic device
US11616747B1 (en) Systems and methods for multi-agent messaging
US20220158836A1 (en) Fork Processing Method And Blockchain Node
WO2018094677A1 (en) Bluetooth low energy (ble) device, and data update system and method
US20220272511A1 (en) Subscription data management method and apparatus
US20200007660A1 (en) Demand response event dissemination system and method
WO2024001022A1 (en) Cross-subnet calling
CN112822177A (en) Data transmission method, device, equipment and storage medium
US11695751B2 (en) Peer-to-peer notification system
KR20220074971A (en) Blockchain-based data processing method, apparatus and device, and readable storage medium
US20140019763A1 (en) Methods and apparatus for authentication
CN103858389A (en) Session transmission method, client and Push server
CN113034146B (en) Block chain-based communication method, system, electronic device and storage medium
RU2647687C2 (en) Device monitoring using multiple servers optimised for different types of communications
CN116192927A (en) Data transmission method and device based on SaaS service, computer equipment and medium
WO2015093959A1 (en) Methods, an online object, a web-based message exchange server, a mobile device, a target offline object, a network and a computer program product
KR102307973B1 (en) Block chain-based Data Sharing Method for Improving Reliability of Distributed Systems
US9154548B2 (en) Auditable distribution of a data file
CN114222290A (en) Communication method, device, equipment and storage medium
KR101888952B1 (en) Client and operation method of client

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant