Introduction

Most breeding enterprises are working to achieve intensification, scale farming and modernization. This trend has led to the high-density production of livestock and poultry in small areas, bringing about unbearable pollution to the environment (Wang et al. 2021a). In 2017, the total faecal emissions of pigs, cattle and sheep in China exceeded 1.64 × 109 t, among which the excretion of cattle accounted for 45.77%, followed by pigs (28.51%), poultry (14.64%) and sheep (11.08%) (Liu et al. 2020a). Pollution by heavy metals, including zinc (Zn), copper (Cu), cadmium (Cd), chromium (Cr) and arsenic (As), in pig manure was more serious than in the manure of other livestock or poultry (Liu et al. 2020a). These heavy metals lead to high levels of oxidative DNA damage, significant overexpression of immediate early response genes, abnormal cell proliferation, the reduction of individual antioxidant levels, and act in combination with the sulfhydryl of antioxidant enzymes (Valko et al. 2005; Assi et al. 2016). Meanwhile, the toxicity of heavy metals to plants and animals is determined by the speciation in which the metals are present instead of their total concentrations (Singh and Kalamdhad. 2013). The centralized discharge of a large number of livestock and poultry manure without effective treatment has caused the pollution of air, water and soil structure (Kong et al. 2018; Liu et al. 2019).

As an eco-friendly technology, composting can convert organic waste into a humified ultimate product through a variety of active microorganisms and reduce the toxicity of heavy metals (Liu et al. 2019). Additives for heavy metal passivation in aerobic composting have been widely studied, such as incorporation of biochar, lime and zeolite (Cui et al. 2020, 2021; Chen et al. 2021). In addition to aerobic composting, some saprophagous insects, including black soldier fly larvae (BSFL), earthworms and houseflies, are used for the degradation of organic waste (Wang et al. 2017; Chen et al. 2019; Cheng et al. 2021). Adult black soldier flies have neither a stinger nor a mouthpart or digestive organs, so they cannot spread diseases by biting, similar to other flies (Kumar et al. 2018). Compared with vermicomposting, BSFL can be inoculated with fresh faeces directly for biocomposting. Lalander et al. (2019) reported that BSFLs were effectively reared on food waste, human faeces and abattoir waste. The gut of BSFL has high amylase, lipase and protease activities (Kim et al. 2011). BSFL could enhance the conversion of fulvic acid, increase the humic acid/fulvic acid ratio and improve humification in livestock manure composting (Liu et al. 2020b; Wang et al. 2021b). Compared with conventional composting methods, BSFL biocomposting can reduce NH3, N2O and CH4 emissions (Pang et al. 2020). The bioconversion properties of BSFL have been studied in different agricultural wastes (Gao et al. 2019; Hasnol et al. 2020; El-Dakar et al. 2021).

Diener et al. (2015) studied the bioaccumulation of Zn, Cd and Pb in the larvae, prepupae and adults of black soldier fly under the pressure of different concentrations, and the results showed that Cd would accumulate in larvae, while Zn and Pb would be excreted. Moreover, the growth environment containing high concentration of these three heavy metals minimally affected the development of black soldier fly (Diener et al. 2015). During the growth of black soldier fly from V instar larvae to prepupae, the contents of minerals and taurine in the body increased, whereas the contents of toxic heavy metals decreased (Giannetto et al. 2020). The European Commission (2002/32/EC) has established maximum concentrations of several heavy metals in animal feed, in which Cd, As and Pb are 2, 2 and 10 mg/kg, respectively (Diener et al. 2015; Giannetto et al. 2020). If the concentration of Cd in the feed for black soldier fly exceeds the EC maximum limit, it is necessary to evaluate whether the black soldier fly protein material used as part of complete feed surpasses the limit, and appropriately reduce the addition of larval protein material (Van der Fels-Klerx et al. 2016).

The absorption of heavy metals by BSFL may be impacted by functional genes in metal homeostasis (Wu et al. 2021). Furthermore, the bioavailable fraction of Cr declined after BSFL composting in swine manure with different concentrations of heavy metals (Wang et al. 2021c). Notably, heavy metal mobilization increases with a short composting time (Liu et al. 2020b). Thus, BSFL was better suited for bioconversion of organic waste compared to other insects. However, there have been few studies on the effect of different inoculations of BSFL on biocomposting.

