Skip to main content
. 2022 Nov 24;22(23):9125. doi: 10.3390/s22239125
Algorithm 1: Computing Power Allocation Optimization Algorithm (CPAOA)
Input: Number of target mining pools
1:M = 1000; K = 50; Op = 1/4; Uth = 90; Lth = 80;
2:     Calculate the computing power of the target mining pool and other mining pools;
3:     Establish the revenue models of evaluation mining pool, target mining pool, and other mining pool;
4:     Determine the solution model and construct the search space;
5:     for (I = 0; I < T; i++)
6:     Randomly generate K attack computing power distribution schemes and form them into a distribution scheme
matrix X;
7:     for (j = 0; j < K; j++)
8:          Calculate the fitness of each attack computing power distribution scheme;
9:          Update the optimal allocation scheme;
10:        if judged that the current scheme is in one of the four stages of AO algorithm;
11:            Execute the formula at this stage to update the attack computing power distribution scheme;
12:            Calculate the fitness value of the scheme;
13:            Calculate the fitness value after the artificial bee colony updates the scheme;
14:            Compare with the optimal scheme at the current moment and update the optimal scheme;
15:         or else
16:            Obtain the optimal distribution scheme of attack computing power for this round;
17:            T = T + 1;
18:            Update global optimal scheme;
19:          end
20:     end
21:     Determine the optimal distribution scheme of attack computing power;
22:     Launch FAW attacks on multiple target mining pools;
23:     Evaluate the protection capabilities of multiple target mining pools;