总结网上很细的两篇文章: https://www.cnblogs.com/0201zcr/p/5962578.html https://www.cnblogs.com/zeng1994/p/8257763.html