## 6 Experimental Evaluation
### Performance of the Resource Allocation  
In this part, we evaluate the performance of the proposed energy-efficient resource allocation. By substituting the solution of the optimal data quantity obtained from the contract into the optimization problem, the optimal computing resource, transmission power, and total energy consumption corresponding to resource allocation can be obtained. To demonstrate the energy-efficient performance of the proposed algorithm, we set up three baseline algorithms as follows. * DCM: DCM [40] is a resource allocation algorithm in mobile edge computing that aims at capturing the trade-off between learning efficiency and energy consumption. It optimizes CPU frequency, data volume, and total FL delay. * Benchmark1: Compared with the proposed algorithm, the CPU frequency \(f_{j}\) of the vehicle is directly set to \(f_{j}^{max}\). * Benchmark2: Compared with the proposed algorithm, the power \(p_{j}\) of the vehicle is directly set to \(p_{j}^{max}\). * Benchmark3: Compared with the proposed algorithm, the data volume of vehicles is randomly allocated. Figure 7 illustrates the relationship between different transmission parameter sizes and energy consumption. It can be observed that, as the parameter size increases, the total energy consumption also increases. This is because larger parameters require more energy for transmission. The proposed algorithm achieves the lowest energy consumption. This is attributed to our algorithm considering the sojourn time based on the degree of contract willingness. The higher the willingness of the VU, the longer its sojourn time, and even if the transmission delay increases, there is still enough time for training. However, in the case of increased transmission delay, the DCM algorithm will reduce training time due to the limitation of total sojourn time, thereby allocating more CPU frequency and resulting in greater energy consumption. Figure 6: VUs’ utility versus contract items. Figure 8 illustrates the relationship between VU's sojourn time and energy consumption. It can be observed that, as the sojourn time increases, the energy consumption decreases. This is because VUs have a longer training time, leading to a lower allocated CPU frequency and transmission power, resulting in reduced computational and transmission energy consumption. The curve's trend gradually flattens out as the computation or communication resources reach their minimum values. Among the compared algorithms, Benchmark1 exhibits the least significant decrease in energy consumption. This is because its CPU frequency is set to the maximum value and cannot be reduced. In the DCM algorithm, latency is optimized, which may lead to a trade-off between latency and energy consumption, resulting in higher energy consumption compared to the proposed algorithm in this paper. The proposed algorithm comprehensively considers contract-based sojourn time, computational capacity, and transmission capacity, aiming to minimize the total energy consumption within a given sojourn time requirement. Figure 8: Total energy consumption versus average sojourn time. Figure 7: Total energy consumption versus parameter size. Figure 9 illustrates the relationship between the number of VUs (J) and the total energy consumption in FL. As the number of VUs increases, the energy consumption inevitably increases. For Benchmark1 and Benchmark2, the allocation of maximum CPU frequency and transmission power, respectively, results in high energy consumption. For Benchmark3, the data allocation to VUs is not optimized, resulting in many VUs being assigned the minimum amount of data, which may lead to poor model performance. As the number of VUs increases, the performance gap between the DCM algorithm and the proposed algorithm significantly increases. This is because the DCM algorithm optimizes the total latency and model accuracy and may allocate as much data and as many resources as possible to improve accuracy and reduce latency, but it ignores the consideration of the willingness of VUs.