Environment monitoring data storage method based on improved PBFT algorithm
By grouping the environmental monitoring blockchain network through the improved PBFT algorithm and AP clustering algorithm, and combining the reward and punishment mechanism with reputation value calculation, the problems of easy tampering and trust of environmental monitoring data are solved, efficient and reliable data storage and sharing are achieved, and the functionality and value of data management are improved.
Patent Information
- Application Number
- CN202311481478.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-08
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2043-11-08
AI Technical Summary
Traditional environmental monitoring data is easy to tamper with and has serious trust issues. Centralized management makes it impossible to operate and manage data across platforms in a unified manner. Data management functionality is low, there is a lack of effective data sharing mechanisms, and the data value is low.
The improved PBFT algorithm and AP clustering algorithm are used to group the environmental monitoring blockchain network, and a reward and punishment mechanism and reputation value calculation are introduced. The data is tamper-proof and trusted management is achieved through smart contracts and blockchain technology, and a hierarchical multi-center consensus mechanism is used for data storage.
It realizes the trusted management and efficient storage of environmental monitoring data, reduces consensus latency, improves data consensus efficiency and reliability, supports cross-platform data operations and unified management, and enhances data sharing and value.
Smart Images

Figure CN118069733B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of blockchain technology, and in particular relates to an environmental monitoring data storage method based on an improved PBFT algorithm. Background Art
[0002] Electronic evidence generated by traditional environmental monitoring is fragile, easily tampered with, and subject to trust issues. Furthermore, centralized data management cannot operate across platforms or centrally manage data resources, resulting in low data management functionality. This lack of data sharing and trust makes it difficult to meet the needs of ecological and environmental oversight. For a long time, environmental monitoring data has only been shared and maintained within local agencies, acting as central management bodies. The collection and storage of environmental monitoring data is not publicly available, resulting in poor communication between external agencies and a lack of effective data sharing mechanisms, making the data of low value. While some environmental monitoring data storage methods are being continuously improved, and some researchers have proposed big data and cloud storage technologies to improve monitoring and storage methods, the problem of data tampering remains unresolved. Centralized management and decentralized storage are no longer the optimal options for environmental monitoring data storage. Summary of the Invention
[0003] In order to solve the problems of electronic evidence fragility, easy tampering, lack of trust, low data management functionality and low data value in the existing technology, the present invention aims to provide an environmental monitoring data storage method based on an improved PBFT algorithm.
[0004] The technical solution adopted in the present invention is:
[0005] A method for storing environmental monitoring data based on an improved PBFT algorithm includes the following steps:
[0006] Use the data collection server to collect environmental monitoring data and send the identity information and environmental monitoring data to the supervision server;
[0007] Based on the supervision server, the data collection server is authenticated according to the identity information;
[0008] If the identity authentication is successful, the smart contract is called to convert the environmental monitoring data into data blocks, generate the corresponding data storage request, and send the data storage request and data blocks to the environmental monitoring blockchain network;
[0009] Using the improved AP clustering algorithm, several nodes in the environmental monitoring blockchain network are grouped to obtain the leadership node group and several corresponding sub-consensus groups;
[0010] The leader node that receives the data storage request is used as the master node. Based on the master node, the leader node group, and the corresponding sub-consensus group, the PBFT consensus algorithm is used to reach an intra-group consensus on the data storage request. The intra-group consensus result is obtained, and the sub-consensus group is used to store the data block on the chain.
[0011] Based on the master node and the leader node group, the PBFT consensus algorithm is used to conduct inter-group consensus on the intra-group consensus results, generate a successful chain message, and use the leader node group to broadcast the successful chain message to the corresponding sub-consensus groups.
[0012] Furthermore, the improved AP clustering algorithm is used to group several nodes in the environmental monitoring blockchain network to obtain a leadership node group and several corresponding sub-consensus groups, including the following steps:
[0013] Based on the environmental monitoring blockchain network, the improved AP clustering algorithm is initialized to obtain K cluster centers and the similarity between all nodes and the cluster centers;
[0014] Introducing a reward and punishment mechanism, obtaining the reputation values of several nodes in the environmental monitoring blockchain network, sorting the nodes in descending order according to their reputation values, and setting bias parameters for the top K nodes;
[0015] Update the attraction information and affiliation information of all nodes, and update K cluster centers based on the attraction information and affiliation information;
[0016] According to the similarity between the updated cluster center and the node, the nodes are grouped to obtain K sub-consensus groups;
[0017] The cluster centers corresponding to the K sub-consensus groups are used as leader nodes to obtain the leader node group, and the other nodes in the sub-consensus groups are used as consensus nodes;
[0018] The iterative attenuation coefficient is introduced to iteratively update the node's attraction information and affiliation information to obtain the final K cluster centers in the environmental monitoring blockchain network;
[0019] Update the sub-consensus group based on the number of nodes in the sub-consensus group;
[0020] If the number of iterations exceeds the iteration threshold or the cluster center does not change, the final leader node group and the corresponding final sub-consensus groups are output.
[0021] Furthermore, the formula of the reward and punishment mechanism is:
[0022]
[0023] Where ε is the number of times a node successfully generates and verifies blocks; e is a natural constant;
[0024]
[0025] In the formula, bad i is the number of times a node fails or has other malicious behaviors; B is the penalty triggering threshold.
[0026] Furthermore, the formula for reputation value is:
[0027]
[0028] Where C i is the current reputation value of each node; i is the node indicator; is the initial reputation value of each node; α1 is the weight of the reward mechanism; R(i) is the single reward value of the node; α2 is the weight of the penalty mechanism; P(i) is the single penalty value of the node.
[0029] Furthermore, the formula for attractiveness information is:
[0030]
[0031] Where r t+1 (i,k) is the degree to which node k is suitable as the cluster center of node i at iteration number t+1, that is, the attraction information of node k to node i; a t (i, j) is the fitness of node i to select node j as its cluster center at iteration number t; r t (i, j) is the degree to which node j is suitable as the cluster center of node i at iteration number t; s(i, k) is the similarity of node k as the cluster center of node i; i, j and k are all node indicators.
[0032] Furthermore, the formula for the attribution information is:
[0033]
[0034] Where r t+1 (k,k) is the degree to which node k is suitable as a cluster center at the iteration number t+1; ∑ j≠i,k max{r t+1 (j,k),0} is the degree to which node k is suitable to be a cluster center other than node i at the iteration number t+1; a t+1 (i, k) is the suitability of node i to select node k as its cluster center at iteration number t+1, that is, the degree of belonging of node k to node i.
[0035] Furthermore, the iterative update formula of the attractiveness information and the belongingness information is:
[0036] r' t+1(i,k)=λ*r t (i,k)+(1-λ)*r t+1 (i,k)
[0037] a' t+1 (i,k)=λ*a t (i,k)+(1-λ)*a t+1 (i,k)
[0038] Where r' t+1 (i,k), a' t+1 (i, k) is the updated attraction information and updated belonging information of node k to node i at iteration number t+1; λ is the iteration attenuation coefficient; r t (i,k),r t+1 (i,k) is the attraction information of node k to node i at iteration number t and t+1; a' t+1 (i,k), a t+1 (i, k) is the degree of belonging of node k to node i at iterations t and t+1.
[0039] Furthermore, the cluster center determination formula is:
[0040] k=argmax{a(i,k)+r(i,k)}
[0041] Where i and k are both node indicators; if i = k, then node i is the cluster center of node k; if i ≠ k, then node k is the cluster center of node i.
[0042] Furthermore, the leader node that receives the data storage request is used as the master node. Based on the master node, the leader node group, and the corresponding sub-consensus group, the PBFT consensus algorithm is used to reach an intra-group consensus on the data storage request, and the sub-consensus group is used to store the data block on the chain, including the following steps:
[0043] The leader node that receives the data storage request is used as the master node, and the master node is used to send the data storage request to all leader nodes of the leader node group;
[0044] Based on the PBFT consensus algorithm, the leader node broadcasts the pre-prepared message to the corresponding sub-consensus group and verifies the legitimacy of the data storage request;
[0045] If the legitimacy verification passes, the leader node will be used to broadcast a preparation message containing the leader node's voting information to the corresponding sub-consensus group, and the preparation message will be written to the message log;
[0046] Based on the consensus nodes within the sub-consensus group, confirmation messages are exchanged. If a consensus node receives confirmation messages exceeding the threshold, the data block is stored on the chain and the on-chain storage result is returned to the corresponding leader node.
[0047] Furthermore, based on the master node and the leader node group, the PBFT consensus algorithm is used to conduct inter-group consensus on the intra-group consensus result, generate a successful chaining message, and use the leader node group to broadcast the successful chaining message to the corresponding sub-consensus groups, including the following steps:
[0048] Based on the PBFT consensus algorithm, the leader node receives the consensus results returned by the corresponding sub-consensus group and sends the voting results to the master node;
[0049] Use the master node to receive the voting results sent by the leader node in the leader node group, and generate a successful on-chain message based on the voting results;
[0050] The successful chaining message is broadcast to the leadership node group, and the leadership node group is used to broadcast the successful chaining message to the corresponding sub-consensus groups.
[0051] The beneficial effects of the present invention are:
[0052] 1) This invention uses blockchain technology to ensure that the environmental monitoring data obtained by the data collection server is stored on the chain in real time and more efficiently. The verification assisted by the supervision server further ensures that the data cannot be tampered with, and realizes the trusted management of environmental monitoring data in a trusted environment.
[0053] 2) This invention uses an improved PBFT algorithm for environmental monitoring data consensus, which reduces consensus latency and improves consensus efficiency;
[0054] 3) The present invention calculates node reputation values through a reputation mechanism and selects leader nodes in order, reducing the number of view switches and the randomness of leader node elections, thereby ensuring the reliability of consensus nodes;
[0055] 4) The present invention combines the reputation mechanism with the improved AP clustering algorithm. To address the problem that the cluster center is affected by the bias parameter, the bias parameters of nodes with higher reputation values are assigned in sequence, making nodes with higher reputation values more likely to become cluster center representatives, thereby reducing the influence of the initial node on the clustering results.
[0056] 5) This invention improves the global decentralized consensus into a hierarchical multi-centralized consensus through improved AP clustering, making the PBFT algorithm more suitable for the blockchain environment of large-scale network nodes.
[0057] 6) This invention introduces blockchain technology for environmental monitoring scenarios and proposes an environmental monitoring data storage method based on an improved PBFT algorithm to ensure that environmental data cannot be tampered with, is shared, and transparent. The authenticity of the node environmental data is verified and decentralized authenticity verification and storage are completed through a consensus mechanism to ensure the authenticity of the data before it is uploaded to the chain. The decentralized distributed storage method is adopted to enable data management to operate across platforms or to perform unified management of data resources, thereby improving data management functionality, strengthening information interaction between environmental monitoring data, realizing an effective data sharing mechanism, and enhancing data value.
[0058] Other beneficial effects of the present invention will be further described in the specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 This is a flowchart of the environmental monitoring data storage method based on the improved PBFT algorithm in the present invention. DETAILED DESCRIPTION
[0060] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments.
[0061] Example 1:
[0062] like Figure 1 As shown, this embodiment provides an environmental monitoring data storage method based on an improved PBFT algorithm, including the following steps:
[0063] Use the data collection server to collect environmental monitoring data and send the identity information and environmental monitoring data to the supervision server;
[0064] When a data collection server first enters the environmental monitoring data collection process, it generates its own public-private key pair through an asymmetric encryption algorithm during registration, uses a unique virtual identity authentication and its corresponding public key to sign and generate a digital certificate to join the environmental monitoring blockchain network, becoming a detectable entity in the network;
[0065] Based on the supervision server, the data collection server is authenticated according to the identity information;
[0066] The supervisory server itself has a trusted identity and is the initial operating node. It verifies the authenticity of the data collection server and the authenticity of the uploaded environmental monitoring data. Trusted operation verification verifies the environmental monitoring data provided by the data collection server. The supervisory server then implements decentralized trusted operations and completes the update of the blockchain structure.
[0067] If the identity authentication is successful, the smart contract is called to convert the environmental monitoring data into data blocks, generate the corresponding data storage request, and send the data storage request and data blocks to the environmental monitoring blockchain network;
[0068] Using the improved Affinity-Propagation (AP) clustering algorithm, several nodes in the environmental monitoring blockchain network are grouped to obtain a leader node group and several corresponding sub-consensus groups, including the following steps:
[0069] Based on the environmental monitoring blockchain network, the improved AP clustering algorithm is initialized to obtain K cluster centers and the similarities between all nodes and the cluster centers. The similarity values between points are all negative, that is, the larger the similarity value, the closer the distance between points.
[0070] A reward and punishment mechanism is introduced to obtain the reputation values of several nodes in the environmental monitoring blockchain network. The nodes are sorted in descending order according to their reputation values, and a bias parameter p(i) is set for the top K nodes. The bias parameter indicates the tendency of data point i to be selected as the cluster center and has a significant impact on which class representatives will serve as the final cluster center. When the p(i) value is larger, the possibility of data point i being the final cluster center is greater, which weakens the influence of the Affinity-Propagation algorithm on the initial nodes.
[0071] The formula for the reward and punishment mechanism is:
[0072]
[0073] In the formula, ε is the number of times a node successfully generates and verifies blocks; e is a natural constant; the reward value formula is based on a Sigmoid function, which is a special form of the Logistic function and a commonly used s-type activation function in neural networks. The output range of this function is 0 to 1, which can normalize the output variable. When a node participates in the consensus, the reward value obtained by the node will experience a period of slow growth. As the number of verifications increases, the final reward value obtained by the node will gradually become constant. The Sigmoid function maps the reward value obtained by the node to a certain range, which can prevent the reward value obtained by the node from being too large and becoming a "super node";
[0074]
[0075] In the formula, bad iis the number of times the node fails or has other malicious behaviors; B is the penalty trigger threshold; when the node generates invalid blocks multiple times, the system will automatically determine that the node is a Byzantine node and will not be allowed to participate in the consensus process. This will quickly eliminate malicious master nodes from the network, preventing them from affecting the reliability and security of the system, and effectively ensuring the honesty of the consensus nodes.
[0076] The formula for reputation value is:
[0077]
[0078] Where C i is the current reputation value of each node; i is the node indicator; is the initial reputation value of each node; α1 is the weight of the reward mechanism; R(i) is the single reward value of the node; α2 is the weight of the penalty mechanism; P(i) is the single penalty value of the node; the node reputation value will be updated after each consensus cycle.
[0079] Update the attraction information and affiliation information of all nodes, and update K cluster centers based on the attraction information and affiliation information;
[0080] The formula for attractiveness information is:
[0081]
[0082] Where r t+1 (i,k) is the degree to which node k is suitable as the cluster center of node i at iteration number t+1, that is, the attraction information of node k to node i; a t (i, j) is the fitness of node i to select node j as its cluster center at iteration number t; r t (i, j) is the degree to which node j is suitable as the cluster center of node i at iteration number t; s(i, k) is the similarity of node k as the cluster center of node i; i, j and k are all node indicators;
[0083] The formula for attribution information is:
[0084]
[0085] Where r t+1 (k,k) is the degree to which node k is suitable as a cluster center at the iteration number t+1; ∑ j≠i,k max{r t+1 (j,k),0} is the degree to which node k is suitable to be a cluster center other than node i at the iteration number t+1; a t+1 (i, k) is the suitability of node i to select node k as its cluster center at iteration number t+1, that is, the degree of belonging of node k to node i;
[0086] According to the similarity between the updated cluster center and the node, the nodes are grouped to obtain K sub-consensus groups;
[0087] The cluster centers corresponding to the K sub-consensus groups are used as leader nodes to obtain the leader node group, and the other nodes in the sub-consensus groups are used as consensus nodes;
[0088] The iterative attenuation coefficient is introduced to iteratively update the node's attraction information and affiliation information to obtain the final K cluster centers in the environmental monitoring blockchain network;
[0089] The iterative update formula of attraction information and belonging information is:
[0090] r' t+1 (i,k)=λ*r t (i,k)+(1-λ)*r t+1 (i,k)
[0091] a' t+1 (i,k)=λ*a t (i,k)+(1-λ)*a t+1 (i,k)
[0092] Where r' t+1 (i,k), a' t+1 (i, k) is the updated attraction information and updated belonging information of node k to node i at iteration number t+1; λ is the iteration attenuation coefficient; r t (i,k),r t+1 (i,k) is the attraction information of node k to node i at iteration number t and t+1; a' t+1 (i,k), a t+1 (i, k) is the degree of belonging of node k to node i at iterations t and t+1;
[0093] The judgment formula of cluster center is:
[0094] k=argmax{a(i,k)+r(i,k)}
[0095] Where i and k are both node indicators; if i = k, then node i is the cluster center of node k; if i ≠ k, then node k is the cluster center of node i;
[0096] Update the sub-consensus group based on the number of nodes in the sub-consensus group. If the number of nodes in the sub-consensus group is greater than the maximum number of nodes that the sub-consensus group can accommodate, the newly added node will be divided into the smallest sub-consensus group other than the cluster center. If the number of nodes is less than 4, update the attraction and belonging values of each node. Repeat this process until all sub-consensus groups meet Byzantine fault tolerance.
[0097] If the number of iterations exceeds the iteration threshold or the cluster center does not change, the final leader node group and the corresponding final sub-consensus groups are output;
[0098] The low-order consensus layer is the first intra-group consensus of the sub-consensus group composed of the cluster area where each leader node is located. The high-order consensus layer is the second inter-group consensus completed by the leader node in each sub-consensus group participating in the consensus, transmitting and broadcasting messages between groups.
[0099] The leader node that receives the data storage request is used as the master node. Based on the master node, the leader node group, and the corresponding sub-consensus group, the Practical Byzantine Fault Tolerance (PBFT) consensus algorithm is used to reach an intra-group consensus on the data storage request. The intra-group consensus result is obtained, and the sub-consensus group is used to store the data block on the chain, including the following steps:
[0100] The leader node that receives the data storage request is used as the master node, and the master node is used to send the data storage request to all leader nodes of the leader node group;
[0101] Based on the PBFT consensus algorithm, the leader node broadcasts the pre-prepared message to the corresponding sub-consensus group and verifies the legitimacy of the data storage request;
[0102] If the legitimacy verification passes, the leader node will be used to broadcast a preparation message containing the leader node's voting information to the corresponding sub-consensus group, and the preparation message will be written to the message log;
[0103] Based on the consensus nodes in the sub-consensus group, confirmation messages are exchanged. If the consensus node receives more than the threshold number of confirmation messages, the data block is stored on the chain and the results of the on-chain storage are returned to the corresponding leader node;
[0104] Based on the master node and the leader node group, the PBFT consensus algorithm is used to conduct inter-group consensus on the consensus results within the group, generate a successful chain message, and use the leader node group to broadcast the successful chain message to the corresponding sub-consensus groups, including the following steps:
[0105] Based on the PBFT consensus algorithm, the leader node receives the consensus results returned by the corresponding sub-consensus group and sends the voting results to the master node;
[0106] Use the master node to receive the voting results sent by the leader node in the leader node group, and generate a successful on-chain message based on the voting results;
[0107] Broadcast the successful chaining message to the leadership node group, and use the leadership node group to broadcast the successful chaining message to the corresponding sub-consensus groups;
[0108] After reaching a consensus on the establishment of a new block, each participant can connect the new block to the end of the data chain. If the environmental monitoring data is successfully uploaded to the chain, the construction and update of the blockchain will be finally completed.
[0109] Aiming at environmental monitoring scenarios, the present invention introduces blockchain technology and proposes an environmental monitoring data storage method based on an improved PBFT algorithm to ensure that environmental data cannot be tampered with, is shared, and is transparent. The authenticity of the node environmental data is verified and decentralized authenticity verification and storage are completed through a consensus mechanism to ensure the authenticity of the data before it is uploaded to the chain. The decentralized distributed storage method is adopted to enable data management to operate across platforms or to perform unified management of data resources, thereby improving data management functionality, strengthening information interaction between environmental monitoring data, realizing an effective data sharing mechanism, and enhancing data value.
[0110] The present invention is not limited to the above optional embodiments. Anyone can derive various other forms of products based on the teachings of the present invention. The above specific embodiments should not be construed as limiting the scope of protection of the present invention. The scope of protection of the present invention shall be based on the scope defined in the claims, and the description can be used to interpret the claims.
Claims
1. A method for storing environmental monitoring data based on an improved PBFT algorithm, characterized by: The steps include: Use the data collection server to collect environmental monitoring data and send the identity information and environmental monitoring data to the supervision server; Based on the supervision server, the data collection server is authenticated according to the identity information; If the identity authentication is successful, the smart contract is called to convert the environmental monitoring data into data blocks, generate the corresponding data storage request, and send the data storage request and data blocks to the environmental monitoring blockchain network; Using the improved AP clustering algorithm, several nodes in the environmental monitoring blockchain network are grouped to obtain the leadership node group and several corresponding sub-consensus groups; The leader node that receives the data storage request is used as the master node. Based on the master node, the leader node group, and the corresponding sub-consensus group, the PBFT consensus algorithm is used to reach an intra-group consensus on the data storage request. The intra-group consensus result is obtained, and the sub-consensus group is used to store the data block on the chain. Based on the master node and the leader node group, the PBFT consensus algorithm is used to conduct inter-group consensus on the consensus results within the group, generate a successful chain message, and use the leader node group to broadcast the successful chain message to the corresponding sub-consensus groups; The improved AP clustering algorithm is used to group several nodes in the environmental monitoring blockchain network to obtain a leader node group and several corresponding sub-consensus groups, including the following steps: Based on the environmental monitoring blockchain network, the improved AP clustering algorithm is initialized to obtain K cluster centers and the similarity between all nodes and the cluster centers; Introducing a reward and punishment mechanism, obtaining the reputation values of several nodes in the environmental monitoring blockchain network, sorting the nodes in descending order according to their reputation values, and setting bias parameters for the top K nodes; Update the attraction information and affiliation information of all nodes, and update K cluster centers based on the attraction information and affiliation information; According to the similarity between the updated cluster center and the node, the nodes are grouped to obtain K sub-consensus groups; The cluster centers corresponding to the K sub-consensus groups are used as leader nodes to obtain the leader node group, and the other nodes in the sub-consensus groups are used as consensus nodes; The iterative attenuation coefficient is introduced to iteratively update the node's attraction information and affiliation information to obtain the final K cluster centers in the environmental monitoring blockchain network; Update the sub-consensus group based on the number of nodes in the sub-consensus group; If the number of iterations exceeds the iteration threshold or the cluster center does not change, the final leader node group and the corresponding final sub-consensus groups are output.
2. The environmental monitoring data storage method based on the improved PBFT algorithm according to claim 1 is characterized in that: The formula of the reward and punishment mechanism is: Where ε is the number of times the node successfully generates and verifies blocks; e is a natural constant, and R(i) is the node's single reward value; In the formula, bad i is the number of times the node fails or has other malicious behaviors; B is the penalty triggering threshold, and P(i) is the single penalty value of the node.
3. The environmental monitoring data storage method based on the improved PBFT algorithm according to claim 2 is characterized in that: The formula for the reputation value is: Where C i The current reputation value of each node; i is the node indicator; is the initial reputation value of each node; α1 is the weight of the reward mechanism; R(i) is the single reward value of the node; α2 is the weight of the penalty mechanism; P(i) is the single penalty value of the node.
4. The environmental monitoring data storage method based on the improved PBFT algorithm according to claim 1 is characterized in that: The formula for the attractiveness information is: Where r t+1 (i, k) is the degree to which node k is suitable as the cluster center of node i at iteration number t+1, that is, the attraction information of node k to node i; a t (i, j) is the fitness of node i to select node j as its cluster center at iteration number t; r t (i, j) is the degree to which node j is suitable as the cluster center of node i at iteration number t; s(i, k) is the similarity of node k as the cluster center of node i; i, j and k are all node indicators.
5. The environmental monitoring data storage method based on the improved PBFT algorithm according to claim 1 is characterized in that: The formula for the attribution information is: Where r t+1 (k,k) is the degree to which node k is suitable as a cluster center at the iteration number t+1; ∑ j≠i,k max{r t+1 (j,k),0} is the degree to which node k is suitable to be a cluster center other than node i at the iteration number t+1; a t+1 (i, k) is the suitability of node i to select node k as its cluster center at iteration number t+1, that is, the degree of belonging of node k to node i.
6. The environmental monitoring data storage method based on the improved PBFT algorithm according to claim 4 is characterized in that: The iterative update formula of the attraction information and the belonging information is: r' t+1 (i,k)=λ*r t (i,k)+(1-λ)*r t+1 (i,k) a' t+1 (i,k)=λ*a t (i,k)+(1-λ)*a t+1 (i,k) Where r' t+1 (i,k), a' t+1 (i, k) is the updated attraction information and updated belonging information of node k to node i at iteration number t+1; λ is the iterative attenuation coefficient; r t (i,k),r t+1 (i,k) is the attraction information of node k to node i at iteration number t and t+1; a' t+1 (i,k), a t+1 (i, k) is the degree of belonging of node k to node i at iterations t and t+1.
7. The environmental monitoring data storage method based on the improved PBFT algorithm according to claim 4 is characterized in that: The cluster center determination formula is: k=argmax{a(i,k)+r(i,k)} Where i and k are both node indicators; if i = k, then node i is the cluster center of node k; If i≠k, then node k is the cluster center of node i, a(i,k) is the affiliation information of node k to node i, and r(i,k) is the attraction information of node k to node i.
8. The environmental monitoring data storage method based on the improved PBFT algorithm according to claim 1 is characterized in that: The leader node that receives the data storage request is used as the master node. Based on the master node, the leader node group, and the corresponding sub-consensus group, the PBFT consensus algorithm is used to reach an intra-group consensus on the data storage request. The sub-consensus group is then used to store the data block on the chain, including the following steps: The leader node that receives the data storage request is used as the master node, and the master node is used to send the data storage request to all leader nodes of the leader node group; Based on the PBFT consensus algorithm, the leader node broadcasts the pre-prepared message to the corresponding sub-consensus group and verifies the legitimacy of the data storage request; If the legitimacy verification passes, the leader node will be used to broadcast a preparation message containing the leader node's voting information to the corresponding sub-consensus group, and the preparation message will be written to the message log; Based on the consensus nodes within the sub-consensus group, confirmation messages are exchanged. If a consensus node receives confirmation messages exceeding the threshold, the data block is stored on the chain and the on-chain storage result is returned to the corresponding leader node.
9. The environmental monitoring data storage method based on the improved PBFT algorithm according to claim 1 is characterized in that: Based on the master node and the leader node group, the PBFT consensus algorithm is used to conduct inter-group consensus on the consensus results within the group, generate a successful chain message, and use the leader node group to broadcast the successful chain message to the corresponding sub-consensus groups, including the following steps: Based on the PBFT consensus algorithm, the leader node receives the consensus results returned by the corresponding sub-consensus group and sends the voting results to the master node; Use the master node to receive the voting results sent by the leader node in the leader node group, and generate a successful on-chain message based on the voting results; The successful chaining message is broadcast to the leadership node group, and the leadership node group is used to broadcast the successful chaining message to the corresponding sub-consensus groups.
Citation Information
Patent Citations
Equipment quality information management node consensus method based on PBFT
CN114448997A
Environment monitoring data sharing method and system based on block chain
CN116055157A