A time synchronization method, characterized by comprising: sending, by a terminal, a target protocol data unit PDU session establishment request to a session management function SMF according to a routing policy, wherein the target PDU session establishment request comprises a target virtual dedicated link identifier, the target virtual dedicated link identifier is configured to indicate for the SMF to request a policy control function PCF to acquire corresponding target virtual dedicated link information, and determine a target user plane function UPF and generate a target forwarding rule by the SMF according to the target virtual dedicated link information, the target virtual dedicated link information comprises first interface information, second interface information and target PDU session information, wherein a first interface indicated by the first interface information is connected to a first clock node to be synchronized, and a second interface indicated by the second interface information is connected to a second clock node to be synchronized, wherein the first interface and the second interface are different UE-side interfaces, or one of the first interface and the second interface is a UE-side interface and the other is a network-side interface, and wherein a target virtual dedicated link is a link between the first interface and the second interface; and establishing, by the terminal, a target PDU session with the target user plane function UPF to transmit a time synchronization message by the target PDU session and the first interface and the second interface indicated by the target virtual dedicated link information, wherein the target PDU session is a PDU session established by the target UPF according to the target forwarding rule, and the target forwarding rule is sent to the target UPF by the SMF according to the target virtual dedicated link information, wherein the target forwarding rule is that a UPF forwards a time synchronization message, received from a PDU session by the first interface, from the second interface, and forwards a time synchronization message received by the second interface to the first interface through the PDU session; or the UPF forwards a time synchronization message, received by the first interface from the PDU session, from a PDU session corresponding to the second interface to the second interface, and forwards a time synchronization message received by the second interface to the first interface through a PDU session corresponding to the first interface. sending, by a terminal, a target protocol data unit PDU session establishment request to a session management function SMF according to a routing policy, wherein the target PDU session establishment request comprises a target virtual dedicated link identifier, the target virtual dedicated link identifier is configured to indicate for the SMF to request a policy control function PCF to acquire corresponding target virtual dedicated link information, and determine a target user plane function UPF and generate a target forwarding rule by the SMF according to the target virtual dedicated link information, the target virtual dedicated link information comprises first interface information, second interface information and target PDU session information, wherein a first interface indicated by the first interface information is connected to a first clock node to be synchronized, and a second interface indicated by the second interface information is connected to a second clock node to be synchronized, wherein the first interface and the second interface are different UE-side interfaces, or one of the first interface and the second interface is a UE-side interface and the other is a network-side interface, and wherein a target virtual dedicated link is a link between the first interface and the second interface; and establishing, by the terminal, a target PDU session with the target user plane function UPF to transmit a time synchronization message by the target PDU session and the first interface and the second interface indicated by the target virtual dedicated link information, wherein the target PDU session is a PDU session established by the target UPF according to the target forwarding rule, and the target forwarding rule is sent to the target UPF by the SMF according to the target virtual dedicated link information, wherein the target forwarding rule is that a UPF forwards a time synchronization message, received from a PDU session by the first interface, from the second interface, and forwards a time synchronization message received by the second interface to the first interface through the PDU session; or the UPF forwards a time synchronization message, received by the first interface from the PDU session, from a PDU session corresponding to the second interface to the second interface, and forwards a time synchronization message received by the second interface to the first interface through a PDU session corresponding to the first interface.