Intelligent consensus method and device for block chain and directed acyclic graph network fusion

By integrating directed acyclic graph network into the blockchain network and dynamically switching network modes according to the current network load index, the problem of slow consensus rate in high transaction volume scenarios is solved, and efficient and secure transaction consensus processing is achieved.

CN119865302AActive Publication Date: 2025-04-22NORTHKING INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510039704.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-04-22
Estimated Expiration
2045-01-10

AI Technical Summary

Technical Problem

Due to the linear processing characteristics, blockchain networks have scalability limitations, resulting in slower consensus rates in high transaction volume scenarios, which reduces consensus efficiency.

Method used

By integrating blockchain and directed acyclic graph network, dynamically switch between two network modes, and using a more appropriate consensus method to conduct transaction consensus. The specific method includes comparing the current network load index with the preset load index, determining the target network mode, and switching the network mode to adapt to changes in transaction volume. Use preset blockchain consensus method in the blockchain network mode, and use weighted confirmation consensus method in the directed acyclic graph network mode.

Benefits of technology

By dynamically switching network modes, consensus efficiency and security are effectively balanced, data security is ensured at low transaction volume, and consensus efficiency is improved at high transaction volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865302A_ABST
    Figure CN119865302A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an intelligent consensus method and device for convergence of a block chain and a directed acyclic graph network. The method comprises the steps of determining a current network load index according to a total transaction quantity generated in a current time period, delay information and transaction weight of each transaction and calculation cost of each node in a current network; comparing the current network load index with a preset load index, and determining a target network mode; if the current network mode is different from the target network mode, switching the current network mode to the target network mode; in response to the target network mode being a block chain network mode, performing consensus processing on the target transaction according to a preset block chain consensus mode; and in response to the fact that the target network mode is the directed acyclic graph network mode, consensus parallel processing is performed on the target transaction according to the weighted confirmation consensus mode, so that dynamic switching between the block chain network mode and the directed acyclic graph network mode is realized, and consensus processing efficiency and security are effectively balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to computer technology, and in particular to an intelligent consensus method and device for integrating blockchain with a directed acyclic graph network. Background Art

[0002] The blockchain network is a distributed ledger network, which can also be regarded as a data structure that stores data in chronological order. The consensus mechanism refers to the verification and confirmation of transactions in a very short time through the voting of special nodes in the blockchain network. For example, for a transaction, if several nodes with irrelevant interests can reach a consensus, it can be considered that the entire network can also reach a consensus on this. The consensus mechanism in the blockchain network ensures that data cannot be tampered with and data consistency. However, in the process of implementing the present invention, the inventor found that there are at least the following problems in the prior art:

[0003] Although the consensus method in the blockchain network can ensure data security, due to the linear processing characteristics of the blockchain network, it has limitations in scalability, resulting in a slower consensus rate in high transaction volume scenarios and reduced consensus efficiency. Summary of the invention

[0004] The embodiments of the present invention provide an intelligent consensus method and device that integrates blockchain and directed acyclic graph network to achieve dynamic switching between blockchain network mode and directed acyclic graph network mode, thereby utilizing a more appropriate consensus method for transaction consensus, effectively balancing consensus efficiency and security.

[0005] In a first aspect, an embodiment of the present invention provides an intelligent consensus method for integrating a blockchain with a directed acyclic graph network, including:

[0006] Determine the current network load index according to the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computational cost of each node in the current network in the current time period, wherein the current time period is a time period with the current moment as the end moment and a preset duration;

[0007] Compare the current network load index with a preset load index, and determine a target network mode according to the comparison result, wherein the target network mode includes: a blockchain network mode or a directed acyclic graph network mode;

[0008] If the current network mode is different from the target network mode, switching the current network mode to the target network mode;

[0009] In response to the target network mode being a blockchain network mode, consensus processing is performed on target transactions generated after the current moment according to a preset blockchain consensus method corresponding to the blockchain network mode;

[0010] In response to the target network mode being a directed acyclic graph network mode, consensus parallel processing is performed on target transactions generated after the current moment according to a weighted confirmation consensus method corresponding to the directed acyclic graph network mode;

[0011] The current network load index is determined according to the following formula:

[0012]

[0013] Where T is the current network load index; N t is the total number of transactions generated in the current time period; d i is the delay information of the ith transaction; f(d i ) is a function used to characterize the delay between the i-th transaction and other transactions; w i is the transaction weight of the ith transaction; N is the number of nodes in the current network in the current time period; p i is the computational cost of the i-th node; α, β, γ, δ, and φ are weight coefficients; λ is a scaling factor used to adjust the sensitivity of the sigmoid function.

[0014] In a second aspect, an embodiment of the present invention further provides an intelligent consensus device integrating a blockchain and a directed acyclic graph network, comprising:

[0015] A current network load index determination module, used to determine the current network load index according to the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computational cost of each node in the current network in the current time period, wherein the current time period is a time period with the current moment as the end moment and a preset duration;

[0016] A target network mode determination module, used to compare the current network load index with a preset load index, and determine a target network mode according to the comparison result, wherein the target network mode includes: a blockchain network mode or a directed acyclic graph network mode;

