A trust management method for a fog node in edge computing

By calculating the subjective trust, indirect trust, and capability trust values ​​of fog nodes, and combining the Bellman equation and decision tree model, malicious nodes in fog computing networks are identified, solving the problem of poor information interaction security and achieving more efficient information interaction security.

CN116244700BActive Publication Date: 2026-06-30NANJING UNIV OF POSTS & TELECOMM

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV OF POSTS & TELECOMM
Filing Date
2023-01-06
Publication Date
2026-06-30

Smart Images

  • Figure CN116244700B_ABST
    Figure CN116244700B_ABST
Patent Text Reader

Abstract

This invention belongs to the interdisciplinary fields of edge computing, privacy and security, and machine learning. It discloses a trust management method for fog nodes in edge computing. First, it calculates the fog node's trust value based on subjective trust value, indirect trust value, and capability trust value. The Bellman equation is used to solve for the shortest trust path, resulting in an initial dataset containing the three trust attributes of the fog node. This initial dataset is divided into a training set and a test set. The dataset is preprocessed by blurring the distribution range of the trust values. The trust attribute with the largest information gain in the training set is calculated as the splitting attribute. The training set is then divided into several subsets. The partitioning terminates if all fog nodes in a subset belong to the same category or if all candidate attributes of a fog node have been used. After generating a decision tree, a loss function is used to prune the decision tree. This invention demonstrates reliability and effectiveness in detecting malicious nodes and internal attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary fields of edge computing, privacy and security, and machine learning. Specifically, it relates to a trust management method for fog nodes in edge computing. Background Technology

[0002] Fog computing is a distributed computing infrastructure that extends traditional cloud computing to the network edge, bringing data, storage, computing, and communication resources closer to end users. However, because fog servers are very close to end users, they may collect sensitive information, thus requiring them to be trusted delegates. While authentication is a very useful encryption technique for initiating initial relationships between IoT devices and fog nodes, it is insufficient because devices can malfunction or be compromised by attackers. Furthermore, existing encryption solutions cannot handle insider attacks, such as those from rogue fog nodes already part of the system. Therefore, trust plays a crucial role in ensuring trustworthy relationships based on current and past interactions and recommendations from neighboring nodes.

[0003] Currently, researchers both domestically and internationally have conducted extensive research on trust issues in large-scale distributed applications, establishing various trust models using different mathematical methods, such as subjective logic, Bayesian, entropy theory, and evidence theory models, all of which provide descriptions and measurement methods for trust relationships. In addition, machine learning methods, such as decision trees, are also used to train trust models.

[0004] Trust based on subjective logic is expressed as subjective opinions with a certain degree of uncertainty, using probabilistic logic with opinions as input and output variables.

[0005] Entropy theory is a measure of information uncertainty. The greater the uncertainty, the greater the entropy. Entropy theory can be used to evaluate the subjectivity and uncertainty of node trust in fog networks.

[0006] Decision trees are an efficient and fast data mining technique commonly used for classification and prediction of datasets. A decision tree consists of internal nodes and leaf nodes. Internal nodes represent attribute values ​​used to split the dataset into smaller subsets, while leaf nodes represent the classification results. When constructing a decision tree, a metric function is applied to all available attributes, and the best attribute is calculated as the splitting attribute. The data is then repeatedly divided into subsets. Splitting terminates if all instances in a subset belong to the same class, or if the set of candidate attributes used to split the data is empty.

[0007] While the above methods can address internal attacks, they cannot effectively filter out malicious nodes in fog computing networks, and the security of information exchange between fog nodes is poor. Summary of the Invention

[0008] To address the shortcomings of existing fog computing networks in effectively identifying malicious nodes and ensuring poor information exchange security, this invention provides a trust management method for fog nodes in edge computing. This method effectively identifies malicious nodes in fog computing networks, improves the security and reliability of information exchange between fog nodes, and maintains a secure and reliable communication environment.

[0009] To achieve the above objectives, the present invention is implemented through the following technical solution:

[0010] This invention is a trust management method for fog nodes in edge computing, the method comprising the following steps:

[0011] Step 1) Calculate the subjective trust value (ST) of the fog node, and the fog node F i and fog node F j After the k-th interaction, fog node F i Generate a pair of fog nodes F j Satisfaction rating If they interact K times within a time period t, then the fog node F i For fog node F j The subjective trust calculation is shown in formula (1).

[0012]

[0013] Where α∈[0,1] is the observation factor, expressed as: Q is node F i For node F j The total number of negative reviews regarding the interaction. Within time period t, the number of fog nodes F... i and fog node F j If there is no interaction between them, then the subjective trust value between them is zero.