Therefore, the major objectives of this study were (i) to determine the effect of different inoculation densities of BSFL on the dynamics of physicochemical properties and larval amino acid content, (ii) to explore the effect of different inoculation densities of BSFL on heavy metal bioaccumulation and bioavailability and (iii) to investigate the correlation between the physicochemical parameters and heavy metal content at different inoculation densities of BSFL. The exploration of the difference between BSFL biocomposting with three inoculation densities and aerobic composting could help with our understanding of the characteristics of heavy metal immobilization in biocomposting, and it is expected that the results presented in the study may provide a basis for heavy metal immobilization in swine manure.

Materials and methods

Preparation of substrates and BSFL culture

In this study, swine manure was collected from a livestock farm at the Institute of Animal Genetics of Sichuan Agricultural University (Ya’an, Sichuan, China), sawdust was acquired from Ya’an Timber Processing Mill and black soldier fly eggs were provided by the Anuo Feed Company. The weight of the substrates in each treatment group was 5 kg, and aerobic composting was mixed at a ratio of 9:1 (swine manure:sawdust, DW). Meanwhile, sawdust was not added to the manure of BSFL biocomposting, and the moisture content of substrates was adjusted to approximately 75% in all treatments. The physicochemical parameters and heavy metal contents of the composting materials are shown in Table 1. The black soldier fly eggs were placed into a plastic box where the temperature stabilized at 26–28 °C for approximately 2–4 days until the larvae hatched. After that, the larvae were stored in a breeding basin with wheat bran for 4 days and then inoculated in fresh swine manure.

Table 1 Composition of raw materials used in this study

Experimental design and samples collection

During 45 days, given component differences, aerobic composting was implemented. Based on the mass fraction (W/W) of fresh weight of pig manure and larvae, BSFL was added at ratios of 0.08% (low: L), 0.24% (medium: M) and 0.40% (high: H), namely, BSFL biocomposting. The mixed stuff of aerobic composting was placed in a plastic lab-scale cylinder composting reactor (diameter: 25.3 cm; height: 33.5 cm; volume: 16 L) wrapped with polyurethane foam for thermal insulation. Forced intermittent ventilation from the container bottom was used to supply oxygen for aerobic composting. It was ventilated for 60 s every 3 h at a rate of 650 mL/min. In addition, the BSFL was placed in a plastic biocomposting container with the inner size of 60 cm in length, 40 cm in width and 20 cm in height; the container was sealed with a screen mesh to ensure air permeability and prevent the experiment from disturbance by external insects. The ambient temperature was maintained at 20–30 °C without any special protocol. Later, black soldier fly prepupae were sifted out after 20 days of BSFL bioconversion, and the substrate was naturally stacked for 25 days, which was the second composting. Each treatment was repeated three times. Samples were taken every 5 days during the whole experiment via the five-point sampling method and then mixed. A total of 50 g of sample was obtained, out of which 35 g was used to determine the moisture content; pH; electric conductivity (EC); total organic carbon (TOC); total nitrogen (TN); the concentrations of 6 heavy metals, including Cu, Zn, Pb, Cd, As and Cr; and the speciation changes of Cu, Zn, Pb and Cr. The remaining 15 g was reserved at − 20 °C for the determination of the germination index (GI) after the end of the composting process. Finally, the black soldier fly prepupae were collected to make 100-g air-dried samples, which were then stored in a dryer and applied to the measurement of the total content of heavy metals and the amino acids of the prepupae.

Analytical methods

Physicochemical properties

pH and EC were measured with a metre (PHS-320, Yiheng Co. Ltd., Chengdu, China). The moisture content of the samples was determined after drying at 105 °C for 24 h. TOC and TN were analysed according to a previously described method (Wang et al. 2021d). The seeds of Chinese cabbage were placed in a Petri dish with qualitative filter paper at the bottom, after which 10 mL water extract of the sample was added, and then the Petri dish was transferred to a thermostatic incubator at 20 °C (SHP-160, Sanfa., Chengdu, China) for 48 h for the purpose of measuring the GI value.

Growth performance and amino acid profiles