[0017] A network mode switching module, configured to switch the current network mode to the target network mode if the current network mode is different from the target network mode;

[0018] A blockchain consensus module, configured to perform consensus processing on target transactions generated after the current moment according to a preset blockchain consensus method corresponding to the blockchain network mode in response to the target network mode being the blockchain network mode;

[0019] A directed acyclic graph consensus module, for performing consensus and parallel processing on target transactions generated after the current moment according to a weighted confirmation consensus method corresponding to the directed acyclic graph network mode in response to the target network mode being a directed acyclic graph network mode;

[0020] The current network load index determination module determines the current network load index according to the following formula:

[0021]

[0022] Where T is the current network load index corresponding to the current time period; N t is the total number of transactions generated in the current time period; d i is the delay information of the i-th transaction; w i is the transaction weight of the ith transaction; N is the number of nodes in the current network in the current time period; p i is the computational cost of the i-th node; α, β, γ, δ, and φ are weight coefficients; λ is a scaling factor used to adjust the sensitivity of the sigmoid function.

[0023] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0024] one or more processors;

[0025] A memory for storing one or more programs;

[0026] When the one or more programs are executed by the one or more processors, the one or more processors implement an intelligent consensus method for integrating blockchain and directed acyclic graph network as provided in any embodiment of the present invention.

[0027] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements an intelligent consensus method for integrating blockchain and a directed acyclic graph network as provided in any embodiment of the present invention.

[0028] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements an intelligent consensus method for integrating blockchain and a directed acyclic graph network as provided in any embodiment of the present invention.

[0029] One embodiment of the above invention has the following advantages or beneficial effects:

[0030] By comprehensively considering the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computational cost of each node in the current network in the current time period, the current network load index can be accurately determined in real time, and the current network load index can be compared with the preset load index. According to the comparison result, the current appropriate target network mode can be determined in real time; if the current network mode is different from the target network mode, the current network mode is switched to the target network mode. When the target network mode is the blockchain network mode, the target transactions generated after the current moment are processed by consensus according to the preset blockchain consensus method corresponding to the blockchain network mode, so that data security can be guaranteed under low transaction volume conditions; when the target network mode is the directed acyclic graph network mode, the target transactions generated after the current moment are processed by consensus in parallel according to the weighted confirmation consensus method corresponding to the directed acyclic graph network mode, so that consensus efficiency can be improved under high transaction volume conditions. By dynamically switching between the blockchain network mode and the directed acyclic graph network mode according to the current network load index, a more appropriate consensus method can be used for transaction consensus processing, thereby effectively balancing consensus efficiency and security. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 It is a flow chart of an intelligent consensus method for integrating blockchain and directed acyclic graph network provided by an embodiment of the present invention;

[0033] Figure 2 It is a flowchart of another intelligent consensus method for integrating blockchain and directed acyclic graph network provided by one embodiment of the present invention;

[0034] Figure 3 It is a structural schematic diagram of an intelligent consensus device integrating blockchain and directed acyclic graph network provided by one embodiment of the present invention;

[0035] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0037] Figure 1 This is a flowchart of a smart consensus method for integrating blockchain and directed acyclic graph network provided by an embodiment of the present invention. This embodiment can be applied to the case of intelligent consensus on transactions in a distributed ledger network. The method can be executed by a smart consensus device integrating blockchain and directed acyclic graph network, which can be implemented by software and / or hardware and integrated into an electronic device. Figure 1 As shown, the method specifically comprises the following steps:

[0038] S110. Determine the current network load index according to the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computational cost of each node in the current network in the current time period, wherein the current time period is a time period with the current moment as the end moment and a preset duration.

[0039] Among them, the current time period refers to the historical time period that is closest to the current moment and has a preset duration. For example, the current time period may refer to the last 1 second, the last 1 minute, or the last 1 hour, etc. The end time in the current time period is the current moment, and the start time is the historical moment obtained by subtracting the preset duration from the current moment. The current time period changes dynamically over time, thereby realizing real-time determination of the network load index. The current network load index can be used to reflect the working intensity and pressure of the current network in the current time period. The larger the current network load index, the larger the transaction volume that the current network needs to process.

[0040] The delay information of each transaction generated in the current time period is used to describe the time interval between transactions or the depth of the dependency relationship. Transaction weight refers to the weight assigned to each transaction, which can be determined based on the importance or priority of the transaction. The more important the transaction or the higher the priority, the greater the assigned transaction weight. Transaction weight can be obtained by training and learning using deep learning artificial intelligence algorithms and production practice data, and can be continuously optimized using subsequent production practice data to improve the rationality and accuracy of transaction weight allocation.

