CN117354255A - Transaction processing method, apparatus, product, device and medium of block chain network - Google Patents

Transaction processing method, apparatus, product, device and medium of block chain network Download PDF

Info

Publication number
CN117354255A
CN117354255A CN202311327260.5A CN202311327260A CN117354255A CN 117354255 A CN117354255 A CN 117354255A CN 202311327260 A CN202311327260 A CN 202311327260A CN 117354255 A CN117354255 A CN 117354255A
Authority
CN
China
Prior art keywords
transaction data
transaction
merged
blockchain network
processed
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
CN202311327260.5A
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 CN202311327260.5A priority Critical patent/CN117354255A/en
Publication of CN117354255A publication Critical patent/CN117354255A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/41Flow control; Congestion control by acting on aggregated flows or links
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a transaction processing method, device, product, equipment and medium of a blockchain network, wherein the method comprises the following steps: acquiring statistical information of a transaction data set to be processed; the transaction data set is composed of one or more transaction data received and to be processed; acquiring a packing condition for transaction data in a blockchain network; if the statistical information meets the packing condition, combining the transaction data in the transaction data set to obtain combined transaction data; and packaging the merged transaction data, and executing uplink processing on the packaged merged transaction data in the blockchain network. By adopting the method and the device, the processing performance of the transaction data in the blockchain network can be improved, and the uplink overhead of the transaction data can be reduced.

Description

