A blockchain trusted sensor anomaly detection method based on trust value improved K-medoids

By using trust value initialization and K-medoids clustering algorithm, the anomaly detection method of blockchain trusted sensors is improved, which solves the impact of noise and outliers on prediction accuracy and achieves efficient detection of abnormal nodes.

CN118921176BActive Publication Date: 2025-11-04福建福链科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310500793.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-06
Publication Date
2025-11-04
Estimated Expiration
2043-05-06

AI Technical Summary

Technical Problem

Existing blockchain trusted sensors are susceptible to noise, edge points, and isolated points during data transmission, leading to decreased prediction accuracy and difficulty in effectively detecting abnormal nodes.

Method used

By setting and updating trust values, nodes are grouped using the K-medoids clustering algorithm. Anomaly detection is performed based on trust values ​​and proximity principles, and nodes with trust values ​​below 60 are identified as anomalous nodes.

Benefits of technology

It improves robustness to noise, can accurately and efficiently detect and eliminate abnormal nodes, and maintains a high detection rate in different environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921176B_ABST
    Figure CN118921176B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on trust value improvement K-medoids's blockchain trusted sensor anomaly detection method, comprising the following steps: S1, trust value initialization, and the trust value of the BTS node participating in this consensus is updated by node trust value update formula;S2, n BTS node is clustered into k groups, and the optimal BTS node is determined as center point;S3, partition for the rest BTS node;S4, when there is client to provide new transaction request, BTS layer according to partition voting result, the same partition vote different from other BTS node is regarded as abnormal target set A, the node set of credit value below 60 points is recorded as B, the node in the intersection of A intersection B is judged as abnormal node, the beneficial effects of the application are: improved K-medoids clustering algorithm, more in line with the demand of BTS practical application, can more accurately and efficiently exclude BTS abnormal node;While clustering result has strong stability, abnormal BTS node under different environments can maintain higher detection rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain sensor anomaly detection technology, specifically to a blockchain trusted sensor anomaly detection method based on improved K-medoids with trust value. Background Technology

[0002] A Blockchain Trusted Sensor (BTS) is a trusted hardware component consisting of a sensor and a trusted module with certain data processing capabilities. It utilizes cryptography, blockchain, fault diagnosis, and privacy protection technologies to ensure the trustworthiness of data at the data acquisition end, enabling tamper-proof and reliable transmission of source data from the acquisition end to the server end, thus solving the on-chain and off-chain data consistency problem. While existing technologies have improved prediction accuracy to some extent, they are susceptible to noise, edge cases, and outliers. Based on the innovations and limitations of related technical solutions, this paper proposes a BTS anomaly detection method based on trust values ​​for specific application scenarios of the Blockchain Trusted Sensor (BTS). Summary of the Invention

[0003] The purpose of this invention is to provide an anomaly detection method for blockchain trusted sensors based on improved K-medoids with trust values, so as to solve the problems mentioned in the background art.

[0004] To achieve the above objectives, the present invention provides the following technical solution:

[0005] A blockchain-based trusted sensor anomaly detection method based on improved K-medoids trust values ​​includes the following steps:

[0006] S1. Set the initial trust value to 60 points, and after the consensus is completed, update the trust value of the BTS nodes participating in this consensus using the node trust value update formula.

[0007] S2. Cluster the n BTS nodes into k groups based on their trust values, and determine the optimal BTS node as the center point.

[0008] S3. Partition the remaining BTS nodes according to the principle of proximity;

[0009] S4. When a client provides a new transaction request that requires voting by the BTS participating in consensus, the BTS layer, based on the partition voting results, considers those partitions whose votes differ from those of other BTS nodes as an abnormal target set. The set of nodes with a credit score below 60 is denoted as , Nodes in the intersection are identified as abnormal nodes.

[0010] As a preferred embodiment of the present invention: the node trust value update formula in S1 is:

[0011] .

[0012] As a preferred embodiment of the present invention: in the node trust value update formula:

[0013] Represented as: the The node at the th Trust value for each consensus round;

[0014] r represents the consensus round;

[0015] Represented as: the Whether a BTS node is offline or not in each consensus round is recorded as 1 if offline and 0 if online.

