Beacon allows Bluetooth [1] devices to broadcast and receive tiny information within short distance, which consists of two parts: a broadcaster (beacon device) and a receiver (smartphone app). So, it is being widely used in URL (Uniform Resource Locator) broadcast, distance measurement, localization etc. However, because of its deviation, measured distance value is not always accuracy. In this paper, we propose a new scheme to improve the distance measurement accuracy. The distance measurement function can be used for localization flexibly, but in some special situation such as a faulted or bad beacon is present, or obstacle is present between the beacon and user, the localization will be incorrect. We also call the beacon is “malicious beaon”. These malicious beacons will significantly impact the accuracy of user's localization. In this paper, we provide a new scheme to mitigate the influence of the “malicious beacon” use the improved distance measurement, and identify it. At last, we compare the performance of our scheme with the general scheme. The simulation result shows that the proposed scheme is better than the general scheme.