Transaction processing method, apparatus, product, device and medium of block chain network
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a transaction processing method, apparatus, product, device, and medium for a blockchain network.
Background
Blockchains are novel application modes of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block.
In the existing application, when the flow of the transaction data in the blockchain network is small, there may be a situation that each time one transaction data is generated, the transaction data is packed into a block to perform consensus uplink, so that the processing efficiency of the transaction data is low, the performance of processing the transaction data by the blockchain network is affected, and great expense is brought in the stage of packing the transaction data into the block to perform consensus.
Disclosure of Invention
The application provides a transaction processing method, device, product, equipment and medium of a blockchain network, which can improve the processing performance of transaction data in the blockchain network and reduce the uplink overhead of the transaction data.
In one aspect, the present application provides a transaction method for a blockchain network, the method including:
acquiring statistical information of a transaction data set to be processed; the transaction data set is composed of one or more transaction data received and to be processed;
acquiring a packing condition for transaction data in a blockchain network;
if the statistical information meets the packing condition, combining the transaction data in the transaction data set to obtain combined transaction data;
and packaging the merged transaction data, and executing uplink processing on the packaged merged transaction data in the blockchain network.
In one aspect, the present application provides a transaction processing apparatus for a blockchain network, the apparatus comprising:
the first acquisition module is used for acquiring statistical information of the transaction data set to be processed; the transaction data set is composed of one or more transaction data received and to be processed;
the second acquisition module is used for acquiring the packing condition aiming at the transaction data in the blockchain network;
the merging module is used for merging the transaction data in the transaction data set if the statistical information meets the packing condition to obtain merged transaction data;
and the packaging module is used for packaging the merged transaction data and executing uplink processing on the packaged merged transaction data in the blockchain network.
Optionally, the method for acquiring the statistical information of the transaction data set to be processed by the first acquiring module includes:
counting transaction data in the transaction data set to obtain the statistical quantity of the transaction data to be processed in the transaction data set;
the statistical quantity is determined as statistical information of the transaction dataset.
Optionally, the packing condition refers to a condition that the number of transaction data to be processed is greater than or equal to a number threshold; the device is also used for:
Detecting the magnitude relation between the statistical quantity and the quantity threshold;
if the statistical quantity is detected to be greater than or equal to the quantity threshold value, determining that the statistical quantity meets the packaging condition;
if the statistical quantity is detected to be smaller than the quantity threshold value, determining that the statistical quantity does not meet the packaging condition.
Optionally, the device is further configured to:
acquiring an average receiving time interval for transaction data to be processed in a blockchain network in a target period;
determining an adjustment quantity threshold for the packing condition based on the average reception time interval;
if the adjusted quantity threshold value is inconsistent with the quantity threshold value in the packing condition, updating the quantity threshold value in the packing condition to the adjusted quantity threshold value.
Optionally, the method for determining the adjustment quantity threshold for the packing condition by the device based on the average receiving time interval includes:
acquiring reference packing interval duration for transaction data to be processed in a blockchain network;
the ratio between the reference packing interval duration and the average receiving time interval is determined as an adjustment quantity threshold.
Optionally, the merging module performs merging processing on the transaction data in the transaction data set to obtain a mode of merging the transaction data, including:
Respectively carrying out serialization processing on each transaction data in the transaction data set to obtain serialized data of each transaction data;
merging and packaging the serialized data of each transaction data to obtain merged transaction data; the serialized data of one transaction data belongs to one transaction parameter of the merged transaction data.
Optionally, the method for packaging the combined transaction data by the packaging module and executing the uplink processing on the packaged combined transaction data in the blockchain network includes:
packaging the merged transaction data to generate a target block to which the merged transaction data belongs;
performing a uplink process on the target block in the blockchain network;
the packed merged transaction data is the target block.
Optionally, the blockchain network includes a consensus network; the packing module performs a flow of uplink processing on a target block in a blockchain network, including:
broadcasting the target block to a consensus network, and performing consensus processing on the target block in the consensus network;
if the consensus is successful for the target block in the consensus network, the target block is uplink to the blockchain network.
Optionally, the consensus network includes a plurality of consensus nodes, and the consensus processing of any consensus node on the target block includes:
Any consensus node is used for acquiring the merged transaction data from the target block and performing deserialization processing on each transaction parameter in the merged transaction data so as to analyze and obtain each transaction data in the transaction data set;
any consensus node is used for verifying each piece of analyzed transaction data, and executing each piece of transaction data after each piece of transaction data is verified successfully to obtain an execution result of each piece of transaction data;
the execution result of the merged transaction data comprises the execution result of each transaction data, and the execution result of one transaction data is one execution sub-result of the merged transaction data.
Optionally, any transaction data in the transaction data set includes original transaction data of the any transaction data and a transaction signature of the original transaction data;
the verification processing of any transaction data obtained by analysis by any consensus node comprises the following steps:
any consensus node is used for verifying original transaction data based on the transaction signature;
and after the original transaction data is successfully verified, executing the original transaction data by any consensus node to obtain an execution result of any transaction data.
Optionally, any transaction data in the transaction data set is initiated by the target transaction client; the device is also used for:
Acquiring an execution result of the merged transaction data and storing the execution result of the merged transaction data;
the device is also used for:
receiving a query request of an execution result aiming at any transaction data sent by a target transaction client;
and responding to the query request, extracting the execution result of any transaction data from the stored execution results of the merged transaction data, and returning the extracted execution result to the target transaction client.
In one aspect, the present application provides a computer device including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform a method in one aspect of the present application.
In one aspect, the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the method of one of the above aspects.
According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program stored in a computer readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program to cause the computer device to execute the method provided in various optional manners of the above aspect and the like.
The method and the device can acquire the statistical information of the transaction data set to be processed; the transaction data set is composed of one or more transaction data received and to be processed; the packing condition for the transaction data in the blockchain network can be obtained; if the statistical information meets the packing condition, the transaction data in the transaction data set can be combined to obtain combined transaction data; further, the merged transaction data may be packaged and the packaged merged transaction data may be uplink processed in the blockchain network. Therefore, according to the method, the packing condition for the transaction data can be set in the blockchain network, and when the received transaction data set to be processed meets the packing condition, the transaction data set to be processed is correspondingly packed, so that the time for packing the transaction data in the blockchain network can be controlled according to actual requirements, the flexibility for packing the transaction data is improved, and the processing performance of the transaction data in the blockchain network is improved; in addition, after the transaction data set to be processed is combined, the combined transaction data is packaged, so that the number of the packaged transaction data is reduced, and the uplink overhead for the transaction data can be reduced.
Drawings
In order to more clearly illustrate the technical solutions of the present application or the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the prior art descriptions, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a network architecture for transaction data processing according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a scenario for processing transaction data according to an embodiment of the present application;
FIG. 3 is a flow chart of a transaction method of a blockchain network according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a scenario for generating consolidated transaction data provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of another scenario for processing transaction data provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a scenario for transaction data validation provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a scenario of an execution result of query transaction data according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a transaction device of a blockchain network according to an embodiment of the present disclosure;
Fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The present application relates to blockchain related technology. The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
The blockchain underlying platform may include processing modules for user management, basic services, smart contracts, operations, and the like. The user management module is responsible for identity information management of all blockchain participants, including maintenance of public and private key generation (account management), key management, maintenance of corresponding relation between the real identity of the user and the blockchain address (authority management) and the like, and under the condition of authorization, supervision and audit of transaction conditions of certain real identities, and provision of rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node devices, is used for verifying the validity of a service request, recording the service request on a storage after the effective request is identified, for a new service request, the basic service firstly analyzes interface adaptation and authenticates the interface adaptation, encrypts service information (identification management) through an identification algorithm, and transmits the encrypted service information to a shared account book (network communication) in a complete and consistent manner, and records and stores the service information; the intelligent contract module is responsible for registering and issuing contracts, triggering contracts and executing contracts, a developer can define contract logic through a certain programming language, issue the contract logic to a blockchain (contract registering), invoke keys or other event triggering execution according to the logic of contract clauses to complete the contract logic, and simultaneously provide a function of registering contract upgrading; the operation module is mainly responsible for deployment in the product release process, modification of configuration, contract setting, cloud adaptation and visual output of real-time states in product operation, for example: alarming, monitoring network conditions, monitoring node equipment health status, etc.
The platform product service layer provides basic capabilities and implementation frameworks of typical applications, and developers can complete the blockchain implementation of business logic based on the basic capabilities and the characteristics of the superposition business. The application service layer provides the application service based on the block chain scheme to the business participants for use.
In the present application, a corresponding packing condition may be set for the transaction data in the blockchain network, and further, after the transaction data set to be processed meets the packing condition, the transaction data set to be processed may be packed after being combined, and this specific process may be described in the following corresponding embodiment of fig. 3.
Firstly, it should be noted that all data (such as transaction data, related data of packaging conditions, etc.) collected in the present application are collected under the condition that the object (such as user, organization, or enterprise) to which the data belongs agrees and authorizes, and the collection, use, and processing of the related data need to comply with related laws and regulations and standards of related countries and regions.
Here, a description will be given of a related art concept to which the present application relates:
intelligent contract: a digitally defined protocol is required to operate in a trusted environment, such as a blockchain platform. The intelligent contract (Smart contract) is a contract running in network space by means of a computer, is propagated, verified or executed in an informationized mode, is read and executed by the computer, and has the characteristic of self-service. Decentralizing the blockchain and tamper-proofing the data determine that the smart contract is more suitable for implementation on the blockchain. Therefore, the development of the blockchain technology enables the intelligent contract to have wider development prospect. An intelligent contract is in fact a piece of program made up of computer code, the association of which is: firstly, two or more parties participating in contract agree on a common consensus to form an intelligent contract; secondly, broadcasting and storing the intelligent contract to fulcrums of all global block chains through a block chain network; and thirdly, automatically executing contract contents after the intelligent contract with success is constructed and waiting conditions are met.
Signature: i.e. digital signature (also called public key digital signature, electronic signature), is a common physical signature similar to that written on paper, implemented using the technology of public key cryptography field, and used for authenticating digital information. The method is a digital string which cannot be forged by others only generated by the sender of the information, and is also an effective proof of the authenticity of the information sent by the sender of the information, and is mainly used for the identification and anti-repudiation of the signer with data change.
Alliance chain: the generation of each block is determined by all preselected nodes together, and other access nodes can participate in the transaction, but no accounting process is performed, and other third parties can perform limited inquiry through the open API of the blockchain. For better performance, the federation chain has certain requirements for the configuration of consensus or authentication nodes and the network environment. With the admission mechanism, transaction performance can be improved more easily, and problems caused by participants with irregular participation are avoided.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a network architecture for transaction data processing according to an embodiment of the present application. As shown in fig. 1, the network architecture may include a blockchain network and transaction clients, wherein a plurality of blockchain nodes may be included in the blockchain network, and some of the blockchain nodes may be configured as relay nodes that may subsequently be used to receive transaction data initiated by the transaction clients to the blockchain network.
The servers forming the blockchain node may be independent physical servers, may be server clusters or distributed systems formed by a plurality of physical servers, and may also be cloud servers providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like. The terminal device may be: intelligent terminals such as smart phones, tablet computers, notebook computers, desktop computers, intelligent televisions and the like.
Referring to fig. 2, fig. 2 is a schematic diagram of a scenario for processing transaction data according to an embodiment of the present application. As shown in fig. 2, the transaction data in the transaction data set to be processed includes the transaction data which is received by the relay node and sent by the transaction client and is not yet processed (i.e., the transaction data to be processed), and the relay node may acquire statistical information of the transaction data set to be processed, and further may determine whether the statistical information meets a packing condition for the transaction data in the blockchain network.
If the relay node judges that the statistical information of the transaction data set to be processed meets the packaging condition, the transaction data in the transaction data set to be processed can be combined, so that combined transaction data can be generated.
Furthermore, the relay node may perform a packing process on the merged transaction data, for example, packing the merged transaction data into a block to which the merged transaction data belongs, so as to obtain the packed merged transaction data, for example, the packed merged transaction data may be the block to which the packed merged transaction data belongs.
The relay node can execute the uplink processing on the packed merged transaction data in the blockchain network, and the uplink processing on the merged transaction data can be realized.
According to the method, as the packing condition for the transaction data can be set in the blockchain network, when the received transaction data set to be processed meets the packing condition, the transaction data set to be processed is correspondingly packed, so that the time for packing the transaction data in the blockchain network can be controlled according to actual requirements, the flexibility for packing the transaction data in the blockchain network is improved, and the processing performance of the transaction data in the blockchain network is improved; in addition, after the transaction data set to be processed is combined, the combined transaction data is packaged, so that the number of the packaged transaction data is reduced, and the uplink overhead for the transaction data can be reduced.
Referring to fig. 3, fig. 3 is a flowchart of a transaction processing method of a blockchain network according to an embodiment of the present application. As shown in fig. 3, the method may include:
step S101, acquiring statistical information of a transaction data set to be processed; the transaction data set is made up of one or more transaction data received for processing.
Alternatively, the blockchain network in the present application may be a federated chain network, or may be another type of blockchain network, where the blockchain network in the present application may include a plurality of blockchain nodes, and a blockchain node may be formed by one or more computer devices, which may be servers, terminal devices, or other devices, without limitation.
It may be understood that, in the embodiment of the present application, the execution body may be a relay node (may also be referred to as a transaction device), where the relay node is a blockchain node with a specific function set in the method of the present application, and the relay node may be any blockchain node in a blockchain network, for example, the relay node may be a service node (not participating in consensus) in the blockchain network, or may also be a consensus node (participating in consensus) in the blockchain network, where the execution body may be any relay node, in other words, if there are multiple relay nodes, each relay node may execute a procedure described below in the present application. The following collectively describes an execution body in the embodiment of the present application as a relay node.
The relay node may obtain statistics of a transaction data set to be processed, which may be composed of one or more transaction data received to be processed. In other words, the transaction data set may contain individual transaction data currently pending.
The transaction data may be any transaction data initiated to the blockchain network, such as resource transfer transaction data. The transaction data may be initiated by a user in a client, which may be the front end of a blockchain network, which may also be referred to as a transaction client, whereas a blockchain network may be understood as the background of the client, which may be used to provide the user with functionality of the front-end related interface operations. Different transaction data in the transaction data set may be initiated by different users in the respective belonging clients.
Wherein the statistics of the transaction data set to be processed may correspond to the packing conditions for the transaction data described below. For example, if the packing condition is a condition that determines whether to pack the transaction data to be processed according to the number of transaction data to be processed, the statistical information of the transaction data set to be processed may be the number of transaction data in the transaction data set.
In this case, the relay node may count transaction data in the transaction data set, so as to obtain a statistical number of transaction data to be processed in the transaction data set, where the statistical number may be the total number of transaction data in the transaction data set.
Further, the relay node may consider the statistics as the above statistics for the transaction dataset.
It should be noted that, each time the relay node receives one transaction data, the current transaction data set may be acquired, and the transaction data set may include the currently received transaction data and the previously received transaction data to be processed (i.e. not yet processed) to execute the whole process in the embodiment of the present application. In other words, the above-mentioned transaction data set to be processed of the present application may be a transaction data set that exists when the relay node receives any transaction data.
That is, each time the relay node receives a transaction data, the corresponding flow in the embodiment of the present application may be executed to determine whether the currently existing transaction data set to be processed needs to be packaged and uplink. The transaction data set described in the following unified manner in the present application may be a transaction data set to be processed that exists currently when any transaction data is received.
Step S102, obtaining packing conditions for transaction data in the blockchain network.
Optionally, the relay node may obtain a packing condition for the transaction data in the blockchain network, where the packing condition may be a preset condition for determining whether the currently received transaction data to be processed needs to be packed.
In a possible implementation manner, the packing condition may refer to a condition that the number of the transaction data to be processed is greater than or equal to a number threshold, where the packing condition indicates that when the number of the transaction data to be processed is greater than or equal to the number threshold, the current transaction data to be processed may be subjected to corresponding packing processing.
In another possible embodiment, the packing condition may be: in the adjacent period from the previous (i.e., last, i.e., last) packaging of the transaction data, the condition that the number of transaction data to be processed (e.g., the number of transaction data in the set of transaction data to be processed) is greater than or equal to the number threshold may be referred to, and if the current time exceeds the adjacent period, the current transaction data to be processed may be immediately packaged (in this case, the number of transaction data to be processed may be less than the number threshold), which may avoid the situation that the transaction data cannot be processed for a long time in the case that the frequency of the generation of the transaction data is small.
Alternatively, the starting time of the adjacent period may be the time of last packing the transaction data, and the duration of the adjacent period may be a specific duration set in advance, for example, a duration set for 2 minutes, etc.
The packing conditions can be set automatically according to the actual packing requirements for the transaction data.
Step S103, if the statistical information meets the packing condition, the transaction data in the transaction data set is combined to obtain combined transaction data.
Optionally, the relay node may detect whether the statistical information of the transaction data set to be processed meets a set packing condition, and if so, may perform subsequent corresponding packing processing on the transaction data in the transaction data set.
The process of merging transaction data in a transaction data set to obtain merged transaction data may include: the relay node may perform a separate serialization process on each transaction data in the transaction data set, so as to obtain serialized data of each transaction data in the transaction data set, where one transaction data may correspond to one serialized data. Where the serialization data of a transaction data is actually used to represent the transaction data itself, the serialization data of a transaction data may be understood as another descriptive form of the transaction data that is easier for the relevant computer device to identify and process.
Furthermore, the relay node may perform merging and packaging processing on the serialized data of each transaction data in the transaction data set, that is, combine and package the serialized data of each transaction data in the transaction data set together, so as to generate merged transaction data, where the merged transaction data includes the serialized data of each transaction data in the transaction data set.
Wherein the serialized data of one transaction data in the transaction data set may be regarded as one parameter (which may be referred to as a transaction parameter or a call parameter) in the merged transaction data. The merged transaction data may be transaction data for processing each transaction data in the set of transaction data to be processed.
Referring to fig. 4, fig. 4 is a schematic diagram of a scenario for generating merged transaction data according to an embodiment of the present application. As shown in fig. 4, the transaction data set to be processed may include transaction data 0, transaction data 1, transaction data 2, transaction data 3, transaction data 4, and transaction data 5.
The relay node can perform serialization processing on the transaction data 0 to obtain serialization data 0 of the transaction data 0, the relay node can perform serialization processing on the transaction data 1 to obtain serialization data 1 of the transaction data 1, the relay node can perform serialization processing on the transaction data 2 to obtain serialization data 2 of the transaction data 2, the relay node can perform serialization processing on the transaction data 3 to obtain serialization data 3 of the transaction data 3, the relay node can perform serialization processing on the transaction data 4 to obtain serialization data 4 of the transaction data 4, and the relay node can perform serialization processing on the transaction data 5 to obtain serialization data 5 of the transaction data 5.
The relay node may perform merging and encapsulation processing on the obtained serialized data 0, serialized data 1, serialized data 2, serialized data 3, serialized data 4, and serialized data 5, so as to generate merged transaction data, where the merged transaction data includes the serialized data 0, serialized data 1, serialized data 2, serialized data 3, serialized data 4, and serialized data 5.
If the statistical information of the transaction data set to be processed does not meet the set packaging condition, the current flow may end, and the relay node may continue to receive the transaction data to be processed in the blockchain network until the received transaction data to be processed meets the set packaging condition.
For example, the packing condition may be a condition that the number of the transaction data to be processed is greater than or equal to a number threshold, and the relay node may detect a size relationship between the statistical number (i.e., statistical information of the transaction data set to be processed) and the number threshold in the packing condition.
If the relay node detects that the statistical quantity is greater than or equal to the quantity threshold, the relay node can determine that the statistical quantity meets the set packaging condition; otherwise, if the statistical quantity is detected to be smaller than the quantity threshold value, it may be determined that the statistical quantity does not satisfy the above-set packing condition.
More, the number threshold in the packing condition may be a fixed threshold set in advance, or the number threshold may be dynamically generated according to the generation frequency of the transaction data to be processed in the nearest blockchain network.
If the number threshold is dynamically generated, the process of generating the number threshold may include: the relay node may obtain an average reception time interval for transaction data to be processed in the blockchain network within the target period, that is, an average time interval for each transaction data to be processed received within the target period. The average receive time interval may be used to reflect the frequency of generation of transaction data to be processed, the larger the average receive time interval indicating a lower frequency of generation of transaction data to be processed and the smaller the average receive time interval indicating a higher frequency of generation of transaction data to be processed.
Alternatively, the above-mentioned target period may refer to a neighboring period of time when any transaction data is acquired each time, if a transaction data is acquired at a target time point, the neighboring period may be a period of time before the target time point, for example, the ending time of the target period may be the target time point, and the duration of the target period may be a predetermined fixed duration, for example, 10 minutes. Alternatively, the target period may be another period set, and this is not a limitation.
Therefore, each time transaction data is acquired, the number threshold in the packing condition can be dynamically generated according to different target time periods corresponding to the time when different transaction data is acquired, as described below.
Further, the relay node dynamically generates an adjustment quantity threshold value for the packing condition by the average reception time interval: the relay node may obtain a reference packing interval duration for the transaction data to be processed in the blockchain network, where the reference packing interval duration may be a set time interval for packing the transaction data for two adjacent times, for example, the reference packing interval duration may be 4 minutes, that is, it indicates that packing the transaction data once every 4 minutes is a relatively suitable time interval.
The relay node may use the ratio between the reference packing interval duration and the average receiving time interval (i.e., the value of the reference packing interval duration to the average receiving time interval) as the adjustment quantity threshold.
Furthermore, the relay node may determine whether the adjustment quantity threshold is consistent with the quantity threshold in the current packaging condition, and if the adjustment quantity threshold is inconsistent with the quantity threshold in the current packaging condition, may dynamically update the quantity threshold in the packaging condition to the adjustment quantity threshold.
Otherwise, if the adjusted quantity threshold is consistent with the quantity threshold in the current packing condition, the quantity threshold in the packing condition may be kept unchanged.
For example, if 100 transaction data are received in the target period, the target period is 10 minutes, and then the average receiving time interval for receiving one transaction data to be processed in the target period is 10 minutes divided by 100 and is 0.1 minutes; if the set reference packing interval duration is 4 minutes, the adjustment quantity threshold may be 4 divided by 0.1, which is equal to 40.
By the method for dynamically generating the quantity threshold value in the packing condition, the frequency of packing the transaction data can be determined according to the generation frequency of the transaction data to be processed recently, so that the actual business requirements can be more met.
Step S104, the combined transaction data is packaged, and the packaged combined transaction data is subjected to uplink processing in the blockchain network.
Alternatively, the blockchain network may include a consensus network, and the consensus network may include a plurality of consensus nodes. Therefore, if the relay node is a consensus node in the consensus network and is a block-out node (node for packaging blocks) in the consensus network, the relay node may broadcast the generated merged transaction data to the consensus network, and may perform packaging processing on the merged transaction data to generate a block to which the merged transaction data belongs, and may call the block to which the merged transaction data belongs as a target block, where the target block may include the merged transaction data. The target block may be referred to as packed consolidated transaction data.
Further, the relay node may perform uplink processing on the above-packaged target block in the blockchain network, as described below.
The relay node can broadcast the generated target block to a consensus network in the block chain network so as to perform consensus processing on the target block in the consensus network; if the target block is successfully identified in the identification network, the relay node can uplink the target block to the blockchain network, and in fact, if the target block is successfully identified in the identification network, each blockchain node in the blockchain network can add the target block to a block account book of the own, so that the uplink processing of the target block is realized.
Referring to fig. 5, fig. 5 is a schematic diagram of another scenario for processing transaction data according to an embodiment of the present application. As shown in fig. 5, if the relay node receives the transaction data 1 to be processed at time t1 and has the transaction data 0 to be processed received before time t1 at time t1 (i.e., the transaction data 0 is not yet processed at time t1 after being received), the relay node may acquire the corresponding transaction data set to be processed at time t1, where the transaction data set to be processed at time t1 includes the transaction data 0 and the transaction data 1.
Furthermore, the relay node may acquire statistical information (i.e., statistical information 1) of the transaction data set to be processed at time t1, and may determine whether the statistical information 1 meets a set packing condition, and if not, may continue to receive the transaction data to be processed.
After time t1, if the relay node receives the transaction data 2 to be processed again at time t2, the relay node may acquire a corresponding transaction data set to be processed at time t2, where the transaction data set to be processed at time t2 includes transaction data 0, transaction data 1 and transaction data 2.
Furthermore, the relay node may acquire statistical information (i.e., statistical information 2) of the transaction data set to be processed at time t2, and may determine whether the statistical information 2 meets a set packing condition, and if not, may continue to receive the transaction data to be processed.
After the time t2, if the relay node receives the transaction data 3 to be processed at the time t3, the relay node may acquire a corresponding transaction data set to be processed at the time t3, where the transaction data set to be processed at the time t3 includes the transaction data 0, the transaction data 1, the transaction data 2 and the transaction data 3.
Furthermore, the relay node may acquire the statistical information (i.e., the statistical information 3) of the transaction data set to be processed at the time t3, and may determine whether the statistical information 3 meets the set packing condition, and if so, may perform corresponding packing and uplink processing on the transaction data set to be processed at the time t 3.
Each consensus node in the consensus network performs a corresponding consensus process for the target block, where the consensus process for the target block by any consensus node in the consensus network may include:
the any consensus node can acquire the merged transaction data from the target block, and can perform deserialization processing on each transaction parameter in the merged transaction data, so that each transaction data in the transaction data set to be processed can be analyzed.
Furthermore, the any consensus node can verify the analyzed transaction data, and can execute the transaction data after the transaction data are verified successfully, so as to obtain the execution result of the transaction data, and further obtain the execution result of the merged transaction data according to the execution result of the transaction data.
The execution result of the merged transaction data may include the execution result of each transaction data in the transaction data set, and the execution result of one transaction data may be one execution sub-result of the execution results of the merged transaction data. The execution result of the merged transaction data may also be uplink with the target block.
It will be appreciated that the transaction data that is executed and results from the execution belongs to already processed transaction data that is no longer subsequently considered to be transaction data to be processed.
Any transaction data in the transaction data set may include the original transaction data of the any transaction data and the transaction signature of the original transaction data, in other words, any transaction data may be obtained by combining the original transaction data with the transaction signature of the original transaction data, where the original transaction data may be original transaction data initiated by a client, such as transaction data of a resource transfer, and so on. The transaction signature may be obtained by signing the original transaction data by using a private key (may be referred to as a client private key) to which the client initiating the corresponding original transaction data belongs (the client private key may be a private key of a user to which the client belongs in a blockchain network), for example, the transaction signature may be obtained by encrypting a hash value of the original transaction data using the private key.
The public key of the client (may be referred to as a client public key, where the client public key may be a public key of a user of the client in the blockchain network, and the public key and the private key together form a pair of key pairs) may be disclosed, so each blockchain node in the blockchain network may hold or obtain the public key of the client. It will be appreciated that data encrypted using the private key of a client may be decrypted using the public key of the client.
Therefore, any of the consensus nodes may implement the verification process of the transaction data (actually may also be understood as the verification process of the original transaction data in the transaction data) by using the transaction signature in the transaction data, and specifically, the verification process of any of the consensus nodes on the resolved transaction data may include:
any of the common nodes may be configured to perform verification processing (i.e. signature verification processing) on the original transaction data in the any of the transaction data through the transaction signature in the any of the transaction data, for example, any of the common nodes may perform hash value calculation on the original transaction data in the any of the transaction data to obtain a hash value to be verified of the original transaction data in the any of the transaction data.
The public key of the client that initiates the transaction data may be used by the any one of the consensus nodes to decrypt the transaction signature in the transaction data to obtain a legal hash value (i.e., a true hash value). Furthermore, the any one of the consensus nodes can detect whether the hash value to be verified is consistent with the legal hash value, if the hash value to be verified is consistent with the legal hash value, the verification of the any one of the transaction data is successful, and if the hash value to be verified is inconsistent with the legal hash value, the verification of the any one of the transaction data is failed.
Referring to fig. 6, fig. 6 is a schematic diagram of a scenario for transaction data verification according to an embodiment of the present application. As shown in fig. 6, the transaction data may include the original transaction data and a transaction signature of the original transaction data, and the transaction signature is decrypted by a public key of a transaction client that initiates the original transaction data, so as to obtain a legal hash value of the original transaction data.
And carrying out hash calculation on the original transaction data, so as to generate a hash value to be verified of the original transaction data, and further, carrying out comparison processing on the legal hash value and the hash value to be verified, thereby obtaining a verification result of the transaction data. If the legal hash value is compared with the hash value to be verified, the verification result of the transaction data can be the verification success result, otherwise, if the legal hash value is compared with the hash value to be verified, the verification result of the transaction data can be the verification failure result.
After the original transaction data in the transaction data is successfully verified (i.e. after the original transaction data is successfully verified), any of the above-mentioned consensus nodes can execute the original transaction data in the transaction data (which can also be understood as executing the transaction data) to obtain the execution result of the transaction data. For example, if the transaction data is resource transfer transaction data, executing the transaction data may refer to performing a corresponding resource transfer according to the transaction data.
More, if the relay node is not a consensus node in the consensus network, the relay node may send the merged transaction data to any consensus node, so that the merged transaction data may be broadcast to the consensus network by any consensus node, so that a block-out node in the consensus network may obtain, in a packing manner, a block to which the merged transaction data belongs according to the above-described process, and perform uplink processing for the block in the blockchain network.
If the relay node is a consensus node in the consensus network, but not a block-out node in the consensus network, the relay node may broadcast the merged transaction data to the consensus network, so that the block-out node in the consensus network may obtain a block to which the merged transaction data belongs by packing according to the above-described process, and perform uplink processing for the block in the blockchain network.
If the relay node is a consensus node in the consensus network, the relay node may directly obtain an execution result of the merged transaction data, where the execution result may be generated by the relay node itself. The relay node may store the execution result of the merged transaction data.
If the relay node is not a consensus node in the consensus network, any consensus node (for example, the consensus node that can be a relay node sending the merged transaction data) in the consensus network can return (i.e. send) the execution result of the merged transaction data to the relay node, after obtaining the execution result of the merged transaction data sent by the consensus node, the relay node can also store the execution result of the merged transaction data, and if there are multiple relay nodes, the consensus node can send the execution result of the merged transaction data to all relay nodes that are not the consensus node in the multiple relay nodes, so that each relay node can maintain and store the execution result of the merged transaction data, and the data maintained by each relay node can be the same.
Optionally, the process of packing and uplink the transaction data in the present application may be implemented by calling an intelligent contract, where the intelligent contract may be referred to as an entry point intelligent contract, each common node in the blockchain network may be preconfigured with the entry point intelligent contract, a block-out node in the blockchain network (may be alternatively served by each common node in the common network) may call the configured entry point intelligent contract to perform the above-mentioned packing process of the combined transaction data, and each common node may call the configured entry point intelligent contract to perform corresponding processing such as common-knowledge uplink on the packed combined transaction data. Wherein the entry point smart contract may be a pre-configured smart contract that may be used to implement packaging and uplink related processing for transactional data.
Subsequently, the user can query the execution result of the transaction data (the transaction data belonging to the transaction data set to be processed) initiated by the user from any relay node (the user can not perceive the existence of the relay node) through the client, for example, the execution result of the transaction data can be queried from the relay node which can initiate the transaction data to the user, as described in the following:
Any of the transaction data in the transaction data set may be initiated by a target transaction client, which may be any transaction client connected to the blockchain network. The target transaction client may initiate a query request for the execution result of the any transaction data to the background (i.e., to the relay node), and the relay node may receive the query request sent by the target transaction client.
The relay node may respond to the query request, extract an execution result of the any transaction data from the stored execution results of the merged transaction data, and may return the extracted execution result to the target transaction client, where the target transaction client may output the execution result in the client interface for viewing by the user.
Referring to fig. 7, fig. 7 is a schematic diagram of a scenario of an execution result of query transaction data according to an embodiment of the present application. It is assumed that the above-described transaction data set to be processed whose statistical information meets the packing condition may include transaction data 0, transaction data 1, transaction data 2, transaction data 3, transaction data 4, and transaction data 5, and thus, the execution result of the merged transaction data may include the execution result of the transaction data 0, the execution result of the transaction data 1, the execution result of the transaction data 2, the execution result of the transaction data 3, the execution result of the transaction data 4, and the execution result of the transaction data 5.
If the relay node receives the query request for the execution result of the transaction data 2 sent by the transaction client, the relay node may extract the execution result of the transaction data 2 from the stored execution result of the merged transaction data, and may return the extracted execution result of the transaction data 2 to the transaction client, where the transaction client may display and output the received execution result of the transaction data 2 for the user to view.
By adopting the process, the relay node can adjust the quantity threshold value in the packing condition according to the flow of the transaction data in the current alliance chain, for example, when the flow of the transaction data in the alliance chain is large, the quantity threshold value can be adjusted to be large, and when the flow of the transaction data in the alliance chain is small, the quantity threshold value can be adjusted to be small, so that the aim of increasing/reducing the rate of packing the chains to process the transaction data can be achieved, namely, the effect of dynamically controlling the block-out speed of the alliance chain is achieved, and the overall performance of the alliance chain on the transaction data processing is further improved.
In addition, since a certain amount of overhead is generated when each transaction data is subjected to the uplink processing, the method and the device can obtain the merged transaction data by merging a plurality of transaction data in the transaction data set to be processed, further perform the uplink processing on one transaction data of the merged transaction data, and further reduce the uplink overhead of a plurality of transaction data in the transaction data set to be processed.
In addition, the method has an excellent effect in an application scene of the alliance chain network, and because the flow of the transaction data in the alliance chain network is quite small, even when the flow of the transaction data in the alliance chain network is quite small, corresponding packing conditions can be set to control the block-out efficiency of the transaction data in the alliance chain network, so that the packing flexibility of the transaction data in the alliance chain network is improved, and the processing performance of the transaction data is improved.
The method and the device can acquire the statistical information of the transaction data set to be processed; the transaction data set is composed of one or more transaction data received and to be processed; the packing condition for the transaction data in the blockchain network can be obtained; if the statistical information meets the packing condition, the transaction data in the transaction data set can be combined to obtain combined transaction data; further, the merged transaction data may be packaged and the packaged merged transaction data may be uplink processed in the blockchain network. Therefore, according to the method, the packing condition for the transaction data can be set in the blockchain network, and when the received transaction data set to be processed meets the packing condition, the transaction data set to be processed is correspondingly packed, so that the time for packing the transaction data in the blockchain network can be controlled according to actual requirements, the flexibility for packing the transaction data is improved, and the processing performance of the transaction data in the blockchain network is improved; in addition, after the transaction data set to be processed is combined, the combined transaction data is packaged, so that the number of the packaged transaction data is reduced, and the uplink overhead for the transaction data can be reduced.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a transaction processing device of a blockchain network according to an embodiment of the present application. As shown in fig. 8, the transaction processing device 1 of the blockchain network may include: a first acquisition module 11, a second acquisition module 12, a merging module 13 and a packing module 14.
A first obtaining module 11, configured to obtain statistical information of a transaction data set to be processed; the transaction data set is composed of one or more transaction data received and to be processed;
a second obtaining module 12, configured to obtain a packing condition for the transaction data in the blockchain network;
the merging module 13 is configured to merge the transaction data in the transaction data set if the statistical information meets the packing condition, so as to obtain merged transaction data;
and the packaging module 14 is used for packaging the combined transaction data and executing uplink processing on the packaged combined transaction data in the blockchain network.
Optionally, the manner in which the first obtaining module 11 obtains the statistical information of the transaction data set to be processed includes:
counting transaction data in the transaction data set to obtain the statistical quantity of the transaction data to be processed in the transaction data set;
The statistical quantity is determined as statistical information of the transaction dataset.
Optionally, the packing condition refers to a condition that the number of transaction data to be processed is greater than or equal to a number threshold; the above device 1 is also used for:
detecting the magnitude relation between the statistical quantity and the quantity threshold;
if the statistical quantity is detected to be greater than or equal to the quantity threshold value, determining that the statistical quantity meets the packaging condition;
if the statistical quantity is detected to be smaller than the quantity threshold value, determining that the statistical quantity does not meet the packaging condition.
Optionally, the above device 1 is further configured to:
acquiring an average receiving time interval for transaction data to be processed in a blockchain network in a target period;
determining an adjustment quantity threshold for the packing condition based on the average reception time interval;
if the adjusted quantity threshold value is inconsistent with the quantity threshold value in the packing condition, updating the quantity threshold value in the packing condition to the adjusted quantity threshold value.
Optionally, the method for determining the adjustment quantity threshold for the packing condition by the apparatus 1 based on the average receiving time interval includes:
acquiring reference packing interval duration for transaction data to be processed in a blockchain network;
the ratio between the reference packing interval duration and the average receiving time interval is determined as an adjustment quantity threshold.
Optionally, the merging module 13 performs merging processing on the transaction data in the transaction data set to obtain a manner of merging the transaction data, which includes:
respectively carrying out serialization processing on each transaction data in the transaction data set to obtain serialized data of each transaction data;
merging and packaging the serialized data of each transaction data to obtain merged transaction data; the serialized data of one transaction data belongs to one transaction parameter of the merged transaction data.
Optionally, the packing module 14 packs the merged transaction data and performs uplink processing on the packed merged transaction data in the blockchain network, including:
packaging the merged transaction data to generate a target block to which the merged transaction data belongs;
performing a uplink process on the target block in the blockchain network;
the packed merged transaction data is the target block.
Optionally, the blockchain network includes a consensus network; the packing module 14 performs a process of uplink processing on the target block in the blockchain network, including:
broadcasting the target block to a consensus network, and performing consensus processing on the target block in the consensus network;
If the consensus is successful for the target block in the consensus network, the target block is uplink to the blockchain network.
Optionally, the consensus network includes a plurality of consensus nodes, and the consensus processing of any consensus node on the target block includes:
any consensus node is used for acquiring the merged transaction data from the target block and performing deserialization processing on each transaction parameter in the merged transaction data so as to analyze and obtain each transaction data in the transaction data set;
any consensus node is used for verifying each piece of analyzed transaction data, and executing each piece of transaction data after each piece of transaction data is verified successfully to obtain an execution result of each piece of transaction data;
the execution result of the merged transaction data comprises the execution result of each transaction data, and the execution result of one transaction data is one execution sub-result of the merged transaction data.
Optionally, any transaction data in the transaction data set includes original transaction data of the any transaction data and a transaction signature of the original transaction data;
the verification processing of any transaction data obtained by analysis by any consensus node comprises the following steps:
any consensus node is used for verifying original transaction data based on the transaction signature;
And after the original transaction data is successfully verified, executing the original transaction data by any consensus node to obtain an execution result of any transaction data.
Optionally, any transaction data in the transaction data set is initiated by the target transaction client; the above device 1 is also used for:
acquiring an execution result of the merged transaction data and storing the execution result of the merged transaction data;
the above device 1 is also used for:
receiving a query request of an execution result aiming at any transaction data sent by a target transaction client;
and responding to the query request, extracting the execution result of any transaction data from the stored execution results of the merged transaction data, and returning the extracted execution result to the target transaction client.
According to one embodiment of the present application, the steps involved in the transaction method of the blockchain network shown in fig. 3 may be performed by the respective modules in the transaction device 1 of the blockchain network shown in fig. 8. For example, step S101 shown in fig. 3 may be performed by the first acquisition module 11 in fig. 8, and step S102 shown in fig. 3 may be performed by the second acquisition module 12 in fig. 8; step S103 shown in fig. 3 may be performed by the merging module 13 in fig. 8, and step S104 shown in fig. 3 may be performed by the packing module 14 in fig. 8.
The method and the device can acquire the statistical information of the transaction data set to be processed; the transaction data set is composed of one or more transaction data received and to be processed; the packing condition for the transaction data in the blockchain network can be obtained; if the statistical information meets the packing condition, the transaction data in the transaction data set can be combined to obtain combined transaction data; further, the merged transaction data may be packaged and the packaged merged transaction data may be uplink processed in the blockchain network. Therefore, the device can set the packing condition for the transaction data in the blockchain network, and when the received transaction data set to be processed meets the packing condition, the transaction data set to be processed is correspondingly packed, so that the time for packing the transaction data in the blockchain network can be controlled according to actual requirements, the flexibility for packing the transaction data is improved, and the processing performance of the transaction data in the blockchain network is improved; in addition, after the transaction data set to be processed is combined, the combined transaction data is packaged, so that the number of the packaged transaction data is reduced, and the uplink overhead for the transaction data can be reduced.
According to one embodiment of the present application, each module in the transaction processing device 1 of the blockchain network shown in fig. 8 may be separately or completely combined into one or several units to form a structure, or some (some) of the units may be further split into a plurality of sub-units with smaller functions, so that the same operation may be implemented without affecting the implementation of the technical effects of the embodiments of the present application. The above modules are divided based on logic functions, and in practical applications, the functions of one module may be implemented by a plurality of units, or the functions of a plurality of modules may be implemented by one unit. In other embodiments of the present application, the transaction device 1 of the blockchain network may also include other units, and in practical applications, these functions may also be implemented with assistance by other units, and may be implemented by cooperation of a plurality of units.
According to one embodiment of the present application, a computer program capable of executing the steps involved in the respective methods shown in the embodiments of the present application may be run on a general purpose computer device, which may contain a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), etc., processing elements and storage elements, to construct a transaction arrangement 1 of a blockchain network as shown in fig. 8. The above-described computer program may be recorded on, for example, a computer-readable recording medium, and may be loaded into and executed in the above-described computer apparatus through the computer-readable recording medium.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 9, the computer device 1000 may include: processor 1001, network interface 1004, and memory 1005, and, in some embodiments, computer device 1000 may further comprise: a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 9, an operating system, a network communication module, a user interface module, and a device control application program may be included in the memory 1005, which is one type of computer storage medium.
In the computer device 1000 shown in fig. 9, the network interface 1004 may provide network communication functions; while user interface 1003 is primarily used as an interface for providing input to a user; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
acquiring statistical information of a transaction data set to be processed; the transaction data set is composed of one or more transaction data received and to be processed;
acquiring a packing condition for transaction data in a blockchain network;
if the statistical information meets the packing condition, combining the transaction data in the transaction data set to obtain combined transaction data;
and packaging the merged transaction data, and executing uplink processing on the packaged merged transaction data in the blockchain network.
In one possible implementation, the processor 1001 may also be used to invoke a device control application stored in the memory 1005 to implement:
counting transaction data in the transaction data set to obtain the statistical quantity of the transaction data to be processed in the transaction data set;
the statistical quantity is determined as statistical information of the transaction dataset.
In one possible embodiment, the packing condition refers to a condition that the number of transaction data to be processed is greater than or equal to a number threshold; the processor 1001 may also be used to invoke a device control application stored in the memory 1005 to implement:
Detecting the magnitude relation between the statistical quantity and the quantity threshold;
if the statistical quantity is detected to be greater than or equal to the quantity threshold value, determining that the statistical quantity meets the packaging condition;
if the statistical quantity is detected to be smaller than the quantity threshold value, determining that the statistical quantity does not meet the packaging condition.
In one possible implementation, the processor 1001 may also be used to invoke a device control application stored in the memory 1005 to implement:
acquiring an average receiving time interval for transaction data to be processed in a blockchain network in a target period;
determining an adjustment quantity threshold for the packing condition based on the average reception time interval;
if the adjusted quantity threshold value is inconsistent with the quantity threshold value in the packing condition, updating the quantity threshold value in the packing condition to the adjusted quantity threshold value.
In one possible implementation, the processor 1001 may also be used to invoke a device control application stored in the memory 1005 to implement:
acquiring reference packing interval duration for transaction data to be processed in a blockchain network;
the ratio between the reference packing interval duration and the average receiving time interval is determined as an adjustment quantity threshold.
In one possible implementation, the processor 1001 may also be used to invoke a device control application stored in the memory 1005 to implement:
Respectively carrying out serialization processing on each transaction data in the transaction data set to obtain serialized data of each transaction data;
merging and packaging the serialized data of each transaction data to obtain merged transaction data; the serialized data of one transaction data belongs to one transaction parameter of the merged transaction data.
In one possible implementation, the processor 1001 may also be used to invoke a device control application stored in the memory 1005 to implement:
packaging the merged transaction data to generate a target block to which the merged transaction data belongs;
performing a uplink process on the target block in the blockchain network;
the packed merged transaction data is the target block.
In one possible implementation, the blockchain network includes a consensus network; the processor 1001 may also be used to invoke a device control application stored in the memory 1005 to implement:
broadcasting the target block to a consensus network, and performing consensus processing on the target block in the consensus network;
if the consensus is successful for the target block in the consensus network, the target block is uplink to the blockchain network.
In one possible implementation, the consensus network includes a plurality of consensus nodes, and the consensus process of any consensus node on the target block includes:
Any consensus node is used for acquiring the merged transaction data from the target block and performing deserialization processing on each transaction parameter in the merged transaction data so as to analyze and obtain each transaction data in the transaction data set;
any consensus node is used for verifying each piece of analyzed transaction data, and executing each piece of transaction data after each piece of transaction data is verified successfully to obtain an execution result of each piece of transaction data;
the execution result of the merged transaction data comprises the execution result of each transaction data, and the execution result of one transaction data is one execution sub-result of the merged transaction data.
In one possible implementation, any transaction data in the transaction data set includes original transaction data for the any transaction data and a transaction signature for the original transaction data;
the verification processing of any transaction data obtained by analysis by any consensus node comprises the following steps:
any consensus node is used for verifying original transaction data based on the transaction signature;
and after the original transaction data is successfully verified, executing the original transaction data by any consensus node to obtain an execution result of any transaction data.
In one possible implementation, any transaction data in the transaction data set is initiated by the target transaction client; the processor 1001 may also be used to invoke a device control application stored in the memory 1005 to implement:
acquiring an execution result of the merged transaction data and storing the execution result of the merged transaction data;
the processor 1001 may also be used to invoke a device control application stored in the memory 1005 to implement:
receiving a query request of an execution result aiming at any transaction data sent by a target transaction client;
and responding to the query request, extracting the execution result of any transaction data from the stored execution results of the merged transaction data, and returning the extracted execution result to the target transaction client.
It should be understood that the computer device 1000 described in the embodiments of the present application may perform the description of the transaction processing method of the blockchain network in the embodiments of the present application, and may also perform the description of the transaction processing apparatus 1 of the blockchain network in the embodiment corresponding to fig. 8, which is not described herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, which when executed by a processor, can perform the description of the transaction processing method of the blockchain network in the embodiments of the present application, and therefore, will not be described in detail herein. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer storage medium related to the present application, please refer to the description of the method embodiments of the present application.
As an example, the above-described computer program may be deployed to be executed on one computer device or on a plurality of computer devices that are located at one site, or alternatively, may be executed on a plurality of computer devices that are distributed across a plurality of sites and interconnected by a communication network, and the plurality of computer devices that are distributed across the plurality of sites and interconnected by the communication network may constitute a blockchain network.
The computer readable storage medium may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card) or the like, which are provided on the computer device. Further, the computer-readable storage medium may also include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
The present application provides a computer program product comprising a computer program stored in a computer readable storage medium. The processor of the computer device reads the computer program from the computer readable storage medium, and the processor executes the computer program, so that the computer device performs the description of the transaction processing method of the blockchain network in the embodiments of the present application, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application.
The terms first, second and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the term "include" and any variations thereof is intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or device that comprises a list of steps or elements is not limited to the list of steps or modules but may, in the alternative, include other steps or modules not listed or inherent to such process, method, apparatus, article, or device.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (15)

