###### Abstract  
In order to overcome the limitations of traditional stochastic models for smartphones, we introduce a double-difference code pseudorange residual (DDPR)-dependent stochastic model based on an optimal satellite subset, with the goal of mitigating the constraints imposed by the quality of GNSS observations in smartphones on the accuracy and reliability of phone-based GNSS positioning. In our methodology, the satellite selection process involved considering the integrated carrier-to-noise density ratio (C/N0) index of both the reference station and the smartphone, enabling us to construct a satellite subset characterized by superior observation quality. Furthermore, by leveraging the optimal subset of satellites and incorporating the C/N0-dependent stochastic model, we could determine the approximate location of the terminal through pseudorange differential positioning. Subsequently, we estimated the DDPRs for all satellites and utilized these values as prior information to build a stochastic model of the observations. Our findings indicate that in occluded environments, the DDPR-dependent stochastic model significantly enhances positioning accuracy for both the Huawei Mate0 and P40 terminals compared to the C/N0-dependent model. Numerically, the improvements in the north (N), east (E), and up (U) directions were approximately 30%, 32%, and 34% for the Mate40, and 26%, 33%, and 24% for the P40 terminal. This suggests that the proposed DDPR-dependent stochastic model effectively identifies and mitigates large gross error signals caused by multipath and non-line-of-sight (NLOS) signals, thereby assigning lower weights to these problematic observations and ultimately enhancing positioning accuracy. Moreover, the weighting method involves minimal computations and is straightforward to implement, making it particularly suitable for GNSS positioning applications on smartphones in complex urban environments. s 202424259820  
accuracy can achieve sub-meter levels with a single or dual-frequency PPP model [1; 2; 3]. However, the convergence time typically spans between 10 to 30 min, a duration primarily dependent on the surrounding environment [3; 4; 5]. In a real-time kinematics (RTK) mode, decimeter or even centimeter positioning accuracy can be realized in static open spaces under ideal conditions [6; 7; 8; 9]. However, dynamic positioning in urban environments presents challenges due to observational noise and multipath influences, making ambiguity difficult to fix and reducing the average positioning accuracy to meter levels, thereby yielding suboptimal results [10; 11; 12]. Consequently, a discernible gap persists between smartphone-based location services and the high-precision positioning application demands of public life. The quality of observations, particularly pertaining to non-line-of-sight (NLOS) signals and multipath errors, remains a principal factor constraining the accuracy, timeliness, and reliability of smartphone GNSS positioning [3; 6; 13]. Ensuring the quality of GNSS observations in smartphones is pivotal for enhancing positioning performance. The stochastic model, which delineates the relative correlation and precision of GNSS observations, is crucial for subsequent optimal parameter estimation and quality control. Broadly, conventional observation stochastic models fall into two categories. The first encompasses classical prior weighting methods, where weights are determined based on empirical values or real-time observations. Examples include the elevation-dependent weighting model [14; 15] and the carrier-to-noise density ratio (C/N0)-dependent weighting model [16; 17]. The second category involves the posteriori variance estimation weighting model, which employs the correction number of the pre-adjustment to ascertain the weight. This includes methods like the Helmert variance component estimation and the minimum norm quadratic unbiased estimation methods [18; 19].