Dpos consensus method and accounting method based on community discovery and dag

CN122989092APending Publication Date: 2026-10-27GANNAN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410420130.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-09
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

然而,区块链的这种链式结构仍然存在不足,例如网络中只能以串行的方式生成区块,无法并发地对交易数据进行处理,这限制了区块链系统处理交易的速度,使其在含有大量交易的场景下处理能力不足

Benefits of technology

[0005]本发明的目的之一在于提供一种基于社区发现和DAG的DPoS共识方法,以提高基于社区发现的DPoS共识方法效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989092A_ABST
    Figure CN122989092A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of consensus algorithm of block chain, and discloses a DPoS consensus method and a DPoS accounting method based on community discovery and DAG, and the specific steps include calculating node information, setting the number of suitable accounting nodes, comprehensively selecting the accounting nodes, and reasonably distributing rewards and punishments. The application proposes a DAG structure to the limitation of the chain structure of the block chain, can make the accounting nodes process transactions in parallel, and thus improves the efficiency of the system. Secondly, the selection of the number of accounting nodes is studied in depth, so as to improve the efficiency of the network. Finally, the improved method is further verified through experiments, and the high efficiency of the method is proved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of consensus algorithm technology in blockchain, and in particular to a DPoS (Delegated Proof of Stake) consensus method based on community discovery and DAG (Directed Acyclic Graph). By comprehensively considering factors such as the size and performance of the system network, the number of accounting nodes in the blockchain network is reasonably set, and the chain structure of the community discovery-based DPoS consensus method is changed to a DAG structure and blocks are issued, thereby improving the performance of the system. Background Technology

[0002] The DPoS consensus method, based on community discovery, designs a formula for the comprehensive reputation value of computing nodes. By sorting the comprehensive reputation values ​​of each node from high to low, the node with the highest comprehensive reputation value is selected as the ledger node. This ensures that the selected ledger node has high trustworthiness and actively maintains the stable operation of the blockchain system. However, the system does not specifically consider the selection of the number of ledger nodes. In a blockchain system, the number of ledger nodes is crucial, as it affects the security and performance of the blockchain network. Setting an appropriate number of ledger nodes can improve the blockchain network's resistance to attacks and its distribution. If the number of nodes is too small, the blockchain network will become centralized, making it vulnerable to attacks or tampering of transaction records by malicious nodes. Conversely, if the number of ledger nodes is too large, the system's efficiency will decrease, and the transaction processing speed will slow down, because ledger nodes not only have the right to produce blocks but also play a role in verifying transactions. Therefore, it is necessary to comprehensively consider factors such as the size and performance of the system network to reasonably set the number of ledger nodes in the blockchain network.

[0003] In blockchain technology, a blockchain is a chained database that connects individual blocks using hash pointers. This chained structure is one of the core design features of the blockchain and is crucial for its decentralization, data transparency, and ensuring the security and tamper-proof nature of transaction records. In a blockchain, apart from the genesis block, each block contains the hash value of the previous block, meaning it references the previous block. If a malicious node attempts to tamper with a block's information, the node will detect the anomaly and refuse to accept the altered block. This chained structure makes blocks tamper-proof, increasing data credibility. Furthermore, all transaction records in a blockchain are publicly transparent; anyone can traverse the entire blockchain to verify the legality and validity of transactions. This chained structure allows for transaction traceability and verification, reducing fraud and promoting fairness and transparency. However, this chained structure still has limitations. For example, blocks can only be generated serially in the network, preventing concurrent processing of transaction data. This limits the blockchain system's transaction processing speed, making it insufficient for scenarios with a large number of transactions.

[0004] To address the aforementioned problems, this invention proposes a DPoS consensus method based on community discovery and DAG. Summary of the Invention

[0005] One of the objectives of this invention is to provide a DPoS consensus method based on community discovery and DAG, so as to improve the efficiency of the community discovery-based DPoS consensus method.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] A DPoS consensus method based on community discovery and DAG, wherein the DPoS consensus method based on community discovery and DAG includes:

[0008] Step S1: Calculate node information: Nodes randomly vote for each other, and after the voting ends, calculate the activity and trustworthiness of each node based on the voting results, and count the number of voting nodes that participated in the voting.

[0009] Step S2: Set the number of accounting nodes: Calculate the number of accounting nodes based on the number of voting nodes and the degree of centralization of the blockchain network;

