i use save_as_mainfile() but this function lock blender interface. What can i do to avoid problem with locking interface ?
There is no way to call operators in an async way.
Perhaps you would better save the scene normally with the explicit operator. For double-safety, save a new temporary .blend file with a unique filename.
But then use subprocess, to invoke
blender.exe from command line along with the correct command line arguments. It should load the script stub file at once and then exit without any UI shown etc.
Unfortunately this is a hack, not exactly the dream. But as long you duplicate your data (to avoid opening the same file at the same time in two processes) and duplicate another new blender.exe instance (to avoid any memory corruption with multithreading etc). Everything will work in the background in a relaxed way.