Patent rules are country specific. In the US, publicly using or selling an invention more than 1 year prior to filing a patent application completely bars you from ever winning a patent on that invention, but in Europe, there is no 1-year grace period; you are barred from getting your invention patented the moment you make a public disclosure. Therefore, European scientists make sure they file their patent application first and then publish in a journal or present the idea at a conference.You should find out what the patent rules in your country are. To avoid problems, you should file your patent application first and then publish a research paper on it in an academic journal.
Additionally, if you wish to publish a paper related to your patent, I think it would be best to inform the journal editor about this before you submit your paper, just in case they have any rules about publishing patent related information.Publishing a journal paper will help you make your invention known to the scientific community. In addition to giving fame and respect, it will also help you get grants.