Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a method and a system for extracting electrocardiogram feature points based on a heart rate sliding threshold method.
The method for extracting the electrocardiogram feature points based on the heart rate sliding threshold method comprises the following steps of:
r point feature point position acquisition: determining the positions of all characteristic points of an electrocardiogram R point;
and (3) acquiring the positions of the feature points of other points: and obtaining the positions of the characteristic points of the P point, the Q point, the S point and the T point of the electrocardiogram by a sliding threshold method according to the positions of the characteristic points of the R point of the electrocardiogram.
Preferably, in the step of acquiring the positions of the R-point feature points, the positions of the feature points of the R-point electrocardiogram are determined by differential calculation and missing inspection.
Preferably, the remaining point feature point position acquiring step includes the steps of:
heart rate acquisition step: and determining the heart rate of each heart beat of the electrocardiogram and the average heart rate of the electrocardiogram according to the positions of the characteristic points of the R point of the electrocardiogram.
And a dynamic adjustment step: determining a range interval of an electrocardiogram Q point according to the position of each characteristic point of the obtained electrocardiogram R point, and dynamically adjusting the range interval of the electrocardiogram Q point according to the heart rate of each heart beat of the electrocardiogram and the average heart rate of the electrocardiogram to obtain data of each point in the range interval of the electrocardiogram Q point;
a characteristic point position obtaining step: and combining the data of each point in the range interval after the electrocardiogram Q point is dynamically adjusted with a post-processing technology to obtain the position of each characteristic point of the electrocardiogram Q point.
Preferably, the remaining point feature point extracting step further includes a replacing step of: and replacing the point Q in the dynamic adjustment step and the characteristic point position acquisition step with a point P, a point S or a point T.
Preferably, the method further comprises the step of determining the position of the feature point: and determining the positions of the characteristic points of the P1 point, the P2 point, the Q1 point, the S2 point, the T1 point and the T2 point of the electrocardiogram according to the positions of the characteristic points of the P point, the Q point, the R point, the S point and the T point of the obtained electrocardiogram.
The invention provides a heart rate sliding threshold method-based electrocardiogram feature point extraction system, which comprises the following modules:
r point feature point position acquisition module: determining the positions of all characteristic points of an electrocardiogram R point;
and a rest point feature point position acquisition module: and obtaining the positions of the characteristic points of the P point, the Q point, the S point and the T point of the electrocardiogram by a sliding threshold method according to the positions of the characteristic points of the R point of the electrocardiogram.
Preferably, in the R-point feature point position obtaining module, the feature point positions of the R-point of the electrocardiogram are determined by differential calculation and missing detection.
Preferably, the remaining point feature point position obtaining module includes the following modules:
a heart rate acquisition module: determining the heart rate of each heart beat of the electrocardiogram and the average heart rate of the electrocardiogram according to the position of the characteristic point of the R point of the electrocardiogram;
a dynamic adjustment module: determining a range interval of an electrocardiogram Q point according to the position of each characteristic point of the obtained electrocardiogram R point, and dynamically adjusting the range interval of the electrocardiogram Q point according to the heart rate of each heart beat of the electrocardiogram and the average heart rate of the electrocardiogram to obtain data of each point in the range interval of the electrocardiogram Q point;
a characteristic point position acquisition module: and combining the data of each point in the range interval after the electrocardiogram Q point is dynamically adjusted with a post-processing technology to obtain the position of each characteristic point of the electrocardiogram Q point.
Preferably, the remaining point feature point extraction module further includes a replacement module: and replacing the Q point in the dynamic adjustment module and the characteristic point position acquisition module with a P point, an S point or a T point.
Preferably, the system further comprises a feature point position determination module: and determining the positions of the characteristic points of the P1 point, the P2 point, the Q1 point, the S2 point, the T1 point and the T2 point of the electrocardiogram according to the positions of the characteristic points of the P point, the Q point, the R point, the S point and the T point of the obtained electrocardiogram.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention determines the electrocardiogram characteristic points of the portable equipment by adopting a sliding threshold method, solves the problem of inaccurate extraction of the characteristic points caused by overlarge range selection of the characteristic points, and achieves the effect of improving the extraction accuracy of the characteristic points under the condition of not increasing overlarge calculation complexity (such as introducing a deep learning model);
2. according to the invention, a quantification means for adjusting the threshold value of the sliding threshold value method is provided by introducing the range interval of the heart rate adjustment characteristic points, so that a technical approach is provided for realizing the sliding threshold value method;
3. the invention provides a theoretical basis for portable equipment to accurately diagnose the electrocardiogram through a method for extracting P points, Q points, R points, S points and T points of the electrocardiogram based on the set medical rules, and is favorable for the development of a computer-aided electrocardiogram technology.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
The embodiment of the invention discloses an electrocardiogram feature point extraction method based on a heart rate sliding threshold method, which is applied to portable equipment, and comprises the following steps as shown in figure 1:
r point feature point position acquisition: and determining the positions of the characteristic points of the R point of the electrocardiogram. And determining the positions of all characteristic points of the R point of the electrocardiogram by adopting the technologies of differential calculation, missing detection and the like. The R point is the highest point or most significant point in a typical electrocardiogram. In an electrocardiogram, there are often a plurality of R points, and only one R point is included in one heart beat. And since the R point is the highest and most obvious point, the feature point extraction strategy starts from the R point, and other points are extracted based on a specific region around the R point. There is a precedence between them.
And (3) acquiring the positions of the feature points of other points: and obtaining the positions of the characteristic points of the P point, the Q point, the S point and the T point of the electrocardiogram by a sliding threshold method according to the positions of the characteristic points of the R point of the electrocardiogram.
According to the positions of the characteristic points of the R point of the electrocardiogram obtained in the step of obtaining the positions of the characteristic points of the R point of the electrocardiogram, the positions of the characteristic points of the P point, the Q point, the S point and the T point of the electrocardiogram are obtained by a sliding threshold method. As shown in fig. 1 and 2, point P is the highest point of a certain fixed area before point R, point Q is the lowest point of a certain fixed area before point R, point S is the lowest point of a certain fixed area after point R, and point T is the highest point of a certain fixed area after point R. The voltage is the translation in voltage and the time is the translation in time.
The step of obtaining the positions of the feature points of other points comprises the following steps: heart rate acquisition step: and determining the heart rate of each heart beat of the electrocardiogram and the average heart rate of the electrocardiogram according to the positions of the characteristic points of the R point of the electrocardiogram. Specifically, according to the position of the characteristic point of the R point of the electrocardiogram, the distance between the R points of adjacent electrocardio-cardiograms and the distance between the R points of the whole section of electrocardio-cardiograms are calculated; calculating the RR interval of the R points of the adjacent electrocardio-heartbeats according to the distance between the R points of the adjacent electrocardio-heartbeats, and determining the heart rate of each electrocardiogram heart beat according to the RR interval of the R points of the adjacent electrocardio-heartbeats; and calculating the RR interval of the whole electrocardiogram according to the distance between the R points of the whole electrocardiogram, and obtaining the average heart rate of the electrocardiogram according to the RR interval of the whole electrocardiogram.
Calculating the distance between R points of adjacent electrocardiographic heartbeats according to the characteristic point positions of the R point of the electrocardiogram obtained in the step of obtaining the characteristic point positions of the R point; and calculating the RR intervals of the R points of the adjacent electrocardiograms according to the distance, thereby determining the heart rate of each heart beat of the electrocardiogram and the average heart rate of the electrocardiogram. RR intervals belong to the medical term. The unit of the RR interval is time, which represents the time between a certain R point and the next adjacent R point. The long-time RR interval information can reflect the heart rate of the electrocardiogram.
And a dynamic adjustment step: according to the position of each characteristic point of the obtained electrocardiogram R point, determining a range interval of the electrocardiogram Q point, wherein the range of the range is determined according to medical rules and statistical rules of application scenes of portable equipment, the specific length is 0.4 times of the RR interval length of the heart beat, the range interval of the electrocardiogram Q point is dynamically adjusted according to the heart rate of each heart beat of the electrocardiogram and the average heart rate of the electrocardiogram, specifically, the length of the range interval of the electrocardiogram Q point is multiplied by a coefficient, and the specific value of the coefficient is the ratio of the heart rate of the heart beat to the average heart rate of the electrocardiogram, so that data of each point in the range interval of the electrocardiogram Q point are obtained. The fixed-length interval is converted into a variable-length interval multiplied by a coefficient, and then feature point extraction is achieved from a more accurate range. And when the threshold value of the sliding threshold value method is determined, dynamically adjusting the heart rate of each heart beat of the electrocardiogram obtained in the heart rate obtaining step.
Namely, the range section of the electrocardiogram Q point is determined according to the positions of all the characteristic points of the electrocardiogram R point obtained in the R point characteristic point position acquisition step. The method belongs to a primary range interval obtained by combining with general medical rules, is a code algorithm version adaptation applicable to portable equipment for medical rules, and is only applicable to coding of the medical rules of the portable equipment. And dynamically adjusting the range interval according to the heart rate of the heart beat and the average heart rate of the electrocardiogram of the section.
A characteristic point position obtaining step: and combining the data of each point in the range interval after the electrocardiogram Q point is dynamically adjusted with a post-processing technology to obtain the position of each characteristic point of the electrocardiogram Q point. The generalized post-processing technology in the invention comprises the steps of obtaining the maximum/minimum amplitude or minimum slope information of a range interval curve; specifically, for the point Q of the electrocardiogram, the post-processing technique is to obtain the minimum amplitude and minimum slope information of the curve between the ranges. For the point P of the electrocardiogram, the post-processing technology is to obtain the maximum amplitude and the minimum slope information of the range interval curve; for the electrocardiogram S point, the post-processing technology is to obtain the minimum amplitude and the minimum slope information of the range interval curve; for the electrocardiogram S-point, the post-processing technique here is to obtain the minimum amplitude and maximum slope information of the range interval curve.
According to the data such as the slope value, the amplitude value and the like of each point in the range interval of the electrocardiogram Q point determined in the dynamic adjustment step, and by combining the post-processing technology, the position of each characteristic point of the electrocardiogram Q point is finally obtained. Specifically, for the Q point, the post-processing technique includes selecting a point with the smallest slope value and the smallest amplitude, and the post-processing technique further includes algorithm self-detection, and if the Q point obtained according to a certain heartbeat has a large error relative to the Q points of other heartbeats, the Q point is marked.
The step of obtaining the positions of the feature points of other points takes the step of obtaining the electrocardiogram Q point by a sliding threshold method as an example, and the positions of all the points of other feature points are determined in the same way. Since the R point is the highest, most significant point of the electrocardiogram, it is easiest to determine other points from the R point.
A replacement step: and replacing the point Q in the dynamic adjustment step and the characteristic point position acquisition step with a point P, a point S or a point T.
A characteristic point position determining step: and determining the positions of the characteristic points of the P1 point, the P2 point, the Q1 point, the S2 point, the T1 point and the T2 point of the electrocardiogram according to the positions of the characteristic points of the P point, the Q point, the R point, the S point and the T point of the obtained electrocardiogram.
Namely, according to the positions of the characteristic points of the P point, the Q point, the R point, the S point and the T point of the electrocardiogram obtained in the step of acquiring the positions of the characteristic points of the other points, the positions of the characteristic points of the P1 point, the P2 point, the Q1 point, the S2 point, the T1 point and the T2 point of the electrocardiogram are determined. Specifically, as shown in fig. 1 and fig. 2, the point finding principle of the points P1 and P2 is the first point before and after the point P and intersecting the baseline (which can be approximated as a line with an amplitude of 0), the point Q1 is the first point before and after the point Q and intersecting the baseline, the point S2 is the first point after and intersecting the baseline, and the points T1 and T2 are the first points before and after the point T and intersecting the baseline. According to the application requirements of the portable equipment and in combination with medical rules, the code is compiled into the code by self.
The embodiment of the invention also discloses a system for extracting the electrocardiogram characteristic points based on the heart rate sliding threshold method, which comprises the following modules:
r point feature point position acquisition module: and determining the positions of the characteristic points of the R point of the electrocardiogram. And determining the positions of all characteristic points of the electrocardiogram R point by adopting differential calculation and missing detection.
And a rest point feature point position acquisition module: and obtaining the positions of the characteristic points of the P point, the Q point, the S point and the T point of the electrocardiogram by a sliding threshold method according to the positions of the characteristic points of the R point of the electrocardiogram.
The other point feature point position acquisition module comprises the following modules: a heart rate acquisition module: and determining the heart rate of each heart beat of the electrocardiogram and the average heart rate of the electrocardiogram according to the positions of the characteristic points of the R point of the electrocardiogram.
A dynamic adjustment module: and determining the range section of the electrocardiogram Q point according to the position of each characteristic point of the obtained electrocardiogram R point, and dynamically adjusting the range section of the electrocardiogram Q point according to the heart rate of each heart beat of the electrocardiogram and the average heart rate of the electrocardiogram to obtain data of each point in the range section of the electrocardiogram Q point.
A characteristic point position acquisition module: and combining the data of each point in the range interval after the electrocardiogram Q point is dynamically adjusted with a post-processing technology to obtain the position of each characteristic point of the electrocardiogram Q point.
And a replacement module: and replacing the Q point in the dynamic adjustment module and the characteristic point position acquisition module with a P point, an S point or a T point.
A feature point position determination module: and determining the positions of the characteristic points of the P1 point, the P2 point, the Q1 point, the S2 point, the T1 point and the T2 point of the electrocardiogram according to the positions of the characteristic points of the P point, the Q point, the R point, the S point and the T point of the obtained electrocardiogram.
In the process of extracting the characteristic points of the electrocardiogram, the invention adopts a method of sliding threshold based on the heart rate to carry out accurate dynamic local positioning on the characteristic points, thereby improving the accuracy of extracting the characteristic points. The whole flow chart reflects the whole electrocardio diagnosis process, and the dotted line frame part belongs to the diagnosis process according to the points, and the process occurs after the characteristic points are extracted.
Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, units provided by the present invention as pure computer readable program code, the system and its various devices, modules, units provided by the present invention can be fully implemented by logically programming method steps in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system and various devices, modules and units thereof provided by the invention can be regarded as a hardware component, and the devices, modules and units included in the system for realizing various functions can also be regarded as structures in the hardware component; means, modules, units for performing the various functions may also be regarded as structures within both software modules and hardware components for performing the method.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.