The study detected various growth indices of 20-day-old BSFL in each treatment, including moisture, crude protein (CPRO), prepupal body weight (PBW), prepupal body size (PBS) and total prepupal yield (TPY). TPY was the sum of the dry matter of prepupae isolated from the three inoculation densities after 20 days. Ten representative black soldier fly prepupae of the same group were selected and weighed for PBW with an electronic balance. Afterwards, the head and tail of the prepupae were fixed with a vernier calliper for PBS measurement. CPRO was detected by an automatic KDN-520 Instrument (KDN-520, Hangzhou LVBO Instrument Co., Ltd); that is, the content of TN was multiplied by 4.76 to obtain the CPRO content (Janssen et al. 2017). Seventeen amino acid contents of 20-day-old black soldier fly prepupae were analysed with an amino acid analyser (LA8080, HITACHI, Shanghai, China) in each treatment, according to the method reported by El-Dakar et al. (2021).

Analysis of concentration and speciation of heavy metals

The concentrations of Cd, As, Pb, Cr, Cu and Zn were measured by inductively coupled plasma mass spectrometry (ICP-MS; iCAP RQ, Thermo Fisher Scientific Inc., Shanghai, China) and inductively coupled plasma optical emission spectrometry (ICP-OES; Optima 8000, PerkinElmer Inc., Massachusetts, USA). The variation percentage (V) of the concentration of all heavy metals in each scenario was calculated, and the V value was determined by the following equation (Wang et al. 2013):

$$V (\mathrm{\%})=\left[\frac{{C}_{i}-{C}_{f}}{{C}_{i}}\right]\times 100$$
(1)

where Ci is the concentration of heavy metals in the raw material (mg/kg, dry weight: DW), and Cf indicates the same in the final compost.

The modified Community Bureau of Reference (BCR) sequential extraction scheme was described in a previous study (Wang et al. 2021d). After sequential extraction, the extractable (F1), reducible (F2), oxidable (F3) and residual (F4) fractions of the heavy metals in each treatment were sequentially extracted and subsequently measured by ICP-MS and ICP-OES. All samples were measured in triplicate. The bioavailable fraction and bioaccumulation factor (BCF) were calculated using a formula by Wu et al. (2021):

$$\mathrm{Bioavailable}\;\mathrm{fraction}\;(\%)=\frac{\mathrm{exchangeable}\;(\mathrm F1)+\mathrm{reducible}\;(\mathrm F2)}{\mathrm{total}\;\mathrm{amount}\;\mathrm{of}\;\mathrm{heavy}\;\mathrm{metals}}\times100$$
(2)
$$BCFs=\frac{{M}_{e}}{{M}_{c}}$$
(3)

where Me is the total concentration (mg/kg, DW) of selected heavy metals in the BSFL, and Mc is the total concentration (mg/kg, DW) of the same heavy metal in the substance.

Statistical analysis

All data are reported as the mean and standard deviation (mean ± SD) of three replicates. One-way analysis of variance (ANOVA) and a Kruskal–Wallis test were used to assess the homogeneity of variance and significance levels of 5% (p < 0.05) by SPSS version 27.0. All charts were created in Origin 2017, and a heatmap was generated in R 3.5.3. Canoco v.5 software was adopted to analyse the correlation between the concentrations of heavy metals and physicochemical parameters.

Results and discussion

Physicochemical changes during composting