[0010] Step S3: Comprehensive selection of accounting nodes: Calculate the comprehensive reputation value of the nodes based on their activity and trustworthiness. Select a specific number of nodes as accounting nodes in descending order of their comprehensive reputation values. The specific number is the number of accounting nodes set in step S2.

[0011] Step S4, Reasonable Allocation of Rewards and Penalties: The accounting nodes adopt the DAG block production method to produce blocks in parallel. When the accounting node successfully produces a block or fails to produce a block normally, the accounting node and voting node are rewarded and penalized accordingly according to the incentive mechanism.

[0012] Several alternative methods are provided below, but they are not intended as additional limitations on the overall solution above. They are merely further additions or optimizations. Provided there are no technical or logical contradictions, each alternative method can be combined individually with respect to the overall solution above, or multiple alternative methods can be combined with each other.

[0013] As a preferred approach, the activity and trustworthiness of each node are calculated using the GN algorithm and the PageRank algorithm, respectively.

[0014] Preferably, the calculation of the number of accounting nodes based on the number of voting nodes and the degree of centralization of the blockchain network includes:

[0015] n = D n ×Vote

[0016] In the formula, n represents the number of accounting nodes, and D n This indicates the degree of centralization of the blockchain network, and Vote represents the number of voting nodes.

[0017] Preferably, the comprehensive reputation value of a node is calculated based on its activity level and trustworthiness, including...

[0018]

[0019] In the formula, I x Let Q(x) represent the overall reputation value of node x, Q(x) represent the activity level of node x, and k represent the overall reputation value of node x. x Let C represent the degree of node x, N represent the number of nodes that voted for node x, i.e., the trustworthiness of node x, and C represent the degree of node x. i V represents the credit value of node i. i Represents the number of votes cast by node i, η and Represents the weighting factor, where

[0020] Preferably, the ledger node uses a DAG-based block production method for parallel block production, including:

[0021] Ledger nodes produce blocks in chronological order, with the earliest DAG block being the genesis block. The genesis block does not contain the hash value of the predecessor block, while other DAG blocks contain at least the hash value of the predecessor block. In addition, DAG blocks also include version number, timestamp, proof, transaction information, and the hash value of the current block. New blocks determine one or more parent blocks based on the propagation mode.

[0022] In a blockchain, each node collects unprocessed transactions from the blockchain network, packages the transaction into a DAG block, broadcasts it to other nodes, and adds the DAG block to its own ledger.

[0023] Preferably, when a ledger node successfully produces a block or fails to produce a block, the ledger node and voting node are rewarded and penalized according to an incentive mechanism, including:

[0024] If the block produced by the ledger node is verified by other validators, the ledger node and the voting nodes that voted for the ledger node will receive credit rewards. In addition, the ledger node will also receive economic rewards for its contribution to packaging the block.

[0025] If a ledger node fails to produce a block within the specified time or produces a block maliciously, then the ledger node and the voting nodes that voted for the ledger node will have their credit points deducted.

[0026] When a node's credit score falls below a threshold after deductions, the node is marked and blacklisted, preventing it from participating in consensus again, and its security deposit is deducted. This invention provides a DPoS consensus method based on community discovery and DAG. First, it proposes an improved DAG structure to address the limitations of the blockchain's chain structure. For example, the blockchain's chain structure allows blocks to be generated serially, preventing concurrent processing of transaction data. This limits the blockchain system's transaction processing speed, making it insufficient for scenarios with a large number of transactions. The proposed DAG structure allows accounting nodes to process transactions in parallel, thus improving system efficiency. Second, it delves into the selection of the number of accounting nodes, further improving network efficiency. Finally, experiments further validate the improved method, demonstrating its high efficiency.

[0027] A second objective of this invention is to provide a ledger method to improve the efficiency of blockchain ledger recording. This ledger method employs the aforementioned DPoS consensus method based on community discovery and DAG to complete blockchain ledger recording.

[0028] A third objective of this invention is to provide a computer device, including a processor and a memory storing a plurality of computer instructions, wherein the computer instructions, when executed by the processor, implement the steps of the DPoS consensus method based on community discovery and DAG. Attached Figure Description

[0029] Figure 1 This is a flowchart of a DPoS consensus method based on community discovery and DAG according to the present invention;

[0030] Figure 2 This is an example diagram illustrating the election of the number of accounting nodes in this invention;

