A server-implemented method for setting a mobile device identifier, comprising: obtaining an application, APP, list of a target mobile device; performing matching between the APP list of the target mobile device and several APP lists stored in a device library, to determine a number of identical APPs in the APP list of the target mobile device and in the APP lists in the device library, wherein corresponding device identifiers are pre-allocated to the several APP lists; determining whether the determined number of identical APPs reaches a pre-set threshold; when the number of identical APPs in the APP list of the target mobile device and in any one of the APP lists in the device library reaches the pre-set threshold, setting a device identifier corresponding to the one APP list in the device library as the target mobile device's device identifier, the method characterised in that the pre-set threshold is an optimal threshold obtained by: generating APP list pairs from the APP lists stored in the device library, each APP list pair comprising a first APP list and a second APP list; calculating, for each APP list pair, a set reference value, the set reference value comprising a minimum value, maximum value, an average value, or a difference between the number of APPs in the first APP list and the number of APPs in the second APP list, wherein the set reference values are calculated similarly for all of the APP list pairs; partitioning at least one value interval based on the calculated set reference values; conducting a statistical analysis of the number of identical APPs in the APP lists of the APP list pairs included in each partitioned value interval to set the optimal threshold for the each partitioned value interval; and wherein before determining whether the determined number of identical APPs reaches a pre-set threshold, the method further comprises: tallying the number of APPs in the APP list of the target mobile device; separately comparing the number of APPs in the APP list of the target mobile device to the number of APPs in each of the APP lists stored in the device library, and calculating a set reference value, wherein each set reference value is calculated similarly as for the APP list pairs for the APP lists stored in the device library; looking up the value interval where the calculated reference value is located; and obtaining the optimal threshold corresponding to the value interval to serve as the pre-set threshold. obtaining an application, APP, list of a target mobile device; performing matching between the APP list of the target mobile device and several APP lists stored in a device library, to determine a number of identical APPs in the APP list of the target mobile device and in the APP lists in the device library, wherein corresponding device identifiers are pre-allocated to the several APP lists; determining whether the determined number of identical APPs reaches a pre-set threshold; when the number of identical APPs in the APP list of the target mobile device and in any one of the APP lists in the device library reaches the pre-set threshold, setting a device identifier corresponding to the one APP list in the device library as the target mobile device's device identifier, the method characterised in that generating APP list pairs from the APP lists stored in the device library, each APP list pair comprising a first APP list and a second APP list; calculating, for each APP list pair, a set reference value, the set reference value comprising a minimum value, maximum value, an average value, or a difference between the number of APPs in the first APP list and the number of APPs in the second APP list, wherein the set reference values are calculated similarly for all of the APP list pairs; partitioning at least one value interval based on the calculated set reference values; conducting a statistical analysis of the number of identical APPs in the APP lists of the APP list pairs included in each partitioned value interval to set the optimal threshold for the each partitioned value interval; and wherein before determining whether the determined number of identical APPs reaches a pre-set threshold, the method further comprises: tallying the number of APPs in the APP list of the target mobile device; separately comparing the number of APPs in the APP list of the target mobile device to the number of APPs in each of the APP lists stored in the device library, and calculating a set reference value, wherein each set reference value is calculated similarly as for the APP list pairs for the APP lists stored in the device library; looking up the value interval where the calculated reference value is located; and obtaining the optimal threshold corresponding to the value interval to serve as the pre-set threshold. tallying the number of APPs in the APP list of the target mobile device; separately comparing the number of APPs in the APP list of the target mobile device to the number of APPs in each of the APP lists stored in the device library, and calculating a set reference value, wherein each set reference value is calculated similarly as for the APP list pairs for the APP lists stored in the device library; looking up the value interval where the calculated reference value is located; and obtaining the optimal threshold corresponding to the value interval to serve as the pre-set threshold.