A communication method and device based on blockchain
By storing the identification of data on the blockchain node rather than the actual data, the problems of data redundancy and high storage costs are solved, and the synchronization speed between blockchain nodes is improved.
Patent Information
- Application Number
- CN202310416809.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-18
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-04-18
AI Technical Summary
When processing data on the blockchain, data redundancy is caused by each node that needs to store the same data, which increases storage costs and reduces synchronization speed between nodes.
By storing the identification of data on the first blockchain node, rather than the actual data, and synchronizing the identification to other nodes, the identification is obtained from the mass storage node when data is needed in the future.
Reduces data redundancy, reduces blockchain storage costs, and improves synchronization speed between nodes.
Smart Images

Figure CN116436917B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed technology, and in particular to a communication method and device based on blockchain. Background Art
[0002] In many distributed application scenarios, data needs to be processed on the blockchain. Generally, before processing the data, the data to be processed needs to be stored on the blockchain. However, due to the characteristics of the blockchain, the data to be processed needs to be stored on each blockchain node of the blockchain, resulting in data redundancy, increasing the blockchain storage cost and reducing the synchronization speed between blockchain nodes. Summary of the invention
[0003] The present application provides a blockchain-based communication method and device to reduce data redundancy, lower blockchain storage costs, and improve the synchronization speed between blockchain nodes.
[0004] In the first aspect, the embodiment of the present application provides a communication method based on blockchain, which can be executed by a communication device, which can be a terminal device or a module for a terminal device, or a server or a module for a server. The present application does not limit the execution subject of the method. The method includes: a first blockchain node receives a first transaction request, the first transaction request includes a blockchain transaction type and first data, and the blockchain transaction type is used to indicate the processing method of the first data; the first blockchain node stores the first data to a large-capacity storage node and determines the identification of the first data; the first blockchain node synchronizes the first block containing the blockchain transaction type and the identification of the first data to at least one second blockchain node.
[0005] In the above scheme, the first blockchain node stores the first data to the large-capacity storage node, and synchronizes the first block to at least one second blockchain node. The first block contains the identifier of the first data instead of the first data. Therefore, the first blockchain node and the at least one second blockchain node only need to store the identifier of the first data, and do not need to store the first data. When the first blockchain node and the at least one second blockchain node need to use or process the first data later, they can obtain the first data from the large-capacity storage node according to the identifier of the first data. Therefore, this scheme reduces data redundancy, reduces blockchain storage costs, and improves the synchronization speed between blockchain nodes.
[0006] In one possible implementation method, the first blockchain node obtains the blockchain transaction type and the identifier of the first data from the first block; the first blockchain node obtains the first data from the large-capacity storage node according to the identifier of the first data; the first blockchain node processes the first data according to the blockchain transaction type.
[0007] In the above scheme, there is a communication protocol between the first blockchain node and the large-capacity storage node, so they can communicate with each other. When the first blockchain node needs to process the first data, it accurately obtains the first data from the large-capacity storage node according to the identifier of the first data. The first blockchain node itself does not need to store the first data. Therefore, this scheme reduces the data redundancy of the first blockchain node and reduces the blockchain storage cost.
[0008] In one possible implementation method, a first blockchain node receives an identifier of first data from a large-capacity storage node.
[0009] In the above scheme, the large-capacity storage node generates an identifier of the first data when storing the first data and returns the identifier of the first data to the first blockchain node, so that the identifier of the first data can be accurately determined.
[0010] In one possible implementation method, the first blockchain node generates an identifier for the first data.
[0011] In the above scheme, the first blockchain node determines the identifier of the first data, which can achieve accurate determination of the identifier of the first data.
[0012] In a possible implementation method, the first transaction request also includes a verification identifier.
[0013] In one possible implementation method, it is determined whether the verification identifier is the same as the identifier of the first data. When the verification identifier is the same as the identifier of the first data, the first blockchain node synchronizes the first block to at least one second blockchain node.
[0014] In the above scheme, when the verification identifier is the same as the identifier of the first data, it indicates that the first data stored in the large-capacity storage node has not been tampered with, thereby increasing the security of the first data and improving the accuracy of the first blockchain node and at least one second blockchain node in obtaining the first data from the large-capacity storage node.
[0015] In one possible implementation method, a first blockchain node receives a second transaction request, the second transaction request includes a blockchain transaction type and an identifier of the first data; the first blockchain node synchronizes a second block including the blockchain transaction type and the identifier of the first data to at least one second blockchain node.
[0016] In the above scheme, after receiving the second transaction request, the first blockchain node directly synchronizes the second block containing the blockchain transaction type and the identifier of the first data to at least one second blockchain node, without the need to perform secondary storage of the first data. On the one hand, this saves space in large-capacity storage nodes, and on the other hand, speeds up the synchronization of the second block to at least one second blockchain node.
[0017] In one possible implementation method, the large-capacity storage node refers to the InterPlanetary File System IPFS node.
[0018] In the above scheme, IPFS is a content-addressable peer-to-peer hypermedia distribution protocol, that is, data with the same content will only be stored in several IPFS nodes, which can not only save resource overhead, but also store more data, and further realize the storage of large amounts of data.
[0019] In one possible implementation method, the first block is used by at least one second blockchain node to process the first data according to the blockchain transaction type.
[0020] In the above scheme, there is a communication protocol between the second blockchain node and the large-capacity storage node, so they can communicate with each other. When at least one second blockchain node needs to process the first data, it accurately obtains the first data from the large-capacity storage node according to the identifier of the first data. At least one second blockchain node itself does not need to store the first data. Therefore, this scheme reduces the data redundancy of at least one second blockchain node and reduces the blockchain storage cost.
[0021] In a second aspect, an embodiment of the present application provides a communication device, comprising: a transceiver unit and a processing unit. The transceiver unit is used for a first blockchain node to receive a first transaction request, the first transaction request includes a blockchain transaction type and first data, and the blockchain transaction type is used to indicate a processing method for the first data; the processing unit is used for the first blockchain node to store the first data to a large-capacity storage node and determine an identifier of the first data; the first blockchain node synchronizes a first block including the blockchain transaction type and the identifier of the first data to at least one second blockchain node.
[0022] In a possible implementation method, the processing unit is also used for the first blockchain node to obtain the blockchain transaction type and the identifier of the first data from the first block; the first blockchain node obtains the first data from the large-capacity storage node according to the identifier of the first data; the first blockchain node processes the first data according to the blockchain transaction type.
[0023] In one possible implementation method, the transceiver unit is also used for the first blockchain node to receive an identifier of the first data from the large-capacity storage node.
[0024] In a possible implementation method, the processing unit is also used for the first blockchain node to generate an identifier of the first data.
[0025] In a possible implementation method, the first transaction request also includes a verification identifier.
[0026] In one possible implementation method, the processing unit is also used to determine whether the verification identifier is the same as the identifier of the first data. When the verification identifier is the same as the identifier of the first data, the first blockchain node synchronizes the first block to at least one second blockchain node.
[0027] In one possible implementation method, the transceiver unit is also used for the first blockchain node to receive a second transaction request, where the second transaction request includes a blockchain transaction type and an identifier of the first data; the first blockchain node synchronizes the second block including the blockchain transaction type and the identifier of the first data to at least one second blockchain node.
[0028] In one possible implementation method, the large-capacity storage node refers to the InterPlanetary File System IPFS node.
[0029] In one possible implementation method, the first block is used by at least one second blockchain node to process the first data according to the blockchain transaction type.
[0030] In a third aspect, an embodiment of the present application further provides a computing device, including:
[0031] A memory for storing program instructions;
[0032] The processor is used to call the program instructions stored in the memory, and execute any method of implementing the above-mentioned first aspect according to the obtained program instructions.
[0033] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which computer-readable instructions are stored. When a computer reads and executes the computer-readable instructions, any method of the above-mentioned first aspect is implemented.
[0034] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program executable by a computer device, wherein when the program is run on the computer device, the computer device executes any method for implementing the above-mentioned first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A flowchart of a blockchain-based communication method provided in an embodiment of the present application;
[0036] Figure 2 A flowchart of a blockchain-based communication method provided in an embodiment of the present application;
[0037] Figure 3 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;
[0038] Figure 4 A schematic diagram of the structure of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] Figure 1 A flowchart of a blockchain-based communication method provided in an embodiment of the present application, the method can be executed by a communication device, the communication device can be a terminal device or a module for a terminal device, or a server or a module for a server. The present application does not limit the execution subject of the method.
[0040] The method comprises the following steps:
[0041] Step 101: A first blockchain node receives a first transaction request.
[0042] The first transaction request includes a blockchain transaction type and first data, and the blockchain transaction type is used to indicate a method for processing the first data.
[0043] In one possible implementation, the first blockchain node refers to any consensus node on the blockchain. Blockchain is a decentralized, distributed system that is usually used to record transactions. The content of these transactions will be recorded as a block of data, which will be independently verified by a peer-to-peer computer network and then added to the blockchain. In order to ensure that all participants in the blockchain network, i.e. all blockchain nodes, agree on a single version of history, the blockchain network implements a consensus mechanism, also known as a consensus protocol or consensus algorithm. The blockchain node that implements the formula mechanism is called a consensus node. The consensus node can be regarded as a special ordinary time node. In addition to completing the work of an ordinary time node, it also needs to reach a consensus protocol to update the ledger.
[0044] In one possible implementation method, the blockchain transaction type is used to indicate the processing method of the first data. For example, if the user's identity information needs to be verified, the first data includes the user's ID card information, academic certificate information, or degree certificate information, etc., and the blockchain transaction type is to verify the user's identity information based on the user's ID card information, academic certificate information, or degree certificate information; for another example, for a certain financing user, it is necessary to verify whether the financing amount of the financing user for one month meets the standard, then the first data is the financing bill of the financing user for one month, and the blockchain transaction type is to verify whether the financing amount of the financing user for one month meets the standard based on the financing bill of the financing user for one month. This application does not limit the blockchain transaction type, nor does it limit the specific content of the first data.
[0045] Step 102: The first blockchain node stores the first data in a large-capacity storage node and determines an identifier of the first data.
[0046] In one possible implementation method, a large-capacity storage node refers to a node with distributed storage capabilities, which avoids the risks of trust centralization, single point failure, data loss or tampering brought about by centralized storage.
[0047] In one possible implementation method, the large-capacity storage node refers to the InterPlanetary File System IPFS node. IPFS is a content-addressable peer-to-peer hypermedia distribution protocol, which means that data with multiple identical contents will only be stored in several IPFS nodes, which not only saves resource overhead, but also can store more data, and further enables the storage of large amounts of data. Each file stored in the IPFS system can be identified by the hash value of its content, which is called CID (Content Identifier), which is the identifier of the first data.
[0048] In a possible implementation method, the first blockchain node receives the identification of the first data from the large-capacity storage node. Exemplarily, if the large-capacity storage node adopts an IPFS node, the first blockchain node will send a storage request to the IPFS node, and the storage request is used to store the first data in the IPFS node. After the IPFS system stores the first data in the IPFS node, the IPFS system will determine the hash value of the first data through hash calculation according to the content of the first data, that is, the identification of the first data, and then return the identification of the first data to the first blockchain node. In this solution, the large-capacity storage node generates the identification of the first data when storing the first data and returns the identification of the first data to the first blockchain node, which can accurately determine the identification of the first data.
[0049] In another possible implementation method, the first blockchain node generates an identifier of the first data. Exemplarily, the first blockchain node determines the hash value of the first data, that is, the identifier of the first data, through hash calculation according to the content of the first data; or the first blockchain node determines the identifier of the first data in other ways. The present application does not limit the method for determining the identifier of the first data, as long as the identifier of the first data can uniquely represent the first data. In this solution, the identifier of the first data is determined by the first blockchain node, which can accurately determine the identifier of the first data.
[0050] Step 103: The first blockchain node synchronizes the first block including the blockchain transaction type and the identifier of the first data to at least one second blockchain node.
[0051] In one possible implementation method, a consensus protocol is run between a first blockchain node and at least one second blockchain node to package transactions and determine a first block, wherein the first block includes a blockchain transaction type and an identifier of the first data. Then, the packaged first block is synchronized to at least one second blockchain node. The at least one second blockchain node and the first blockchain node respectively execute the transactions in the first block.
[0052] In a possible implementation method, the first blockchain node and at least one second blockchain node obtain the blockchain transaction type and the identifier of the first data from the first block; the first blockchain node and at least one second blockchain node obtain the first data from the large-capacity storage node according to the identifier of the first data; the first blockchain node and at least one second blockchain node process the first data according to the blockchain transaction type. In this solution, there is a communication protocol between the first blockchain node and the large-capacity storage node, so they can communicate with each other. When the first blockchain node needs to process the first data, it accurately obtains the first data from the large-capacity storage node according to the identifier of the first data. The first blockchain node itself does not need to store the first data, so this solution reduces the data redundancy of the first blockchain node and reduces the blockchain storage cost.
[0053] In a possible implementation method, the first transaction request is in the form of a smart contract, and the blockchain transaction type represents the logic of the smart contract, that is, the logical relationship of processing the first data according to the smart contract. The first blockchain node and at least one second blockchain node execute the transaction in the first block and process the first data according to the logic of the smart contract. This solution, through the form of a smart contract, enables the first blockchain node and at least one second blockchain node to communicate with a large-capacity storage node over the network, so that the first blockchain node and at least one second blockchain node can accurately obtain the first data and process the first data, thereby ensuring the correct execution of the business logic.
[0054] In the above scheme, the first blockchain node stores the first data to the large-capacity storage node, and synchronizes the first block to at least one second blockchain node. The first block contains the identifier of the first data instead of the first data. Therefore, the first blockchain node and the at least one second blockchain node only need to store the identifier of the first data, and do not need to store the first data. When the first blockchain node and the at least one second blockchain node need to use or process the first data later, they can obtain the first data from the large-capacity storage node according to the identifier of the first data. Therefore, this scheme reduces data redundancy, reduces blockchain storage costs, and improves the synchronization speed between blockchain nodes.
[0055] In a possible implementation method, the first transaction request also includes a verification identifier, which can be a hash value determined by hash calculation based on the content of the first data, or a verification identifier determined according to a certain rule. This application does not limit the method for determining the verification identifier and the form of the verification identifier. It is only necessary that the verification identifier can verify whether the identifier of the first data is legal. Whether the identifier of the first data is legal refers to whether the identifier of the first data can uniquely identify the content of the first data. If the identifier of the first data can uniquely identify the content of the first data, the identifier of the first data is legal, otherwise, the identifier of the first data is illegal. When it is determined that the identifier of the first data is legal, the first blockchain node synchronizes the first block to at least one second blockchain node.
[0056] In one possible implementation method, when the client sends a first transaction request to the first blockchain node, the client generates a verification identifier, writes the verification identifier into the first transaction request, and sends it to the first blockchain node.
[0057] In another possible implementation method, the client sends a first transaction request to the communication device, the server of the communication device receives the first transaction request, generates a verification identifier based on the first data carried in the first transaction request, then writes the verification identifier into the first transaction request, and then sends the first transaction request to the first blockchain node.
[0058] In one possible implementation method, it is determined whether the verification identifier is the same as the identifier of the first data. If the identifier of the first data is consistent with the verification identifier, then the identifier of the first data is legal, which means that when the first data is stored in the large-capacity storage node, the content of the first data has not been tampered with; if the identifier of the first data is inconsistent with the verification identifier, then the identifier of the first data is illegal, that is, when the first data is stored in the large-capacity storage node, the content of the first data has been tampered with, and the first data stored in the large-capacity storage node is wrong.
[0059] In the above scheme, when the verification identifier is the same as the identifier of the first data, it indicates that the first data stored in the large-capacity storage node has not been tampered with, thereby increasing the security of the first data and improving the accuracy of the first blockchain node and at least one second blockchain node in obtaining the first data from the large-capacity storage node.
[0060] In a possible implementation method, when the verification identifier is the same as the identifier of the first data, the first blockchain node synchronizes the first block to at least one second blockchain node. After the synchronization is completed, the first blockchain node and the at least one second blockchain node obtain the blockchain transaction type and the identifier of the first data from the first block; the first blockchain node and the at least one second blockchain node respectively send a request to obtain data to the large-capacity storage node, i.e., the IPFS system, the request to obtain data includes the identifier of the first data, and the IPFS system reads the first data from the IPFS node according to the identifier of the first data, and returns it to the first blockchain node and the at least one second blockchain node respectively; after the first blockchain node and the at least one second blockchain node respectively obtain the first data, they process the first data according to the blockchain transaction type; after the processing of the first data is completed, the processing result is returned to the client.
[0061] In one possible implementation method, when the verification identifier is different from the identifier of the first data, the first blockchain node will not synchronize the first block to at least one second blockchain node, but will return the information that the verification identifier is different from the identifier of the first data to the client, and wait for subsequent processing by the client, such as the client initiating a second transaction request.
[0062] In one possible implementation method, the first blockchain node receives a second transaction request, and the second transaction request includes a blockchain transaction type and an identifier of the first data. At this time, the second transaction request does not include the first data because the first data has been stored in a large-capacity storage node, so there is no need to store the first data again. In this solution, after receiving the second transaction request, the first blockchain node directly synchronizes the second block including the blockchain transaction type and the identifier of the first data to at least one second blockchain node, without the need to perform secondary storage of the first data. On the one hand, it saves space in the large-capacity storage node, and on the other hand, it speeds up the synchronization of the second block to at least one second blockchain node.
[0063] In a possible implementation method, the first blockchain node synchronizes the second block containing the blockchain transaction type and the identifier of the first data to at least one second blockchain node. After the synchronization is completed, the first blockchain node and the at least one second blockchain node obtain the blockchain transaction type and the identifier of the first data from the second block; the first blockchain node and the at least one second blockchain node respectively send a request to obtain data to the large-capacity storage node, i.e., the IPFS system, the request to obtain data includes the identifier of the first data, and the IPFS system reads the first data from the IPFS node according to the identifier of the first data, and returns it to the first blockchain node and the at least one second blockchain node respectively; after the first blockchain node and the at least one second blockchain node respectively obtain the first data, they process the first data according to the blockchain transaction type; after the processing of the first data is completed, the processing result is returned to the client.
[0064] In one possible implementation method, the second transaction request also includes a second verification identifier, which is used to verify whether the identifier of the first data has changed during the network transmission process. The second verification identifier can be a hash value determined by hash calculation based on the content of the first data, or it can be a second verification identifier determined according to a certain rule. The present application does not limit the method for determining the second verification identifier and the form of the second verification identifier. It is only necessary that the second verification identifier can verify whether the identifier of the first data in the second transaction request has changed during the network transmission process. After determining that the identifier of the first data in the second transaction request has not changed during the network transmission process, the first blockchain node synchronizes the second block to at least one second blockchain node.
[0065] In one possible implementation method, when the second verification identifier is the same as the identifier of the first data in the second transaction request, the first blockchain node synchronizes the second block to at least one second blockchain node.
[0066] The following uses a specific example to illustrate how to process the first data.
[0067] In one possible implementation method, a user sets a sales target amount for a product one month ago, for example, the sales target amount is one million. One month later, the user wants to verify whether the sales amount for this month has reached the sales target amount. Then the user, i.e., the client, sends a first transaction request to the consensus node of the blockchain. The first transaction request includes a blockchain transaction type, first data, and a verification identifier. The blockchain transaction type is to verify whether the sales amount for this month has reached the sales target amount, and the first data is the sales order of the user for this month. Then the processing of the first data is as follows: Figure 2 As shown, the method comprises the following steps:
[0068] Step 201: A first blockchain node receives a first transaction request.
[0069] Step 202: The first blockchain node sends a storage request to a large-capacity storage node.
[0070] In one possible implementation method, the first blockchain node sends a storage request to a large-capacity storage node, namely, an IPFS node. The storage request includes first data, namely, the user's sales orders for one month.
[0071] Step 203: The large-capacity storage node stores the first data and generates an identifier of the first data.
[0072] In one possible implementation method, after receiving a storage request, the IPFS system stores the first data carried in the storage request to the IPFS node, and returns an identifier of the first data to the first blockchain node. The identifier of the first data is the hash value determined by the IPFS system through hash calculation based on the content of the first data.
[0073] Step 204: The IPFS system returns the identifier of the first data to the first blockchain node.
[0074] Step 205: The first blockchain node verifies the identifier of the first data.
[0075] In a possible implementation method, it is determined whether the verification identifier is the same as the identifier of the first data. If the verification identifier is the same as the identifier of the first data, the first blockchain node synchronizes the first block containing the blockchain transaction type and the identifier of the first data to at least one second blockchain node; if the verification identifier is different from the identifier of the first data, the first blockchain node sends information that the identifier verification of the first data has failed to the client, and the user decides whether to initiate a transaction request to the blockchain node again.
[0076] Step 206, determining the first block.
[0077] In a possible implementation method, the first blockchain node reaches a consensus with at least one second blockchain node according to a consensus protocol and determines the content of the first block, for example, the first block contains information such as the blockchain transaction type, the identifier of the first data, the size of the first block, or the generation time of the first block, and then the first blockchain node synchronizes the first block to at least one second blockchain node. The first blockchain node and the at least one second blockchain node write the first block into their respective corresponding blockchain nodes.
[0078] Step 207: The first blockchain node synchronizes the first block to at least one second blockchain node.
[0079] Step 208: The first blockchain node and at least one second blockchain node process the first data according to the content of the first block.
[0080] In one possible implementation method, the first blockchain node and at least one second blockchain node obtain the blockchain transaction type and the identifier of the first data from the first block; the first blockchain node and the at least one second blockchain node respectively send a request to obtain data to a large-capacity storage node, i.e., an IPFS system, the request to obtain data includes the identifier of the first data, and the IPFS system reads the first data, i.e., the user's sales order for one month, from the IPFS node according to the identifier of the first data, and returns it to the first blockchain node and the at least one second blockchain node respectively; the first blockchain node and the at least one second blockchain node calculate the sales amount for one month based on the user's sales order for one month, and after the calculation is completed, verify whether the sales amount for one month has reached the target amount of commodity sales, and return the verification result to the user.
[0081] In a possible implementation method, when the user needs to verify again whether the sales amount for a month has reached the target sales amount, the user needs to send a second transaction request to the first blockchain node. The second transaction request only needs to include the blockchain transaction type, the identifier of the first data, and the second verification identifier, and no longer needs to include the first data. After the first blockchain node receives the second transaction request and completes the verification of the identifier of the first data, the first blockchain node reaches a consensus with at least one second blockchain node according to the consensus protocol and determines the content of the second block. For example, the second block contains information such as the blockchain transaction type, the identifier of the first data, the size of the second block, or the generation time of the second block. Then the first blockchain node synchronizes the second block to at least one second blockchain node. The first blockchain node and the at least one second blockchain node write the second block into their respective corresponding blockchain nodes.
[0082] In one possible implementation method, the first blockchain node and at least one second blockchain node verify again whether the user's monthly sales amount has reached the commodity sales target amount based on the content of the second block, and return the verification result to the user.
[0083] Based on the same technical concept, Figure 3 A communication device 300 provided in an embodiment of the present application is exemplarily shown. Figure 3As shown, it includes: a transceiver unit 301 and a processing unit 302. The transceiver unit 301 is used for the first blockchain node to receive a first transaction request, the first transaction request includes a blockchain transaction type and first data, and the blockchain transaction type is used to indicate a processing method for the first data; the processing unit 302 is used for the first blockchain node to store the first data in a large-capacity storage node and determine the identifier of the first data; the first blockchain node synchronizes the first block including the blockchain transaction type and the identifier of the first data to at least one second blockchain node.
[0084] In a possible implementation method, the processing unit 302 is also used for the first blockchain node to obtain the blockchain transaction type and the identifier of the first data from the first block; the first blockchain node obtains the first data from the large-capacity storage node according to the identifier of the first data; the first blockchain node processes the first data according to the blockchain transaction type.
[0085] In one possible implementation method, the transceiver unit 301 is also used for the first blockchain node to receive an identifier of the first data from the large-capacity storage node.
[0086] In a possible implementation method, the processing unit 302 is also used for the first blockchain node to generate an identifier of the first data.
[0087] In a possible implementation method, the first transaction request also includes a verification identifier.
[0088] In a possible implementation method, the processing unit 302 is also used to determine whether the verification identifier is the same as the identifier of the first data. When the verification identifier is the same as the identifier of the first data, the first blockchain node synchronizes the first block to at least one second blockchain node.
[0089] In a possible implementation method, the transceiver unit 301 is also used for the first blockchain node to receive a second transaction request, where the second transaction request includes a blockchain transaction type and an identifier of the first data; the first blockchain node synchronizes the second block including the blockchain transaction type and the identifier of the first data to at least one second blockchain node.
[0090] In one possible implementation method, the large-capacity storage node refers to the InterPlanetary File System IPFS node.
[0091] In one possible implementation method, the first block is used by at least one second blockchain node to process the first data according to the blockchain transaction type.
[0092] Based on the same technical concept, the embodiment of the present application provides a communication device 400, which may be a computing device, for example. Figure 4As shown, a communication device 400 includes at least one processor 401 and a memory 402 connected to the at least one processor. The specific connection medium between the processor 401 and the memory 402 is not limited in the embodiment of the present application. Figure 4 For example, the processor 401 and the memory 402 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0093] In an embodiment of the present application, the memory 402 stores instructions that can be executed by at least one processor 401. The at least one processor 401 can execute the above-mentioned blockchain-based communication method by executing the instructions stored in the memory 402.
[0094] Among them, the processor 401 is a control center of a communication device 400, which can use various interfaces and lines to connect various parts of the computer equipment, and perform resource settings by running or executing instructions stored in the memory 402 and calling data stored in the memory 402. Optionally, the processor 401 may include one or more determination units, and the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0095] Processor 401 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.
[0096] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 402 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 402 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 402 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0097] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer-executable program, and the computer-executable program is used to enable a computer to execute a blockchain-based communication method listed in any of the above methods.
[0098] An embodiment of the present application provides a computer program product, including a computer program executable by a computer device. When the program is run on the computer device, the computer device executes a blockchain-based communication method listed in any of the above methods.
[0099] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0100] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0101] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0103] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A communication method based on blockchain, characterized in that: include: The first blockchain node receives a first transaction request, where the first transaction request includes a blockchain transaction type and first data, where the blockchain transaction type is used to indicate a processing method for the first data; The first blockchain node stores the first data in the large-capacity storage node, and determines an identifier of the first data; The first blockchain node synchronizes a first block including an identifier of the blockchain transaction type and the first data to at least one second blockchain node, and the first block is used by the at least one second blockchain node to obtain the first data from the large-capacity storage node according to the identifier of the first data, and process the first data according to the blockchain transaction type.
2. The method according to claim 1, characterized in that After the first blockchain node stores the first data in the large-capacity storage node, the method further includes: The first blockchain node obtains the blockchain transaction type and an identifier of the first data from the first block; When the first blockchain node needs to process the first data, the first blockchain node obtains the first data from the large-capacity storage node according to the identifier of the first data; The first blockchain node processes the first data according to the blockchain transaction type.
3. The method according to claim 1 or 2, characterized in that The first blockchain node determines the identifier of the first data, including: The first blockchain node receives an identification of the first data from the mass storage node.
4. The method according to claim 1 or 2, characterized in that: The first blockchain node determines the identifier of the first data, including: The first blockchain node generates an identifier of the first data.
5. The method according to claim 1 or 2, characterized in that: The first transaction request also includes a verification identifier; and the method further includes: Determining whether the verification identifier is the same as an identifier of the first data; The first blockchain node synchronizes the first block including the blockchain transaction type and the identifier of the first data to at least one second blockchain node, including: When the verification identifier is the same as the identifier of the first data, the first blockchain node synchronizes the first block to the at least one second blockchain node.
6. The method according to claim 1 or 2, characterized in that: The method further comprises: The first blockchain node receives a second transaction request, where the second transaction request includes the blockchain transaction type and an identifier of the first data; The first blockchain node synchronizes a second block including an identifier of the blockchain transaction type and the first data to the at least one second blockchain node.
7. The method according to claim 1 or 2, characterized in that: The large-capacity storage node refers to the InterPlanetary File System IPFS node.
8. A communication device, characterized in that: Including transceiver unit and processing unit: The transceiver unit is configured to receive a first transaction request at a first blockchain node, wherein the first transaction request includes a blockchain transaction type and first data, and the blockchain transaction type is used to indicate a processing method for the first data; The processing unit is used for the first blockchain node to store the first data to the large-capacity storage node and determine the identification of the first data; the first blockchain node synchronizes the first block including the blockchain transaction type and the identification of the first data to at least one second blockchain node, and the first block is used for the at least one second blockchain node to obtain the first data from the large-capacity storage node according to the identification of the first data, and process the first data according to the blockchain transaction type.
9. A computing device, characterized in that include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 7 according to the obtained program instructions.
Citation Information
Patent Citations
Block chain network transmission method and device, and electronic equipment
CN109474682A
Financial big data-oriented multi-way tree structure block chain integrated optimization storage method
CN111611315A