[0031] Figure 3 This is a diagram of the DAG block structure involved in this invention;

[0032] Figure 4 This is the DAG topology diagram of the present invention;

[0033] Figure 5 This is a diagram of the adjacency list storage structure of the DAG block in this invention;

[0034] Figure 6 This is a diagram illustrating the Gossip propagation pattern involved in this invention;

[0035] Figure 7 This is a diagram illustrating the propagation of the Gossip protocol in this invention.

[0036] Figure 8 This is a graph showing the experimental data of the present invention in terms of test latency;

[0037] Figure 9 This is a graph showing experimental data of the present invention in terms of throughput testing;

[0038] Figure 10 This is an experimental data graph showing the probability of a malicious node being elected in this invention. Detailed Implementation

[0039] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to limit the invention.

[0041] Example 1

[0042] like Figure 1 As shown, the DPoS consensus method based on community discovery and DAG provided in this embodiment includes the following steps:

[0043] Step S1: Calculate node information: Nodes randomly vote for each other, and after the voting ends, calculate the activity and trustworthiness of each node based on the voting results, and count the number of voting nodes that participated in the voting.

[0044] Step S1.1: Nodes begin to vote randomly among themselves, and a voting time window is set. Voting stops when the time window ends.

[0045] Step S1.2: The system calculates the activity and trustworthiness of each node based on the voting results. In this embodiment, the activity and trustworthiness of each node are calculated using the GN (Girvan-Newman) algorithm and the PageRank algorithm, respectively. The activity of a node represents its voting enthusiasm, and the trustworthiness of a node represents the number of votes it receives during the voting process.

[0046] Step S1.3: Count the voting nodes that participated in the voting in the blockchain network.

[0047] Step S2: Set the number of accounting nodes: Calculate the number of accounting nodes based on the number of voting nodes and the degree of centralization of the blockchain network.

[0048] Calculate the appropriate number of accounting nodes according to formula (1):

[0049] n = D n ×Vote (1)

[0050] In the formula, n represents the number of accounting nodes, and D n This represents the degree of centralization of the blockchain network. It is quantified and its value is in the range of (0, 1). The larger the value, the higher the degree of centralization of the network. Vote represents the number of voting nodes.

[0051] See Figure 2 , Figure 2 Example diagram for the election of the number of accounting nodes. There are a total of 23 nodes in the diagram, of which 21 nodes participated in the voting among nodes, and the other 2 nodes were offline and did not participate in the consensus of the system. According to formula (1), the value of Vote is 21. Assuming that the degree of decentralization of the system is 0.1, the value of n is rounded up to 3, that is, three nodes are selected as accounting nodes in this round of consensus.

[0052] Step S3: Comprehensive selection of accounting nodes: Calculate the comprehensive reputation value of the nodes based on their activity and trustworthiness. Select a specific number of nodes as accounting nodes in descending order of their comprehensive reputation values. The specific number is the number of accounting nodes set in step S2. Safe and reliable accounting nodes are elected through the comprehensive reputation value.

[0053] The overall reputation value of the node is calculated according to formula (2):

[0054]

