## 3.1 Structure and morphology of PCDP and N/S-DDPCs

As shown in Fig. 2a, FT-IR spectra of NAR, PPD and PCDP present the structural changes before and after polymerization. The peaks of 3245 cm− 1 and 1694 cm− 1 belong to the stretching vibration of the -NH2 and C = O bonds of NAR. For FT-IR of PPD, the peak of characteristics H-C = O appeared at 1682 cm− 1 and 2812 cm− 1, respectively. The disappeared characteristic absorption peaks for PCDP are of H-C = O and -NH2 groups. A new stretching vibration peak appeared at 1602 cm− 1, corresponding to the bond C = N formed during polymerization [24, 25]. These results indicated that the aldehyde group and the amino group reacted completely. To further verify the occurrence of Knoevenagel reaction, we conducted solid state nuclear magnetic 13C NMR measurement on PCDP to confirm the formation of C = N and C = C bond. As can be seen from Fig. 2b, the resonance peaks at 235 ppm and 182 ppm are attributed to the C = S and C = O bonds on the *N*-Aminorhodanine moiety. In general, the resonance peaks at 165 ppm are assigned to the C = N bond, while the peaks at 116 ppm are ascribed to the C = C bond [26]. In brief, the above results showed that the precursor PCDP was successfully synthesized. Figure 2c presents the XRD diagrams of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9. The two characteristic peaks at 23.7° and 43° belong to the (002) and (100) crystal planes of graphite, indicating the structure of part of the graphite stack [27, 28]. The wide diffraction peak (002) indicates that a large number of amorphous structures exist in N/S-DDPCs. In general, the higher carbonization temperatures provide the necessary driving force for the formation of more crystal regions and promote a higher degree of graphitization [29]. As can be seen in Fig. 2d, all samples have very wide diffraction peaks, and N/S-DDPC8 is more obvious, which may be due to the abundant micropores in N/S-DDPC8. The (100) surfaces of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8, and N/S-DDPC9 changed from sharp and sharp to wide and almost disappear with the increase of temperature, so it can be proved that the ordered carbon level decreases with the increase of the activator mass [30]. At the carbonization temperature of 600 and 700 ℃, N/S-DDPC6 and N/S-DDPC7 have higher plane diffraction peaks (002) due to the incomplete reaction between KOH and C. However, N/S-DDPC9 has a higher degree of graphitization because the higher temperature at 900 ℃ promotes not only the reaction between KOH and C, but also the transition from amorphous carbon to graphitized carbon [31].

In the experiment, the Raman spectra were measured to clarify the graphitized structure (Fig. 2d). Two characteristic D bands and G bands were observed for N/S-DDPCs at 1342 and 1582 cm− 1, respectively. It has been reported that D bands are produced by structural defects and partially disordered structures, and G bands are produced by sp2 hybrid graphite carbon atoms [32, 33]. The wide D bands was synthesized into three bands of 1200, 1350 and 1490 cm− 1, which correspond to D1 caused by hybridization, D2 caused by the vibration of sp3 carbon atoms and amorphous carbon D3 respectively [30]. The strength ratio of D-band to G-band (ID/IG) is usually considered as a method of determining the defect degree in carbon materials. According to the calculation, the ID/IG ratios of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9 are calculated as 1.08, 1.05, 1.03 and 0.95, respectively. The close to 1 of ID/IG values for all samples indicates that the carbon materials have an ideal structure [34]. At the same time, the temperature is so high that some carbon atoms cross the energy barrier and become graphitized carbon atoms [35]. Fig. S1 shows that D3 gradually decreases and IG gradually increases from N/S-DDPC6 to N/S-DDPC9. N/S-DDPC9 exhibited the minimum ID/IG value (0.95), which was in great consistency with the above XRD observation.