[0014] Step 2) Calculate the indirect trust value (IT) for fog nodes, F. j Not belonging to fog node F i Neighboring nodes within the communication range, in order to calculate the fog node F i For fog node F j The trust value can only be calculated through trust propagation between neighboring nodes. Considering the fog node F... i For fog node F j There may be multiple trusted paths, with two cases: if there is only one trusted path R(i, m1, m2, ... m) between fog nodes. Z If j), then determine the fog node F. i The subjective trust value ST for the first neighbor node F1 on the path i1 Is it greater than or equal to the trust threshold V? T If it is greater than the fog node F iFor fog node F j The indirect trust value is calculated as shown in formula (2).

[0015]

[0016] Where Z is the number of intermediate nodes on the trusted path, otherwise IT ij The value is zero. If multiple paths exist, the Bellman equation is used to find the shortest path R. s .

[0017] Step 3) Calculate the fog node capability trust value (AT), which consists of two sub-trusts in the node's communication interaction: fault tolerance trust (FT) and stability trust (WT). The fault tolerance trust includes three fault tolerance factors for the node: pass rate (P...). p Failure rate (P) F ) and recovery rate (P r The stability trust includes the node's working time H. w and the time H when the node joins the network a Calculate the fog node F i For fog node F j The ability to trust is shown in formula (3).

[0018] AT ij =(w1×FT) ij )+(w2×WT ij (3)

[0019] Where w1 and w2 are the weight parameters for fault-tolerant trust and stability trust, respectively. ij and WT ij Fog node F i For fog node F j Fault-tolerant trust and stability trust.

[0020] Step 4) Data fuzzing: First, the three attribute values ​​of the fog node are averaged and aggregated, as shown in formulas (4), (5), and (6).

[0021]

[0022]

[0023]

[0024] Where n is the total number of nodes in the network, a trust value attribute dataset containing n fog nodes is obtained, and then according to the Gaussian distribution of the node trust values, as shown in formula (7).

[0025]

[0026] The trust value is divided into high, medium, and low trust ranges S. h S m S l Where μ and σ represent the mean and standard deviation of the three trust attributes, respectively, the entire dataset is finally divided into a training set (D) in an 8:2 ratio. train ) and test set (D test (Two parts)

[0027] Step 5) Construct a decision tree, with the fog node attribute set as B = {B1, B2, ..., B}. n}, attribute B j∈(j=1,2,...,n) There are μ attribute values, namely {θ1, θ2, ..., θ...} μ Fog nodes have M categories, D train It is the fog node training set, p i Let D represent the proportion of fog nodes of the i-th category. Then calculate D. train The information entropy is shown in formula (8).

[0028]

[0029] Next, calculate the information gain ratio (GainRatio) for subjective ST, indirect IT, and capability AT respectively. train B1), GainRatio(D) train B2), GainRatio(D) train (B3) Select the attribute with the largest current information gain ratio as the splitting attribute, and then divide D. train The data is divided into several subsets. If all fog nodes in a subset belong to the same category, the subset is not further divided. If the fog nodes in a subset belong to different categories, the information gain ratio of other attributes is calculated and the subset is further divided until all fog nodes in the subset belong to the same category or the candidate attribute set used to split the data is empty. At this point, the division is terminated and the decision tree is completed.

[0030] Step 6) Decision tree pruning: From the bottom of the decision tree to the top, calculate the loss function of the leaf nodes and internal nodes, as shown in formula (9).

[0031]

[0032] Where |T| represents the number of leaf nodes in the decision tree, and N t H represents the number of samples output from leaf node t. t (T) represents the empirical entropy of leaf node t, and γ is the regularization coefficient. If the loss function of the parent node of the subtree of the decision tree is greater than the loss function of the leaf node, then the parent node of the subtree is replaced with a leaf node.

[0033] Step 7) Test set classification, input fog node test set Dtest Starting from the root node of the decision tree, determine which branch the current attribute value of the fog node belongs to. If the node under the branch is a leaf node, output the category of the fog node. If it is an internal node, continue to determine which branch the attribute value of the fog node belongs to, until the category of the fog node is output from the leaf node.

[0034] Step 2) is as follows:

[0035] Step 21): Fog node F i and fog node F j There are multiple trusted paths; find the shortest path R. s This is transformed into a discrete-time optimal path problem, as shown in equation (10).

[0036]

[0037] Where the function χ(·) and φ(·) represent the process cost, terminal cost, and total cost of the shortest path, respectively. The costs here are represented using the path weights. Given the state and decision sequence for the path problem, s k ∈R n ,a k ∈R m Let $k$ represent the path cost at time $k$ and the next node on the path chosen at time $k$, respectively.

[0038] Step 22): Given the problem's states and decision sequence, the value function is the minimum cost of the system at each state and time, as shown in Equation (11).

[0039]

[0040] Step 23): Based on Bellman's optimality principle and the system value function, the Bellman equation can be defined as shown in formula (12).