The temperature of aerobic composting was maintained above 55 °C during days 0 to 10, with the highest temperature being 64.4 °C (Fig. S1). In the aerobic composting, L, M and H groups on day 20, the moisture contents were 37.05%, 33.39%, 28.32% and 19.61% (Fig. S2a), respectively, and the moisture cumulative loss separately reached 58.74%, 71.88%, 89.78% and 101.31% (Fig. S2b). TOC and TN in aerobic composting were different from those in BSFL biocomposting at the beginning of composting (Fig. 1a and b). A contributing factor was that sawdust was added to aerobic composting at the initial stage to adjust the C/N ratio, increase the porosity and permeability of the heap, thereby ensuring the normal aerobic composting. BSFL had been able to directly degrade and transform pig manure through feeding and digestion. The mechanical peristalsis had helped increase the number of pores in the composting and improve air permeability. After composting, TOC significantly (p < 0.05) decreased by 18.68%, 26.54%, 32.04% and 32.65% in the aerobic composting, L, M and H groups, respectively (Fig. 1a). A potential reason was that the substrate of the compost became the material with a smaller particle size and was easier to degrade by microorganisms after being chewed up by the larvae and digested by various digestive enzymes (Kim et al. 2011). Furthermore, the TOC of the H group was significantly (p < 0.05) lower than that of the M group on day 10. On day 45, the TN of the aerobic composting, L, M and H groups was 23.32 g/kg, 25.11 g/kg, 26.08 g/kg and 26.16 g/kg, respectively (Fig. 1b). A large amount of NH3 emission, caused by high temperature of the substrate (Fig S1), resulted in a rapid decrease of TN in aerobic composting (Yang et al. 2019). The degradation and mineralization of organic matter led to an increase in the concentration of soluble salts in the substrates (Chan et al. 2016), thereby causing a rise in EC from day 1 to 20 (Fig. 1d). The consumption of TOC by BSFL was one of the potential factors for the increase in EC. In particular, humus generated during the composting process gave rise to a decline in EC in all groups during days 20 to 30 (Li et al. 2020). During days 30 to 45, a possible factor of rising EC was the increase in the concentration of soluble salts caused by decreasing moisture content. On day 45, the EC of the aerobic composting, L, M and H groups was 3.54, 3.44, 4.79 and 4.7 ms/cm, respectively. EC within 4.0 ms/cm could exert little toxicity on plants (Lasaridi et al. 2006). The dilution of the composting production of the M and H groups could effectively reduce the inhibitory action on the plants. The increase in pH values of substrates could be caused by the decomposition of organic nitrogen and NH4+-N produced by ammonification (Liu et al. 2019). In addition, the decline in the pH value is possibly due to the production of low-molecular-weight organic acids and the increase in nitrification (Chen et al. 2019). During the first 20 days, the pH values in the L, M and H groups showed similar variation tendencies (Fig. 1e). Nevertheless, the pH of aerobic composting peaked 5 days later than that in BSFL. On days 20–45, the rate of increase was different in all treatments. At the end of composting, the pH values were 8.38, 9.46, 8.90 and 8.66 in the aerobic composting, L, M and H groups, respectively. During days 20 to 45, the low utilization of L group for TN led to the conversion of the remaining TN to NH4+-N by the ammonification of microorganisms, which could have caused the highest pH of L at day 45. Generally, GI was greater than 80%, indicating that compost maturity and plant toxicity roughly reached 0 (Yang et al. 2015; Wang et al. 2021e). The GI of all treatments increased before day 35 (Fig. 1f). In the M and H groups, it peaked at 110.33% and 120.5% on day 35, and its later decline was associated with high EC (Fig. 1d). Moreover, it reached the highest value, 104.47% and 82.49%, in aerobic composting and L group, respectively, at day 45. The highest GI of the M and H groups appeared 10 days earlier than that of the aerobic composting and L groups. Additionally, during days 0 to 45, the C/N of the aerobic composting, L, M and H groups fell by 24.32%, 29.06%, 36.79% and 37.56%, respectively (Fig. 1c). In this experiment, the degradation rate and the mineralization degree of the organic matter in the M and H groups were the greatest, and the GI of the H group peaked at day 35.

Fig. 1
figure 1

Dynamics of the TOC (a), TN (b), C/N (c), EC (d), pH (e) and GI (f) during aerobic and BSFL composting

Growth performance and amino acid contents of BSFL

In BSFL biocomposting, the PBW and PBS both diminished as the inoculation density rose, while the TPY increased (Fig. 2). The PBW and PBS in the L group (130.89 ± 5.18 mm and 14.62 ± 0.10 mg) were at the maximum, and they were at the minimum in the H group (45.06 ± 0.80 mm and 9.45 ± 0.34 mg) among the 20-day-old black soldier fly prepupae. PBS and PBW in all treatments were lower than those reported by El-Dakar et al. (2021), which may result from malnutrition caused by the lack of adding adjuvants to swine manure before inoculating the larvae. Conversely, TPY in the H group reached the highest value, 135.70 g (Fig. 2). Given this, TPY in the M group (124.51 g) and H group was higher than that reported by Beesigamukama et al. (2021). Additionally, CPRO (Fig. 2) in the study was lower than that of the research reported by Gao et al. (2019), for the nitrogen-to-protein conversion factor was closer to the actual value (Janssen et al. 2017). As the inoculation densities grew, TPY increased, while PBW and PBS decreased. Nonetheless, they had little effect on the CPRO of individuals and the total contents of amino acids (Table 2). The nitrogen recovery of the prepupae in M and H groups was significantly higher than that in L group, which was bound up with the TPY. Among the 17 kinds of detected amino acids, the contents of serine (Ser), glutamic acid (Glu), glycine (Gly), tyrosine (Tyr) and histidine (His) were dramatically different (p < 0.05), among which Ser, Glu and Gly increased as the inoculation density increased, while Tyr and His showed the opposite trend (Table 2). Ser is the precursor of Gly, Glu and Gly are precursors of the synthesis of glutathione, and Met is likewise the progenitor of cysteine (Cys) (Peng et al. 2007). Metallothionein, a small protein rich in Cys, exerts an effect with glutathione on the detoxification of heavy metals in organisms (Fisker et al. 2013). Moreover, the significant differences in these amino acids were consistent with BCF at different inoculation densities (Table 3). Hence, more Glu, Gly and Ser were probably synthesized to glutathione and metallothionein in the BSFL of the M and H groups to release the stress caused by heavy metals.