[0016] Represented as: BTS node offline penalty coefficient;

[0017] Represented as: the The number of invalid transactions submitted by BTS nodes in each consensus round;

[0018] Represented as: Malicious transaction penalty coefficient;

[0019] Represented as: the Whether a consensus round is successful or not is recorded as 1 for success and 0 for failure.

[0020] Represented as: the weighting coefficient of the reward points given after a successful consensus;

[0021] Represented as: the trust value of node i;

[0022] Represented as: the historical trust value of node i;

[0023] It is represented as: the weighting coefficient of historical trust value.

[0024] As a preferred embodiment of the present invention, the trust value clustering grouping in S2 specifically includes the following steps:

[0025] S①, with the current iteration number NI=0, select the k nodes with the highest trust values ​​from the n BTS nodes as the initial center points;

[0026] S② Calculate the distance from each non-center point to each center point using Formula 1, and then cluster the nodes according to the proximity principle to generate a cluster set. ;

[0027] S③ In each cluster, non-central nodes are replaced sequentially with central nodes, and the total cost after the replacement is calculated using Formula 2. ,when If the node is used, replace the center point; otherwise, leave it unchanged.

[0028] S④ Update the cluster set generated during initialization to obtain the optimal cluster set consisting of the k center points. Then, the remaining BTS nodes are partitioned according to the principle of proximity.

[0029] As a preferred embodiment of the present invention: Formula 1 in S② is:

[0030] .

[0031] As a preferred embodiment of the present invention: Formula 2 in S② is: .

[0032] As a preferred embodiment of the present invention: In formula 2:

[0033] Represented as: non-central points in a cluster;

[0034] Represented as: cluster The center point;

[0035] It is represented as the sum of squared deviations of all nodes in the cluster.

[0036] Compared with the prior art, the beneficial effects of the present invention are:

[0037] 1. The K-medoids-based center clustering algorithm is robust to noise and effectively avoids the impact of noise on prediction accuracy.

[0038] 2. The improved K-medoids clustering algorithm is more in line with the actual application needs of BTS and can more accurately and efficiently eliminate abnormal nodes in BTS.

[0039] 3. The improved K-medoids clustering results have strong stability and can maintain a high detection rate for abnormal BTS nodes under different environments. Attached Figure Description

[0040] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

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

[0042] Please see Figure 1 This invention provides a technical solution: a blockchain trusted sensor anomaly detection method based on trust value-improved K-medoids, characterized by comprising the following steps:

[0043] S1. Set the initial trust value to 60 points, and after the consensus is completed, update the trust value of the BTS nodes participating in this consensus using the node trust value update formula.

[0044] S2. Cluster the n BTS nodes into k groups based on their trust values, and determine the optimal BTS node as the center point.

[0045] S3. Partition the remaining BTS nodes according to the principle of proximity;

[0046] S4. When a client provides a new transaction request that requires voting by the BTS participating in consensus, the BTS layer, based on the partition voting results, considers those partitions whose votes differ from those of other BTS nodes as an abnormal target set. The set of nodes with a credit score below 60 is denoted as , Nodes in the intersection are identified as abnormal nodes.

[0047] Furthermore: the node trust value update formula in S1 is:

[0048] .

[0049] Furthermore: In the node trust value update formula:

[0050] Represented as: the The node at the th Trust value for each consensus round;

[0051] r represents the consensus round;

[0052] Represented as: the Whether a BTS node is offline or not in each consensus round is recorded as 1 if offline and 0 if online.

[0053] Represented as: BTS node offline penalty coefficient;

[0054] Represented as: the The number of invalid transactions submitted by BTS nodes in each consensus round;

[0055] Represented as: Malicious transaction penalty coefficient;

[0056] Represented as: the Whether a consensus round is successful or not is recorded as 1 for success and 0 for failure.

[0057] Represented as: the weighting coefficient of the reward points given after a successful consensus;

[0058] Represented as: the trust value of node i;

[0059] Represented as: the historical trust value of node i;

[0060] It is represented as: the weighting coefficient of historical trust value.

[0061] Furthermore: the trust value clustering grouping in S2 specifically includes the following steps:

