R-wave detection method and device for electrocardio data, electronic device and storage medium
By calculating the noise figure of ECG data and combining it with multi-channel verification, the problem of low accuracy in R-wave detection in ECG data was solved, thus improving the accuracy of detection.
Patent Information
- Application Number
- CN202311706148.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-12-11
AI Technical Summary
Existing methods for detecting R-waves in electrocardiogram data are easily affected by external factors such as instruments and body movement in weak biological signals, leading to a decrease in detection accuracy.
By calculating the noise figure of each R wave in ECG data from multiple channels, the R waves with a high degree of interference are eliminated using the noise figure, and the location of the R waves is determined by combining the multi-channel data for verification.
It improves the accuracy of R-wave position detection and reduces the impact of noise interference on the detection results.
Smart Images

Figure CN120131030B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, and storage medium for R-wave detection of electrocardiogram (ECG) data. Background Technology
[0002] In the field of electrocardiogram (ECG) data analysis, the QRS complex is the main feature of the signal, reflecting the depolarization process of the left and right ventricles. In QRS complex detection, the detection of the R wave position is crucial for calculating parameters such as heart rate and ST segment. Therefore, accurate R wave position detection is of great significance. The R wave is the wave with the largest peak value in the QRS complex, characterized by its large amplitude, rapid changes, and short duration. Currently, the differential thresholding method is commonly used to detect the position of each R wave in ECG data. However, because ECG signals are weak biological signals and are easily interfered with by external factors such as instrument use and body movement during acquisition, the accuracy of the obtained R wave position detection results can decrease. Summary of the Invention
[0003] In view of this, embodiments of this application provide a method, apparatus, electronic device, and storage medium for R-wave detection of electrocardiogram data, which can improve the accuracy of R-wave position detection.
[0004] The first aspect of this application provides a method for detecting the R wave in electrocardiogram (ECG) data, including:
[0005] Acquire raw electrocardiogram (ECG) data, which includes ECG data from multiple channels corresponding to each sampling point collected at multiple sampling points.
[0006] The noise figure of each R wave in the ECG data of multiple channels is calculated separately. The noise figure is used to represent the degree of signal interference to the corresponding R wave.
[0007] For each sampling point, if at least one channel of the ECG data in the multiple channels corresponding to the sampling point has an R-wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels besides the at least one channel to the total number of channels is greater than a first threshold, then it is determined that an R-wave exists at the location of the sampling point; wherein, the ECG data of the target channel has an R-wave with a noise figure that meets a preset condition within the time range determined according to the sampling point.
[0008] In this embodiment, ECG data from multiple channels corresponding to each sampling point are first acquired. Then, the noise figure of each R-wave in the ECG data of multiple channels is calculated. This noise figure reflects the degree of interference to the R-wave. Finally, each sampling point is traversed to detect whether an R-wave exists at each sampling point. Specifically, when traversing the sampling points, if at least one channel of the ECG data corresponding to a certain sampling point is found to have an R-wave with a noise figure that meets a preset condition, it indicates that at least one channel has detected an R-wave with a relatively low degree of interference. Then, it is detected whether the ECG data of other channels also have an R-wave with a noise figure that meets the preset condition within a nearby time range determined based on the sampling point. The channel that detects the R-wave is called the target channel. If the ratio of the number of target channels to the number of multiple channels is greater than a first threshold, it indicates that a sufficient number of channels have detected an R-wave with a relatively low degree of interference within a time range near the sampling point. At this point, it can be determined that an R-wave exists at the sampling point. The above process uses noise figure to remove R waves that are heavily interfered with, and combines multi-channel ECG data to verify the R wave position, which can improve the accuracy of R wave position detection to a certain extent.
[0009] In one implementation of this application, the noise figure of each R wave in the ECG data of multiple channels is calculated, including:
[0010] Obtain the pre-analysis R-wave position detection results; wherein, the pre-analysis R-wave position detection results are obtained by performing R-wave position detection on preprocessed ECG data, and the preprocessed ECG data is the ECG data obtained after preprocessing the original ECG data;
[0011] Based on each R-wave vertex in the pre-analysis R-wave position detection results, construct each time segment that corresponds one-to-one with each R-wave vertex.
[0012] For each time segment, the noise figure of the R wave in the ECG data of each channel within that time segment is calculated based on the signal change characteristics of the ECG data of each channel within that time segment.
[0013] In one implementation of this application, the noise figure of the R wave in the ECG data of each channel within the time segment is calculated based on the signal change characteristics of the ECG data of each channel within that time segment, including:
[0014] For each channel, multiple signal values of the ECG data of that channel are calculated within the time segment and differential processing is performed to obtain the absolute value; the integral of the absolute value is calculated within the time segment and the mean of the integral is used as the noise figure of the R wave of the ECG data of that channel within the time segment.
[0015] In one implementation of this application, after calculating the noise figure of each R wave in the ECG data of multiple channels, before determining that an R wave exists at the location of the sampling point for each sampling point, if at least one channel in the ECG data of the multiple channels corresponding to the sampling point has an R wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels besides the at least one channel to the total number of channels is greater than a first threshold, the method further includes:
[0016] Based on the noise coefficient of each R wave in the ECG data from multiple channels, calculate the noise level value for each channel.
[0017] Remove ECG data from a set number of channels with the highest noise levels among multiple channels.
[0018] In one implementation of this application, the noise level value of each channel is calculated based on the noise figure of each R wave in the ECG data from multiple channels, including:
[0019] The noise coefficients of each R wave in the ECG data from multiple channels are sorted from smallest to largest, and an initial noise coefficient curve is constructed based on the sorted noise coefficients.
[0020] Determine the second threshold based on the initial noise figure curve;
[0021] Using the second threshold as the dividing line, the initial noise figure curve is normalized to obtain the normalized noise figure curve.
[0022] Based on the normalized noise figure curve, calculate the noise level value for each channel.
[0023] In one implementation of this application, determining the second threshold based on the initial noise figure curve includes:
[0024] The difference between the initial noise figure curve and the translated noise figure curve is calculated to obtain the difference noise figure curve; wherein, the translated noise figure curve is obtained by translating the initial noise figure curve.
[0025] The second threshold is determined based on the peak value in the difference noise figure curve.
[0026] In one implementation of this application, the horizontal axis of the initial noise figure curve represents each R wave in the ECG data from multiple channels, and the vertical axis of the initial noise figure curve represents the noise figure of each R wave in the ECG data from multiple channels; determining a second threshold based on the peak value in the difference noise figure curve includes:
[0027] If there is a peak with an amplitude greater than the third threshold in the horizontal axis range of the last m% of the difference noise figure curve, then select a first peak from the peaks with an amplitude greater than the third threshold, and determine the noise figure corresponding to the first peak as the second threshold.
[0028] If there is a peak with an amplitude less than or equal to the third threshold in the horizontal axis range of the last m% of the difference noise figure curve, then select the second peak with the largest amplitude from the peaks with amplitude less than or equal to the third threshold, and determine the noise figure corresponding to the second peak as the second threshold.
[0029] If there is no peak in the last m% of the horizontal axis range of the difference noise figure curve, and there is a peak in the last n% of the horizontal axis range of the difference noise figure curve, then select the third peak with the largest amplitude from the peaks in the last n% of the horizontal axis range, and determine the noise figure corresponding to the third peak as the second threshold, where n > m.
[0030] If there is no peak value in the last n% of the horizontal axis range of the difference noise figure curve, then the noise figure corresponding to the starting point of the last m% of the horizontal axis range of the difference noise figure curve is determined as the second threshold.
[0031] In one implementation of this application, if at least one channel of the ECG data from multiple channels corresponding to the sampling point has an R-wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels (excluding the at least one channel) to the total number of channels is greater than a first threshold, then it is determined that an R-wave exists at the location of the sampling point, including:
[0032] If at least one channel of the ECG data corresponding to the sampling point has an R wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels besides the at least one channel to the total number of channels is greater than a first threshold, then the RR interval parameter corresponding to the target R wave with a noise figure that meets the preset condition is determined.
[0033] Determine whether the target R wave is effective based on the RR interval parameters;
[0034] If the target R-wave is valid, then the location of the sampling point is determined to have an R-wave.
[0035] In one implementation of this application, the RR interval parameter includes the average RR interval, the current RR interval, the previous RR interval, and an RR interval rule identifier; determining whether the target R-wave is valid based on the RR interval parameter includes:
[0036] If the RR interval regularity is marked as RR interval irregularity, then the target R wave is determined to be valid;
[0037] If the RR interval rule is identified as RR interval rule, and the previous RR interval is greater than or equal to the first product, then the target R wave is determined to be valid. The first product is the product of the average RR interval and the first value.
[0038] If the RR interval rule is identified as RR interval rule, the previous RR interval is less than the first product, and the average of the previous RR interval and the current RR interval is between the first product and the second product, then the target R wave is determined to be valid. The second product is the product of the average RR interval and the second value, and the second value is greater than the first value.
[0039] If the RR interval rule is identified as RR interval rule, the previous RR interval is less than the first product, and the current RR interval is between the first product and the second product, then the target R wave is determined to be valid;
[0040] If the RR interval rule is identified as RR interval rule, the previous RR interval is less than the first product, and the previous RR interval is between the third and fourth products, then the target R wave is determined to be valid. The third product is the product of the current RR interval and the first value, and the fourth product is the product of the current RR interval and the second value.
[0041] In one implementation of this application, determining the RR interval parameter corresponding to the target R wave whose noise figure of the ECG data of at least one channel meets preset conditions includes:
[0042] If the number of R waves currently identified is less than the fourth threshold, then the pre-analysis R wave position detection result is obtained; wherein, the pre-analysis R wave position detection result is obtained by performing R wave position detection on preprocessed ECG data, and the preprocessed ECG data is the ECG data obtained after preprocessing the original ECG data;
[0043] The average RR interval is obtained by calculating the average of multiple RR intervals contained in the pre-analysis R-wave position detection results;
[0044] Calculate the interval between the target R wave and the last R wave among the currently identified R waves, and use it as the current RR interval;
[0045] Calculate the interval between the last R wave and the penultimate R wave among the identified R waves, and use it as the preceding RR interval;
[0046] If the difference between any two RR intervals in the pre-analysis R-wave position detection results is greater than the fifth threshold, then the RR interval regularity case is identified as the RR interval irregularity case; otherwise, the RR interval regularity case is identified as the RR interval regularity case.
[0047] In another implementation of this application embodiment, determining the RR interval parameter corresponding to the target R wave whose noise figure of the ECG data of at least one channel meets preset conditions includes:
[0048] If the number of currently identified R waves is greater than or equal to the fourth threshold, then the average of the multiple RR intervals contained in the currently identified R waves is calculated to obtain the average RR interval.
[0049] Calculate the interval between the target R wave and the last R wave among the currently identified R waves, and use it as the current RR interval;
[0050] Calculate the interval between the last R wave and the penultimate R wave among the identified R waves, and use it as the preceding RR interval;
[0051] If the difference between any two RR intervals in the multiple RR intervals contained in the currently identified R wave is greater than the fifth threshold, then the case of regular RR intervals is identified as irregular RR intervals; otherwise, the case of regular RR intervals is identified as regular RR intervals.
[0052] In one implementation of this application, before calculating the noise figure of each R wave in the ECG data of multiple channels, the method further includes:
[0053] Acquire preprocessed ECG data, which is ECG data obtained after preprocessing the raw ECG data;
[0054] Based on the preprocessed ECG data, the time period of abnormal data was determined;
[0055] Remove ECG data that falls outside the abnormal data time period from the original ECG data.
[0056] In one implementation of this application, determining the time period of abnormal data based on preprocessed electrocardiogram data includes:
[0057] Convert the preprocessed ECG data into a corresponding scatter plot;
[0058] Identifying the first abnormal heartbeat in a scatter plot based on the dilatational erosion algorithm;
[0059] The signal segment corresponding to the first abnormal heartbeat in the preprocessed electrocardiogram data is identified as the abnormal data time period;
[0060] or,
[0061] The preprocessed ECG data was converted into a corresponding time scatter plot.
[0062] Identifying the second abnormal heartbeat in a time scatter plot based on the sample entropy algorithm;
[0063] The signal segment corresponding to the second abnormal heartbeat in the preprocessed electrocardiogram data is identified as the abnormal data time period;
[0064] or,
[0065] Convert the preprocessed ECG data into corresponding histograms;
[0066] A confidence interval-based method is used to identify the third abnormal heartbeat in the histogram;
[0067] The signal segment corresponding to the third abnormal heartbeat in the preprocessed electrocardiogram data was identified as the abnormal data time period.
[0068] In another implementation of this application's embodiments, determining the time period of abnormal data based on preprocessed electrocardiogram data includes:
[0069] Convert the preprocessed ECG data into a corresponding ECG data display chart;
[0070] Determine the fourth abnormal heartbeat selected by the user based on the ECG data display chart;
[0071] The signal segment corresponding to the fourth abnormal heartbeat in the preprocessed electrocardiogram data was identified as the abnormal data time period.
[0072] A second aspect of this application provides an R-wave detection device for electrocardiogram (ECG) data, comprising:
[0073] The ECG data acquisition module is used to acquire raw ECG data, which includes ECG data from multiple channels corresponding to each sampling point collected at multiple sampling points.
[0074] The noise figure calculation module is used to calculate the noise figure of each R wave in the ECG data of multiple channels. The noise figure is used to represent the degree of signal interference received by the corresponding R wave.
[0075] The R-wave detection module is used to determine the presence of an R-wave at each sampling point if, for each sampling point, at least one channel of the ECG data from multiple channels has an R-wave with a noise figure that meets a preset condition, and the ratio of the number of target channels to the number of channels in the other channels (excluding the at least one channel) is greater than a first threshold. The target channel's ECG data has an R-wave with a noise figure that meets the preset condition within a time range determined based on the sampling point.
[0076] A third aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the R-wave detection method for electrocardiogram data as provided in the first aspect of this application.
[0077] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the R-wave detection method for electrocardiogram data as provided in the first aspect of this application.
[0078] It is understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0079] Figure 1 This is a flowchart of an R-wave detection method for electrocardiogram data provided in an embodiment of this application;
[0080] Figure 2 This is a schematic diagram of an initial noise figure curve provided in an embodiment of this application;
[0081] Figure 3 This is a schematic diagram of a difference noise figure curve provided in an embodiment of this application;
[0082] Figure 4 This is a schematic diagram of the operation process for determining the second threshold based on the peak value in the difference noise figure curve provided in the embodiments of this application;
[0083] Figure 5 This is a schematic diagram of a normalized noise figure curve provided in an embodiment of this application;
[0084] Figure 6 This is a schematic diagram of the operation process for determining the effectiveness of a target R wave based on RR interval parameters, provided in an embodiment of this application.
[0085] Figure 7 This is a schematic diagram of a scatter plot obtained from preprocessed electrocardiogram data provided in an embodiment of this application;
[0086] Figure 8 This is a schematic diagram of a scatter plot after removing the scatter points in the core region, provided in an embodiment of this application.
[0087] Figure 9 This is a schematic diagram of a time scatter plot obtained from preprocessed electrocardiogram data provided in an embodiment of this application;
[0088] Figure 10 This is a schematic diagram of the region with frequent RR interval changes identified in the time scatter plot provided in the embodiments of this application;
[0089] Figure 11 This is a schematic diagram of a histogram obtained from preprocessed electrocardiogram data provided in an embodiment of this application;
[0090] Figure 12 This is a schematic diagram of anomaly regions selected from a histogram, provided in an embodiment of this application.
[0091] Figure 13 This is a schematic diagram of the operation process for automatically identifying abnormal heartbeats based on various algorithms provided in the embodiments of this application;
[0092] Figure 14 This is a schematic diagram of the user's manual selection of abnormal heartbeats provided in an embodiment of this application;
[0093] Figure 15 This is a schematic diagram of the structure of an R-wave detection device for electrocardiogram data provided in an embodiment of this application;
[0094] Figure 16 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0095] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail. Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0096] In the field of electrocardiogram (ECG) data analysis, the detection of R-wave position is crucial for calculating parameters such as heart rate and ST segment. Accurate R-wave position detection is of great significance. Currently, the differential thresholding method is commonly used to detect the position of each R-wave in ECG data. However, because ECG signals are weak biological signals and are easily interfered with by external factors such as instrument use and body movement during acquisition, the accuracy of the obtained R-wave position detection results is low. To address this problem, embodiments of this application provide a method, apparatus, electronic device, and storage medium for R-wave detection of ECG data, which can improve the accuracy of R-wave position detection. For more specific technical details regarding the embodiments of this application, please refer to the various embodiments described below.
[0097] It should be understood that the execution subject of the various method embodiments of this application can be various types of electronic devices, such as mobile phones, tablets, wearable devices, electrocardiogram data acquisition devices, electrocardiogram data analysis devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), large-screen TVs, etc. The embodiments of this application do not impose any restrictions on the specific type of electronic device.
[0098] Please see Figure 1 This application illustrates a method for detecting the R wave in electrocardiogram (ECG) data, comprising:
[0099] 101. Acquire raw ECG data, which includes ECG data from multiple channels corresponding to each sampling point collected at multiple sampling points;
[0100] First, raw ECG data is acquired, which includes ECG data from multiple channels corresponding to each sampling point. For example, assuming the sampling rate of the raw ECG data is 500Hz, there are a total of 8 data acquisition channels, and the acquisition time is 24 hours, then the total number of sampling points per channel is 500Hz x 60 seconds x 60 minutes x 24 hours = 43,200,000 sampling points. For each of these 43,200,000 sampling points, there are corresponding ECG data from 8 channels.
[0101] 102. Calculate the noise figure of each R wave in the ECG data of multiple channels. The noise figure is used to represent the degree of signal interference to the corresponding R wave.
[0102] After acquiring the raw electrocardiogram (ECG) data, the noise figure of each R-wave in the raw ECG data is calculated. The noise figure represents the degree of signal interference experienced by the corresponding R-wave. For example, assuming the raw ECG data contains 8 channels, and each channel has m R-waves, the noise figure of each of these 8 x m R-waves is calculated. A higher noise figure indicates a greater degree of signal interference experienced by the corresponding R-wave. In practice, the noise figure of a particular R-wave can be estimated based on the waveform variation characteristics of that R-wave within a corresponding time segment.
[0103] In one implementation of this application, the noise figure of each R wave in the ECG data of multiple channels is calculated, including:
[0104] (1) Obtain the pre-analysis R-wave position detection result; wherein, the pre-analysis R-wave position detection result is obtained by performing R-wave position detection on the pre-processed ECG data, and the pre-processed ECG data is the ECG data obtained after pre-processing the original ECG data;
[0105] (2) Based on each R-wave vertex in the pre-analysis R-wave position detection results, construct each time segment corresponding to each R-wave vertex;
[0106] (3) For each time segment, based on the signal change characteristics of the ECG data of each channel within that time segment, calculate the noise figure of the R wave of the ECG data of each channel within that time segment.
[0107] In practice, the raw ECG data can be preprocessed to obtain preprocessed ECG data. For example, the ECG data from the channel with the highest data quality can be selected, and the selected channel's data can be compressed to obtain preprocessed ECG data. After obtaining the preprocessed ECG data, R-wave position detection processing is performed on the preprocessed ECG data to obtain the positions of each R-wave in the preprocessed ECG data, i.e., the pre-analysis R-wave position detection results. Then, based on each R-wave vertex in the pre-analysis R-wave position detection results, time segments corresponding one-to-one with each R-wave vertex are constructed, that is, the boundaries of the corresponding time segments are determined based on the R-wave vertex. Obviously, each R-wave in the pre-analysis R-wave position detection results will obtain a corresponding time segment. For example, a time segment corresponding to a certain R wave can be represented as [Startpos = R - 500ms, Endpos = R - 500ms], where Startpos represents the start point of the time segment, Endpos represents the end point of the time segment, and R represents the position of the current R wave peak; or it can be represented as [Startpos = LastR + 350ms, Endpos = NextR - 200ms], where Startpos represents the start point of the time segment, Endpos represents the end point of the time segment, LastR represents the position of the previous R wave peak, and NextR represents the position of the next R wave peak. After obtaining each time segment, for each time segment, based on the signal change characteristics of the ECG data of each channel within that time segment, the noise figure of the R wave of the ECG data of each channel within that time segment is calculated. For example, assuming there are 8 channels, for time segment 1, the noise figure of the R wave of the ECG data of channel 1 within time segment 1 is calculated, the noise figure of the R wave of the ECG data of channel 2 within time segment 1 is calculated, and so on, the noise figure of the R wave of the ECG data of channel 8 within time segment 1 is calculated. Perform the same operation as for time segment 1 for each time segment to obtain the noise figure of each R wave in the ECG data of all channels.
[0108] In one implementation of this application, the noise figure of the R wave in the ECG data of each channel within the time segment is calculated based on the signal change characteristics of the ECG data of each channel within that time segment, including:
[0109] For each channel, multiple signal values of the ECG data of that channel are calculated within the time segment and differential processing is performed to obtain the absolute value; the integral of the absolute value is calculated within the time segment and the mean of the integral is used as the noise figure of the R wave of the ECG data of that channel within the time segment.
[0110] The following example illustrates the calculation of the noise figure of the R-wave in ECG data from channel 1 within time segment 1. Assuming time segment 1 is [Startpos, Endpos], the difference (Data_diff) of multiple signal values in the ECG data from channel 1 within the range of [Startpos, Endpos] is calculated. This difference can be a two-point difference, a three-point difference, or a difference of four or more points. For example, assuming the signal values of the four sampling points in the ECG data from channel 1 within the range of [Startpos, Endpos] are A1, A2, A3, and A4, then the two-point difference can be expressed as: B1 = A2 - A1, B2 = A3 - A2, B3 = A4 - A3; the three-point difference can be expressed as: C1 = B2 - B1 = A3 - 2 × A2 + A1, C2 = B3 - B2 = A4 - 2 × A3 + A2; and the four-point difference can be expressed as: D1 = C2 - C1 = A4 - 3 × A3 + 3 × A2 - A1. Then, the absolute value of the difference, abs(Data_diff), is calculated within the range [Startpos, Endpos]. The integral of abs(Data_diff) over the range [Startpos, Endpos] is obtained as INT(abs(Data_diff)), and the mean of the integral, nosIndex, is calculated as: nosIndex = INT(abs(Data_diff)) / (Endpos - Startpos). This calculated mean nosIndex can be used as the noise figure of the R-wave in time segment 1 of the ECG data for channel 1. A larger nosIndex indicates greater noise. Similarly, the noise figure of the R-wave in each channel within each time segment can be calculated using this method. Assuming the number of R-waves in the preprocessed ECG data is N, there are N time segments, and N noise figures nosIndex can be calculated for each channel (corresponding to the N R-waves in the channel). Therefore, 8 channels can yield 8 x N noise figures nosIndex.
[0111] In one implementation of this application, after calculating the noise figure of each R wave in the ECG data of multiple channels, before determining that an R wave exists at the location of the sampling point for each sampling point, if at least one channel in the ECG data of the multiple channels corresponding to the sampling point has an R wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels besides the at least one channel to the total number of channels is greater than a first threshold, the method further includes:
[0112] (1) Calculate the noise level value of each channel based on the noise coefficient of each R wave in the ECG data of multiple channels;
[0113] (2) Remove the ECG data of a set number of channels with the highest noise level among multiple channels.
[0114] After calculating the noise coefficient of each R-wave in the ECG data from multiple channels, the noise level value of each channel can be calculated based on the noise coefficient of each R-wave in the ECG data of each channel. A higher noise level value for a channel indicates greater noise interference in that channel's ECG data. In practice, the noise level values of each channel can be sorted by magnitude, and the ECG data from a predetermined number of channels with the highest noise levels can be removed. These channels, due to the greater noise interference, are excluded and therefore not included in the R-wave fusion process described in step 103. For example, if channel 8 has the highest noise level, its ECG data can be removed. Then, the ECG data from multiple channels processed in step 103 only includes the ECG data from channels 1-7; that is, the ECG data from channel 8 does not participate in the R-wave fusion process described in step 103. This setting avoids the participation of ECG data from channels with significant noise interference in the R-wave fusion process, thereby improving the accuracy of R-wave fusion to some extent.
[0115] As an example, ECG data from channels with the highest noise levels can be removed. For channels with noise levels lower than the highest noise level, the removal of ECG data can be determined as follows:
[0116] (1) Calculate the lead noise percentage based on the noise level values;
[0117] (2) If the noise ratio of the leads exceeds the set threshold, the ECG data of the channel with a noise level value less than the maximum noise level value will be removed; otherwise, it will not be removed.
[0118] For example, assuming channel 4 has the second highest noise level, with a noise level of Channel4 - nosIndexReSum, then the lead noise percentage = Channel4 - nosIndexReSum / number of R waves. Here, the number of R waves refers to the total number of R waves in the ECG data from channel 4. If the lead noise percentage exceeds a set threshold, such as 15%, it indicates that the ECG data from channel 4 is experiencing excessive noise interference and should be removed. If the lead noise percentage does not exceed the set threshold, it indicates that the noise interference from the ECG data from channel 4 is within an acceptable range and can be retained. Alternatively, the lead noise percentage can also be calculated using the total duration of the corresponding ECG data, for example, lead noise percentage = Channel4 - nosIndexReSum / total duration of ECG data from channel 4.
[0119] In one implementation of this application, the noise level value of each channel is calculated based on the noise figure of each R wave in the ECG data from multiple channels, including:
[0120] (1) Sort the noise coefficients of each R wave in the ECG data of multiple channels from small to large, and construct an initial noise coefficient curve based on the sorted noise coefficients;
[0121] (2) Determine the second threshold based on the initial noise figure curve;
[0122] (3) Using the second threshold as the threshold of the dividing line, the initial noise figure curve is normalized to obtain the normalized noise figure curve.
[0123] (4) Calculate the noise level value of each channel according to the normalized noise figure curve.
[0124] When calculating the noise level for each channel based on the noise coefficient of each R-wave in ECG data from multiple channels, the noise coefficients of each R-wave in the ECG data from multiple channels can be sorted from smallest to largest, and an initial noise coefficient curve can be constructed based on the sorted noise coefficients. For example, as described above, assuming there are 8 channels and each channel has N R-waves, then N noise coefficients nosIndex can be calculated for each channel. Summarizing the noise coefficients of each channel yields AllnosIndex = [nosIndex of each channel]. Clearly, AllnosIndex contains 8 x N noise coefficients nosIndex. These 8 x N noise coefficients nosIndex in AllnosIndex are then sorted from smallest to largest, and an initial noise coefficient curve is constructed based on the sorted noise coefficients. For example... Figure 2 The image shown is a schematic diagram of an initial noise figure curve provided in an embodiment of this application. Figure 2 In the diagram, the horizontal axis represents the number of R-waves x 8 channels, which can be viewed as 8 x N R-wave numbers, and the vertical axis represents the specific value of the noise figure (nosIndex) for each R-wave. Based on the constructed initial noise figure curve, a second threshold can be determined as the dividing line threshold for normalization. In practice, positions with significant noise figure changes can be selected from the initial noise figure curve, and the noise figure corresponding to these positions can be used as the second threshold. For example, through... Figure 2 It can be seen that the noise figure changes significantly near the horizontal coordinate 3000, so the noise figure corresponding to the horizontal coordinate 3000 can be determined as the second threshold.
[0125] As an example, determining the second threshold based on the initial noise figure curve includes:
[0126] (1) Calculate the difference between the initial noise figure curve and the translated noise figure curve to obtain the difference noise figure curve; wherein, the translated noise figure curve is obtained by translating the initial noise figure curve;
[0127] (2) Determine the second threshold based on the peak value in the difference noise figure curve.
[0128] To easily identify locations with significant noise figure changes, the difference between the initial noise figure curve and the translated noise figure curve can be calculated to obtain the difference noise figure curve. Specifically, assuming the initial noise figure curve is AllnosIndex(n), it can be translated by one unit to obtain the translated noise figure curve AllnosIndex(n-1). Then, the difference between the initial noise figure curve and the translated noise figure curve, AllnosIndex(n) - AllnosIndex(n-1), is calculated to obtain the difference noise figure curve diff(nosIndex). Then, by finding the peak value in the difference noise figure curve, a second threshold is determined. Figure 3 The image shown is a schematic diagram of a difference noise figure curve provided in an embodiment of this application. Figure 3 In the diagram, the horizontal axis represents the number of R-waves multiplied by 8 channels, and the vertical axis represents the difference between the noise figures. (This is achieved through...) Figure 3 As can be seen, the peaks in the difference noise figure curve are the locations where the noise figure changes significantly, so the second threshold can be determined based on these peaks.
[0129] In one implementation of this application, the horizontal axis of the initial noise figure curve represents each R wave in the ECG data from multiple channels, and the vertical axis of the initial noise figure curve represents the noise figure of each R wave in the ECG data from multiple channels; determining a second threshold based on the peak value in the difference noise figure curve includes:
[0130] (1) If there is a peak with an amplitude greater than the third threshold in the horizontal axis range of the last m% of the difference noise figure curve, then select a first peak from the peaks with an amplitude greater than the third threshold, and determine the noise figure corresponding to the first peak as the second threshold.
[0131] (2) If there are peaks with amplitudes less than or equal to the third threshold in the horizontal axis range of the last m% of the difference noise figure curve, then select the second peak with the largest amplitude from the peaks with amplitudes less than or equal to the third threshold, and determine the noise figure corresponding to the second peak as the second threshold.
[0132] (3) If there is no peak in the horizontal axis range of the last m% of the difference noise figure curve, and there is a peak in the horizontal axis range of the last n% of the difference noise figure curve, then select the third peak with the largest amplitude from the peaks in the horizontal axis range of the last n% and determine the noise figure corresponding to the third peak as the second threshold, n>m.
[0133] (4) If there is no peak value in the last n% of the horizontal axis range of the difference noise figure curve, then the noise figure corresponding to the starting point of the last m% of the horizontal axis range of the difference noise figure curve is determined as the second threshold.
[0134] In obtaining such Figure 3 After obtaining the difference noise figure curve diff(nosIndex), the peak value of diff(nosIndex) can be calculated. These peak values can then be used to determine the normalization threshold, i.e., the second threshold. Figure 4 The diagram shows the operation flow for determining the second threshold based on the peak value in the difference noise figure curve.
[0135] Based on the distribution pattern of the difference noise figure curve, select empirical values m and n, where n > m > 0. For example, m = 5 and n = 10. Detect whether there are peaks with amplitudes greater than the third threshold (e.g., 4) within the last m% of the difference noise figure curve's horizontal axis range. If so, select one of these peaks and denote it as the first peak. If there is only one peak, select it directly; if there are multiple peaks, select one as the first peak according to a set method, such as selecting the first peak, selecting the largest peak, randomly selecting a peak, etc. After selecting the first peak, determine the noise figure corresponding to the first peak as the second threshold. Specifically, the horizontal axis of the first peak can be determined based on the difference noise figure curve, and then the corresponding noise figure is found from the initial noise figure curve based on this horizontal axis, serving as the second threshold.
[0136] If there are no peaks with amplitudes greater than the third threshold in the last m% of the horizontal axis range of the difference noise figure curve, but there are peaks with amplitudes less than or equal to the third threshold, then select the peak with the largest amplitude from the peaks with amplitudes less than or equal to the third threshold, record it as the second peak, and determine the noise figure corresponding to the second peak as the second threshold.
[0137] If there is no peak value in the last m% of the horizontal axis range of the difference noise figure curve, but there is a peak value in the last n% of the horizontal axis range of the difference noise figure curve, then select the peak value with the largest amplitude from the peak values in the last n% of the horizontal axis range, record it as the third peak value, and determine the noise figure corresponding to the third peak value as the second threshold.
[0138] If there are no peaks in the last n% of the horizontal axis range of the difference noise figure curve, then the noise figure corresponding to the starting point of the last m% of the horizontal axis range can be determined as the second threshold. For example, if m = 5, then the last m% of the horizontal axis range is the 95%-100% horizontal axis range, so the noise figure corresponding to the starting point, i.e., the 95% horizontal axis position, can be determined as the second threshold.
[0139] After determining the second threshold, the initial noise figure curve is normalized using the second threshold as the dividing line, resulting in a normalized noise figure curve. For example... Figure 5 The diagram shown is a schematic of a normalized noise figure curve provided in an embodiment of this application. It utilizes functions such as ReLU, with a second threshold as the dividing line threshold, to... Figure 2 The initial noise figure curve shown can be normalized to obtain... Figure 5 The normalized noise figure curve is shown below. For ease of comparison, in... Figure 5 The display simultaneously shows the initial noise figure curve and the normalized noise figure curve. Assuming the initial noise figure curve is AllnosIndex and the second threshold is Thd, normalization is performed as follows:
[0140] If(AllnosIndex>=Thd),AllnosIndexRe=1
[0141] If (AllnosIndex) <Thd),AllnosIndexRe=0
[0142] The final obtained curve, AllnosIndexRe, is the normalized noise figure curve. It should be noted that the example here normalizes to (0, 1), but in reality, it can be normalized to many other values. For example, multiple threshold values (Thd) can be obtained and then normalized to (0, 1, 2, 3…), resulting in a stepped normalized noise figure curve.
[0143] After obtaining the normalized noise figure curve, the noise level value for each channel can be calculated based on this curve. That is, based on the normalized noise figure curve AllnosIndexRe, the noise level values Channel1-nosIndexReSum for channel 1, Channel2-nosIndexReSum for channel 2, Channel3-nosIndexReSum for channel 3, and so on, are calculated. The specific calculation method is as follows:
[0144] Channel1-nosIndexReSum=∑nosIndexRe(Channel1)
[0145] Channel2-nosIndexReSum=∑nosIndexRe(Channel2)
[0146] Channel3-nosIndexReSum=∑nosIndexRe(Channel3)
[0147] Channel4-nosIndexReSum=∑nosIndexRe(Channel4)
[0148] ...
[0149] Wherein, Channel1-nosIndexReSum=∑nosIndexRe(Channel1) means first finding the nosIndexRe values of all R waves in the ECG data of Channel 1, and then summing these nosIndexRe values together, and so on.
[0150] Next, the noise level values of each channel can be sorted according to their size, for example, from smallest to largest or from largest to smallest, such as sorting Channel1-nosIndexReSum, Channel2-nosIndexReSum, ... After sorting, the maximum value can be removed, that is, the ECG data of the channel with the largest noise level value will not participate in the R-wave fusion process in step 103.
[0151] 103. For each sampling point, if at least one channel of the ECG data in the multiple channels corresponding to the sampling point has an R-wave with a noise figure that meets the preset conditions, and the ratio of the number of target channels in the other channels besides the at least one channel to the total number of channels is greater than a first threshold, then it is determined that an R-wave exists at the location of the sampling point.
[0152] Step 103 can be viewed as an R-wave fusion process for ECG data from various channels. Fusion can be performed only on the R-waves of the ECG data from channels with lower noise levels. Here, R-wave fusion refers to comprehensively considering the R-wave position detection results from each channel's ECG data to infer whether an R-wave truly exists at the location of each sampling point.
[0153] Assuming the original ECG data sampling rate is 500Hz, there are a total of 8 channels, and the acquisition time is 24 hours, then the total number of sampling points per channel is 500Hz x 60 seconds x 60 minutes x 24 hours = 43,200,000 sampling points. For each of these 43,200,000 sampling points, there are ECG data from 8 channels.
[0154] The same processing is applied to all sampling points. In practice, starting from the first sampling point, the presence of an R-wave is determined at each sampling point sequentially until all sampling points are processed, thus completing the R-wave detection process for ECG data. Taking a sampling point P as an example, the process first checks whether at least one channel of ECG data corresponding to sampling point P has an R-wave with a noise figure that meets a preset condition. In specific implementation, each channel can be checked sequentially. For example, starting from channel 1, the presence of an R-wave in the ECG data of channel 1 at sampling point P can be determined by checking whether the signal amplitude at sampling point P exceeds a set threshold. If an R-wave exists, the noise figure of that R-wave is then checked to see if it meets the preset condition. Since the noise figures of all R-waves in multiple channels have been calculated in step 102, the noise figure of the currently determined R-wave can be obtained here. It is then determined whether the noise figure meets certain conditions, such as whether the noise figure is less than a set threshold. If so, the noise figure meets the preset condition; otherwise, it does not. Alternatively, if the noise figure has been processed... Figure 5The normalization process shown can be used to determine if the noise coefficient is 0. If the noise coefficient is 0, it means that the noise coefficient meets the preset condition; otherwise, it means that the noise coefficient does not meet the preset condition. If the ECG data of channel 1 does not have an R wave at sampling point P, or if the noise coefficient of the R wave in the ECG data of channel 1 at sampling point P does not meet the preset condition, then the ECG data of channel 2 is checked to see if there is an R wave with a noise coefficient that meets the preset condition at sampling point P, and so on, until all channels are traversed. It should be noted that if some channels with large noise levels were removed in the previous steps, then the channels traversed here do not include those removed channels. If the ECG data of all channels does not have an R wave with a noise coefficient that meets the preset condition at sampling point P, then it can be determined that there is no R wave at sampling point P, and then the same method is used to continue to check whether there is an R wave at the next sampling point. If, during the traversal of all channels, it is detected that the ECG data of at least one channel has an R wave with a noise coefficient that meets the preset condition at sampling point P, then the ECG data of other channels besides the at least one channel are searched within a certain time range near sampling point P to monitor whether there is an R wave with a noise coefficient that meets the preset condition. For example, assuming that the ECG data of channel 1 contains an R-wave with a noise figure that meets a preset condition at sampling point P, a time range [P+2ms, P+150ms] can be determined based on sampling point P. Then, the ECG data of channels 2-8 are checked to see if an R-wave with a noise figure that meets the preset condition exists within this time range. If it exists, the corresponding channel is considered to have detected an R-wave and is recorded as the target channel. For example, if the ECG data of channel 3 contains an R-wave with a noise figure that meets the preset condition within this time range, then channel 3 is the target channel. If the ECG data of channel 6 does not contain an R-wave with a noise figure that meets the preset condition within this time range, then channel 6 is not the target channel, and so on. Afterwards, the number of target channels is counted. If the ratio of the number of target channels to the number of all channels traversed is greater than a first threshold, then it is determined that an R-wave exists at sampling point P; otherwise, it is determined that an R-wave does not exist at sampling point P. For example, if the ratio of the number of target channels to the number of all channels traversed is greater than 50%, it means that more than half of the channels have detected an R-wave with a noise figure that meets the preset condition near sampling point P, therefore it can be determined that an R-wave does exist at sampling point P.
[0155] In one implementation of this application, if at least one channel of the ECG data from multiple channels corresponding to the sampling point has an R-wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels (excluding the at least one channel) to the total number of channels is greater than a first threshold, then it is determined that an R-wave exists at the location of the sampling point, including:
[0156] (1) If at least one channel of the ECG data in the multiple channels corresponding to the sampling point has an R wave with a noise figure that meets the preset conditions, and the ratio of the number of target channels in the other channels besides the at least one channel to the number of channels is greater than the first threshold, then the RR interval parameter corresponding to the target R wave with a noise figure that meets the preset conditions in the ECG data of the at least one channel is determined.
[0157] (2) Determine whether the target R wave is effective based on the RR interval parameter;
[0158] (3) If the target R wave is valid, then the location of the sampling point is determined to have an R wave.
[0159] When at least one channel of ECG data corresponding to a sampling point is found to have an R-wave with a noise figure that meets a preset condition, and the ratio of the number of target channels to the number of target channels in other channels is greater than a first threshold, the presence of an R-wave at the sampling point is not immediately determined. Instead, an RR interval verification step is added. Only after the RR interval verification passes is the presence of an R-wave at the sampling point determined. This further improves the accuracy of R-wave location detection. Specifically, the R-wave with a noise figure that meets the preset condition in the ECG data of at least one channel can be denoted as the target R-wave. Then, the RR interval parameter corresponding to the target R-wave is obtained. The RR interval parameter is used to determine whether the target R-wave is valid. If the target R-wave is valid, the presence of an R-wave at the sampling point is determined; if the target R-wave is invalid, the absence of an R-wave at the sampling point is determined. The RR interval parameter can include the average RR interval, the current RR interval, the previous RR interval, and an RR interval rule identifier. The following explains how these RR interval parameters are obtained and how the validity of the target R-wave is determined.
[0160] In one implementation of this application, determining the RR interval parameter corresponding to the target R wave whose noise figure of the ECG data of at least one channel meets preset conditions includes:
[0161] (1) If the number of R waves that have been identified is less than the fourth threshold, then the pre-analysis R wave position detection result is obtained; wherein, the pre-analysis R wave position detection result is obtained by performing R wave position detection on the pre-processed ECG data, and the pre-processed ECG data is the ECG data obtained after pre-processing the original ECG data;
[0162] (2) Calculate the average value of multiple RR intervals contained in the pre-analysis R-wave position detection results to obtain the average RR interval;
[0163] (3) Calculate the interval between the target R wave and the last R wave among the currently identified R waves, and use it as the current RR interval;
[0164] (4) Calculate the interval between the last R wave and the penultimate R wave in the identified R waves, and use it as the previous RR interval;
[0165] (5) If the difference between any two RR intervals in the multiple RR intervals included in the pre-analysis R-wave position detection results is greater than the fifth threshold, then the RR interval regularity case is identified as the RR interval irregularity case; otherwise, the RR interval regularity case is identified as the RR interval regularity case.
[0166] In the technical solution of this application embodiment, the presence of R-waves at each sampling point is detected sequentially. Therefore, the R-waves that have been determined to exist are a continuously updated R-wave sequence, which can be denoted as the fused R-wave sequence. For example, assuming that the current determination is for sampling point P, and 7 sampling points before sampling point P have confirmed the presence of R-waves, then the current fused R-wave sequence can be represented as: Y1, Y2, Y3, Y4, Y5, Y6, Y7, where Y1-Y7 represent the confirmed R-waves. If the number of confirmed R-waves is small, for example, less than 7 R-waves in the fused R-wave sequence, then the accuracy of using the fused R-wave sequence to determine some RR interval parameters (such as the average RR interval and RR interval regularity identifiers) is insufficient. In this case, the pre-analysis R-wave position detection results can be obtained, and the RR interval parameters can be determined using the pre-analysis R-wave position detection results. The explanation of the pre-analysis R-wave position detection results can be referred to the previous description, and will not be repeated here. The individual R-wave positions contained in the pre-analysis R-wave position detection results can also be considered as an R-wave sequence. However, since the pre-analysis R-wave position detection process has ended, this R-wave sequence is no longer updated and can be denoted as the pre-analysis R-wave sequence. For example, the pre-analysis R-wave sequence can be represented as: X1, X2, X3, X4, X5, X6, X7...Xn, where X1-Xn represent the individual R-waves in the pre-analysis R-wave position detection results, respectively.
[0167] When determining the RR interval parameter using the pre-analysis R-wave position detection results, the average of multiple RR intervals included in the pre-analysis R-wave position detection results is calculated to obtain the average RR interval. For example, calculating X2-X1 yields RR interval 1, calculating X3-X2 yields RR interval 2, calculating X4-X3 yields RR interval 3, and so on. The average of these RR intervals is then calculated as the average RR interval. In practice, to improve the accuracy of the average RR interval calculation, the maximum and minimum values of these RR intervals can be removed before calculating the average.
[0168] If the difference between any two RR intervals in the pre-analysis R-wave position detection results is greater than the fifth threshold, the RR intervals of the pre-analyzed R-wave sequence can be considered irregular. Therefore, cases with regular RR intervals are identified as irregular; otherwise, cases with regular RR intervals are identified as regular. For example, if the difference between any two RR intervals in the six RR intervals X1-X7 is greater than 100ms, then the RR intervals can be considered irregular; otherwise, they are considered regular.
[0169] Assuming the current fused R-wave sequence is Y1, Y2, Y3, Y4, Y5, Y6, Y7, then the currently identified target R-wave is Y8. The interval between the target R-wave and the last R-wave among the currently identified R-waves is calculated as the current RR interval, i.e., current RR interval = Y8 - Y7. The interval between the last R-wave and the second-to-last R-wave among the identified R-waves is calculated as the previous RR interval, i.e., previous RR interval = R7 - R6. Clearly, the current RR interval and the previous RR interval are continuously updated; each detected R-wave has its own corresponding current RR interval and previous RR interval.
[0170] For ease of understanding, a detected R-wave that has not been validated by the RR interval is labeled Y'. When Y' is validated by the RR interval, it is denoted as Y. As an example, initially the fused R-wave sequence is empty. When the first R-wave Y1' is detected, since its corresponding current RR interval and previous RR interval cannot be obtained, Y1' is directly determined to be valid, resulting in Y1. At this time, the fused R-wave sequence is: Y1. When the second R-wave Y2' is detected, since the fused R-wave sequence contains only one R-wave, the previous RR interval corresponding to Y2' cannot be obtained either. Therefore, Y2' is directly determined to be valid, resulting in Y2. At this time, the fused R-wave sequence is: Y1, Y2. When the third R-wave Y3' is detected, its preceding RR interval = Y2 - Y1, and its current RR interval = Y3' - Y2. The validity of Y3' can then be determined by verifying the RR intervals. If valid, the fused R-wave sequence is: Y1, Y2, Y3; if invalid, the fused R-wave sequence is: Y1, Y2. When the fourth R-wave Y4' is detected, assuming the fused R-wave sequence is: Y1, Y2, Y3, its preceding RR interval = Y3 - Y2, and its current RR interval = Y4' - Y3. The validity of Y4' can then be determined by verifying the RR intervals. Similarly, assuming the fused R-wave sequence is: Y1, Y2, its preceding RR interval = Y2 - Y1, and its current RR interval = Y4' - Y2. The validity of Y4' can then be determined by verifying the RR intervals. If Y4' is valid, the merged R-wave sequence is updated to: Y1, Y2, Y3, Y4 or Y1, Y2, Y4, and so on.
[0171] As another example, initially, the fused R-wave sequence is empty. When the first R-wave Y1' is detected, since its corresponding current RR interval and previous RR interval cannot be obtained, Y1' is directly determined to be valid, resulting in Y1. At this point, the fused R-wave sequence is: Y1. When the second R-wave Y2' is detected, since the fused R-wave sequence contains only one R-wave, the previous RR interval corresponding to Y2' cannot be obtained either. Therefore, it is not evaluated at this point, and the fused R-wave sequence is: Y1, Y2'. When the third R-wave Y3' is detected, Y2' is evaluated. Its corresponding previous RR interval = Y2' - Y1, and current RR interval = Y3' - Y2'. The validity of Y2' can then be verified using the RR intervals. If Y2' is valid, the fused R-wave sequence is: Y1, Y2, Y3'; otherwise, the fused R-wave sequence is: Y1, Y3'. When the fourth R-wave Y4' is detected, if the fused R-wave sequence is Y1, Y2, Y3', then the preceding RR interval corresponding to Y3' = Y3' - Y2, and the current RR interval = Y4' - Y3'. If the fused R-wave sequence is Y1, Y3', then the preceding RR interval corresponding to Y3' = Y3' - Y1, and the current RR interval = Y4' - Y3'. If Y3' is deemed valid through RR interval verification, the fused R-wave sequence is updated to Y1, Y2, Y3, Y4' or Y1, Y3, Y4', and so on.
[0172] In another implementation of this application embodiment, determining the RR interval parameter corresponding to the target R wave whose noise figure of the ECG data of at least one channel meets preset conditions includes:
[0173] (1) If the number of R waves that have been identified is greater than or equal to the fourth threshold, then calculate the average value of the multiple RR intervals contained in the R waves that have been identified to obtain the average RR interval.
[0174] (2) Calculate the interval between the target R wave and the last R wave among the currently identified R waves, and use it as the current RR interval;
[0175] (3) Calculate the interval between the last R wave and the penultimate R wave in the identified R waves, and use it as the previous RR interval;
[0176] (4) If the difference between any two RR intervals in the multiple RR intervals contained in the currently determined R wave is greater than the fifth threshold, then the RR interval regularity case is identified as the RR interval irregularity case; otherwise, the RR interval regularity case is identified as the RR interval regularity case.
[0177] If the number of R waves that have been identified is large, for example, if the number of R waves in the fused R wave sequence is greater than or equal to 7, then the accuracy of using the fused R wave sequence to determine the RR interval parameter is sufficient, and it is not necessary to use the pre-analysis R wave position detection results.
[0178] When determining the RR interval parameters using a currently identified R-wave, i.e., the fused R-wave sequence, the average of multiple RR intervals contained within the currently identified R-wave is calculated to obtain the average RR interval. For example, calculating Y2-Y1 yields RR interval 1, calculating Y3-Y2 yields RR interval 2, calculating Y4-Y3 yields RR interval 3, and so on. The average of these RR intervals is then calculated as the average RR interval. In practice, to improve the accuracy of the average RR interval calculation, the maximum and minimum values of these RR intervals can be removed before calculating the average.
[0179] If the difference between any two RR intervals in the existing R-wave is greater than the fifth threshold, the RR intervals of the fused R-wave sequence can be considered irregular. Therefore, cases where the RR intervals are regular are identified as irregular; otherwise, cases where the RR intervals are regular are identified as regular. For example, if the difference between any two RR intervals in the six RR intervals of Y1-Y7 is greater than 100ms, the RR intervals are considered irregular; otherwise, they are considered regular.
[0180] Assuming the current fused R-wave sequence is Y1, Y2, Y3, Y4, Y5, Y6, Y7, then the currently identified target R-wave is Y8. The interval between the target R-wave and the last R-wave among the currently identified R-waves is calculated as the current RR interval, i.e., current RR interval = Y8 - Y7. The interval between the last R-wave and the second-to-last R-wave among the identified R-waves is calculated as the previous RR interval, i.e., previous RR interval = R7 - R6. Clearly, the current RR interval and the previous RR interval are continuously updated; each detected R-wave has its own corresponding current RR interval and previous RR interval.
[0181] In one implementation of this application, determining whether the target R-wave is effective based on the RR interval parameter includes:
[0182] (1) If the regular RR interval is marked as irregular RR interval, then the target R wave is determined to be valid;
[0183] (2) If the RR interval rule is identified as RR interval rule, and the previous RR interval is greater than or equal to the first product, then the target R wave is determined to be valid. The first product is the product of the average RR interval and the first value.
[0184] (3) If the RR interval rule is identified as RR interval rule, the previous RR interval is less than the first product, and the average value of the previous RR interval and the current RR interval is between the first product and the second product, then the target R wave is determined to be valid. The second product is the product of the average RR interval and the second value, and the second value is greater than the first value.
[0185] (4) If the RR interval rule is identified as RR interval rule, the previous RR interval is less than the first product, and the current RR interval is between the first product and the second product, then the target R wave is determined to be valid;
[0186] (5) If the RR interval rule is identified as RR interval rule, the previous RR interval is less than the first product, and the previous RR interval is between the third product and the fourth product, then the target R wave is determined to be valid. The third product is the product of the current RR interval and the first value, and the fourth product is the product of the current RR interval and the second value.
[0187] When determining the effectiveness of the target R wave based on the RR interval parameter, considering that many diseases can cause irregular RR intervals in the R wave, in order to maintain the corresponding R wave signal characteristics, when a regular RR interval is detected, it is marked as an irregular RR interval, and the target R wave can be directly determined to be effective.
[0188] If the RR interval rule is identified as an RR interval rule, there are multiple branches for determining the validity of the target R-wave. Under the RR interval rule, if the previous RR interval is greater than or equal to the first product, the target R-wave is determined to be valid. The first product is the product of the average RR interval and a first value. For example, assuming the first value is 0.8, if the previous RR interval is ≥ 0.8 × the average RR interval, the target R-wave is determined to be valid. If the previous RR interval is less than the first product, and the average of the previous RR interval and the current RR interval is between the first and second products, the target R-wave is determined to be valid. The second product is the product of the average RR interval and a second value, and the second value is greater than the first value. For example, assuming the first value is 0.8 and the second value is 1.2, if the previous RR interval is < 0.8 × the average RR interval, and 0.8 × the average RR interval < (previous RR interval + current RR interval) / 2 < 1.2 × the average RR interval, the target R-wave is determined to be valid. If the previous RR interval is less than the first product, and the current RR interval is between the first and second products, then the target R-wave is determined to be valid. For example, assuming the first value is 0.8 and the second value is 1.2, if the previous RR interval < 0.8 x the average RR interval, and 0.8 x the average RR interval < the current RR interval < 1.2 x the average RR interval, then the target R-wave is determined to be valid. If the previous RR interval is less than the first product, and the previous RR interval is between the third and fourth products, then the target R-wave is determined to be valid. The third product is the product of the current RR interval and the first value, and the fourth product is the product of the current RR interval and the second value. For example, assuming the first value is 0.8 and the second value is 1.2, if the previous RR interval < 0.8 x the average RR interval, and 0.8 x the current RR interval < the previous RR interval < 1.2 x the current RR interval, then the target R-wave is determined to be valid. All other cases not listed above indicate that the target R-wave is invalid. Figure 6 The diagram shown above illustrates the operational procedure for determining the effectiveness of the target R wave based on the RR interval parameter.
[0189] In one implementation of this application, before calculating the noise figure of each R wave in the ECG data of multiple channels, the method further includes:
[0190] (1) Obtain preprocessed ECG data. Preprocessed ECG data is ECG data obtained after preprocessing the original ECG data.
[0191] (2) Determine the time period of abnormal data based on the preprocessed ECG data;
[0192] (3) Remove ECG data that is outside the abnormal data time period from the original ECG data.
[0193] The R-wave fusion process of the ECG data from each channel described in step 103 can be regarded as a precise reanalysis of R-wave detection. The fused R-wave sequence obtained is used as the reanalysis result to correct the pre-analysis R-wave position detection result. Since the original ECG data is extremely large, performing a complete and precise reanalysis of the original ECG data requires a lot of time and computation. Considering that the error in the pre-analysis R-wave position detection result usually lies in the abnormal data time period of the pre-processed ECG data, such as the signal segment where the abnormal heartbeat is located, the abnormal data time period can be identified first, and the ECG data outside the abnormal data time period in the original ECG data can be removed. That is, only the part of the ECG data within the abnormal time period needs to be precisely reanalyzed. This can significantly reduce the computation and time consumed by the algorithm. Methods for identifying anomalous data time periods may include: identifying anomalous heartbeats in scatter plots based on the dilation algorithm, identifying anomalous heartbeats in time scatter plots based on the sample entropy algorithm, identifying anomalous heartbeats in histograms based on the confidence interval method, allowing users to manually select one or more anomalous heartbeats through an operable interface, and automatically filtering one or more anomalous heartbeats based on certain fixed rules through an operable interface, etc. These methods are described in detail below.
[0194] In one implementation of this application, determining the time period of abnormal data based on preprocessed electrocardiogram data includes:
[0195] (1) Convert the preprocessed ECG data into a corresponding scatter plot;
[0196] (2) Identify the first abnormal heartbeat in the scatter plot based on the expansion erosion algorithm;
[0197] (3) The signal segment corresponding to the first abnormal heartbeat in the preprocessed electrocardiogram data is determined as the abnormal data time period.
[0198] After converting the preprocessed ECG data into a corresponding scatter plot, abnormal heartbeats in the scatter plot can be identified using the dilation and erosion algorithm, denoted as the first abnormal heartbeat. Then, the signal segment corresponding to the first abnormal heartbeat in the preprocessed ECG data is determined as the abnormal data time period. Obviously, since there can be one or more first abnormal heartbeats, the determined abnormal data time period can also be one or more. Specifically, the dilation and erosion algorithm performs dilation or erosion processing on the image pixels being operated on. Its principle can refer to existing technologies. Using the dilation and erosion algorithm, the outline of the core region of the scatter plot can be identified, and the scatter points within the core region are removed. The remaining scatter points in the non-core region are the abnormal points, and the ECG signals corresponding to these abnormal points are the first abnormal heartbeats. For example... Figure 7 The image shown is a schematic diagram of a scatter plot obtained from preprocessed ECG data. The dilatational erosion algorithm can be used to identify... Figure 7The outline of the core region of the scatter plot is shown, and then the scatter points within the core region are removed to obtain the result as shown. Figure 8 The scatter plot shown is after removing the scatter points from the core region. Figure 8 In the process, the remaining black dots are the abnormal points. The electrocardiogram signals corresponding to these abnormal points are obtained as the first abnormal heartbeat.
[0199] In another implementation of this application's embodiments, determining the time period of abnormal data based on preprocessed electrocardiogram data includes:
[0200] (1) Convert the preprocessed ECG data into a corresponding time scatter plot;
[0201] (2) Identify the second abnormal heartbeat in the time scatter plot based on the sample entropy algorithm;
[0202] (3) The signal segment corresponding to the second abnormal heartbeat in the preprocessed electrocardiogram data is identified as the abnormal data time period.
[0203] After converting the preprocessed ECG data into a corresponding time scatter plot, abnormal heartbeats in the scatter plot can be identified using the sample entropy algorithm, denoted as the second abnormal heartbeat. The signal segment corresponding to the second abnormal heartbeat in the preprocessed ECG data is then determined as the abnormal data time period. Obviously, since there can be one or more second abnormal heartbeats, the determined abnormal data time period can also be one or more. Specifically, the sample entropy algorithm is an improved method based on approximate entropy for measuring the complexity of time series, and it is well-suited for the analysis of biomedical signal sequences. Its principle can refer to existing technologies. Using the sample entropy algorithm, regions with frequent RR interval changes in the time scatter plot can be identified; the ECG signal corresponding to this region is the second abnormal heartbeat. Figure 9 The image shows a schematic diagram of a time scatter plot obtained from preprocessed ECG data. The sample entropy algorithm can be used to identify... Figure 9 The scatter plot of time shows regions with frequent changes in the RR interval. For example... Figure 10 The image shows a schematic diagram of regions with frequent changes in the RR interval identified in the time scatter plot. These frequently changing regions are located in... Figure 10 The area in the middle is the black dot region, which is different from the gray dots in the less frequently changing regions. The ECG signal corresponding to the frequently changing regions is the abnormal heartbeat.
[0204] In another implementation of this application's embodiments, determining the time period of abnormal data based on preprocessed electrocardiogram data includes:
[0205] (1) Convert the preprocessed ECG data into the corresponding histogram;
[0206] (2) Identifying the third abnormal heartbeat in the histogram based on the confidence interval method;
[0207] (3) The signal segment corresponding to the third abnormal heartbeat in the preprocessed electrocardiogram data is identified as the abnormal data time period.
[0208] After converting the preprocessed ECG data into a corresponding histogram, abnormal heartbeats in the histogram can be identified based on confidence intervals, denoted as the third abnormal heartbeat. The signal segment corresponding to the third abnormal heartbeat in the preprocessed ECG data is then determined as the abnormal data time period. Obviously, since there can be one or more third abnormal heartbeats, the determined abnormal data time period can also be one or more. Specifically, based on the confidence interval method, the first 5% and last 5% of the histogram distribution can be selected as abnormal regions, and the ECG signals corresponding to these abnormal regions are taken as the third abnormal heartbeat. Figure 11 The image shows a schematic diagram of a histogram obtained from preprocessed ECG data. Using a confidence interval-based method, the top 5% and bottom 5% of the histogram distribution can be selected as abnormal regions. Figure 12 The image shows a schematic diagram of the selected abnormal regions in the histogram. The electrocardiogram signals corresponding to these abnormal regions are the abnormal heartbeats.
[0209] like Figure 13 The diagram illustrates the workflow for automatically identifying abnormal heartbeats based on various algorithms. After converting preprocessed ECG data into corresponding scatter plots, time scatter plots, and histograms, for the scatter plots, the dilation and erosion algorithm is used to identify the core region outline, thus obtaining abnormal heartbeats in the scatter plot. For the time scatter plot, sample entropy is used to identify regions with frequent RR interval changes, thus obtaining abnormal heartbeats in the time scatter plot. For the histogram, the confidence interval method is used to filter out abnormal regions, thus obtaining abnormal heartbeats in the histogram. A segment selection switch can be set, allowing users to select one or more of the scatter plot, time scatter plot, and histogram abnormal heartbeats, and then the user-selected abnormal heartbeats are merged. After merging the abnormal heartbeats, certain preprocessing can be performed on the merged abnormal heartbeats, specifically including dilation, deduplication, and erosion, etc. The process involves several steps: expansion processing extends all R waves in abnormal heartbeats by a certain duration (e.g., 3 minutes); deduplication processing removes duplicate segments from abnormal heartbeats to determine the start and end points of the reanalysis data segment; and erosion processing reduces the start and end points of the abnormal heartbeats by a certain duration (e.g., 2.5 minutes). After preprocessing, the merged abnormal heartbeats can be used as segments for precise reanalysis, i.e., the abnormal data time period.
[0210] In another implementation of this application's embodiments, determining the time period of abnormal data based on preprocessed electrocardiogram data includes:
[0211] (1) Convert the preprocessed ECG data into the corresponding ECG data display chart;
[0212] (2) Determine the fourth abnormal heartbeat selected by the user based on the ECG data display chart;
[0213] (3) The signal segment corresponding to the fourth abnormal heartbeat in the preprocessed electrocardiogram data is identified as the abnormal data time period.
[0214] Preprocessed ECG data can be converted into corresponding ECG data visualizations, such as page scan images, scatter plots, templates, histograms, overlay plots, event plots, and ECGs, etc. These ECG data visualizations are output through a user-friendly interface. After viewing these visualizations, users can perform manual analysis, manually selecting one or more abnormal heartbeats from the interface, designated as the fourth abnormal heartbeat. The signal segment corresponding to the fourth abnormal heartbeat in the preprocessed ECG data is then identified as the abnormal data time period. Obviously, since there can be one or more fourth abnormal heartbeats, the identified abnormal data time period can also be one or more. Figure 14 The diagram illustrates the user's manual selection process for abnormal heartbeats. After converting preprocessed ECG data into corresponding ECG data visualizations such as page scans, scatter plots, templates, histograms, overlay plots, event plots, and ECGs, and outputting them through an operable interface, users can manually select one or more abnormal heartbeats, one or more types of abnormal heartbeats, or one or more segments of abnormal heartbeats from these ECG data visualizations. Then, the user-selected abnormal heartbeats are merged. After merging, the merged abnormal heartbeats can be subjected to dilation, deduplication, and erosion processing to obtain the segments to be precisely reanalyzed, i.e., the abnormal data time periods.
[0215] In this embodiment, ECG data from multiple channels corresponding to each sampling point are first acquired. Then, the noise figure of each R-wave in the ECG data of multiple channels is calculated. This noise figure reflects the degree of interference to the R-wave. Finally, each sampling point is traversed to detect whether an R-wave exists at each sampling point. Specifically, when traversing the sampling points, if at least one channel of the ECG data corresponding to a certain sampling point is found to have an R-wave with a noise figure that meets a preset condition, it indicates that at least one channel has detected an R-wave with a relatively low degree of interference. Then, it is detected whether the ECG data of other channels also have an R-wave with a noise figure that meets the preset condition within a nearby time range determined based on the sampling point. The channel that detects the R-wave is called the target channel. If the ratio of the number of target channels to the number of multiple channels is greater than a first threshold, it indicates that a sufficient number of channels have detected an R-wave with a relatively low degree of interference within a time range near the sampling point. At this point, it can be determined that an R-wave exists at the sampling point. The above process uses noise figure to remove R waves that are heavily interfered with, and combines multi-channel ECG data to verify the R wave position, which can improve the accuracy of R wave position detection to a certain extent.
[0216] In summary, the embodiments of this application utilize multi-channel R-wave fusion technology to achieve accurate reanalysis, and the obtained reanalysis results can be used to correct the pre-analysis R-wave position detection results. Furthermore, the embodiments of this application also provide various methods for identifying abnormal data time periods, performing accurate reanalysis only on ECG data within those abnormal data time periods, which can effectively reduce the computational load and time consumed by the algorithm.
[0217] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0218] The above mainly describes a method for detecting the R wave in electrocardiogram (ECG) data. The following will describe a device for detecting the R wave in ECG data.
[0219] Please see Figure 15 One embodiment of an R-wave detection device for electrocardiogram data in this application includes:
[0220] The ECG data acquisition module 1501 is used to acquire raw ECG data, which includes ECG data from multiple channels corresponding to each sampling point collected at multiple sampling points.
[0221] The noise figure calculation module 1502 is used to calculate the noise figure of each R wave in the ECG data of multiple channels. The noise figure is used to represent the degree of signal interference received by the corresponding R wave.
[0222] The R-wave detection module 1503 is used to determine that an R-wave exists at the location of a sampling point if, for each sampling point, at least one channel of the ECG data in the multiple channels corresponding to that sampling point has an R-wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels besides the at least one channel to the number of the multiple channels is greater than a first threshold; wherein, the ECG data of the target channel has an R-wave with a noise figure that meets the preset condition within the time range determined according to the sampling point.
[0223] In one implementation of this application, the noise figure calculation module includes:
[0224] The pre-analysis result acquisition unit is used to acquire the pre-analysis R-wave position detection result; wherein, the pre-analysis R-wave position detection result is obtained by performing R-wave position detection on preprocessed ECG data, and the preprocessed ECG data is the ECG data obtained after preprocessing the original ECG data;
[0225] The time segment construction unit is used to construct time segments corresponding to each R-wave vertex based on the pre-analysis R-wave position detection results.
[0226] The noise figure calculation unit is used to calculate the noise figure of the R wave of the ECG data of each channel within each time segment, based on the signal change characteristics of the ECG data of each channel within that time segment.
[0227] In one implementation of this application, the noise figure calculation unit includes:
[0228] The noise figure calculation subunit is used to calculate the absolute value of multiple signal values of the ECG data of each channel within the time segment by performing differential processing; and to calculate the integral of the absolute value within the time segment and calculate the mean of the integral as the noise figure of the R wave of the ECG data of that channel within the time segment.
[0229] In one implementation of this application, the R-wave detection device for electrocardiogram data further includes:
[0230] The noise level calculation module is used to calculate the noise level value of each channel based on the noise coefficient of each R wave in the ECG data of multiple channels.
[0231] The channel removal module is used to remove ECG data from a set number of channels with the highest noise levels among multiple channels.
[0232] In one implementation of this application, the noise level calculation module includes:
[0233] The noise figure sorting unit is used to sort the noise figure of each R wave in the ECG data of multiple channels from smallest to largest, and to construct an initial noise figure curve based on the sorted noise figures.
[0234] The segmentation threshold determination unit is used to determine the second threshold based on the initial noise figure curve;
[0235] The normalization processing unit is used to normalize the initial noise figure curve using the second threshold as the dividing line, so as to obtain the normalized noise figure curve.
[0236] The noise level calculation unit is used to calculate the noise level value of each channel based on the normalized noise figure curve.
[0237] In one implementation of this application, the segmentation line threshold determination unit includes:
[0238] The curve is used as a sub-unit to calculate the difference between the initial noise figure curve and the translated noise figure curve, thus obtaining the difference noise figure curve; wherein, the translated noise figure curve is obtained by translating the initial noise figure curve.
[0239] The segmentation threshold determination sub-unit is used to determine the second threshold based on the peak value in the difference noise figure curve.
[0240] In one implementation of this application, the segmentation line threshold determination subunit includes:
[0241] The first threshold determination subunit is used to select a first peak from the peaks with amplitudes greater than the third threshold if there are peaks with amplitudes greater than the third threshold in the horizontal coordinate range of the last m% of the difference noise figure curve, and determine the noise figure corresponding to the first peak as the second threshold.
[0242] The second threshold determination subunit is used to select the second peak with the largest amplitude from the peaks with amplitudes less than or equal to the third threshold if there are peaks with amplitudes less than or equal to the third threshold in the horizontal coordinate range of the last m% of the difference noise figure curve, and to determine the noise figure corresponding to the second peak as the second threshold.
[0243] The third threshold determination subunit is used to select the third peak with the largest amplitude from the peaks in the last m% of the horizontal axis range if there are no peaks in the last m% of the horizontal axis range of the difference noise figure curve, and the noise figure corresponding to the third peak is determined as the second threshold, where n>m.
[0244] The fourth threshold determination subunit is used to determine the noise figure corresponding to the starting point of the last m% of the horizontal coordinate range of the difference noise figure curve as the second threshold if there is no peak in the last n% of the horizontal coordinate range of the difference noise figure curve.
[0245] In one implementation of this application, the R-wave detection module includes:
[0246] The RR interval parameter determination unit is used to determine the RR interval parameter corresponding to the target R wave whose noise figure meets the preset condition if at least one channel of the ECG data in the multiple channels corresponding to the sampling point has an R wave with a noise figure that meets the preset condition, and the ratio of the number of target channels in the other channels besides the at least one channel to the number of channels is greater than a first threshold.
[0247] The effectiveness detection unit is used to determine whether the target R wave is effective based on the RR interval parameter;
[0248] The R-wave location determination unit is used to determine the location of the sampling point where an R-wave exists if the target R-wave is valid.
[0249] In one implementation of this application, the RR interval parameter includes the average RR interval, the current RR interval, the previous RR interval, and an RR interval rule status identifier; the validity detection unit includes:
[0250] The first validity detection subunit is used to determine the validity of the target R wave if the RR interval regularity is identified as the RR interval irregularity.
[0251] The second validity detection subunit is used to determine that the target R wave is valid if the RR interval regularity is identified as RR interval regularity and the previous RR interval is greater than or equal to the first product. The first product is the product of the average RR interval and the first value.
[0252] The third validity detection subunit is used to determine the target R wave is valid if the RR interval regularity is identified as RR interval regularity, the previous RR interval is less than the first product, and the average value of the previous RR interval and the current RR interval is between the first product and the second product. The second product is the product of the average RR interval and the second value, and the second value is greater than the first value.
[0253] The fourth validity detection subunit is used to determine the target R wave as valid if the RR interval regularity is identified as RR interval regularity, the previous RR interval is less than the first product, and the current RR interval is between the first product and the second product.
[0254] The fifth validity detection subunit is used to determine the target R wave as valid if the RR interval rule is identified as RR interval rule, the previous RR interval is less than the first product, and the previous RR interval is between the third product and the fourth product. The third product is the product of the current RR interval and the first value, and the fourth product is the product of the current RR interval and the second value.
[0255] In one implementation of this application, the RR interval parameter determination unit includes:
[0256] The pre-analysis result acquisition subunit is used to acquire the pre-analysis R-wave position detection result if the number of currently identified R waves is less than the fourth threshold. The pre-analysis R-wave position detection result is obtained by performing R-wave position detection on preprocessed ECG data. The preprocessed ECG data is the ECG data obtained after preprocessing the original ECG data.
[0257] The first average RR interval calculation subunit is used to calculate the average value of multiple RR intervals contained in the pre-analysis R-wave position detection results to obtain the average RR interval;
[0258] The first current RR interval calculation subunit is used to calculate the interval between the target R wave and the last R wave among the currently identified R waves, which is used as the current RR interval.
[0259] The first preceding RR interval calculation subunit is used to calculate the interval between the last R wave and the penultimate R wave among the identified R waves, which is used as the preceding RR interval.
[0260] The first RR interval regularity identification sub-unit is used to identify the RR interval regularity as irregular if the difference between any two RR intervals in the pre-analysis R-wave position detection results is greater than the fifth threshold; otherwise, it is identified as regular.
[0261] In another implementation of this application embodiment, the RR interval parameter determination unit includes:
[0262] The second average RR interval calculation subunit is used to calculate the average of multiple RR intervals contained in the currently determined R waves if the number of currently determined R waves is greater than or equal to the fourth threshold, and obtain the average RR interval.
[0263] The second current RR interval calculation subunit is used to calculate the interval between the target R wave and the last R wave among the currently identified R waves, which is used as the current RR interval.
[0264] The second preceding RR interval calculation subunit is used to calculate the interval between the last R wave and the penultimate R wave among the identified R waves, which is used as the preceding RR interval.
[0265] The second RR interval rule status identification sub-unit is used to identify the RR interval rule status as irregular if the difference between any two RR intervals in the multiple RR intervals contained in the currently identified R wave is greater than the fifth threshold; otherwise, it is identified as regular.
[0266] In one implementation of this application, the R-wave detection device for electrocardiogram data further includes:
[0267] The preprocessed ECG data acquisition module is used to acquire preprocessed ECG data, which is ECG data obtained after preprocessing the original ECG data.
[0268] The abnormal data time period determination module is used to determine the abnormal data time period based on the preprocessed ECG data;
[0269] The ECG data removal module is used to remove ECG data that falls outside the abnormal data time period from the original ECG data.
[0270] In one implementation of this application, the abnormal data time period determination module includes:
[0271] The scatter plot conversion unit is used to convert preprocessed ECG data into corresponding scatter plots.
[0272] The first abnormal heartbeat identification unit is used to identify the first abnormal heartbeat in the scatter plot based on the dilatational erosion algorithm.
[0273] The first abnormal data time period determination unit is used to determine the signal segment corresponding to the first abnormal heartbeat in the preprocessed electrocardiogram data as the abnormal data time period;
[0274] The time scatter plot conversion unit is used to convert preprocessed ECG data into corresponding time scatter plots;
[0275] The second abnormal heartbeat identification unit is used to identify the second abnormal heartbeat in the time scatter plot based on the sample entropy algorithm.
[0276] The second abnormal data time period determination unit is used to determine the signal segment corresponding to the second abnormal heartbeat in the preprocessed electrocardiogram data as the abnormal data time period;
[0277] The histogram conversion unit is used to convert preprocessed ECG data into corresponding histograms;
[0278] The third abnormal heartbeat identification unit is used to identify the third abnormal heartbeat in the histogram based on the confidence interval method.
[0279] The third abnormal data time period determination unit is used to determine the signal segment corresponding to the third abnormal heartbeat in the preprocessed electrocardiogram data as the abnormal data time period.
[0280] In another implementation of this application embodiment, the abnormal data time period determination module includes:
[0281] The ECG data display conversion unit is used to convert preprocessed ECG data into corresponding ECG data display graphs.
[0282] The abnormal heartbeat determination unit is used to determine the fourth abnormal heartbeat selected by the user based on the ECG data display diagram;
[0283] The fourth abnormal data time period determination unit is used to determine the signal segment corresponding to the fourth abnormal heartbeat in the preprocessed electrocardiogram data as the abnormal data time period.
[0284] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the R-wave detection method for electrocardiogram data as described in any of the above embodiments.
[0285] This application also provides a computer program product that, when run on an electronic device, causes the electronic device to perform an R-wave detection method for electrocardiogram data as described in any of the above embodiments.
[0286] Figure 16 This is a schematic diagram of an electronic device provided in an embodiment of this application. Figure 16 As shown, the electronic device 16 of this embodiment includes: a processor 160, a memory 161, and a computer program 162 stored in the memory 161 and executable on the processor 160. When the processor 160 executes the computer program 162, it implements the steps in the embodiments of the various ECG data R-wave detection methods described above, for example... Figure 1 Steps 101 to 103 are shown. Alternatively, when the processor 160 executes the computer program 162, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 15 The functions of modules 1501 to 1503 are shown.
[0287] The computer program 162 can be divided into one or more modules / units, which are stored in the memory 161 and executed by the processor 160 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 162 in the electronic device 16.
[0288] The processor 160 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0289] The memory 161 can be an internal storage unit of the electronic device 16, such as a hard disk or memory of the electronic device 16. The memory 161 can also be an external storage device of the electronic device 16, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the electronic device 16. Furthermore, the memory 161 can include both internal and external storage units of the electronic device 16. The memory 161 is used to store the computer program and other programs and data required by the electronic device. The memory 161 can also be used to temporarily store data that has been output or will be output.
[0290] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0291] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0292] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0293] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0294] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0295] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0296] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0297] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0298] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for detecting the R wave in electrocardiogram (ECG) data, characterized in that, include: Acquire raw electrocardiogram (ECG) data, which includes ECG data from multiple channels corresponding to each sampling point collected at multiple sampling points; The noise figure of each R wave in the ECG data of the multiple channels is calculated respectively. The noise figure is used to represent the degree of signal interference to the corresponding R wave. For each sampling point, if at least one channel of the ECG data in the plurality of channels corresponding to the sampling point has an R-wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels besides the at least one channel to the number of the plurality of channels is greater than a first threshold, then it is determined that an R-wave exists at the location of the sampling point; wherein, the ECG data of the target channel has an R-wave with a noise figure that meets the preset condition within the time range determined according to the sampling point.
2. The method as described in claim 1, characterized in that, The calculation of the noise figure of each R wave in the ECG data of the multiple channels includes: Obtain the pre-analysis R-wave position detection result; wherein, the pre-analysis R-wave position detection result is obtained by performing R-wave position detection on preprocessed ECG data, and the preprocessed ECG data is ECG data obtained after preprocessing the original ECG data; Based on each R-wave vertex in the pre-analysis R-wave position detection results, construct each time segment that corresponds one-to-one with each R-wave vertex. For each time segment, based on the signal change characteristics of the ECG data of each channel within the time segment, the noise figure of the R wave of the ECG data of each channel within the time segment is calculated respectively.
3. The method as described in claim 2, characterized in that, The step of calculating the noise figure of the R wave of the ECG data of each channel within the time segment based on the signal change characteristics of the ECG data of each channel within the time segment includes: For each channel, multiple signal values of the ECG data of the channel are calculated within the time segment and differentially processed to obtain the absolute value; the integral of the absolute value is calculated within the time segment and the mean of the integral is calculated as the noise figure of the R wave of the ECG data of the channel within the time segment.
4. The method as described in claim 1, characterized in that, After calculating the noise figure of each R wave in the ECG data of the multiple channels respectively, before determining that an R wave exists at the location of the sampling point for each sampling point, if at least one channel in the ECG data of the multiple channels corresponding to the sampling point has an R wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels besides the at least one channel to the total number of channels is greater than a first threshold, the method further includes: Based on the noise coefficient of each R wave in the ECG data of the multiple channels, calculate the noise level value of each channel respectively; Remove the ECG data from a set number of channels with the highest noise level among the multiple channels.
5. The method as described in claim 4, characterized in that, The step of calculating the noise level value for each of the multiple channels based on the noise coefficient of each R wave in the ECG data includes: The noise coefficients of each R wave in the ECG data of the multiple channels are sorted from smallest to largest, and an initial noise coefficient curve is constructed based on the sorted noise coefficients. Determine the second threshold based on the initial noise figure curve; Using the second threshold as the threshold for the dividing line, the initial noise figure curve is normalized to obtain the normalized noise figure curve. Based on the normalized noise figure curve, the noise level value of each channel is calculated.
6. The method as described in claim 5, characterized in that, Determining the second threshold based on the initial noise figure curve includes: The difference between the initial noise figure curve and the translated noise figure curve is calculated to obtain the difference noise figure curve; wherein, the translated noise figure curve is obtained by translating the initial noise figure curve. The second threshold is determined based on the peak value in the difference noise figure curve.
7. The method as described in claim 6, characterized in that, The horizontal axis of the initial noise figure curve represents each R wave in the ECG data of the multiple channels, and the vertical axis of the initial noise figure curve represents the noise figure of each R wave in the ECG data of the multiple channels. Determining the second threshold based on the peak value in the difference noise figure curve includes: If there is a peak with an amplitude greater than the third threshold in the horizontal axis range of the last m% of the difference noise figure curve, then select a first peak from the peaks with amplitude greater than the third threshold, and determine the noise figure corresponding to the first peak as the second threshold. If there is a peak with an amplitude less than or equal to the third threshold in the horizontal axis range of the last m% of the difference noise figure curve, then select the second peak with the largest amplitude from the peaks with amplitude less than or equal to the third threshold, and determine the noise figure corresponding to the second peak as the second threshold. If there are no peaks in the last m% of the horizontal axis range of the difference noise figure curve, and there are peaks in the last n% of the horizontal axis range of the difference noise figure curve, then select the third peak with the largest amplitude from the peaks in the last n% of the horizontal axis range, and determine the noise figure corresponding to the third peak as the second threshold, where n > m; If there is no peak value in the last n% of the horizontal axis range of the difference noise figure curve, then the noise figure corresponding to the starting point of the last m% of the horizontal axis range of the difference noise figure curve is determined as the second threshold.
8. The method as described in claim 1, characterized in that, If at least one channel of the ECG data corresponding to the sampling point has an R-wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels (excluding the at least one channel) to the total number of channels is greater than a first threshold, then it is determined that an R-wave exists at the location of the sampling point, including: If at least one channel of the ECG data corresponding to the sampling point has an R wave with a noise figure that meets a preset condition, and the ratio of the number of target channels in the other channels besides the at least one channel to the total number of channels is greater than a first threshold, then the RR interval parameter corresponding to the target R wave with a noise figure that meets the preset condition is determined. Based on the RR interval parameters, determine whether the target R wave is effective; If the target R-wave is valid, then it is determined that an R-wave exists at the location of the sampling point.
9. The method as described in claim 8, characterized in that, The RR interval parameters include the average RR interval, the current RR interval, the previous RR interval, and an RR interval rule identifier; determining whether the target R-wave is valid based on the RR interval parameters includes: If the RR interval regularity is identified as RR interval irregularity, then the target R wave is determined to be valid; If the RR interval rule is identified as an RR interval rule, and the previous RR interval is greater than or equal to the first product, then the target R wave is determined to be valid. The first product is the product of the average RR interval and the first value. If the RR interval rule is identified as an RR interval rule, the previous RR interval is less than the first product, and the average value of the previous RR interval and the current RR interval is between the first product and the second product, then the target R wave is determined to be valid. The second product is the product of the average RR interval and the second value, and the second value is greater than the first value. If the RR interval rule is identified as RR interval rule, the previous RR interval is less than the first product, and the current RR interval is between the first product and the second product, then the target R wave is determined to be valid. If the RR interval rule is identified as an RR interval rule, the previous RR interval is less than the first product, and the previous RR interval is between the third product and the fourth product, then the target R wave is determined to be valid. The third product is the product of the current RR interval and the first value, and the fourth product is the product of the current RR interval and the second value.
10. The method as described in claim 9, characterized in that, The step of determining the RR interval parameter corresponding to the target R wave whose noise figure of the ECG data of at least one channel meets the preset conditions includes: If the number of R waves currently identified is less than the fourth threshold, then the pre-analysis R wave position detection result is obtained; wherein, the pre-analysis R wave position detection result is obtained by performing R wave position detection on preprocessed ECG data, and the preprocessed ECG data is the ECG data obtained after preprocessing the original ECG data; The average RR interval is obtained by calculating the average of multiple RR intervals contained in the pre-analysis R-wave position detection results; Calculate the interval between the target R-wave and the last R-wave among the currently identified R-waves, and use it as the current RR interval; Calculate the interval between the last R wave and the penultimate R wave among the identified R waves, and use it as the preceding RR interval; If the difference between any two RR intervals in the multiple RR intervals included in the pre-analysis R-wave position detection result is greater than the fifth threshold, then the RR interval regularity case is identified as RR interval irregularity; otherwise, the RR interval regularity case is identified as RR interval regularity.
11. The method as described in claim 9, characterized in that, The step of determining the RR interval parameter corresponding to the target R wave whose noise figure of the ECG data of at least one channel meets the preset conditions includes: If the number of currently identified R waves is greater than or equal to the fourth threshold, then the average value of the multiple RR intervals contained in the currently identified R waves is calculated to obtain the average RR interval; Calculate the interval between the target R-wave and the last R-wave among the currently identified R-waves, and use it as the current RR interval; Calculate the interval between the last R wave and the penultimate R wave among the identified R waves, and use it as the preceding RR interval; If the difference between any two RR intervals among the multiple RR intervals contained in the currently determined R wave is greater than the fifth threshold, then the RR interval regularity case is identified as RR interval irregularity; otherwise, the RR interval regularity case is identified as RR interval regularity.
12. The method according to any one of claims 1 to 11, characterized in that, Before calculating the noise figure of each R wave in the ECG data of the plurality of channels, the method further includes: Acquire preprocessed electrocardiogram (ECG) data, wherein the preprocessed ECG data is ECG data obtained after preprocessing the original ECG data; Based on the preprocessed ECG data, the time period of abnormal data is determined; Remove ECG data that falls outside the time period of the abnormal data from the original ECG data.
13. The method as described in claim 12, characterized in that, The step of determining the time period of abnormal data based on the preprocessed electrocardiogram data includes: The preprocessed ECG data is converted into a corresponding scatter plot. The first abnormal heartbeat in the scatter plot was identified based on the dilatational erosion algorithm. The signal segment corresponding to the first abnormal heartbeat in the preprocessed electrocardiogram data is determined as the abnormal data time period; or, The preprocessed ECG data is converted into a corresponding time scatter plot; The second abnormal heartbeat in the time scatter plot was identified based on the sample entropy algorithm. The signal segment corresponding to the second abnormal heartbeat in the preprocessed electrocardiogram data is determined as the abnormal data time period; or, The preprocessed electrocardiogram data is converted into a corresponding histogram; The third abnormal heartbeat in the histogram is identified using a confidence interval-based method; The signal segment corresponding to the third abnormal heartbeat in the preprocessed electrocardiogram data is determined as the abnormal data time period.
14. The method as described in claim 12, characterized in that, The step of determining the time period of abnormal data based on the preprocessed electrocardiogram data includes: The preprocessed ECG data is converted into a corresponding ECG data display chart; Determine the fourth abnormal heartbeat selected by the user based on the ECG data display diagram; The signal segment corresponding to the fourth abnormal heartbeat in the preprocessed electrocardiogram data is determined as the abnormal data time period.
15. A device for detecting R-waves in electrocardiogram (ECG) data, characterized in that, include: An electrocardiogram (ECG) data acquisition module is used to acquire raw ECG data, which includes ECG data from multiple channels corresponding to each of the multiple sampling points. The noise figure calculation module is used to calculate the noise figure of each R wave in the ECG data of the multiple channels respectively. The noise figure is used to represent the degree of signal interference received by the corresponding R wave. The R-wave detection module is used to determine that an R-wave exists at the location of the sampling point if, for each sampling point, at least one channel of the ECG data in the plurality of channels corresponding to the sampling point has an R-wave with a noise coefficient that meets a preset condition, and the ratio of the number of target channels in the other channels besides the at least one channel to the total number of channels is greater than a first threshold; wherein, the ECG data of the target channel has an R-wave with a noise coefficient that meets the preset condition within a time range determined according to the sampling point.
16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the R-wave detection method for electrocardiogram data as described in any one of claims 1 to 14.
17. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the R-wave detection method for electrocardiogram data as described in any one of claims 1 to 14.
Citation Information
Patent Citations
QRS wave group verification method of multiple-lead electrocardiosignal, device thereof, equipment and medium
CN109009084A
Electrocardiosignal R-wave detection method and system
CN109009085A