You can extend your residence permit for the purpose of research before the expiry of its validity period if you wish to continue your work as a researcher in Germany.