In order to further analyze the functional groups on the surface of N/S-DDPCs, XPS were measured, as shown in Fig. 3. The characteristic peaks appear near 285.1, 400.1, 532.8 and 178.8 eV, corresponding to C 1s, O 1s, N 1s and S 2p atoms, respectively. The C 1s spectra were resolved into three peaks at 284.7, 286.3, and 289.1 eV, corresponding to the C = C, C-O-C and C = O, respectively (Fig. 3b). The N 1s spectra of all N/S-DDPC samples can be classified into three different types (Fig. 3c), namely pyridine-type nitrogen (N-6, 398.1 eV), pyrrole-type nitrogen (N-5, 400.4 eV) and quaternary nitrogen (N-Q, 401.5 eV) [36]. Pyridine nitrogen could improve the surface wettability of the electrode, and provide additional reversible pseudocapacitance [37]. With the increase of temperature, the content of N decreases from 4.82% at 600 ℃ to 1.8% at 900 ℃. This result indicates that KOH reacts with both carbon and N at the higher temperature, leads to the excessive corrosion of N element in materials. Fig. S2 also shows that the optimal carbonization temperature of PCDP is 800 ℃ in the preparation of N/S-DDPCs. At the same time, N-6 gradually changes to N-5, and the content of N-5 in N/S-DDPC8 is 1.28%. As can be seen from Table S1, although N-6 becomes N-5, with the increase of temperature, the N content is lost, and the N-5 content gradually decreases from 2–0.8%. It was proved that reducing the content of N-5 in N/S-DDPC8 can further reduce the occurrence of leakage current and self-discharge, and increase cyclic stability [15]. Therefore, 800 ℃ is the optimal calcination temperature for the highest capacitance in electrochemical theory. The high resolution S 2p spectrum (Fig. 3d) can be divided into three peaks, of which two peaks of 163.8 eV and 165.1 eV are attributed to the bonding of S 2p3/2 and S 2p1/2, and the peak of 168.6 eV is attributed to C-SOx-C [38]. The observed S 2p3/2 and S 2p1/2 indicate that the S atoms were successfully inserted into the carbon lattice, thereby widening the distance of the carbon lattice, changing the electron density, and creating more pseudocapacitor defects. The C-SOx-C group could improve the surface wettability of N/S-DDPC8 and attract more electrolyte ions. Furthermore, the sulfur dopant can also participate in the Faraday reaction to produce pseudo-capacitance. Generally, the charge redistribution and the increase of electron donors in the carbon skeleton are carried out by reversible redox reactions containing N, S and P atoms. [39]. For N/S-DDPCs, N and S double doping plays a crucial role in improving the capacitance performance of the materials. In Table S2, the fitting percentages of C, N, O and S elements of N/S-DDPC8 were 77.62%, 3.57%, 16.5% and 2.31%, respectively. These retained heteroatoms could modify the surface chemical state, including beneficial wettability of electrodes and beneficial changes in surface charge density to provide additional pseudo-capacitance.

As Fig. 4a shown, the isothermal curves of four N/S-DDPCs present a typical IV curve with H2 hysteresis loop, which means the existence of mesoporous. The slight increase of 0.9-1.0, P/P0 in the high-pressure region indicates the existence of a small number of macropores. The hysteresis loop appeared in the range of relative pressure P/P0 0.5–0.9 is the characteristic of mesopore. In the low voltage area of P/P0 < 0.1, the curve rises sharply due to strong interaction, indicating the existence of a large number of micropores. The existence of mesopores promotes the electrical conductivity to a certain extent, while the micropores contribute more to capacitance. These characteristics are essential in the charge storage process following the double-layer capacitance mechanism.

In addition, the pore size distribution curve also confirmed the appearance of micropores and mesopores, and the pore sizes for N/S-DDPCs were concentrated in 2.6–4.5 nm range (Fig. 4b). In addition, due to solvation deformation, the micropores with diameter less than 0.7 nm in the sample can make the solvated ions in the aqueous electrolyte closer to the carbon wall (which means that the electronic double layer is closer to the electrode material, resulting in an increase in capacitance) [40]. With the increase of carbonization temperature, specific surface areas (SSA) of N/S-DDPC6, N/S-DDPC7 and N/S-DDPC8 increased from 1283 and 1496 to 2047 m2 g− 1, respectively, while SSA of N/S-DDPC9 decreased to 1875 m2 g− 1 again. When the carbonization temperature increased to 900 ℃, the strong activation process makes the pores collapse, resulting in the decrease of SSA (Fig. 4c). Moreover, the total pore volume correspondingly increased from 0.91 cm3 g− 1 and 0.96 cm3 g− 1 to 1.06 cm3 g− 1, then decreased to 1.02 cm3 g− 1 (Fig. 4d). The high carbonization temperature leads to the effective etching of the inner wall of PCDP by KOH, which increases the specific surface area and broadens the pore size distribution. However, the too high carbonization temperature also cause damage to the structure of carbon materials [41]. For this experiment, the carbonization temperature of 800 ℃ is the best one for the precursor PCDP. In short, N/S-DDPC8 has high SSA and proper pore size distribution and good electrochemical performance.