1. A method of transaction processing for a blockchain network, the method comprising:
acquiring statistical information of a transaction data set to be processed; the transaction data set is composed of one or more transaction data received and to be processed;
Acquiring a packing condition for transaction data in the blockchain network;
if the statistical information meets the packaging condition, combining the transaction data in the transaction data set to obtain combined transaction data;
and packaging the merged transaction data, and executing uplink processing on the packaged merged transaction data in the blockchain network.
2. The method of claim 1, wherein the obtaining statistics of the transaction data set to be processed comprises:
counting transaction data in the transaction data set to obtain the statistical quantity of the transaction data to be processed in the transaction data set;
the statistical quantity is determined as the statistical information of the transaction dataset.
3. The method of claim 2, wherein the packing condition is a condition that a quantity of transaction data to be processed is greater than or equal to a quantity threshold; the method further comprises the steps of:
detecting a magnitude relation between the statistical quantity and the quantity threshold;
if the statistical quantity is detected to be greater than or equal to the quantity threshold value, determining that the statistical quantity meets the packaging condition;
And if the statistical quantity is detected to be smaller than the quantity threshold value, determining that the statistical quantity does not meet the packaging condition.
4. A method as claimed in claim 3, wherein the method further comprises:
acquiring an average receiving time interval for transaction data to be processed in the blockchain network in a target period;
determining an adjustment quantity threshold for the packaging condition based on the average reception time interval;
and if the adjustment quantity threshold value is inconsistent with the quantity threshold value in the packing condition, updating the quantity threshold value in the packing condition into the adjustment quantity threshold value.
5. The method of claim 4, wherein the determining the adjusted quantity threshold for the packaging condition based on the average receive time interval comprises:
acquiring reference packing interval duration for transaction data to be processed in the blockchain network;
and determining the ratio between the reference packing interval duration and the average receiving time interval as the adjustment quantity threshold value.
6. The method of claim 1, wherein the merging transaction data in the transaction dataset to obtain merged transaction data comprises:
Respectively carrying out serialization processing on each transaction data in the transaction data set to obtain serialized data of each transaction data;
merging and packaging the serialized data of each transaction data to obtain merged transaction data; the serialized data of one transaction data belongs to one transaction parameter of the merged transaction data.
7. The method of claim 6, wherein said packaging the merged transaction data and performing a chaining process on the packaged merged transaction data in the blockchain network comprises:
packaging the merged transaction data to generate a target block to which the merged transaction data belongs;
performing a uplink process on the target block in the blockchain network;
and the packed merged transaction data is the target block.
8. The method of claim 7, wherein the blockchain network includes a consensus network; the performing uplink processing on the target block in the blockchain network includes:
broadcasting the target block to the consensus network, and performing consensus processing on the target block in the consensus network;
And if the consensus is successful for the target block in the consensus network, the target block is uplink to the blockchain network.
9. The method of claim 8, wherein the consensus network comprises a plurality of consensus nodes, the consensus process for the target block by any consensus node comprising:
the any consensus node is used for acquiring the merged transaction data from the target block, and performing deserialization processing on each transaction parameter in the merged transaction data so as to analyze and obtain each transaction data in the transaction data set;
the any consensus node is used for verifying each piece of transaction data obtained through analysis, and executing each piece of transaction data after each piece of transaction data is successfully verified, so as to obtain an execution result of each piece of transaction data;
wherein the execution result of the merged transaction data comprises the execution result of each transaction data, and the execution result of one transaction data is an execution sub-result of the merged transaction data.
10. The method of claim 9, wherein any transaction data in the transaction data set includes original transaction data for the any transaction data and a transaction signature for the original transaction data;
The verification processing of the any one of the consensus nodes on the analyzed any one of the transaction data comprises the following steps:
the any consensus node is used for verifying the original transaction data based on the transaction signature;
and after the original transaction data is successfully verified, executing the original transaction data by the any consensus node to obtain an execution result of the any transaction data.
11. The method of claim 9, wherein any transaction data in the transaction data set is initiated by a target transaction client; the method further comprises the steps of:
acquiring an execution result of the merged transaction data and storing the execution result of the merged transaction data;
the method further comprises the steps of:
receiving a query request of an execution result of the any transaction data sent by the target transaction client;
and responding to the query request, extracting the execution result of any transaction data from the stored execution results of the merged transaction data, and returning the extracted execution result to the target transaction client.
12. A transaction processing apparatus of a blockchain network, the apparatus comprising:
The first acquisition module is used for acquiring statistical information of the transaction data set to be processed; the transaction data set is composed of one or more transaction data received and to be processed;
the second acquisition module is used for acquiring the packing condition for the transaction data in the blockchain network;
the merging module is used for merging the transaction data in the transaction data set to obtain merged transaction data if the statistical information meets the packing condition;
and the packaging module is used for packaging the merged transaction data and executing uplink processing on the packaged merged transaction data in the blockchain network.
13. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the method of any of claims 1-11.
14. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1-11.
15. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program adapted to be loaded by a processor and to perform the method of any of claims 1-11.
CN202311327260.5A 2023-10-13 2023-10-13 Transaction processing method, apparatus, product, device and medium of block chain network Pending CN117354255A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311327260.5A CN117354255A (en) 2023-10-13 2023-10-13 Transaction processing method, apparatus, product, device and medium of block chain network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311327260.5A CN117354255A (en) 2023-10-13 2023-10-13 Transaction processing method, apparatus, product, device and medium of block chain network