[0041] The current network in the current time period can refer to a blockchain network or a directed acyclic graph network. A blockchain network is a linear structure that starts from the so-called "genesis block" and continues to each new block on the chain. Each block contains many transactions and refers to the previous block through a hash value. Therefore, all blocks in the blockchain network can be traced back to the first block, and it is impossible to modify the data in the block, thereby providing a secure and permanent record. A directed acyclic graph network is a distributed ledger network structure that is different from a blockchain network. In a directed acyclic graph network, multiple connections between units are allowed, and there is no concept of blocks. Each unit records the transactions of a single user. This structure enables the directed acyclic graph network to asynchronously and concurrently write a large number of transactions, greatly improving the scalability of the system. For example, a directed acyclic graph is a directed graph without a cycle, that is, there is no loop in the graph. Each transaction has a direction and cannot form a closed loop. In a directed acyclic graph, each transaction needs to verify the previous transaction. This verification mechanism allows new transactions to be added to the network asynchronously and concurrently, thereby improving the processing speed and scalability of the system. The distributed ledger network in this embodiment is a heterogeneous network that integrates the blockchain network model and the directed acyclic graph network model to optimize the overall transaction processing capabilities of the system.

[0042] When the current network is a blockchain network, a node may refer to a block in the blockchain network. When the current network is a directed acyclic graph network, a node may refer to a unit or transaction in the directed acyclic graph network. The computational cost of each node in the current network can be used to characterize the processing power and computing resources of each node. The nodes in the network can be used to participate in transaction verification in the directed acyclic graph network mode or the blockchain network mode, thereby confirming the authenticity of the transaction and preventing double spending. The transaction data of each transaction generated may include the transaction parties, transaction amount, transaction time, transaction hash, directed acyclic graph network mode verification, and blockchain-anchored metadata, thereby supporting intelligent adaptation of the dual mode.

[0043] Specifically, the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computing cost of each node in the current network in the current time period can be collected in real time, and the total number of transactions, the delay information and transaction weight of each transaction, and the computing cost of each node in the current network can be comprehensively weighted to obtain the current network load index. Since the current network load index comprehensively considers the current transaction information and current network information in the current time period, it can be intelligently and dynamically adjusted according to the real-time network conditions to achieve efficient mode conversion.

[0044] Exemplarily, the current network load index is determined according to the following formula:

[0045]

[0046] Where T is the current network load index; N t is the total number of transactions generated in the current time period; d i is the delay information of the ith transaction; f(d i ) is a function used to characterize the delay between the i-th transaction and other transactions; w i is the transaction weight of the ith transaction; N is the number of nodes in the current network in the current time period; p i is the computational cost of the i-th node; α, β, γ, δ, and φ are weight coefficients; λ is a scaling factor used to adjust the sensitivity of the sigmoid function.

[0047] For example, f(d i ) is an exponential function used to measure transaction propagation time or dependency depth. For example, The delay information d of each transaction generated in the current time period i Substitute into f(d i ), get each transaction d i The transaction delay change information f(d i ), the transaction delay change information can measure the transaction propagation time or the dependency depth between transactions. According to the transaction weight of each transaction, the transaction delay change information of each transaction is weighted and summed to obtain the total transaction delay change information corresponding to the current time period, that is, Add up the computational cost of each node in the current network in the current time period to obtain the total computational cost corresponding to the current time period, that is,

[0048] Among them, α, β, γ, δ and φ can be obtained by training and learning from a large amount of production practice data through deep learning artificial intelligence algorithms, and intelligent calculation optimization, and can be continuously optimized in subsequent calculations. ) and the logarithmic function (i.e., ln function) to calculate the current network load index, which can achieve nonlinear scaling conversion, allowing the system to smoothly transition between the blockchain network mode and the directed acyclic graph network mode based on real-time data. By using the above formula, the current network load index can be determined more precisely and accurately, a comprehensive load calculation can be achieved, and the mode conversion can be smoother, improving the overall system performance.

[0049] S120. Compare the current network load index with the preset load index, and determine the target network mode according to the comparison result. The target network mode includes: a blockchain network mode or a directed acyclic graph network mode.

[0050] Among them, the target network mode may refer to the network consensus mode that best suits the current network load. The blockchain network mode refers to a mode that uses a blockchain network for consensus processing. The directed acyclic graph network mode refers to a mode that uses a directed acyclic graph network for consensus processing. The preset load index can be a preset critical value of the network load index for switching the network mode. For example, the preset load index may include a first preset load index and a second preset load index, wherein the first preset load index refers to the critical value of the network load index for switching to a directed acyclic graph network mode. The second preset load index refers to the critical value of the network load index for switching to a blockchain network mode. The first preset load index may be equal to the second preset load index so that only one preset load index is used to make a decision on mode switching. Alternatively, the first preset load index may also be greater than the second preset load index so that two different preset load indices are used to make a decision on mode switching, thereby meeting personalized business needs.

[0051] Specifically, when there is only one preset load index, that is, the first preset load index is equal to the second preset load index, the current network load index is compared with the preset load index. If the current network load index is greater than the preset load index, the directed acyclic graph network mode is determined as the target network mode, so that in the case of high transaction volume, the transaction is processed in the directed acyclic graph network mode to achieve fast consensus verification and improve consensus efficiency. If the current network load index is less than the preset load index, the blockchain network mode is determined as the target network mode, so that in the case of low transaction volume, the transaction is processed in the blockchain network mode to improve security.