Fig. 2
figure 2

Comparisons of growth performance on day 20 at different BSFL inoculation densities. TPY: total prepupal yield, PBW: prepupal body weight, CPRO: crude protein, NR: nitrogen recovery, PBS: prepupal body size. Various letters signify a significant difference among treatments (p < 0.05)

Table 2 Comparisons of 17 amino acids at different inoculation densities
Table 3 Bioaccumulation factors (BCFs) of heavy metals in BSFL after a 20-day bioconversion

Effects of different inoculation densities of BSFL on the concentration and speciation of heavy metals

In this study, the variation in heavy metal concentration in the substrates of BSFL biocomposting is mainly due to the following two factors. First, a large amount of organic matter is consumed in the substrates during the composting process, and then the ash content increased, thereby causing a concentration effect (Vig et al. 2011). In addition, bioaccumulation in BSFL results from the absorption of heavy metals from the substrate through the skin or intestine (Wang et al. 2017). Over the first 20 days, when the concentration effect was greater than bioaccumulation in BSFL during biocomposting, the concentration of heavy metals grew. Otherwise, it dropped.

The concentrations of 6 heavy metals (Cu, As, Cd, Zn, Pb and Cr) showed a tendency of day 0 < day 20 < day 45 in aerobic composting (Fig. 3), and this trend was merely impacted by the concentration effect. During a 45-day compositing period, there was an increase in the contents of 6 heavy metals, ranked as follows: Cu (47.3%) > As (45.7%) > Cd (45.4%) > Zn (41.6%) > Pb (40.3%) > Cr (34.8%). The elements of C, H and O in the composting of organic matter were lost in the form of CO2, H2S and H2O, respectively, due to the action of microorganisms and the fauna (Khan et al. 2019). Over the 20 days of BSFL bioconversion, the contents of the 6 heavy metals in the substrates varied. The contents of As, Cu and Zn in the L, M and H groups increased (Fig. 3). The concentration of As increased by 34.16%, 68.04% and 85.95% in those three groups, respectively; Cu, 12.38%, 13.89% and 24.28%; and Zn, 26.53%, 39.01% and 43.72%. On day 20, the contents of As, Cu and Zn followed group H > group M > group L. The rate of increase of As concentration in BSFL substrates was the highest, and As was undetected in the BSFL bodies, probably owing to the excessively low As content inside them. Van der Fels-Klerx et al. (2016) revealed that the bioaccumulation factor of As in BSFL was low because most As was eliminated through the intestine before the prepupal stage. Generally, the variation trend for the concentrations of As, Cu and Zn in the substrates was in accordance with the studies reported by Lv et al. (2016) and Liu et al. (2020b). In addition, the rate of increase in As concentration in the M and H groups was higher than that in aerobic composting because the assimilation ratio of organic matter by BSFL exceeded its degradation by aerobic composting (Liu et al. 2020b). Apart from Cr and Pb in the L group, the concentrations of Cd, Cr and Pb in the substrates of BSFL bioconversion during d0–d20 declined (Fig. 3). The substrate concentrations of Cd in the L, M and H groups decreased by 25.63%, 45.20% and 78.66%, respectively. In addition, the Cr concentrations of the M and H groups in substrates were reduced by 20.98% and 20.27%, respectively, and the Pb concentrations decreased by 6.51% and 8.17%, respectively. Furthermore, the concentrations of Cd, Cr, Cu and Zn in BSFL bodies in the M and H groups were significantly higher than those in the L group (p < 0.05). On day 20, the BSFL was isolated, and the second composting phase (curing phase) started. The heavy metal concentration was merely affected by the concentration effect, thereby resulting in an increase in the 6 heavy metal concentrations in the substrate during days 20–45 (Fig. 3). On day 45, in BSFL biocomposting, the concentrations of As, Cu, Zn and Pb in the three groups grew by 57.18–129.12%, 26.98–38.71%, 35.87–59.61% and 0.91–18.45%, respectively, while the Cd concentration declined by 11.76–71.32%. Except for the L group, the Cr concentration in the other groups decreased by 3.64–9.68%. In the substrates of the BSFL bioconversion, as the inoculation densities grew during d0–d20, the rate of decrease of Cd and Pb concentration rose, and the rate of increase of Cu concentration was less than that in aerobic composting. The highest concentrations of Cd, Cr, Cu and Zn were found in the BSFL bodies of the M and H groups.

