A method for loading a kernel module implemented by an electronic device, comprising: generating identifier information in a kernel module, wherein the generating the identifier information in the kernel module comprises: acquiring the kernel module, and determining whether the kernel module satisfies a preset condition, wherein the preset condition includes compatibility between the kernel module and a kernel to which the kernel module is to be loaded; and generating, in response to determining the kernel module satisfying the preset condition, the identifier information in the kernel module by compiling an instruction or by modifying information in the kernel module using a write tool; detecting an instruction for loading a to-be-loaded kernel module into a target kernel; determining, in response to detecting the instruction, whether the identifier information is included in the to-be-loaded kernel module, the identifier information being used to characterise loading the to-be-loaded kernel module into the target kernel, wherein if there is information irrelevant to program content in the to-be-loaded kernel module, the information irrelevant to the program content in the to-be-loaded kernel module is determined as the identifier information; and loading, in response to determining the identifier information being included in the to-be-loaded kernel module, the to-be-loaded kernel module into the target kernel; wherein the loading, in response to determining the identifier information being included in the to-be-loaded kernel module, the to-be-loaded kernel module into the target kernel comprises: Performing, in response to determining the identifier information being included in the to-be-loaded kernel module, a security verification on the identifier information; and loading the to-be-loaded kernel module into the target kernel if the identifier information passes the security verification. generating identifier information in a kernel module, wherein the generating the identifier information in the kernel module comprises: acquiring the kernel module, and determining whether the kernel module satisfies a preset condition, wherein the preset condition includes compatibility between the kernel module and a kernel to which the kernel module is to be loaded; and generating, in response to determining the kernel module satisfying the preset condition, the identifier information in the kernel module by compiling an instruction or by modifying information in the kernel module using a write tool; acquiring the kernel module, and determining whether the kernel module satisfies a preset condition, wherein the preset condition includes compatibility between the kernel module and a kernel to which the kernel module is to be loaded; and generating, in response to determining the kernel module satisfying the preset condition, the identifier information in the kernel module by compiling an instruction or by modifying information in the kernel module using a write tool; detecting an instruction for loading a to-be-loaded kernel module into a target kernel; determining, in response to detecting the instruction, whether the identifier information is included in the to-be-loaded kernel module, the identifier information being used to characterise loading the to-be-loaded kernel module into the target kernel, wherein if there is information irrelevant to program content in the to-be-loaded kernel module, the information irrelevant to the program content in the to-be-loaded kernel module is determined as the identifier information; and loading, in response to determining the identifier information being included in the to-be-loaded kernel module, the to-be-loaded kernel module into the target kernel; wherein the loading, in response to determining the identifier information being included in the to-be-loaded kernel module, the to-be-loaded kernel module into the target kernel comprises: Performing, in response to determining the identifier information being included in the to-be-loaded kernel module, a security verification on the identifier information; and loading the to-be-loaded kernel module into the target kernel if the identifier information passes the security verification. Performing, in response to determining the identifier information being included in the to-be-loaded kernel module, a security verification on the identifier information; and loading the to-be-loaded kernel module into the target kernel if the identifier information passes the security verification.