[0052] Exemplarily, step S120 may include: if the current network load index is greater than the first preset load index, determining the directed acyclic graph network mode as the target network mode; if the current network load index is less than the second preset load index, determining the blockchain network mode as the target network mode.

[0053] Specifically, when there are two different preset load indexes, that is, the first preset load index is greater than the second preset load index, if the current network load index is greater than the first preset load index, the target network mode is determined to be a directed acyclic graph network mode. If the current network load index is less than the second preset load index, the target network mode is determined to be a blockchain network mode. If the current network load index is less than or equal to the first preset load index, and greater than or equal to the second preset load index, it indicates that the current transaction volume is moderate. At this time, there is no need to switch the network mode, and consensus processing can continue to be based on the current network mode, which further effectively balances consensus efficiency and security.

[0054] S130: If the current network mode is different from the target network mode, switch the current network mode to the target network mode.

[0055] Among them, the current network mode refers to the network mode at the current moment, that is, the network mode corresponding to the current network. Different network modes correspond to different consensus methods. The target network mode is the network consensus mode that best suits the current network load.

[0056] Specifically, when the current network mode is different from the target network mode, the current network mode is switched to the most suitable target network mode, so that the most suitable target network mode can be used to perform consensus processing on target transactions generated after the current moment.

[0057] Exemplarily, when the current network mode is the blockchain network mode and the target network mode is the directed acyclic graph network mode, it indicates that the current network load index increases. At this time, by switching the network from the blockchain network mode to the directed acyclic graph network mode, the consensus parallel processing of transactions in the directed acyclic graph network mode can provide scalability, thereby improving throughput and consensus efficiency. When the current network mode is the directed acyclic graph network mode and the target network mode is the blockchain network mode, it indicates that the current network load index decreases. At this time, by switching the network from the directed acyclic graph network mode to the blockchain network mode, the transaction consensus processing is performed in the blockchain network mode, so that security and order verification can be prioritized, thereby strengthening data security. By utilizing a heterogeneous network that integrates the blockchain network mode and the directed acyclic graph network mode, speed, throughput and security can be effectively balanced, thereby realizing high-frequency transaction demand applications such as cross-border payments, financial transactions and the Internet of Things.

[0058] It should be noted that if the current network mode is the target network mode, it means that there is no need to switch the network mode at present, and the target transactions generated after the current moment can continue to be processed according to the target consensus method corresponding to the current network mode. By using the current network load index calculated in real time, the intelligent switching of network modes can be realized, thereby ensuring that the mode switching is smoother and more reliable, and improving the overall performance of the system.

[0059] S140. In response to the target network mode being the blockchain network mode, consensus processing is performed on the target transaction generated after the current moment according to a preset blockchain consensus method corresponding to the blockchain network mode.

[0060] The preset blockchain consensus method corresponding to the blockchain network mode may be any pre-set blockchain consensus algorithm, i.e., a consensus algorithm that improves security. For example, the preset blockchain consensus method may be, but is not limited to, a PBFT (Practical Byzantine Fault Tolerance) algorithm. The target transaction refers to a new transaction generated after the current moment.

[0061] Specifically, when the target network mode is a blockchain network mode, consensus processing is performed on target transactions generated after the current moment according to a preset blockchain consensus method corresponding to the blockchain network mode, thereby ensuring the security of the transaction.

[0062] S150. In response to the target network mode being a directed acyclic graph network mode, consensus and parallel processing are performed on target transactions generated after the current moment according to a weighted confirmation consensus method corresponding to the directed acyclic graph network mode.

[0063] Among them, the weighted confirmation consensus method corresponding to the directed acyclic graph network mode can be a consensus algorithm for verifying and confirming transactions based on the weighted graph structure in the directed acyclic graph network. Transactions in the directed acyclic graph network mode are verified based on the cumulative weight of the confirmation nodes. For example, each transaction determines the cumulative weight according to the confirmation score. When the cumulative weight exceeds the threshold, the transaction is deemed to be confirmed, that is, a transaction that has been successfully verified. The target transaction refers to a new transaction generated after the current moment.

[0064] Specifically, when the target network mode is a directed acyclic graph network mode, according to the weighted confirmation consensus method corresponding to the directed acyclic graph network mode, consensus and parallel processing of target transactions generated after the current moment can be allowed, thereby having scalability and improving consensus efficiency.

[0065] By utilizing an intelligent consensus mechanism that integrates weighted confirmation consensus and preset blockchain consensus, it is possible to intelligently and dynamically switch between blockchain network mode and directed acyclic graph network mode according to real-time network conditions, thereby intelligently balancing security and scalability in the distributed ledger network to adapt to broader and more massive application needs.

[0066] Exemplarily, the method may further include: anchoring the transaction hash value corresponding to the target transaction stored in the directed acyclic graph network in the blockchain network. The target transaction stored in the directed acyclic graph network refers to a transaction that has been confirmed and successfully verified. Specifically, the target transaction stored in the directed acyclic graph network may be anchored to the blockchain network or converted into a blockchain block periodically and asynchronously, thereby avoiding tampering with the data of the target transaction and improving the security of the target transaction.

