The Patent Law clearly stipulates that "using relevant patents for scientific research and experiments" is not regarded as infringement of patent rights.
However, if your final scientific research results are going to enter the market, and the said scientific research results contain other people's patented technology, then you need to negotiate with the patent technology holder to sign an implementation license contract during the implementation process, otherwise it will be infringement.