## 3 System Model
### Client Selection Problem Definition  
Federated learning can protect user privacy, however, it also has limitations. Participants may deny their shared local models, and attackers may compromise legitimate participants and share poisoned local model parameters with the server [37]. Therefore, the selection of high-quality and honest participants is critical, and the selection of participants is influenced by a number of factors. Firstly, the differentiated computational and communication capabilities of end devices directly affect the latency of local training, data transmission, and the energy consumption, which leads to a different number of iterations and model accuracy for each device. Secondly, the size of the dataset carried on the terminal device is different, and the compensation paid to the terminal device is also different. The data may not meet the characteristics of independent and same distribution, which results in a difference in the training accuracy of the local model. The reputations of each client in the global model may vary significantly to the highly imbalanced data and energy consumption of different clients. The concept of device reputation is an important reference factor for accelerating training and improving model accuracy. Therefore, the following four factors should be considered in the node selection.  
1. Accuracy: For an FL task, its training quality is defined as the test accuracy of the aggregated global model on the test dataset. In this paper, we use the sum of the loss functions of the test dataset to denote the test accuracy, i.e., \(L\Big{(}x_{\text{test}},y_{\text{test}};\omega_{n}^{(T^{it})}\Big{)}\), where \(\omega_{n}^{(T^{it})}\) denotes the local model parameters.
2. Number of iterations: The number of iterations in time \(T\) varies from device to device due to differences in device computational power and local dataset size, with more iterations usually resulting in better accuracy. The CPU cycle frequency, the number of CPU cycles, and the capacitive parameters of the compute chip for client \(n\) are denoted by \(f_{n},c_{n}\), and \(\zeta\). The computation time for a local iteration is as follows: \[T_{n}=c_{n}|H_{n}|f_{n}^{-1}\] (10) The number of iterations for device \(n\) is denoted as follows: \[T_{n}^{iter}=T/T_{n}\] (11)
3. Profit: The compensation paid to the client is usually calculated according to the size of the client's contribution. If the client can contribute more to the training task, such as providing a better model, higher accuracy, etc., then the client will receive a higher profit accordingly [38]. The profit to client \(n\) in round \(t\) can be calculated using the following formula: \[P_{n}^{t}=\alpha\cdot|H_{n}|+\beta\] (12) where \(\alpha\) and \(\beta\) are pre-determined coefficients, and \(|H_{n}|\) denotes the size of the data that the client participates in training. The values of \(\alpha\) and \(\beta\) can be determined according to the difficulty of the task, the size of the client's data, and the time limit of the task.  
4. Reputation: The evaluation of the client's data volume is determined by the size of the dataset of the other participating clients, and the contribution of the data size can be calculated using the following formula: \[G_{n}=\frac{|H_{n}|}{\sum_{n=1}^{N}|H_{n}|}\] (13) The CPU power consumption of the client in a local iteration is represented as follows: \[E_{n}^{cmp}=\frac{\zeta c_{n}|H_{n}|f_{n}^{2}-\text{min}(E^{cmp})}{\text{max}( E^{cmp})-\text{min}(E^{cmp})}\] (14) Therefore, the client's contribution in one edge iteration can be calculated as follows: \[C_{l}(n)=E_{n}T_{n}^{liter}+G_{n}\] (15) Blockchain is a distributed ledger that records the client's reputation value. Assuming an initial reputation value of \(r^{0}=0\) for all clients, the reputation \(r\) of a client for \(l\)-th edge iteration can be expressed by the cumulative reputation value as follows: \[r_{n}=\sum_{l=1}^{l}\frac{1}{1+e^{-\log\left(\left(f_{n}^{l-1}+C_{l}(n)\right) /2\right)}}\] (16)