[0067] The technical solution of this embodiment can accurately determine the current network load index in real time by comprehensively considering the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computational cost of each node in the current network in the current time period, and compare the current network load index with the preset load index. According to the comparison result, the current appropriate target network mode can be determined in real time; if the current network mode is different from the target network mode, the current network mode is switched to the target network mode. When the target network mode is the blockchain network mode, the target transaction generated after the current moment is processed by consensus according to the preset blockchain consensus method corresponding to the blockchain network mode, so that data security can be guaranteed in the case of low transaction volume; when the target network mode is the directed acyclic graph network mode, the target transaction generated after the current moment is processed by consensus in parallel according to the weighted confirmation consensus method corresponding to the directed acyclic graph network mode, so that the consensus efficiency can be improved in the case of high transaction volume. By dynamically switching between the blockchain network mode and the directed acyclic graph network mode according to the current network load index, a more appropriate consensus method can be used for transaction consensus processing, thereby effectively balancing consensus efficiency and security.

[0068] Figure 2 A flowchart of another intelligent consensus method for integrating blockchain and directed acyclic graph network provided by an embodiment of the present invention. Based on the above embodiments, this embodiment optimizes the step of "consensus and parallel processing of target transactions generated after the current moment according to the weighted confirmation consensus method corresponding to the directed acyclic graph network mode". The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.

[0069] See also Figure 2 Another intelligent consensus method for integrating blockchain and directed acyclic graph network provided in this embodiment specifically includes the following steps:

[0070] S210. Determine the current network load index according to the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computing cost of each node in the current network in the current time period, wherein the current time period is a time period with the current moment as the end moment and a preset duration.

[0071] S220. Compare the current network load index with the preset load index, and determine the target network mode according to the comparison result. The target network mode includes: a blockchain network mode or a directed acyclic graph network mode.

[0072] S230: If the current network mode is different from the target network mode, switch the current network mode to the target network mode.

[0073] S240: In response to the target network mode being the blockchain network mode, consensus processing is performed on the target transaction generated after the current moment according to a preset blockchain consensus method corresponding to the blockchain network mode.

[0074] S250: In response to the target network mode being a directed acyclic graph network mode, determining a confirmation score corresponding to each target transaction generated after the current moment according to a weighted graph structure in the directed acyclic graph network.

[0075] Among them, in the directed acyclic graph network, the node represents a transaction or a block, and each node is an independent data record, such as a transaction or a block, containing information about the transaction, a timestamp, and verification information. The dependency between nodes expresses the order and confirmation method between transactions. Edges represent dependencies or reference relationships. Edges usually point from one transaction (occurring first) to another transaction, and subsequent transactions depend on previous transactions. This dependency can be understood as the confirmation of previous transactions when adding new transactions. Edges can also have weights to measure the strength of the dependency or determine the influence of the dependency in the final calculation of the confirmation score. In the directed acyclic graph network mode, a weighted graph structure is used to verify transactions. G = (V, E) is a directed acyclic graph, in which the vertex set V represents all transactions, and the edge set E represents all verification and dependency directions. In a directed acyclic graph, from transaction T i Point to transaction T j The edge represents T j Depends on T i , so T j The confirmation score can be based on the point T j All nodes T i By utilizing the weighted graph structure in the directed acyclic graph network, the confirmation score corresponding to each target transaction generated after the current moment can be determined more accurately. The confirmation score can be used to sort the priority of transactions. The higher the confirmation score of a transaction, the higher the priority the transaction will be to prevent delays.

[0076] Exemplarily, step S250 may include: for each target transaction generated after the current moment, determining the target edge set of the target node corresponding to the target transaction in the directed acyclic graph network, and the edge weight and node distance corresponding to each target edge in the target edge set according to the weighted graph structure in the directed acyclic graph network, wherein each target edge in the target edge set is an edge pointing to the target node; determining the confirmation score corresponding to the target transaction according to the edge weight and node distance corresponding to each target edge in the target edge set.

[0077] Specifically, for each target transaction generated after the current moment, the target node T corresponding to the target transaction is determined according to the weighted graph structure in the directed acyclic graph network. jThe target edge set E in the DAG network j , and the target edge set E j Each target edge (T i , T j ) corresponds to the edge weight w ij The distance d from the node ij . Among them, each target edge (T i , T j ) are all from T i Point to T j The edge of T i Occurs before, T j Occurs after T j Depends on T i , T j At the time of establishment, T i The previous state, T j Confirm T i . Edge weight w ij From T i to T j The edge weight, node distance d ij From T i to T j It should be noted that the target edge may include an edge that directly points to the target node or an edge that indirectly points to the target node. ij You can use T i to T j The edge weight w is determined by the number of edges passed. ij You can use T i to T j The weight of each edge is determined. For example, if T i Directly pointing to T through an edge j , then determine the target edge (T i , T j ) corresponds to the node distance d ij is 1, determining the edge weight w ij is the weight of the edge. i Directed to T via at least two edges j , then the number of passing edges is determined as the target edge (T i , T j ) corresponds to the node distance d ij , the sum of the weights of all edges is determined as the target edge (T i , T j ) corresponds to the edge weight w ij .