Fig. 3
figure 3

Dynamics of the concentration of heavy metals in the 20-day BSFL body and substrates on days 0, 20 and 45. AC: aerobic composting; L: the inoculation density group of 0.08% BSFL; M: the inoculation density group of 0.24% BSFL; H: the inoculation density of 0.40% BSFL. Values plotted are the relative abundances after log10 transformation

The BCF of Cd in the three groups of larvae was greater than 1 (Table 3), in line with a previous study (Ahadi et al. 2020). A related study revealed that Cd2+ could be transported through Ca2+ channels and accumulate in various dipteran insects (Van der Fels-Klerx et al. 2016). Given this, the Ca content of BSFL was higher than that of other species of insects, leading to the high Cd content, which increased the amount of metallothionein in the larvae to combine more Cd (Wang et al. 2021c). The overall BCF of Cd in the three groups was higher than that of the study reported by Wang et al. (2021c). This could be due to the background value of heavy metals in the substrate. That is, BCFs are generally higher in the less polluted mixtures (Wang et al. 2017). However, the BCFs of Pb, Cr, Cu and Zn were less than 1, and the BCFs of the M and H groups were significantly higher than those of the L group. The descending order of BCF in the M and H groups (Cd > Zn > Cu > Cr > Pb > As) and that of the BCF of Cd in the H group were similar to those in previous studies on earthworms (Rorat et al. 2016). Cu and Zn are essential elements with latent toxicity. In insects, the metal-responsive-element-binding transcription factor-1 (MTF-1) is capable of activating some genes involved in the intracellular sequestration and transport of zinc, including metallothioneins (MTs), zinc efflux transporter protein (ZnT1), and glutamate-Cysteine ligase heavy chain (γGCShc), so as to actively regulate homeostasis of Cu and Zn (Laity and Andrews. 2007; Navarro and Schneuwly. 2017). The weak bioaccumulation effect of black soldier fly prepupae on Pb and Cr is probably owing to the excretion of larvae through ecdysis and metamorphosis (Diener et al. 2015; Gao et al. 2017). Similar to earthworms, BSFL rapidly absorbs essential trace elements such as Cu and Zn at the initial stage of composting, and the absorption of nonessential trace elements such as Cd continuously increases with low excretion after essential trace elements reach saturation (Rorat et al. 2016). In short, different inoculation densities in BSFL biocomposting led to diverse variations in moisture content, TOC, TN and heavy metal concentration in the substrates among the BSFL bioconversions. The H group showed the best removal effect on heavy metals in swine manure in terms of the trends of TPY, BCFs and heavy metal content of the BSFL bodies during BSFL bioconversion.