[0055] In the formula, I xLet Q(x) represent the overall reputation value of node x, Q(x) represent the active modular metric of node x (representing the node's activity level), and k x Let C represent the degree of node x, N represent the number of nodes that voted for node x, i.e., the trustworthiness of node x, and C represent the degree of node x. i V represents the credit value of node i. i Represents the number of votes cast by node i, η and Represents the weighting factor, where

[0056] Step S4: Reasonable Allocation of Rewards and Penalties: Ledger nodes use a DAG-based block production method for parallel block production, employing an asynchronous block production mechanism. Each ledger node can simultaneously package transactions for block production. When a ledger node successfully produces a block or fails to produce a block, corresponding rewards and penalties are applied to both the ledger node and voting nodes according to the incentive mechanism.

[0057] In this embodiment, after the ledger node produces blocks in parallel using the DAG block production method, it determines whether the ledger node has successfully produced a block and applies corresponding rewards and penalties. The specific process is as follows:

[0058] (1) If the block generated by the accounting node is verified by other validating nodes, the accounting node and the voting nodes that voted for the accounting node will receive credit value rewards. At the same time, the accounting node will also receive economic rewards for its contribution to packaging blocks (using the credit incentive mechanism published in existing literature, which will not be explained in detail here).

[0059] (2) If a ledger node fails to produce a block within the specified time or produces a block maliciously, the ledger node and the voting nodes that voted for the ledger node will have a specified credit value deducted according to the credit incentive mechanism published in existing literature.

[0060] (3) When a node's credit value is deducted and falls below the threshold, the system will mark the node, add it to the blacklist, prohibit the node from participating in consensus again, and deduct the node's deposit.

[0061] See Figure 3 , Figure 3This is a diagram illustrating the DAG block structure involved in this invention. In the diagram, the genesis block, as the first block, does not contain any information about previous blocks; that is, it does not contain the hash value of the previous block. Other blocks, however, contain at least one hash value from the previous block. For example, blocks 1 and 2 each contain one hash value from the previous block, while block 3 contains two different hash values ​​from the previous block. Furthermore, other information in the DAG block includes version number, timestamp, proof, transaction information, and the hash value of the current block. The DAG blockchain ledger links from the hash value of the previous block contained in the last block to the previous block, continuously linking to previous blocks in this way, ultimately linking to the genesis block, thus forming a complex and complete data ledger. When a malicious node attempts to tamper with transactions, it will affect the entire data ledger, causing incomplete data. The problem is easily detected; therefore, the DAG graph structure data ledger has good tamper resistance.

[0062] like Figure 4 The diagram shows a DAG topology. Ledger nodes produce blocks in chronological order, with the earliest block being the genesis block (block 0), which does not contain the hash value of its predecessor block. All other blocks contain the hash value of at least one predecessor block. A new block first needs to reference one or more parent blocks to ensure the integrity of the transaction data. The selection of the parent block depends on the specific propagation mode, such as the Gossip propagation mode. Then, each node collects unprocessed transactions from the network, packages them into blocks, broadcasts them to other nodes, and adds the block to its own ledger. The DAG block structure and the block production method of the ledger nodes in this embodiment enable parallel processing of transactions, thereby improving system efficiency.

[0063] like Figure 5 As shown, Figure 4 The DAG topology graph corresponds to the DAG adjacency list storage structure diagram. Each block in the graph contains a hash value, transaction information, and a hash pointer. The hash value is similar to the ID of the block and is unique; while the hash pointer points to the hash value of the next block. The system traverses the adjacency list of each block and connects them with directed line segments to form a huge and complex network.

[0064] like Figure 6 The diagram shown illustrates the Gossip propagation patterns involved in this invention. Three patterns are presented to ensure data consistency across all nodes, meaning that the ledgers stored by each node are consistent:

[0065] Figure 6(a) is the push mode of Gossip. Server A pushes data of Bob, Alice and Jerry to server B. However, server B finds that Bob's data is stored in its own database, but Alice and Jerry's data cannot be found. So it updates its own database and adds the new data to its own database, that is, it adds Alice and Jerry's data to its own database.

[0066] Figure 6 (b) is the pull mode of Gossip. Server A pulls data such as Bob, Tom and Lucy from server B. However, server A finds that Bob's data is stored in its own database, but Tom and Lucy's data cannot be found. Therefore, server A updates its own database and adds the new data to its own database, that is, adds Tom and Lucy's data to its own database.

[0067] Figure 6 (c) is the push-pull mode of Gossip. Server A pushes its stored data of Bob, Alice, and Jerry to server B and pulls server B's data of Bob, Tom, and Lucy. However, server A and server B find that Bob's data is stored in their own databases, and the other data cannot be found. After that, both server A and server B update their own databases. Server A adds Tom and Lucy's data to its own database, while server B adds Alice and Jerry's data to its own database. Thus, the data of server A and server B are consistent.

[0068] See Figure 7 , Figure 7 Example diagram of Gossip protocol propagation: Figure 7 In (a), the data information of node 1 has changed. According to the protocol, node 1 will randomly "infect" other nodes, such as nodes 3 and 5, by spreading the updated data information to these two nodes. After receiving the data information, they will update the data stored locally, such as... Figure 7 As shown in (b). Subsequently, nodes 3 and 5 "infect" other nodes. For example, node 3 propagates the updated data to nodes 2 and 6, while node 5 propagates the updated data to nodes 8 and 9. These nodes, upon receiving the data update information, will update their local databases accordingly. Figure 7 As shown in (c). The node that updates the database then propagates the update data message to other nodes until the databases of all nodes in the network reach a consensus, thus obtaining... Figure 7 (d)

[0069] like Figures 8-10 The figure shows the performance test data of the test method in this invention. The experiment used an Intel i5-6200U CPU 2.30GHz processor, 8GB memory, PyCharm 2020.1 programming tool, and Python 3.8 language version for simulation. As can be seen from the figure, the CD-DPoS_DAG method of this invention significantly improves latency compared to the CD-DPoS (Continuous Delegated ProofofStake, a consensus algorithm combining continuity and witness mechanisms) algorithm. Although the overall trend is a slow increase, the latency is lower than both CW-DPoS (Continuous Witness Delegated ProofofStake, a consensus algorithm combining continuity and witness mechanisms) and CD-DPoS methods when the number of network nodes is equal. Due to the use of parallel block production, the throughput is significantly higher than that of CD-DPoS. Furthermore, in the probability test of malicious node election, the probability of malicious nodes being elected decreases the fastest. Therefore, the method proposed in this invention has more efficient performance and a more significant ability to curb malicious nodes from disrupting consensus.

[0070] In the specific implementation of this invention, some minor steps utilize methods published in other literature and methods claimed in patents, such as PageRank-based node trustworthiness calculation, GN algorithm-based node activity measurement, comprehensive election mechanism, and credit incentive mechanism (e.g., Wangchun Li, Xiaohong Deng, Juan Liu, et al. Delegated Proof of Stake Consensus Mechanism Based on Community Discovery and Credit Incentive[J]. Entropy, 2023, 25: 1320.), which will not be described in detail here.

[0071] Example 2

[0072] This embodiment provides a DPoS consensus method based on community discovery and DAG, including the following steps:

[0073] Step 11: Nodes begin to vote randomly among themselves, and a voting time window is set. Voting stops when the time window ends.

[0074] Step 12: The system calculates the participation enthusiasm and trustworthiness of each node based on the voting results.

[0075] Step 13: Count the nodes that participated in the voting in the network.

[0076] Step 14: Calculate the appropriate number of accounting nodes according to formula (1):

[0077] n = D n ×Vote (1)

[0078] Where n represents the number of accounting nodes, D n The value represents the degree of centralization of the network, and its value is in the range of (0, 1). Vote represents the number of voting nodes in the network.

[0079] Step 15: Calculate the overall reputation value by combining the activity level and trustworthiness of the nodes, and select the number of accounting nodes calculated by the system in descending order of the overall reputation value.

[0080] Step 16: After the accounting node produces blocks in parallel using the DAG block production method, determine whether the accounting node has successfully produced a block;

[0081] Step 16.1: If the block generated by the accounting node is verified by other validating nodes, the accounting node and the voting nodes that voted for the accounting node will receive credit value rewards. At the same time, economic rewards will be given for the contribution made by the accounting node in packaging the block (using the credit incentive mechanism published in existing literature, which will not be described in detail here).

[0082] Step 16.2: If a ledger node fails to produce a block within the specified time or produces a block maliciously, the ledger node and the voting nodes that voted for the ledger node will have a specified credit value deducted according to the credit incentive mechanism published in existing literature.

[0083] Step 16.3: When a node's credit value falls below the threshold after deduction, the system will mark the node, add it to the blacklist, prohibit the node from participating in consensus again, and deduct the node's security deposit.

[0084] Step 17: The first round of consensus ends, and the next round of consensus begins.

[0085] This invention primarily improves the CD-DPoS (Chain Delegated ProofofStake) algorithm, renaming it the CD-DPoS_DAG method. First, it proposes an improved DAG structure to address the limitations of the blockchain's chain structure. Second, it delves into the selection of the number of accounting nodes to improve network efficiency. Finally, experiments further validate the improved method, demonstrating its high efficiency.

[0086] For specific limitations of the DPoS consensus method based on community discovery and DAG, please refer to the description in Example 1, which will not be repeated here.

[0087] Example 3

[0088] An accounting method is provided, which uses the DPoS consensus method based on community discovery and DAG as described in Example 1 or Example 2 to complete blockchain accounting.

[0089] For specific limitations of the DPoS consensus method based on community discovery and DAG, please refer to the description in Example 1, which will not be repeated here.

[0090] Example 4

[0091] In another embodiment, the present invention also provides a computer, including a processor and a memory storing a plurality of computer instructions, which, when executed by the processor, implement the steps of the DPoS consensus method based on community discovery and DAG.

[0092] For specific limitations of the DPoS consensus method based on community discovery and DAG, please refer to the description in Example 1, which will not be repeated here.

[0093] The memory and processor are electrically connected directly or indirectly to enable data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines. The memory stores a computer program that can run on the processor, which implements the method in the embodiments of the present invention by running the computer program stored in the memory.

[0094] The memory may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory stores the program, and the processor executes the program upon receiving an execution instruction.

[0095] The processor may be an integrated circuit chip with data processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.

[0096] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0097] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. A DPoS consensus method based on community discovery and DAG, characterized in that, The DPoS consensus method based on community discovery and DAG includes: Step S1: Calculate node information: Nodes randomly vote for each other, and after the voting ends, calculate the activity and trustworthiness of each node based on the voting results, and count the number of voting nodes that participated in the voting. Step S2: Set the number of accounting nodes: Calculate the number of accounting nodes based on the number of voting nodes and the degree of centralization of the blockchain network; Step S3: Comprehensive selection of accounting nodes: Calculate the comprehensive reputation value of the nodes based on their activity and trustworthiness. Select a specific number of nodes as accounting nodes in descending order of their comprehensive reputation values. The specific number is the number of accounting nodes set in step S2. Step S4, Reasonable Allocation of Rewards and Penalties: The accounting nodes adopt the DAG block production method to produce blocks in parallel. When the accounting node successfully produces a block or fails to produce a block normally, the accounting node and voting node are rewarded and penalized accordingly according to the incentive mechanism.