[0078] Exemplarily, the confirmation score corresponding to the target transaction is determined according to the following formula:

[0079]

[0080] Among them, C(T j ) is the target node T corresponding to the target transaction j Corresponding confirmation score; E j is the target node T j The corresponding target edge set; (T i ,T j ) refers to a target edge set from T i Point to T j The target edge of ij refers to the target edge (T i ,T j ) corresponding to the edge weight; d ij refers to the target edge (T i ,T j ) corresponds to the node distance; f(d ij ) is about d ij The decay function of .

[0081] Specifically, using the attenuation function f(d ij ), such as the inverse proportional function 1 / d ij , the node distance corresponding to each target edge is attenuated to obtain the attenuated distance of each target edge. The attenuation function can be used to represent that as the node distance increases, the dependency effect gradually decreases. According to the edge weight w corresponding to each target edge ij , for each target edge attenuated distance f(d ij ) is weighted and summed, and the sum result is determined as the confirmation score C(T j ).

[0082] S260: Determine the cumulative weight corresponding to each target transaction according to the confirmation score corresponding to each target transaction, and perform confirmation verification on each target transaction according to the cumulative weight corresponding to each target transaction to obtain a target transaction that has passed the verification.

[0083] Specifically, the confirmation score corresponding to each target transaction is multiplied by a preset coefficient, and the multiplication result is used as the cumulative weight corresponding to each target transaction. The cumulative weight corresponding to each target transaction is compared with the preset weight, and the target transaction with a cumulative weight greater than the preset weight is determined as a target transaction that has passed the verification. By using the cumulative weight to perform parallel verification of transactions, the consensus efficiency is improved.

[0084] S270 , determining a processing order corresponding to the verified target transactions according to the confirmation scores corresponding to the verified target transactions, and adding the verified target transactions to the directed acyclic graph network according to the processing order.

[0085] Specifically, all verified target transactions are sorted according to the confirmation scores corresponding to the verified target transactions, and a target transaction processing order with decreasing confirmation scores is obtained. According to the processing order, the verified target transactions are added to the directed acyclic graph network in sequence. For example, a new node corresponding to each verified target transaction is created, the new node is added to the directed acyclic graph network, and the new node is connected to the existing node on which the new node depends, so as to complete the transaction consensus processing in the directed acyclic graph network. By using the weighted graph structure in the directed acyclic graph network to verify and confirm transactions, the efficiency of transaction consensus can be improved to adapt to fast, massive and secure transaction applications.

[0086] The technical solution of this embodiment determines the confirmation score corresponding to each target transaction generated after the current moment according to the weighted graph structure in the directed acyclic graph network; determines the cumulative weight corresponding to each target transaction according to the confirmation score corresponding to each target transaction, and confirms and verifies each target transaction according to the cumulative weight corresponding to each target transaction to obtain the verified target transaction; determines the processing order corresponding to the verified target transaction according to the confirmation score corresponding to the verified target transaction, and adds the verified target transaction to the directed acyclic graph network according to the processing order, thereby quickly verifying and confirming the transaction and improving the transaction consensus efficiency.

[0087] The following is an embodiment of an intelligent consensus device for integrating blockchain and directed acyclic graph network provided by an embodiment of the present invention. The device and the intelligent consensus method for integrating blockchain and directed acyclic graph network in the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the intelligent consensus device for integrating blockchain and directed acyclic graph network, reference can be made to the embodiment of the intelligent consensus method for integrating blockchain and directed acyclic graph network in the above-mentioned embodiments.

[0088] Figure 3 This is a schematic diagram of the structure of an intelligent consensus device that integrates blockchain and directed acyclic graph network provided by an embodiment of the present invention. This embodiment can be applied to the case of intelligent consensus on transactions in a distributed ledger network. Figure 3 As shown, the device specifically includes: a current network load index determination module 310, a target network mode determination module 320, a network mode switching module 330, a blockchain consensus module 340 and a directed acyclic graph consensus module 350.

[0089] Among them, the current network load index determination module 310 is used to determine the current network load index according to the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computational cost of each node in the current network in the current time period, wherein the current time period is a time period with the current moment as the end moment and a preset duration; the target network mode determination module 320 is used to compare the current network load index with the preset load index, and determine the target network mode according to the comparison result, and the target network mode includes: blockchain network mode or directed acyclic graph network mode; the network mode switching module 330 is used to switch the current network mode to the target network mode if the current network mode is different from the target network mode; the blockchain consensus module 340 is used to respond to the target network mode being the blockchain network mode, according to the preset blockchain consensus method corresponding to the blockchain network mode, consensus processing is performed on the target transaction generated after the current moment; the directed acyclic graph consensus module 350 is used to respond to the target network mode being the directed acyclic graph network mode, according to the weighted confirmation consensus method corresponding to the directed acyclic graph network mode, consensus and parallel processing is performed on the target transaction generated after the current moment;

[0090] The current network load index determination module determines the current network load index according to the following formula:

[0091]

