An immunization method for user behavior detection in the electronic transaction process comprises a data preprocessing step in which the operation process of a user is processed into a sequence format and related repeated data is cleaned, a training step in which the age value of each sequence is calculated in chronological order and according to the age evolution process, aged logs are deleted according to the age values, and a normal sequence library (namely, antibody) is extracted, a detection step in which whether a newly generated transaction sequence is mutated is detected, and an updating step in which the autologous and allogeneic age values are updated in a timely manner and a related library set is updated. The immunization method is designed for abnormal situations in the electronic transaction process, which may be misoperation by users, illegal operation caused by false account use, or other situations not in accordance with behavior habits of users. The immunization method for user behavior detection in the electronic transaction process is provided for e-commerce and third-party payment platforms, and has the characteristics of being controllable and preventable, adaptive, self-learning, and the like.