# Cross-Domain Access Control Model in Industrial IoT Environment
## 3 Distributed Access Control Model Based on a Master-Slave Chain
### Dynamic Selection Strategy of Master Chain Nodes Based on Reputation Mechanism
#### 3.2.2 Reputation Calculation Model  
All edge nodes in the slave chain maintain a node behavior record table. This table records the edge node's reputation value and the reference factors for determining the node's reputation value. Each edge node caches the behavior record table of all edge nodes, including itself, and the table is updated before each consensus completion. Next, we discuss the specific calculation rules of the reputation model and calculate the edge node reputation value using the following equations. We evaluate the degree of honesty of a node by its historically honest consensus behavior \(HCB_{i}\). If the node behaves honestly, it has a high degree of honesty and is likely to maintain good honest behavior. Conversely, if a node has a lot of malicious behavior, its historical consensus behavior will be low. The historical consensus behavior of a node is evaluated by assessing the ratio of the number of honest consensus behaviors to the number of historical consensus behaviors for that node. The historical consensus numbers refer to that node's total number of consensus numbers since it joined the network. The evaluation formula is as follows:  
\[HCB_{i}=\frac{SC_{i}}{AC_{i}} \tag{1}\]  
where \(SC_{i}\) represents the number of historical honest consensus behaviors of the edge node \(En_{i}\), and \(AC_{i}\) represents the number of historical consensus behaviors of \(En_{i}\). When an edge node sends an error message, other edge nodes can report it when they verify the digital signature, and they send their malicious behavior and data to other  
Figure 2: Block structure. edge nodes for inspection. The measure of maliciousness in this reputation model is the number of times that a node acts maliciously. If a node commits malicious behavior, its reputation value will grow slowly, even if it later performs honest behaviors. With this penalty mechanism, nodes are prevented from carrying out malicious behaviors in order to make the main chain system more secure and reliable. The malicious behavior \(MCB_{i}\) is calculated by the following formula. \[MCB_{i}=MC_{i} \tag{2}\]  
where \(MC_{i}\) represents the number of consensus behaviors for the malicious behavior of \(En_{i}\). The historical activity \(HA_{i}\) of \(En_{i}\) is used to measure the activity of the node. In the process, edge nodes need to actively complete consensus to achieve high efficiency. If the edge node does not complete the consensus within the specified time, the node may have network latency, downtime, etc., and it is likely to suffer attacks if it is offline for a long time or it has a bad network. Thus, \(HA_{i}\) is derived from the ratio of the node's online time \(OnlineT_{i}\) and the total time \(TotalT_{i}\) from it joining the network to the current time. The node itself is not a malicious node because of the node's environment or its own problems. The node does not need to be punished; the probability of the node becoming a master chain node only needs to be reduced. Therefore, the historical consensus participation of \(En_{i}\) can be expressed as:  
\[HA_{i}=\frac{OnlineT_{i}}{TotalT_{i}} \tag{3}\]  
The credibility \(NC_{i}\) of an edge node is related to the honesty achieved by that node. When an edge node joins the network, its credibility is relatively low, but when the node has reached many consensuses, its reputation will become high. This parameter is used to prevent nodes that are joining the network from increasing their reputation value too quickly, maintaining system stability. \[NC_{i}=\frac{1}{1+e^{-SC_{i}}} \tag{4}\]  
In this study, we calculated the reputation value of a node in a cross-domain access control system, based on the above reputation assessment factors.