In the experiment, we used SEM and TEM to systematically observe the precursor PCDP and the target carbon material N/S-DDPCs. From Fig. S3, it can be seen that the amorphous structure is displayed even at low magnification, the petal-like structure of PCDP is conducive to the fabrication of porous structures in the subsequent treatments. Figure 5(a-d) shows the SEM in N/S-DDPCs obtained at different temperatures. The pore structure of N/S-DDPC6 and N/S-DDPC7 by carbonized at 600 ℃ and 700 ℃ is not as developed as that at 800 ℃. This is due to incomplete etching of materials by KOH and incomplete evaporation of excess components in PCDP. For N/S-DDPC8 carbonized at 800 ℃, there are abundant interconnected pore structures, While the temperature reaches 900 ℃, resulting in excessive activation of KOH, the reactivated pores in N/S-DDPC9, and the thinner pore wall (Fig. 5d). From Fig. 5(e-g) of SEM-EDX element mapping image of N/S-DDPC8, the presence of N, O and S elements can be seen, showing uniform distribution. In order to further prove the internal structure of N/S-DDPCs, TEM observations were carried out on the carbonized samples (Fig. 6). Under the action of KOH, the pores preliminarily formed in the N/S-DDPCs at 600 ℃. With the increase of temperature, the pores gradually became more and more (Fig. 6(a-d)). Among TEM observations at different sample, N/S-DDPC8 shows a large number of mesopores and macropores at low magnification (Fig. 6c). Under the high-power mirror of Fig. S4, amorphous carbon mainly exists in porous carbon because lattice fringe of carbon does not appear. The electron diffraction patterns of selected areas of N/S-DDPC8 were observed from Fig. 6e. The high definition diffraction rings on the (002), (100) and (101) crystal planes of carbon confirmed the graphitization structure of N/S-DDPC8 to a certain extent [42]. The graphitized structure of the porous carbon material helps to improve the conductivity of the sample, thus changing the capacitive property of the sample. At the same time, the existence of C、N and S for N/S-DDPC8 was confirmed in EDS test in Fig. 6f, while O element was decomposed in most of the etching and calcination processes. The above result indicates that the temperature should not be too low or too high in the etching process of PCDP with KOH as the activator [43]. Overall, in our experiment, the carbonization at 800 ℃ is the most suitable for precursor PCDP.

## 3.2 Electrochemical measurements

In the three-electrode test system, the electrochemical properties of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9 were studied systematically in 6 M KOH as electrolyte. The CV curves of N/S-DDPCs are close to rectangle, reflecting the rapid electron and ion transport in the electrode (Fig. S5). For more intuitively quantification the CV curves of N/S-DDPCs at 100 mV s− 1 are presented in one picture. As shown in Fig. 7a, N/S-DDPC8 has a larger encircling area than N/S-DDPC6, N/S-DDPC7 and N/S-DDPC9, indicating that N/S-DDPC8 has a higher specific capacitance. The slight bulge of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9 near − 0.2 V results from the Faraday reaction caused by doped N and S elements, thus further proving a double layer electric capacitor and a slight pseudocapacitor [44]. With the increase of scanning speed, the curves of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9 are slightly distorted, but still maintain the basic rectangle, and there is no obvious redox peak. GCD test was performed to further quantify the specific capacitance of N/S-DDPCs. Figure 7b shows the GCD curves of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9 at current density of 0.5 A g− 1. It can be seen that N/S-DDPC8 comparatively exhibits longer charge-discharge time than N/S-DDPC6, N/S-DDPC7 and N/S-DDPC9, indicating that N/S-DDPC8 has the largest specific capacitance among N/S-DDPCs. According to formula (1.1) in the support information, the specific capacitance values for N/S-DDPCs were calculated as 180 F g− 1, 211 F g− 1, 354 F g− 1 and 307 F g− 1 at the current density of 0.5 A g− 1. Fig. S6 presented the GCD of the four N/S-DDPCs at the current density of 0.5–10 A g− 1, the specific capacitances of N/S-DDPCs are decreasing at a current density from 0.5 to 10 A g− 1 (Fig. 7c). In contrast, the decrease of the specific capacitance of N/S-DDPC8 is the smallest one. For example, when the current density reaches 10 A g− 1, the specific capacitance of N/S-DDPC8 is still as high as 202 F g− 1, equivalent to 74.3% of the specific capacitance at 0.5 A g− 1 current density. However, the specific capacitance retention rates of N/S-DDPC6, N/S-DDPC7 and N/S-DDPC9 under these conditions are 55.1%, 60.7% and 65.7%, respectively. In the experiments, the assembled supercapacitor was used to study the energy storage performance of the capacitor through the cyclic voltammetry (CV) curve of Dunn method. As shown in Fig. S7, the specific capacitance of N/S-DDPCs from electronic double layer has a high current capacitance value, which is generated by high specific surface area and a large number of micropores, and the pseudocapacitance generated by the doped heteroatoms also occupies a small part. When the scanning rate was increased from 20 to 100 mV s− 1, the capacitance contributions from electron bilayers of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9 ranged from 72–93%, 76–94%, 85–97% and 81–95%, respectively. This result indicates that the capacitance contribution increases with the increase of scanning speed. For the system composed of N/S-DDPC8 with good capacitance property, good connectivity and short-length graded channel, the electrolyte ions can transfer quickly and smoothly in the pores of the material [45, 46]. In short, the above results are closely related to the high SSA, the porous structure observed from SEM/TEM of N/S-DDPC8.

