A method includes obtaining a filtered waveform signal, marking the waveform signal as K signal line segments based on monotonicity, extracting line segment data of each signal line segment, and determining a line segment matching template of the waveform signal based on the line segment data of each signal line segment, where the line segment matching template includes M consecutive signal line segments, and M is an integer less than K. The method further includes matching each of the K signal line segments with the M signal line segments included in the line segment matching template, and determining a target wave group of the waveform signal based on a matching result of each signal line segment. The method further includes determining periodic signal data of the waveform signal based on line segment data of the target wave group.