The user terminal may calculate the first message authentication code of the first location privacy setting data based on a first freshness parameter, where the first freshness parameter includes a first counter value and a first function counter value. The user terminal may notify the data management network element of the first freshness parameter, so that the data management network element obtains the second message authentication code of the first location privacy setting data based on the first freshness parameter. The user terminal calculates a fourth message authentication code of the first location privacy setting data based on a second freshness parameter, where second freshness parameter includes a first counter value and a second function counter value, and the second function counter value is different from the value of the first function counter value.
Alternatively, the user terminal calculates the first message authentication code of the first location privacy setting data based on a first random value, and calculates the second message authentication code of the first location privacy setting data based on a second random value. The first random value is generated by the user terminal, and the user terminal may notify the data management network element of the first random value, so that the data management network element obtains the second message authentication code of the first location privacy setting data based on the first random value. The second random value is generated by the data management network element or an authentication service network element, and then the data management network element or the authentication service network element notifies the user terminal of the second random value, so that the user terminal calculates the fourth message authentication code of the first location privacy setting data based on the second random value.