## 4 Trusted Network Secure Routing Algorithm
### Node Reputation  
Trust is a very complicated concept that has been studied for almost a century. Trust is a social attribute in human society and is generally regarded as an intuitive concept. It is subjective and can be established between two individuals in an environment to ensure relative safety. A wireless sensor network can be seen as a microcosm of human society, and the trust relationship between nodes can be expressed in terms of node reputation values. In a wireless sensor network, communication mainly relies on the mutual cooperation between nodes; because the network does not have a fixed topology, establishing good trust relationships by introducing the node reputation mechanism into a wireless sensor network can effectively improve the network's security performance against internal threats.  
In research on trust values, the most commonly used type of trust value is one based on the Beta distribution, which is simple and flexible and is well suited for computing values to represent the communication reputations of nodes. The probability density function of the Beta distribution \(beta(\alpha,\beta)\) is shown in Equation (5):  
\[f(x|\alpha,\beta)=\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}x^{ \alpha-1}(1-x)^{\beta-1} \tag{5}\]  
In this formula, \(x\) should satisfy \(0\leq x\leq 1\); moreover, \(a>0\) and \(b>0\). The BRSN reputation-evaluation model uses the Beta distribution to calculate the reputation value of a node [(19; 20)]:  
\[R_{ij}=\frac{\alpha_{ij}+1}{\alpha_{ij}+\beta_{ij}+2} \tag{6}\]  
where \(R_{ij}\) represents the reputation-evaluation value of node \(i\) with respect to node \(j\), \(\alpha_{ij}\) and \(\beta_{ij}\) denote the number of successful communication behaviors and the number of failed communication behaviors, respectively.  
In this paper, the method of calculating the node reputation value in the DPMA-MD algorithm [(21)] is improved. In the calculation of the reputation values, the DPMA-MD algorithm uses the concepts of  
Figure 2: Data transmission path for communication in a wireless sensor network.  
direct credit evaluation and indirect credit evaluation, and the two corresponding types of reputation values are integrated to obtain the final reputation value for a node. However, this method only considers how to calculate the node reputation value; it does not consider the effective utilization of energy, the complexity of the calculation, etc. Therefore, in this paper, we propose a new algorithm for calculating the reputation value of a node.  
The nodes in a wireless sensor network are randomly distributed. The reputation-evaluation information is very similar for some nodes, and if their sensing areas intersect, then the calculation of the credit evaluations of their information will involve duplicate computations, thereby increasing the computational complexity of the algorithm and resulting in unnecessary energy consumption [22]. Therefore, this paper introduces a filtering mechanism into the calculation of the indirect reputation value, which reduces the repetition of computations and eliminates the influence of repeated information on the objective situation. The process is illustrated in Figure 3.