[0062] S①, with the current iteration number NI=0, select the k nodes with the highest trust values ​​from the n BTS nodes as the initial center points;

[0063] S② Calculate the distance from each non-center point to each center point using Formula 1, and then cluster the nodes according to the proximity principle to generate a cluster set. ;

[0064] S③ In each cluster, non-central nodes are replaced sequentially with central nodes, and the total cost after the replacement is calculated using Formula 2. ,when If the node is used, replace the center point; otherwise, leave it unchanged.

[0065] S④ Update the cluster set generated during initialization to obtain the optimal cluster set consisting of the k center points. Then, the remaining BTS nodes are partitioned according to the principle of proximity.

[0066] Furthermore: Formula 1 in S② is: .

[0067] Furthermore: Formula 2 in S② is: .

[0068] Furthermore: In Formula 2:

[0069] Represented as: non-central points in a cluster;

[0070] Represented as: cluster The center point;

[0071] It is represented as the sum of squared deviations of all nodes in the cluster.

[0072] Specifically, in use, the blockchain's trust value is first initialized to 60 points, and the blockchain consensus operation is executed. After the consensus is completed, the node trust value is updated using the following formula:

[0073] The trust values ​​of the BTS nodes participating in this consensus are updated to obtain the trust values ​​of the nodes in the corresponding round. and the historical trust value of the node Then, based on trust values, the BTS nodes in the blockchain are clustered into groups, and the best BTS node in the optimal group is determined as the center point. When a client provides a new transaction request that requires voting by the BTS nodes participating in consensus, the BTS layer, based on the partition voting results, considers nodes whose votes in the same partition differ from those of other BTS nodes as an abnormal target set. The set of nodes with a credit score below 60 is denoted as , Nodes in the intersection are identified as abnormal nodes, enabling rapid anomaly detection for trusted sensors in the blockchain.

[0074] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A blockchain trusted sensor anomaly detection method based on trust value-improved K-medoids, characterized in that, Includes the following steps: S1. Set the initial trust value to 60 points, and after the consensus is completed, update the trust value of the BTS nodes participating in this consensus using the node trust value update formula. S2. Cluster the n BTS nodes into k groups based on their trust values, and determine the optimal BTS node as the center point. S3. Partition the remaining BTS nodes according to the principle of proximity; S4. When a client provides a new transaction request that requires voting by the BTS participating in consensus, the BTS layer, based on the partition voting results, considers those partitions whose votes differ from those of other BTS nodes as an abnormal target set. The set of nodes with a credit score below 60 is denoted as , Nodes in the intersection are identified as abnormal nodes; The trust value clustering grouping in S2 is specifically divided into the following steps: S①, with the current iteration number NI=0, select the k nodes with the highest trust values ​​from the n BTS nodes as the initial center points; S② Calculate the distance from each non-center point to each center point, and then cluster the nodes according to the proximity principle to generate a cluster set. ; S③ In each cluster, non-central nodes are replaced sequentially with central nodes, and the total cost of the replacement is calculated. ,when If the node is used, replace the center point; otherwise, leave it unchanged. S④ Update the cluster set generated during initialization to obtain the optimal cluster set consisting of the k centroids. .

2. The blockchain trusted sensor anomaly detection method based on improved K-medoids with trust value as described in claim 1, characterized in that: The node trust value update formula in S1 is: ; In the node trust value update formula: Represented as: the The node at the th Trust value for each consensus round; r represents the consensus round; Represented as: the Whether a BTS node is offline or not in each consensus round is recorded as 1 if offline and 0 if online. Represented as: BTS node offline penalty coefficient; Represented as: the The number of invalid transactions submitted by BTS nodes in each consensus round; Represented as: Malicious transaction penalty coefficient; Represented as: the Whether a consensus round is successful or not is recorded as 1 for success and 0 for failure. Represented as: the weighting coefficient of the reward points given after a successful consensus; Represented as: the trust value of node i; Represented as: the historical trust value of node i; It is represented as: the weighting coefficient of historical trust value.

Citation Information

Patent Citations

  • Sensor node detection method and device based on block chain, equipment and medium

    CN115835212A

  • Access authentication method supporting trusted communication

    CN115913674A