CN116737054A - Data transfer processing method, device, equipment and storage medium - Google Patents

Data transfer processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN116737054A
CN116737054A CN202210203238.9A CN202210203238A CN116737054A CN 116737054 A CN116737054 A CN 116737054A CN 202210203238 A CN202210203238 A CN 202210203238A CN 116737054 A CN116737054 A CN 116737054A
Authority
CN
China
Prior art keywords
data transfer
current
new block
node
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210203238.9A
Other languages
Chinese (zh)
Inventor
曾毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210203238.9A priority Critical patent/CN116737054A/en
Publication of CN116737054A publication Critical patent/CN116737054A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a data transfer processing method, a device, electronic equipment and a storage medium, which are applied to various scenes such as cloud technology, artificial intelligence, intelligent traffic, auxiliary driving and the like, wherein the method comprises the following steps: receiving a current contract execution result which is sent by a target endorsement node and comprises a current data transfer read-write set; performing data transfer conflict detection on the current data transfer read-write set to obtain a current detection result comprising a first current data transfer operation set; the first current data transfer operation set is a set formed by non-conflict data transfer operations; creating a current new block, and packaging a 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, so that the other nodes update local data transfer records of the other nodes based on the packaged current new block. The embodiment of the application can improve the utilization rate of the magnetic disk and the performance of the block chain.

Description