[0041] Finding the optimal path that satisfies this equation yields the shortest path R for the problem. s The Bellman-Ford algorithm is used to find the shortest path. The solution code is as follows:

[0042]

[0043] Step 3) is as follows:

[0044] Step 31): Pass rate (P) p P represents the ratio of the total number of interactions successfully completed by the target node to the total number of interactions initiated by the source node. FP is the ratio of the total number of failed interactions at the target node to the total number of interactions initiated by the source node. r The recovery rate is measured by how well a node recovers from a broken state. Therefore, the fog node F... i and fog node F j The fault tolerance trust between them is shown in formula (13).

[0045]

[0046] Step 32): The network topology is dynamically changing. To model the stability trust, we consider two time periods: the working time H of the fog node. w The time H for fog nodes to join the network a ,|H w |For node N j Processing node N i The duration of the initiated transaction, |H a | Represents node N j The duration of time node N has been in the network. i For node N j The stability trust is shown in formula (14).

[0047]

[0048] Where β is the penalty parameter applied between the two nodes, expressed as: δ∈[0,1] is an arbitrary constant, L is the number of times a node leaves the network, and the stability trust value is 0 if there is no transaction between nodes.

[0049] Step 33): Based on the two sub-trusts of fault tolerance and stability, the final capability trust model is obtained as shown in formula (3), where w1 and w2 are the weights of fault tolerance trust and stability trust, and capability trust is the weighted average of fault tolerance trust and stability trust.

[0050] Step 5) is as follows:

[0051] Step 51): Transfer the training set (D) train The nodes in the fog are divided into two categories: trusted and untrusted. The information entropy of the training set is calculated using formula (8), where M represents the total number of categories of fog nodes, p i This represents the proportion of the i-th category.

[0052] Step 52): According to a certain attribute B of the fog node j (j = 1, 2, 3, representing subjective, indirect, and ability attributes respectively), the training set (D) train Divide into several subsets D k According to D kThe information entropy of the fog node types and probabilities is defined as Ent(D). train |B j =θ k ), based on attribute B j Under the division, attribute B j The conditional entropy is shown in formula (15).

[0053]

[0054] Where θ k Representative attribute B j The attribute value is calculated based on attribute B. j The empirical entropy is shown in formula (16).

[0055]

[0056] Where p x For attribute B j The value is θ x The probability of attribute B j There are μ possible values.

[0057] Step 53) Calculate node attribute B j The information gain is shown in formula (17).

[0058] Gain(D train B j ) = Ent(D train )-Ent(D train |B j (17)

[0059] Computed attribute B j The information gain ratio is shown in formula (18).

[0060]

[0061] Step 54) Compare the information gain ratios of the three attributes and select max(GainRatio(D)). train B j Using j=1,2,3 as splitting attributes, the training set is divided into several subsets. Subsets in which all fog nodes belong to the same category are not further divided. Subsets containing fog nodes of multiple categories are further divided by repeating steps 51-53 until all fog nodes in the subset belong to the same category or all attributes are used as splitting attributes, at which point the division is terminated.

[0062] Step 6) is as follows:

[0063] Step 61) Starting from the bottom of the decision tree, sequentially determine the loss function of each subtree and the loss function of its leaf nodes. Calculate the loss function of the root node of the subtree, as shown in formula (19).

[0064]

[0065] in N p N represents the number of samples output from the root node p of the subtree. pk This represents the number of samples whose true class belongs to class k, output from the root node p of the subtree, and γ is the regularization coefficient.

[0066] Step 62) Calculate the loss function of the leaf nodes of the subtree, as shown in formula (20).

[0067]

[0068] in |T| represents the number of leaf nodes in the subtree, and N represents the number of leaf nodes in the subtree. t N represents the number of samples output from leaf node t. tk H represents the number of samples in leaf node t whose true class belongs to class k. t (T) represents the empirical entropy of leaf node t, and γ is the regularity coefficient.

