The invention provides a method and device of detecting whether a GNSS (Global Navigation Satellite System) terminal is on or below an overhead road. The method includes the steps: inputting the acquired observation characteristic value of the GNSS terminal into a random forest model, wherein the random forest model gives more than one decision-making result according to the observation characteristic value, classifying the decision-making results according to whether the GNSS terminal is on or below the overhead road, and taking the decision-making result with an occupation proportion greaterthan 50% as a judgment result, about whether the GNSS terminal is on or below the overhead road, given by the random forest model. The method and device of detecting whether a GNSS terminal is on orbelow an overhead road directly utilize the GNSS information, use machine learning to learn the corresponding model according to the signal data in the environments on and below the overhead road, canimprove the accuracy of discriminating on / below condition of the overhead road, do not depend on other sensors, do not need the previous related upgrade / downgrade records, and can be available once the device is started.