[0092] Where T is the current network load index corresponding to the current time period; N t is the total number of transactions generated in the current time period; d i is the delay information of the i-th transaction; w i is the transaction weight of the ith transaction; N is the number of nodes in the current network in the current time period; p i is the computational cost of the i-th node; α, β, γ, δ, and φ are weight coefficients; λ is a scaling factor used to adjust the sensitivity of the sigmoid function.

[0093] The technical solution of this embodiment can accurately determine the current network load index in real time by comprehensively considering the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computational cost of each node in the current network in the current time period, and compare the current network load index with the preset load index. According to the comparison result, the current appropriate target network mode can be determined in real time; if the current network mode is different from the target network mode, the current network mode is switched to the target network mode. When the target network mode is the blockchain network mode, the target transaction generated after the current moment is processed by consensus according to the preset blockchain consensus method corresponding to the blockchain network mode, so that data security can be guaranteed in the case of low transaction volume; when the target network mode is the directed acyclic graph network mode, the target transaction generated after the current moment is processed by consensus in parallel according to the weighted confirmation consensus method corresponding to the directed acyclic graph network mode, so that the consensus efficiency can be improved in the case of high transaction volume. By dynamically switching between the blockchain network mode and the directed acyclic graph network mode according to the current network load index, a more appropriate consensus method can be used for transaction consensus processing, thereby effectively balancing consensus efficiency and security.

[0094] Optionally, f(d i ) is an exponential function used to measure transaction propagation time or dependency depth.

[0095] Optionally, the target network mode determination module 320 is specifically configured to:

[0096] If the current network load index is greater than the first preset load index, the directed acyclic graph network mode is determined as the target network mode; if the current network load index is less than the second preset load index, the blockchain network mode is determined as the target network mode; wherein the first preset load index is greater than or equal to the second preset load index.

[0097] Optionally, the directed acyclic graph consensus module 350 includes:

[0098] A confirmation score determination unit, used to determine the confirmation score corresponding to each target transaction generated after the current moment according to the weighted graph structure in the directed acyclic graph network;

[0099] A confirmation and verification unit, used to determine the cumulative weight corresponding to each target transaction according to the confirmation score corresponding to each target transaction, and to confirm and verify each target transaction according to the cumulative weight corresponding to each target transaction to obtain the target transaction that has passed the verification;

[0100] The transaction adding unit is used to determine the processing order corresponding to the verified target transaction according to the confirmation score corresponding to the verified target transaction, and add the verified target transaction to the directed acyclic graph network according to the processing order.

[0101] Optionally, the confirmation score determination unit is specifically configured to:

[0102] For each target transaction generated after the current moment, the target edge set of the target node corresponding to the target transaction in the directed acyclic graph network, and the edge weight and node distance corresponding to each target edge in the target edge set are determined according to the weighted graph structure in the directed acyclic graph network, wherein each target edge in the target edge set is an edge pointing to the target node; the confirmation score corresponding to the target transaction is determined according to the edge weight and node distance corresponding to each target edge in the target edge set.

[0103] Optionally, the confirmation score determining unit determines the confirmation score corresponding to the target transaction according to the following formula:

[0104]

[0105] Among them, C(T j ) is the target node T corresponding to the target transaction j Corresponding confirmation score; E j is the target node T j The corresponding target edge set; (T i ,T j ) refers to a target edge set from T i Point to T j The target edge of ij refers to the target edge (T i ,T j ) corresponding to the edge weight; d ij refers to the target edge (T i ,T j ) corresponds to the node distance; f(d ij ) is about d ij The decay function of .

[0106] The intelligent consensus device for integrating blockchain and directed acyclic graph network provided in the embodiment of the present invention can execute the intelligent consensus method for integrating blockchain and directed acyclic graph network provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the intelligent consensus method for integrating blockchain and directed acyclic graph network.

[0107] It is worth noting that in the embodiment of the intelligent consensus device integrating the above-mentioned blockchain and directed acyclic graph network, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0108] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 4 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0109] like Figure 4 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0110] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0111] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0112] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory 30 (RAM) and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0113] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0114] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0115] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the steps of an intelligent consensus method for integrating a blockchain and a directed acyclic graph network provided in any embodiment of the present invention.

[0116] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the intelligent consensus method for integrating blockchain and directed acyclic graph network provided in any embodiment of the present invention.

[0117] This embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of an intelligent consensus method for integrating a blockchain with a directed acyclic graph network as provided in any embodiment of the present invention.

[0118] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0119] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0120] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0121] An embodiment of the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements an intelligent consensus method for integrating blockchain and directed acyclic graph network as provided in any embodiment of the present invention.