The EIS analysis is used to evaluate charge transport capacity and ion accessibility [47]. Figure 7d presents the EIS of several N/S-DDPCs. Obviously, the Nyquist curve is a nearly straight line in the low frequency region, and a typical semi-arc combination exists in the high frequency region, corresponding to Warburg impedance and charge transfer resistance respectively [36]. According to the circuit diagram simulation (Fig. 7d illustration), the diffusion resistance (Rct) reflects the charge transfer resistance between the electrode and the electrolyte. The equivalent series resistance (Rs) involves the contact resistance of the active substance/collector, the resistance of the active substance and the electrolyte, and the Warburg line and the ion diffusion resistance (σ (Ω s− 0.5)). The Rs of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9 were calculated as 1.34 Ω, 1.31 Ω, 1.02 Ω and 1.14 Ω, respectively. The Rct of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9 were measured as 0.28 Ω, 0.08 Ω, 0.07 Ω and 0.15 Ω, respectively. Through the simple comparison of Rct and Rs, N/S-DDPC8 has further proved as better electrochemical performance. The lower Rct can improve the charge storage capacity and accelerate its conduction and transport for N/S-DDPC8 [48]. The lower Rs value shows that N/S-DDPC8 electrode has excellent electrical conductivity. N/S-DDPC8 has a larger specific surface area, thus providing more accessible sites for electrolyte ions adsorption and the ions permeation to the electroactive surface. In addition, the phase angle of all samples is shown in Bode plot in Fig. 7e, and the phase angle of N/S-DDPC8 was 86°, which was close to the phase angle of 90° of the ideal double-layer electric capacitor. According to formula (τ0 = 1/f0), the relaxation times (τ0) of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9 at 45° was 7.7, 5.1, 0.6 and 2.0 s, respectively. It can be seen that the relaxation time of N/S-DDPC8 with good ion transport and diffusion ability was the shortest, indicating that the high degree of graphitization, rich pore structure, and N/S doping were conducive to the rapid transport and diffusion of ions. In order to quantify the ion diffusion resistance more accurately, the Warburg coefficient σ (Ω s− 0.5) was obtained by fitting the linear fitting diagram between Z' (the real part) and the reciprocal square root of the angular frequency (ω−0.5) in the angular frequency range of 0.2 to 0.5 rad s− 1. As shown in Fig. 7f, the σ values of N/S-DDPC6, N/S-DDPC7, N/S-DDPC8 and N/S-DDPC9 were 4.2, 4.1, 2.6, and 2.8 Ω s− 0.5, respectively. This means that the diffusion constant of N/S-DDPC8 was the largest, which was due to the large number of pores generated by KOH activation. However, for N/S-DDPC9 carbonized at 900 ℃, due to the destruction of pore structure, the charge diffusion resistance and its diffusion constant increases again. In brief, the above results indicate that N/S-DDPC8 has relatively fast relaxation time and larger diffusion constant, which is the main reason for its excellent electrochemical performance.

