In the case of random checks, a procedure that could be helpful to mitigate the risks to privacy would be to require police to conduct a privacy impact assessment.
Before using random checks, I encourage you to explore the possibility of establishing parameters so that not only are the checks not random, but they aren't arbitrary either or left to the full discretion of the peace officer. That would be the first thing to do. If you don't think there should be such controls, I strongly encourage you to try to structure this and have parameters for the exercise of police powers on the matter.
Beyond those criteria that would give legal parameters for the exercise of police powers, there is, in the right to privacy, the mechanics of the privacy impact assessment. Based on that assessment, government authorities would be asked to assess how they would implement the power in question. They would reflect on how to do it, how the risks to privacy could be mitigated and how to manage these things.