Theoretical and experimental study on the flexible barrier optimization against debris flow risk