A method for improving the accuracy of UWB 
ranging in a firearm off-location alarm 
system is disclosed. The method comprises: a UWB module installed on a 
beacon in a firearm sends a 
ranging request pulse 
signal to a sentry box 
base station at a first moment, and a UWB module of the sentry box 
base station receives the request pulse 
signal at a second moment, and sends a response 
signal to the 
beacon at a third moment, the UWB module of the 
beacon receives the response signal at a 
fourth moment, and sends an end signal at a fifth moment, and the sentry box 
base station UWB module receives the end signal at a six moment; two-way 
flight time of the pulse signal between the beacon and the sentry box base 
station is calculated based on the first moment, the second moment, the third moment, thefourth moment, the fifth moment, and the sixth moment, so that the UWB 
ranging information is determined, wherein the UWB ranging information is about a distance from the beacon to the sentry box basestation; and filtering treatment is performed on the UWB ranging 
information data by adaptively selecting a corresponding parameter configuration based on multiple groups of different parameter configurations.