Dexmedetomidine (Dex) is an alpha-2 agonist used for sedation during various procedures. Dex activates 2-adrenoceptors, and causes the decrease of sympathetic tone, with attenuation of the neuroendocrine and hemodynamic responses to anesthesia and surgery; it reduces anesthetic and opioid requirements; and causes sedation and analgesia. Objective: it was to compare the perioperative effects of different doses of Dex at different timing in patients using Dex during the perioperative period adopting a medical data classification algorithm based on optimized semi-supervised collaborative training (Tri-training). Methods: 495 patients requiring surgical treatment in Xingtai People’s Hospital were randomly selected as the study subjects. The patients were divided into group A (used before induction), group B (used during induction), and group C (used after induction) according to different induction timing, with 165 cases in each group. Then, groups A, B, and C were divided into groups A1, B1, and C1 (0.4 μg/(kg·h) rate), groups A2, B2, and C2 (0.6 μg/(kg·h) rate), and groups A3, B3, and C3 (0.8 μg/(kg·h) rate) according to the dose used, with 55 cases in each group. Intraoperative anesthesia and postoperative adverse reactions were compared among the 9 groups. Results: the similarity between the Tri-training algorithm optimized by Naive Bayes (NB) classification algorithm and the actual classification (93.49%) was clearly higher than that by decision tree (DT) and K-nearest neighbor (kNN) classification algorithm (76.21%, 74.31%); heart rate (HR), systolic blood pressure (SBP), and diastolic blood pressure (DBP) values decreased obviously after Dex used in groups B1, C1, B2, C2, B3, and C3 (P <0.05), but did not change significantly in groups A1, A2, and A3 (P >0.05); the proportion of patients with satisfactory Ramsay score in group A3 was distinctly superior than that in groups A1, A2, B1, B2, B3, C1, C2, and C3 (P <0.05); the incidence of adverse reactions in group A3 was significantly inferior than that in groups A1, A2, B1, B2, B3, C1, C2, and C3 (P <0.05). Conclusion: the optimization effect of NB classification algorithm was the best, and the injection of Dex at the injection rate of 0.8 μg/(kg·h) before induction of anesthesia could apparently improve the fluctuation of HR, SBP, and DBP during perioperative period, and effectively reduce the occurrence of adverse reactions in patients, with better sedative effect on patients.