Publications (1)

Publication Number Publication Date
CN117354255A true CN117354255A (en) 2024-01-05

Family

ID=89370615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311327260.5A Pending CN117354255A (en) 2023-10-13 2023-10-13 Transaction processing method, apparatus, product, device and medium of block chain network

Country Status (1)

Country Link
CN (1) CN117354255A (en)

Similar Documents

Publication Publication Date Title
CN111737724B (en) Data processing method and device, intelligent equipment and storage medium
CN106101258B (en) Interface calling method, device and system of hybrid cloud
US20220271960A1 (en) Blockchain-based data processing method, apparatus, device, and readable storage medium
CN113282603B (en) Block chain consensus node checking method, device, equipment and storage medium
CN110009494B (en) Method and device for monitoring transaction content in block chain
CN111556120A (en) Data processing method and device based on block chain, storage medium and equipment
US20230037932A1 (en) Data processing method and apparatus based on blockchain network, and computer device
CN112308561A (en) Block chain-based evidence storing method and system, computer equipment and storage medium
US20190288833A1 (en) System and Method for Securing Private Keys Behind a Biometric Authentication Gateway
CN112235301A (en) Method and device for verifying access authority and electronic equipment
CN108833500B (en) Service calling method, service providing method, data transmission method and server
CN112417052B (en) Data synchronization method, device, equipment and storage medium in block chain network
CN113987062A (en) Data uplink storage method, system, device and storage medium
CN108882230B (en) Call record management method, device and system
CN113869901B (en) Key generation method, key generation device, computer-readable storage medium and computer equipment
CN117354255A (en) Transaction processing method, apparatus, product, device and medium of block chain network
CN111311412B (en) Decentralized transaction confirmation method and device and server
CN114301912A (en) Information interaction method and device based on block chain
CN116467062A (en) Block chain-based data processing method, equipment and readable storage medium
CN113592638A (en) Transaction request processing method and device and alliance chain
WO2024103856A1 (en) Blockchain-based data processing method, and device and readable storage medium
CN117040929B (en) Access processing method, device, equipment, medium and program product
CN116032494B (en) Data interaction method, blockchain predictor, device and medium
CN117040930B (en) Resource processing method, device, product, equipment and medium of block chain network
CN112203247B (en) Safe storage method and system for electric energy data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication