Data transfer processing method, apparatus, device, and storage medium

CN116737054BActive Publication Date: 2026-08-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210203238.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-03
Publication Date
2026-08-21
Estimated Expiration
2042-03-03

AI Technical Summary

Technical Problem

[0003]相关技术中的区块链共识模式的智能合约在背书节点执行,共识过程只负责合约执行结果的排序打包过程,检测数据转移冲突、标记冲突数据转移操为失效的数据转移操作的过程由提交节点执行,然而相关技术将失效的数据转移操作打包至区块中,需要大量磁盘空间保存被该失效的失效的数据转移操作,磁盘利用率较低

Benefits of technology

[0024]本申请实施例提出的数据转移处理方法、装置、设备及存储介质,通过共识节点接收目标背书节点发送的、包括当前数据转移读写集的当前合约执行结果,对当前数据转移读写集进行数据转移冲突检测,得到包括第一当前数据转移操作集的当前检测结果,创建当前新区块,将所述第一当前数据转移操作集打包至所述当前新区块中,传递打包后的当前新区块至当前区块链网络中的其他节点,以使所述其他节点基于所述打包后的当前新区块,更新所述其他节点的本地数据转移记录,实现了将智能合约的执行交由背书节点异步执行,合约执行不影响区块链产块,从而可以支持复杂耗时的智能合约,进而提高区块链的性能;此外,由于共识节点打包非冲突数据转移操作至生成的新区块,不存在标记失效的数据转移操作的问题,即新区块中不存在被标记为失效的冲突数据转移,避免失效数据转移操作磁盘的占用,从而提高了磁盘的利用率和区块链的性能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116737054B_ABST
    Figure CN116737054B_ABST
Patent Text Reader

Abstract

The application provides a data transfer processing method and device, electronic equipment and storage medium, which are applied to various scenes such as cloud technology, artificial intelligence, intelligent transportation and auxiliary driving. The method comprises the following steps: receiving a current contract execution result including a current data transfer read-write set sent by a target endorsement node; performing data transfer conflict detection on the current data transfer read-write set to obtain a current detection result including a first current data transfer operation set; the first current data transfer operation set is a set composed of non-conflict data transfer operations; creating a current new block, packing the first current data transfer operation set into the current new block; and delivering the packed current new block to other nodes in a current blockchain network, so that the other nodes update local data transfer records of the other nodes based on the packed current new block. The application embodiment can improve the utilization rate of the disk and the performance of the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and specifically relates to a data transfer processing method, apparatus, device and storage medium. Background Technology

[0002] Currently, blockchain networks have evolved into a universal backend service supporting various applications. Through smart contracts deployed in blockchain networks, data submitted by applications can be stored on the chain, business logic related processing and query services can be provided, and the immutability and traceability of data can be achieved, thus gaining widespread use.

[0003] In the blockchain consensus model of related technologies, smart contracts are executed by endorsing nodes. The consensus process is only responsible for sorting and packaging the contract execution results. The process of detecting data transfer conflicts and marking conflicting data transfer operations as invalid data transfer operations is executed by the committing nodes. However, related technologies package invalid data transfer operations into blocks, which requires a large amount of disk space to store the invalid data transfer operations, resulting in low disk utilization. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a data transfer processing method, apparatus, device, and storage medium.

[0005] On the one hand, this application proposes a data transfer processing method, the method comprising:

[0006] Receive the current contract execution result sent by the target endorsing node; the current contract execution result is obtained by the target endorsing node in response to the current data transfer request sent by the client, by executing the smart contract corresponding to the current data transfer request, and the current contract execution result includes the current data transfer read / write set;

[0007] Data transfer conflict detection is performed on the current data transfer read / write set to obtain the current detection result; the current detection result includes a first current data transfer operation set, which is a set of non-conflicting data transfer operations;

[0008] Create a new block and package the first set of current data transfer operations into the new block;

[0009] The packaged new block is transmitted to other nodes in the current blockchain network so that the other nodes update their local data transfer records based on the packaged new block; the other nodes include the target endorsing node.

[0010] On the other hand, embodiments of this application provide a data transfer processing method, the method comprising:

[0011] In response to a current data transfer request sent by the client, the smart contract corresponding to the current data transfer request is executed to obtain the execution result of the current contract; the execution result of the current contract includes the current data transfer read / write set;

[0012] The current contract execution result is sent to the consensus node, so that the consensus node performs data transfer conflict detection on the current data transfer read / write set and obtains a current detection result including a first current data transfer operation set; the first current data transfer operation set is a set composed of non-conflicting data transfer operations; and the consensus node creates a new current block, packages the first current data transfer operation set into the new current block, and transmits the packaged new current block to other nodes in the current blockchain network; the other nodes include the target endorsing node; and the other nodes update their local data transfer records based on the packaged new current block.

[0013] On the other hand, embodiments of this application provide a data transfer processing apparatus, the apparatus comprising:

[0014] The current contract execution result sending module is used to receive the current contract execution result sent by the target endorsing node; the current contract execution result is obtained by the target endorsing node responding to the current data transfer request sent by the client and executing the smart contract corresponding to the current data transfer request; the current contract execution result includes the current data transfer read / write set.

[0015] The conflict detection module is used to perform data transfer conflict detection on the current data transfer read / write set and obtain the current detection result; the current detection result includes a first current data transfer operation set, which is a set of non-conflicting data transfer operations;

[0016] The packaging module is used to create a new block and package the first current data transfer operation set into the new block.

[0017] The transmission module is used to transmit the packaged current new block to other nodes in the current blockchain network, so that the other nodes can update their local data transfer records based on the packaged current new block; the other nodes include the target endorsing node.

[0018] On the other hand, embodiments of this application provide a data transfer processing apparatus, the apparatus comprising:

[0019] The current data transfer request response module is used to respond to the current data transfer request sent by the client, execute the smart contract corresponding to the current data transfer request, and obtain the execution result of the current contract; the execution result of the current contract includes the current data transfer read / write set;

[0020] A consensus node sending module is configured to send the current contract execution result to a consensus node, enabling the consensus node to perform data transfer conflict detection on the current data transfer read / write set, obtaining a current detection result including a first current data transfer operation set; the first current data transfer operation set is a set composed of non-conflicting data transfer operations; and enabling the consensus node to create a new current block, package the first current data transfer operation set into the new current block, and transmit the packaged new current block to other nodes in the current blockchain network; the other nodes include the target endorsing node; and enabling the other nodes to update their local data transfer records based on the packaged new current block.

[0021] On the other hand, this application proposes an electronic device for data transfer processing, the electronic device including a processor and a packer, the packer packing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the data transfer processing method as described above.

[0022] On the other hand, this application proposes a computer-readable storage medium that contains at least one instruction or at least one program, which is loaded and executed by a processor to implement the data transfer processing method as described above.

[0023] On the other hand, this application proposes a computer program product that, when executed by a processor, implements the data transfer processing method as described above.

[0024] The data transfer processing method, apparatus, device, and storage medium proposed in this application embodiment receive the current contract execution result, including the current data transfer read / write set, sent by the target endorsing node through a consensus node. Data transfer conflict detection is performed on the current data transfer read / write set to obtain a current detection result including a first current data transfer operation set. A new current block is created, and the first current data transfer operation set is packaged into the new current block. The packaged new current block is then transmitted to other nodes in the current blockchain network, enabling these other nodes to update their local data transfer records based on the packaged new current block. This allows the execution of smart contracts to be asynchronously performed by the endorsing node, without affecting blockchain block production. This supports complex and time-consuming smart contracts, thereby improving blockchain performance. Furthermore, since the consensus node packages non-conflicting data transfer operations into the generated new block, there is no issue of marked invalid data transfer operations. That is, there are no conflicting data transfers marked as invalid in the new block, avoiding disk occupation by invalid data transfer operations, thus improving disk utilization and blockchain performance. Attached Figure Description