Data transfer processing method, device, equipment and storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a data transfer processing method, a device, equipment and a storage medium.
Background
Currently, a blockchain network has been developed as a background service supporting the versatility of various applications, and through intelligent contracts deployed in the blockchain network, uplink storage, business logic related processing and query services can be performed on data submitted by the applications, and the characteristics of non-tampering and traceability of the data are realized, so that the blockchain network is commonly used.
The intelligent block chain consensus mode in the related art is implemented at about an endorsement node, the consensus process is only responsible for the ordering and packaging process of contract implementation results, the process of detecting data transfer conflict and marking the conflict data transfer operation as invalid data transfer operation is implemented by a submitting node, however, the related art packages the invalid data transfer operation into a block, a large amount of disk space is required for storing the invalid data transfer operation which is invalid, and the disk utilization rate is low.
Disclosure of Invention
In order to solve the technical problems, the application provides a data transfer processing method, a device, equipment and a storage medium.
In one aspect, the present application provides a data transfer processing method, which includes:
receiving a current contract execution result sent by a target endorsement node; the current contract execution result is obtained by the target endorsement node executing an intelligent contract corresponding to the current data transfer request in response to the current data transfer request sent by the client, and the current contract execution result comprises a current data transfer read-write set;
Performing data transfer conflict detection on the current data transfer read-write set to obtain a current detection result; the current detection result comprises a first current data transfer operation set, wherein the first current data transfer operation set is a set formed by non-conflict data transfer operations;
creating a current new block, and packaging the first current data transfer operation set into the current new block;
transmitting the packaged current new block to other nodes in the current blockchain network, so that the other nodes update local data transfer records of the other nodes based on the packaged current new block; the other nodes include the target endorsement node.
In another aspect, an embodiment of the present application provides a data transfer processing method, where the method includes:
responding to a current data transfer request sent by a client, executing an intelligent contract corresponding to the current data transfer request, and obtaining a current contract execution result; the current contract execution result comprises a current data transfer read-write set;
transmitting the current contract execution result to a consensus node so that the consensus node carries out data transfer conflict detection on the current data transfer read-write set to obtain a current detection result comprising a first current data transfer operation set; the first current data transfer operation set is a set formed by non-conflict data transfer operations; the common node creates a current new block, packages the first current data transfer operation set into the current new block, and transmits the packaged current new block to other nodes in a current blockchain network; the other nodes comprise the target endorsement node; and updating the local data transfer records of the other nodes based on the packaged current new block by the other nodes.
In another aspect, an embodiment of the present application provides a data transfer processing apparatus, including:
the current contract execution result sending module is used for receiving the current contract execution result sent by the target endorsement node; the current contract execution result is obtained by the target endorsement node executing an intelligent contract corresponding to the current data transfer request in response to the current data transfer request sent by the client, and the current contract execution result comprises a current data transfer read-write set;
the conflict detection module is used for carrying out data transfer conflict detection on the current data transfer read-write set to obtain a current detection result; the current detection result comprises a first current data transfer operation set, wherein the first current data transfer operation set is a set formed by non-conflict data transfer operations;
the packaging module is used for creating a current new block and packaging the first current data transfer operation set into the current new block;
the transmission module is used for transmitting the packaged current new block to other nodes in the current blockchain network so that the other nodes update local data transfer records of the other nodes based on the packaged current new block; the other nodes include the target endorsement node.
In another aspect, an embodiment of the present application provides a data transfer processing apparatus, including:
the current data transfer request response module is used for responding to a current data transfer request sent by a client, executing an intelligent contract corresponding to the current data transfer request and obtaining a current contract execution result; the current contract execution result comprises a current data transfer read-write set;
the consensus node sending module is used for sending the current contract execution result to a consensus node so that the consensus node can detect the data transfer conflict of the current data transfer read-write set to obtain a current detection result comprising a first current data transfer operation set; the first current data transfer operation set is a set formed by non-conflict data transfer operations; the common node creates a current new block, packages the first current data transfer operation set into the current new block, and transmits the packaged current new block to other nodes in a current blockchain network; the other nodes comprise the target endorsement node; and updating the local data transfer records of the other nodes based on the packaged current new block by the other nodes.
In another aspect, the present application provides an electronic device for data transfer processing, where the electronic device includes a processor and a packer, and the packer packages at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement a data transfer processing method as described above.
In another aspect, the present application provides a computer readable storage medium having at least one instruction or at least one program packaged therein, the at least one instruction or the at least one program loaded and executed by a processor to implement a data transfer processing method as described above.
In another aspect, the application proposes a computer program product which, when executed by a processor, implements a data transfer processing method as described above.
According to the data transfer processing method, the device, the equipment and the storage medium, a current contract execution result which is sent by a target endorsement node and comprises a current data transfer read-write set is received through a consensus node, data transfer conflict detection is carried out on the current data transfer read-write set to obtain a current detection result comprising a first current data transfer operation set, a current new block is created, the first current data transfer operation set is packed into the current new block, the packed current new block is transferred 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 execution of intelligent contracts is carried out by the endorsement node asynchronously, the execution of contracts does not influence blockchain production blocks, and therefore complex time-consuming intelligent contracts can be supported, and the performance of blockchains is improved; in addition, because the consensus node packs the non-conflict data transfer operation to the generated new block, the problem of marking the invalid data transfer operation does not exist, namely, the conflict data transfer marked as invalid does not exist in the new block, and the occupation of a disk of the invalid data transfer operation is avoided, so that the utilization rate of the disk and the performance of a blockchain are improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram illustrating an implementation environment of a data transfer processing method according to an exemplary embodiment.
Fig. 2 is a flowchart one of a data transfer processing method according to an exemplary embodiment.
FIG. 3 is a flowchart illustrating a client sending a current data transfer request to a target endorsement node, in accordance with an example embodiment.
FIG. 4 is a schematic diagram illustrating relevant data involved in a data transfer operation, according to an example embodiment.
Fig. 5 is a flow chart two of a data transfer processing method according to an exemplary embodiment.
Fig. 6 is a schematic diagram illustrating an alternative configuration according to an exemplary embodiment.
Fig. 7 is an alternative schematic diagram of a Block Structure (Block Structure) according to an example embodiment.
Fig. 8 is a flowchart three illustrating a data transfer processing method according to an exemplary embodiment.
Fig. 9 is a flowchart fourth illustrating a data transfer processing method according to an exemplary embodiment.
Fig. 10 is a block diagram of a data transfer processing apparatus according to an exemplary embodiment.
FIG. 11 illustrates a block diagram of a data transfer processing apparatus according to an exemplary embodiment.
Fig. 12 is a block diagram of a hardware architecture of a server for a data transfer process according to an exemplary embodiment.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, technical terms related to the embodiments of the present application will be described:
a proof of Work (POW): is a consensus mechanism for blockchains. Refers to an algorithm in a blockchain system that determines permissions based on the contribution each node makes during the operation. In a blockchain network constructed based on a workload certification mechanism, the ability of a node to solve for the correct value solution to generate a block by computing the value solution of a random hash to contend for the accounting right is a concrete manifestation of the node's computing power.
Proof of rights mechanism (POS): the rights and interests proving mechanism requires that the prover provide ownership of a certain number of encrypted virtual resources. The equity proof mechanism operates in such a way that when creating a new block, the mineworker needs to create a "virtual resource" trade, which sends some virtual resources to the mineworker itself in a predetermined proportion. The rights and interests proving mechanism reduces the difficulty of obtaining the virtual resources of the nodes in equal proportion according to the proportion and time of each node having the virtual resources and the algorithm, thereby accelerating the speed of searching the random numbers.
Smart Contract: is a set of digitally defined commitments including agreements on which the contract participants can perform these commitments.
FIG. 1 is a schematic diagram illustrating an implementation environment of a data transfer processing method according to an exemplary embodiment. As shown in fig. 1, the implementation environment may at least include a client 01, an endorsement node 02, a consensus node 03, and the like, where the client 01, the endorsement node 02, and the consensus node 03 may be directly or indirectly connected through a wired or wireless communication manner, and embodiments of the present application are not limited herein.
Specifically, the client 01 may be configured to send a current data transfer request to the target endorsement node. Alternatively, the client 01 may include, but is not limited to, a cell phone, a computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, an aircraft, etc. The embodiment of the application can be applied to various scenes, including but not limited to cloud technology, artificial intelligence, intelligent transportation, auxiliary driving and the like.
Specifically, the endorsement node 02 may be configured to execute an intelligent contract corresponding to the current data transfer request in response to the current data transfer request, to obtain a current contract execution result including the current data transfer read-write set, and to send the current contract execution result to the consensus node.
Specifically, the consensus node 03 may be configured to perform data transfer conflict detection on a current data transfer read-write set to obtain a current detection result including a first current data transfer operation set; and the method is used for creating a 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.
Alternatively, the endorsement node 02, the consensus node 03 may be a separate physical device, a physical server. Or may be a server cluster or a distributed system formed by a plurality of physical servers. The cloud server can also provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, big data, artificial intelligent platforms and the like.
It should be noted that fig. 1 is only an example. In other scenarios, other implementation environments may also be included.
Fig. 2 is a flowchart one of a data transfer processing method according to an exemplary embodiment. The method may be used in the implementation environment of fig. 1. The present specification provides method operational steps as described above, for example, in the examples or flowcharts, but may include more or fewer operational steps based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented in a real system or server product, the methods illustrated in the embodiments or figures may be performed sequentially or in parallel (e.g., in a parallel processor or multithreaded environment). As shown in fig. 2, the method may include:
S101, the client sends a current data transfer request to a target endorsement node.
Optionally, an endorsement node exists in the blockchain network, and the endorsement node may refer to a node selected to take on an endorsement task in the blockchain network. The "endorsement" can be understood as a process and a mechanism for carrying out data transfer verification on the data transfer of the blockchain network by the node bearing the endorsement task and declaring the data transfer legal for the data transfer operation passing the verification.
Illustratively, the data transfer in the embodiments of the present application may be a transaction, and the data transfer request may be a transaction request.
Optionally, the embodiment of the present application may send the current data transfer request to the target endorsement node in various manners, which is not specifically limited herein.
In one embodiment, in the case that the endorsement node in the blockchain network is one, the client may directly send the current data transfer request to the endorsement node through a wired or wireless transmission manner.
In an alternative embodiment, fig. 3 is a flowchart illustrating a client sending a current data transfer request to a target endorsement node according to an exemplary embodiment, where, as shown in fig. 3, the current blockchain network includes a plurality of endorsement nodes, and in step S101, the client sending the current data transfer request to the target endorsement node may include:
S1011, the client sends a current data transfer request to the current blockchain network, wherein the current data transfer request carries an endorsement policy of an intelligent contract and a data transfer hash value corresponding to the current data transfer request.
S1013, the current blockchain network responds to the current data transfer request, and determines a target endorsement node from the endorsement nodes based on an endorsement policy and a data transfer hash value.
S1015, the current blockchain network sends a current data transfer request to the target endorsement node.
Alternatively, in the case where a plurality of endorsement nodes are included in the current blockchain network in step S1011 described above, the client may first send a current data transfer request to the current blockchain network. FIG. 4 is a schematic diagram illustrating related data involved in a data transfer operation, according to an exemplary embodiment, as shown in FIG. 4, the current data transfer request may carry an endorsement policy of a smart contract, a data transfer hash value corresponding to the current data transfer request, a data transfer identification (Identity Document, ID), a smart contract that needs to be invoked, a method that needs to be invoked, a list of data transfer related parameters (e.g., keys, key values), an initiator that initiated the data transfer request, a signature of the initiator that initiated the data transfer request, etc.
Wherein the data transfer hash value refers to a character segment required for marking data transfer in data transfer of the blockchain network, which can be expressed by a series of letters, numbers or other symbols. For example, if a plurality of resources need to be transferred from the a address to the B address, the private key signature can be performed by using the a address, the signature is combined with the data transfer, and then the hash value operation is performed to obtain the data transfer hash value.
Optionally, there is an "endorsement policy" setting in the global configuration of the blockchain network or in the function call configuration of the smart contracts, i.e. the endorsement policy of the smart contract may provide a default configuration of the blockchain global, or the endorsement policy of the smart contract may be set in each smart contract separately. An "endorsement policy" describes how many endorsement nodes are required to execute and sign endorse the execution result after a data transfer request is broadcast to the endorsement nodes.
Illustratively, the endorsement policy of the smart contract may be set by an administrator of the contract (e.g., a contract installer), and includes the following three modes: any three kinds of endorsement strategies, all endorsement strategies, most endorsement strategies and the like, and the endorsement strategies can be changed at any time. The endorsement policy change is also realized through data transfer, the new policy can be validated after the data transfer is correctly packaged, and the data transfer is verified and executed according to the new policy. Any endorsement policy refers to selecting any endorsement node from a plurality of endorsement nodes to execute a corresponding intelligent contract, all endorsement policies refer to executing corresponding intelligent contracts by the plurality of endorsement nodes, and most endorsement policies refer to selecting more than half of endorsement nodes from the plurality of endorsement nodes to execute corresponding intelligent contracts.
Optionally, in the step S1013, the current blockchain network may determine the target endorsement node from the plurality of endorsement nodes based on the endorsement policy and the data transfer hash value when receiving the data transfer request.
Assuming that the endorsement policy is any endorsement policy, the current blockchain network may determine, from a plurality of endorsement nodes, a preset number of endorsement nodes corresponding to the data transfer hash value according to the data transfer hash value, and use any one of the preset number of endorsement nodes corresponding to the data transfer hash value as a target endorsement node.
Assuming that the endorsement policy is an all-endorsement policy, the current blockchain network may determine, from a plurality of endorsement nodes, a preset number of endorsement nodes corresponding to the data transfer hash value according to the data transfer hash value, and take all of the preset number of endorsement nodes corresponding to the data transfer hash value as target endorsement nodes.
Assuming that the endorsement policy is a majority of the endorsement policies, the current blockchain network may determine a preset number of endorsement nodes corresponding to the data transfer hash value from a plurality of endorsement nodes according to the data transfer hash value, and take a majority of the preset number of endorsement nodes corresponding to the data transfer hash value as a target endorsement node.
Optionally, in the step S1015, after determining the target endorsement node, the current blockchain network may send the current data transfer request to the target endorsement node, so as to forward the current data transfer request sent by the client to the target endorsement node.
In the embodiment of the application, the target endorsement node for executing the intelligent contract is determined through the endorsement strategy and the data transfer hash value corresponding to the current data transfer request, so that the determination precision of the target endorsement node can be improved, and the data transfer precision is improved.
S103, the target endorsement node responds to the current data transfer request and executes an intelligent contract corresponding to the current data transfer request to obtain a current contract execution result; the current contract execution result includes a current data transfer read-write set.
Optionally, since the current data transfer request carries the called smart contract, the target endorsement node may execute the smart contract carried by the current data transfer request when receiving the current data transfer request. Wherein, the endorsement node performs intelligent contracts can be understood as: the endorsement node registers its own public key and other business related information into the intelligent contract, and the process of registering information into the intelligent contract by the endorsement node can be understood as the endorsement node executing the intelligent contract. Illustratively, some of the other business related information described above may include, but is not limited to: certificate information, port information, international interconnection protocol (Internet Protocol, IP), etc. Since the number of endorsement nodes may be plural, a plurality of endorsement nodes are registered in the intelligent contract, an endorsement node list may be formed in the intelligent contract, and an endorsement signature in the endorsement node list is valid, and if a certain endorsement node is not registered in the intelligent contract, i.e., does not exist in the endorsement node list, the endorsement signature of the endorsement node is invalid.
In one embodiment, the registration mode of the endorsement node may be an organization registration mode, and an endorsement node list corresponding to an organization may be queried through an endorsement node contract. For example, a blockchain network is jointly created by N enterprises, where N is a positive integer greater than or equal to 1, and the N enterprises are N organizations, which may represent N nodes in the blockchain network, and each organization may register corresponding endorsement nodes, so that the entire blockchain network includes 2N nodes (i.e., N consensus nodes and N endorsement nodes), and each organization corresponds to one consensus node and one endorsement node respectively. Because each organization has corresponding endorsement nodes, the corresponding endorsement node list of a certain organization can be conveniently inquired and obtained through the registration mode according to the organization.
In another embodiment, the registration mode of the endorsement node may be a registration mode according to a contract, and the endorsement node contract may be used to query an endorsement node list corresponding to the contract. For example, there are N intelligent contracts, each intelligent contract can register at least one endorsement node to form an endorsement node list corresponding to each intelligent contract, and the endorsement node list corresponding to a certain intelligent contract can be conveniently queried according to the registering mode of the contract.
Alternatively, continuing with FIG. 4, the current contract execution results may include, but are not limited to: current data transfer read-write set, data transfer event log list, contract return value, etc.
Illustratively, the current data transfer read-write set may characterize data of the target endorsement node for read-write operations, and the current data transfer read-write set may include a read set and a write set. The read set may further include an executed smart contract name, key, data transfer version, etc., and the key in the read set may be a key value pair of a variable read when performing data transfer. The write set may further include a contract name, key value, etc. that is executed, and the key in the write set may be a key value pair of a variable written when performing data transfer. The keys in the read-write set mean exclusive use of corresponding data, for example, in a resource transfer scenario, the read-write set includes an initiator account address and a recipient account address.
Illustratively, the list of data transfer event logs may further include data transfer topics, data transfer logs, and the like.
S105, the target endorsement node transmits the current contract execution result to the consensus node.
Optionally, after the target endorsement node executes the intelligent contract to obtain the current contract execution result, the current contract execution result may be broadcast to the consensus node by a wired or wireless transmission manner.
Specifically, the consensus node is a node present in the blockchain network, which may be determined by a consensus mechanism. The consensus mechanism is to complete verification and confirmation of data transfer operation in a short time through voting of special nodes; for a data transfer operation, if several nodes that are not of interest can agree on it, the entire blockchain network can be considered to agree on it as well.
Alternatively, in the embodiment of the present application, the current contract execution result may be sent to the consensus node in a plurality of manners, which is not specifically limited herein.
In an alternative embodiment, fig. 5 is a flowchart of a second data transfer processing method according to an exemplary embodiment, as shown in fig. 5, where in the step S105, the target endorsement node sends the current contract execution result to a consensus node, and may include:
s1051, the target endorsement node signs the current contract execution result and the current data transfer request to obtain current data transfer information carrying endorsement signature.
S1053, the target endorsement node transmits the current data transfer information to the consensus node.
Alternatively, in the above step S1051, the target endorsement node may attach the current contract execution result to the back of 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.
Optionally, in the step S1053, the number of the target endorsement nodes may be plural, and one target endorsement node may be selected from the plural target endorsement nodes as the master node, and after the master node collects the endorsement signature satisfying the endorsement policy, the master node may assemble a complete current data transfer operation to be packaged as shown in fig. 4, and broadcast the complete current data transfer operation to the consensus node. As shown in fig. 4, in the case where there are a plurality of endorsement signatures, an endorsement signature list may be formed. For example, in the case of a data transfer into a transaction, the complete current data transfer operation may be considered a current complete transaction.
In the embodiment of the application, the security and the reliability of data transfer can be improved by attaching the current contract execution result to the back of the current data transfer request and signing the current contract execution result and the current data transfer request.
S107, the consensus node performs data transfer conflict detection on the current data transfer read-write set to obtain a current detection result; the current detection result comprises a first current data transfer operation set, wherein the first current data transfer operation set is a set formed by non-conflict data transfer operations.
In an alternative embodiment, the method may further include: after the consensus node receives the current data transfer information carrying the endorsement signature, the consensus node can first verify that the endorsement signature meets an endorsement policy corresponding to the intelligent contract.
In one embodiment, in the case where the endorsement signature does not satisfy the endorsement policy, indicating that the endorsement signature is not legitimate, the consensus node does not perform a data transfer collision detection operation.
In another embodiment, the consensus node places the current data transfer operation into the data transfer pool in the event that the endorsement signature satisfies an endorsement policy. In the proposal block stage, the consensus node acquires a batch of complete current data transfer operation from the data transfer pool and verifies whether a read-write set of the batch of current data transfer operation has conflict data transfer operation. Wherein, the conflict refers to: multiple accounts of the client may concurrently submit multiple data transfer requests for modification to the same data set, and the application processing data is sent to the blockchain network for consensus, and then stored in the ledger, so that conflicting data transfer operations exist in one block.
If there are conflicting data transfer operations, only one of the conflicting data transfer operations (i.e., the non-conflicting data transfer operation) is reserved and the other data transfer operations are marked as stale data transfer operations (i.e., conflicting data transfer operations). Specifically, a set of non-conflicting data transfer operations may be considered a first set of current data transfer operations, and a set of conflicting data transfer operations that conflict with data transfer operations in the first set of current data transfer operations may be considered a second set of current data transfer operations.
For example, the first and second current sets of data transfer operations may be in the form of a list of data transfer operations. Taking data transfer as an example of a transaction, the list of data transfer operations may be a list of transactions.
For example, when the current data transfer read-write set performs data transfer conflict detection, data transfer operations modified for the data set 1 are found to be data transfer operation 1, data transfer operation 2 and data transfer operation 3 respectively, data transfer operations modified for the data set 2 are found to be data transfer operation 4 and data transfer operation 5 respectively, and then for the data set 1, the data transfer operations 1, 2 and 3 conflict, one of the data transfer operations 1, 2 and 3 can be reserved, for example, the data transfer operation 1 is reserved, and the data transfer operation 2 and 3 are marked as conflict data transfer operations conflicting with the data transfer operation 1. For data set 2, data transfer operation 4 and data transfer operation 5 conflict, one of data transfer operations 4 and data transfer operation 5 may be reserved, e.g., data transfer operation 4 is reserved, and data transfer operation 5 is marked as a conflicting data transfer operation that conflicts with data transfer operation 4. Finally, the set of data transfer operations 1 and 4 may be referred to as a first current set of data transfer operations, and the set of data transfer operations 2, 3, and 5 may be referred to as a second current set of data transfer operations.
S109, the consensus node creates a current new block, packages the first current data transfer operation set into the current new block, and transmits the packaged current new block to other nodes in a current block chain network; the other nodes include the target endorsement node.
Optionally, in S109, the consensus node may create a new block, package the first current data transfer operation set into the current new block for proposal, and perform consensus processing on the current new block using a consensus flow in the current new block. After consensus is reached, the consensus node communicates the packaged current new block to other nodes in the current blockchain network to broadcast the new block in the current blockchain network.
In an alternative embodiment, the consensus node may broadcast the current new chunk directly in the blockchain network in the event that there is no read-write collision with the current data transfer read-write set.
In still another alternative embodiment, in the case where there is a read-write collision in the current data transfer read-write set, in S109, the transferring the packaged current new block to another node in the current blockchain network may include:
S1091, under the condition that the current detection result comprises a second current data transfer operation set, the common node attaches the second data transfer operation set to the packaged current new block to obtain a current new block carrying the second data transfer operation set; the second set of current data transfer operations is a set of conflicting data transfer operations, the conflicting data transfer operations being data transfer operations that conflict with data transfer operations in the first set of current data transfer operations.
S1093, the consensus node transmits the current new block carrying the second data transfer operation set to other nodes.
Optionally, in the above steps S1091-S1093, in the case where there is a read-write conflict in the current data transfer read-write set, that is, in the case where the above current detection result includes the second current data transfer operation set, the consensus node may append the conflicting second data transfer operation set on the current new block, 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.
In the embodiment of the application, the first current data transfer operation set formed by the packed non-conflict data transfer operation is packed into the current new block, and the conflict data transfer operation is not packed into the current new block, so that the conflict data transfer operation does not exist in the data structure of the current new block, the hash calculation of the current new block is not influenced, and the problem of marking the failure data transfer operation is not caused because the failure data transfer operation does not exist in the current new block, the occupation of a failure data transfer operation disk is avoided, and the utilization rate of the disk and the performance of a block chain are improved.
In an alternative embodiment, the method may further include:
and the consensus node updates the local data transfer record of the consensus node based on the packaged current new block.
Optionally, while broadcasting the packaged current new block to the blockchain network, the consensus node may further incorporate the packaged current new block into its own local data transfer record, so as to update its own local data transfer record, thereby implementing updating of the local data transfer record of the consensus node. In the case of data transfer into transactions, the data transfer record may be a ledger. Because the packed current new block comprises non-conflict data transfer operation but does not comprise conflict data transfer operation, the updated local data transfer record also does not comprise conflict data transfer operation, occupation of a failure data transfer operation disk is avoided, and the utilization rate of the disk and the performance of a block chain are improved.
S1011, the other nodes update local data transfer records of the other nodes based on the packaged current new block.
Optionally, after receiving the packaged current new block, the other nodes may perform a series of verification, for example, verify 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 allowable range, whether the data transfer transaction in the block is valid, and so on, and when all the verification passes, the other nodes may incorporate the new packaged current new block data into their own local data transfer record, so as to update the local data transfer record.
The other node may be, for example, a target endorsement node, where after receiving the packaged current new block, the target endorsement node performs the series of verification as described above, and when the verification passes, the target endorsement node includes the packaged current new block data into its own local data transfer record, so as to implement updating of the local data transfer record.
Continuing with FIG. 5, in an alternative embodiment, the other nodes are target endorsement nodes, and after the consensus node passes the current new block carrying the second set of data transfer operations to the other nodes, the method further comprises:
s201, the target endorsement node extracts a second data transfer operation set from a current new block carrying the second data transfer operation set.
S203, the target endorsement node re-uses the data transfer request corresponding to the second data transfer operation set as the current data transfer request.
S205, the target endorsement node repeats the above-mentioned response to the current data transfer request, executes the intelligent contract corresponding to the current data transfer request, obtains the current contract execution result, and sends the current contract execution result to the operation of the consensus node.
S207, repeating the data transfer conflict detection on the current data transfer read-write set by the consensus node to obtain a current detection result, and transmitting the current new block carrying the second data transfer operation set to the other nodes; and repeating the operation of updating the local data transfer record based on the packaged current new block by the other nodes, and stopping when the current detection result does not comprise the second current data transfer operation set.
Optionally, in the step S201, there is a conflict data transfer operation in the current data transfer read-write set, that is, in the case that the current detection result includes the second current data transfer operation set, the endorsement node may extract the second data transfer operation set of the data transfer conflict from the current new block, in addition to updating the local data transfer record based on the packaged current new block.
Optionally, in the step S203, since the second data transfer operation set is obtained by performing data transfer conflict detection on the current data transfer read-write set by the consensus node, and the current data transfer read-write set is obtained by executing the intelligent contract by the endorsement node in response to a certain data transfer request, it is seen that the second data transfer operation set corresponds to the certain data transfer request, and therefore the data transfer request corresponding to the second data transfer operation set may be extracted and re-used as the current data transfer request.
Optionally, in the step S205, for the target endorsement node, the target endorsement node re-executes the intelligent contract corresponding to the current data transfer request in response to the current data transfer request, to obtain the operation of the current contract execution result including the current data transfer read-write set; and re-executing the operation of transmitting the current contract execution result to the consensus node. For the consensus node, the consensus node re-executes the operation of carrying out data transfer conflict detection on the current data transfer read-write set to obtain a current detection result comprising a first current data transfer operation set; and re-executing 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. For other nodes, the other nodes re-execute the operation of updating the local data transfer record of the other nodes based on the packaged current new block. And (3) repeating the cycle until the current detection result does not comprise the second current data transfer operation set, namely stopping when the current data transfer read-write set does not have conflict data transfer operation.
For example, when the data transfer conflict detection is performed on the current data transfer read-write set, it is found that the data transfer operations modified on the data set 1 are respectively the data transfer operation 1, the data transfer operation 2 and the data transfer operation 3, and the data transfer operation 1, the data transfer operation 2 and the data transfer operation 3 conflict, one of the data transfer operations 1, the data transfer operation 2 and the data transfer operation 3 can be reserved, for example, the data transfer operation 1 is reserved, the data transfer operation 2 and the data transfer operation 3 are marked as conflict data transfer operations conflicting with the data transfer operation 1, the data transfer operation 1 is used as a first non-conflict current data transfer operation set, and the data transfer operation 2 and the data transfer operation 3 are used as a second conflict current data transfer operation set.
The common node re-creates a current new block (for example, the current new block is a first new block), packages the data transfer operation 1 into the current new block, transmits the current new block carrying the data transfer operation 2 and the data transfer operation 3 to a target endorsement node, updates an account book based on the data transfer operation 1 after verifying the first new block, re-executes an intelligent contract of the data transfer operation 2 and the data transfer operation 3 to obtain a current contract execution result including a current data transfer read-write set, and re-sends the current contract execution result to the common node, and the common node re-performs data transfer conflict detection on the current data transfer read-write set, finds that the data transfer operation 2 and the data transfer operation 3 conflict, and can put the data transfer operation 2 into a non-conflicting first current data transfer operation set and put the data transfer operation 3 into a conflicting second current data transfer operation set.
The consensus node re-creates a current new block (for example, the current new block is a second new block), packages the data transfer operation 2 into the current new block, transmits the current new block carrying the data transfer operation 3 to the target endorsement node, and after verifying the second new block, the target endorsement node updates the account book based on the data transfer operation 2, and then re-executes the intelligent contract of the data transfer operation 3 to obtain a current contract execution result comprising a current data transfer read-write set, and re-transmits the current contract execution result to the consensus node.
And the consensus node re-detects the data transfer conflict of the current data transfer read-write set, and if the fact that no conflict data transfer operation exists at the moment is found, the current new block is re-created (for example, the current new block is a third new block), the data transfer operation 3 is packed into the current new block, no conflict transaction is added, and the third new block is broadcasted to the network, including the current endorsement node. And after the target endorsement node verifies the third new block, updating the account book based on the data transfer operation 3, and stopping the repeated process without other conflict transactions.
In the embodiment of the application, the execution of the intelligent contract is carried out asynchronously by the endorsement node, the execution of the contract does not affect the block chain production block, the complex time-consuming intelligent contract can be supported, and the performance of the block chain can be improved to a very high level; the read-write conflict detection is carried out during the consensus sequencing, and the conflicting data transfer set is broadcasted to the endorsement node, so that the problem that the client continuously reinitiates the same data transfer request due to the failure of the data transfer mark is avoided, the client only needs to submit the data transfer request once, the information transmission frequency between the client and the node is reduced, and the consumption of system resources of the client and the consumption of network transmission resources are reduced; in addition, because the conflict data transfer operation does not exist in the data structure of the block, namely, no invalidation transaction exists in the block, occupation of a disk of the invalidation data transfer operation is avoided, the utilization rate of the disk is higher, and the performance of the block chain network is further improved.
Continuing with fig. 5, in an alternative embodiment, the other node is the target endorsement node, and the method further includes:
s301, the target endorsement node transmits the packaged current new block to the client.
S303, the client updates the local data transfer record of the client based on the packaged current new block.
Optionally, after receiving the packaged current new block sent by the consensus node, the target endorsement node can also transmit the packaged current new block to the client, and the client receives the packaged current new block and updates its local data transfer record, so that on one hand, the local data transfer record of the client is accurately updated, and on the other hand, the endorsement node does not transmit conflicting data transfer operation to the client, so that the client does not need to reinitiate the same data transfer request, only needs to submit the data transfer request once, and the information transmission frequency between the client and the node is reduced, thereby reducing the consumption of system resources of the client and the consumption of network transmission resources.
It should be noted that the data transfer processing method can be applied to not only the scenario of the alliance chain but also the scenario of the public chain. Where a federation chain refers to members of a particular community and limited third parties, which internally designate a plurality of preselected nodes as billing agents, the generation of each block is determined by all of the preselected nodes in common. A public chain refers to a blockchain that anyone can read, send transactions, and that the transactions can be validated effectively, and that can also participate in the consensus process therein.
The endorsement nodes in the public chain cannot ensure that the endorsement nodes are always online, and the endorsement nodes are in a competitive relationship with the endorsement nodes in the alliance chain. In one embodiment, the high online rate of endorsement nodes and the lack of endorsement can be ensured by adding a guarantee in the endorsement node registration contract, and once the endorsement node is found to be wrongly, the endorsement node will be penalized, thereby improving the security of the blockchain network.
In another embodiment, in public chains, the endorsement policy may select a policy for most nodes to endorse, due to the existence of potentially disliked nodes. The endorsement nodes compete with each other to generate blocks, and a POW or POS mode can be adopted to select effective endorsement node signatures when endorsing. Therefore, while the endorsement node signature is added to the data transfer operation, a piece of endorsement node consensus result information can be added. For example, in the step S1051, the obtained current data transfer information carrying the endorsement signature may be added with a result information that is commonly known by the endorsement node, and when the endorsement signature is verified, the commonly known node may also verify the result information that is commonly known by the endorsement node, and if the endorsement node is verified, it indicates that the endorsement node is not a disqualified node, then the commonly known node may perform a subsequent collision detection operation, and if the endorsement node is not verified, it indicates that the endorsement node is a disqualified node, and then the commonly known node does not perform a subsequent collision detection operation.
In an alternative embodiment, embodiments of the present application further provide a data transfer processing system, which may include: the client, the target endorsement node, the consensus node and other nodes;
and the client is used for sending the current data transfer request to the target endorsement node.
The target endorsement node is used for responding to the current data transfer request and executing an intelligent contract corresponding to the current data transfer request to obtain a current contract execution result; the current contract execution result comprises a current data transfer read-write set; and the current contract execution result is sent to the consensus node.
The consensus node is used for carrying out data transfer conflict detection on the current data transfer read-write set to obtain a current detection result; the current detection result comprises a first current data transfer operation set, wherein the first current data transfer operation set is a set formed by non-conflict data transfer operations; the method comprises the steps of creating a 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 a current blockchain network; the other nodes include the target endorsement node.
And the other nodes are used for updating local data transfer records of the other nodes based on the packaged current new block.
Referring To fig. 6, fig. 6 is an alternative architecture diagram illustrating an example embodiment, where a plurality of nodes form a constituent Peer-To-Peer (P2P) network, and the P2P protocol is an application layer protocol that runs on top of a transmission control protocol (TCP, transmission Control Protocol) protocol. In a blockchain system, any machine, such as a server, a terminal, may join to become a node, including a hardware layer, a middle layer, an operating system layer, and an application layer.
Referring to the functionality of each node in the blockchain system shown in fig. 6, the functions involved include:
1) The routing, the node has basic functions for supporting communication between nodes.
Besides the routing function, the node can also have the following functions:
2) The application is used for being deployed in a block chain to realize specific service according to actual service requirements, recording data related to the realization function to form recorded data, carrying a digital signature in the recorded data to represent the source of task data, sending the recorded data to other nodes in the block chain system, and adding the recorded data into a temporary block when the source and the integrity of the recorded data are verified by the other nodes.
3) The blockchain comprises a series of blocks (blocks) which are connected with each other according to the generated sequence time, the new blocks are not removed once being added into the blockchain, and record data submitted by nodes in the blockchain system are recorded in the blocks.
Referring to fig. 7, fig. 7 is an alternative schematic diagram of a Block Structure (Block Structure) according to an exemplary embodiment, in which each Block includes a data transfer hash value of a storage transaction record of the Block (data transfer hash value of the Block) and a data transfer hash value of a previous Block, and the blocks are connected by the data transfer hash values to form a blockchain. In addition, the block may include information such as a time stamp at the time of block generation. The Blockchain (Blockchain), which is essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains associated information that is used to verify the validity (anti-counterfeiting) of its information and to generate the next block.
Fig. 8 is a flowchart three illustrating a data transfer processing method according to an exemplary embodiment. The method for data transfer processing is introduced by taking the consensus node as an execution main body, and as shown in fig. 8, the method may include:
S401, receiving a current contract execution result sent by a target endorsement node; and the current contract execution result is obtained by the target endorsement node executing the intelligent contract corresponding to the current data transfer request in response to the current data transfer request sent by the client, and the current contract execution result comprises a current data transfer read-write set.
S403, performing data transfer conflict detection on the current data transfer read-write set to obtain a current detection result; the current detection result comprises a first current data transfer operation set, wherein the first current data transfer operation set is a set formed by non-conflict data transfer operations.
S405, creating a current new block, and packaging the first current data transfer operation set into the current new block.
S407, transmitting the packaged current new block to other nodes in the current blockchain network, so that the other nodes update local data transfer records of the other nodes based on the packaged current new block; the other nodes include the target endorsement node.
In an optional embodiment, the transferring the packaged current new block to another node in the current blockchain network, so that the another node updates a local data transfer record of the another node based on the packaged current new block, includes:
Under the condition that the current detection result comprises a second current data transfer operation set, the second data transfer operation set is added to the packed current new block, and a current new block carrying the second data transfer operation set is obtained; the second set of current data transfer operations is a set of conflicting data transfer operations, the conflicting data transfer operations being data transfer operations that conflict with data transfer operations in the first set of current data transfer operations.
And transmitting the current new block carrying the second data transfer operation set to the other nodes so that the other nodes update local data transfer records of the other nodes based on the current new block carrying the second data transfer operation set.
In an optional embodiment, after the transferring the current new block carrying the second data transfer operation set to the other node, the other node updates the local data transfer record of the other node based on the current new block carrying the second data transfer operation set, the method further includes:
Repeating the operation of receiving the current contract execution result sent by the target endorsement node, and transferring the current new block carrying the second data transfer operation set to the other nodes so that the other nodes update the local data transfer records of the other nodes based on the current new block carrying the second data transfer operation set, and stopping when the current detection result does not include the second current data transfer operation set;
and the current contract execution result in the repetition process is that the target endorsement node re-uses the data transfer request corresponding to the second data transfer operation set as the current data transfer request, and repeats the current data transfer request sent by the response client to execute the intelligent contract corresponding to the current data transfer request, wherein the second data transfer operation set is extracted from the current new block carrying the second data transfer operation set by the target endorsement node.
In an optional embodiment, the receiving the current contract execution result sent by the target endorsement node includes:
receiving current data transfer information carrying endorsement signature sent by the target endorsement node; the current data transfer information is obtained by signing the current contract execution result and the current data transfer request by the target endorsement node.
The method further comprises the following steps:
and executing the operation of performing data transfer conflict detection on the current data transfer read-write set to obtain a current detection result under the condition that the endorsement signature is verified to meet the endorsement policy corresponding to the intelligent contract.
Fig. 9 is a flowchart fourth illustrating a data transfer processing method according to an exemplary embodiment. The method for transferring data is introduced by taking the target endorsement node as an execution main body, and as shown in fig. 9, the method may include:
s501, responding to a current data transfer request sent by a client, and executing an intelligent contract corresponding to the current data transfer request to obtain a current contract execution result; the current contract execution result includes a current data transfer read-write set.
S503, sending the current contract execution result to a consensus node so that the consensus node can detect data transfer conflict of the current data transfer read-write set to obtain a current detection result comprising a first current data transfer operation set; the first current data transfer operation set is a set formed by non-conflict data transfer operations; the common node creates a current new block, packages the first current data transfer operation set into the current new block, and transmits the packaged current new block to other nodes in the current blockchain network; the other nodes comprise the target endorsement node; and updating the local data transfer records of the other nodes based on the packaged current new block by the other nodes.
In an optional embodiment, the other node is a local target node, and the method further includes:
and receiving the current new block carrying the second data transfer operation set transmitted by the consensus node.
The current new block carrying the second data transfer operation set is obtained by the common node attaching the second data transfer operation set to the packaged current new block if the current detection result includes the second current data transfer operation set, where the second current data transfer operation set is a set formed by conflict data transfer operations, and the conflict data transfer operations are data transfer operations that conflict with data transfer operations in the first current data transfer operation set.
In an alternative embodiment, the method further comprises:
and extracting the second data transfer operation set from the current new block carrying the second data transfer operation set.
And re-using the data transfer request corresponding to the second data transfer operation set as the current data transfer request.
Repeating the current data transfer request sent by the response client, executing the intelligent contract corresponding to the current data transfer request to obtain a current contract execution result, and sending the current contract execution result to the consensus node; repeating the operation of performing data transfer conflict detection on the current data transfer read-write set by the consensus node to obtain a current detection result comprising a first current data transfer operation set; repeatedly creating a current new block by the consensus node, 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 repeating the operation of updating the local data transfer record of the other nodes based on the packaged current new block by the other nodes, and stopping when the current detection result does not comprise the second current data transfer operation set.
In an alternative embodiment, the sending the current contract execution result to the consensus node includes:
signing the current contract execution result and the current data transfer request to obtain current data transfer information carrying endorsement signature.
And transmitting the current data transfer information to the consensus node.
In an optional embodiment, the other node is a local target node, and the method further includes:
and transmitting the packed current new block to the client so that the client updates the local data transfer record of the client based on the packed current new block.
In an alternative embodiment, the current blockchain network includes a plurality of local nodes, and the responding 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 the plurality of local nodes based on an endorsement policy carried in the current data transfer request and a data transfer hash value corresponding to the current data transfer request by the current blockchain network in response to the current data transfer request sent by the client.
Fig. 10 is a block diagram of a data transfer processing apparatus according to an exemplary embodiment. As shown in fig. 10, the apparatus may include at least:
the current contract execution result receiving module 601 is configured to receive a current contract execution result sent by a target endorsement node; and the current contract execution result is obtained by the target endorsement node executing the intelligent contract corresponding to the current data transfer request in response to the current data transfer request sent by the client, and the current contract execution result comprises a current data transfer read-write set.
The conflict detection module 603 is configured to perform data transfer conflict detection on the current data transfer read-write set, so as to obtain a current detection result; the current detection result comprises a first current data transfer operation set, wherein the first current data transfer operation set is a set formed by non-conflict data transfer operations.
The packing module 605 is configured to create a current new block, and pack the first set of current data transfer operations into the current new block.
A transfer module 607, configured to transfer the packaged current new block to other nodes in the current blockchain network, so that the other nodes update local data transfer records of the other nodes based on the packaged current new block; the other nodes include the target endorsement node.
Optionally, the transferring module 607 includes:
an appending unit, configured to append the second data transfer operation set to the packaged current new block to obtain a current new block carrying the second data transfer operation set, where 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 formed by conflict data transfer operations, and the conflict data transfer operations are data transfer operations which conflict with the data transfer operations in the first current data transfer operation set;
and the first block transfer unit is used for transferring the current new block carrying the second data transfer operation set to the other nodes so that the other nodes update the local data transfer records of the other nodes based on the current new block carrying the second data transfer operation set.
Optionally, the other node is the target endorsement node, and the apparatus further includes:
the first repeating module is configured to repeat the current contract execution result sent by the receiving target endorsement node to the transfer the current new block carrying the second data transfer operation set to the other nodes, so that the other nodes update the local data transfer record of the other nodes based on the current new block carrying the second data transfer operation set, and stop when the current detection result does not include the second current data transfer operation set;
And the current contract execution result in the repetition process is that the target endorsement node re-uses the data transfer request corresponding to the second data transfer operation set as the current data transfer request, and repeats the current data transfer request sent by the response client to execute the intelligent contract corresponding to the current data transfer request, wherein the second data transfer operation set is extracted from the current new block carrying the second data transfer operation set by the target endorsement node.
Optionally, the current contract execution result receiving module is configured to receive current data transfer information carrying an endorsement signature sent by the target endorsement node; the current data transfer information is obtained by signing the current contract execution result and the current data transfer request by the target endorsement node;
the device further comprises:
and the execution module is used for executing the operation of carrying out data transfer conflict detection on the current data transfer read-write set to obtain a current detection result under the condition that the endorsement signature is verified to meet the endorsement policy corresponding to the intelligent contract.
FIG. 11 illustrates a block diagram of a data transfer processing apparatus according to an exemplary embodiment. As shown in fig. 11, the apparatus may include at least:
A current data transfer request response module 701, configured to execute an intelligent contract corresponding to the current data transfer request in response to a current data transfer request sent by a client, so as to obtain a current contract execution result; the current contract execution result includes a current data transfer read-write set.
A consensus node sending module 703, 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 to obtain a current detection result including a first current data transfer operation set; the first current data transfer operation set is a set formed by non-conflict data transfer operations; the common node creates a current new block, packages the first current data transfer operation set into the current new block, and transmits the packaged current new block to other nodes in the current blockchain network; the other nodes comprise the target endorsement node; and updating the local data transfer records of the other nodes based on the packaged current new block by the other nodes.
Optionally, the other node is a local target node, and the apparatus further includes:
The current new block receiving module is used for receiving the current new block carrying the second data transfer operation set and transmitted by the consensus node;
the current new block carrying the second data transfer operation set is obtained by the common node attaching the second data transfer operation set to the packaged current new block if the current detection result includes the second current data transfer operation set, where the second current data transfer operation set is a set formed by conflict data transfer operations, and the conflict data transfer operations are data transfer operations that conflict with data transfer operations in the first current data transfer operation set.
Optionally, the apparatus further includes:
and the extraction module is used for extracting the second data transfer operation set from the current new block carrying the second data transfer operation set.
And the redetermining module is used for redefining the data transfer request corresponding to the second data transfer operation set as the current data transfer request.
The second repeating module is used for repeating the current data transfer request sent by the response client, executing the intelligent contract corresponding to the current data transfer request, obtaining a current contract execution result, and sending the current contract execution result to the operation of the consensus node; repeating the operation of performing data transfer conflict detection on the current data transfer read-write set by the consensus node to obtain a current detection result comprising a first current data transfer operation set; repeatedly creating a current new block by the consensus node, 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 repeating the operation of updating the local data transfer record of the other nodes based on the packaged current new block by the other nodes, and stopping when the current detection result does not comprise the second current data transfer operation set.
Optionally, the consensus node sending module includes:
and the signature module is used for signing the current contract execution result and the current data transfer request to obtain current data transfer information carrying endorsement signature.
And the node sending unit is used for sending the current data transfer information to the consensus node.
Optionally, the other node is a local target node, and the apparatus further includes:
and the second block transfer unit is used for transferring the packaged current new block to the client so that the client updates the local data transfer record of the client based on the packaged current new block.
Optionally, the current blockchain network includes a plurality of local nodes, and the current data transfer request response module is configured to respond to a current data transfer request sent by the current blockchain network based on a local target node;
the local target node is determined from the plurality of local nodes based on an endorsement policy carried in the current data transfer request and a data transfer hash value corresponding to the current data transfer request by the current blockchain network in response to the current data transfer request sent by the client.
It should be noted that, the device embodiment provided by the embodiment of the present application and the method embodiment described above are based on the same inventive concept.
The embodiment of the application also provides an electronic device for data transfer processing, which comprises a processor and a memory, wherein at least one instruction or at least one section of program is stored in the memory, and the at least one instruction or the at least one section of program is loaded and executed by the processor to realize the data transfer processing method provided by any embodiment.
Embodiments of the present application also provide a computer readable storage medium that can be provided in a terminal to store at least one instruction or at least one program for implementing a data transfer processing method in a method embodiment, where the at least one instruction or the at least one program is loaded and executed by a processor to implement the data transfer processing method as provided in the method embodiment described above.
Alternatively, in the present description embodiment, the storage medium may be located in at least one network server among a plurality of network servers of the computer network. Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The memory of the embodiment of the present specification may be used for storing software programs and modules, and the processor executes various functional application programs and data transfer processes by executing the software programs and modules stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for functions, and the like; the storage data area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide access to the memory by the processor.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data transfer processing method provided by the above-described method embodiment.
The data transfer processing method provided by the embodiment of the application can be executed in a terminal, a computer terminal, a server or similar computing devices. Taking the example of running on a server, fig. 12 is a block diagram of the hardware architecture of a server for a data transfer process according to an exemplary embodiment. As shown in fig. 12, the server 800 may vary considerably in configuration or performance, and may include one or more central processing units (Central Processing Units, CPU) 810 (the central processing unit 810 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA), a memory 830 for storing data, one or more storage mediums 820 (e.g., one or more mass storage devices) for storing applications 823 or data 822. Wherein memory 830 and storage medium 820 can be transitory or persistent. The program stored on the storage medium 820 may include one or more modules, each of which may include a series of instruction operations on a server. Still further, the central processor 810 may be arranged to communicate with the storage medium 820 and to execute a series of instruction operations in the storage medium 820 on the server 800. The 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 XTM, unixTM, linuxTM, freeBSDTM, etc.
The input-output interface 840 may be used to receive or transmit data via a network. The specific example of the network described above may include a wireless network provided by a communication provider of the server 800. In one example, the input-output interface 840 includes a network adapter (Network Interface Controller, NIC) that may connect to other network devices through a base station to communicate with the internet. In one example, the input-output interface 840 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 12 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, server 800 may also include more or fewer components than shown in fig. 12, or have a different configuration than shown in fig. 12.
It should be noted that: the sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device and server embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and references to the parts of the description of the method embodiments are only required.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program to instruct related hardware, and the program may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing is only illustrative of the present application and is not to be construed as limiting thereof, but rather as various modifications, equivalent arrangements, improvements, etc., within the spirit and principles of the present application.