In order to be closer to practical application, the electrochemical performance of the symmetric supercapacitor (N/S-DDPC8-D) prepared with N/S-DDPC8 as electrode was tested with 2 M Zn(CF3SO3)2 as electrolyte, shown in Fig. 8a. From Fig. 8b, when the sweep speed is 5-100 mV s− 1, the CV curves of N/S-DDPC8-D are quasi-rectangular and have no obvious deformation, indicating a good double-layer capacitance behavior. The GCD curves of N/S-DDPC8-D were isosceles triangular (Fig. 8c). Formula (1.2) was used to calculate the specific capacitance when the current density is 0.5 ~ 10 A g− 1, and the calculated results are 336, 320, 308, 296 and 280 F g− 1, respectively. Even at 10 A g− 1, the specific capacitance retention rate of N/S-DDPC8-D can still reach 83.35%. In general, EIS is used to study the ion transport limitations of electrolytes (Fig. 8d). According to the calculation, the Rs and Rct of N/S-DDPC8-D were 1.8 Ω and 2.53 Ω, respectively, indicating that N/S-DDPC8 has a good ion transport capacity in Zn(CF3SO3)2 electrolyte. In addition, due to the good pore structure and wettability caused by N/S-doped atoms, in the low frequency region, the almost vertical straight line shows the effective ion diffusion efficiency. Cycle life is one of the key parameters for the evaluation of supercapacitors. In our experiment, the stability of N/S-DDPC8-D was investigated by GCD measurements. As shown in Fig. 9, after 10000 cycles, the specific capacitance of the symmetrical capacitor is still maintained at 98% of the initial value, indicating that N/S-DDPC8-D has excellent cycle stability. It can be seen in the illustration that two coins batteries can light up the LED lamp with a working voltage of 1.5 V. We can speculate that the uniform pore structure, larger SSA and N-S-dopped heteroatoms endow N/S-DDPCs with excellent electrochemical properties.

As well known, electrolyte is one of the most important components in supercapacitor, and its chemical composition, conductivity and viscosity have a crucial impact on its final performance. In order to further improve and stabilize the electrochemical performance of N/S-DDPCs, the above traditional non-concentrated Zn(CF3SO3)2 aqueous electrolyte (2 M) was regulated by dimethyl oxalate (DMO) additive (0.1 M) in our experiments. The unique Zn2+ solvation sheath, in which DMO and CF3SO3− anion jointly participate in the form of H2O + DMO, contributes to the formation of a stable ZnF2 interphase on the surface of N/S-DDPCs and the improved hydrophilicity between electrolyte and electrode surface [49, 50]. The solvation structure of H2O + DMO electrolytes and the interaction between Zn(CF3SO3)2 and the solvent were investigated by FT-IR and Raman. Figure 10(a-b) presents the FT-IR spectra of H2O + DMO electrolytes along with the neat DMO and H2O solvents. FT-IR spectra of Zn(CF3SO3)2 and Zn(CF3SO3)2+DMO solutions are basically similar. The vibration of -OH at 3359 cm− 1 from H2O in traditional Zn(CF3SO3)2 aqueous solution is redshifted to 3350 cm− 1 when Zn(CF3SO3)2 solutions regulated with DMO. This change may be due to DMO’s involvement in the formation of hydrogen bonds, in which the oxygen electrons transfer to hydrogen, the reduced constant force leads to a change in the vibrational state. This phenomenon was obviously due to the formation of hydrogen bonds in Zn(CF3SO3)2+DMO electrolyte. However, The vibration at other sites is not obvious, which further explains the formation of hydrogen bonds between the Zn(CF3SO3)2+DMO electrolytes [20]. Figure 10(c-d) shows the evolution of hydrogen bond interaction in Zn(CF3SO3)2+DMO electrolyte. In Fig. 10d, the changes at 3000–3800 cm− 1 are related with hydrogen bond interaction. The H-bond interactions in Raman spectra were divided into three types: strong H-bonds, weak H-bonds, and no H-bonds. In this experiment, the fitted area ratio of strong H-bonds to total H-bonds (As/At) in Fig. 10d increased from 0.32 in Zn(CF3SO3)2 to 0.36 in Zn(CF3SO3)2+DMO, accompanied by decrease in the ratio of non-H-bonds to total H-bonds (An/At) from 0.67 to 0.58, indicating that the strong hydrogen bond interaction induced by DMO [21]. The subsequent electrochemical data based on the response current in the monitoring CV and the solution resistance (Rs) in the EIS also confirmed significantly enhanced capacitance performance of N/S-DDPC8 using Zn(CF3SO3)2+DMO as electrolyte.

