An insight into pyrolysis and flame retardant mechanism of unsaturated polyester resin with different valance states of phosphorus structures