Claims (15)

1. A data transfer processing method, the method comprising:
receiving a current contract execution result sent by a target endorsement node; the current contract execution result is obtained by the target endorsement node executing an intelligent contract corresponding to the current data transfer request in response to the current data transfer request sent by the client, and the current contract execution result comprises a current data transfer read-write set;
Performing data transfer conflict detection on the current data transfer read-write set to obtain a current detection result; the current detection result comprises a first current data transfer operation set, wherein the first current data transfer operation set is a set formed by non-conflict data transfer operations;
creating a current new block, and packaging the first current data transfer operation set into the current new block;
transmitting the packaged current new block to other nodes in the current blockchain network, so that the other nodes update local data transfer records of the other nodes based on the packaged current new block; the other nodes include the target endorsement node.
2. The method of claim 1, wherein the delivering the packaged current new block to other nodes in the current blockchain network to cause the other nodes to update local data transfer records of the other nodes based on the packaged current new block comprises:
when the current detection result is determined to comprise a second current data transfer operation set, the second data transfer operation set is added to the packed current new block, and a current new block carrying the second data transfer operation set is obtained; the second current data transfer operation set is a set formed by conflict data transfer operations, and the conflict data transfer operations are data transfer operations conflicting with the data transfer operations in the first current data transfer operation set;
And transmitting the current new block carrying the second data transfer operation set to the other nodes so that the other nodes update local data transfer records of the other nodes based on the current new block carrying the second data transfer operation set.
3. The method of claim 2, wherein the other node is the target endorsement node, and wherein after the transferring the current new chunk carrying the second set of data transfer operations to the other node to cause the other node to update the other node's local data transfer record based on the current new chunk carrying the second set of data transfer operations, the method further comprises:
repeating the operation of receiving the current contract execution result sent by the target endorsement node, and transmitting the current new block carrying the second data transfer operation set to the other nodes so that the other nodes update the local data transfer records of the other nodes based on the current new block carrying the second data transfer operation set, and stopping when the current detection result does not comprise the second current data transfer operation set;
and the current contract execution result in the repetition process is that the target endorsement node re-uses the data transfer request corresponding to the second data transfer operation set as the current data transfer request, and repeats the current data transfer request sent by the response client to execute the intelligent contract corresponding to the current data transfer request, wherein the second data transfer operation set is extracted from the current new block carrying the second data transfer operation set by the target endorsement node.
4. A method according to any one of claims 1 to 3, wherein receiving the current contract execution result sent by the target endorsement node includes:
receiving current data transfer information carrying endorsement signatures sent by the target endorsement node; the current data transfer information is obtained by signing the current contract execution result and the current data transfer request by the target endorsement node;
the method further comprises the steps of:
and under the condition that the endorsement signature is verified to meet the endorsement policy corresponding to the intelligent contract, executing the operation of carrying out data transfer conflict detection on the current data transfer read-write set to obtain a current detection result.
5. A data transfer processing method, the method comprising:
responding to a current data transfer request sent by a client, executing an intelligent contract corresponding to the current data transfer request, and obtaining a current contract execution result; the current contract execution result comprises a current data transfer read-write set;
transmitting the current contract execution result to a consensus node so that the consensus node carries out data transfer conflict detection on the current data transfer read-write set to obtain a current detection result comprising a first current data transfer operation set; the first current data transfer operation set is a set formed by non-conflict data transfer operations; the common node creates a current new block, packages the first current data transfer operation set into the current new block, and transmits the packaged current new block to other nodes in a current blockchain network; the other nodes comprise the target endorsement node; and updating the local data transfer records of the other nodes based on the packaged current new block by the other nodes.
6. The method of claim 5, wherein the other node is a local target node, the method further comprising:
receiving a current new block carrying a second data transfer operation set transmitted by the consensus node;
the current new block carrying the second data transfer operation set is obtained by the common node attaching the second data transfer operation set to the packaged current new block under the condition that the current detection result includes the second current data transfer operation set, wherein the second current data transfer operation set is a set formed by conflict data transfer operations, and the conflict data transfer operations are data transfer operations which conflict with the data transfer operations in the first current data transfer operation set.
7. The method of claim 6, wherein the method further comprises:
extracting a second data transfer operation set from the current new block carrying the second data transfer operation set;
re-using the data transfer request corresponding to the second data transfer operation set as the current data transfer request;
repeating the current data transfer request sent by the response client, executing the intelligent contract corresponding to the current data transfer request to obtain a current contract execution result, and sending the current contract execution result to a consensus node; repeating the operation of performing data transfer conflict detection on the current data transfer read-write set by the consensus node to obtain a current detection result comprising a first current data transfer operation set; and repeating the operations of creating a current new block by the consensus node, packaging the first current data transfer operation set into the current new block, and transmitting the packaged current new block to other nodes in a current blockchain network; and repeating the operation of updating the local data transfer record of the other nodes based on the packaged current new block by the other nodes, and stopping when the current detection result does not comprise the second current data transfer operation set.
8. The method according to any one of claims 5 to 7, wherein the sending the current contract execution result to a consensus node comprises:
signing the current contract execution result and the current data transfer request to obtain current data transfer information carrying endorsement signature;
and sending the current data transfer information to the consensus node.
9. The method according to any of claims 5 to 7, wherein the other node is a local target node, the method further comprising:
and transmitting the packaged current new block to the client so that the client updates the local data transfer record of the client based on the packaged current new block.
10. The method of any of claims 5 to 7, wherein the current blockchain network includes a plurality of local nodes therein, and wherein the responding to the current data transfer request sent by the client includes:
the local target node responds to a current data transfer request sent by the current blockchain network;
the local target node responds to the current data transfer request sent by the client, and is determined from the plurality of local nodes based on an endorsement policy carried in the current data transfer request and a data transfer hash value corresponding to the current data transfer request.
11. A data transfer processing apparatus, the apparatus comprising:
the current contract execution result receiving module is used for receiving the current contract execution result sent by the target endorsement node; the current contract execution result is obtained by the target endorsement node executing an intelligent contract corresponding to the current data transfer request in response to the current data transfer request sent by the client, and the current contract execution result comprises a current data transfer read-write set;
the conflict detection module is used for carrying out data transfer conflict detection on the current data transfer read-write set to obtain a current detection result; the current detection result comprises a first current data transfer operation set, wherein the first current data transfer operation set is a set formed by non-conflict data transfer operations;
the packaging module is used for creating a current new block and packaging the first current data transfer operation set into the current new block;
the transmission module is used for transmitting the packaged current new block to other nodes in the current blockchain network so that the other nodes update local data transfer records of the other nodes based on the packaged current new block; the other nodes include the target endorsement node.
12. A data transfer processing apparatus, the apparatus comprising:
the current data transfer request response module is used for responding to a current data transfer request sent by a client, executing an intelligent contract corresponding to the current data transfer request and obtaining a current contract execution result; the current contract execution result comprises a current data transfer read-write set;
the consensus node sending module is used for sending the current contract execution result to a consensus node so that the consensus node can detect the data transfer conflict of the current data transfer read-write set to obtain a current detection result comprising a first current data transfer operation set; the first current data transfer operation set is a set formed by non-conflict data transfer operations; the common node creates a current new block, packages the first current data transfer operation set into the current new block, and transmits the packaged current new block to other nodes in a current blockchain network; the other nodes comprise the target endorsement node; and updating the local data transfer records of the other nodes based on the packaged current new block by the other nodes.
13. An electronic device for a data transfer processing method, characterized in that the electronic device comprises a processor and a memory, in which at least one instruction or at least one program is stored, which is loaded and executed by the processor to implement the data transfer processing method according to any one of claims 1 to 10.
14. A computer-readable storage medium, characterized in that at least one instruction or at least one program is stored in the computer-readable storage medium, the at least one instruction or the at least one program being loaded and executed by a processor to implement the data transfer processing method according to any one of claims 1 to 10.
15. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the data transfer processing method of any of claims 1 to 10.
CN202210203238.9A 2022-03-03 2022-03-03 Data transfer processing method, device, equipment and storage medium Pending CN116737054A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210203238.9A CN116737054A (en) 2022-03-03 2022-03-03 Data transfer processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210203238.9A CN116737054A (en) 2022-03-03 2022-03-03 Data transfer processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116737054A true CN116737054A (en) 2023-09-12