[0069] Step 63) Determine if condition C is met. γ (T p )≤C γ (T c If the condition is met, pruning is performed, and the parent node is changed into a new leaf node according to the category with the largest proportion of leaf nodes.

[0070] The beneficial effects of this invention are:

[0071] (1) This invention selects subjective trust based on interaction, indirect trust based on recommendation, and capability trust based on fault tolerance and stability as the trust attributes of fog nodes. When calculating the indirect trust value, the shortest trust path is calculated through the Bellman equation to improve the accuracy of the indirect trust value.

[0072] (2) This invention avoids directly assigning precise weights to the trust attributes of fog nodes for aggregation by constructing a decision tree, thereby improving the accuracy of fog node classification.

[0073] (3) This invention prunes the decision tree by using a loss function, thereby reducing the complexity of the decision tree, improving the efficiency of the algorithm, and also solving the problem of model overfitting.

[0074] In summary, this invention selects subjective trust based on interaction, indirect trust based on recommendation, and capability trust based on fault tolerance and stability as the trust attributes of fog nodes. By constructing a decision tree to classify fog nodes, it effectively identifies malicious nodes in the fog computing network and improves the security and reliability of information interaction between fog nodes. Attached Figure Description

[0075] Figure 1 This is a flowchart of the trust management method of the present invention.

[0076] Figure 2 This is a flowchart of a fog node classification method based on decision trees.

[0077] Figure 3 It is a decision tree constructed using examples. Detailed Implementation

[0078] The embodiments of the present invention will be disclosed below with reference to the drawings. For clarity, many practical details will be described in the following description. However, it should be understood that these practical details are not intended to limit the invention. That is, in some embodiments of the invention, these practical details are not essential.

[0079] like Figure 1 As shown, this invention is a trust management method for fog nodes in edge computing, which includes the following steps:

[0080] Step 1: Calculate the subjective trust value (ST) of the fog node, and the fog node F i and fog node F j After the k-th interaction, fog node F i Generate a pair of fog nodes F j Satisfaction rating Fog Node F i and fog node F j If K interactions occur within a time period t, then the fog node F i For fog node F j The formula for calculating subjective trust is:

[0081]

[0082] Where α∈[0,1] is the observation factor, expressed as: Q represents fog node F. i For fog node F j The total number of negative reviews regarding the interaction, within the time period t, for fog node F i and fog node F j If no interaction occurs, then fog node F i and fog node F j The subjective trust value between them is zero.

[0083] Step 2: Calculate the indirect trust value (IT) for fog nodes, F. j Not belonging to fog node F i Neighboring nodes within the communication range, in order to calculate the fog node F i For fog node F j The trust value can only be calculated through trust propagation between neighboring nodes, taking into account the fog node F. i For fog node F j There exists one or more trusted paths, if there is only one trusted path R(i, m1, m2, ... m) between fog nodes. Z If j), then determine the fog node F. i The subjective trust value ST for the first neighbor node F1 on the path i1 Is it greater than or equal to the trust threshold V? T If it is greater than the fog node F i For fog node F j The formula for calculating indirect trust value is:

[0084]

[0085] Where Z is the number of intermediate nodes on the trusted path, otherwise IT ij If the value is zero, and multiple paths exist, then the Bellman equation is used to find the shortest path R. s .

[0086] Step 2 specifically includes the following steps:

[0087] Step 2-1: Fog Node F i and fog node F j There are multiple trusted paths; find the shortest path R. s This can be transformed into a discrete-time optimal path problem, expressed as:

[0088]

[0089] Where the function χ(·) and φ(·) represent the process cost, terminal cost, and total cost of the shortest path, respectively, with the cost represented by the path weights. Given the state and decision sequence for the path problem, s k ∈R n a k ∈R m Let $k$ represent the path cost at time $k$ and the next node on the chosen path at time $k$, respectively.

[0090] Step 2-2: Given the problem's states and decision sequence, the value function, which represents the minimum cost of the system at each state and time, is expressed as:

[0091]

[0092] Steps 2-3: Define the Bellman equation based on Bellman's optimality principle and the system value function:

[0093]

[0094] Finding the optimal path that satisfies this equation yields the shortest path R for the problem. s The Bellman-Ford algorithm is used to find the shortest path.

[0095] Step 3: Calculate the fog node capability trust value (AT), which consists of two sub-trusts in the node's communication interaction: fault tolerance trust (FT) and stability trust (WT). The fault tolerance trust includes three fault tolerance factors of the node: pass rate (P). p Failure rate (P) F ) and recovery rate (P r The stability trust includes the working time H of the fog node. w The time H for fog nodes to join the network a Calculate the fog node F. i For fog node F j The formula for trust in capabilities is:

[0096] AT ij =(w1×FT) ij )+(w2×WT ij )

[0097] Where w1 and w2 are the weight parameters for fault-tolerant trust and stability trust, respectively. ij and WT ij Fog node F i For fog node F j Fault-tolerant trust and stability trust.

[0098] Step 3 specifically includes the following steps:

[0099] Step 3-1: Pass Rate (P) p P represents the ratio of the total number of interactions successfully completed by the target node to the total number of interactions initiated by the source node. F P is the ratio of the total number of failed interactions at the target node to the total number of interactions initiated by the source node. r The recovery rate is measured by the extent to which a node recovers from a broken state. Therefore, for fog nodes F... i and fog node F j The fault tolerance trust between them is represented as:

[0100]

[0101] Step 3-2: Consider two time periods: the working time H of the fog node. w The time H for fog nodes to join the network a ,|H w |For node N j Processing node N i The duration of the initiated transaction, |H a | Represents node N j The duration of time node N has been in the network. i For node N j The stability of trust is represented as:

