the first commit, it now  can work. but need some test to set various periods porperly

Signed-off-by: anzizhao <anzizhao@126.com>