The inoculation of BSFL with livestock manure for biocomposting led to an increase in the humic acid content of the compost, the conversion of fulvic acid and the acceleration of composting humification (Liu et al. 2020b). The bioavailability of heavy metals is affected by the complex formed from heavy metals and humic acids. In addition, another transformation method for heavy metal speciation was the binding mechanism between metals and cells in the larvae, including the regulation and excretion of essential metals such as Cu and Zn based on metallothionein isomers (He et al. 2016). Furthermore, nonessential metals reaching toxic concentrations are replaced by Ca and then combined with organic ligands and inorganic substrates for detoxification, and different heavy metal speciations change along with the variation in concentration in the biocomposting process (He et al. 2016). The toxicity of heavy metals mainly relies on their bioavailable fractions, while residual fraction bioavailability is tiny (Wu et al. 2021). The variation in speciation of Cu, Zn, Pb and Cr before and after composting was distinct. After 45 days, the reducible fraction (F2) of Cu in aerobic composting was significantly decreased from 68.72 ± 2.86% to 19.11 ± 2.51% (p < 0.05), and in the L, M and H groups, the fraction started at the initial 71.77 ± 2.02% to 26 ± 3.15%, 6.36 ± 0.65% and 6.19 ± 3.71% (p < 0.05), respectively (Fig. 4). Apart from the exchangeable fraction (F1) of aerobic composting, the proportions of other forms increased, especially the oxidizable fraction (F3). Studies have reported that inoculating swine manure with BSFL could lead to a rise in weak acid-soluble components of Cu in the substrates (Liu et al. 2020b; Wu et al. 2021). In this study, the decline in the Cu bioavailable fraction was mainly ascribed to the decrease in the reducible fraction (F2) and the increase in the oxidizable fraction (F3) (Fig. 4), and the Cu bioavailable fraction of the aerobic composting, L, M and H groups significantly dropped by 49.76%, 41.05%, 60.31% and 58.77%, respectively, after composting (p < 0.01) (Table 4). Compared with Cu, the bioavailable fraction of Zn remained almost the same before and after composting. According to the study reported by Wu et al. (Wu et al. 2021), the bioavailable fraction of Cu and Zn did not show a dramatic change after BSFL biocomposting, probably owing to the extremely high concentrations of Cu and Zn in the substrates (Fig. 5), which led to little effect of microorganisms and BSFL on reducing the bioavailable fraction of heavy metals. This situation is similar to that of Zn in this experiment. The reducible fraction (F2) of Zn (aerobic composting: 62.01 ± 0.71%, L: 69.81 ± 2.56%, M: 70.9 ± 2.17%, H: 71.08 ± 2.99%) after 45 days of composting was higher than that of the other three fractions (Fig. 4), which was similar to the research of Zheng et al. (2021), and a major factor was that Zn could bind with Fe oxides. The exchangeable fraction (F1) of Pb, however, was not detected in the initial composting materials of aerobic composting or BSFL biocomposting (Fig. 4). This was consistent with the experimental result of Wang et al. (2017). This may be attributed to the chemical properties of Pb and its insoluble inorganic compounds (Zheng et al. 2021). The reducible fraction (F2) of Pb in aerobic composting decreased from 32.72 ± 3.05% to 25.95 ± 3.38%, and in the L, M and H groups, the fraction significantly declined from 28.67 ± 2.47% to 9.93 ± 1.50%, 8.14 ± 2.44% and 0%, respectively (p < 0.05). In contrast, the residual fraction (F4) of Pb in aerobic composting increased from 32.29 to 37.70%, and in the L, M and H groups, the fraction significantly increased from 42.39 ± 1.75% to 54.56 ± 2.71%, 66.83 ± 1.96% and 73.03 ± 3.14%, respectively (p < 0.05) (Fig. 4). Similarly, during earthworm composting with sludge and cow dung as substrates, the residual fraction (F4) of Pb rose, whereas the exchangeable fraction (F1) fell (He et al. 2016; Wang et al. 2017). The decrease in the Pb reducible fraction (F2) and the increase in the Pb residual fraction (F4) contributed to the reduction in Pb bioavailable fractions in the aerobic composting, L, M and H groups by 6.77%, 18.74%, 20.53% and 28.67%, respectively. Among them, there was a significant decline (p < 0.01) in Pb bioavailable fractions in the L, M and H groups, and those in the H group on day 45 were 0, probably because when humus combined with heavy metals, they could be effectively degraded from the organic compounds by microorganisms with the help of BSFL (Wang et al. 2017), and the transformation of part of the Pb form was completed in the larval body. Moreover, the residual fraction (F4) of Cr in aerobic composting significantly climbed from 19.65 ± 2.77% to 33.80 ± 2.94% (p < 0.05) after 45 days of composting, and in the L, M and H groups, the fraction significantly increased from 19.31 ± 2.17% to 48.02 ± 1.66%, 57.02 ± 3.54% and 73.90 ± 2.07%, respectively (p < 0.05). However, the reducible fraction (F2) significantly decreased from 34.58 ± 2.44% to 17.89 ± 2.06%, and in the L, M and H groups, the fraction decreased from 30.98 ± 0.63% to 19.24 ± 2.96%, 9.90 ± 0.68% and 6.93 ± 1.09%, respectively (p < 0.05). Hence, the bioavailable fraction of Cr was significantly reduced by 17.05%, 13.13%, 22.47% and 25.44% in the aerobic composting, L, M and H groups, respectively (p < 0.01). Accordingly, the H group had the highest removal rate (%) on the bioavailable fraction of Pb and Cr in swine manure.