[0025] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a schematic diagram illustrating the implementation environment of a data transfer processing method according to an exemplary embodiment.

[0027] Figure 2 This is a flow chart of a data transfer processing method according to an exemplary embodiment. Figure 1 .

[0028] Figure 3 This is a flowchart illustrating, according to an exemplary embodiment, a client sending a current data transfer request to a target endorsing node.

[0029] Figure 4 This is a schematic diagram illustrating relevant data involved in a data transfer operation according to an exemplary embodiment.

[0030] Figure 5 This is a flow chart of a data transfer processing method according to an exemplary embodiment. Figure 2 .

[0031] Figure 6 This is a schematic diagram of an optional structure according to an exemplary embodiment.

[0032] Figure 7 This is an optional schematic diagram of a block structure illustrated according to an exemplary embodiment.

[0033] Figure 8 This is a flow chart of a data transfer processing method according to an exemplary embodiment. Figure 3 .

[0034] Figure 9 This is a flow chart of a data transfer processing method according to an exemplary embodiment. Figure 4 .

[0035] Figure 10 This is a block diagram of a data transfer processing apparatus according to an exemplary embodiment.

[0036] Figure 11 A block diagram of a data transfer processing apparatus is shown according to an exemplary embodiment.

[0037] Figure 12 This is a hardware structure block diagram of a data transfer processing server provided according to an exemplary embodiment. Detailed Implementation

[0038] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0040] First, the technical terms involved in the embodiments of this application will be introduced:

[0041] Proof-of-Work (PoW) is a consensus mechanism in blockchain. It refers to an algorithm in a blockchain system that determines permissions based on the contributions made by each node during the computation process. In a blockchain network built on PoW, nodes compete for the right to record transactions by calculating the numerical solution of a random hash. The ability to obtain the correct numerical solution to generate a block is the concrete manifestation of a node's computing power.

[0042] Proof of Stake (PoS): PoS requires the prover to demonstrate ownership of a certain amount of encrypted virtual resources. It works by having the miner create a "virtual resource" transaction when a new block is created. This transaction sends a portion of the virtual resources to the miner according to a pre-defined ratio. PoS reduces the difficulty of acquiring virtual resources for each node proportionally based on the proportion and duration of their virtual resource ownership, thereby accelerating the search for random numbers.

[0043] Smart Contract: A set of promises defined in digital form, including protocols that allow contract participants to execute these promises.

[0044] Figure 1 This is a schematic diagram illustrating the implementation environment of a data transfer processing method according to an exemplary embodiment. For example... Figure 1 As shown, the implementation environment may include at least a client 01, an endorsement node 02, and a consensus node 03. The client 01, the endorsement node 02, and the consensus node 03 may be directly or indirectly connected through wired or wireless communication. This application embodiment does not impose any limitations on this.

[0045] Specifically, the client 01 can be used to send a current data transfer request to the target endorsing node. Optionally, the client 01 can be, but is not limited to, a mobile phone, computer, intelligent voice interaction device, smart home appliance, vehicle terminal, aircraft, etc. This application embodiment can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0046] Specifically, the endorsing node 02 can be used to respond to the current data transfer request, execute the smart contract corresponding to the current data transfer request, obtain the current contract execution result including the current data transfer read / write set, and send the aforementioned current contract execution result to the consensus node.

[0047] Specifically, the consensus node 03 can be used to perform data transfer conflict detection on the current data transfer read and write set, and obtain the current detection result including the first current data transfer operation set; and to create the current new block, package the first current data transfer operation set into the current new block, and pass the packaged current new block to other nodes in the current blockchain network.

[0048] Optionally, the endorsement node 02 and consensus node 03 can be independent physical devices or physical servers. They can also be server clusters or distributed systems composed of multiple physical servers. Alternatively, they can be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0049] It should be noted that, Figure 1 This is just one example. Other implementation environments may also be included in other scenarios.

[0050] Figure 2 This is a flow chart of a data transfer processing method according to an exemplary embodiment. Figure 1 This method can be used for Figure 1 In the implementation environment described in this specification, the method operation steps are as illustrated in the embodiments or flowcharts. However, based on conventional or non-inventive labor, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or server product execution, the method can be executed sequentially according to the embodiments or drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown in the embodiments or drawings... Figure 2 As shown, the method may include:

[0051] S101. The client sends a current data transfer request to the target endorsing node.

[0052] Optionally, the blockchain network may have endorsing nodes, which can refer to nodes selected in the blockchain network to undertake the endorsement task. Here, "endorsement" can be understood as the process and mechanism by which the node undertaking the endorsement task verifies data transfers on the blockchain network and declares the data transfer legal for verified data transfer operations.

[0053] For example, in the embodiments of this application, the data transfer can be a transaction, and the data transfer request can be a transaction request.

[0054] Optionally, embodiments of this application may send the current data transfer request to the target endorsing node in various ways, without specific limitations.

[0055] In one implementation, when there is only one endorsing node in the blockchain network, the client can send the current data transfer request directly to the endorsing node via wired or wireless transmission.

[0056] In an optional embodiment, Figure 3 This is a flowchart illustrating, according to an exemplary embodiment, a client sending a current data transfer request to a target endorsing node, such as... Figure 3 As shown, the current blockchain network includes multiple endorsing nodes. In step S101, the client sends a current data transfer request to the target endorsing node, which may include:

[0057] S1011. The client sends a current data transfer request to the current blockchain network. The current data transfer request carries the endorsement strategy of the smart contract and the data transfer hash value corresponding to the current data transfer request.

[0058] S1013. In response to the current data transfer request, the current blockchain network determines the target endorser node from the multiple endorser nodes mentioned above, based on the endorsement strategy and the data transfer hash value.

[0059] S1015. The current blockchain network sends the current data transfer request to the aforementioned target endorsing node.

[0060] Optionally, in step S1011 above, if the current blockchain network includes multiple endorsing nodes, the client may first send a current data transfer request to the current blockchain network. Figure 4 This is a schematic diagram illustrating relevant data involved in a data transfer operation according to an exemplary embodiment, such as... Figure 4 As shown, the current data transfer request may carry the smart contract's endorsement strategy, the data transfer hash value corresponding to the current data transfer request, the data transfer identifier (Identity Document, ID), the smart contract to be called, the method to be called, a list of data transfer related parameters (e.g., key, key-value), the initiator of the data transfer request, and the signature of the initiator of the data transfer request.

[0061] In this context, the data transfer hash value refers to the character field used to mark data transfers in a blockchain network. It can be expressed as a string of letters, numbers, or other symbols. For example, if several resources need to be transferred from address A to address B, address A can be used to sign the data transfer with a private key. This signature is then combined with the data transfer data, and a hash value is calculated to obtain the data transfer hash value.

[0062] Optionally, an "endorsement policy" can be set in the global configuration of the blockchain network or in the function call configuration of the smart contract. That is, the endorsement policy of the smart contract can provide a global default configuration, or the endorsement policy of each smart contract can be set individually. The "endorsement policy" specifies how many endorsement nodes need to execute and sign the execution result to be considered valid after a data transfer request is broadcast to the endorsement nodes.

[0063] For example, the endorsement strategy of a smart contract can be set by the contract administrator (e.g., the contract installer). The endorsement strategy includes three modes: arbitrary endorsement strategy, full endorsement strategy, and majority endorsement strategy. The endorsement strategy can be changed at any time. Changes to the endorsement strategy are also achieved through data transfer. Once the data transfer is correctly packaged, the new strategy takes effect, and subsequent data transfers will be verified and executed according to the new strategy. An arbitrary endorsement strategy means selecting any one endorser from multiple endorser nodes to execute the corresponding smart contract; a full endorsement strategy means all endorser nodes execute the corresponding smart contract; and a majority endorsement strategy means selecting more than half of the endorser nodes from multiple endorser nodes to execute the corresponding smart contract.

