An example in which this embodiment of this application is applied to the schematic diagram of the network architecture shown in
Step S101: UE calculates a first message authentication code of first location privacy setting data.
The first location privacy setting data is location privacy setting data entered or updated by a user on the UE. The UE may save the first location privacy setting data, so that the UE may report the first location privacy setting data to a UDM.
The UE may calculate the first message authentication code of the first location privacy setting data based on an input key and a first input parameter. Further, the UE derives a key used to calculate a message authentication code of location privacy setting data, and uses the key as the input key. The UE calculates a hash value for the first location privacy setting data by using the input key and the first input parameter, and the hash value is the first message authentication code.