A security protection method, comprising: generating software versions based on diversity compilation, and constructing a software version pool using the software versions as heterogeneous functional equivalents; and dynamically deploying a software version on a network element according to the software version pool, wherein dynamically deploying the software version on the network element according to the software version pool comprises: when the network element is initially generated, selecting one software version from the software version pool randomly or based on a security policy, and deploying the selected software version onto a physical resource of the network element, wherein dynamically deploying the software version on the network element according to the software version pool further comprises: during system operation, migrating services from a first network element to a second network element according to a security policy, deploying a first software version in the software version pool on the first network element, and deploying a second software version in the software version pool on the second network element, wherein the first software version and the second software version correspond to a same software function but different compiled versions; and/or during system operation, changing the software version on the network element periodically or according to the security policy, wherein the software version after the change is selected from the software version pool randomly or selected from the software version pool based on the security policy, and the software version before the change and the software version after the change correspond to the same software function but different compiled versions, wherein the same software function correspond to one or more diversity compilation version, and the same diversity compilation version only correspond to one software function. generating software versions based on diversity compilation, and constructing a software version pool using the software versions as heterogeneous functional equivalents; and dynamically deploying a software version on a network element according to the software version pool, wherein dynamically deploying the software version on the network element according to the software version pool comprises: when the network element is initially generated, selecting one software version from the software version pool randomly or based on a security policy, and deploying the selected software version onto a physical resource of the network element, wherein dynamically deploying the software version on the network element according to the software version pool further comprises: during system operation, migrating services from a first network element to a second network element according to a security policy, deploying a first software version in the software version pool on the first network element, and deploying a second software version in the software version pool on the second network element, wherein the first software version and the second software version correspond to a same software function but different compiled versions; and/or during system operation, changing the software version on the network element periodically or according to the security policy, wherein the software version after the change is selected from the software version pool randomly or selected from the software version pool based on the security policy, and the software version before the change and the software version after the change correspond to the same software function but different compiled versions, wherein the same software function correspond to one or more diversity compilation version, and the same diversity compilation version only correspond to one software function. during system operation, migrating services from a first network element to a second network element according to a security policy, deploying a first software version in the software version pool on the first network element, and deploying a second software version in the software version pool on the second network element, wherein the first software version and the second software version correspond to a same software function but different compiled versions; and/or during system operation, changing the software version on the network element periodically or according to the security policy, wherein the software version after the change is selected from the software version pool randomly or selected from the software version pool based on the security policy, and the software version before the change and the software version after the change correspond to the same software function but different compiled versions, wherein the same software function correspond to one or more diversity compilation version, and the same diversity compilation version only correspond to one software function.