## 3 Optimal Attack Strategy
### Optimal Attack Strategy Solving Based on PSO  
As an attacker, the attack strategy for each observation system is different, and when the system contains multiple observations the expression (5) for the average entropy of the system as a whole has multiple independent variables, and the only dependent variable is the average entropy of the system as a whole, \(\bar{H}\). For this kind of optimization problem with multiple independent variables and a single objective, it is difficult to find an explicit solution by ordinary computational methods, so we need an algorithm to solve the problem. Intelligent optimization algorithms such as PSO and the genetic algorithm (GA) are the most commonly used choices for solving this optimization problem [26; 27]. The PSO algorithm is chosen in this paper for the following reasons:  
1. The PSO algorithm is based on particle optimality and population optimality, where memory and particles with less fitness are saved, while GA has no memory and previous knowledge is destroyed with the change of population. 2. For problems with fewer parameters, the PSO algorithm can obtain the optimal solution quickly without losing performance. 3. The advantage of GA mainly lies in its global search ability; this paper introduces adaptive mutation in the PSO algorithm, which can help the PSO algorithm to jump out of the local optimum. It is easy to adjust the parameters in the PSO algorithm to select the optimal value. Combining the above factors, this paper selects the PSO algorithm as a method for solving the multi-parameter optimization problems. In (1), at \(l=1,\ldots,m\), if the attacker knows about the system parameters, \(\theta\), the threshold, \(C_{l}\), and the input vector, \(\phi_{l}\), this paper is based on PSO for the optimization problem (8) to solve the optimal attack strategy solution set \(\Omega^{*}=\{p_{1}^{*},q_{1}^{*},\ldots,p_{m}^{*},q_{m}^{*}\}\). Optimization design for PSO requires determining the population size, the particle dimensions, the positions and velocities of the particles, the learning factors, the inertia weights, the fitness function, and the maximum number of evolutionary generations. * **Population size**. Too large a population size will increase the complexity of the algorithm, resulting in a slow solution, while too small a population size will result in the algorithm failing to find an optimal solution. * **Particle dimension**. The particle dimension is set to \(2m\) since there are \(m\) observational systems, each of which the attacker can choose individually \((p_{l},q_{l})\). * **Learning factor**. The larger the learning factor is, the easier it is to skip the optimal position, while too small a learning factor will result in particles falling into the local optimum easily. * **Inertia weight**. The inertia weight is mainly to determine how much the particle is influenced by the velocity vector of the previous moment, and it is enough to choose the appropriate value. * **Fitness function**. The fitness value is the function that needs to be optimized as the target. In this paper, the fitness function (5) of the particle is the average entropy of the system, and the optimal position of the population in PSO is the solution to the optimization problem (8) when iterated for many times or when the termination conditions are satisfied. * **Maximum evolutionary algebra**. Its effect on the optimization solution process is similar to that of population size; too small a maximum evolutionary generation will cause the algorithm to terminate the iterations early and fail to obtain the optimal solution. After selecting suitable initialization parameters, the optimal attack strategy, \(\Omega^{*}\), can be obtained based on the PSO algorithm, and the algorithm flow is as Algorithm 1. In Algorithm 1, the parameters are initialized firstly. In each iteration round, the velocity and particle position are updated according to the optimal and current positions, while _rand_ is a random value.