增加一些缓存读写逻辑
增加一些缓存读写逻辑

提高无人值守时的稳定性。

多进程同时读写、意外退出或断电时会造成文件写入不完整，无法再次读出。
- f.close() 尽快完成写入。
- 增加几种异常，遇到损坏的缓存时直接覆盖。
eehello/bypy,Zocalos/bypy,RobberPhex/bypy,alex1818/bypy,houtianze/bypy,rocky1001/bypy,liujianpc/bypy,yusiwen/bypy,menghan/bypy,rchlin/bypy,usr0418/bypy,WangKaimin/bypy,wwj718/bypy,liuycsd/bypy,YelaSeamless/bypy,adrianzhang/bypy,jezhang/bypy,oouyang/bypy,hxford/bypy,nucked/bypy,houtianze/bypy,krizex/bypy,zeropool/bypy,liuycsd/bypy,MaolinWang/bypy