2. The DPoS consensus method based on community discovery and DAG as described in claim 1, characterized in that, The activity and trustworthiness of each node are calculated using the GN algorithm and the PageRank algorithm, respectively.

3. The DPoS consensus method based on community discovery and DAG according to claim 1, characterized in that, The calculation of the number of ledger nodes based on the number of voting nodes and the degree of centralization of the blockchain network includes: n=D n ×Vote In the formula, n represents the number of accounting nodes, and D n This indicates the degree of centralization of the blockchain network, and Vote represents the number of voting nodes.

4. The DPoS consensus method based on community discovery and DAG according to claim 1, characterized in that, The comprehensive reputation value of a node, calculated based on its activity and trustworthiness, includes: In the formula, I x Let Q(x) represent the overall reputation value of node x, Q(x) represent the activity level of node x, and k represent the overall reputation value of node x. x Let C represent the degree of node x, N represent the number of nodes that voted for node x, i.e., the trustworthiness of node x, and C represent the degree of node x. i V represents the credit value of node i. i Represents the number of votes cast by node i, η and Represents the weighting factor, where 5. The DPoS consensus method based on community discovery and DAG according to claim 1, characterized in that, The ledger nodes use a DAG-based block production method for parallel block production, including: Ledger nodes produce blocks in chronological order, with the earliest DAG block being the genesis block. The genesis block does not contain the hash value of the predecessor block, while other DAG blocks contain at least the hash value of the predecessor block. In addition, DAG blocks also include version number, timestamp, proof, transaction information, and the hash value of the current block. New blocks determine one or more parent blocks based on the propagation mode. In a blockchain, each node collects unprocessed transactions from the blockchain network, packages the transaction into a DAG block, broadcasts it to other nodes, and adds the DAG block to its own ledger.

6. The DPoS consensus method based on community discovery and DAG according to claim 1, characterized in that, When a ledger node successfully produces a block or fails to produce a block, the ledger node and voting nodes are rewarded and penalized according to the incentive mechanism, including: If the block produced by the ledger node is verified by other validators, the ledger node and the voting nodes that voted for the ledger node will receive credit rewards. In addition, the ledger node will also receive economic rewards for its contribution to packaging the block. If a ledger node fails to produce a block within the specified time or produces a block maliciously, then the ledger node and the voting nodes that voted for the ledger node will have their credit points deducted. When a node's credit score falls below a threshold after being deducted, the node will be marked and blacklisted, preventing it from participating in consensus again, and its security deposit will be deducted.

7. An accounting method, characterized in that, The aforementioned accounting method employs the DPoS consensus method based on community discovery and DAG as described in any one of claims 1 to 6 to complete blockchain accounting.

8. A computer device, comprising a processor and a memory storing a plurality of computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the DPoS consensus method based on community discovery and DAG as described in any one of claims 1 to 6.