[0102]

[0103] Where β is the effect at fog node F i and fog node F j The penalty parameter between them is expressed as follows: δ∈[0,1] is an arbitrary constant, L is the number of times a node leaves the network, and if there is no transaction between nodes, the stability trust value is 0;

[0104] Step 3-3: Based on the two sub-trusts of fault tolerance and stability, the final capability trust model is obtained as follows:

[0105] AT ij =(w1×FT) ij )+(w2×WT ij )

[0106] Where w1 and w2 are the weight parameters of fault tolerance trust and stability trust, and capability trust is the weighted average of fault tolerance trust and stability trust.

[0107] Step 4: Data fuzzing. First, the subjective trust value, indirect trust value, and capability trust value of the fog nodes are averaged and aggregated, as shown in the following formula:

[0108]

[0109]

[0110]

[0111] Where n is the total number of nodes in the network, a dataset of subjective trust values, indirect trust values, and capability trust values ​​of n fog nodes is obtained. Then, based on the Gaussian distribution of the node trust values, as shown in the following formula...

[0112]

[0113] The trust value is divided into high, medium, and low trust ranges S. h S m S l Where μ and σ represent the mean and standard deviation of the subjective trust value, indirect trust value, and ability trust value attributes, respectively. Finally, the entire dataset is divided into a training set (D) in an 8:2 ratio. train ) and test set (D test Two parts;

[0114] Step 5: Construct a decision tree, with the fog node attribute set as B = {B1, B2, ..., B}. n}, attribute B j∈(j=1,2,...,n) There are μ attribute values, namely {θ1, θ2, ..., θ...} μ Fog nodes have M categories, D train It is the fog node training set, p i Let D represent the proportion of fog nodes of the i-th category. Then calculate D. train The information entropy is then used to calculate the information gain ratio (GainRatio) for subjective trust value, indirect trust value, and capability trust value, respectively. train B1), GainRatio(D) train B2), GainRatio(D) train (B3) Select the attribute with the largest current information gain ratio as the splitting attribute, and then divide D. train The data is divided into several subsets. If all fog nodes in a subset belong to the same category, the subset is not further divided. If the fog nodes in a subset belong to different categories, the information gain ratio of other attributes is calculated and the subset is further divided until all fog nodes in the subset belong to the same category or the candidate attribute set used to split the data is empty. At this point, the division is terminated and the decision tree is completed.

[0115] Step 5 specifically includes the following steps:

[0116] Step 5-1: Convert the fog node training set D train The nodes in the fog are divided into two categories: trusted and untrusted. The information entropy of the fog node training set is calculated as follows:

[0117]

[0118] Where M represents the total number of fog node categories, p i This represents the proportion of the i-th category;

[0119] Step 5-2: According to a certain attribute B of the fog node j (j = 1, 2, 3, representing subjective, indirect, and capability attributes respectively), the fog node training set D train Divided into several subsets Dk According to D k The information entropy of the fog node types and probabilities is defined as Ent(D). train |B j =θ k ), based on attribute B j Under the division, attribute B j The conditional entropy is expressed as:

[0120]

[0121] Where θ k Representative attribute B j The attribute value is calculated based on attribute B. j Empirical entropy:

[0122]

[0123] Where p x For attribute B j The value is θ x The probability of attribute B j There are μ possible values;

[0124] Step 5-3: Calculate node attribute B j Information gain:

[0125] Gain(D train B j ) = Ent(D train )-Ent(D train |B j )

[0126] Computed attribute B j Information gain ratio:

[0127]

[0128] Step 5-4: Compare the information gain ratios of the three attributes and select max(GainRatio(D)). train B j The training set is divided into several subsets using the splitting attributes j = 1, 2, 3. Subsets in which all fog nodes belong to the same category are not further divided. Subsets containing fog nodes of multiple categories are further divided by repeating steps 5-1 to 5-3 until all fog nodes in the subset belong to the same category or all attributes are used as splitting attributes.

[0129] Step 6: Decision tree pruning. Calculate the loss function for leaf nodes and internal nodes from the bottom to the top of the decision tree:

[0130]

[0131] Where |T| represents the number of leaf nodes in the decision tree, and N t H represents the number of samples output from leaf node t. t (T) represents the empirical entropy of leaf node t, and γ is the regularization coefficient. If the loss function of the parent node of the subtree of the decision tree is greater than the loss function of the leaf node, then the parent node of the subtree is replaced with a leaf node.

[0132] Step 6 specifically includes the following steps:

[0133] Step 6-1: Starting from the bottom of the decision tree, sequentially determine the loss function of each subtree and the loss function of its leaf nodes, and calculate the loss function of the root node of the subtree:

[0134]