Fig. 4
figure 4

Distribution of Cu, Zn, Pb and Cr in aerobic and BSFL composting. SM: swine manure; AC: aerobic composting; L: the inoculation density group of 0.08% BSFL; M: the inoculation density group of 0.24% BSFL; H: the inoculation density of 0.40% BSFL. Numbers on the abscissa represent days

Table 4 Bioavailable fractions (%)
Fig. 5
figure 5

Concentrations of exchangeable (F1), reducible (F2), oxidizable (F3) and residual (F4) fractions of Zn, Cu, Pb, Cr. SM: swine manure; AC: aerobic composting; L: the inoculation density group of 0.08% BSFL; M: the inoculation density group of 0.24% BSFL; H: the inoculation density of 0.40% BSFL. Numbers on the abscissa represent days

Correlation analysis of the concentration of heavy metals and physicochemical parameters

The absorption of heavy metals by BSFL and earthworms is influenced by various physicochemical properties of substrates, including pH, EC and both organic and inorganic matter content. (He et al. 2016; Wang et al. 2017). Redundancy analysis (RDA) was used to detect the concentration of heavy metals and physicochemical parameters among the four different compost treatments to determine the relationship of their variation trends during the composting process. The RDA demonstrated that aerobic composting had a higher correlation with the concentration of heavy metals and physicochemical properties than the BSFL treatments (Fig. 6). The values of these correlation coefficients for the aerobic composting and L, M, and H groups were 84.48%, 71.56%, 66.38% and 66.00%, respectively, which could have been due to different effects of BSFL biocomposting and aerobic composting on the concentration of heavy metals and the degradation of organic matter in the substrates. The RDA indicated that the correlation of TOC and moisture content was positive, while that among TOC, moisture content and heavy metal concentration was negative in aerobic composting. Many reports have shown that TOC is largely consumed by microorganisms or saprophagous insects when composting (Wu et al. 2020; Gong et al. 2021). Given this, the concentration effect, leading to the concentration variation of heavy metals in aerobic composting, was mainly caused by the decline in TOC and moisture content. Furthermore, there was a positive correlation between pH, EC, TN and the concentration of heavy metals (Fig. 6). Bioaccumulation and concentration effects both played roles in the concentration of heavy metals among BSFL treatments (Vig et al. 2011; Wang et al. 2017). Cd was positively correlated with TOC and moisture content in BSFL biocomposting due to the huge absorption of Cd by BSFL (Wang et al. 2021c). In addition, the concentration variation of Pb and Cr in the M and H groups was also positively correlated with TOC and moisture content because the absorption rate of Pb and Cr by BSFL in the substrates for the M and H groups was higher than the concentration rate (Fig. 6). Judging from the RDA results, during BSFL biocomposting, the Cd concentration in BSFL group is positively correlated with TOC and moisture. TOC (Fig. 1a), moisture content (Fig. S2) and Cd concentration (Fig. 3) show a decreasing trend in the process of BSFL biocomposting compared with the initial values, the Cd concentration declined with the consumption of TOC and moisture. The rise in EC value for the M and H groups could be ascribed to the increase in the concentrations of Cu, As and Zn.

Fig. 6
figure 6

Redundancy analyses of the correlation between the concentration of heavy metals and physicochemical properties

Conclusion

Compared with aerobic composting, BSFL biocomposting with an inoculation density of 0.40% resulted in a higher total organic carbon degradation rate, germination index and total prepupal yield. The inoculation density of 0.40% had the best removal effect on Cd, Cr, Cu and Zn and the highest removal rate (%) of bioavailable fraction of Pb and Cr in swine manure. The bioavailable fraction of Zn showed little difference owing to the high concentration. One of the main factors for increases in EC at inoculation densities of 0.24% and 0.40% was the increase in the concentrations of Cu, As and Zn. This study could help understand the features of heavy metal immobilization in aerobic composting and biocomposting with three inoculation densities of BSFL, which is expected to lay the foundation for heavy metal immobilization in swine manure.