[0064] Optionally, in step S1013 above, when the current blockchain network receives the data transfer request, it can determine the target endorser node from multiple endorser nodes based on the endorsement strategy and the data transfer hash value.

[0065] Assuming the endorsement strategy is arbitrary, the current blockchain network can determine a preset number of endorsement nodes corresponding to the data transfer hash value from multiple endorsement nodes based on the data transfer hash value, and take any one of the preset number of endorsement nodes corresponding to the data transfer hash value as the target endorsement node.

[0066] Assuming the endorsement strategy is a full endorsement strategy, the current blockchain network can determine a preset number of endorsement nodes corresponding to the data transfer hash value from multiple endorsement nodes based on the data transfer hash value, and use all of the preset number of endorsement nodes corresponding to the data transfer hash value as target endorsement nodes.

[0067] Assuming the endorsement strategy is the majority endorsement strategy, the current blockchain network can determine a preset number of endorsement nodes corresponding to the data transfer hash value from multiple endorsement nodes based on the data transfer hash value, and select the majority of the nodes corresponding to the preset number of endorsement nodes as the target endorsement nodes.

[0068] Optionally, in step S1015 above, after the target endorsing node is determined, the current blockchain network can send the current data transfer request to the target endorsing node, thereby forwarding the current data transfer request sent by the client to the target endorsing node.

[0069] In this embodiment, the target endorser node for executing the smart contract is determined by the endorsement strategy and the data transfer hash value corresponding to the current data transfer request. This improves the accuracy of determining the target endorser node and thus improves the accuracy of data transfer.

[0070] S103. The aforementioned target endorsing node responds to the current data transfer request by executing the smart contract corresponding to the current data transfer request and obtaining the execution result of the current contract; the execution result of the current contract includes the current data transfer read / write set.

[0071] Optionally, since the current data transfer request carries the invoked smart contract, the target endorsing node can execute the smart contract carried in the current data transfer request upon receiving it. The execution of the smart contract by the endorsing node can be understood as the endorsing node registering its public key and other business-related information into the smart contract. This registration process is equivalent to the endorsing node executing the smart contract. For example, the aforementioned business-related information may include, but is not limited to, certificate information, port information, and Internet Protocol (IP) information. Since there may be multiple endorsing nodes, their registration in the smart contract can form an endorsing node list. Endorsement signatures in this list are valid; if an endorsing node is not registered in the smart contract (i.e., does not exist in the endorsing node list), its endorsement signature is invalid.

[0072] In one implementation, endorsement node registration can be done by organization. Through the endorsement node contract, a list of endorsement nodes corresponding to an organization can be retrieved. For example, if N companies jointly create a blockchain network, where N is a positive integer greater than or equal to 1, these N companies represent N organizations, which can represent N nodes in the blockchain network. Each organization can also register corresponding endorsement nodes, resulting in a total of 2N nodes in the blockchain network (i.e., N consensus nodes and N endorsement nodes), with each organization corresponding to one consensus node and one endorsement node. Since each organization has corresponding endorsement nodes, this organization-based registration method allows for convenient retrieval of the list of endorsement nodes corresponding to a specific organization.

[0073] In another implementation, endorsement nodes can be registered by contract. By registering endorsement node contracts, a list of endorsement nodes corresponding to a given contract can be retrieved. For example, with N smart contracts, each smart contract can register at least one endorsement node, forming a list of endorsement nodes for each smart contract. By registering by contract, the list of endorsement nodes corresponding to a specific smart contract can be easily retrieved.

[0074] Optionally, continue as follows Figure 4 As shown, the execution result of the current contract may include, but is not limited to: the current data transfer read / write set, the data transfer event log list, and the contract return value.

[0075] For example, the current data transfer read / write set can represent the data read and written by the target endorsing node. This current data transfer read / write set can include a read set and a write set. The read set can further include the executed smart contract name, key, data transfer version, etc., and the key in the read set can be a key-value pair of variables read during the data transfer. The write set can further include the executed contract name, key, key-value pair, etc., and the key in the write set can be a key-value pair of variables written during the data transfer. The keys contained in the read / write set imply exclusive use of the corresponding data; for example, in a resource transfer scenario, the read / write set contains the initiator's account address and the recipient's account address.

[0076] For example, the data transfer event log list may further include data transfer topics, data transfer logs, etc.

[0077] S105. The aforementioned target endorsing node sends the current contract execution result to the consensus node.

[0078] Optionally, after executing the smart contract at the target endorsing node and obtaining the current contract execution result, the current contract execution result can be broadcast to the consensus node via wired or wireless transmission.

[0079] Specifically, consensus nodes are nodes existing in a blockchain network, which can be determined through a consensus mechanism. This consensus mechanism refers to the process of verifying and confirming data transfer operations in a very short time through voting by specific nodes. If several nodes with unrelated interests can reach a consensus on a single data transfer operation, then the entire blockchain network can be considered to have reached a consensus on it.

[0080] Optionally, the execution result of the current contract can be sent to the consensus node in various ways in this embodiment of the application, and no specific limitation is made here.

[0081] In an optional embodiment, Figure 5 This is a flow chart of a data transfer processing method according to an exemplary embodiment. Figure 2 ,like Figure 5 As shown, in step S105 above, the target endorsing node sending the current contract execution result to the consensus node may include:

[0082] S1051. The aforementioned target endorsing node signs the aforementioned current contract execution result and the aforementioned current data transfer request to obtain current data transfer information carrying the endorsement signature.

[0083] S1053. The aforementioned target endorsing node sends the aforementioned current data transfer information to the aforementioned consensus node.

[0084] Optionally, in step S1051 above, the target endorsing node can append the current contract execution result to the current data transfer request and sign the current contract execution result and the current data transfer request to obtain the current data transfer information carrying the endorsement signature.

[0085] Optionally, in step S1053 above, the number of target endorsement nodes may be multiple. One target endorsement node can be selected as the master node from among the multiple target endorsement nodes. After the master node collects the endorsement signatures that satisfy the endorsement policy, it can assemble them into a signature such as... Figure 4 The complete current data transfer operation to be packaged is shown, and this complete current data transfer operation is broadcast to the consensus nodes. For example... Figure 4 As shown, when there are multiple endorsement signatures, an endorsement signature list can be formed. For example, in the case of a data transfer being a transaction, the complete current data transfer operation can be considered a single, complete current transaction.

[0086] In this embodiment of the application, by appending the current contract execution result to the current data transfer request and signing the current contract execution result and the current data transfer request, the security and reliability of data transfer can be improved.

[0087] S107. The consensus node performs data transfer conflict detection on the current data transfer read / write set to obtain the current detection result; the current detection result includes the first current data transfer operation set, which is a set of non-conflicting data transfer operations.

[0088] In an optional embodiment, the above method may further include: after the consensus node receives the current data transfer information carrying the endorsement signature, the consensus node may first verify that the endorsement signature satisfies the endorsement policy corresponding to the smart contract.

[0089] In one implementation, if the endorsement signature does not meet the endorsement policy, it indicates that the endorsement signature is invalid, and the consensus node does not perform the data transfer conflict detection operation.

[0090] In another implementation, if the endorsement signature satisfies the endorsement policy, the consensus node places the current data transfer operation into the data transfer pool. During the proposal block phase, the consensus node retrieves a complete batch of current data transfer operations from the data transfer pool and verifies whether there are conflicting data transfer operations within the read / write set of this batch. A conflict refers to a situation where multiple client accounts may concurrently submit multiple data transfer requests modifying the same dataset. When these applications process the data, send it to the blockchain network for consensus, and then store it in the ledger, conflicting data transfer operations may exist within a single block.

