## 3 Results and Discussion
Figure 4b show the rate performance curves of the CNFs-0 NH\({}_{3}\), CNFs-10 NH\({}_{3}\), CNFs-20 NH\({}_{3}\), CNFs-30 NH\({}_{3}\), and CNFs-40 NH\({}_{3}\) anodes. Similarly, with the increase in the ammonia activation time from the CNFs-0 NH\({}_{3}\), CNFs-10 NH\({}_{3}\), and CNFs-20 NH\({}_{3}\) anodes to the CNFs-30 NH\({}_{3}\) anode, the rate performance of the carbon nanofiber anodes also gradually increased. The CNFs-30 NH\({}_{3}\) anode showed the strongest rate performance, with an average specific capacity of 818.4, 666.5, 623.8, 508.9, and 452.4 mAh g\({}^{-1}\) at the current density of 50, 100, 200, 500, and 1000 mA g\({}^{-1}\), respectively. When the current density returned to 50 mA g\({}^{-1}\), the specific capacity of the CNFs-30 NH\({}_{3}\) anode could still reach 736.7 mAh g\({}^{-1}\). However, with the further increase in the ammonia activation time, the rate performance of the CNFs-40 NH\({}_{3}\) anode was attenuated. These results illustrate that a moderate ammonia activation time is beneficial to improving the electrochemical  
Figure 3: XPS analysis of carbon nanofibers with different ammonia activation times: (**a**) Full spectra of CNFs-10 NH\({}_{3}\), CNFs-20 NH\({}_{3}\), CNFs-30 NH\({}_{3}\), and CNFs-40 NH\({}_{3}\). N\({}_{\rm 1s}\) spectra of (**b**) CNFs-10 NH\({}_{3}\), (**c**) CNFs-20 NH\({}_{3}\), (**d**) CNFs-30 NH\({}_{3}\), and (**e**) CNFs-40 NH\({}_{3}\). properties of carbon nanofibers, as excessive activation may make the anode sheet brittle due to the presence of too many holes, resulting in poor rate performance. Based on the analysis of the above results, ammonia activation can make carbon nanofibers obtain a hierarchical and heterogeneous porosity structure, which is instrumental in promoting electrochemical properties. In addition, it is worth noting that a small amount of nitrogen was doped in the carbon nanofibers in the process of manufacturing the microporous, mesoporous, and macroporous structures. Therefore, to further explore the effect of N-doping on the electrochemical performance of carbon nanofiber anodes, we chose CNFs-30 NH\({}_{3}\) with the best performance as the N-doping object to reveal the influence mechanism of nitrogen on carbon nanofibers with the hierarchical and heterogeneous porosity structure and to further improve its electrochemical performance. Figure 5a-d show the micromorphology of the hierarchical and heterogeneous porosity structure of carbon nanofibers with different N-doping contents. The images show that all N-doped porous carbon nanofibers have a good nanofiber shape, with a diameter of about 300 nm. With the increase in the N-doping content, there was little difference in the micromorphology of the carbon nanofibers. However, there are many cross-linking phenomena in the CNFs-3N anode. This is because when the added content of melamine is 3 g, the spinnability of the nanofiber becomes poor, and the spinning rate decreases due to the high viscosity of the solution, so the CNFs-3N anode will be locally uneven after pre-oxidation, carbonization, and activation. The SEM image of CNFs-2N and the corresponding EDS mapping of elements are shown in Figure 5e. The C and N elements are evenly distributed, indicating that N was effectively doped in the nanofibers. Figure 5f show the nitrogen adsorption-desorption curves. The hysteresis loop of each sample appears at P/P\({}_{0}\) > 0.4, belonging to type IV isotherms. This indicates that all samples contain mesopores. Furthermore, the corresponding pore size distribution curves of CNFs-0N, CNFs-1N, CNFs-2N, and CNFs-3N in Figure 5g indicate that all samples have micropores (pore size less than 2 nm), mesopores (pore size between 2 and 50 nm), and macropores (pore size greater than 50 nm), which meets the expectation of preparing N-doped carbon nanofibers with a hierarchical and heterogeneous porosity structure.