Deterministic and stochastic mean-field sirs models on heterogeneous networks