Localization using wireless signal is a hot field now, and the real time indoor localization is a difficult problem for its complex and sensitive to the environment. This paper proposes a method based on grid to convert global to local. Based on the Markov random field, we convert efficiently signals between different environments and achieve high precision and fast speed. The paper also discusses influence of multiple signals to location precision, explains that multiple sets of signal can be used greatly to improve localization precision. To reduce the number of supervised grids in learning data required by the grid-matching algorithm, this paper presents a method which combines the grid matching and the signal strength model. First the position is localized by the grid-matching method and then its location is refined by using the signal strength model in the local area.