A data transmission method, applied to a root node or a child parent node in a peripheral component interconnect express, PCIe, topology tree corresponding to a PCIe bus, wherein the method comprises: receiving a transmission packet sent by a sending device, wherein the sending device comprises any one of the root node, the child parent node, or an endpoint device, the endpoint device is connected to the root node or the child parent node, and the root node is connected to a system memory manager; and when determining, based on pre-obtained security configuration information, that the transmission packet is valid, transmitting the transmission packet to a next device, wherein the transmission packet is a transaction layer packet, TLP, packet; wherein before the determining, based on pre-obtained security configuration information, that the transmission packet is valid, the method further comprises: obtaining a configuration access request, and when determining that the configuration access request is from an operating system in a trusted execution environment, TEE, obtaining the security configuration information carried in the configuration access request, wherein the configuration access request is a TLP packet; or obtaining a configuration packet in configuration space of the root node or the child parent node, wherein the configuration packet comprises security check information, and when determining that the security check information is valid, obtaining the security configuration information carried in the configuration packet, wherein the configuration packet is a TLP packet; or obtaining a memory packet generated by a processor CPU, wherein the memory packet comprises a memory packet that carries security check information, and when determining that the security check information is valid, obtaining the security configuration information carried in the memory packet, wherein the memory packet is a TLP packet. receiving a transmission packet sent by a sending device, wherein the sending device comprises any one of the root node, the child parent node, or an endpoint device, the endpoint device is connected to the root node or the child parent node, and the root node is connected to a system memory manager; and when determining, based on pre-obtained security configuration information, that the transmission packet is valid, transmitting the transmission packet to a next device, wherein the transmission packet is a transaction layer packet, TLP, packet; wherein before the determining, based on pre-obtained security configuration information, that the transmission packet is valid, the method further comprises: obtaining a configuration access request, and when determining that the configuration access request is from an operating system in a trusted execution environment, TEE, obtaining the security configuration information carried in the configuration access request, wherein the configuration access request is a TLP packet; or obtaining a configuration packet in configuration space of the root node or the child parent node, wherein the configuration packet comprises security check information, and when determining that the security check information is valid, obtaining the security configuration information carried in the configuration packet, wherein the configuration packet is a TLP packet; or obtaining a memory packet generated by a processor CPU, wherein the memory packet comprises a memory packet that carries security check information, and when determining that the security check information is valid, obtaining the security configuration information carried in the memory packet, wherein the memory packet is a TLP packet. obtaining a configuration access request, and when determining that the configuration access request is from an operating system in a trusted execution environment, TEE, obtaining the security configuration information carried in the configuration access request, wherein the configuration access request is a TLP packet; or obtaining a configuration packet in configuration space of the root node or the child parent node, wherein the configuration packet comprises security check information, and when determining that the security check information is valid, obtaining the security configuration information carried in the configuration packet, wherein the configuration packet is a TLP packet; or obtaining a memory packet generated by a processor CPU, wherein the memory packet comprises a memory packet that carries security check information, and when determining that the security check information is valid, obtaining the security configuration information carried in the memory packet, wherein the memory packet is a TLP packet.