[0135] in N p N represents the number of samples output from the root node p of the subtree. pk This represents the number of samples whose true class belongs to class k, output from the root node p of the subtree, where γ is the regularization coefficient;

[0136] Step 6-2: Calculate the loss function for the leaf nodes of the subtree:

[0137]

[0138] in |T| represents the number of leaf nodes in the subtree, and N represents the number of leaf nodes in the subtree. t N represents the number of samples output from leaf node t. tk H represents the number of samples in leaf node t whose true class belongs to class k. t (T) represents the empirical entropy of leaf node t, and γ is the regularity coefficient;

[0139] Step 6-3: Determine if condition C is met. γ (E p )≤C γ (T c If the condition is met, pruning is performed, and the parent node is changed into a new leaf node according to the category with the largest proportion of leaf nodes.

[0140] Step 7: Test set classification, input fog node test set D test Starting from the root node of the decision tree, determine which branch the current attribute value of the fog node belongs to. If the node under the branch is a leaf node, output the category of the fog node. If it is an internal node, continue to determine which branch the attribute value of the fog node belongs to, until the category of the fog node is output from the leaf node.

[0141] In practice, Figure 2 This is the workflow of a fog node classification method based on decision trees. First, subjective trust based on interactions between fog nodes is calculated. Then, indirect trust based on trust propagation and shortest path is calculated. Finally, capability trust based on fault tolerance and stability is calculated. The three trust values ​​are averaged and aggregated to obtain a dataset containing the three trust attributes of fog nodes: subjective, indirect, and capability. The dataset is preprocessed by fuzzification according to the Gaussian distribution of the trust values. The dataset is then divided into training and test sets according to a certain ratio. A decision tree is constructed on the training set using information gain ratio. The constructed decision tree is pruned using a loss function. Finally, the test set is tested, and the fog node category is output.

[0142] Step 1) The trust values ​​of the 10 node data points are fuzzed according to the Gaussian distribution intervals of the trust values, where the low, medium, and high trust intervals for subjective and ability attributes are S0, ... l = [0, 0.4), S m = [0.4, 0.6), S h = [0.6, 1], the low, medium, and high trust intervals of the indirect attribute are S respectively. l = [0, 0.2), S m = [0.2, 0.4), S h = [0.4, 1], the original data is shown in Table (a), and the fuzzification results are shown in Table (b).

[0143]

[0144] Step 2) Divide the dataset D into two categories: trust and distrust. There are 7 trusted nodes and 3 distrusted nodes. Calculate the information entropy of the dataset as follows:

[0145]

[0146] Step 3) Select the subjective attribute of the node to partition the dataset D. The dataset is then divided into three subsets: high, medium, and low. The number of data points in the subsets with subjective attributes equal to high, medium, and low are 5, 3, and 2, respectively. Next, classify the nodes in these three subsets. The number of nodes belonging to the trust and distrust categories for the subsets with subjective attributes equal to high, medium, and low are 4, 1, 2, 1, 1, and 1, respectively. Therefore, the conditional entropy of the dataset based on subjective attributes is:

[0147]

[0148] Step 4) Dividing the dataset using only subjective attributes results in three subsets: high, medium, and low. The number of data points in the subsets where the subjective attribute equals high, medium, and low are 5, 3, and 2 respectively. Therefore, the empirical entropy of the node's subjective attribute is:

[0149]

[0150] Step 5) Calculate the information gain of the subjective attribute:

[0151] Gain(D,B1)=Ent(D)-Ent(D|B1)=0.04346

[0152] Step 6) Calculate the information gain ratio of the subjective attribute:

[0153]

[0154] Step 7) Repeat steps 3-7 to calculate the information gain ratio for indirect attributes and capability attributes respectively:

[0155] GainRatio(D,B2)=0.1132

[0156] GainRatio(D,B3)=0.1132

[0157] Step 8) Compare the information gain ratios of the three attributes and select the attribute with the largest information gain as the splitting attribute. Since GainRatio(D,B2)=GainRatio(D,B3)>GainRatio(D,B1), we choose indirectness or capability as the splitting attribute. Here, we choose capability as the current classification attribute.

[0158] Step 9) Construct the root node of the decision tree. Using ability as the splitting attribute, divide the dataset D into three subsets. The subsets with low ability and medium ability contain trusted nodes and untrusted nodes, while the subset with high ability contains only trusted nodes. Nodes in the subset with high ability are directly classified as trusted nodes, and this subset is not further divided.

[0159] Step 10) For subsets with low and medium abilities, repeat steps 2-9 until all subsets are of the same type or the attributes have been used, then stop splitting.

[0160] This invention selects subjective trust based on interaction, indirect trust based on recommendation, and capability trust based on fault tolerance and stability as the trust attributes of fog nodes. By constructing a decision tree to classify fog nodes, it effectively identifies malicious nodes in the fog computing network and improves the security and reliability of information interaction between fog nodes.

