A first aspect of this embodiment of this application provides a data transmission system, and the system includes a user terminal and a data management network element.
The user terminal is configured to calculate a first message authentication code of first location privacy setting data, and send the first message authentication code and the first location privacy setting data to the data management network element.
The data management network element is configured to receive the first message authentication code and the first location privacy setting data from the user terminal, obtain a second message authentication code of the first location privacy setting data, and if the first message authentication code is the same as the second message authentication code, determine that the first location privacy setting data is not tampered with, and store the first location privacy setting data.
According to the first aspect, the data management network element compares the first message authentication code with the second message authentication code to determine whether the first location privacy setting data is tampered with, to effectively prevent location privacy setting data from being tampered with, thereby ensuring end-to-end integrity protection of the location privacy setting data between the user terminal and the data management network element. When the first location privacy setting data is not tampered with, the first location privacy setting data is stored, so that another network element may obtain the location privacy setting data of the user terminal from the data management network element.