The invention relates to an electrocardio waveform drawing method and device based on a GPU
shader and a medium, and the method comprises the steps: for each
line segment group in an electrocardio
data set, according to the width d of lines in an electrocardiogram needing to be drawn, extending each piece of data contained in the
line segment group by a distance of d / 2 along two directions of a normal vector of a
line segment formed by two pieces of data in the line segment group to obtain four vertexes of a rectangle of which the length is the length of the line segment and the width is d; for each inflection point, according to the coordinates of the inflection point, calculating the coordinates of n segmentation points after a circle which takes the inflection point as the circle center and takes d / 2 as the
radius is uniformly split into n segments; based on the inflection points and the segmentation points, n triangles are constructed, and three vertexes in each triangle comprise the inflection points and two adjacent segmentation points; and coloring the rectangles and the triangles through a GPU
shader. According to the invention, the problem of sharp puncture existing in the traditional electrocardio waveform is solved, and the diagnosis accuracy of a doctor is improved.