Electrocardiosignal detection method and device, computer equipment and storage medium
By segmenting and calculating deviations of the ECG signal, and inverting the signal to determine its direction, the problem of low ECG signal measurement accuracy in the existing technology is solved, and more accurate ECG data analysis is achieved.
Patent Information
- Application Number
- CN202310300854.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2024-09-24
AI Technical Summary
Existing technology cannot effectively identify and correct whether the ECG signal is reversed, resulting in low measurement accuracy.
By segmenting the ECG signal according to the heartbeat frequency, calculating the deviation of each segmented signal, inverting the signal and comparing the total deviation to determine the forward and reverse direction of the signal, and then determine the direction of the ECG signal.
It improves the measurement accuracy of ECG signals and ensures the accuracy and reliability of ECG data.
Smart Images

Figure CN118680578A
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal processing technology, and in particular to an electrocardiogram signal detection method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] Electrocardiography (ECG or EKG) is a diagnostic technology that records the electrophysiological activity of the heart in time units through the body wall, and captures and records it through electrodes in contact with the skin. Currently, there are many single-lead ECG patch products for home users, and the waveform of the single-lead ECG signal is closely related to the position of contact between the collection electrode and the skin. For general users, if the position of the electrode is incorrect during ECG measurement, a reverse ECG signal may be collected. Existing technology cannot well identify whether the ECG signal is reversed. If it is not corrected, it may affect the final measurement results of such products.
[0003] Currently, it is not possible to clearly identify whether the ECG signal is reversed, resulting in low measurement accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide an ECG signal detection method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the ECG signal measurement accuracy in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for detecting an electrocardiogram signal. The method comprises:
[0006] Segmenting the electrocardiogram signal to be detected according to the heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points;
[0007] Acquire a first average signal corresponding to a plurality of first segmented signals, calculate a deviation of each first segmented signal relative to the first average signal, and obtain a first total deviation of the electrocardiogram signal to be detected according to the sum of the deviations of each first segmented signal relative to the first average signal;
[0008] Inverting the electrocardiogram signal to be detected to obtain an inverted electrocardiogram signal;
[0009] obtaining a second total deviation of the inverted ECG signal;
[0010] According to the magnitudes of the first total deviation and the second total deviation, the positive and negative detection results of the electrocardiographic signal to be detected are determined.
[0011] In one embodiment, the electrocardiogram signal to be detected is segmented according to the heartbeat frequency to obtain a plurality of first segmented signals, including:
[0012] Perform R wave recognition on the electrocardiogram signal to be detected to obtain multiple first wave peaks, determine the first wave peak interval between every two consecutive first wave peaks, and calculate the average interval between the first wave peaks of the electrocardiogram signal to be detected;
[0013] According to the average interval of the first wave peaks, a plurality of first segmented signals of the electrocardiographic signal to be detected are determined; each of the first segmented signals includes a first wave peak.
[0014] In one embodiment, determining a plurality of first segmented signals of the electrocardiogram signal to be detected according to the first wave peak average interval includes:
[0015] Determine the length of the front signal according to the average interval of the first wave peak and the preset ratio parameter; the length of the front signal is used to characterize the number of sampling points before each first wave peak;
[0016] Determine the segment signal sampling point interval of each first segment signal according to the length of the previous segment signal;
[0017] A plurality of first segmented signals of the electrocardiographic signal to be detected are determined according to the segmented signal sampling point interval of each first segmented signal.
[0018] In one embodiment, the method for determining the preset ratio parameter includes:
[0019] The preset ratio parameters are determined according to the waveform characteristics of the electrocardiogram signal to be detected.
[0020] In one embodiment, obtaining a first average signal corresponding to a plurality of first segmented signals includes:
[0021] Determine a first sampling point correspondence relationship between each first segmented signal;
[0022] According to the corresponding relationship of the first sampling points, determine the signal value of each first segmented signal corresponding to each sampling point, and calculate the average signal value of multiple first segmented signals corresponding to each sampling point;
[0023] A first average signal is determined according to the average signal value of each sampling point.
[0024] In one embodiment, calculating the deviation of each first segment signal relative to the first average signal includes:
[0025] Determine a second sampling point correspondence relationship between a first segmented signal and a first average signal;
[0026] Calculating a standard deviation between a first segmented signal and a first average signal according to the second sampling point correspondence relationship;
[0027] The standard deviation between each first segment signal and the first average signal is calculated as the deviation of each first segment signal relative to the first average signal.
[0028] In one embodiment, obtaining a second total deviation of the inverted ECG signal includes:
[0029] Segmenting the inverted ECG signal according to the heartbeat frequency to obtain a plurality of second segmented signals; each second segmented signal corresponds to a cardiac cycle, and each second segmented signal has the same number of sampling points;
[0030] A second average signal corresponding to the plurality of second segmented signals is obtained, a deviation of each second segmented signal relative to the second average signal is calculated, and a second total deviation is obtained by summing the deviations of each second segmented signal relative to the second average signal.
[0031] In one embodiment, determining the forward and reverse detection results of the electrocardiogram signal to be detected according to the magnitude of the first total deviation and the second total deviation includes:
[0032] If the first total deviation is less than the second total deviation, it is determined that the electrocardiogram signal to be detected is a positive electrocardiogram signal;
[0033] If the first total deviation is greater than the second total deviation, it is determined that the electrocardiogram signal to be detected is a reverse electrocardiogram signal.
[0034] In a second aspect, the present application also provides an electrocardiogram signal detection device. The device comprises:
[0035] A first calculation module is used to segment the electrocardiogram signal to be detected according to the heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points;
[0036] The first calculation module is further used to obtain a first average signal corresponding to the plurality of first segmented signals, calculate the deviation of each first segmented signal relative to the first average signal, and obtain a first total deviation of the electrocardiogram signal to be detected according to the sum of the deviations of each first segmented signal relative to the first average signal;
[0037] A signal inversion module, used for inverting the ECG signal to be detected to obtain an inverted ECG signal;
[0038] A second calculation module, used for obtaining a second total deviation of the inverted ECG signal;
[0039] The signal detection module is used to determine the positive and negative detection results of the electrocardiogram signal to be detected according to the magnitude of the first total deviation and the second total deviation.
[0040] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0041] Segmenting the electrocardiogram signal to be detected according to the heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points;
[0042] Acquire a first average signal corresponding to a plurality of first segmented signals, calculate a deviation of each first segmented signal relative to the first average signal, and obtain a first total deviation of the electrocardiogram signal to be detected according to the sum of the deviations of each first segmented signal relative to the first average signal;
[0043] Inverting the electrocardiogram signal to be detected to obtain an inverted electrocardiogram signal;
[0044] obtaining a second total deviation of the inverted ECG signal;
[0045] According to the magnitudes of the first total deviation and the second total deviation, the positive and negative detection results of the electrocardiographic signal to be detected are determined.
[0046] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0047] Segmenting the electrocardiogram signal to be detected according to the heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points;
[0048] Acquire a first average signal corresponding to a plurality of first segmented signals, calculate a deviation of each first segmented signal relative to the first average signal, and obtain a first total deviation of the electrocardiogram signal to be detected according to the sum of the deviations of each first segmented signal relative to the first average signal;
[0049] Inverting the electrocardiogram signal to be detected to obtain an inverted electrocardiogram signal;
[0050] obtaining a second total deviation of the inverted ECG signal;
[0051] According to the magnitudes of the first total deviation and the second total deviation, the positive and negative detection results of the electrocardiographic signal to be detected are determined.
[0052] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0053] Segmenting the electrocardiogram signal to be detected according to the heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points;
[0054] Acquire a first average signal corresponding to a plurality of first segmented signals, calculate a deviation of each first segmented signal relative to the first average signal, and obtain a first total deviation of the electrocardiogram signal to be detected according to the sum of the deviations of each first segmented signal relative to the first average signal;
[0055] Inverting the electrocardiogram signal to be detected to obtain an inverted electrocardiogram signal;
[0056] obtaining a second total deviation of the inverted ECG signal;
[0057] According to the magnitudes of the first total deviation and the second total deviation, the positive and negative detection results of the electrocardiographic signal to be detected are determined.
[0058] The above-mentioned ECG signal detection method, device, computer equipment, storage medium and computer program product segment the ECG signal to be detected according to the heartbeat frequency to obtain multiple first segmented signals; obtain the first average signal corresponding to the multiple first segmented signals, calculate the deviation of each first segmented signal relative to the first average signal, and obtain the first total deviation of the ECG signal to be detected according to the sum of the deviations of each first segmented signal relative to the first average signal; invert the ECG signal to be detected to obtain an inverted ECG signal; obtain the second total deviation of the inverted ECG signal; determine the positive and negative detection results of the ECG signal to be detected according to the magnitude of the first total deviation and the second total deviation. By respectively calculating the numerical characteristics of an original ECG signal after forward and inversion, i.e., the first total deviation and the second total deviation, it is possible to accurately determine whether the original ECG signal is a reverse signal, which helps to correct the ECG data later and helps to improve the analysis accuracy of the ECG signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A schematic diagram of a flow chart of an electrocardiogram signal detection method in one embodiment;
[0060] Figure 2 A schematic diagram of an ECG waveform in one embodiment;
[0061] Figure 3 A schematic diagram of an R wave mark in an electrocardiogram signal to be detected in an embodiment;
[0062] Figure 4 A schematic diagram of a first segmented signal and a first average signal in one embodiment;
[0063] Figure 5 A schematic diagram of an R wave marker in an inverted ECG signal in an embodiment;
[0064] Figure 6 A schematic diagram of a second segmented signal and a second average signal in one embodiment;
[0065] Figure 7 is a structural block diagram of an electrocardiogram signal detection device in an embodiment;
[0066] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0068] In one embodiment, Figure 1 As shown, a method for detecting an electrocardiogram signal is provided. This embodiment uses the method applied to a computer device as an example for illustration. It can be understood that the computer device can specifically be a terminal or a server. Among them, the terminal can be but is not limited to various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart medical devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps:
[0069] Step 102, segmenting the electrocardiogram signal to be detected according to the heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points.
[0070] Among them, the cardiac cycle refers to the process that the cardiovascular system goes through from the start of one heartbeat to the start of the next heartbeat. When the heart relaxes, the internal pressure decreases, and the blood in the vena cava flows back into the heart. When the heart contracts, the internal pressure increases, pumping blood to the arteries. Each contraction and relaxation of the heart constitutes a cardiac cycle. In a cardiac cycle, the two atria contract first, with the right atrium contracting slightly earlier than the left atrium. After the atria begin to relax, the two ventricles contract, and the left ventricle contracts slightly earlier than the right ventricle. In the late stage of ventricular diastole, the atria begin to contract again. If the average heart rate of an adult is 75 beats per minute, each cardiac cycle is an average of 0.8 seconds, of which the average atrial contraction period is 0.11 seconds, and the average diastole period is 0.69 seconds. The average ventricular contraction period is 0.27 seconds, and the average diastole period is 0.53 seconds. If Figure 2As shown, in a normal cardiac cycle, a typical ECG waveform is composed of a P wave, a QRS complex, a T wave, and a U wave that may be seen in about 50% to 75% of ECGs.
[0071] Optionally, the computer device divides the electrocardiogram signal to be detected into multiple first segmented signals based on a cardiac cycle as a segmentation standard, where one first segmented signal corresponds to one cardiac cycle, and ensures that each first segmented signal contains the same number of sampling points.
[0072] Step 104, obtaining a first average signal corresponding to a plurality of first segmented signals, calculating a deviation of each first segmented signal relative to the first average signal, and obtaining a first total deviation of the electrocardiogram signal to be detected by summing up the deviations of each first segmented signal relative to the first average signal.
[0073] Optionally, the computer device calculates an average signal for all first segmented signals as the first average signal. Since each first segmented signal contains the same number of sampling points, it is easy to calculate the average signal. Further, the computer device uses the first average signal as a standard to calculate the deviation between each first segmented signal and the first average signal, and then adds all the deviations to calculate the first total deviation of the electrocardiogram signal to be detected.
[0074] Step 106, inverting the ECG signal to be detected to obtain an inverted ECG signal.
[0075] Optionally, the computer device multiplies each signal value in the electrocardiogram signal to be detected by -1 to obtain an inverted electrocardiogram signal, or uses the X-axis in the original coordinate system of the electrocardiogram signal to be detected as a rotation axis to flip the electrocardiogram signal to be detected to obtain an inverted electrocardiogram signal.
[0076] Step 108: Obtain a second total deviation of the inverted ECG signal.
[0077] Optionally, the computer device segments the inverted ECG signal according to the heartbeat frequency to obtain a plurality of second segmented signals; each second segmented signal corresponds to a cardiac cycle, and each second segmented signal has the same number of sampling points. Further, the computer device obtains a second average signal corresponding to the plurality of second segmented signals, calculates the deviation of each second segmented signal relative to the second average signal, and obtains a second total deviation by summing the deviations of each second segmented signal relative to the second average signal.
[0078] Step 110: Determine the forward and reverse detection results of the electrocardiogram signal to be detected according to the magnitudes of the first total deviation and the second total deviation.
[0079] Optionally, the computer device compares the size of the first total deviation and the second total deviation. If the first total deviation is smaller than the second total deviation, the ECG signal to be detected is a positive ECG signal, and the ECG signal to be detected can be directly subjected to subsequent analysis and processing. If the first total deviation is larger than the second total deviation, the ECG signal to be detected is a reverse ECG signal, and the ECG signal to be detected needs to be inverted before subsequent analysis and processing.
[0080] In the above-mentioned ECG signal detection method, the ECG signal to be detected is segmented according to the heartbeat frequency to obtain a plurality of first segmented signals; the first average signal corresponding to the plurality of first segmented signals is obtained, the deviation of each first segmented signal relative to the first average signal is calculated, and the first total deviation of the ECG signal to be detected is obtained according to the sum of the deviations of each first segmented signal relative to the first average signal; the ECG signal to be detected is inverted to obtain an inverted ECG signal; the second total deviation of the inverted ECG signal is obtained; and the positive and negative detection results of the ECG signal to be detected are determined according to the magnitude of the first total deviation and the second total deviation. By respectively calculating the numerical characteristics of an original ECG signal after forward and inversion, that is, the first total deviation and the second total deviation in this embodiment, it is possible to accurately determine whether the original ECG signal is a reverse signal, which helps in the subsequent correction of the ECG data and helps to improve the analysis accuracy of the ECG signal.
[0081] In one embodiment, R wave recognition is performed on the ECG signal to be detected to obtain multiple first wave peaks, the first wave peak interval between every two consecutive first wave peaks is determined, and the average interval of the first wave peaks of the ECG signal to be detected is calculated. According to the waveform characteristics of the ECG signal to be detected, the preset ratio parameter is determined. According to the average interval of the first wave peaks and the preset ratio parameter, the length of the front segment signal is determined; the length of the front segment signal is used to characterize the number of sampling points before each first wave peak; according to the length of the front segment signal, the segmented signal sampling point interval of each first segmented signal is determined; according to the segmented signal sampling point interval of each first segmented signal, multiple first segmented signals of the ECG signal to be detected are determined. Each first segmented signal includes a first wave peak. Each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points.
[0082] Further, determine the first sampling point correspondence between each first segmented signal; determine the signal value of each sampling point corresponding to each first segmented signal based on the first sampling point correspondence, and calculate the average signal value of multiple first segmented signals corresponding to each sampling point; determine the first average signal based on the average signal value of each sampling point. Determine the second sampling point correspondence between a first segmented signal and the first average signal; calculate the standard deviation between a first segmented signal and the first average signal based on the second sampling point correspondence; calculate the standard deviation between each first segmented signal and the first average signal as the deviation of each first segmented signal relative to the first average signal. According to the sum of the deviations of each first segmented signal relative to the first average signal, obtain the first total deviation of the electrocardiogram signal to be detected.
[0083] Specifically, the R wave of the detected ECG signal is identified. The R wave identification methods include but are not limited to the methods of Pan-Tompkins 1985, Hamilton 2002, Zong 2003, Martinez 2004, Christov 2004, etc. The Pan-Tompkins 1985 algorithm is preferred. The R wave detection effect and real-time performance of this algorithm are good. The ECG signal is identified by this algorithm, and the R wave peak value and the acquisition time corresponding to the peak value are marked with R wave, and the peak value and acquisition time point of the R wave are recorded. The result is as follows: Figure 3 As shown. Taking the identified R wave as the reference point, the ECG signal to be detected is segmented. Generally speaking, the ECG signal is a good periodic signal. In order to ensure that the segmented signal segments contain a complete cycle as much as possible, the average RR interval RR_MEAN is calculated for all identified R waves, and the length of each segmented signal is RR_MEAN. Taking the R wave as the reference point, the preset ratio of the signal length of each first segmented signal before the R wave to RR_MEAN is defined as SEG_FACTOR. The preset ratio parameter SEG_FACTOR can be adjusted according to the data characteristics. Generally, the accuracy of the algorithm needs to be verified based on a certain data set. The different acquisition equipment and acquisition methods used in the data set may require the adjustment of subsequent processing parameters. Therefore, this parameter is an empirical parameter, and SEG_FACTOR=0.5 can be selected, that is, the R wave is located in the middle of the segmented signal. The average value of each sampling point of the segmented ECG signal is calculated, and the waveform formed by the average value sequence is the first average signal. The segmented ECG signal and the first average signal are shown in Figure 4 As shown, the black bold line in the figure is the average signal, and the other lines are each first segmented signal. The standard deviation of each sampling point in each first segmented signal and each sampling point in the first average signal is calculated, and the sum of all standard deviations is calculated to obtain the first total deviation STDEV_SUM of the ECG signal to be detected.
[0084] In this embodiment, the electrocardiogram signal to be detected is segmented according to the heartbeat frequency to obtain multiple first segmented signals; the first average signal corresponding to the multiple first segmented signals is obtained, and the deviation of each first segmented signal relative to the first average signal is calculated. According to the sum of the deviations of each first segmented signal relative to the first average signal, the first total deviation of the electrocardiogram signal to be detected can be accurately calculated.
[0085] In one embodiment, the inverted ECG signal is segmented according to the heartbeat frequency to obtain a plurality of second segmented signals; each second segmented signal corresponds to a cardiac cycle, and each second segmented signal has the same number of sampling points. A second average signal corresponding to the plurality of second segmented signals is obtained, the deviation of each second segmented signal relative to the second average signal is calculated, and the second total deviation is obtained by summing the deviations of each second segmented signal relative to the second average signal.
[0086] Optionally, the same method as that for calculating the first total deviation is used. Perform R wave identification on the inverted ECG signal to obtain multiple second wave peaks, determine the second wave peak interval between every two consecutive second wave peaks, and calculate the average interval of the second wave peaks of the inverted ECG signal. Determine the preset ratio parameter based on the waveform characteristics of the inverted ECG signal. Determine the length of the front segment signal based on the average interval of the second wave peaks and the preset ratio parameter; the length of the front segment signal is used to characterize the number of sampling points before each second wave peak; determine the segmented signal sampling point interval of each second segmented signal based on the length of the front segment signal; determine multiple second segmented signals of the inverted ECG signal based on the segmented signal sampling point interval of each second segmented signal. Each second segmented signal includes a second wave peak. Each second segmented signal corresponds to a cardiac cycle, and each second segmented signal has the same number of sampling points.
[0087] Further, determine the second sampling point correspondence between each second segmented signal; determine the signal value of each sampling point corresponding to each second segmented signal based on the second sampling point correspondence, calculate the average signal value of multiple second segmented signals corresponding to each sampling point; determine the second average signal based on the average signal value of each sampling point. Determine the second sampling point correspondence between a second segmented signal and a second average signal; calculate the standard deviation between a second segmented signal and the second average signal based on the second sampling point correspondence; calculate the standard deviation between each second segmented signal and the second average signal as the deviation of each second segmented signal relative to the second average signal. According to the sum of the deviations of each second segmented signal relative to the second average signal, obtain the second total deviation of the inverted ECG signal.
[0088] Specifically, the inverted ECG signal is subjected to R wave recognition. The same Pan-Tompkins 1985 algorithm as in the above embodiment is selected to recognize the ECG signal using this algorithm, and the R wave peak value and the acquisition time corresponding to the peak value are marked. The peak value and acquisition time point of the R wave are recorded. The result is as follows: Figure 5 As shown. The inverted ECG signal is segmented with the identified R wave as the reference point. With the R wave as the reference point, the preset ratio of the signal length of each second segmented signal before the R wave to RR_MEAN is defined as SEG_FACTOR. The preset ratio parameter is SEG_FACTOR=0.5, which is the same as the above embodiment, that is, the R wave is located in the middle of the segmented signal. The average value of each sampling point of the segmented ECG signal is calculated, and the waveform formed by the average value sequence is the second average signal. The segmented ECG signal and the second average signal are shown in Figure 6 As shown, the black bold line in the figure is the second average signal, and the other lines are each second segmented signal. The standard deviation of each sampling point in each second segmented signal and each sampling point in the second average signal is calculated, and the sum of all standard deviations is calculated to invert the second total deviation STDEV_SUM_INV of the ECG signal.
[0089] In this embodiment, the inverted ECG signal is segmented according to the heartbeat frequency to obtain a plurality of second segmented signals; a second average signal corresponding to the plurality of second segmented signals is obtained, and the deviation of each second segmented signal relative to the second average signal is calculated; based on the sum of the deviations of each second segmented signal relative to the second average signal, the second total deviation of the inverted ECG signal can be accurately calculated.
[0090] In one embodiment, the positive and negative detection results of the electrocardiogram signal to be detected are determined according to the size of the first total deviation and the second total deviation, including: if the first total deviation is smaller than the second total deviation, then the electrocardiogram signal to be detected is determined to be a positive electrocardiogram signal; if the first total deviation is larger than the second total deviation, then the electrocardiogram signal to be detected is determined to be a reverse electrocardiogram signal.
[0091] Optionally, following the above embodiment, if the total error STDEV_SUM of the original signal is less than the total error STDEV_SUM_INV of the inverted signal, it is determined that the original signal is not inverted; if the total error STDEV_SUM of the original signal is greater than the total error STDEV_SUM_INV of the inverted signal, it is determined that the original signal is inverted.
[0092] In this embodiment, by respectively calculating the numerical characteristics of an original ECG signal after forward and inversion, that is, the first total deviation and the second total deviation in this embodiment, it is possible to accurately determine whether the original ECG signal is a reverse signal. If the original ECG signal is a forward ECG signal, the subsequent analysis and processing can be performed directly on the ECG signal to be detected. If the original ECG signal is a reverse ECG signal, it is necessary to first invert the original ECG signal and then perform subsequent analysis and processing, which helps to improve the analysis accuracy of the ECG signal.
[0093] In one embodiment, a method for detecting an electrocardiogram signal includes:
[0094] Perform R wave recognition on the ECG signal to be detected to obtain multiple first wave peaks, determine the first wave peak interval between every two consecutive first wave peaks, and calculate the average interval of the first wave peaks of the ECG signal to be detected. Determine the preset ratio parameter according to the waveform characteristics of the ECG signal to be detected. Determine the length of the front segment signal according to the average interval of the first wave peaks and the preset ratio parameter; the length of the front segment signal is used to characterize the number of sampling points before each first wave peak; determine the segmented signal sampling point interval of each first segmented signal according to the length of the front segment signal; determine multiple first segmented signals of the ECG signal to be detected according to the segmented signal sampling point interval of each first segmented signal. Each first segmented signal includes a first wave peak. Each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points.
[0095] Determine the first sampling point correspondence between each first segmented signal; determine the signal value of each sampling point corresponding to each first segmented signal based on the first sampling point correspondence, and calculate the average signal value of multiple first segmented signals corresponding to each sampling point; determine the first average signal based on the average signal value of each sampling point. Determine the second sampling point correspondence between a first segmented signal and the first average signal; calculate the standard deviation between a first segmented signal and the first average signal based on the second sampling point correspondence; calculate the standard deviation between each first segmented signal and the first average signal as the deviation of each first segmented signal relative to the first average signal. According to the sum of the deviations of each first segmented signal relative to the first average signal, obtain the first total deviation of the electrocardiogram signal to be detected.
[0096] The electrocardiogram signal to be detected is inverted to obtain an inverted electrocardiogram signal.
[0097] The same method as that for calculating the first total deviation is adopted. Perform R wave identification on the inverted ECG signal to obtain multiple second wave peaks, determine the second wave peak interval between every two consecutive second wave peaks, and calculate the average interval of the second wave peaks of the inverted ECG signal. Determine the preset ratio parameter according to the waveform characteristics of the inverted ECG signal. Determine the length of the front segment signal according to the average interval of the second wave peaks and the preset ratio parameter; the length of the front segment signal is used to characterize the number of sampling points before each second wave peak; determine the segment signal sampling point interval of each second segment signal according to the length of the front segment signal; determine multiple second segment signals of the inverted ECG signal according to the segment signal sampling point interval of each second segment signal. Each second segment signal includes a second wave peak. Each second segment signal corresponds to a cardiac cycle, and each second segment signal has the same number of sampling points.
[0098] Determine the second sampling point correspondence between each second segmented signal; determine the signal value of each sampling point corresponding to each second segmented signal based on the second sampling point correspondence, and calculate the average signal value of multiple second segmented signals corresponding to each sampling point; determine the second average signal based on the average signal value of each sampling point. Determine the second sampling point correspondence between a second segmented signal and a second average signal; calculate the standard deviation between a second segmented signal and the second average signal based on the second sampling point correspondence; calculate the standard deviation between each second segmented signal and the second average signal as the deviation of each second segmented signal relative to the second average signal. According to the sum of the deviations of each second segmented signal relative to the second average signal, obtain the second total deviation of the inverted ECG signal.
[0099] If the first total deviation is smaller than the second total deviation, it is determined that the electrocardiogram signal to be detected is a positive electrocardiogram signal; if the first total deviation is larger than the second total deviation, it is determined that the electrocardiogram signal to be detected is a negative electrocardiogram signal.
[0100] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0101] Based on the same inventive concept, the embodiment of the present application also provides an ECG signal detection device for implementing the ECG signal detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more ECG signal detection device embodiments provided below can refer to the limitations on the ECG signal detection method above, and will not be repeated here.
[0102] In one embodiment, Figure 7 As shown, an electrocardiogram signal detection device 700 is provided, comprising: a first calculation module 701, a signal inversion module 702, a second calculation module 703 and a signal detection module 704, wherein:
[0103] The first calculation module 701 is used to segment the electrocardiogram signal to be detected according to the heartbeat frequency to obtain multiple first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points.
[0104] The first calculation module 701 is also used to obtain a first average signal corresponding to multiple first segmented signals, calculate the deviation of each first segmented signal relative to the first average signal, and obtain a first total deviation of the electrocardiogram signal to be detected based on the sum of the deviations of each first segmented signal relative to the first average signal.
[0105] The signal inversion module 702 is used to invert the ECG signal to be detected to obtain an inverted ECG signal;
[0106] The second calculation module 703 is used to obtain a second total deviation of the inverted ECG signal.
[0107] The signal detection module 704 is used to determine the positive and negative detection results of the electrocardiogram signal to be detected according to the magnitudes of the first total deviation and the second total deviation.
[0108] In one embodiment, the first calculation module 701 is also used to perform R wave recognition on the ECG signal to be detected to obtain multiple first wave peaks, determine the first wave peak interval between every two consecutive first wave peaks, and calculate the average interval of the first wave peaks of the ECG signal to be detected; based on the average interval of the first wave peaks, determine multiple first segmented signals of the ECG signal to be detected; each first segmented signal includes a first wave peak.
[0109] In one embodiment, the first calculation module 701 is also used to determine the length of the front signal based on the average interval of the first peaks and the preset ratio parameters; the length of the front signal is used to characterize the number of sampling points before each first peak; based on the length of the front signal, the segmented signal sampling point interval of each first segmented signal is determined; based on the segmented signal sampling point interval of each first segmented signal, multiple first segmented signals of the electrocardiogram signal to be detected are determined.
[0110] In one embodiment, the first calculation module 701 is further used to determine a preset ratio parameter according to the waveform characteristics of the electrocardiogram signal to be detected.
[0111] In one embodiment, the first calculation module 701 is also used to determine the first sampling point correspondence between each first segmented signal; according to the first sampling point correspondence, determine the signal value of each sampling point corresponding to each first segmented signal, calculate the average signal value of multiple first segmented signals corresponding to each sampling point; determine the first average signal according to the average signal value of each sampling point.
[0112] In one embodiment, the first calculation module 701 is further used to determine a second sampling point correspondence between a first segmented signal and a first average signal; calculate a standard deviation between a first segmented signal and the first average signal based on the second sampling point correspondence; calculate the standard deviation between each first segmented signal and the first average signal as the deviation of each first segmented signal relative to the first average signal.
[0113] In one embodiment, the second calculation module 703 is also used to segment the inverted ECG signal according to the heartbeat frequency to obtain multiple second segmented signals; each second segmented signal corresponds to a cardiac cycle, and each second segmented signal has the same number of sampling points; obtain a second average signal corresponding to the multiple second segmented signals, calculate the deviation of each second segmented signal relative to the second average signal, and obtain the second total deviation based on the sum of the deviations of each second segmented signal relative to the second average signal.
[0114] In one embodiment, the signal detection module 704 is further used to determine that the ECG signal to be detected is a positive ECG signal if the first total deviation is smaller than the second total deviation; and to determine that the ECG signal to be detected is a negative ECG signal if the first total deviation is larger than the second total deviation.
[0115] Each module in the above-mentioned ECG signal detection device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0116] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store electrocardiogram signal data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an electrocardiogram signal detection method is implemented.
[0117] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0118] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: segmenting an electrocardiogram signal to be detected according to a heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points; obtaining a first average signal corresponding to the plurality of first segmented signals, calculating a deviation of each first segmented signal relative to the first average signal, and obtaining a first total deviation of the electrocardiogram signal to be detected based on the sum of the deviations of each first segmented signal relative to the first average signal; inverting the electrocardiogram signal to be detected to obtain an inverted electrocardiogram signal; obtaining a second total deviation of the inverted electrocardiogram signal; and determining positive and negative detection results of the electrocardiogram signal to be detected based on the magnitude of the first total deviation and the second total deviation.
[0119] In one embodiment, when the processor executes the computer program, the following steps are also implemented: performing R wave identification on the ECG signal to be detected to obtain multiple first wave peaks, determining the first wave peak interval between every two consecutive first wave peaks, and calculating the average interval of the first wave peaks of the ECG signal to be detected; according to the average interval of the first wave peaks, determining multiple first segmented signals of the ECG signal to be detected; each first segmented signal includes a first wave peak.
[0120] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the length of the front-segment signal based on the average interval of the first wave peaks and the preset ratio parameter; the length of the front-segment signal is used to characterize the number of sampling points before each first wave peak; determining the segmented signal sampling point interval of each first segmented signal based on the length of the front-segment signal; determining multiple first segmented signals of the electrocardiogram signal to be detected based on the segmented signal sampling point interval of each first segmented signal.
[0121] In one embodiment, when the processor executes the computer program, the following steps are further implemented: determining a preset ratio parameter according to the waveform characteristics of the electrocardiogram signal to be detected.
[0122] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the correspondence between the first sampling points of each first segmented signal; determining the signal value of each first segmented signal corresponding to each sampling point based on the correspondence between the first sampling points, and calculating the average signal value of multiple first segmented signals corresponding to each sampling point; determining the first average signal based on the average signal value of each sampling point.
[0123] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining a second sampling point correspondence between a first segmented signal and a first average signal; calculating a standard deviation between a first segmented signal and the first average signal based on the second sampling point correspondence; calculating the standard deviation between each first segmented signal and the first average signal as the deviation of each first segmented signal relative to the first average signal.
[0124] In one embodiment, the processor further implements the following steps when executing the computer program: segmenting the inverted ECG signal according to the heartbeat frequency to obtain a plurality of second segmented signals; each second segmented signal corresponds to a cardiac cycle, and each second segmented signal has the same number of sampling points; obtaining a second average signal corresponding to the plurality of second segmented signals, calculating the deviation of each second segmented signal relative to the second average signal, and obtaining a second total deviation based on the sum of the deviations of each second segmented signal relative to the second average signal.
[0125] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if the first total deviation is smaller than the second total deviation, the ECG signal to be detected is determined to be a positive ECG signal; if the first total deviation is larger than the second total deviation, the ECG signal to be detected is determined to be a negative ECG signal.
[0126] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: segmenting an electrocardiogram signal to be detected according to the heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points; obtaining a first average signal corresponding to the plurality of first segmented signals, calculating the deviation of each first segmented signal relative to the first average signal, and obtaining a first total deviation of the electrocardiogram signal to be detected based on the sum of the deviations of each first segmented signal relative to the first average signal; inverting the electrocardiogram signal to be detected to obtain an inverted electrocardiogram signal; obtaining a second total deviation of the inverted electrocardiogram signal; and determining the positive and negative detection results of the electrocardiogram signal to be detected based on the magnitude of the first total deviation and the second total deviation.
[0127] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: performing R wave identification on the ECG signal to be detected to obtain multiple first wave peaks, determining the first wave peak interval between every two consecutive first wave peaks, and calculating the average interval between the first wave peaks of the ECG signal to be detected; based on the average interval between the first wave peaks, determining multiple first segmented signals of the ECG signal to be detected; each first segmented signal includes a first wave peak.
[0128] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the length of the front-segment signal based on the average interval of the first wave peaks and the preset ratio parameter; the length of the front-segment signal is used to characterize the number of sampling points before each first wave peak; determining the segmented signal sampling point interval of each first segmented signal based on the length of the front-segment signal; determining multiple first segmented signals of the electrocardiogram signal to be detected based on the segmented signal sampling point interval of each first segmented signal.
[0129] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: determining a preset ratio parameter according to the waveform characteristics of the electrocardiogram signal to be detected.
[0130] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the first sampling point correspondence between each first segmented signal; determining the signal value of each sampling point corresponding to each first segmented signal based on the first sampling point correspondence, and calculating the average signal value of multiple first segmented signals corresponding to each sampling point; determining the first average signal based on the average signal value of each sampling point.
[0131] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a second sampling point correspondence between a first segmented signal and a first average signal; calculating a standard deviation between a first segmented signal and the first average signal based on the second sampling point correspondence; calculating the standard deviation between each first segmented signal and the first average signal as the deviation of each first segmented signal relative to the first average signal.
[0132] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the inverted ECG signal is segmented according to the heartbeat frequency to obtain multiple second segmented signals; each second segmented signal corresponds to a cardiac cycle, and each second segmented signal has the same number of sampling points; a second average signal corresponding to the multiple second segmented signals is obtained, the deviation of each second segmented signal relative to the second average signal is calculated, and a second total deviation is obtained based on the sum of the deviations of each second segmented signal relative to the second average signal.
[0133] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the first total deviation is smaller than the second total deviation, the ECG signal to be detected is determined to be a positive ECG signal; if the first total deviation is larger than the second total deviation, the ECG signal to be detected is determined to be a negative ECG signal.
[0134] In one embodiment, a computer program product is provided, comprising a computer program, which implements the following steps when executed by a processor: segmenting an electrocardiogram signal to be detected according to a heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points; obtaining a first average signal corresponding to the plurality of first segmented signals, calculating a deviation of each first segmented signal relative to the first average signal, and obtaining a first total deviation of the electrocardiogram signal to be detected based on the sum of the deviations of each first segmented signal relative to the first average signal; inverting the electrocardiogram signal to be detected to obtain an inverted electrocardiogram signal; obtaining a second total deviation of the inverted electrocardiogram signal; and determining positive and negative detection results of the electrocardiogram signal to be detected based on the magnitude of the first total deviation and the second total deviation.
[0135] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: performing R wave identification on the ECG signal to be detected to obtain multiple first wave peaks, determining the first wave peak interval between every two consecutive first wave peaks, and calculating the average interval between the first wave peaks of the ECG signal to be detected; based on the average interval between the first wave peaks, determining multiple first segmented signals of the ECG signal to be detected; each first segmented signal includes a first wave peak.
[0136] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the length of the front-segment signal based on the average interval of the first wave peaks and the preset ratio parameter; the length of the front-segment signal is used to characterize the number of sampling points before each first wave peak; determining the segmented signal sampling point interval of each first segmented signal based on the length of the front-segment signal; determining multiple first segmented signals of the electrocardiogram signal to be detected based on the segmented signal sampling point interval of each first segmented signal.
[0137] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: determining a preset ratio parameter according to the waveform characteristics of the electrocardiogram signal to be detected.
[0138] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the first sampling point correspondence between each first segmented signal; determining the signal value of each sampling point corresponding to each first segmented signal based on the first sampling point correspondence, and calculating the average signal value of multiple first segmented signals corresponding to each sampling point; determining the first average signal based on the average signal value of each sampling point.
[0139] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a second sampling point correspondence between a first segmented signal and a first average signal; calculating a standard deviation between a first segmented signal and the first average signal based on the second sampling point correspondence; calculating the standard deviation between each first segmented signal and the first average signal as the deviation of each first segmented signal relative to the first average signal.
[0140] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the inverted ECG signal is segmented according to the heartbeat frequency to obtain multiple second segmented signals; each second segmented signal corresponds to a cardiac cycle, and each second segmented signal has the same number of sampling points; a second average signal corresponding to the multiple second segmented signals is obtained, the deviation of each second segmented signal relative to the second average signal is calculated, and a second total deviation is obtained based on the sum of the deviations of each second segmented signal relative to the second average signal.
[0141] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the first total deviation is smaller than the second total deviation, the ECG signal to be detected is determined to be a positive ECG signal; if the first total deviation is larger than the second total deviation, the ECG signal to be detected is determined to be a negative ECG signal.
[0142] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0143] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0144] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0145] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for detecting an electrocardiogram signal, It is characterized in that The method comprises: Segmenting the electrocardiogram signal to be detected according to the heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points; Acquire a first average signal corresponding to the plurality of first segmented signals, calculate a deviation of each first segmented signal relative to the first average signal, and obtain a first total deviation of the electrocardiogram signal to be detected according to the sum of the deviations of each first segmented signal relative to the first average signal; Inverting the electrocardiogram signal to be detected to obtain an inverted electrocardiogram signal; Acquire a second total deviation of the inverted electrocardiogram signal; According to the magnitudes of the first total deviation and the second total deviation, the forward and reverse detection results of the electrocardiographic signal to be detected are determined.
2. The method according to claim 1, It is characterized in that The signal segmentation of the electrocardiogram signal to be detected according to the heartbeat frequency to obtain a plurality of first segmented signals includes: Perform R wave recognition on the electrocardiogram signal to be detected to obtain multiple first wave peaks, determine the first wave peak interval between every two consecutive first wave peaks, and calculate the average interval between the first wave peaks of the electrocardiogram signal to be detected; According to the first wave peak average interval, a plurality of first segmented signals of the electrocardiographic signal to be detected are determined; each first segmented signal includes a first wave peak.
3. The method according to claim 2, It is characterized in that The step of determining a plurality of first segmented signals of the electrocardiographic signal to be detected according to the first wave peak average interval comprises: Determine the length of the front-end signal according to the first wave peak average interval and the preset ratio parameter; the length of the front-end signal is used to characterize the number of sampling points before each first wave peak; Determine the segment signal sampling point interval of each first segment signal according to the length of the previous segment signal; A plurality of first segmented signals of the electrocardiographic signal to be detected are determined according to the segmented signal sampling point interval of each first segmented signal.
4. The method according to claim 3, It is characterized in that The method for determining the preset ratio parameter includes: The preset ratio parameter is determined according to the waveform characteristics of the electrocardiogram signal to be detected.
5. The method according to claim 1, It is characterized in that The obtaining of a first average signal corresponding to the plurality of first segmented signals comprises: Determine a first sampling point correspondence relationship between each first segmented signal; According to the first sampling point correspondence relationship, determine the signal value of each first segmented signal corresponding to each sampling point, and calculate the average signal value of the plurality of first segmented signals corresponding to each sampling point; The first average signal is determined according to the average signal value of each sampling point.
6. The method according to claim 1, It is characterized in that The calculating the deviation of each first segmented signal relative to the first average signal comprises: Determine a second sampling point correspondence relationship between a first segmented signal and the first average signal; Calculating a standard deviation between a first segmented signal and the first average signal according to the corresponding relationship of the second sampling points; A standard deviation between each first segment signal and the first average signal is calculated as a deviation of each first segment signal relative to the first average signal.
7. The method according to claim 1, It is characterized in that The step of obtaining a second total deviation of the inverted electrocardiogram signal comprises: Segmenting the inverted ECG signal according to the heartbeat frequency to obtain a plurality of second segmented signals; each second segmented signal corresponds to a cardiac cycle, and each second segmented signal has the same number of sampling points; Obtain a second average signal corresponding to the plurality of second segmented signals, calculate a deviation of each second segmented signal relative to the second average signal, and obtain the second total deviation by summing the deviations of each second segmented signal relative to the second average signal.
8. The method according to claim 1, It is characterized in that The step of determining the positive and negative detection results of the electrocardiogram signal to be detected according to the magnitudes of the first total deviation and the second total deviation includes: If the first total deviation is less than the second total deviation, determining that the electrocardiogram signal to be detected is a positive electrocardiogram signal; If the first total deviation is greater than the second total deviation, it is determined that the electrocardiogram signal to be detected is a reverse electrocardiogram signal.
9. An electrocardiogram signal detection device, It is characterized in that The device comprises: A first calculation module is used to segment the electrocardiogram signal to be detected according to the heartbeat frequency to obtain a plurality of first segmented signals; each first segmented signal corresponds to a cardiac cycle, and each first segmented signal has the same number of sampling points; The first calculation module is further used to obtain a first average signal corresponding to the plurality of first segmented signals, calculate a deviation of each first segmented signal relative to the first average signal, and obtain a first total deviation of the electrocardiogram signal to be detected according to the sum of the deviations of each first segmented signal relative to the first average signal; A signal inversion module, used for inverting the electrocardiogram signal to be detected to obtain an inverted electrocardiogram signal; A second calculation module, used for obtaining a second total deviation of the inverted ECG signal; The signal detection module is used to determine the positive and negative detection results of the electrocardiogram signal to be detected according to the magnitude of the first total deviation and the second total deviation.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