In the experiment, we further assembled the prepared Zn(CF3SO3)2+DMO as electrolyte (N/S-DDPC8-DMO-D) into a coin battery. Figure 11a shows CV curves under different voltage windows (from 1.4 to 2.0 V, 50 mV s− 1). When the voltage is increased to 1.6 V, the CV curve still has no obvious deformation, but when the voltage is controlled to 1.8 V, the CV curve was deformed, so the following electrochemical properties were tested at room temperature at 1.6 V. Figure 11b presents the CV curves of the device when the scanning rate is 5 to 100 mV s− 1, and Fig. 11c illustrates the GCD curves of the device when the current density is changed from 0.5 to 10 A g− 1. The calculated capacitances of the device calculated by GCD in Fig. 11c were 475, 458, 445, 387 and 332 F g− 1, respectively. Compared with other materials, N/S-DDPC8-DMO-D supercapacitors have superior performance (Table S (3, 4, 5 and 6)). In our investigation, according to the formulas (1.3 and 1.4) in the supporting information, and plotted (Fig. 11d). At 0.5 A g− 1 current density, the Ed and Pd of N/S-DDPC8-DMO-D were calculated up to 36.4 Wh kg− 1 and 642 W kg− 1, respectively. Under the same current, the Ed and Pd of N/S-DDPC8-D in traditional Zn(CF3SO3)2 electrolyte are only 11.7 Wh kg− 1 and 250 W kg− 1, respectively. The cyclic stability test is shown in Fig. 12. After 10,000 cycles at room temperature, the manufactured device showed a 100% capacitance retention rate. Additionally, the illustration indicates that the battery can light an LED light with an operating potential of 1.5 V.

The Nyquist curves of the supercapacitors based on N/S-DDPC8-DMO-D and N/S-DDPC8-D are shown in Fig. S8a. Bode diagram of Fig. S8b shows the phase angle of N/S-DDPC8-DMO-D and N/S-DDPC8-D was 85°, which was close to the ideal double layer capacitor (90°). According to formula (τ0 = 1/f0), the relaxation time (τ0) of N/S-DDPC8-DMO-D and N/S-DDPC8-D was 1 and 13.7 s, respectively. These results indicate that the addition of DMO in the Zn(CF3SO3)2 solution is more beneficial to the rapid migration and diffusion of ions. The ion diffusivity can be more accurately quantified by calculating Warburg coefficient σ (Ω s− 0.5), as shown in Fig. S8c. N/S-DDC8-DMO-D and N/S-DDPC8-D σ values were calculated as 2.4 and 3.4 Ω s− 0.5, respectively. The results show that the N/S-DDPC8-DMO-D material has lower charge diffusion resistance than other conductive materials. The main reason is that N/S-DDPC8-DMO-D system has a large surface area with N/S-dopped atoms, and the addition of DMO substantially increases the wettability of the contact surface between N/S-DDPC8 and electrolyte. These advantages can provide a larger, more accessible effecting surface for electrolyte ion and N/S-DDPC8, and enhance the transport efficiency for electrolyte ions.

Zn(CF3SO3)2+DMO electrolyte greatly extends the operating temperature, allowing the device to operate under extreme conditions. In Fig. S9, CV curves, GCD curves and EIS curves were tested at different temperatures (30 ℃, 40 ℃, 50 ℃, 60 ℃ and 70 ℃). Fig S9a shows the CV curves of 1 V using Zn(CF3SO3)2 electrolyte at 30 to 70 ℃ with a scan rate of 30 mV s− 1. Fig. S9d shows the CV curves of 1.6 V using Zn(CF3SO3)2+DMO electrolyte at 30 to 70 ℃ and a scan rate of 30 mV s− 1. Apparently all CV curves in Zn(CF3SO3)2+DMO electrolyte almost coincide with each other without significant area decay, indicating that the device has ideal capacitive properties even under large temperature fluctuation. As shown in Fig S9(b and e), GCD curves at the current density of 1 A g− 1 from 30°C to 70°C show triangular characteristics. Table S7 presents the specific capacitance calculated from GCD curve at current density of 1 A g− 1. The corresponding capacity retention rates in two electrolyte at 30 ℃ were 61% and 66%, respectively. It can be concluded that the addition of DMO extends the application range of N/S-DDPC8 supercapacitor. As shown in Fig. S9 (c and f), the equivalent series resistance gradually decreases with increasing temperature, due to the decreasing electrolyte viscosity and increasing ion mobility. In a word, N/S-DDPC8 has a high specific surface area, a layered porous structure, rich N/S double doping, multiple active sites and certain graphitized carbon, which was conducive to the diffusion of ions and the wettability of the electrode surface. The above advantages of N/S-DDPC8, combined with the regulation effect of DMO on traditional Zn(CF3SO3)2 electrolytes, together enable the substantial enhancement of capacitance performance in supercapacitor.