Optimization method for proposal node selection of carbon general block chain consensus algorithm
By combining statistical methods and the performance prediction model of the Transformer-XL architecture with the maximum weighted independent set algorithm, outlier nodes are identified and excluded, solving the problem of inefficient proposal node selection in the blockchain consensus algorithm and achieving efficient and accurate node selection and network performance improvement.
Patent Information
- Application Number
- CN202511284961.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2045-09-10
AI Technical Summary
The selection of proposal nodes in existing blockchain consensus algorithms is inefficient and cannot effectively exclude nodes with abnormal performance, resulting in unstable network performance.
A carbon credit performance prediction model based on statistical methods and the Transformer-XL architecture is combined with the maximum weighted independent set algorithm. By calculating the mathematical mean and standard deviation of the consensus efficiency scores of candidate nodes, outlier nodes are identified, and the dynamic memory adjustment function is used to adjust the model parameters to generate a list of proposal nodes.
It significantly improves the accuracy and efficiency of proposal node selection, ensures that the selected nodes have excellent network performance and processing capabilities, and improves the overall consensus efficiency and stability of the blockchain network.
Smart Images

Figure CN120785520A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of carbon-inclusive blockchain technology, and specifically relates to an optimization method for selecting proposal nodes for a carbon-inclusive blockchain consensus algorithm. Background Art
[0002] Blockchain consensus algorithms are a core technology in distributed systems. Traditional proposal node selection methods rely primarily on random selection or static ranking mechanisms based on proof-of-stake. These methods are widely used in applications with high network performance requirements, such as carbon credit. Existing node selection mechanisms typically employ fixed screening criteria and lack in-depth analysis and dynamic evaluation of node historical performance, making it difficult to accurately identify and exclude outlier nodes in the network. In current blockchain consensus systems, due to the lack of effective statistical analysis methods and intelligent prediction mechanisms, outlier nodes with consensus efficiency scores significantly deviating from the normal range can still participate in the proposal process, resulting in decreased overall consensus efficiency and unstable network performance. In other words, existing technologies suffer from inefficient proposal node selection and an inability to effectively exclude outlier nodes. Summary of the Invention
[0003] In view of this, the present invention provides an optimization method for selecting proposal nodes of a carbon-inclusive blockchain consensus algorithm, which can solve the technical problems in the prior art that the selection of proposal nodes in the blockchain consensus algorithm is inefficient and cannot effectively exclude nodes with abnormal performance.
[0004] The present invention is implemented as follows: The present invention provides an optimization method for selecting proposal nodes of a carbon-inclusive blockchain consensus algorithm, including: a node starts a new epoch, records the current block height as a block height value, counts the total number of candidate nodes as the number of candidate nodes, assigns a candidate node sequence number to each candidate node, and queries the consensus efficiency score of each candidate node in the previous epoch on the chain; applies statistical methods to calculate the mathematical mean and standard deviation values of the consensus efficiency scores of all candidate nodes, judges whether the node score meets the outlier judgment condition based on the deviation adjustment coefficient, and marks the node that meets the outlier judgment condition as an outlier node; applies a carbon-inclusive performance prediction model and a dynamic memory adjustment function to evaluate and predict the network performance of the candidate node, removes the candidacy of the outlier node in this epoch, and applies the maximum weighted independent set algorithm to generate a proposal node list for this epoch; the proposal node performs block packaging proposal at a specified block height and broadcasts block data; the verification node performs transaction validity verification and status execution verification and votes for broadcasting; executes multiple rounds of voting verification processes and increases consensus participation points for participating nodes; after the block is submitted, the node score list is sent and written into the next block header.
[0005] The epoch refers to a time management unit in the blockchain system with a fixed number of blocks as a period, which is used to periodically adjust the qualifications of candidate nodes and update the identities of consensus participants.
[0006] The consensus efficiency score refers to a numerical indicator that quantifies the performance of a node during the consensus process. It is calculated by counting the effective participation and response speed of the node in each round of voting. The consensus efficiency score is calculated by dividing the number of successful votes each node participated in in the previous epoch by the total number of voting rounds and multiplying by 100.
[0007] Among them, the outlier judgment condition refers to the mathematical condition for judging whether a node is a performance abnormal node. When the difference between the mathematical mean and the node consensus efficiency score is greater than the product of the deviation adjustment coefficient and the standard deviation value, it is determined that the outlier judgment condition is met.
[0008] The deviation adjustment coefficient refers to a numerical parameter that controls the strictness of outlier node identification and is used to adjust the sensitivity of outlier determination. The deviation adjustment coefficient has a value range of 0.5 to 2.0.
[0009] Among them, the specific structure of the carbon credit performance prediction model is a time series prediction network based on the Transformer-XL architecture, which includes an encoder layer for processing node historical performance data, a decoder layer for generating future performance prediction results, and a memory mechanism for processing long sequences of node performance change patterns.
[0010] Among them, the number of memory fragments of the memory mechanism of the carbon credit performance prediction model is adjusted through a dynamic memory adjustment function according to the epoch cycle length and the number of candidate nodes. When the epoch cycle length value is large or the number of candidate nodes is large, the number of memory fragments is increased; when the epoch cycle length value is small or the number of candidate nodes is small, the number of memory fragments is reduced.
[0011] Among them, the dynamic memory adjustment function calculates the memory adjustment value based on the epoch period length, the number of candidate nodes and the network complexity index. The calculation formula of the memory adjustment value is the sum of the epoch period length divided by 100 plus the number of candidate nodes divided by 50 plus the network complexity index divided by 10 divided by 3.
[0012] Among them, when the memory adjustment value is in the range of 0 to 0.3, 8 basic memory fragments are used to adjust the memory mechanism parameters of the carbon credit performance prediction model; when the memory adjustment value is in the range of 0.3 to 0.7, 16 medium memory fragments are used; when the memory adjustment value is in the range of 0.7 to 1.0, 32 extended memory fragments are used.
[0013] Among them, the application steps of the maximum weight independent set algorithm specifically include constructing the remaining candidate nodes after removing the outlier nodes into a weighted undirected graph, with each candidate node as a vertex of the graph, the consensus efficiency score of the candidate node as the vertex weight, establishing edge connections of the graph based on the network connectivity and resource competition relationship between the candidate nodes, and applying a greedy algorithm or a dynamic programming algorithm to solve the maximum weight independent set of the weighted undirected graph.
[0014] Among them, before applying the carbon credit performance prediction model, it also includes the step of establishing a training data set, specifically including collecting historical operation data of multiple carbon credit blockchain networks, the historical operation data including node network delay time series, CPU usage time series, memory usage time series, block packaging success rate data, and voting response time data. The step of establishing the training data set specifically divides the historical operation data into a training sample set according to the time window, each training sample includes the node performance data in a continuous time period as the input feature vector and the performance data of the next time period as the prediction target vector, and the abnormal data is cleaned and standardized. The step of training the carbon credit performance prediction model specifically includes dividing the comprehensive training data set into a model training set and a model verification set in a ratio of 8 to 2, initializing the Transformer-XL model parameters and setting the initial number of memory segments to 16, and using the Adam optimization algorithm to train the model parameters. The steps of model parameter training specifically include setting the learning rate parameter to 0.001, the batch size parameter to 32, and the number of training rounds parameter to 100 rounds. During the training process, the number of memory segments is adjusted through the dynamic memory adjustment function according to the value of the model validation set loss function. When the value of the model validation set loss function does not improve for five consecutive training rounds, the early stopping mechanism is triggered.
[0015] The consensus participation points refer to the quantitative scores that record the contribution of the node in the consensus process. Each valid vote will increase the node's consensus participation points by 1.
[0016] The sufficient number refers to the minimum number of nodes required to ensure the credibility of the scoring list, and the sufficient number is equal to the number of candidate nodes minus the Byzantine fault tolerance parameter plus 1.
[0017] The present invention effectively identifies and excludes outlier nodes with abnormal consensus efficiency scores by introducing a statistical outlier detection method combined with a carbon credit performance prediction model based on the Transformer-XL architecture and a comprehensive node selection mechanism of the maximum weighted independent set algorithm, thereby significantly improving the accuracy and efficiency of proposal node selection. The dynamic memory adjustment function adopted by the present invention can adaptively adjust the prediction model parameters according to changes in the network environment, overcoming the limitation of the traditional static selection mechanism that cannot adapt to dynamic changes in the network, and ensuring that the selected proposal node has the best network performance and processing power. The present invention fundamentally solves the technical problems of low efficiency of proposal node selection and inability to effectively exclude abnormal performance nodes in the existing consensus algorithm through the organic combination of multiple rounds of statistical analysis, intelligent prediction evaluation and graph theory optimization algorithms. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a flow chart of the method of the present invention.
[0019] Figure 2 Schematic diagram of the division of epoch iteration stages. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0021] like Figure 1 FIG. 1 is a flowchart of an optimization method for selecting a proposal node for a carbon-inclusive blockchain consensus algorithm provided by the present invention. The method includes the following steps: S01. The node starts a new epoch, records the current block height as the block height value, counts the total number of candidate nodes as the number of candidate nodes, assigns a candidate node sequence number to each candidate node, and queries the consensus efficiency score of each candidate node in the previous epoch on the chain; S02. Apply statistical methods to calculate the mathematical mean and standard deviation of the consensus efficiency scores of all candidate nodes, determine whether the node score meets the outlier determination criteria based on the deviation adjustment coefficient, and mark the node that meets the outlier determination criteria as an outlier node; S03. Apply the carbon credit performance prediction model and dynamic memory adjustment function to evaluate and predict the network performance of candidate nodes, remove outlier nodes from the candidacy of this epoch, and apply the maximum weighted independent set algorithm to generate the list of proposed nodes for this epoch; S04. The proposal node proposes a block package at the specified block height and broadcasts the newly packaged block data to other verification nodes; S05. The verification node verifies the transaction validity and status of the block packaged by the proposal node. The verification node votes on the block based on the verification results and broadcasts the voting information to other nodes. S06. The consensus algorithm executes multiple rounds of voting verification process. After receiving a valid vote, the node increases the consensus participation points for the node that sent the vote. S07. After the block is submitted, each node sends the node score list to the proposal node at the next height. After the proposal node receives a sufficient number of score lists, it writes the score list data into the block header of the next block.
[0022] Among them, the epoch is a time management unit in the blockchain system with a fixed number of blocks as a period, which is used to periodically adjust the qualifications of candidate nodes and update the identities of consensus participants.
[0023] Among them, the block height value is the serial number identifier of the current latest block in the blockchain, which is used to determine the current status and progress of the blockchain.
[0024] Among them, the number of candidate nodes is the total number of blockchain nodes participating in the consensus algorithm candidate. The number of candidate nodes determines the scale and degree of decentralization of the consensus network.
[0025] The candidate node serial number is a unique identifier assigned to each candidate node, which is used to distinguish and track different network nodes during the execution of the algorithm.
[0026] The consensus efficiency score is a numerical indicator that quantifies the performance of a node during the consensus process. It is calculated by counting the effective participation and response speed of the node in each voting round. The consensus efficiency score is calculated by dividing the number of successful voting rounds of each node in the previous epoch by the total number of voting rounds and multiplying by 100.
[0027] The mathematical mean is the arithmetic mean of the consensus efficiency scores of all candidate nodes, and the calculation formula of the mathematical mean is the sum of the consensus efficiency scores of all candidate nodes divided by the number of candidate nodes.
[0028] The standard deviation value is a statistic that measures the degree of dispersion of the consensus efficiency scores of candidate nodes. The calculation formula for the standard deviation value is the square root of the sum of the squares of the differences between the scores of each node and the mathematical mean, divided by the number of candidate nodes.
[0029] The deviation adjustment coefficient is a numerical parameter that controls the strictness of outlier node identification and is used to adjust the sensitivity of outlier determination. The deviation adjustment coefficient has a value range of 0.5 to 2.0.
[0030] Among them, the outlier judgment condition is a mathematical condition for judging whether a node is a performance abnormal node. When the difference between the mathematical mean and the node consensus efficiency score is greater than the product of the deviation adjustment coefficient and the standard deviation value, it is determined that the outlier judgment condition is met.
[0031] Among them, outlier nodes are candidate nodes whose consensus efficiency scores deviate significantly from the normal range. Statistical methods are used to identify nodes whose network performance or processing power is below average.
[0032] Among them, the carbon credit performance prediction model is a node performance evaluation algorithm built based on machine learning technology, which is used to predict the network delay and processing power performance of candidate nodes in the carbon credit scenario.
[0033] Among them, the dynamic memory adjustment function is a calculation function used to adjust the memory parameters of the carbon credit performance prediction model, and dynamically optimizes the memory length setting of the model according to changes in the network environment.
[0034] Among them, the maximum weighted independent set algorithm is a classic optimization algorithm in graph theory, which is used to find a set of non-adjacent vertices with the largest total weight in a weighted graph. In this method, it is used to select the optimal proposal node combination.
[0035] Among them, the proposal node list is a list of nodes responsible for packaging blocks in this epoch, and the proposal node list contains high-performance candidate node identifiers screened by the algorithm.
[0036] Among them, the specified block height is the block number of the block packaging operation performed by the proposal node, and the specified block height is within the range of the current block height value plus 1 to the current block height value plus the epoch period length.
[0037] Among them, block data is a data structure containing transaction information, status updates and consensus proofs, which is organized and packaged by the proposal node.
[0038] Among them, the verification node is the blockchain network node responsible for verifying the validity of the block and participating in the voting. It is different from the proposal node but participates in the entire consensus process.
[0039] Among them, transaction validity verification is the process of verifying whether the transactions contained in the block comply with the blockchain rules and state transition requirements.
[0040] Among them, state execution verification is the process of simulating the execution of transactions in the block and verifying the correctness of state changes.
[0041] Among them, the voting information is a digitally signed message in which the verification node expresses support or opposition to the validity of the block.
[0042] Among them, the multi-round voting verification process is an iterative voting process to ensure that the block obtains sufficient consensus support. The number of rounds of the multi-round voting verification process is determined by the security requirements of the consensus algorithm.
[0043] Among them, the consensus participation points are quantitative scores that record the contribution of the node in the consensus process. Each valid vote will increase the node's consensus participation points by 1 point.
[0044] Among them, the node score list is a data list that records the consensus participation points obtained by all nodes in the current block consensus process.
[0045] Among them, the next height is the block number position of the current block height value plus 1.
[0046] The sufficient number is the minimum number of nodes required to ensure the credibility of the scoring list, and the sufficient number is equal to the number of candidate nodes minus the Byzantine fault tolerance parameter plus 1.
[0047] Among them, the Byzantine fault tolerance parameter is the maximum number of malicious or faulty nodes that the consensus algorithm can tolerate.
[0048] Among them, the scoring list data is structured information containing the consensus participation points of each node, which is used to update the historical consensus efficiency score of the node.
[0049] Among them, the block header is divided into the front part of the block data structure containing metadata information, which is used to store block summary and consensus-related information.
[0050] Among them, the specific structure of the carbon credit performance prediction model is a timing prediction network based on the Transformer-XL architecture, which includes an encoder layer for processing node historical performance data, a decoder layer for generating future performance prediction results, and a memory mechanism for processing long sequences of node performance change patterns. The number of memory segments of the memory mechanism is adjusted according to the epoch period length and the number of candidate nodes through a dynamic memory adjustment function. When the epoch period length is large or the number of candidate nodes is large, the number of memory segments is increased to capture more historical information. When the epoch period length is small or the number of candidate nodes is small, the number of memory segments is reduced to improve computational efficiency.
[0051] Among them, the step of establishing the training data set of the carbon credit performance prediction model specifically includes collecting historical operation data of multiple carbon credit blockchain networks, the historical operation data includes node network delay time series, CPU usage time series, memory usage time series, block packaging success rate data, and voting response time data, and dividing the historical operation data into training sample sets according to time windows. Each training sample includes node performance data in a continuous time period as input feature vectors and performance data of the next time period as prediction target vectors. Abnormal data is cleaned and standardized to establish a comprehensive training data set that includes the rules of node performance changes under different network conditions and loads.
[0052] Among them, the steps of training the carbon credit performance prediction model specifically include dividing the comprehensive training data set into a model training set and a model verification set in a ratio of 8 to 2, initializing the Transformer-XL model parameters and setting the initial number of memory segments to 16, using the Adam optimization algorithm to train the model parameters, setting the learning rate parameter to 0.001, the batch size parameter to 32, and the number of training rounds parameter to 100 rounds. During the training process, the number of memory segments is adjusted through the dynamic memory adjustment function according to the value of the model verification set loss function to optimize the model performance. When the value of the model verification set loss function does not improve for 5 consecutive training rounds, the early stopping mechanism is triggered, and the model parameters with the best performance of the model verification set are saved as the final training results.
[0053] Among them, the dynamic memory adjustment function is used to adjust the number of memory segments of the carbon inclusive performance prediction model. The dynamic memory adjustment function calculates a memory adjustment value based on the epoch period length, the number of candidate nodes and the network complexity index. The calculation formula of the memory adjustment value is the sum of the epoch period length divided by 100 plus the number of candidate nodes divided by 50 plus the network complexity index divided by 10 divided by 3. When the memory adjustment value is in the range of 0 to 0.3, the basic memory segment number of 8 is used to adjust the memory mechanism parameters of the carbon inclusive performance prediction model. When the memory adjustment value is in the range of 0.3 to 0.7, the medium memory segment number of 16 is used to adjust the memory mechanism parameters of the carbon inclusive performance prediction model. When the memory adjustment value is in the range of 0.7 to 1.0, the extended memory segment number of 32 is used to adjust the memory mechanism parameters of the carbon inclusive performance prediction model.
[0054] Among them, the application steps of the maximum weight independent set algorithm specifically include constructing the remaining candidate nodes after removing the outlier nodes into a weighted undirected graph, with each candidate node as a vertex of the graph, and the consensus efficiency score of the candidate node as the vertex weight. The edge connection of the graph is established according to the network connectivity and resource competition relationship between the candidate nodes. The weight of the edge represents the intensity of resource competition between nodes. The greedy algorithm or dynamic programming algorithm is applied to solve the maximum weight independent set of the weighted undirected graph, and the candidate nodes corresponding to the vertices in the maximum weight independent set are used as the proposal node list of this era.
[0055] The epoch length refers to the number of blocks contained in each new epoch and is used to control the interval between candidate node qualification adjustments. The epoch length ranges from 100 to 1000 blocks. The network complexity index is a numerical parameter that measures the topology and communication complexity of a blockchain network. It is calculated based on inter-node connectivity and geographical distribution and ranges from 1 to 100. The number of memory segments refers to the number of data segments used to store historical information in the carbon inclusive performance prediction model, which affects the model's ability to learn long-term dependencies. The memory adjustment value is the output of the dynamic memory adjustment function, which is used to determine the level of memory segments that should be used in the carbon inclusive performance prediction model. A weighted undirected graph is a data structure in graph theory consisting of a set of vertices and edges, with each vertex and edge assigned a numerical weight. The vertex weight is the numerical value assigned to each vertex in the weighted undirected graph and, in this method, corresponds to the overall performance score of the candidate node. The resource contention intensity is a numerical indicator that measures the degree of competition between two candidate nodes for hardware resources or network bandwidth. The greedy algorithm is a heuristic algorithm for solving the maximum weighted independent set problem, which gradually builds a global solution through local optimal selection. The dynamic programming algorithm is an exact algorithm for solving the maximum weighted independent set problem, which finds the optimal solution by decomposing subproblems and state transition equations.
[0056] The specific implementation of the above steps is described in detail below.
[0057] In the specific implementation of step S01, the system first detects the start signal of a new epoch and initiates the node selection and optimization process. The system obtains the sequence number of the most recent block through the blockchain status query interface as the block height value, which is used to determine the starting position and time anchor point for algorithm execution. The system then traverses all active nodes in the blockchain network and counts the total number of nodes that meet the candidacy criteria. Candidacy criteria include a node's online time exceeding 80% of the epoch period, the node's hardware configuration meeting minimum performance requirements, and a node network connectivity test pass rate exceeding 95%. For each eligible node, the system assigns a unique candidate node sequence number based on the time it first joined the network. The sequence number uses an ascending integer encoding method to ensure uniqueness and traceability of the node identifier. After completing the node count and numbering, the system queries each candidate node's consensus efficiency score in the previous epoch through the smart contract interface. This score reflects the node's participation and responsiveness in the consensus process. The query process uses a batch read mechanism to improve data acquisition efficiency.
[0058] The specific implementation method of step S02 is that the system applies descriptive statistical methods to perform data analysis on the collected candidate node consensus efficiency scores. First, the arithmetic mean of the scores of all candidate nodes is calculated as the mathematical mean, which represents the average performance level of the nodes in the network. The standard deviation value of the score is then calculated to measure the discrete degree and distribution characteristics of the node performance. The standard deviation is calculated using the sample standard deviation formula to obtain an unbiased estimate. The system sets the sensitivity threshold for outlier judgment based on the preset deviation adjustment coefficient. The recommended value of the deviation adjustment coefficient is 1.5. This value can achieve a good balance between identifying abnormal nodes and maintaining the size of the candidate pool. For each candidate node, the system checks whether its consensus efficiency score meets the outlier judgment condition, that is, when the difference between the mathematical mean and the node score exceeds the product of the deviation adjustment coefficient and the standard deviation, the node is marked as an outlier node. This outlier detection method based on statistical principles can effectively identify nodes whose performance deviates significantly from the normal range and prevent inefficient nodes from affecting the overall consensus efficiency.
[0059] In step S03, the system initiates a carbon credit performance prediction module to evaluate the network performance of the remaining candidate nodes. This prediction model, based on a time-series neural network architecture, predicts future network latency and processing power based on the node's historical performance data. The system inputs the candidate node's historical performance feature vector, including key metrics such as network latency, CPU usage, and memory usage. The prediction model outputs the node's expected performance score in the next epoch. A dynamic memory adjustment function automatically adjusts the prediction model's memory mechanism parameters based on the current network complexity and candidate node size, ensuring the model's adaptability to network environments of varying sizes and complexities. The system then removes all nodes marked as outliers from the candidate pool to ensure the basic performance quality of the proposed nodes. After completing performance prediction and removing outlier nodes, the system applies a maximum-weighted independent set algorithm to select the optimal combination of proposed nodes. This algorithm constructs the remaining candidate nodes into a weighted graph structure, using the node's comprehensive performance score as the vertex weight and the resource competition relationship between nodes as the edge weight. By solving the maximum-weighted independent set problem, the proposed node list is obtained as a set of non-conflicting nodes with the highest total weight.
[0060] In step S04, the system determines the block packaging timing for each proposing node based on the list of proposing nodes and the block production scheduling strategy. The scheduling strategy uses a round-robin mechanism to ensure that each proposing node has a fair chance at block production. When the specified block height is reached, the corresponding proposing node initiates the block packaging process. This process begins by selecting pending transactions from the transaction pool. The transaction selection strategy comprehensively considers factors such as transaction fees, transaction priority, and block space constraints. The proposing node verifies the validity of selected transactions, including digital signature verification, balance sufficiency checks, and transaction format compliance checks, to ensure that all included transactions comply with the blockchain protocol specifications. Verified transactions are organized into a Merkle tree structure, generating a transaction root hash value as a key component of the block header. The proposing node constructs a complete block data structure, including necessary fields such as the block header, transaction list, and state root hash, and digitally signs the entire block to verify its origin and integrity. After completing block packaging, the proposing node immediately broadcasts the new block data to all validating nodes via a peer-to-peer network protocol. This broadcast utilizes a hierarchical propagation mechanism to improve transmission efficiency and network coverage.
[0061] The specific implementation of step S05 is that upon receiving a new block, the validator node immediately initiates the block verification process. First, it performs a compliance check on the basic format and structure of the block, including basic verification items such as the integrity of the block header fields, block size limit, and timestamp validity. The system then performs a detailed validity check on each transaction contained in the block. This verification process includes key steps such as cryptographic verification of transaction signatures, verification of the sufficiency of the sender's account balance, and verification of the correctness of smart contract execution. After completing the transaction validity check, the validator node simulates the execution of all transactions in the block to verify the correctness of state transitions. This execution process uses a virtual machine environment to ensure the determinism and reproducibility of state changes. The system calculates the hash value of the new state root after execution and compares it with the state root declared in the block header to ensure the consistency and accuracy of state transitions. Based on the verification results, the validator node generates the corresponding voting information, which uses digital signature technology to ensure the authenticity and unforgeability of the votes. The validator node broadcasts the voting information to other network nodes via the network protocol. The voting message contains key information such as the block hash, voting results, node identification, and digital signature. The broadcast mechanism uses an optimized propagation algorithm to reduce network latency and bandwidth consumption.
[0062] The specific implementation of step S06 involves the consensus algorithm executing a multi-round voting verification mechanism designed based on Byzantine fault tolerance theory to ensure that a block can be officially confirmed only after sufficient network consensus support. The system typically sets the number of voting rounds to three, with each round having a clear time window limit, recommended at 30 seconds. Votes not received within the time window will be deemed invalid. During each voting round, nodes collect voting information from other validating nodes and verify the validity of the votes, including cryptographic verification of voting signatures, identity verification of voting nodes, and format verification of voting content. The system counts the number of nodes supporting and opposing the block in each voting round. When the number of supporting votes exceeds two-thirds of the total number of validating nodes, consensus is reached in that round; otherwise, the next voting round proceeds. For each node that submits a valid vote, the system automatically awards it a consensus participation point. This point accumulation mechanism incentivizes nodes to actively participate in the consensus process and maintain network activity. The multi-round voting mechanism is designed to prevent abnormal situations such as network partitions, node failures, and malicious attacks, and improves the security and reliability of block confirmation through a progressive consensus confirmation process.
[0063] The specific implementation of step S07 is that after a block has achieved sufficient consensus support and has been formally submitted to the blockchain, each validator node compiles the performance records of all nodes during the current consensus round and generates a node score list containing node identifiers and corresponding consensus participation points. The score list uses a structured data format to ensure data integrity and parsability. The list records each node's specific performance and points earned during the current block's consensus process. Each validator node transmits the node score list to the designated proposing node at the next higher level via a secure communication protocol. The transmission process utilizes digital signatures and encryption mechanisms to ensure data authenticity and confidentiality. The proposing node at the next higher level continuously collects score lists from each validator node and stops collecting when the number of collected score lists reaches a sufficient threshold. This threshold is equal to the total number of candidate nodes minus the Byzantine Fault Tolerance parameter plus 1. The Byzantine Fault Tolerance parameter is typically set at one-third of the total number of candidate nodes. The proposing node aggregates and verifies the consistency of the collected score lists, and uses a majority voting mechanism to determine the final node score result, resolving potential scoring discrepancies. The aggregated score list data is written into the header of the next block, becoming a permanent record of the blockchain state and providing historical basis for node selection in subsequent epochs. This blockchain-based point recording mechanism ensures the transparency, immutability, and traceability of node performance data.
[0064] The carbon credit performance prediction model utilizes a deep neural network based on the Transformer-XL architecture, which effectively models long sequences of data using a self-attention mechanism and relative position encoding techniques. The model's encoder layer processes historical node performance data, including multi-dimensional feature vectors such as network latency time series, CPU usage time series, and memory usage time series. The encoder uses a multi-head attention mechanism to capture correlations and dependencies between different performance metrics. The decoder layer generates predictions of future node performance based on the encoder output. These predictions include key performance parameters such as expected network latency, processing capacity estimates, and stability metrics. The model's memory mechanism utilizes a segmented recurrent memory design, enabling it to store and utilize historical information beyond the current input window. The number of memory segments dynamically adjusts based on network size and complexity: the basic configuration has 8 memory segments, the medium configuration has 16 memory segments, and the extended configuration has 32 memory segments. A dynamic memory adjustment function calculates a memory adjustment value based on the epoch length, the number of candidate nodes, and network complexity. When the adjustment value is small, the basic memory configuration is used to improve computational efficiency; when the adjustment value is large, the extended memory configuration is used to enhance the model's ability to learn long-term dependencies.
[0065] The training dataset construction process first requires collecting historical operational data from multiple operating carbon-inclusive blockchain networks. The recommended data collection period covers at least six months of network operation to ensure data representativeness and integrity. Collected historical operational data includes time series data on node network latency, sampled every minute, recording the communication delay between the node and other nodes in the network. CPU usage time series data records the node processor load, sampled every 30 seconds, reflecting the node's computing resource consumption pattern. Memory usage time series data monitors the node's memory usage, also sampled every 30 seconds, and is used to assess the node's resource management efficiency. Block packaging success rate data measures the success rate of block production when a node acts as a proposal node, calculated using epochs as the statistical period. Voting response time data records the node's voting response speed during the validation process, reflecting the node's consensus participation efficiency. The data preprocessing phase begins with a quality check of the collected raw data, identifying and marking anomalous data points, including abnormal readings caused by sensor failures, data loss due to network outages, and performance fluctuations caused by system restarts. Abnormal data is processed using statistical methods. Isolated outliers are corrected using interpolation, and continuous outlier intervals are filled with the average of the preceding and following data. Data normalization uses the Z-score method to convert performance indicators of different dimensions into standardized values, eliminating the impact of dimensional differences on model training. Time window partitioning divides the normalized data into training samples based on fixed time lengths. Each sample contains 72 consecutive hours of historical performance data as the input feature vector and the performance data of the following 24 hours as the predicted target vector. This partitioning method enables the model to learn the patterns and trends of short-term performance changes.
[0066] The model training process adopts stratified sampling method to divide the comprehensive training data set into model training set and model validation set according to the ratio of 8 to 2, to ensure the consistency of training set and validation set in data distribution. The initialization of Transformer-XL model parameters adopts Xavier initialization method to ensure the stability of signal propagation between network layers, and the initial memory segment number is set to 16 as the starting configuration of training. The training process adopts Adam optimization algorithm to update the model parameters iteratively. Adam algorithm combines the advantages of momentum method and adaptive learning rate, which can realize stable convergence on the surface of complex loss function. The learning rate parameter is set to 0.001, which can ensure the stability of training while providing sufficient parameter update amplitude. The batch size parameter is set to 32, which balances the calculation efficiency and gradient estimation accuracy, avoiding excessive variance of gradient estimation or waste of computing resources. The number of training rounds is set to 100 rounds, which provides sufficient learning time for the model to converge to the optimal parameter configuration. During the training process, the system continuously monitors the loss function value of the model on the validation set. When the loss value decreases and the trend tends to be flat, the dynamic memory adjustment function adjusts the number of memory segments according to the current learning state, increases the number of memory segments to improve the expression ability of the model, and reduces the number of memory segments to prevent overfitting. The trigger condition of early stopping mechanism is set as the loss function value of the validation set does not improve for 5 consecutive training rounds. At this time, it is considered that the model has reached the optimal state, and further training may cause overfitting problem. The system saves the model parameters with the best performance on the validation set as the final training result, ensuring that the deployed model has the best generalization ability and prediction accuracy.
[0067] The key technical concepts of this invention are primarily reflected in the following aspects. First, a statistically based outlier node identification technique is employed. This technique calculates the mean and standard deviation of the consensus efficiency scores of candidate nodes to establish a mathematical model for outlier determination, automatically identifying nodes whose performance significantly deviates from the normal range. Compared to traditional fixed-threshold filtering methods, statistical methods can dynamically adjust the determination criteria based on the overall network performance distribution, avoiding misjudgments caused by changes in the network environment and improving the accuracy and adaptability of node screening. Second, the application of a carbon credit performance prediction model, based on the Transformer-XL architecture, is capable of processing long-sequence data and capturing long-term dependencies. Compared to traditional rule-based or simple statistical methods for node evaluation, deep learning models can automatically learn complex performance variation patterns from historical data, providing more accurate node performance predictions and mitigating the problem of decreased consensus efficiency caused by inaccurate performance estimates. Third, the innovative application of the maximum weighted independent set algorithm in proposal node selection transforms the node selection problem into a graph optimization problem. By comprehensively considering node performance weights and resource competition, the algorithm can select an optimal node combination that combines high performance with no conflicts. Compared to traditional greedy or random selection methods, the Maximum Weighted Independent Set algorithm can optimize node configuration from a global perspective, maximizing overall consensus efficiency while avoiding performance disruptions caused by resource competition. Fourthly, a dynamic memory adjustment mechanism is introduced. This mechanism adaptively adjusts the memory parameters of the prediction model based on network size and complexity, achieving a dynamic balance between computational efficiency and prediction accuracy.
[0068] The synergistic effect of these key technical ideas has produced significant technical effects and advantages. Statistical outlier detection provides high-quality data input for the performance prediction model. By removing anomalous nodes, it prevents noise data from interfering with model learning, thereby improving the training effect and generalization ability of the prediction model. The accurate prediction results of the performance prediction model provide a reliable node weight assessment for the maximum weighted independent set algorithm, enabling the algorithm to make optimal selections based on accurate performance information, improving the scientific nature and effectiveness of node selection. The dynamic memory adjustment mechanism ensures the adaptability and stability of the performance prediction model in different network environments, providing continuous and reliable technical support for the entire system. This multi-technology integrated design has greater robustness and higher overall performance than traditional single-technology solutions, and can maintain stable and efficient consensus operations in complex and changing blockchain network environments.
[0069] It should be noted that the present invention also solves the following technical problems: First, it solves the technical problem of insufficient accuracy in node performance prediction in the blockchain consensus algorithm. Traditional node performance evaluation methods mainly rely on static indicator analysis, which cannot accurately predict the future performance of nodes in a dynamic network environment, resulting in the selected proposal node possibly experiencing performance degradation during the actual consensus process. The present invention constructs a carbon credit performance prediction model based on the Transformer-XL architecture, uses the encoder layer to process node historical performance data including multi-dimensional features such as network delay time series, CPU usage time series, and memory usage time series, combines the decoder layer to generate future performance prediction results, and uses a memory mechanism to process long sequences of node performance change patterns, significantly improving the accuracy and reliability of node performance prediction. Second, it solves the technical problem of the lack of adaptability of memory mechanism parameter configuration in the blockchain consensus system. Existing blockchain performance prediction models based on deep learning usually use fixed memory parameter settings, which cannot be dynamically adjusted according to changes in network scale and complexity, resulting in unstable performance of the model in different network environments. The present invention designs a dynamic memory adjustment function, calculates the memory adjustment value based on the epoch period length, the number of candidate nodes and the network complexity index, and automatically selects the number of basic, medium or extended memory segments according to different value ranges, thereby realizing the intelligent configuration of the memory mechanism parameters and ensuring that the prediction model can maintain the optimal learning ability and prediction accuracy under various network conditions.
[0070] Specifically, the principle behind this invention is that it addresses the core technical issues of inefficient proposal node selection and the inability to effectively exclude outlier nodes by employing a multi-level node evaluation and screening mechanism. First, by calculating the mathematical mean and standard deviation of the consensus efficiency scores of candidate nodes, a scientific statistical foundation is established, providing a quantitative standard for identifying outlier nodes. The introduction of a deviation adjustment coefficient further enhances the flexibility and accuracy of outlier determination. Second, the carbon credit performance prediction model based on the Transformer-XL architecture processes historical node performance data through an encoder layer, generates future performance predictions through a decoder layer, and uses a memory mechanism to process long sequences of node performance change patterns, enabling accurate predictions of node network latency and processing power in carbon credit scenarios. A dynamic memory adjustment function dynamically adjusts the number of memory segments based on the epoch length, the number of candidate nodes, and network complexity indicators to ensure that the prediction model consistently maintains optimal performance. Finally, the maximum weighted independent set algorithm constructs candidate nodes as a weighted undirected graph. By finding the set of non-adjacent vertices with the largest sum of weights, it ensures that the selected proposal node not only has high performance but also avoids resource contention conflicts. The logical rigor of this multi-level screening mechanism lies in its progressive process from statistical exclusion of anomalies, intelligent prediction and evaluation of performance to graph theory optimization selection. Each step provides a more reliable data foundation for the next step, ultimately achieving efficient and accurate proposal node selection.
[0071] A specific embodiment 1 of the present invention is provided below. The specific implementation of each step in this embodiment 1 is described in detail as follows.
[0072] In this embodiment, the specific implementation of step S01 is the same as above and will not be described in detail here.
[0073] The specific implementation of step S02 is that the system applies statistical methods to perform data analysis on the consensus efficiency scores of candidate nodes. The specific expression of mathematical mean calculation is as follows: ; Where, It is the mathematical mean of the consensus efficiency scores of all candidate nodes; For the The consensus efficiency score of candidate nodes; is the number of candidate nodes; The candidate node number ranges from 1 to .
[0074] The specific expression of standard deviation numerical calculation is as follows: ; Where, The standard deviation of the candidate node consensus efficiency score; is the square of the difference between each node score and the mathematical mean; the meanings of other variables are the same as above.
[0075] The specific expression of the outlier judgment condition is as follows: ; Where, is the deviation adjustment coefficient, the value range is 0.5 to 2.0, and the recommended value is 1.5; when the inequality condition is met, the The candidate nodes are judged as outlier nodes; the meanings of other variables are the same as above. The parameter acquisition method is: The query is obtained through the blockchain smart contract interface. The query process includes step 1: connecting to the blockchain network node and establishing an RPC communication connection; step 2: calling the smart contract's historical score query function, passing in the node identifier and epoch number parameters; step 3: parsing the returned score data and performing data type conversion. The statistics are obtained by traversing the candidate node list. The statistical process includes step 1: obtaining the candidate node registration list of the current epoch; step 2: filtering the active nodes that meet the qualification conditions; step 3: counting the total number of filtered nodes. The recommended range is 1.0 to 2.0.
[0076] The specific implementation of step S03 is that the system applies a dynamic memory adjustment function to calculate the memory adjustment value, which is specifically expressed as follows: ; Where, To memorize the adjustment value, the value range is 0 to 1.0; The length of the epoch period ranges from 100 to 1000 blocks; is the network complexity index, ranging from 1 to 100; the meanings of other variables are the same as above.
[0077] The specific expression for determining the number of memory segments based on the memory adjustment value is as follows: ; Where, The number of memory segments used in the carbon credit performance prediction model; the meanings of other variables are the same as above. The parameter acquisition method is: The configuration process includes step 1: reading the governance parameter configuration file of the blockchain network; step 2: parsing the epoch period length configuration item; step 3: verifying the legitimacy of the parameter value and loading it into the system memory. It is obtained by network topology analysis. The analysis process includes step 1: collecting the connection information and geographical distribution data of all nodes in the network; step 2: calculating the average degree centrality and clustering coefficient of the network graph; step 3: calculating the network complexity index by weighted average based on the degree centrality and clustering coefficient.
[0078] The specific implementation of steps S04-S05 is the same as above and will not be repeated here.
[0079] The specific implementation of step S06 is that the system performs multiple rounds of voting verification process and calculates the consensus participation points. The specific expression of the consensus efficiency score calculation is as follows: ; Where, For the The consensus efficiency score of each node has the same meaning as the variable in step S02; For the The number of times a node successfully participated in voting in the previous epoch; is the total number of voting rounds in the previous epoch; other variables have the same meanings as above.
[0080] The specific representation of consensus participation points accumulation is as follows: ; Where, For the The consensus participation points of each node in the current block; For the The initial score of each node before the start of the current block; The number of voting rounds in the current block consensus process; For the The increment of voting points in a round, when voting is effective , when an invalid vote is cast ; is the voting round number. The parameter acquisition method is: The data is obtained by counting the voting records of the nodes. The counting process includes step 1: querying all voting transactions of the specified epoch from the blockchain historical data; step 2: filtering out the valid voting transactions initiated by the target node; step 3: counting the total number of valid voting transactions. Obtained through epoch voting statistics. The statistical process includes step 1: determining the start and end block heights of the target epoch; step 2: traversing the voting round records of all blocks in the epoch; step 3: accumulating the number of voting rounds of all blocks.
[0081] The specific implementation of step S07 is that the system collects the node score list and writes it into the block header. The specific representation of sufficient number calculation is as follows: ; Where, A sufficient number to ensure the credibility of the scoring list; is the Byzantine fault tolerance parameter, usually set to ; is the floor rounding function; the other variables have the same meanings as above. The parameter acquisition method is: The calculation is obtained using the Byzantine fault tolerance theory. The calculation process includes step 1: determining the total number of candidate nodes ; Step 2: Calculate Divide the quotient by 3; Step 3: Round down the quotient to obtain the Byzantine fault tolerance parameter.
[0082] It should be noted that in the specific structure of the carbon credit performance prediction model, the design of the dynamic memory adjustment function is based on the network adaptability theory, and the intelligent adjustment of the model memory mechanism is achieved by comprehensively considering the three key factors of the epoch period length, the number of candidate nodes and the network complexity. The three influencing factors are standardized and then equally weighted to ensure the stability and predictability of the adjustment mechanism. When the network is large or complex, the function automatically increases the number of memory segments to enhance the model's long-term dependency learning ability. When the network environment is relatively simple, the function reduces the number of memory segments to improve computational efficiency. This dynamic adjustment mechanism significantly improves the adaptability and prediction accuracy of the prediction model in different network environments compared to fixed parameter configurations.
[0083] The mathematical mean and standard deviation calculation formulas follow classical statistical theory and provide a scientific basis for outlier detection by quantifying the central tendency and dispersion of the performance distribution of candidate nodes. The mathematical mean reflects the overall performance level of network nodes, while the standard deviation measures the consistency of the performance distribution. Together, they form a complete statistical description system. Compared to traditional fixed-threshold filtering methods, the statistically based dynamic threshold adaptively adjusts the judgment criteria based on the actual performance distribution of the network, avoiding over- or under-filtering caused by changes in the network environment and significantly improving the accuracy and robustness of node screening.
[0084] The outlier judgment condition uses the standard deviation multiple method, which compares the deviation degree of the node score from the mean and the multiple relationship of the standard deviation. , to achieve automatic identification of abnormal nodes. The core principle of this method is based on the normal distribution theory, using standard deviation as a standard scale to measure the degree of deviation, and adjusting the multiple coefficient Achieve flexible control over the strictness of judgment. Compared with the absolute threshold judgment method, this relative threshold method can adapt to the differences in performance distribution in different network environments, provide better environmental adaptability while maintaining the effectiveness of the judgment, and effectively prevent the negative impact of inefficient nodes on the consensus process.
[0085] Consensus efficiency score calculation formula By quantifying a node's participation rate in the voting process, an objective performance evaluation system is established. This formula, expressed as a percentage, makes scores comparable across epochs, providing a standardized data foundation for historical performance analysis and trend forecasting. The calculation comprehensively considers a node's number of successful votes and total voting opportunities, accurately reflecting its consensus participation and technical reliability. Compared to simple online time statistics, this method more accurately assesses a node's actual contribution value, providing a more reliable historical basis for subsequent node selection.
[0086] Consensus participation points accumulation formula An incremental calculation method is used to record node performance during the consensus process of a single block through round-by-round accumulation. This formula takes into account vote validity verification. Only verified votes are rewarded with points, incentivizing nodes to provide high-quality consensus services. This incremental design synchronizes the point calculation process with the consensus process, avoiding data inconsistencies that may arise from post-calculation. Compared to traditional fixed reward mechanisms, this dynamic point system can more accurately quantify node contributions, providing technical support for building a fair and transparent incentive mechanism.
[0087] Sufficient quantity calculation formula Based on the Byzantine fault tolerance theory, it ensures that credible scoring results can be obtained even in the presence of malicious nodes. The formula is calculated by subtracting the maximum possible number of malicious nodes. The addition of 1 ensures that the number of collected scoring lists is sufficient to resist Byzantine attacks. This formula design reflects the security requirements of distributed systems, striking a balance between efficiency and security. Compared to simple majority voting mechanisms, this Byzantine fault-tolerant design can guarantee system correctness and reliability under more stringent security assumptions, providing stronger security for blockchain consensus algorithms.
[0088] To better understand and implement the present invention, Example 2 of a specific application scenario is provided below: The technical team discovered that the traditional proof-of-stake consensus algorithm suffers from inefficiency and poor node selection when processing large-scale node networks. In particular, when the network size exceeds 500 candidate nodes, consensus confirmation time increases significantly, affecting the platform's real-time performance. To address this technical challenge, the technical team decided to adopt the proposed node selection optimization method for the Carbon Inclusive Blockchain Consensus Algorithm.
[0089] The technical team first collected basic information and historical performance data for all candidate nodes in the current network. At the start of epoch 127, the system recorded a current block height of 63,500, with a total of 480 eligible nodes in the network. The technical team assigned each candidate node a unique serial number, from 1 to 480, based on the chronological order of their joining the network. The system then queried the consensus efficiency score of each candidate node in epoch 126 through a smart contract interface. These scores reflect each node's participation and responsiveness in the voting process during the previous epoch. Basic information about the candidate nodes is shown in Table 1.
[0090] Table 1 Basic information of candidate nodes
[0091] The technical team then launched the statistical analysis module to process the consensus efficiency scores of the 480 candidate nodes collected. Through calculation, it was found that the mathematical mean of the consensus efficiency scores of all candidate nodes is , standard deviation value . System setting deviation adjustment coefficient Based on this, the outlier threshold was calculated to be 18.6. After outlier detection, the technical team discovered that the consensus efficiency scores of 23 nodes significantly deviated from the normal range. These nodes primarily exhibited issues such as excessive network latency, slow voting response, or unstable device performance. The statistical analysis results of the node consensus efficiency scores are shown in Table 2.
[0092] Table 2 Node consensus efficiency score statistics
[0093] The technical team then applied the carbon inclusive performance prediction model to evaluate the network performance of the remaining 457 candidate nodes. blocks, number of candidate nodes , network complexity index The memory adjustment value is calculated by the dynamic memory adjustment function. .because The value is in the range of 0.7 to 1.0, and the system automatically selects the number of extended memory segments. The performance prediction model is configured using the 72-hour historical performance data of each node, including network latency time series, CPU usage series, and memory usage series. The prediction model generates a performance prediction score for the next epoch. The performance prediction results are shown in Table 3.
[0094] Table 3 Performance prediction results
[0095] The technical team then applied the Maximum Weighted Independent Set algorithm to select the optimal combination of proposal nodes. The algorithm constructed a weighted undirected graph of 457 valid candidate nodes, using each node's comprehensive performance score as the vertex weight and the resource competition between nodes as the edge weight. By analyzing the geographic distribution of nodes and hardware resource configuration, the technical team determined the node competition intensity matrix. The algorithm employed dynamic programming to solve the Maximum Weighted Independent Set problem, ultimately selecting 25 mutually non-conflicting nodes with the highest total weight as proposal nodes for epoch 127. These 25 proposal nodes were geographically distributed across major regions of China, all possessed Grade A hardware configurations, and had expected network latency below 30ms. Information on the final selected proposal nodes is shown in Table 4.
[0096] Table 4 Proposal node selection results
[0097] During the actual operation of Epoch 127, the system strictly followed the optimized consensus process. When block height reached 63501, the proposal node, numbered 001, began the block packaging operation, selecting 2,847 carbon emissions transactions from the transaction pool for packaging, with a transaction verification pass rate of 99.8%. Block data was immediately broadcast to other validating nodes upon generation, with an average propagation delay of only 1.2 seconds. Upon receiving the block, the validating nodes quickly completed validity checks and status verification, with the entire verification process taking an average of 2.8 seconds. During the subsequent three rounds of voting, a total of 452 validating nodes participated, with a response rate of 98.9% and an average confirmation time of 6.5 seconds per round. Based on the voting results, the system awarded consensus participation points to nodes that participated in the valid votes, totaling 1,356 valid voting points.
[0098] After the end of epoch 127, the technical team collected the node score lists submitted by each verification node. According to the Byzantine fault tolerance theory, the system needs to collect enough Scoring lists. 312 valid scoring lists were actually collected, meeting the credibility requirements. The proposal nodes in epoch 128 aggregated and verified the collected scoring lists, using a majority voting mechanism to resolve scoring discrepancies. The finalized score data was written into the block header at block height 63701, becoming a permanent record on the blockchain.
[0099] To evaluate the technical effectiveness of the proposed algorithm, the technical team conducted comparative tests on the optimized solution against a traditional proof-of-stake consensus algorithm. This traditional approach uses a fixed node polling mechanism to select proposing nodes, lacks performance prediction and outlier detection capabilities, and exhibits significant performance bottlenecks when handling large-scale node networks. The comparative test results are shown in Table 5.
[0100] Table 5 Comparison between traditional method and the method of the present invention
[0101] Traditional approaches to addressing the core technical issues of this invention primarily include simple random selection algorithms, stake-based polling mechanisms, and fixed-threshold performance filtering methods. These traditional methods exhibit significant technical limitations when dealing with large-scale distributed networks, primarily manifested in the lack of intelligent node performance evaluation mechanisms, the inability to effectively identify and exclude abnormal nodes, overly simplistic node selection strategies, and a lack of global optimization considerations. The technological advancement of this invention over traditional approaches lies primarily in the introduction of a statistically based outlier detection mechanism that automatically identifies and promptly excludes nodes with abnormal performance, significantly improving the overall stability and reliability of the consensus network. The application of a carbon-inclusive performance prediction model enables the system to accurately predict future node performance based on historical data, providing a scientific basis for node selection and avoiding the limitations of traditional methods that rely on static information. The innovative application of the maximum-weighted independent set algorithm achieves global optimization in proposal node selection, ensuring that the selected node combination is both high-performance and avoids resource contention, resulting in better overall results than traditional greedy selection methods. The introduction of a dynamic memory adjustment mechanism enables the performance prediction model to adaptively adjust parameter configuration based on network scale and complexity, achieving a dynamic balance between computational efficiency and prediction accuracy, addressing the inability of traditional fixed parameter configurations to adapt to complex network environments.
[0102] The following is another specific application scenario of the present invention, Example 3: A technical team is responsible for developing an atmospheric environment quality monitoring network system based on blockchain technology. The system needs to process data from air quality monitoring stations across the country in real time. Concentration data, Emissions data and During system operation, the technical team discovered that as the number of monitoring sites increased, the traditional consensus algorithm experienced significant performance degradation when processing high-frequency environmental data. In particular, in severe weather conditions, the network connection of some monitoring nodes became unstable, significantly reducing the efficiency of the entire consensus network. To address this key technical issue, the technical team decided to adopt the proposed node selection optimization method for the Carbon Inclusive Blockchain Consensus Algorithm.
[0103] The technical team started a new consensus process at the beginning of epoch 45, and the current block height , there are a total of Environmental monitoring candidate nodes are distributed in major regions such as North China, East China, and South China. The candidate node numbers are arranged in the order of geographical location and time of joining the network, and the number range is The technical team queries each candidate node through the blockchain smart contract interface in the 44th epoch ( epoch) consensus efficiency score These scores are calculated based on comprehensive indicators such as the node’s voting participation rate, data reporting accuracy, and network response time in the previous epoch. The basic information distribution of candidate nodes is shown in Table 6.
[0104] Table 6 Regional distribution of candidate nodes
[0105] The technical team then performed a statistical analysis process to calculate the mathematical characteristic parameters of the consensus efficiency scores of all candidate nodes. By performing statistical calculations on the score data of 360 nodes, the mathematical mean was obtained. points, standard deviation System setting variable adjustment coefficient , based on which the outlier determination condition is determined as , that is, when the node score is lower than 54.14 points, it is identified as an outlier node. After statistical analysis, the distribution characteristics of the consensus efficiency score are shown in Table 7.
[0106] Table 7 Consensus efficiency score statistical analysis table
[0107] Based on outlier determination conditions , the technical team identified 29 outlier nodes whose performance deviated significantly from the normal range. The serial numbers of these nodes are recorded as Outlier nodes are primarily concentrated in remote areas with unstable network connections and early deployment sites with severely aged equipment. These problems are manifested by data transmission delays exceeding 5 seconds, voting response timeouts exceeding 15%, and environmental data reporting accuracy rates below 85%. The outlier node identification results are shown in Table 8.
[0108] Table 8 Outlier node identification results
[0109] The technical team then applied the carbon credit performance prediction model and the maximum weighted independent set algorithm to conduct a comprehensive evaluation of the remaining 331 valid candidate nodes. The network complexity metric reflects the complexity of the geographical distribution and communication topology between nodes. The performance prediction model, based on the Transformer-XL architecture, utilizes 32 memory segments to process historical node environmental data reports, network communication logs, and device operating status information. The prediction model outputs each node's expected performance score over the next 150 blocks and constructs a weighted graph structure based on the resource competition relationships between nodes. By solving the maximum weighted independent set problem, the algorithm ultimately selected 18 non-conflicting nodes with the highest combined weights as the proposed node list for epoch 45. The proposed node selection results are shown in Table 9.
[0110] Table 9 Proposal node selection results
[0111] During the actual operation of Epoch 45, the technical team strictly followed the optimized consensus algorithm to execute multiple rounds of voting verification. At 1:00 pm, the proposal node with the serial number 023 started to execute the block packaging operation and selected 1265 air quality monitoring records from the environmental data trading pool for packaging. These monitoring records include real-time data from 89 monitoring stations in North China. Concentration data, Emissions data and air quality index calculation results. Block data is immediately broadcast to other validator nodes via a peer-to-peer network protocol upon generation, with an average network propagation delay of 0.8 seconds. Upon receiving the block, the validator nodes quickly initiate the verification and execution process, fully verifying the integrity of the environmental monitoring data, the validity of the timestamp, and the correctness of the digital signature. The entire verification process takes an average of 1.9 seconds.
[0112] According to the consensus algorithm mechanism, the system executes Round voting verification process. At block height Consensus rounds In the blockchain, the verification node votes based on the block verification results and broadcasts the voting information to other nodes. The scoring mechanism designed by the technical team requires each verification node to score the voting behavior of other nodes. When receiving a vote from a node at a high and consensus phase After a valid vote is cast, the system automatically records 1 consensus participation point for the voting node. Assuming that during the consensus process for a specific block, there are 18 validating nodes and three rounds of voting, the voting participation of each node in different rounds shows significant differences, with core nodes maintaining high participation and marginal nodes occasionally absent. The scoring results for these multiple rounds are shown in Table 10.
[0113] Table 10 Multi-round voting scoring statistics
[0114] After the block is successfully submitted to the blockchain, all verification nodes will sort out the performance records of each node in this round of consensus according to the protocol requirements and generate a detailed score list containing the node number and the corresponding consensus participation points. These score lists are sent to the next high level node through an encrypted communication channel. According to the Byzantine fault tolerance theory, the system needs to collect The scoring list sent by each node can ensure the credibility of the data. This is the number of malicious nodes that the consensus algorithm tolerates, so a sufficient number During the actual collection process, the proposal node at height 22502 received a total of 236 valid scoring lists, exceeding the minimum requirement and meeting the security conditions of Byzantine fault tolerance.
[0115] The proposal node aggregates and verifies the consistency of the 236 scoring lists collected, and uses a majority voting mechanism to handle possible scoring discrepancies. The verified scoring list data is formatted as structured information and written into the block header of the block at height 22502, becoming an unalterable record of the blockchain. This blockchain-based point recording mechanism ensures the transparency, integrity, and historical traceability of node performance data, providing a reliable data foundation for the node selection process in the next era. When the block height reaches When , the 45th epoch officially ends and the system automatically enters the 46th epoch. The entire epoch iteration process continues to run according to the established periodic rhythm. The epoch iteration process is as follows Figure 2 shown.
[0116] To comprehensively evaluate the effectiveness of the proposed algorithm, the technical team conducted comparative tests against traditional consensus algorithms. Traditional approaches employ a simple round-robin node selection mechanism, lacking statistically based outlier detection and intelligent performance prediction capabilities. This approach exhibits significant technical limitations when applied to large-scale environmental monitoring networks. The comparative tests were conducted under identical network conditions and data loads, covering 10 complete epochs. The performance comparison results are shown in Table 11.
[0117] Table 11 Performance comparison between traditional algorithm and the algorithm of the present invention
[0118] The traditional polling mechanism selects proposal nodes according to a preset node order or randomly, ignoring the performance differences between nodes and the impact of changes in the network environment. It cannot effectively cope with the challenges of dynamic changes in node performance in large-scale distributed networks. The simple threshold filtering method uses a fixed performance judgment standard and lacks the ability to adaptively adjust according to the overall network conditions. It is prone to over-filtering or under-filtering when the network scale expands or the environmental conditions deteriorate. The significant technical progress brought by the present invention compared to traditional means is mainly reflected in the introduction of an intelligent outlier detection mechanism based on statistical principles. By dynamically calculating the mathematical characteristic parameters of the performance distribution of network nodes, it realizes the accurate identification and automatic exclusion of abnormal nodes, significantly improving the overall robustness and reliability of the consensus network. The innovative application of the carbon credit performance prediction model enables the system to predict the future performance of nodes based on historical data and current network status, providing a scientific and quantitative basis for node selection decisions, and avoiding the technical limitations of traditional methods that rely on static information for judgment. The clever use of the maximum weighted independent set algorithm achieves global optimization of proposal node selection, ensuring that the selected node combination can achieve high performance while avoiding resource competition conflicts, and has better overall coordination effect than the traditional simple selection strategy. The organic combination of multi-round voting scoring mechanism and Byzantine fault tolerance design has built a complete node performance evaluation and incentive system, which not only improves the transparency and fairness of the consensus process, but also enhances the system's security protection capabilities against malicious attacks and node failures.
[0119] It should be noted that the detailed explanation of the variables involved in the present invention is shown in Table 12.
[0120] Table 12 Variable Explanation Table
[0121] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the scope of protection of the present invention.
Claims
1. An optimization method for selecting proposal nodes for a carbon-inclusive blockchain consensus algorithm, characterized in that: include: The node starts a new epoch, records the current block height as the block height value, counts the total number of candidate nodes as the number of candidate nodes, assigns a candidate node sequence number to each candidate node, and queries the consensus efficiency score of each candidate node in the previous epoch on the chain; Apply statistical methods to calculate the mathematical mean and standard deviation of the consensus efficiency scores of all candidate nodes, and determine whether the node score meets the outlier judgment criteria based on the deviation adjustment coefficient. Nodes that meet the outlier judgment criteria are marked as outliers. The carbon credit performance prediction model and dynamic memory adjustment function are used to evaluate and predict the network performance of candidate nodes, remove the candidacy of outlier nodes in this epoch, and apply the maximum weighted independent set algorithm to generate the proposal node list of this epoch; the proposal node proposes block packaging at the specified block height and broadcasts the block data; the verification node verifies the transaction validity and status execution and votes for broadcast; executes multiple rounds of voting verification process and increases consensus participation points for participating nodes; after the block is submitted, the node score list is sent and written into the next block header.
2. The method according to claim 1, characterized in that The epoch refers to a time management unit in the blockchain system with a fixed number of blocks as a period, which is used to periodically adjust the qualifications of candidate nodes and update the identities of consensus participants.
3. The method according to claim 2, characterized in that The consensus efficiency score refers to a numerical indicator that quantifies the performance of a node during the consensus process. It is calculated by counting the effective participation and response speed of the node in each voting round. The consensus efficiency score is calculated by dividing the number of successful voting rounds of each node in the previous epoch by the total number of voting rounds and multiplying by 100.
4. The method according to claim 3, characterized in that The outlier determination condition refers to the mathematical condition for determining whether a node is a performance abnormal node. When the difference between the mathematical mean and the node consensus efficiency score is greater than the product of the deviation adjustment coefficient and the standard deviation value, it is determined that the outlier determination condition is met.
5. The method according to claim 4, characterized in that The deviation adjustment coefficient refers to a numerical parameter that controls the strictness of outlier node identification and is used to adjust the sensitivity of outlier determination. The deviation adjustment coefficient ranges from 0.5 to 2.
0.
6. The method according to claim 5, characterized in that The specific structure of the carbon credit performance prediction model is a time series prediction network based on the Transformer-XL architecture, which includes an encoder layer for processing historical node performance data, a decoder layer for generating future performance prediction results, and a memory mechanism for processing long sequences of node performance change patterns.
7. The method according to claim 6, characterized in that The number of memory segments of the memory mechanism of the carbon inclusive performance prediction model is adjusted through a dynamic memory adjustment function according to the epoch cycle length and the number of candidate nodes. When the epoch cycle length is large or the number of candidate nodes is large, the number of memory segments is increased; when the epoch cycle length is small or the number of candidate nodes is small, the number of memory segments is reduced.
8. The method according to claim 7, characterized in that The dynamic memory adjustment function calculates a memory adjustment value based on the epoch period length, the number of candidate nodes and the network complexity index. The calculation formula of the memory adjustment value is the sum of the epoch period length divided by 100 plus the number of candidate nodes divided by 50 plus the network complexity index divided by 10 divided by 3.
9. The method according to claim 8, characterized in that When the memory adjustment value is in the range of 0 to 0.3, a basic number of memory fragments of 8 are used to adjust the memory mechanism parameters of the carbon credit performance prediction model; when the memory adjustment value is in the range of 0.3 to 0.7, a medium number of memory fragments of 16 are used; when the memory adjustment value is in the range of 0.7 to 1.0, an extended number of memory fragments of 32 are used.
10. The method according to claim 9, characterized in that The application steps of the maximum weight independent set algorithm specifically include constructing the remaining candidate nodes after removing the outlier nodes into a weighted undirected graph, with each candidate node as a vertex of the graph, the consensus efficiency score of the candidate node as the vertex weight, establishing edge connections of the graph based on the network connectivity and resource competition relationship between the candidate nodes, and applying a greedy algorithm or a dynamic programming algorithm to solve the maximum weight independent set of the weighted undirected graph.
Citation Information
Patent Citations
Block chain Byzantine fault-tolerant consensus method based on collaborative filtering recommendation
CN115022326A
Block chain consensus mechanism construction method for operation scheduling of integrated energy system
CN116050725A
Node selection method, system and device based on block chain and storage medium
CN117675378A
Consensus efficiency optimization method and system
CN118118188A
Consensus proposal node selection method and device, equipment, medium and product
CN118863770A
Cited By
Method for extracting and parsing bitcoin transaction autonomy information
US12626253B2
Method for extracting and parsing bitcoin transaction autonomy information
US20250037124A1