[0091] If conflicting data transfer operations exist, only one data transfer operation from the conflicting data transfer operations (i.e., non-conflicting data transfer operations) is retained, and the other data transfer operations are marked as invalid data transfer operations (i.e., conflicting data transfer operations). Specifically, the set of non-conflicting data transfer operations can be used as the first current data transfer operation set, and the set of conflicting data transfer operations that conflict with the data transfer operations in the first current data transfer operation set can be used as the second current data transfer operation set.

[0092] For example, the first current data transfer operation set and the second current data transfer operation set can be in the form of a data transfer operation list. Taking data transfer as an example, the data transfer operation list can be a transaction list.

[0093] For example, when performing data transfer conflict detection on the current data transfer read / write set, it is found that the data transfer operations modifying dataset 1 are data transfer operation 1, data transfer operation 2, and data transfer operation 3, and the data transfer operations modifying dataset 2 are data transfer operation 4 and data transfer operation 5. Therefore, for dataset 1, data transfer operations 1, 2, and 3 conflict. One of these data transfer operations can be retained; for example, data transfer operation 1 can be retained, and data transfer operations 2 and 3 can be marked as conflicting data transfer operations that conflict with data transfer operation 1. Similarly, for dataset 2, data transfer operations 4 and 5 conflict. One of these data transfer operations can be retained; for example, data transfer operation 4 can be retained, and data transfer operation 5 can be marked as conflicting data transfer operation that conflicts with data transfer operation 4. Finally, the set consisting of data transfer operations 1 and 4 can be used as the first current data transfer operation set, and the set consisting of data transfer operations 2, 3, and 5 can be used as the second current data transfer operation set.

[0094] S109. The aforementioned consensus node creates a new current block, packages the aforementioned first current data transfer operation set into the aforementioned new current block, and transmits the packaged new current block to other nodes in the current blockchain network; the aforementioned other nodes include the aforementioned target endorsing node.

[0095] Optionally, in S109 above, the consensus node can create a new block, package the first current data transfer operation set into the new block for proposal, and use the consensus process in the new block to perform consensus processing on the new block. After consensus is reached, the consensus node transmits the packaged new block to other nodes in the current blockchain network to broadcast the new block in the current blockchain network.

[0096] In an alternative implementation, if there are no read / write conflicts in the current data transfer read / write set, the consensus node can directly broadcast the new block in the blockchain network.

[0097] Continue as Figure 5 As shown, in another optional implementation, if a read-write conflict exists in the current data transfer read-write set, in the above-described S109, the transfer of the packaged new block to other nodes in the current blockchain network may include:

[0098] S1091. If it is determined that the current detection result includes the second current data transfer operation set, the consensus node appends the second data transfer operation set to the packaged current new block to obtain the current new block carrying the second data transfer operation set; the second current data transfer operation set is a set of conflicting data transfer operations, and the conflicting data transfer operations are data transfer operations that conflict with the data transfer operations in the first current data transfer operation set.

[0099] S1093. Consensus nodes transmit the current new block carrying the second set of data transfer operations to other nodes.

[0100] Optionally, in steps S1091-S1093 above, if there is a read-write conflict in the current data transfer read-write set, that is, if the current detection result includes the second current data transfer operation set, the consensus node can attach the conflicting second data transfer operation set to the current new block to obtain the current new block carrying the second data transfer operation set, and broadcast the current new block carrying the second data transfer operation set in the entire blockchain network.

[0101] In this embodiment, since the first set of current data transfer operations, consisting of non-conflicting data transfer operations, is packaged into the current new block, while conflicting data transfer operations are not packaged into the current new block, conflicting data transfer operations do not exist in the data structure of the current new block and do not affect the hash calculation of the current new block. Since there are no invalid data transfer operations in the current new block, there is no problem of marking invalid data transfer operations, thus avoiding disk occupation by invalid data transfer operations and improving disk utilization and blockchain performance.

[0102] In an optional embodiment, the above method may further include:

[0103] Based on the newly packaged block, the consensus nodes update their local data transfer records.

[0104] Optionally, while the consensus node broadcasts the packaged new block to the blockchain network, it can also include the packaged new block in its local data transfer record to update its local data transfer record, thereby updating the consensus node's local data transfer record. When the data transfer is a transaction, this data transfer record can be a ledger. Since the packaged new block includes non-conflicting data transfer operations but not conflicting data transfer operations, the updated local data transfer record also does not include conflicting data transfer operations, avoiding disk usage by invalid data transfer operations and improving disk utilization and blockchain performance.

[0105] S1011. The other nodes mentioned above update their local data transfer records based on the current new block after packaging.

[0106] Optionally, after other nodes receive the packaged new block, they can perform a series of verifications, such as verifying whether the block data format is correct, whether the hash value of the block header is less than the target difficulty, whether the block timestamp is within the allowed range, and whether the data transfer transaction in the block is valid. When all verifications pass, other nodes can include the newly packaged new block data into their own local data transfer records to update their local data transfer records.

[0107] For example, the other node can be the target endorsing node. After receiving the packaged new block, the target endorsing node will also perform the above series of verifications. When the verification is successful, the target endorsing node will include the packaged new block data into its own local data transfer record, thereby updating the local data transfer record.

[0108] Continue as Figure 5As shown, in an optional embodiment, the other nodes mentioned above are target endorsing nodes. After the consensus node transmits the current new block carrying the second data transfer operation set to the other nodes, the method further includes:

[0109] S201. The target endorsing node extracts the second data transfer operation set from the current new block carrying the second data transfer operation set.

[0110] S203. The target endorsing node will re-use the data transfer request corresponding to the second data transfer operation set as the current data transfer request.

[0111] S205. The target endorsing node repeats the above response to the current data transfer request, executes the smart contract corresponding to the current data transfer request, obtains the execution result of the current contract, and then sends the execution result of the current contract to the consensus node.

[0112] S207. The aforementioned consensus node repeats the above-mentioned data transfer conflict detection on the current data transfer read-write set, obtains the current detection result, and then transmits the current new block carrying the second data transfer operation set to the other nodes; the aforementioned other nodes repeat the above-mentioned operation of updating the local data transfer record based on the packaged current new block, and stop when the above-mentioned current detection result does not include the second current data transfer operation set.

[0113] Optionally, in step S201 above, if there are conflicting data transfer operations in the current data transfer read / write set, that is, if the current detection result includes the second current data transfer operation set, the endorsing node can not only update the local data transfer record based on the packaged current new block, but also extract the second data transfer operation set with data transfer conflicts from the current new block.

[0114] Optionally, in step S203 above, since the second data transfer operation set is obtained by the consensus node performing data transfer conflict detection on the current data transfer read-write set, and the current data transfer read-write set is obtained by the endorsing node responding to a certain data transfer request and executing a smart contract, it can be seen that the second data transfer operation set corresponds to a certain data transfer request. Therefore, the data transfer request corresponding to the second data transfer operation set can be extracted and the data transfer request can be used as the current data transfer request again.

[0115] Optionally, in step S205 above, for the target endorsing node, the target endorsing node re-executes the operation in response to the current data transfer request, executes the smart contract corresponding to the current data transfer request, and obtains the current contract execution result including the current data transfer read / write set; and re-executes the operation of sending the current contract execution result to the consensus node. For the consensus node, the consensus node re-executes the operation of performing data transfer conflict detection on the above-mentioned current data transfer read / write set, obtains the current detection result including the first current data transfer operation set; and re-executes the operation of creating the current new block, packaging the above-mentioned first current data transfer operation set into the current new block, and transmitting the packaged current new block to other nodes in the current blockchain network. For other nodes, the other nodes re-execute the operation of updating their local data transfer records based on the packaged current new block. This process is repeated until the current detection result does not include the second current data transfer operation set, that is, when there are no conflicting data transfer operations in the current data transfer read / write set.

