CN116071160A - Block chain-based transaction implementation method, device and computer readable medium - Google Patents
Block chain-based transaction implementation method, device and computer readable medium Download PDFInfo
- Publication number
- CN116071160A CN116071160A CN202211648493.0A CN202211648493A CN116071160A CN 116071160 A CN116071160 A CN 116071160A CN 202211648493 A CN202211648493 A CN 202211648493A CN 116071160 A CN116071160 A CN 116071160A
- Authority
- CN
- China
- Prior art keywords
- transaction
- transactions
- dependency
- blockchain
- vertex
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9024—Graphs; Linked lists
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0631—Resource planning, allocation, distributing or scheduling for enterprises or organisations
- G06Q10/06312—Adjustment or analysis of established resource schedule, e.g. resource or task levelling, or dynamic rescheduling
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Human Resources & Organizations (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Economics (AREA)
- Strategic Management (AREA)
- Development Economics (AREA)
- General Business, Economics & Management (AREA)
- General Engineering & Computer Science (AREA)
- Marketing (AREA)
- Finance (AREA)
- Accounting & Taxation (AREA)
- Entrepreneurship & Innovation (AREA)
- Software Systems (AREA)
- Educational Administration (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Operations Research (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Game Theory and Decision Science (AREA)
- Technology Law (AREA)
- Data Mining & Analysis (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The method obtains transaction information of each transaction in a block on a block chain node, constructs each transaction into a transaction dependency graph comprising dependency relations among the transactions according to the obtained information, determines and outputs a transaction execution sequence of each transaction according to the transaction dependency graph, and finally dispatches and executes each transaction according to the execution sequence among the transactions represented by the transaction execution sequence. Therefore, the method and the system provide a thought of combining transaction flows such as green certificate transaction and the like with the blockchain, and can fully utilize the advantage characteristics of the blockchain to solve the problems that the traditional centralized green certificate transaction flow is complex, user information is easy to tamper and leak, the verification of the green certificate is time-consuming and labor-consuming, and the certificate record is difficult to trace back; meanwhile, the flow of the blockchain processing green certificate transaction and other transactions is combined with the transaction dependency graph, so that the method can further adapt to the performance requirement of the blockchain in scenes with strong correlation among transactions.
Description
Technical Field
The application belongs to the technical field of blockchain application, and particularly relates to a blockchain-based transaction realization method, a blockchain-based transaction realization device and a computer readable medium.
Background
Renewable energy quota system refers to that governments make mandatory regulations on market share of renewable energy power in the form of laws, regulations and the like, and the renewable energy power is required to contain a certain proportion in the power used by electricity-selling companies or power consumers. The green license transaction system is an important matching system of the quota system, and because the electric power source cannot be distinguished from the physical level, the concept of renewable energy source certificates (green license) is introduced to represent the using amount of renewable energy sources. The government needs to issue green certificates to renewable energy power generation enterprises, the quantity of which corresponds to the online electric quantity of the renewable energy power generation enterprises, and the quota obligation body can prove that the quota target is completed by purchasing the green certificates from the power generation enterprises.
The traditional green card transaction depends on a centralized system, and the identity authentication of a user, the verification of the green card and the transaction of the green card are completed by the centralized system, so that the whole transaction flow is complicated, and transaction data is at risk of being illegally tampered to obtain benefits.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus and a computer readable medium for realizing a transaction based on a blockchain, which solve the problems of complex transaction flow of a traditional centralized green license, easy tampering and leakage of user information, time and effort consumption of the verification of the green license, difficult tracing of a certificate record and the like by combining the transaction flow of the green license transaction and the like with the blockchain, and simultaneously combine the transaction flow of the blockchain for processing the green license transaction and the like with a directed acyclic graph, so as to adapt to the performance requirement of the blockchain in the transaction scene of the green license transaction and the like.
The specific scheme is as follows:
a blockchain-based transaction implementation method, comprising:
acquiring transaction information of each transaction in a block on a block chain node;
constructing each transaction into a transaction dependency graph comprising dependency relations among each transaction according to the transaction information of each transaction; the transaction dependency graph is a directed acyclic graph, the transaction dependency graph comprises a plurality of vertexes and directed edges among the vertexes, the vertexes in the transaction dependency graph represent corresponding transactions, and the directed edges among the vertexes represent dependency relations among the transactions;
determining and outputting a transaction execution sequence of each transaction according to the transaction dependency graph;
And scheduling and executing each transaction according to the execution sequence among the transactions represented by the output transaction execution sequence.
Optionally, according to the transaction information of each transaction, each transaction is configured into a transaction dependency graph including dependency relationships between each transaction, including:
according to the transaction information of each transaction, carrying out dependency identification between any two transactions in each transaction;
constructing a transaction dependency graph corresponding to each transaction according to the dependency relationship identification result among the transactions;
the directed edge of the first vertex points to the second vertex in the transaction dependency graph, which indicates that the transaction represented by the second vertex has dependency on the transaction represented by the first vertex.
Optionally, determining and outputting a transaction execution sequence of each transaction according to the transaction dependency graph, and performing scheduling execution on each transaction according to an execution sequence between transactions represented by the output transaction execution sequence, where the scheduling execution includes:
determining and outputting a transaction execution sequence which can be used for indicating that the transactions with the dependency relationship are executed in series and the transactions without the dependency relationship are executed in parallel according to the transaction dependency graph;
And according to the transaction execution sequence, scheduling and executing the transactions with the dependency relationship in each transaction in a serial mode, and scheduling and executing the transactions without the dependency relationship in a parallel mode.
Optionally, the determining and outputting the transaction execution sequence of each transaction according to the transaction dependency graph, and performing scheduling execution on each transaction according to the output transaction execution sequence, including:
determining the degree of incidence of each vertex which does not realize transaction scheduling in the transaction dependency graph;
outputting each target vertex of which the determined current input degree meets the preset input degree condition;
the transaction represented by each target vertex with the current income meeting the preset income condition is submitted to a plurality of working threads to be executed in parallel;
after the transaction represented by each current target vertex is executed, eliminating the directed edge of each current target vertex directed to the subsequent node, subtracting 1 from the incidence of the corresponding subsequent vertex pointed by each current target vertex, and returning to the step of determining the incidence of each vertex which does not realize transaction scheduling in the transaction dependency graph, so as to circularly execute the processing procedures, and serially executing the target vertices with dependency relations in the target vertices output by the processing procedures of different rounds until the transaction represented by each vertex in the transaction dependency graph is executed;
Wherein the transaction execution sequence comprises: and in the process of circularly executing the processing, the input degree sequentially output by the processing processes of different rounds meets the transaction respectively represented by each target vertex of the preset input degree condition.
Optionally, the transaction is a green certificate transaction;
the blockchain network corresponding to the blockchain is as follows: the green certificate transaction blockchain network is constructed by taking all participants in the green certificate issuing and transaction process as blockchain main bodies; the method further comprises the following steps before the transaction information of each transaction in the block on the block chain node is acquired:
a block of transaction information including each green license transaction broadcast by a predetermined node in the blockchain network is received.
Optionally, intelligent contracts for realizing corresponding business processes of green certificate transaction are embedded in the blockchain nodes;
the method further comprises the steps of:
and calling a corresponding intelligent contract in the execution process of the green card transaction, and storing the business data related to the green card transaction on the blockchain node.
Optionally, the smart contracts include a user contract and a green license contract;
the user contract is used for finishing the registration uplink of the user identity and the checking and checking of the user identity information, and the green card contract is used for finishing the verification and the transfer of the green card.
A blockchain-based transaction implementation device, comprising:
the transaction acquisition unit is used for acquiring transaction information of each transaction in the block on the blockchain node;
a transaction dependency graph construction unit configured to construct each transaction into a transaction dependency graph including dependency relationships between each transaction according to the transaction information of each transaction; the transaction dependency graph comprises a plurality of vertexes and directed edges among the vertexes, wherein the vertexes in the transaction dependency graph represent corresponding transactions, and the directed edges among the vertexes represent dependency relations among the transactions;
and the transaction scheduling unit is used for determining and outputting the transaction execution sequence of each transaction according to the transaction dependency graph, and scheduling and executing each transaction according to the execution sequence among the transactions represented by the output transaction execution sequence.
Optionally, the transaction dependency graph construction unit is specifically configured to:
according to the transaction information of each transaction, carrying out dependency identification between any two transactions in each transaction;
constructing a transaction dependency graph corresponding to each transaction according to the dependency relationship identification result among the transactions;
The directed edge of the first vertex points to the second vertex in the transaction dependency graph, which indicates that the transaction represented by the second vertex has dependency on the transaction represented by the first vertex.
A computer readable medium having stored thereon a computer program comprising program code for performing the method of any of the above.
According to the scheme, the method, the device and the computer readable medium for realizing the transaction based on the blockchain acquire the transaction information of each transaction in the block on the blockchain node, construct each transaction into a transaction dependency graph (directed acyclic graph) comprising the dependency relationship among each transaction according to the transaction information of each transaction, determine and output a transaction execution sequence of each transaction according to the transaction dependency graph, and finally schedule and execute each transaction according to the execution sequence among the transactions represented by the output transaction execution sequence. Therefore, the method and the system provide a thought of combining transaction flows such as green certificate transaction and the like with the blockchain, and can fully utilize the advantage characteristics of the blockchain to solve the problems that the traditional centralized green certificate transaction flow is complex, user information is easy to tamper and leak, the verification of the green certificate is time-consuming and labor-consuming, and the certificate record is difficult to trace back; meanwhile, the green card transaction belongs to one of transactions with strong inter-transaction relevance, and the method and the device can further adapt to the performance requirement of the scene with strong inter-transaction relevance, such as the green card transaction, on the blockchain by combining the flow of processing the transactions, such as the green card transaction, with the directed acyclic graph.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow chart of a blockchain-based transaction implementation method provided herein;
FIG. 2 is another flow chart of a blockchain-based transaction implementation method provided herein;
FIG. 3 is a block chain based green certificate transaction overall logic framework provided herein;
FIG. 4 is an exemplary detailed workflow provided herein for processing green license transactions to enable transaction scheduling execution;
FIGS. 5 (a) -5 (g) are one example of a DAG construction process provided herein;
6 (a) -6 (d) are one example of outputting a transaction execution sequence according to the generated directed acyclic graph provided herein;
fig. 7 is a block chain-based transaction implementation device component block diagram provided herein.
Detailed Description
For reference or clarity, related art terms, abbreviations or nouns referred to in the embodiments of the present application are first explained as follows:
blockchain: the blockchain is a novel application mode of computer technologies such as distributed data storage, P2P network, consensus mechanism, encryption algorithm, intelligent contract and the like, and has the characteristics of decentralization, collective maintenance, programmability, incapability of tampering, safety, reliability, traceability and the like.
DAG Directed Acyclic Graph, directed acyclic graph.
MVCC Multi-Version Concurrency Control, i.e., multi-version concurrency control.
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 without undue burden from the present disclosure, are within the scope of the present disclosure.
The method mainly uses green card transaction as an example, firstly combines the green card transaction flow with the blockchain, and solves the problems that the traditional centralized green card transaction flow is complex, user information is easy to tamper and leak, the verification of the green card is time-consuming and labor-consuming, and the certificate record is not easy to trace back by utilizing the advantage characteristic of the blockchain.
Blockchain networks are typically composed of multiple nodes, each storing a copy of the complete data. The transaction execution is essentially that each node calculates based on the local data copy, meanwhile, the consistency of the calculation results of each node needs to be ensured, when the calculation results of each node agree, each node updates the local data copy, and only then the data copy maintained by each node can be ensured to be always the same. The transaction on the chain of the blockchain is completed by calling an intelligent contract, the intelligent contract can be regarded as an independent application program, the intelligent contract is communicated with a blockchain node through a network, the execution of the transaction on the chain is accompanied by a large amount of network I/O, disk I/O and calculation tasks related to the use of a CPU, the execution process is extremely time-consuming, the traditional blockchain system adopts a serial mode to execute the transaction in order to ensure the consistency of data copies, the serial execution efficiency is lower, the calculation processing capacity of the multi-core of the CPU of a modern computer cannot be fully utilized, for example, a 6-core CPU only has 1 core working in a serial execution mode, and meanwhile, the waste of system resources is also caused. Under the environment of green certificate transaction, a certain requirement is provided for the execution efficiency of the transaction, and the conventional serial execution mode of the blockchain cannot meet the requirement of the execution efficiency.
The representative item Hyperledger Fabric in the federation chain adopts an MVCC-based transaction concurrency execution policy, and although the transactions can be executed concurrently, in a scenario with a large inter-transaction relevance, only the first transaction of a plurality of modified transactions with the same data in the same block can succeed due to the optimistic concurrency control mechanism, and the rest of the transactions can be marked as failures, so that the applicant researches find that the failures of the transactions are not caused by the judgment of a business logic layer of the applicant but caused by the mechanism inside the blockchain item, and the failed transactions need to be retried by the business layer, and also can cause performance degradation, processing efficiency degradation, and green certificate transactions belong to one of cases with the large inter-transaction relevance. In summary, the current blockchain is difficult to meet the performance requirements in the green license transaction scenario.
Based on the method, the flow of processing the green card transaction by the blockchain is further combined with the directed acyclic graph, so that the method is suitable for the performance requirement of the blockchain by transaction scenes with strong correlation among the green card transaction and other transactions.
In combination with the above research, the application provides a blockchain-based transaction implementation method, a blockchain-based transaction implementation device and a computer readable medium, and optionally, the related transactions may be transactions with a certain requirement on the execution efficiency of the transactions, such as green certificate transactions, and the relationship between the transactions is strong.
The method and the device combine the transaction flow of green card transaction and the like with the blockchain and the directed acyclic graph, and mainly relate to the writing of related intelligent contracts required when the transaction flow of green card transaction and the like is migrated to the blockchain and the adaptation of the optimization of the performance of the bottom layer of the blockchain.
The system comprises a green certificate issuing and trading process, a green certificate managing and managing system, a green certificate managing system, a power grid company and a government district related organization, wherein each participant in the green certificate issuing and trading process is taken as a main body in advance to jointly construct a green certificate trading blockchain network, for example, a green certificate supervising mechanism, a power grid company and a government district related organization are taken as main bodies to jointly construct the green certificate trading blockchain network, and the blockchain network links each participant in the green certificate issuing and trading process in a distributed mode to construct an equal and mutually trusted environment. And developing corresponding intelligent contracts in advance to transfer the business process of the green card transaction to the blockchain or complement and perfect the original business process by using the intelligent contracts.
Aiming at green certificate transaction, intelligent contracts to be realized mainly comprise two types of user contracts and green certificate contracts.
The two types of contracts are as follows:
user contracts
The method is mainly used for finishing the registration uplink of the user identity and the checking and checking of the user identity information.
The market main body can register the user identity through taking the corresponding management platform (such as each provincial management platform) as an entrance, each management platform firstly examines the qualification of the market main body, and the renewable energy suppliers also need to confirm that the market main body has renewable power generation capability so as to ensure the order of the green card market and the legitimacy of the green card circulation from the source. The public and private key pairs are distributed by the platform through the audited user, the private key is stored by the user, and the public key is shared anonymously by the uplink of each management platform (such as each provincial management platform). The subsequent user employs a private key signature when performing a green license transaction-related operation, such as initiating a transfer of a green license, to ensure that the operation is initiated by a legitimate party and is not repudiated.
(II) Green syndrome contract
The method is mainly used for completing the nuclear development of the green syndrome and the transfer of the green syndrome.
Nuclear onset of green syndrome: a market subject user (e.g., a renewable energy provider) through registration auditing may install or upgrade a smart meter by a grid company. On the basis, users such as suppliers can apply for the verification of green certificates, the power grid company measures the actual online renewable energy electric quantity so as to generate equivalent green certificates according to set conversion standards (for example, 1MW h corresponds to the conversion standard of one green certificate), specifically, the result measured by the power grid company is transmitted to a green certificate auditing mechanism for auditing and checking, and after the verification, the green certificates are generated by the green certificate auditing mechanism, wherein each green certificate at least comprises information such as auditing mechanism numbers, supplier numbers, green certificate attribution numbers, energy types (wind power/photovoltaic and the like), verification time and the like. The green certificate's auditing mechanism will invoke the smart contract to deposit the green certificate into the vendor's account.
Transfer of green evidence: the transfer of green certificates adopts an in-field trading mechanism. Sellers and buyers of green certificates can hang up and pick up cards on a transaction platform. The seller of the green certificate discloses the selling intention of the green certificate on the transaction platform, and the selling intention comprises information such as selling unit price, selling quantity and the like of the green certificate. The buyer of the green card can acquire the latest market dynamics through the transaction platform, a proper green card seller is selected for transaction negotiation, when the buyer and the seller agree on the transaction quantity and the transaction unit price, the green card buyer gives the pre-paid money to the transaction platform, and when the green card seller calls the intelligent contract to finish the transfer of the green card, the transaction platform gives the transaction money to the green card seller. The data to be recorded for each green license transfer includes, but is not limited to, seller number, buyer number, green license number, transaction price, transaction time, etc.
The adaptation of the blockchain underlying performance optimization mainly includes two aspects of transaction dependency graph construction and scheduling of transaction tasks. The method comprises the following steps:
transaction dependency graph construction: according to the association relation between the transactions such as green card transactions, a batch of transactions in the block are organized into a directed acyclic graph. Each transaction within a block may be considered a vertex in the graph (or "node" of the graph), with the edges between the vertices representing the relationship between the two transactions.
And (3) transaction task scheduling: and scheduling the transaction according to the directed acyclic graph constructed by the intra-block transaction and executing the transaction. If there is an association between two transactions, then they are executed serially, and if there is no association between two transactions, then they are executed concurrently. Optionally, this process uses the idea of the topological ordering algorithm of the graph to ensure that all of its predecessor transactions have been performed when a certain transaction is performed.
On this basis, referring to the flowchart of the blockchain-based transaction implementation method shown in fig. 1, the blockchain-based transaction implementation method provided in the application at least includes the following processing steps:
Referring to fig. 1, an example of a blockchain infrastructure transaction structure is provided, which is a typical structure of transaction information in a blockchain, and the structure is a general structure, as shown in fig. 1, the transaction infrastructure information includes, but is not limited to, information such as a transaction initiator (Sender), a called contract name (callcontact name), a called contract method (callcontact method), a contract calling parameter (callars), a Signature (Signature) of the transaction initiator on the transaction, and other related transaction information of both sides of the transaction, such as a green certificate seller, a green certificate buyer, a green certificate transaction quantity, and the like.
Table 1 blockchain transaction structure
When executing transaction, the blockchain can locate a specific intelligent contract and a specific contract method according to a contract name (CallContractName), a called contract method (CallContractmethod) and a contract call parameter (CallArgs), and then give the specific contract call parameter, so that the call of the contract method is completed to bear different business logics. For example, callcontrolname=proof and callcontrolmethod=store Proof can be located to the method for storing the certificate contract, then the method is given the parameters CallArgs required for calling, and the store Proof can be called to complete the business logic of the certificate.
For green certificate transactions, the blockchain network corresponding to the blockchain may be: a green certificate transaction blockchain network is constructed by taking all participants in the green certificate issuing and transaction process as blockchain bodies.
The method may further include, before step 101: a block of transaction information including each green license transaction broadcast by a predetermined node in the blockchain network is received.
The preset node may be a leader node selected from the block link points based on a consensus algorithm.
In the application, transaction processing on a chain in a blockchain network takes a block as a unit, a common algorithm selects a transaction from a leader node selected from block chain link points, packages the selected transaction into a block and broadcasts the block to other nodes of the blockchain network, and nodes in the blockchain network (namely, blockchain nodes) process the transaction locally after receiving the block.
When each block is received to process the transaction locally, the blockchain node firstly obtains the transaction information of each transaction in the block, such as transaction ID, green certificate seller, green certificate buyer, green certificate transaction quantity and the like.
102, constructing each transaction into a corresponding transaction dependency graph according to the transaction information of each transaction; the transaction dependency graph is a directed acyclic graph, the transaction dependency graph comprises a plurality of vertexes and directed edges between the vertexes, the vertexes in the transaction dependency graph represent corresponding transactions, and the directed edges between the vertexes represent dependency relationships between the transactions.
And then, carrying out dependency recognition between any two transactions in each transaction according to the transaction information of each transaction in the block, and constructing a transaction dependency graph in a DAG form corresponding to each transaction according to the dependency recognition result between each transaction. Therefore, the block chain is used for processing the transaction flow of the green card transaction and the like and is combined with the directed acyclic graph, and the directed acyclic graph is used for describing the association relationship between the green card transactions.
The directed edge of the vertex x pointing to the vertex y indicates that the transaction represented by the vertex y must be executed after the transaction represented by the vertex x is completed, so that the directed edge also represents the execution sequence of the two connected vertices.
And 103, determining and outputting a transaction execution sequence of each transaction according to the transaction dependency graph.
On the basis, according to the transaction dependency graph, a transaction execution sequence for each transaction is determined and output. The transaction execution sequence aims at indicating that related transactions in the block are executed in series and unassociated transactions are executed in parallel/concurrently, so that the correctness of the transaction execution result is ensured, a certain concurrency is realized, the computing processing capacity of a CPU (central processing unit) of a modern computer is fully utilized, the efficiency of transaction processing is improved, and the performance requirement on a blockchain under a green certificate transaction scene is met.
And 104, scheduling and executing each transaction according to the execution sequence among the transactions represented by the output transaction execution sequence.
Correspondingly, the transactions with the dependency relationship in each transaction in the block can be scheduled and executed in a serial mode, and the transactions without the dependency relationship are scheduled and executed in a parallel mode according to the output transaction execution sequence.
The following provides a specific embodiment of steps 103-104, referring to fig. 2, and the following processes may specifically implement steps 103-104 to determine and output a transaction execution sequence of each transaction according to the transaction dependency graph, and schedule execution of each transaction according to the output transaction execution sequence:
11 Determining the degree of incidence of each vertex which does not realize transaction scheduling in the transaction dependency graph;
12 Outputting each target vertex of which the determined current input degree meets the preset input degree condition;
wherein, the preset entering degree condition can be set as follows: the degree of vertex penetration is 0.
An ingress of a vertex of 0 indicates that the transaction represented by that vertex is currently complete with respect to other transactions, or that the transaction represented by that vertex is independent of any other transactions.
13 The transaction represented by each target vertex with the current income meeting the preset income degree condition is submitted to a plurality of working threads to be executed in parallel;
14 After the transaction represented by each current target vertex is executed, eliminating the directed edge of each current target vertex directed to the subsequent node, subtracting 1 from the incoming degree of the corresponding subsequent vertex directed by each current target vertex, returning to the step 11), circularly executing the processing procedures, and enabling the target vertices with the dependency relationship in the target vertices output by the processing procedures of different rounds to be executed in series by circularly executing the processing procedures until the transaction represented by each vertex in the transaction dependency graph is executed.
Wherein the transaction execution sequence comprises: in the process of circularly executing the processing, the processing processes of different rounds sequentially output transactions respectively represented by each target vertex of which the input degree meets the preset input degree condition
According to the embodiment, the vertex with the input degree of 0 is continuously output, transactions represented by the vertices with the input degree of 0 in the same batch and output by the same time sequence point (namely, output by the processing process of the same round) are scheduled and executed in a parallel/concurrent mode, transactions represented by the vertices with the input degree of 0 in different batches and output by different time sequence points are executed in time sequence, parallel/concurrent execution of the non-associated transactions in the block is realized, the associated transactions are executed in series, the correctness of the transaction execution result can be ensured, and certain concurrency can be ensured.
According to the above scheme, the method for realizing the transaction based on the blockchain obtains the transaction information of each transaction in the block on the blockchain node, constructs each transaction into a transaction dependency graph (directed acyclic graph) comprising the dependency relationship among each transaction according to the transaction information of each transaction, determines and outputs the transaction execution sequence of each transaction according to the transaction dependency graph, and finally performs scheduling execution on each transaction according to the execution sequence among the transactions represented by the output transaction execution sequence. Therefore, the method and the system provide a thought of combining transaction flows such as green certificate transaction and the like with the blockchain, and can fully utilize the advantage characteristics of the blockchain to solve the problems that the traditional centralized green certificate transaction flow is complex, user information is easy to tamper and leak, the verification of the green certificate is time-consuming and labor-consuming, and the certificate record is difficult to trace back; meanwhile, the green card transaction belongs to one of transactions with strong inter-transaction relevance, and the method and the device can further adapt to the performance requirement of the scene with strong inter-transaction relevance, such as the green card transaction, on the blockchain by combining the flow of processing the transactions, such as the green card transaction, with the directed acyclic graph.
Optionally, in an embodiment, an intelligent contract for implementing a corresponding business process of the green certificate transaction is embedded on a blockchain node of the blockchain network. Referring to the flowchart of the blockchain-based transaction implementation method shown in fig. 2, the blockchain-based transaction implementation method disclosed in the present application may further include the following processes:
For green card transaction, as described above, the intelligent contracts mainly include two types of user contracts and green card contracts, wherein the user contracts are mainly used for finishing the registration uplink of user identity and the checking and checking of user identity information, and the green card contracts are mainly used for finishing the verification and the transfer of green cards.
Accordingly, in the execution process of the green card transaction, the corresponding intelligent contract is called to store the service data corresponding to the green card transaction into the blockchain node, which can include, but is not limited to, calling the user contract to perform identity registration uplink or user identity information checking and verification according to the requirement, storing the related identity registration information or verification information and the like into the blockchain node, calling the green card contract to perform green card verification, green card transfer and the like, and storing the related data such as green card verification, green card transfer and the like into the blockchain node, so that the effective migration and adaptation of the service flow of the green card transaction to the blockchain are realized.
An example of an application of the method of the present application is provided further below.
The example mainly relates to the compiling of related intelligent contracts required by the green card transaction process when migrating to a blockchain and the adapting of the bottom performance optimization of the blockchain, and is shown in fig. 3, which is a blockchain-based green card transaction integral logic framework (a dotted line frame part is a core improvement part provided by the scheme of the application in the figure), wherein, for the compiling of the required intelligent contracts, two types of intelligent contracts (namely, a right dotted line frame part in the figure) of a user contract and a green card contract are mainly realized, the logic/functions of the two types of intelligent contracts are respectively described in the above description, and a method of the intelligent contract is called in the transaction executing process to store specific business data on the blockchain, such as the identity registration of the user contract, the green card verification of the green card contract, the transfer of the green card and the like.
Aiming at the adaptation of the block chain bottom layer performance optimization, a block chain node software is newly added with a DAG module (namely a broken line frame part on the left side in the figure), the DAG module is responsible for receiving a block transmitted by a block execution module, constructing transactions in the block into DAGs, and delivering the DAGs to a transaction execution thread pool for scheduling execution, and meanwhile, the DAG module records results generated by all transaction execution, returns the results to the block execution module, and submits data to an account book by the block execution module.
In this example, referring to FIG. 3, the adaptation of the blockchain underlying performance optimization is achieved by further dividing the DAG module into two sub-modules, a transaction dependency graph construct and a transaction task scheduler, wherein:
and the transaction dependency graph construction submodule is used for organizing a batch of transactions in the block into a directed acyclic graph according to the association relation between green certificate transactions. Each transaction within a block may be considered a vertex in the graph, with the vertex-to-vertex edge representing an associative relationship between the two transactions.
And the transaction task scheduling sub-module is used for scheduling and executing the transaction according to the directed acyclic graph constructed for the intra-block transaction. If there is an association between two transactions, they are executed serially, if there is no association between two transactions, they are executed in parallel, and the process can use the idea of topological ordering algorithm of the graph to ensure that all the preceding transactions have been executed when executing a certain transaction.
When green card transaction is processed to realize the scheduling execution of the transaction, transaction information in a block is read based on the corresponding sub-modules in the two sub-modules, the dependence of the transaction is identified, the association relationship between the transactions is identified based on the dependence of the transaction, the transaction is constructed into a transaction dependence graph (DAG graph), finally a transaction execution sequence is output through the graph, and the scheduling of the transaction is performed in parallel or in series, wherein the basic workflow is shown in fig. 4, and the workflow is further described in detail below.
Referring in conjunction with FIG. 4, one exemplary detailed workflow for processing a green certificate transaction to effect transaction scheduling execution in this example is as follows:
21 Initializing a task queue and working threads with the same number of CPU cores, wherein the working threads continuously acquire transactions from the task queue for processing, and the transactions in the task queue are in one-to-one correspondence with the transactions in the block, and have the same structural information. In the initial state, the task queue is empty, and the working threads are in a blocking state.
22 Identifying dependencies between transactions within the block, constructing the transactions within the block as DAGs.
As in the example shown in fig. 5 (a), the transactions are first removed from the block, each representing a green certificate transfer process, and each transaction is initially considered as a node in the two-dimensional plane.
With continued reference to the DAG construction process schematic diagrams provided in fig. 5 (b) -5 (g), the transactions in the block have a certain order, each transaction is sequentially read according to the transaction order, and the dependent items of the transaction, namely, the green certificate buyer and seller, are extracted. If two transactions have the same dependent item or the dependent item has an intersection, the nodes corresponding to the two transactions are connected by a directed edge, taking fig. 5 (d) as an example, both transaction 1 and transaction 3 modify the user a, that is, the dependent item of transaction 1 and the dependent item of transaction 3 have an intersection, and the two transactions are related to each other, a directed edge pointing from the node 1 to the node 3 is added. Taking fig. 5 (e) again as an example, transaction 4 modifies user B and user C, user B has been modified by transaction 1 before and user C has been modified by transaction 3 before, so that a directed edge from node 1 to node 4 is added between node 1 and node 4, and a directed edge from node 3 to node 4 is added between node 3 and node 4. The directed edge of the node x pointing to the node y indicates that the transaction represented by the node y must wait for the transaction represented by the node x to be executed after the execution is completed, i.e., the directed edge indicates the execution sequence of the two connected nodes.
And repeating the process, and forming a directed acyclic graph by the dependency relationship of the nodes in the plane in the step 2) when the transaction in the block is read.
23 Outputting a transaction execution sequence according to the generated directed acyclic graph to perform serial/parallel scheduling execution on the transaction according to the transaction execution sequence.
Specifically, as shown in fig. 6 (a) -6 (d), when a transaction execution sequence is output according to the generated directed acyclic graph, firstly, calculating the degree of incidence of each vertex/node in the directed acyclic graph, which does not realize scheduling execution currently, according to the directed acyclic graph, then continuously outputting the vertex/node with the degree of incidence of 0, directly executing transactions represented by the vertices/nodes in the same batch output by the same time sequence node in parallel without depending on other transactions, correspondingly throwing the transactions to a task queue, waking up a working thread to conduct transaction processing in a parallel mode, after the transaction execution is finished, eliminating the directed edge of the node to the subsequent node, subtracting 1 from the degree of incidence of the subsequent node, generating a node with the degree of incidence of 0 in a new round, and repeating the process until the transaction execution is finished.
Conventional blockchains employ a mode of serial execution to process transactions within a block, serial execution meaning that only one transaction processing thread is in operation and each transaction is processed sequentially. A transaction processing thread uses at most one core of a host CPU where the block link point is located, and a modern computer CPU is generally multi-core, so that CPU resources of the host where the block link point is located are not fully utilized, and in addition, the serial transaction processing efficiency is low. If the transaction processing capability of a blockchain node is to be enhanced by enhancing the host configuration is greatly limited, at least increasing the number of CPU cores cannot enhance the transaction processing capability.
Applicant research has found that the reason why the conventional blockchain employs serial execution is to solve the uncertainty that may be caused by concurrently executing transactions under multiple nodes. For example, in a transfer scenario, user A initiates two transfer transactions simultaneously, transaction 1: user a transfers 20 to user B; transaction 2: user a transfers 30 to user C. If the balance of user a is only 30, this means that only one of the two transfer transactions is successful, the other will fail because of the insufficient balance of user a. In the case of blockchain multiple nodes, concurrent execution may result in two execution orders of transaction 1, transaction 2 and transaction 2, transaction 1, meaning that transaction 1 is successful on some nodes and transaction 2 is successful on other nodes, which may cause data inconsistencies for each node. In the other case, user A and user B initiate two transfer transactions simultaneously, transaction 1: user a transfers 20 to user C, transaction 2: user B transfers 30 to user D, in which case consistent results occur whether performed in the order of transaction 1, transaction 2, or transaction 2, transaction 1. Based on the two cases, it can be known that in the case of correlation between transactions, serial execution is required according to the sequence, so as to avoid uncertainty of execution results caused by concurrent execution; and in the case of no correlation between transactions, concurrent execution may be performed, where serial execution and concurrent execution can always produce the same execution result.
Based on the research, the transaction is organized into the directed acyclic graph by identifying the association relation between the transactions, if the two transactions are associated, a directed edge is added between the two transactions, and finally the order of transaction execution is output through the directed acyclic graph, so that the associated transactions are executed in series, the uncertainty caused by the concurrent execution of the associated transactions is eliminated, the concurrent execution of the unassociated transactions is realized, the multi-core processing capability of a CPU (central processing unit) of a modern computer can be fully utilized, the concept is applied to transaction scenes with requirements on the execution efficiency of the transactions such as green card transactions and strong association between the transactions, and the performance requirements of the blockchain of the transaction scenes such as the green card transactions can be effectively adapted.
Corresponding to the above-mentioned transaction implementation method based on the blockchain, the embodiment of the application also discloses a transaction implementation device based on the blockchain, where the composition structure of the device is shown in fig. 7, and the device includes:
a transaction obtaining unit 701, configured to obtain transaction information of each transaction in a block on a blockchain node;
a transaction dependency graph construction unit 702, configured to construct each transaction into a transaction dependency graph including dependency relationships among each transaction according to the transaction information of each transaction; the transaction dependency graph comprises a plurality of vertexes and directed edges among the vertexes, wherein the vertexes in the transaction dependency graph represent corresponding transactions, and the directed edges among the vertexes represent dependency relations among the transactions;
A transaction scheduling unit 703, configured to determine and output a transaction execution sequence of each transaction according to the transaction dependency graph, and schedule execution of each transaction according to an execution order among transactions represented by the output transaction execution sequence.
In one embodiment, the transaction dependency graph construction unit 702 is specifically configured to:
according to the transaction information of each transaction, carrying out dependency identification between any two transactions in each transaction;
constructing a transaction dependency graph corresponding to each transaction according to the dependency relationship identification result among the transactions;
the directed edge of the first vertex points to the second vertex in the transaction dependency graph, which indicates that the transaction represented by the second vertex has dependency on the transaction represented by the first vertex.
In one embodiment, the transaction scheduling unit 703 is specifically configured to:
determining and outputting a transaction execution sequence which can be used for indicating that the transactions with the dependency relationship are executed in series and the transactions without the dependency relationship are executed in parallel according to the transaction dependency graph;
and according to the transaction execution sequence, scheduling and executing the transactions with the dependency relationship in each transaction in a serial mode, and scheduling and executing the transactions without the dependency relationship in a parallel mode.
In one embodiment, the transaction scheduling unit 703 is specifically configured to:
determining the degree of incidence of each vertex which does not realize transaction scheduling in the transaction dependency graph;
outputting each target vertex of which the determined current input degree meets the preset input degree condition;
the transaction represented by each target vertex with the current degree meeting the preset degree condition is submitted to a plurality of working threads to be executed in parallel;
after the transaction represented by each current target vertex is executed, eliminating the directed edge of each current target vertex directed to the subsequent node, subtracting 1 from the incidence of the corresponding subsequent vertex pointed by each current target vertex, and returning to the step of determining the incidence of each vertex which does not realize transaction scheduling in the transaction dependency graph, so as to circularly execute the processing procedures, and serially executing the target vertices with dependency relations in the target vertices output by the processing procedures of different rounds until the transaction represented by each vertex in the transaction dependency graph is executed;
wherein the transaction execution sequence comprises: and in the process of circularly executing the processing, the input degree sequentially output by the processing processes of different rounds meets the transaction respectively represented by each target vertex of the preset input degree condition.
In one embodiment, the transaction is a green certificate transaction;
the blockchain network corresponding to the blockchain is as follows: the green certificate transaction blockchain network is constructed by taking all participants in the green certificate issuing and transaction process as blockchain main bodies;
the device further comprises: and the block receiving unit is used for receiving the block which is broadcasted by a preset node in the blockchain network and comprises the transaction information of each green certificate transaction before the transaction information of each transaction in the block on the blockchain node is acquired.
In one embodiment, the blockchain node is embedded with an intelligent contract for realizing a corresponding business flow of green certificate transaction;
the device also comprises a contract calling unit for calling the corresponding intelligent contract in the execution process of the green card transaction and storing the business data related to the green card transaction on the blockchain node.
In one embodiment, the smart contracts include user contracts and green license contracts;
the user contract is used for finishing the registration uplink of the user identity and the checking and checking of the user identity information, and the green card contract is used for finishing the verification and the transfer of the green card.
The blockchain-based transaction implementation device disclosed in the embodiments of the present application corresponds to the blockchain-based transaction implementation method disclosed in the embodiments of the method, so that the description is relatively simple, and regarding the similarity, please refer to the description of the embodiments of the method above, and details thereof will not be described.
In addition, the present application also provides a computer readable medium having stored thereon a computer program comprising program code for performing a blockchain-based transaction implementation method as disclosed in any of the method embodiments above.
In the context of this application, a computer-readable medium (machine-readable medium) can be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be embodied in an electronic device; or may exist alone without being assembled into an electronic device.
In summary, the method, the device and the computer readable medium for implementing the transaction based on the blockchain disclosed in the embodiments of the present application have at least the following technical advantages compared with the prior art:
a) The method combines the green card transaction flow and the blockchain, provides a set of realization mode of related intelligent contracts under the green card scene, and solves the problems that the traditional centralized green card transaction flow is complex, user information is easy to tamper and leak, the verification of the green card is time-consuming and labor-consuming, and the certificate record is not easy to trace back by utilizing the advantage characteristics of the blockchain.
b) The method combines the flow of processing the green card transaction by the blockchain with the directed acyclic graph, describes the association relation between the green card transactions by using the directed acyclic graph, outputs a transaction execution sequence by combining the directed acyclic graph and the topology ordering idea, and schedules and executes the transactions in parallel or in series, thereby effectively improving the system throughput of the blockchain and being capable of adapting to the performance requirements of the blockchain in the green card transaction scene.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
For convenience of description, the above system or apparatus is described as being functionally divided into various modules or units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
From the above description of embodiments, it will be apparent to those skilled in the art that the present application may be implemented in software plus a necessary general purpose hardware platform. Based on such understanding, the technical solutions of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in the embodiments or some parts of the embodiments of the present application.
Finally, it is further noted that relational terms such as first, second, third, fourth, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.
Claims (10)
1. A blockchain-based transaction implementation method, comprising:
acquiring transaction information of each transaction in a block on a block chain node;
constructing each transaction into a transaction dependency graph comprising dependency relations among each transaction according to the transaction information of each transaction; the transaction dependency graph is a directed acyclic graph, the transaction dependency graph comprises a plurality of vertexes and directed edges among the vertexes, the vertexes in the transaction dependency graph represent corresponding transactions, and the directed edges among the vertexes represent dependency relations among the transactions;
determining and outputting a transaction execution sequence of each transaction according to the transaction dependency graph;
and scheduling and executing each transaction according to the execution sequence among the transactions represented by the output transaction execution sequence.
2. The method of claim 1, wherein constructing each transaction into a transaction dependency graph including dependencies between each transaction based on transaction information of each transaction, comprises:
According to the transaction information of each transaction, carrying out dependency identification between any two transactions in each transaction;
constructing a transaction dependency graph corresponding to each transaction according to the dependency relationship identification result among the transactions;
the directed edge of the first vertex points to the second vertex in the transaction dependency graph, which indicates that the transaction represented by the second vertex has dependency on the transaction represented by the first vertex.
3. The method of claim 1, wherein determining and outputting the transaction execution sequence for each transaction from the transaction dependency graph, scheduling execution of each transaction in an execution order between transactions characterized by the output transaction execution sequence, comprises:
determining and outputting a transaction execution sequence which can be used for indicating the serial execution sequence of the transaction with the dependency relationship and the parallel execution of the transaction without the dependency relationship according to the transaction dependency graph;
and according to the transaction execution sequence, scheduling and executing the transactions with the dependency relationship in each transaction in a serial mode, and scheduling and executing the transactions without the dependency relationship in a parallel mode.
4. The method of claim 1, wherein determining and outputting the transaction execution sequence for each transaction based on the transaction dependency graph, scheduling execution of each transaction according to the output transaction execution sequence, comprises:
Determining the degree of incidence of each vertex which does not realize transaction scheduling in the transaction dependency graph;
outputting each target vertex of which the determined current input degree meets the preset input degree condition;
the transaction represented by each target vertex with the current degree meeting the preset degree condition is submitted to a plurality of working threads to be executed in parallel;
after the transaction represented by each current target vertex is executed, eliminating the directed edge of each current target vertex directed to the subsequent node, subtracting 1 from the incidence of the corresponding subsequent vertex pointed by each current target vertex, and returning to the step of determining the incidence of each vertex which does not realize transaction scheduling in the transaction dependency graph, so as to circularly execute the processing procedures, and serially executing the target vertices with dependency relations in the target vertices output by the processing procedures of different rounds until the transaction represented by each vertex in the transaction dependency graph is executed;
wherein the transaction execution sequence comprises: and in the process of circularly executing the processing, the input degree sequentially output by the processing processes of different rounds meets the transaction respectively represented by each target vertex of the preset input degree condition.
5. The method of claim 1, wherein the transaction is a green certificate transaction;
the blockchain network corresponding to the blockchain is as follows: the green certificate transaction blockchain network is constructed by taking all participants in the green certificate issuing and transaction process as blockchain main bodies; the method further comprises the following steps before the transaction information of each transaction in the block on the block chain node is acquired:
a block of transaction information including each green license transaction broadcast by a predetermined node in the blockchain network is received.
6. The method of claim 5, wherein intelligent contracts for realizing corresponding business processes of green certificate transaction are embedded on the blockchain nodes;
the method further comprises the steps of:
and calling a corresponding intelligent contract in the execution process of the green card transaction, and storing the business data related to the green card transaction on the blockchain node.
7. The method of claim 6, wherein the smart contracts include a user contract and a green license contract;
the user contract is used for finishing the registration uplink of the user identity and the checking and checking of the user identity information, and the green card contract is used for finishing the verification and the transfer of the green card.
8. A blockchain-based transaction implementation device, comprising:
the transaction acquisition unit is used for acquiring transaction information of each transaction in the block on the blockchain node;
a transaction dependency graph construction unit configured to construct each transaction into a transaction dependency graph including dependency relationships between each transaction according to the transaction information of each transaction; the transaction dependency graph comprises a plurality of vertexes and directed edges among the vertexes, wherein the vertexes in the transaction dependency graph represent corresponding transactions, and the directed edges among the vertexes represent dependency relations among the transactions;
and the transaction scheduling unit is used for determining and outputting the transaction execution sequence of each transaction according to the transaction dependency graph, and scheduling and executing each transaction according to the execution sequence among the transactions represented by the output transaction execution sequence.
9. The apparatus according to claim 8, wherein the transaction dependency graph construction unit is specifically configured to:
according to the transaction information of each transaction, carrying out dependency identification between any two transactions in each transaction;
constructing a transaction dependency graph corresponding to each transaction according to the dependency relationship identification result among the transactions;
The directed edge of the first vertex points to the second vertex in the transaction dependency graph, which indicates that the transaction represented by the second vertex has dependency on the transaction represented by the first vertex.
10. A computer readable medium, characterized in that it has stored thereon a computer program comprising a program code for performing the method according to any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211648493.0A CN116071160A (en) | 2022-12-21 | 2022-12-21 | Block chain-based transaction implementation method, device and computer readable medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211648493.0A CN116071160A (en) | 2022-12-21 | 2022-12-21 | Block chain-based transaction implementation method, device and computer readable medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116071160A true CN116071160A (en) | 2023-05-05 |
Family
ID=86174087
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211648493.0A Pending CN116071160A (en) | 2022-12-21 | 2022-12-21 | Block chain-based transaction implementation method, device and computer readable medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116071160A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116993039A (en) * | 2023-09-25 | 2023-11-03 | 浙江华云信息科技有限公司 | Time sequence feature-based green electricity and power data processing method and system for both sender and sender |
-
2022
- 2022-12-21 CN CN202211648493.0A patent/CN116071160A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116993039A (en) * | 2023-09-25 | 2023-11-03 | 浙江华云信息科技有限公司 | Time sequence feature-based green electricity and power data processing method and system for both sender and sender |
CN116993039B (en) * | 2023-09-25 | 2023-12-26 | 浙江华云信息科技有限公司 | Time sequence feature-based green electricity and power data processing method and system for both sender and sender |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Liu et al. | Electric vehicle power trading mechanism based on blockchain and smart contract in V2G network | |
Bada et al. | Towards a green blockchain: A review of consensus mechanisms and their energy consumption | |
CN108805627B (en) | Media resource allocation method, device, system, medium and equipment | |
Wang et al. | Inter-bank payment system on enterprise blockchain platform | |
US20200043115A1 (en) | Permissioned blockchain ecosystem for economic development incentives | |
US20210049306A1 (en) | System and method for consensus management | |
CN113065775A (en) | Bidding system based on block chain | |
Dzobo et al. | Proposed framework for blockchain technology in a decentralised energy network | |
CN114971625A (en) | Microgrid green electricity transaction system based on block chain technology and data storage and settlement method | |
Wen et al. | Application of blockchain technology in data management: advantages and solutions | |
CN116071160A (en) | Block chain-based transaction implementation method, device and computer readable medium | |
Ge et al. | Blockchain and green certificates based market structure and transaction mechanism of direct power-purchase for industrial users | |
CN112598132A (en) | Model training method and device, storage medium and electronic device | |
CN117635189A (en) | Virtual power plant master-slave multi-chain resource interactive matching method based on improved consensus algorithm | |
CN108985909A (en) | Data trade method and system based on block chain technology | |
CN115760395A (en) | Electric-carbon linkage collaborative transaction system based on block chain | |
CN114529376A (en) | Energy exchange data processing method and device, computer equipment and storage medium | |
CN114398451A (en) | Reliable evidence storing method, device, equipment and medium for electric power spot market data | |
Hsiao | Blockchain for corporate renewable energy procurement-potential for verification of renewable energy certificates | |
CN113315837A (en) | Enterprise data sharing platform | |
Čeke et al. | Enhancing transparency and fairness in public procurement process with the support of blockchain technology: a smart contract based approach | |
CN112085601A (en) | Annuity data processing method, device, medium and electronic equipment | |
Xu et al. | Existing Blockchain Platforms | |
CN110910091A (en) | Data processing method, device and medium | |
Gupta et al. | An Intrinsic Review on Securitization using Blockchain |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |