This invention discloses an online ECG control method and device for a pacemaker, relating to the field of
medical device technology. The method includes: synchronously acquiring raw ECG and transient impedance signals; establishing an artifact waveform model based on impedance attenuation characteristics; removing pacing pulse artifacts; reconstructing a clean
ECG signal and marking the capture state; extracting
signal waveform features to construct a time-series matrix; inputting it into a pre-trained time-series prediction model to obtain future
heart rate trajectories and arrhythmia risk probabilities; constructing a cost function including physiological comfort, safety penalties, and energy efficiency indicators; solving for the optimal pacing parameter vector using the
gradient projection method; and driving the pacing circuit to output pulses. This invention effectively solves the artifact
interference problem, achieving precise adaptive pacing control based on risk prediction and multi-objective optimization, significantly improving treatment safety and
patient comfort.