[0116] For example, when performing data transfer conflict detection on the current data transfer read / write set, it is found that the data transfer operations that modify dataset 1 are data transfer operation 1, data transfer operation 2, and data transfer operation 3. Data transfer operation 1, data transfer operation 2, and data transfer operation 3 conflict with each other. One of the data transfer operations can be retained. For example, data transfer operation 1 can be retained, and data transfer operation 2 and data transfer operation 3 can be marked as conflicting data transfer operations that conflict with data transfer operation 1. Data transfer operation 1 is then used as the first non-conflicting current data transfer operation set, and data transfer operation 2 and data transfer operation 3 are used as the second conflicting current data transfer operation set.

[0117] The consensus node recreates the current new block (e.g., the current new block is the first new block), packages data transfer operation 1 into the current new block, and transmits the current new block carrying data transfer operations 2 and 3 to the target endorsing node. After verifying the first new block, the target endorsing node updates the ledger based on data transfer operation 1, and then re-executes the smart contract of data transfer operations 2 and 3 to obtain the current contract execution result including the current data transfer read-write set. The current contract execution result is then re-sent to the consensus node. The consensus node re-performs data transfer conflict detection on the current data transfer read-write set. If data transfer operations 2 and 3 conflict, data transfer operation 2 can be placed in the non-conflicting first current data transfer operation set, and data transfer operation 3 can be placed in the conflicting second current data transfer operation set.

[0118] The consensus node recreates the current new block (e.g., the current new block is the second new block), packages data transfer operation 2 into the current new block, and transmits the current new block carrying data transfer operation 3 to the target endorsing node. After verifying the second new block, the target endorsing node updates the ledger based on data transfer operation 2, and then re-executes the smart contract of data transfer operation 3 to obtain the current contract execution result including the current data transfer read and write set, and resends the current contract execution result to the consensus node.

[0119] The consensus node re-performs data transfer conflict detection on the current data transfer read / write set. If no conflicting data transfer operations are found, a new block is created (e.g., the third new block), and data transfer operation 3 is packaged into this new block without attaching conflicting transactions. The third new block is then broadcast to the network, including the current endorsing node. After verifying the third new block, the target endorsing node updates the ledger based on data transfer operation 3. If no other conflicting transactions are found, the above repetitive process stops.

[0120] In this embodiment, the execution of smart contracts is delegated to the endorsement nodes for asynchronous execution. Contract execution does not affect blockchain block production, supporting complex and time-consuming smart contracts and significantly improving blockchain performance. Furthermore, read / write conflict detection is performed during consensus ordering, and conflicting data transfer sets are broadcast to the endorsement nodes. This avoids the problem of clients repeatedly re-initiating the same data transfer request due to failed data transfer marking. Clients only need to submit a data transfer request once, reducing the frequency of information transmission between clients and nodes, thereby reducing the consumption of client system resources and network transmission resources. In addition, since conflicting data transfer operations do not exist in the block's data structure (i.e., there are no invalid transactions in the block), disk usage for invalid data transfer operations is avoided, resulting in higher disk utilization and further improved blockchain network performance.

[0121] Continue as Figure 5 As shown, in an optional embodiment, the other nodes mentioned above are the target endorsement nodes, and the method further includes:

[0122] S301. The target endorsing node transmits the packaged current new block to the client.

[0123] S303. The client updates the local data transfer record of the above client based on the current new block after packaging.

[0124] Optionally, after receiving the packaged new block from the consensus node, the target endorsing node can also transmit the packaged new block to the client. The client receives the packaged new block and updates its local data transfer record. On the one hand, this accurately updates the client's local data transfer record. On the other hand, since the endorsing node does not transmit conflicting data transfer operations to the client, the client does not need to re-initiate the same data transfer request; it only needs to submit one data transfer request. This reduces the frequency of information transmission between the client and the node, thereby reducing the consumption of client system resources and network transmission resources.

[0125] It should be noted that the above data transfer processing method is applicable not only to consortium blockchains but also to public blockchains. A consortium blockchain refers to a blockchain for members of a specific group and a limited number of third parties, where multiple pre-selected nodes are designated as ledger keepers, and the generation of each block is jointly determined by all pre-selected nodes. A public blockchain, on the other hand, refers to a blockchain where anyone can read and send transactions, and where transactions can be effectively confirmed, and where anyone can participate in the consensus process.

[0126] Unlike consortium blockchains where endorser nodes are guaranteed to be online and can collaborate, endorser nodes in public blockchains cannot always be guaranteed to be online, and they are in competition with each other. One implementation method is to add a security deposit to the endorser node registration contract to ensure a high online rate and prevent malicious behavior by the endorser nodes. If a malicious endorser node is discovered, its security deposit will be forfeited, thereby improving the security of the blockchain network.

[0127] In another implementation, within a public blockchain, due to the existence of potentially malicious nodes, the endorsement strategy can be chosen based on the majority of nodes endorsing the blockchain. Endorsing nodes compete to generate blocks, and a Proof-of-Work (PoW) or Proof-of-Stake (PoS) model can be used to select a valid endorser signature during the endorsement signing process. Therefore, while attaching the endorser signature to the data transfer operation, consensus result information of the endorser node can also be attached. For example, in step S1051 above, consensus result information of the endorser node can be attached to the obtained current data transfer information carrying the endorsement signature. The consensus node can verify this consensus result information while verifying the endorsement signature. If the verification passes, it indicates that the endorser node is not malicious, and the consensus node can perform subsequent conflict detection operations. If the verification fails, it indicates that the endorser node is malicious, and the consensus node will not perform subsequent conflict detection operations.

[0128] In an optional embodiment, this application also provides a data transfer processing system, which may include: a client, a target endorsement node, a consensus node, and other nodes;

[0129] The client is used to send a current data transfer request to the target endorsing node.

[0130] The target endorsing node is configured to respond to the current data transfer request, execute the smart contract corresponding to the current data transfer request, and obtain the current contract execution result; the current contract execution result includes the current data transfer read / write set; and to send the current contract execution result to the consensus node.

[0131] The consensus node is used to perform data transfer conflict detection on the current data transfer read / write set and obtain a current detection result; the current detection result includes a first current data transfer operation set, which is a set of non-conflicting data transfer operations; and is used to create a new block, package the first current data transfer operation set into the new block, and transmit the packaged new block to other nodes in the current blockchain network; the other nodes include the target endorsing node.

[0132] The other nodes are used to update their local data transfer records based on the current new block after packaging.

[0133] See Figure 6 , Figure 6 This is an exemplary schematic diagram illustrating an optional structure, in which multiple nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). In a blockchain system, any machine, such as a server or terminal, can join and become a node. A node includes a hardware layer, a middleware layer, an operating system layer, and an application layer.

[0134] See Figure 6 The functions of each node in the blockchain system shown include:

[0135] 1) Routing: A basic function of nodes used to support communication between nodes.

[0136] In addition to routing capabilities, nodes can also have the following functions:

[0137] 2) Applications are deployed in the blockchain to implement specific business needs. They record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system. When other nodes successfully verify the source and integrity of the record data, they add the record data to a temporary block.

[0138] 3) A blockchain consists of a series of blocks that are sequentially generated. Once a new block is added to the blockchain, it will not be removed. The blocks contain the data submitted by the nodes in the blockchain system.