Family

ID=87904883

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210203238.9A Pending CN116737054A (en) 2022-03-03 2022-03-03 Data transfer processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116737054A (en)

Similar Documents

Publication Publication Date Title
US11461773B2 (en) Blockchain-based node management methods and apparatuses
JP7408619B2 (en) Computer-implemented system and method for managing large-scale distributed memory pools in blockchain networks
US11088854B2 (en) Securing blockchain access through a gateway on behalf of a communication device
CN109426949B (en) Cross-chain transaction method and device
EP3545665B1 (en) System and method for detecting replay attack
CN111629039B (en) Block chain consensus method, client, endorsement node and sequencing node
CN113395363B (en) Data processing method, device and equipment based on block chain and storage medium
EP3249599A1 (en) Blockchain-based system, and electronic apparatus and method in the system
CN108769230B (en) Transaction data storage method, device, server and storage medium
CN111144881A (en) Selective access to asset transfer data
CN110602050A (en) Authentication method and device for block chain access, storage medium and electronic device
CN110912707A (en) Block chain-based digital certificate processing method, device, equipment and storage medium
CN110597911A (en) Certificate processing method and device for block chain network, electronic equipment and storage medium
CN115769241A (en) Privacy preserving architecture for licensed blockchains
CN110597922B (en) Data processing method, device, terminal and storage medium
WO2023116790A1 (en) Method and apparatus for executing computing task, and storage medium and electronic apparatus
CN114490685A (en) DNS data query updating method and system based on block chain and verifiable calculation
CN110990790B (en) Data processing method and equipment
CN113821816B (en) Block chain consensus method, system and device based on position
Wu et al. Reinforced practical Byzantine fault tolerance consensus protocol for cyber physical systems
CN116737054A (en) Data transfer processing method, device, equipment and storage medium
da Costa et al. Securing light clients in blockchain with DLCP
CN105678155A (en) Verification method and device for information storage
Guo Cypherium: a scalable and permissionless smart contract platform
WO2020058655A1 (en) Group collaborative decision-making by decentralized network nodes

Legal Events

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