[0122] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0123] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0124] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. An intelligent consensus method integrating blockchain and directed acyclic graph network, characterized in that: include: Determine the current network load index according to the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computational cost of each node in the current network in the current time period, wherein the current time period is a time period with the current moment as the end moment and a preset duration; Compare the current network load index with a preset load index, and determine a target network mode according to the comparison result, wherein the target network mode includes: a blockchain network mode or a directed acyclic graph network mode; If the current network mode is different from the target network mode, switching the current network mode to the target network mode; In response to the target network mode being a blockchain network mode, consensus processing is performed on target transactions generated after the current moment according to a preset blockchain consensus method corresponding to the blockchain network mode; In response to the target network mode being a directed acyclic graph network mode, consensus parallel processing is performed on target transactions generated after the current moment according to a weighted confirmation consensus method corresponding to the directed acyclic graph network mode; The current network load index is determined according to the following formula: Where T is the current network load index; N t is the total number of transactions generated in the current time period; d i is the delay information of the ith transaction; f(d i ) is a function used to characterize the delay between the i-th transaction and other transactions; w i is the transaction weight of the ith transaction; N is the number of nodes in the current network in the current time period; p i is the computational cost of the i-th node; α, β, γ, δ, and φ are weight coefficients; λ is a scaling factor used to adjust the sensitivity of the sigmoid function.

2. The method according to claim 1, characterized in that f(d i ) is an exponential function used to measure transaction propagation time or dependency depth.

3. The method according to claim 1, characterized in that Comparing the current network load index with a preset load index, and determining a target network mode according to the comparison result, includes: If the current network load index is greater than the first preset load index, determining the directed acyclic graph network mode as the target network mode; If the current network load index is less than the second preset load index, the blockchain network mode is determined as the target network mode; Wherein, the first preset load index is greater than or equal to the second preset load index.

4. The method according to claim 1, characterized in that According to the weighted confirmation consensus method corresponding to the directed acyclic graph network model, consensus and parallel processing are performed on the target transactions generated after the current moment, including: According to the weighted graph structure in the directed acyclic graph network, the confirmation score corresponding to each target transaction generated after the current moment is determined; Determine the cumulative weight corresponding to each target transaction according to the confirmation score corresponding to each target transaction, and confirm and verify each target transaction according to the cumulative weight corresponding to each target transaction to obtain the verified target transaction; According to the confirmation scores corresponding to the verified target transactions, the processing order corresponding to the verified target transactions is determined, and the verified target transactions are added to the directed acyclic graph network according to the processing order.

5. The method according to claim 4, characterized in that According to the weighted graph structure in the directed acyclic graph network, the confirmation score corresponding to each target transaction generated after the current moment is determined, including: For each target transaction generated after the current moment, according to the weighted graph structure in the directed acyclic graph network, determine the target edge set of the target node corresponding to the target transaction in the directed acyclic graph network, and the edge weight and node distance corresponding to each target edge in the target edge set, wherein each target edge in the target edge set is an edge pointing to the target node; A confirmation score corresponding to the target transaction is determined according to the edge weight and the node distance corresponding to each target edge in the target edge set.

6. The method according to claim 5, characterized in that The confirmation score corresponding to the target transaction is determined according to the following formula: Among them, C(T j ) is the target node T corresponding to the target transaction j Corresponding confirmation score; E j is the target node T j The corresponding target edge set; (T i ,T j ) refers to a target edge set from T i Point to T j The target edge of ij refers to the target edge (T i ,T j ) corresponding to the edge weight; d ij refers to the target edge (T i ,T j ) corresponds to the node distance; f(d ij ) is about d ij The decay function of .

7. An intelligent consensus device integrating blockchain and directed acyclic graph network, characterized in that: include: A current network load index determination module, used to determine the current network load index according to the total number of transactions generated in the current time period, the delay information and transaction weight of each transaction, and the computational cost of each node in the current network in the current time period, wherein the current time period is a time period with the current moment as the end moment and a preset duration; A target network mode determination module, used to compare the current network load index with a preset load index, and determine a target network mode according to the comparison result, wherein the target network mode includes: a blockchain network mode or a directed acyclic graph network mode; A network mode switching module, configured to switch the current network mode to the target network mode if the current network mode is different from the target network mode; A blockchain consensus module, configured to perform consensus processing on target transactions generated after the current moment according to a preset blockchain consensus method corresponding to the blockchain network mode in response to the target network mode being the blockchain network mode; A directed acyclic graph consensus module, for performing consensus and parallel processing on target transactions generated after the current moment according to a weighted confirmation consensus method corresponding to the directed acyclic graph network mode in response to the target network mode being a directed acyclic graph network mode; The current network load index determination module determines the current network load index according to the following formula: Where T is the current network load index corresponding to the current time period; N t is the total number of transactions generated in the current time period; d i is the delay information of the ith transaction; w i is the transaction weight of the ith transaction; N is the number of nodes in the current network in the current time period; p i is the computational cost of the i-th node; α, β, γ, δ, and φ are weight coefficients; λ is a scaling factor used to adjust the sensitivity of the sigmoid function.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the intelligent consensus method for integrating the blockchain and the directed acyclic graph network as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, an intelligent consensus method for integrating a blockchain and a directed acyclic graph network as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When executed by a processor, the computer program implements an intelligent consensus method for integrating a blockchain with a directed acyclic graph network as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • A high performance FAAS system based on block chain

    CN109508432A

  • Self-adaptive extensible consensus method based on block chain and directed acyclic graph

    CN119071304A

  • Rapid consensus method for large-scale heterogeneous dynamic nodes based on DAG block chain

    CN119094558A