[0139] See Figure 7 , Figure 7 This is an optional schematic diagram of a block structure according to an exemplary embodiment. Each block includes the data transfer hash value of the transaction records stored in this block (the data transfer hash value of this block) and the data transfer hash value of the previous block. The blocks are connected through their data transfer hash values ​​to form a blockchain. Additionally, blocks may include information such as a timestamp when the block was generated. A blockchain is essentially a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains relevant information used to verify the validity of the information (anti-counterfeiting) and to generate the next block.

[0140] Figure 8 This is a flow chart of a data transfer processing method according to an exemplary embodiment. Figure 3 The above data transfer and processing methods are introduced, with consensus nodes as the implementing entities. Figure 8 As shown, the method may include:

[0141] S401. Receive the current contract execution result sent by the target endorsing node; the current contract execution result is obtained by the target endorsing node responding to the current data transfer request sent by the client and executing the smart contract corresponding to the current data transfer request, and the current contract execution result includes the current data transfer read / write set.

[0142] S403. Perform data transfer conflict detection on the above-mentioned current data transfer read / write set to obtain the current detection result; the above-mentioned current detection result includes the first current data transfer operation set, which is a set of non-conflicting data transfer operations.

[0143] S405. Create a new block and package the first set of current data transfer operations into the new block.

[0144] S407. Transmit the packaged current new block to other nodes in the current blockchain network so that the other nodes update their local data transfer records based on the packaged current new block; the other nodes include the target endorsing node.

[0145] In an optional embodiment, the above-mentioned transmission of the packaged new block to other nodes in the current blockchain network, so that the other nodes update their local data transfer records based on the packaged new block, includes:

[0146] If it is determined that the current detection result includes the second current data transfer operation set, the second data transfer operation set is appended to the packaged current new block to obtain a current new block carrying the second data transfer operation set; the second current data transfer operation set is a set of conflicting data transfer operations, and the conflicting data transfer operations are data transfer operations that conflict with the data transfer operations in the first current data transfer operation set.

[0147] The current new block carrying the second data transfer operation set is transmitted to the other nodes so that the other nodes update their local data transfer records based on the current new block carrying the second data transfer operation set.

[0148] In an optional embodiment, the other nodes are the target endorsing nodes. After transmitting the current new block carrying the second data transfer operation set to the other nodes, so that the other nodes update their local data transfer records based on the current new block carrying the second data transfer operation set, the method further includes:

[0149] Repeat the above process of receiving the current contract execution result sent by the target endorsement node until the above process of transmitting the current new block carrying the second data transfer operation set to the above other nodes, so that the above other nodes update the local data transfer records of the above other nodes based on the current new block carrying the second data transfer operation set, and stop when the above current detection result does not include the above second current data transfer operation set;

[0150] In the repeated process, the current contract execution result is that the target endorsing node takes the data transfer request corresponding to the second data transfer operation set as the current data transfer request again, repeats the current data transfer request sent by the client, and executes the smart contract corresponding to the current data transfer request. The second data transfer operation set is extracted by the target endorsing node from the current new block carrying the second data transfer operation set.

[0151] In an optional embodiment, receiving the current contract execution result sent by the target endorsement node includes:

[0152] Receive current data transfer information carrying endorsement signature sent by the aforementioned target endorsement node; wherein, the aforementioned current data transfer information is obtained by the aforementioned target endorsement node signing the aforementioned current contract execution result and the aforementioned current data transfer request.

[0153] The above methods also include:

[0154] If the endorsement signature is verified to satisfy the endorsement policy corresponding to the smart contract, the operation of performing data transfer conflict detection on the current data transfer read / write set and obtaining the current detection result is performed.

[0155] Figure 9 This is a flow chart of a data transfer processing method according to an exemplary embodiment. Figure 4 Taking the target endorsement node as the execution subject, the above data transfer processing method is introduced, such as... Figure 9 As shown, the method may include:

[0156] S501. In response to the current data transfer request sent by the client, execute the smart contract corresponding to the current data transfer request and obtain the execution result of the current contract; the execution result of the current contract includes the current data transfer read / write set.

[0157] S503. Send the current contract execution result to the consensus node, so that the consensus node performs data transfer conflict detection on the current data transfer read / write set and obtains a current detection result including the first current data transfer operation set; the first current data transfer operation set is a set of non-conflicting data transfer operations; and so that the consensus node creates a new current block, packages the first current data transfer operation set into the new current block, and transmits the packaged new current block to other nodes in the current blockchain network; the other nodes include the target endorsing node; and so that the other nodes update their local data transfer records based on the packaged new current block.

[0158] In an optional embodiment, the other nodes mentioned above are local target nodes, and the method further includes:

[0159] Receive the current new block carrying the second set of data transfer operations transmitted by the aforementioned consensus node.

[0160] The aforementioned new block carrying the second data transfer operation set is obtained by the consensus node attaching the second data transfer operation set to the packaged new block when it is determined that the current detection result includes the second current data transfer operation set. The second current data transfer operation set is a set of conflicting data transfer operations, which are data transfer operations that conflict with the data transfer operations in the first current data transfer operation set.

[0161] In an optional embodiment, the above method further includes:

[0162] Extract the second data transfer operation set from the current new block that carries the second data transfer operation set.

[0163] The data transfer request corresponding to the second data transfer operation set mentioned above is re-used as the current data transfer request.

[0164] The process involves repeating the above-described response to the current data transfer request sent by the client, executing the smart contract corresponding to the current data transfer request, obtaining the current contract execution result, and then sending the current contract execution result to the consensus node. This process is repeated by the consensus node to perform data transfer conflict detection on the current data transfer read / write set, obtaining a current detection result including the first current data transfer operation set. The process also involves the consensus node to repeatedly create a new current block, package the first current data transfer operation set into the new current block, and transmit the packaged new current block to other nodes in the current blockchain network. Finally, the process involves the other nodes to repeat the above-described operation of updating their local data transfer records based on the packaged new current block. The process stops when the current detection result does not include the second current data transfer operation set.

[0165] In an optional embodiment, sending the current contract execution result to the consensus node includes:

[0166] Sign the current contract execution result and the current data transfer request to obtain the current data transfer information with endorsement signature.

[0167] Send the aforementioned current data transfer information to the aforementioned consensus node.

[0168] In an optional embodiment, the other nodes mentioned above are local target nodes, and the method further includes:

[0169] The newly packaged block is transmitted to the client so that the client updates its local data transfer record based on the newly packaged block.

[0170] In an optional embodiment, the current blockchain network includes multiple local nodes, and the response to the current data transfer request sent by the client includes:

[0171] The local target node responds to the current data transfer request sent by the current blockchain network.

[0172] The aforementioned local target node is determined from among the aforementioned multiple local nodes based on the endorsement policy carried in the aforementioned current data transfer request and the data transfer hash value corresponding to the aforementioned current data transfer request, in response to the aforementioned current data transfer request sent by the aforementioned client.

[0173] Figure 10 This is a block diagram illustrating a data transfer processing apparatus according to an exemplary embodiment. Figure 10 As shown, the device may include at least:

[0174] The current contract execution result receiving module 601 is used to receive the current contract execution result sent by the target endorsing node; the current contract execution result is obtained by the target endorsing node responding to the current data transfer request sent by the client and executing the smart contract corresponding to the current data transfer request; the current contract execution result includes the current data transfer read / write set.

[0175] The conflict detection module 603 is used to perform data transfer conflict detection on the current data transfer read / write set and obtain the current detection result; the current detection result includes a first current data transfer operation set, which is a set of non-conflicting data transfer operations.

[0176] Packaging module 605 is used to create a new block and package the first set of current data transfer operations into the new block.

[0177] The transmission module 607 is used to transmit the packaged current new block to other nodes in the current blockchain network, so that the other nodes can update their local data transfer records based on the packaged current new block; the other nodes include the target endorsing node.

