iOS app connects to the intranet and controls other hardware. This hardware is used for the surgery of patients. As mostly on surgery it's tough to use the iOS app by finger and voice commands look better option out there.
I had gone through the speech recognizer framework and could detect the words without internet.
however, these services can not be run for a long time. SpeechRecognizer framework only allow to run for a minute, as surgery may last more than an hour. I want to create a mechanism where we can trigger the app to start recognizing the voice command. (Similar to ok google in Android) so that the app gets a trigger to capture the voice commands.
Looking for the suggested readings or solutions.

"Hey Siri" works in the same way as "Ok Google", Both just trigger the voice assistant. To be able to perform custom tasks you can create a Siri extension, or maybe use Siri shortcuts but that might be more limited. You cannot just trigger your app directly from voice. You need to use Siri as that is 'always listening'.
There are some older answers that suggest if you start recording in the foreground and then switch the background and request extended time to finish your recording that it works but even then I think it would only give you a short amount of time. With recent releases I think this has been restricted further (probably for privacy reasons)
iOS Background audio recording
So to answer your question, I think you would need to create a Siri extension that can trigger these actions in your app.