[0161] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.

Claims

1. A trust management method for fog nodes in edge computing, characterized in that: The trust management method includes the following steps: Step 1: Calculate the subjective trust value (ST) of the fog node, and the fog node F i and fog node F j After the k-th interaction, fog node F i Generate a pair of fog nodes F j Satisfaction rating Fog Node F i and fog node F j If K interactions occur within a time period t, then the fog node F i For fog node F j The formula for calculating subjective trust is: Where α∈[0,1] are observation factors, expressed as follows: Q represents fog node F. i For fog node F j The total number of negative reviews regarding the interaction, within time period t, for fog node F i and fog node F j If no interaction occurs, then fog node F i and fog node F j The subjective trust value between them is zero; Step 2: Calculate the indirect trust value (IT) for fog nodes, F. j Not belonging to fog node F i Neighboring nodes within the communication range, in order to calculate the fog node F i For fog node F j The trust value can only be calculated through trust propagation between neighboring nodes, taking into account the fog node F. i For fog node F j There exists one or more trusted paths. If there is only one trusted path R(i,m1,m2,…m) between fog nodes... z If (j), then determine the fog node F. i The subjective trust value ST for the first neighbor node F1 on the path i1 Is it greater than or equal to the trust threshold V? T If it is greater than the fog node F i For fog node F j The formula for calculating indirect trust value is: Where Z is the number of intermediate nodes on the trusted path, otherwise IT ij If the value is zero, and multiple paths exist, then the Bellman equation is used to find the shortest path R. s ; Step 3: Calculate the fog node capability trust value (AT), which consists of two sub-trusts in the node's communication interaction: fault tolerance trust (FT) and stability trust (WT). Calculate the fog node's F... i For fog node F j The formula for trust in capabilities is: AT ij =(w1×FT ij )+(w2×WT ij ) Where w1 and w2 are the weight parameters for fault-tolerant trust and stability trust, respectively. ij and WT ij Fog node F i For fog node F j Fault-tolerant trust and stability trust; Step 4: Data fuzzing. First, the subjective trust value, indirect trust value, and capability trust value of the fog nodes are averaged and aggregated, as shown in the following formula: Where n is the total number of nodes in the network, a dataset of subjective trust values, indirect trust values, and capability trust values ​​of n fog nodes is obtained. Then, based on the Gaussian distribution of the node trust values, as shown in the following formula... The trust value is divided into high, medium, and low trust ranges S. h ,S m ,S l Where μ and σ represent the mean and standard deviation of the subjective trust value, indirect trust value, and ability trust value attributes, respectively. Finally, the entire dataset is divided into a training set (D) in an 8:2 ratio. train ) and test set (D test Two parts; Step 5: Construct a decision tree, with the fog node attribute set as B = {B1, B2, ..., B}. n }, attribute B j∈(j=1,2,…,n) There are μ attribute values, namely {θ1, θ2, ..., θ...} μ Fog nodes have M categories, D train It is the fog node training set, p i Let D represent the proportion of fog nodes of the i-th category. Then calculate D. train The information entropy is then used to calculate the information gain ratio (GainRatio) for subjective trust value, indirect trust value, and capability trust value, respectively. train ,B1),GainRatio(D train ,B2),GainRatio(D train (B3) Select the attribute with the largest current information gain ratio as the splitting attribute, and then divide D. train Divide into several subsets. If all fog nodes in a subset belong to the same category, the subset will not be further divided. If the fog nodes in a subset belong to different categories, the information gain ratio of other attributes will be calculated and the subset will be divided until all fog nodes in the subset belong to the same category or the candidate attribute set used to split the data is empty. Then the division will be terminated and the decision tree construction will be completed. Step 6: Decision tree pruning. Calculate the loss function for leaf nodes and internal nodes from the bottom to the top of the decision tree: Where |T| represents the number of leaf nodes in the decision tree, and N t H represents the number of samples output from leaf node t. t (T) represents the empirical entropy of leaf node t, and γ is the regularization coefficient. If the loss function of the parent node of the subtree of the decision tree is greater than the loss function of the leaf node, then the parent node of the subtree is replaced with a leaf node. Step 7: Test set classification, input fog node test set D test Starting from the root node of the decision tree, determine which branch the current attribute value of the fog node belongs to. If the node under the branch is a leaf node, output the category of the fog node. If it is an internal node, continue to determine which branch the attribute value of the fog node belongs to, until the category of the fog node is output from the leaf node.

2. The trust management method for fog nodes in edge computing according to claim 1, characterized in that: Step 2 specifically includes the following steps: Step 2-1: Fog Node F i and fog node F j There are multiple trusted paths; find the shortest path R. s This can be transformed into a discrete-time optimal path problem, expressed as: Where the function Let $\mathbf$ represent the process cost, terminal cost, and total cost of the shortest path, respectively, with the cost represented by the path weights. Given the state and decision sequence for the path problem, s k ∈R n ,a k ∈R m Let $k$ represent the path cost at time $k$ and the next node on the chosen path at time $k$, respectively. Step 2-2: Given the problem's states and decision sequence, the value function, which represents the minimum cost of the system at each state and time, is expressed as: Steps 2-3: Define the Bellman equation based on Bellman's optimality principle and the system value function: Finding the optimal path that satisfies this equation yields the shortest path R for the problem. s The Bellman-Ford algorithm is used to find the shortest path.

3. The trust management method for fog nodes in edge computing according to claim 1, characterized in that: In step 3, the fault tolerance trust includes three fault tolerance factors for nodes: pass rate (P... p Failure rate (P) F ) and recovery rate (P r The stability trust includes the working time H of the fog node. w The time H for fog nodes to join the network a .

4. The trust management method for fog nodes in edge computing according to claim 3, characterized in that: Step 3 specifically includes the following steps: Step 3-1: Pass Rate (P) p P represents the ratio of the total number of interactions successfully completed by the target node to the total number of interactions initiated by the source node. F P is the ratio of the total number of failed interactions at the target node to the total number of interactions initiated by the source node. r The recovery rate is measured by the extent to which a node recovers from a broken state. Therefore, for fog nodes F... i and fog node F j The fault tolerance trust between them is represented as: Step 3-2: Consider two time periods: the working time H of the fog node. w The time H for fog nodes to join the network a ,|H w |For node N j Processing node N i The duration of the initiated transaction, |H a | Represents node N j The duration of time node N has been in the network. i For node N j The stability of trust is represented as: Where β is the effect at fog node F i and fog node F j The penalty parameter between them is expressed as follows: δ∈[0,1] is an arbitrary constant, L is the number of times a node leaves the network, and the stability trust value is 0 if there is no transaction between nodes. Step 3-3: Based on the two sub-trusts of fault tolerance and stability, the final capability trust model is obtained as follows: AT ij =(w1×FT ij )+(w2×WT ij ) Where w1 and w2 are the weight parameters of fault tolerance trust and stability trust, and capability trust is the weighted average of fault tolerance trust and stability trust.

5. A trust management method for fog nodes in edge computing according to claim 1, characterized in that: Step 5 specifically includes the following steps: Step 5-1: Convert the fog node training set D train The nodes in the training set are divided into two categories: trusted and untrusted. The information entropy of the fog node training set is calculated as follows: Where M represents the total number of fog node categories, p i This represents the proportion of the i-th category; Step 5-2: According to a certain attribute N of the fog node j (j = 1, 2, 3, representing subjective, indirect, and capability attributes respectively), the fog node training set D train Divided into several subsets D k According to D k The information entropy of the fog node types and probabilities is defined as Ent(D). train |B j =θ k ), based on attribute B j Under the division, attribute B j The conditional entropy is expressed as: Where θ k Representative attribute B j The attribute value is calculated based on attribute B. j Empirical entropy: Where p x For attribute B j The value is θ x The probability of attribute B j There are μ possible values; Step 5-3: Calculate node attribute B j Information gain: Gain(D traini B j )=Ent(D train -Ent(D train |B j ) Computed attribute B j Information gain ratio: Step 5-4: Compare the information gain ratios of the three attributes and select max(GainRatio(D)). train B j Using j=1,2,3 as splitting attributes, the training set is divided into several subsets. Subsets in which all fog nodes belong to the same category are not further divided. Subsets containing fog nodes of multiple categories continue to be divided by repeating steps 5-1 to 5-3 until all fog nodes in the subset belong to the same category or all attributes are used as splitting attributes, at which point the division is terminated.

6. The trust management method for fog nodes in edge computing according to claim 1, characterized in that: Step 6 specifically includes the following steps: Step 6-1: Starting from the bottom of the decision tree, sequentially determine the loss function of each subtree and the loss function of its leaf nodes, and calculate the loss function of the root node of the subtree: in N p N represents the number of samples output from the root node p of the subtree. pk This represents the number of samples whose true class belongs to class k, output from the root node p of the subtree, where γ is the regularization coefficient; Step 6-2: Calculate the loss function for the leaf nodes of the subtree: in |T| represents the number of leaf nodes in the subtree, and N represents the number of leaf nodes in the subtree. t N represents the number of samples output from leaf node t. tk H represents the number of samples in leaf node t whose true class belongs to class k. t (T) represents the empirical entropy of leaf node t, and γ is the regularity coefficient; Step 6-3: Determine if condition C is met. γ (T p )≤C γ (T c If the condition is met, pruning is performed, and the parent node is changed into a new leaf node according to the category with the largest proportion of leaf nodes.