[0178] Optionally, the aforementioned transmission module 607 includes:

[0179] An appending unit is used to append the second data transfer operation set to the packaged current new block when it is determined that the current detection result includes the second current data transfer operation set, so as to obtain a current new block carrying the second data transfer operation set; the second current data transfer operation set is a set of conflicting data transfer operations, and the conflicting data transfer operations are data transfer operations that conflict with the data transfer operations in the first current data transfer operation set.

[0180] The first block transfer unit is used to transfer the current new block carrying the second data transfer operation set to the other nodes, so that the other nodes can update their local data transfer records based on the current new block carrying the second data transfer operation set.

[0181] Optionally, the other nodes mentioned above are the target endorsement nodes, and the device further includes:

[0182] The first repeating module is used to repeat the above-mentioned receiving of the current contract execution result sent by the target endorsement node until the above-mentioned transmitting of the current new block carrying the second data transfer operation set to the above-mentioned other nodes, so that the above-mentioned other nodes update the local data transfer records of the above-mentioned other nodes based on the above-mentioned current new block carrying the second data transfer operation set, and stops when the above-mentioned current detection result does not include the above-mentioned second current data transfer operation set;

[0183] In the repeated process, the current contract execution result is that the target endorsing node takes the data transfer request corresponding to the second data transfer operation set as the current data transfer request again, repeats the current data transfer request sent by the client, and executes the smart contract corresponding to the current data transfer request. The second data transfer operation set is extracted by the target endorsing node from the current new block carrying the second data transfer operation set.

[0184] Optionally, the aforementioned current contract execution result receiving module is used to receive current data transfer information carrying an endorsement signature sent by the aforementioned target endorsement node; wherein, the aforementioned current data transfer information is obtained by the aforementioned target endorsement node signing the aforementioned current contract execution result and the aforementioned current data transfer request;

[0185] The above-mentioned device also includes:

[0186] The execution module is used to perform the above-mentioned data transfer conflict detection on the current data transfer read / write set and obtain the current detection result, provided that the above-mentioned endorsement signature satisfies the endorsement policy corresponding to the above-mentioned smart contract.

[0187] Figure 11 A block diagram of a data transfer processing apparatus is shown according to an exemplary embodiment. Figure 11 The device may include at least:

[0188] The current data transfer request response module 701 is used to respond to the current data transfer request sent by the client, execute the smart contract corresponding to the current data transfer request, and obtain the execution result of the current contract; the execution result of the current contract includes the current data transfer read / write set.

[0189] The consensus node sending module 703 is used to send the current contract execution result to the consensus node, so that the consensus node performs data transfer conflict detection on the current data transfer read / write set and obtains a current detection result including a first current data transfer operation set; the first current data transfer operation set is a set of non-conflicting data transfer operations; and to enable the consensus node to create a new current block, package the first current data transfer operation set into the new current block, and transmit the packaged new current block to other nodes in the current blockchain network; the other nodes include the target endorsing node; and to enable the other nodes to update their local data transfer records based on the packaged new current block.

[0190] Optionally, the other nodes mentioned above are local target nodes, and the device further includes:

[0191] The current new block receiving module is used to receive the current new block carrying the second data transfer operation set transmitted by the aforementioned consensus nodes;

[0192] The aforementioned new block carrying the second data transfer operation set is obtained by the consensus node attaching the second data transfer operation set to the packaged new block when it is determined that the current detection result includes the second current data transfer operation set. The second current data transfer operation set is a set of conflicting data transfer operations, which are data transfer operations that conflict with the data transfer operations in the first current data transfer operation set.

[0193] Optionally, the above-mentioned device further includes:

[0194] The extraction module is used to extract the second data transfer operation set from the current new block carrying the second data transfer operation set.

[0195] The re-determination module is used to re-use the data transfer request corresponding to the second data transfer operation set as the current data transfer request.

[0196] The second repetition module is used to repeat the above-mentioned operation of responding to the current data transfer request sent by the client, executing the smart contract corresponding to the current data transfer request, obtaining the current contract execution result, and sending the current contract execution result to the consensus node; to enable the consensus node to repeat the above-mentioned operation of performing data transfer conflict detection on the current data transfer read-write set and obtaining the current detection result including the first current data transfer operation set; to enable the consensus node to repeat the operation of creating the current new block, packaging the first current data transfer operation set into the current new block, and transmitting the packaged current new block to other nodes in the current blockchain network; and to enable the other nodes to repeat the above-mentioned operation of updating the local data transfer record of the other nodes based on the packaged current new block, stopping when the current detection result does not include the second current data transfer operation set.

[0197] Optionally, the consensus node sending module mentioned above includes:

[0198] The signature module is used to sign the current contract execution result and the current data transfer request to obtain the current data transfer information with endorsement signature.

[0199] The node sending unit is used to send the aforementioned current data transfer information to the aforementioned consensus node.

[0200] Optionally, the other nodes mentioned above are local target nodes, and the device further includes:

[0201] The second block transfer unit is used to transfer the packaged current new block to the client, so that the client can update its local data transfer record based on the packaged current new block.

[0202] Optionally, the aforementioned current blockchain network includes multiple local nodes, and the aforementioned current data transfer request response module is used to respond to the current data transfer request sent by the aforementioned current blockchain network based on the local target node;

[0203] The aforementioned local target node is determined from among the aforementioned multiple local nodes based on the endorsement policy carried in the aforementioned current data transfer request and the data transfer hash value corresponding to the aforementioned current data transfer request, in response to the aforementioned current data transfer request sent by the aforementioned client.

[0204] It should be noted that the device embodiments provided in this application are based on the same inventive concept as the method embodiments described above.

[0205] This application also provides an electronic device for data transfer processing, which includes a processor and a memory. The memory stores at least one instruction or at least one program. The processor loads and executes the at least one instruction or at least one program to implement the data transfer processing method provided in any of the above embodiments.

[0206] Embodiments of this application also provide a computer-readable storage medium that can be disposed in a terminal to store at least one instruction or at least one program for implementing a data transfer processing method in the method embodiments. The at least one instruction or at least one program is loaded and executed by a processor to implement the data transfer processing method provided in the above method embodiments.

[0207] Optionally, in the embodiments of this specification, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0208] The memory described in this specification can be used to store software programs and modules. The processor executes various functional applications and data transfer processes by running the software programs and modules stored in the memory. The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for functions, etc.; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.

[0209] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the data transfer processing method provided in the above-described method embodiments.

[0210] The data transfer processing method embodiments provided in this application can be executed on a terminal, computer terminal, server, or similar computing device. Taking running on a server as an example, Figure 12This is a hardware structure block diagram of a data transfer processing server provided according to an exemplary embodiment. For example... Figure 12 As shown, the server 800 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 810 (CPUs 810 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 830 for storing data, and one or more storage media 820 (e.g., one or more mass storage devices) for storing application programs 823 or data 822. The memory 830 and storage media 820 may be temporary or persistent storage. The program stored in the storage media 820 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 810 may be configured to communicate with the storage media 820 and execute the series of instruction operations stored in the storage media 820 on the server 800. Server 800 may also include one or more power supplies 860, one or more wired or wireless network interfaces 850, one or more input / output interfaces 840, and / or one or more operating systems 821, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0211] The input / output interface 840 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 800. In one example, the input / output interface 840 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 840 may be a radio frequency (RF) module for wireless communication with the Internet.

[0212] Those skilled in the art will understand that Figure 12 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 800 may also include... Figure 12 The more or fewer components shown, or having the same Figure 12 The different configurations shown.

[0213] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0214] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and server embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0215] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0216] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A data transfer processing method, characterized in that, The data transfer processing method is applied to consensus nodes, and the method includes: Receive the current contract execution result sent by the target endorsing node; the current contract execution result is obtained by the target endorsing node in response to the current data transfer request sent by the client, by executing the smart contract corresponding to the current data transfer request, and the current contract execution result includes the current data transfer read / write set; Data transfer conflict detection is performed on the current data transfer read / write set to obtain the current detection result; the current detection result includes a first current data transfer operation set, which is a set of non-conflicting data transfer operations; Create a new block and package the first set of current data transfer operations into the new block; The packaged new block is transmitted to other nodes in the current blockchain network besides the consensus node, so that the other nodes update their local data transfer records based on the packaged new block; the other nodes include the target endorsing node.

2. The method according to claim 1, characterized in that, The step of transmitting the packaged new block to other nodes in the current blockchain network besides the consensus node, so that the other nodes update their local data transfer records based on the packaged new block, includes: If it is determined that the current detection result includes the second current data transfer operation set, the second current data transfer operation set is appended to the packaged current new block to obtain a current new block carrying the second current data transfer operation set; the second current data transfer operation set is a set of conflicting data transfer operations, and the conflicting data transfer operations are data transfer operations that conflict with the data transfer operations in the first current data transfer operation set; The current new block carrying the second current data transfer operation set is transmitted to the other nodes, so that the other nodes update their local data transfer records based on the current new block carrying the second current data transfer operation set.

3. The method according to claim 2, characterized in that, The other nodes are the target endorsing nodes. After the method transmits the current new block carrying the second current data transfer operation set to the other nodes, so that the other nodes update their local data transfer records based on the current new block carrying the second current data transfer operation set, the method further includes: Repeat the process of receiving the current contract execution result sent by the target endorsement node until the current new block carrying the second current data transfer operation set is transmitted to the other nodes, so that the other nodes update their local data transfer records based on the current new block carrying the second current data transfer operation set. Stop when the current detection result does not include the second current data transfer operation set. In the repeated process, the current contract execution result is obtained by the target endorsing node taking the data transfer request corresponding to the second current data transfer operation set as the current data transfer request again, repeating the current data transfer request sent by the client, and executing the smart contract corresponding to the current data transfer request. The second current data transfer operation set is extracted by the target endorsing node from the current new block carrying the second current data transfer operation set.

4. The method according to any one of claims 1 to 3, characterized in that, The receipt of the current contract execution result sent by the target endorsement node includes: Receive current data transfer information carrying an endorsement signature sent by the target endorsing node; wherein, the current data transfer information is obtained by the target endorsing node signing the current contract execution result and the current data transfer request; The method further includes: If the endorsement signature is verified to satisfy the endorsement policy corresponding to the smart contract, the operation of performing data transfer conflict detection on the current data transfer read / write set and obtaining the current detection result is performed.

5. A data transfer processing method, characterized in that, The data transfer processing method is applied to the target endorsement node, and the method includes: In response to a current data transfer request sent by the client, the smart contract corresponding to the current data transfer request is executed to obtain the execution result of the current contract; the execution result of the current contract includes the current data transfer read / write set; The current contract execution result is sent to the consensus node, so that the consensus node performs data transfer conflict detection on the current data transfer read / write set and obtains a current detection result including a first current data transfer operation set; the first current data transfer operation set is a set composed of non-conflicting data transfer operations; and the consensus node creates a new current block, packages the first current data transfer operation set into the new current block, and transmits the packaged new current block to other nodes in the current blockchain network other than the consensus node; the other nodes include the target endorsing node; and the other nodes update their local data transfer records based on the packaged new current block.

6. The method according to claim 5, characterized in that, The other nodes are local target nodes, and the method further includes: Receive the new block carrying the second set of current data transfer operations transmitted by the consensus node; The current new block carrying the second current data transfer operation set is obtained by the consensus node appending the second current data transfer operation set to the packaged current new block when it is determined that the current detection result includes the second current data transfer operation set. The second current data transfer operation set is a set of conflicting data transfer operations, which are data transfer operations that conflict with the data transfer operations in the first current data transfer operation set.

7. The method according to claim 6, characterized in that, The method further includes: Extract the second current data transfer operation set from the current new block carrying the second current data transfer operation set; The data transfer request corresponding to the second current data transfer operation set is re-used as the current data transfer request; The process involves repeating the response to the current data transfer request sent by the client, executing the smart contract corresponding to the current data transfer request, obtaining the execution result of the current contract, and sending the execution result of the current contract to the consensus node; causing the consensus node to repeat the operation of performing data transfer conflict detection on the current data transfer read-write set to obtain a current detection result including the first current data transfer operation set; causing the consensus node to repeatedly create a new current block, package the first current data transfer operation set into the new current block, and transmit the packaged new current block to other nodes in the current blockchain network; and causing the other nodes to repeat the operation of updating their local data transfer records based on the packaged new current block, stopping when the current detection result does not include the second current data transfer operation set.

8. The method according to any one of claims 5 to 7, characterized in that, Sending the current contract execution result to the consensus node includes: Sign the current contract execution result and the current data transfer request to obtain current data transfer information carrying an endorsement signature; Send the current data transfer information to the consensus node.

9. The method according to any one of claims 5 to 7, characterized in that, The other nodes are local target nodes, and the method further includes: The packaged new block is transmitted to the client so that the client updates its local data transfer record based on the packaged new block.

10. The method according to any one of claims 5 to 7, characterized in that, The current blockchain network includes multiple local nodes, and the response to the current data transfer request sent by the client includes: The local target node responds to the current data transfer request sent by the current blockchain network; The local target node is determined from among the multiple local nodes based on the endorsement policy carried in the current data transfer request and the data transfer hash value corresponding to the current data transfer request, in response to the current data transfer request sent by the client in the current blockchain network.

11. A data transfer and processing apparatus, characterized in that, The data transfer processing device is applied to the consensus node, and the device includes: The current contract execution result receiving module is used to receive the current contract execution result sent by the target endorsing node; the current contract execution result is obtained by the target endorsing node responding to the current data transfer request sent by the client and executing the smart contract corresponding to the current data transfer request; the current contract execution result includes the current data transfer read / write set. The conflict detection module is used to perform data transfer conflict detection on the current data transfer read / write set and obtain the current detection result; the current detection result includes a first current data transfer operation set, which is a set of non-conflicting data transfer operations; The packaging module is used to create a new block and package the first current data transfer operation set into the new block. The transmission module is used to transmit the packaged current new block to other nodes in the current blockchain network other than the consensus node, so that the other nodes can update their local data transfer records based on the packaged current new block; the other nodes include the target endorsing node.

12. A data transfer and processing apparatus, characterized in that, The data transfer processing device is applied to the target endorsement node, and the device includes: The current data transfer request response module is used to respond to the current data transfer request sent by the client, execute the smart contract corresponding to the current data transfer request, and obtain the execution result of the current contract; the execution result of the current contract includes the current data transfer read / write set; A consensus node sending module is configured to send the current contract execution result to a consensus node, so that the consensus node performs data transfer conflict detection on the current data transfer read / write set and obtains a current detection result including a first current data transfer operation set; the first current data transfer operation set is a set composed of non-conflicting data transfer operations; and to enable the consensus node to create a new current block, package the first current data transfer operation set into the new current block, and transmit the packaged new current block to other nodes in the current blockchain network other than the consensus node; the other nodes include the target endorsing node; and to enable the other nodes to update their local data transfer records based on the packaged new current block.

13. An electronic device for a data transfer and processing method, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the data transfer processing method as described in any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the data transfer processing method as described in any one of claims 1 to 10.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the data transfer processing method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Intelligent contract conflict detection method based on directed acyclic graph

    CN112837153A

  • Customized endorsement logic for blockchain

    US20190278852A1