Electrocardiosignal processing method and device, electronic equipment and storage medium
By preprocessing the ECG signal and updating the standard heart beat template, the problems of insufficient database data and motion artifact interference in the existing technology are solved, and the accuracy of premature ventricular contraction detection is improved.
Patent Information
- Application Number
- CN202410561094.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2024-09-06
AI Technical Summary
Existing methods for detecting premature ventricular contractions based on deep neural networks are difficult to ensure detection accuracy when the amount of database data is insufficient, and are susceptible to heartbeat interference from motion artifacts.
By preprocessing the ECG signal, a standard heartbeat template is determined, and the template is used to filter out motion artifact heartbeats and update the RR interval, thereby improving the accuracy of premature ventricular contraction detection.
It improves the quality of ECG data, reduces the impact of missing data and baseline drift on detection, avoids the interference of motion artifacts on detection, and improves the accuracy of premature ventricular contraction detection.
Smart Images

Figure CN118592971A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of bioelectric signal processing, and in particular to an electrocardiogram signal processing method, device, electronic device and storage medium. Background Art
[0002] Ventricular Premature Contractions (VPCs) have become the most common arrhythmia in clinical practice. They are not only closely related to a variety of cardiovascular diseases with great harm, but also the clinical manifestation of some cardiovascular diseases, which seriously affects the daily life and work of patients. Its diagnosis mainly depends on electrocardiogram or dynamic electrocardiogram monitoring. Therefore, early detection of ventricular premature contractions based on electrocardiogram signals is very critical.
[0003] At present, when detecting ventricular premature beats based on ECG signals, deep neural network models can be used to automatically extract features from the ECG, and ventricular premature beats can be identified based on the extracted features. However, deep neural network models require a large number of databases for model training, and the effect of ventricular premature beat detection is closely related to the data size of the database. The database may not cover all ventricular premature beat waveforms, and the workload of constructing the database is huge. If the amount of data in the database is insufficient, it is difficult to ensure the accuracy of ventricular premature beat detection. Summary of the invention
[0004] The present application provides an electrocardiogram (ECG) signal processing method, device, electronic device, and storage medium, which can achieve accurate detection of ventricular premature beats by processing ECG signal data.
[0005] In a first aspect, a method for processing an electrocardiogram signal is provided, comprising:
[0006] Acquire an ECG signal of a target object, and pre-process the ECG signal to obtain ECG signal waveform information, wherein the ECG signal waveform information includes at least a plurality of first RR intervals and a plurality of first heart beat data corresponding to a plurality of first heart beats;
[0007] determining a first standard heart beat template in the electrocardiogram signal based on the electrocardiogram signal waveform information;
[0008] Using a first standard heart beat template to screen out motion artifact heart beats from a plurality of first heart beats, and determining a second RR interval after the motion artifact heart beats are screened out;
[0009] The first standard heart beat template is updated by using the second RR interval, and the ventricular premature beat detection is performed on the electrocardiogram signal by using the updated second standard heart beat template to obtain the detection result of the ventricular premature beat corresponding to the target object.
[0010] In a second aspect, an electrocardiogram signal processing device is provided, comprising:
[0011] A processing module, used for acquiring an ECG signal of a target object and preprocessing the ECG signal to obtain ECG signal waveform information, wherein the ECG signal waveform information at least includes a plurality of first RR intervals and a plurality of first heart beat data corresponding to a plurality of first heart beats;
[0012] A determination module, configured to determine a first standard heart beat template in the electrocardiogram signal based on the electrocardiogram signal waveform information;
[0013] A screening module, used for screening out motion artifact heart beats from a plurality of first heart beats using a first standard heart beat template, and determining a second RR interval after screening out the motion artifact heart beats;
[0014] The detection module is used to update the first standard heart beat template using the second RR interval, and to detect ventricular premature beats on the electrocardiogram signal using the updated second standard heart beat template to obtain a detection result of the ventricular premature beats corresponding to the target object.
[0015] According to a third aspect, an electronic device is provided, comprising: a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect or its various implementations.
[0016] According to a fourth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method according to the first aspect or its various implementations.
[0017] Through the technical solution provided by the present application, after acquiring the ECG signal of the target object, the ECG signal can be preprocessed to obtain the ECG signal waveform information; then, based on the ECG signal waveform information, a first standard heartbeat template is determined in the ECG signal, and the first standard heartbeat template is used to screen out motion artifact heartbeats in multiple first heartbeats, and the second RR interval after screening out motion artifact heartbeats is determined; then, the first standard heartbeat template is updated using the second RR interval, and the ECG signal is detected for ventricular premature beats using the updated second standard heartbeat template to obtain the detection result of the target object's corresponding ventricular premature beats. The technical solution disclosed in the present disclosure can improve the quality of ECG data by preprocessing the ECG signal, and reduce the impact of data missing and baseline drift on ventricular premature beat detection. By selecting and updating the standard heartbeat template, motion artifact heartbeats can be screened out to ensure the accuracy of the selected standard heartbeat template. Using the modified standard heartbeat template to detect ventricular premature beats can avoid the interference of irrelevant factors such as motion artifact heartbeats on the detection of ventricular premature beats, and can improve the detection accuracy of ventricular premature beats.
[0018] It should be understood that the above general description and the following detailed description are only exemplary and explanatory and cannot limit the present application. Other features and advantages of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 An application scenario diagram provided for an embodiment of the present application;
[0021] Figure 2 A flowchart of an electrocardiogram signal processing method provided in an embodiment of the present application;
[0022] Figure 3 A flowchart of an electrocardiogram signal processing method provided in another embodiment of the present application;
[0023] Figure 4 A schematic diagram of the structure of an electrocardiogram signal processing device provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] At present, when detecting ventricular premature beats based on ECG signals, deep neural network models can be used to automatically extract features from the ECG, and ventricular premature beats can be identified based on the extracted features. However, deep neural network models require a large number of databases for model training, and the effect of ventricular premature beat detection is closely related to the data size of the database. The database may not cover all ventricular premature beat waveforms, and the workload of constructing the database is huge. If the amount of data in the database is insufficient, it is difficult to ensure the accuracy of ventricular premature beat detection.
[0028] In order to solve the above technical problems, the inventive concept of the present invention is: a new type of ventricular premature beats beat-by-beat rapid detection method is proposed, and its key technology can be used for intelligent auxiliary diagnosis of ventricular premature beats in electrocardiographs. The method generally consists of four parts: ECG signal preprocessing method, adaptive standard heart beat template setting, ECG signal re-segmentation and ventricular premature beat heart beat positioning. First, the ECG signal is preprocessed to obtain ECG signal waveform information. The preprocessing may include digital filtering processing, ECG RR interval segmentation processing, and screening processing of available data segments corresponding to each heart beat. Through the preprocessing process, the quality of ECG data can be improved, and the influence of data loss and baseline drift on ventricular premature beat detection can be reduced. Secondly, the standard heart beat template is selected from multiple heart beats, so as to detect ventricular premature beats based on the selected standard heart beat template; afterwards, considering that the wfdb toolkit is easily affected by motion artifacts when capturing the R peak, it leads to the wrong capture of the R peak, thereby affecting the RR interval and affecting subsequent work. Therefore, the present invention aims at this problem, adopts RR interval to filter motion artifact heartbeat, recalculates RR interval, that is, re-segments the electrocardiogram signal; finally, based on the RR interval of all heartbeats after recalculation, the standard heartbeat template can be reset, and the ventricular premature beat heartbeat location can be performed using the reset standard heartbeat template. Using the corrected standard heartbeat template to perform ventricular premature beat detection can avoid the interference of non-related factors such as motion artifact heartbeat on ventricular premature beat detection, and can improve the detection accuracy of ventricular premature beat.
[0029] It should be understood that the technical solution of the present invention can be applied to the following scenarios, but is not limited to:
[0030] In some possible implementations, Figure 1 An application scenario diagram provided by an embodiment of the present invention, such as Figure 1 As shown, the application scenario may include an electronic device 110 and a network device 120. The electronic device 110 may establish a connection with the network device 120 via a wired network or a wireless network.
[0031] Exemplarily, the electronic device 110 may be a desktop computer, a laptop computer, a tablet computer, etc., but is not limited thereto. The network device 120 may be a terminal device or a server, but is not limited thereto. In one embodiment of the present invention, the electronic device 110 may send a request message to the network device 120, and the request message may be used to request to obtain a ventricular premature beat detection result corresponding to the electrocardiogram signal. Further, the electronic device 110 may receive a response message sent by the network device 120, and the response message includes a ventricular premature beat detection result corresponding to the electrocardiogram signal data.
[0032] also, Figure 1 An electronic device 110 and a network device 120 are provided as an example, but other numbers of electronic devices and network devices may be included in practice, and the present invention is not limited thereto.
[0033] In some other possible implementations, the technical solution of the present invention may also be executed by the above-mentioned electronic device 110, or the technical solution of the present invention may also be executed by the above-mentioned network device 120, and the present invention does not limit this.
[0034] After introducing the application scenarios of the embodiments of the present invention, the technical solutions of the present invention will be described in detail below:
[0035] Figure 2 A flowchart of an electrocardiogram signal processing method provided by an embodiment of the present invention, the method can be as follows Figure 1 The electronic device 110 shown in the figure performs, but is not limited to this. Figure 2 As shown, the method may include the following steps:
[0036] Step 210: Acquire the ECG signal of the target object, and pre-process the ECG signal to obtain ECG signal waveform information, wherein the ECG signal waveform information at least includes a plurality of first RR intervals and a plurality of first heart beat data corresponding to a plurality of first heart beats.
[0037] Among them, the target object is a biological body that can generate an electrocardiogram signal and can detect ventricular premature beats based on the electrocardiogram signal data based on the technical solution in this application, such as a human body, an animal body, etc. In the following embodiments of this application, the target object is a human body to be detected for ventricular premature beats as an example to illustrate the technical solution in this application, but it does not constitute a specific limitation; the electrocardiogram signal refers to the heart electrical activity signal recorded by a medical device. The electrocardiogram signal is usually obtained by an electrocardiogram (ECG) device and can reflect the electrical activity of the heart. By analyzing the electrocardiogram signal, the electrophysiological function of the heart can be understood, so as to accurately diagnose and treat heart diseases. The electrocardiogram signal is usually presented in a graphical form, and its features include P wave, QRS complex, T wave, S wave, R wave, etc. The changes in these features can be used to determine the type and severity of heart disease; the preprocessing of the electrocardiogram signal can at least include digital filtering processing, electrocardiogram RR interval segmentation processing, and screening processing of available data segments corresponding to each heart beat. Through the preprocessing process, the quality of ECG data can be improved and the impact of data missing and baseline drift on ventricular premature beat detection can be reduced.
[0038] The heartbeat of an ECG signal refers to the electrical activity of the heart that is manifested as a complete wave cycle on the ECG. This cycle consists of a P wave, a QRS complex, an ST segment, and a T wave, and each part corresponds to a stage of the heartbeat. The cycle of each heartbeat reflects the electrical activity state of the heart, including the processes of the heart's excitation, conduction, and repolarization. Therefore, the heartbeat is the basic unit of ECG analysis and is of great significance for diagnosing heart diseases. The first heartbeat is all the heartbeats contained in the ECG signal corresponding to the target object. The first RR interval is the RR interval obtained after the ECG RR interval segmentation processing is performed on the ECG signal of the target object. The ECG RR interval segmentation processing is used to estimate and calculate the first RR interval in the ECG signal by capturing the first R peak position on the ECG signal and using the first R peak position. The first RR interval refers to the distance between two adjacent R waves, or in layman's terms, the interval between two heartbeats. Heartbeat data refers to the available data segment with diagnostic value contained in each heartbeat recorded on the ECG. This information includes the shape, amplitude, frequency, time interval and other characteristics of the heartbeat, as well as the relationship and change pattern between them, which helps to analyze the electrical activity of the heart in more detail and accurately. The first heartbeat data is the available data segment extracted corresponding to the first heartbeat. When the ECG signal contains N first heartbeats, the ECG signal waveform information may include N first RR intervals and N first heartbeat data corresponding to the N first heartbeats.
[0039] Step 220: Determine a first standard heart beat template in the ECG signal based on the ECG signal waveform information.
[0040] The first standard heart beat template is an idealized, standardized first heart beat, and its corresponding electrocardiogram waveform is representative and can be used to identify abnormalities or diseases. For the disclosed embodiment, the sum of deviations between each first heart beat and other first heart beats among multiple first heart beats can be calculated, and then the first heart beat with the smallest sum of deviations is selected as the first standard heart beat template.
[0041] Step 230: Use the first standard heart beat template to filter out motion artifact heart beats from a plurality of first heart beats, and determine the second RR interval after the motion artifact heart beats are filtered out.
[0042] Among them, motion artifact heartbeat refers to the interference waveform generated by the target subject's body movement during the ECG recording process. Motion artifact heartbeat may appear as irregular waveform, baseline drift, amplitude change or other abnormal characteristics. These abnormal characteristics may interfere with or simulate the electrical activity of the heart, resulting in abnormal ECG waveform or misleading interpretation.
[0043] For the disclosed embodiment, in order to reduce the influence of motion artifact heartbeats, motion artifact heartbeats can be located and screened out in multiple first heartbeats based on the first standard heartbeat template, further improving the accuracy of the electrocardiogram and reducing the interference of these interfering waveforms on the detection of ventricular premature beats. After the motion artifact heartbeats are screened out in multiple first heartbeats, since the adjacent R waves corresponding to the retained first heartbeats may change, the second RR interval after the motion artifact heartbeats are screened out can be recalculated based on the changed R waves.
[0044] Step 240: Use the second RR interval to update the first standard heart beat template, and use the updated second standard heart beat template to detect ventricular premature beats on the electrocardiogram signal to obtain a detection result of the ventricular premature beats corresponding to the target object.
[0045] In a specific application scenario, after the RR interval is updated, the standard heart beat template will also change. Therefore, for the disclosed embodiment, in order to ensure the accuracy of the standard heart beat template, the second RR interval can be used to re-set the standard heart beat template, that is, the first standard heart beat template is updated to the second standard heart beat template. After that, the revised second standard heart beat template is used to detect ventricular premature beats, which can avoid the interference of non-related factors such as motion artifact heartbeats on the detection of ventricular premature beats, and can improve the detection accuracy of ventricular premature beats. Among them, the detection result of ventricular premature beats can correspond to the absence of ventricular premature beats or the presence of ventricular premature beats, and when it is judged that there are ventricular premature beats, the heartbeat where the ventricular premature beats are located can also be output accordingly.
[0046] In summary, according to the ECG signal processing method provided by the present invention, after acquiring the ECG signal of the target object, the ECG signal can be preprocessed to obtain the ECG signal waveform information; then, based on the ECG signal waveform information, a first standard heartbeat template is determined in the ECG signal, and the first standard heartbeat template is used to screen out motion artifact heartbeats in multiple first heartbeats, and the second RR interval after screening out motion artifact heartbeats is determined; then, the first standard heartbeat template is updated using the second RR interval, and the ECG signal is detected for ventricular premature beats using the updated second standard heartbeat template to obtain the detection result of the ventricular premature beats corresponding to the target object. The technical solution disclosed in the present invention can improve the quality of ECG data by preprocessing the ECG signal, and reduce the influence of data missing and baseline drift on the detection of ventricular premature beats. By selecting and updating the standard heartbeat template, motion artifact heartbeats can be screened out to ensure the accuracy of the selected standard heartbeat template. Using the modified standard heartbeat template to detect ventricular premature beats can avoid the interference of irrelevant factors such as motion artifact heartbeats on the detection of ventricular premature beats, and can improve the detection accuracy of ventricular premature beats.
[0047] based on Figure 2 The embodiment shown is a refinement and extension of the above embodiment. In order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 3 The specific method shown. Figure 3 based on Figure 2 In the embodiment shown, step 220 is further defined. Figure 2 In the illustrated embodiment, step 220 includes steps 320 to 340. As shown in Figure 3, the method includes the following steps:
[0048] Step 310: Acquire the ECG signal of the target object, and pre-process the ECG signal to obtain ECG signal waveform information, wherein the ECG signal waveform information at least includes a plurality of first RR intervals and a plurality of first heart beat data corresponding to a plurality of first heart beats.
[0049] For the embodiment of the present disclosure, preprocessing the ECG signal in step 310 to obtain ECG signal waveform information may include the following steps:
[0050] Step 310 - 1 : Perform digital filtering processing on the ECG signal using a bandpass filter to obtain a target ECG signal whose corresponding frequency distribution is within a preset cutoff frequency interval.
[0051] In a specific application scenario, the ECG signal can be a 10-second ECG signal with a sampling frequency of 500Hz. After acquiring the ECG signal of the target object, a 5th-order Butterworth bandpass filter can be used to digitally filter the ECG signal. Specifically, the preset cutoff frequency interval can be set to retain the target ECG signal within the preset cutoff frequency interval in the ECG signal. Considering that the main frequency distribution of the ECG signal is between 0-40Hz, the frequency range of the ST segment is 0.7-2Hz, the frequency range of the P wave and the T wave is 0.7-10Hz, and the baseline drift frequency is between the 0.05-1Hz frequency band, the lower limit of the cutoff frequency of the preset cutoff frequency interval can be set to 0.85Hz, and the upper limit of the cutoff frequency can be set to 40Hz, that is, the preset cutoff frequency interval is [0.85Hz, 40Hz].
[0052] Step 310 - 2 : Identify multiple first R peak positions corresponding to multiple first heart beats in the target electrocardiogram signal.
[0053] For the disclosed embodiment, the target ECG signal may be processed for ECG RR interval segmentation. When the ECG RR interval segmentation is performed, the wfdb.processing.gqrs_detect function may be used to traverse leads I, II, III or leads II, III in the target ECG signal to obtain multiple first R peak positions contained in the ECG signal.
[0054] Step 310 - 3 : Calculate a plurality of first RR intervals in the target electrocardiogram signal based on adjacent R peak positions among the plurality of first R peak positions, and calculate an RR interval average value of the plurality of first RR intervals.
[0055] Since the RR interval refers to the distance between two adjacent R waves, after determining the multiple first R peak positions contained in the target ECG signal, the distance between two adjacent R waves can be calculated based on the adjacent R peak positions in the multiple first R peak positions, and the distance can be used as the first RR interval in the target ECG signal. In this way, all the first RR intervals contained in the target ECG signal can be obtained. Specifically, the adjacent R peak positions in the multiple first R peak positions can be substituted into the RR interval calculation formula to obtain the calculation result of the first RR interval.
[0056] Among them, the formula characteristics of the RR interval calculation formula are described as follows:
[0057] RR_interval (i) =R_index (i+1) -R_index (i)
[0058] Where, RR_interval (i) is the first RR interval of the i-th period, R_index (i+1)is the position of the first R peak at the i+1th position, R_index (i) is the position of the i-th first R peak.
[0059] After all the first RR intervals included in the target electrocardiogram signal are calculated, a preset average value calculation formula may be used to calculate the RR interval average value of multiple first RR intervals in the target electrocardiogram signal.
[0060] The formula characteristic description of the preset average value calculation formula is:
[0061]
[0062] In the formula, is the average value of the RR interval, n is the total number of beats of the target ECG signal, that is, the number of the first R peak, RR_interval (i) is the i-th first RR interval.
[0063] Step 310 - 4 : Determine first heart beat data corresponding to each first heart beat in the target electrocardiogram signal based on multiple first R peak positions and RR interval averages.
[0064] Accordingly, for the embodiments of the present disclosure, when determining the first heart beat data corresponding to each first heart beat in the target electrocardiogram signal based on multiple first R peak positions and RR interval average values, the embodiment steps may include: for each first R peak position among the multiple first R peak positions, determining the starting position and ending position of the first heart beat data corresponding to each first heart beat based on the RR interval average value, and determining the electrocardiogram signal data between the starting position and the ending position as the corresponding first heart beat data; wherein the starting position is before the first R peak position, and the distance between the starting position and the first R peak position is a first preset distance, and the ending position is after the first R peak position, and the distance between the ending position and the first R peak position is a second preset distance.
[0065] In a specific application scenario, the first preset distance and the second preset distance can be set according to the actual application scenario. For example, according to the experimental conclusion, 1 / 5 of the average RR interval can be determined as the first preset distance, and 2 / 5 of the average RR interval can be determined as the second preset distance. That is, for each first heartbeat, the electrocardiogram signal data of the average RR interval length from 1 / 5 of the first R peak position to 2 / 5 of the average RR interval length after the first R peak position can be used as the first heartbeat data.
[0066] At this point, after the preprocessing of steps 310 - 1 to 310 - 4 of the above embodiment is performed on the 10-second ECG data, available data segments (first heart beat data) of all first RR intervals and each first heart beat can be obtained.
[0067] Step 320: determine the first heartbeat in the target electrocardiogram signal whose corresponding first RR interval is less than the first preset threshold as the first premature heartbeat, and screen out the first premature heartbeat from multiple first heartbeats to obtain multiple second heartbeats.
[0068] Among them, the first preset threshold is a preset multiple of the average value of the RR intervals corresponding to the multiple first RR intervals. The preset multiple can be set according to the actual application scenario, such as the preset multiple can be set to 0.9 according to the experimental conclusion; the second heart beat is the part of the first heart beats retained after the first premature heart beats are screened out from the multiple first heart beats. For the disclosed embodiment, the first heart beat corresponding to the first RR interval less than 0.9 times the average RR interval in the target electrocardiogram signal can be determined as the first premature heart beat, and the first premature heart beat can be screened out from the multiple first heart beats to obtain the retained multiple second heart beats.
[0069] Step 330, based on the first heart beat data of any second heart beat and the second heart beat data of other second heart beats, calculate the accumulated value of the first waveform deviation between any second heart beat and all other second heart beats, wherein the second heart beat data is the heart beat data after performing electrocardiogram signal sliding processing on the first heart beat data of each other second heart beat.
[0070] When calculating the accumulated value of the first waveform deviation between any second heart beat and all other second heart beats, the waveform deviation C between the i-th second heart beat and other second heart beats j is calculated in sequence using the i-th second heart beat as a template. i,j Since the first R peak position captured by the wfdb toolkit is not completely consistent, sometimes there is a deviation of about 50 sampling points, so it is necessary to move m sampling points back and forth at the original starting position with a length of 3 / 5 of the average RR interval, and calculate C in sequence. i,(j,m) , represents the waveform deviation after moving m sampling points with the i-th second heartbeat as the template and the j-th second heartbeat, m can be set according to the actual application scenario. In the following embodiment steps of the present disclosure, the value range of m is -50 to 50 as an example to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation. In this way, for each second heartbeat i and any other second heartbeat j, 100 waveform deviation values can be calculated. Then, 100 waveform deviation values C can be taken. i,(j,m) The minimum deviation C i,(j,min) is the waveform deviation between the second heart beat i and the second heart beat j (i.e., minimum deviation sliding matching). In this way, the minimum waveform deviation C between the i-th second heart beat and each other second heart beat j can be calculated. i,(j,min) Then, the sum of the deviations between the i-th second heart beat as the template and all other second heart beats j can be calculated: i,sum , the calculation formula of the sum of deviations is as follows:
[0071]
[0072] In the formula, C i,sum is the sum of the deviations between the ith second heart beat as the template and all other second heart beats j, n is the number of other second heart beats other than the ith second heart beat, j is any other second heart beat j among the n other second heart beats, C i,(j,min) is the 100 waveform deviation values C corresponding to the i-th second heart beat and any other second heart beat j i,(j,m) The minimum deviation C i,(j,min) .
[0073] Correspondingly, when calculating the waveform deviation, a multi-channel waveform deviation detection method based on matrix distance can be used. Specifically, the cdist function under the scipy.spatial.distance package can be used to calculate the matrix distance between the two heartbeat data, recorded as matrix A, and the trace of matrix A is calculated. The trace of matrix A is determined as the waveform deviation between the two multi-channel heartbeat data.
[0074] For example, it is determined that the target ECG signal contains 4 second heart beats: a1, a2, a3, and a4. When calculating the cumulative value of the first waveform deviation between each second heart beat and all other second heart beats, one of a1, a2, a3, and a4 can be used as a template in turn to calculate the sum of the deviations between it and all other second heart beats. When the second heart beat a1 is used as a template, 100 waveform deviation values corresponding to a1 and a2 can be calculated, and the minimum deviation value among the 100 waveform deviation values can be used as the waveform deviation A12 between a1 and a2; 100 waveform deviation values corresponding to a1 and a3 can be calculated, and the minimum deviation value among the 100 waveform deviation values can be used as the waveform deviation A13 between a1 and a3; 100 waveform deviation values corresponding to a1 and a4 can be calculated, and the minimum deviation value among the 100 waveform deviation values can be used as the waveform deviation A14 between a1 and a4. Then, the cumulative value of the first waveform deviation between the second heart beat a1 and all other second heart beats (a2, a3, a4) is calculated as: A12+A13+A14; accordingly, when the second heart beat a2 is used as a template, the waveform deviation A21 between a2 and a1, the waveform deviation A23 between a2 and a3, and the waveform deviation A24 between a2 and a4 can be calculated in the same manner according to the above method. Then, the cumulative value of the first waveform deviation between the second heart beat a2 and all other second heart beats (a1, a3, a4) is calculated as: A21+A23+A24. When the second heart beat a3 is used as a template, the waveform deviation A31 between a3 and a1, the waveform deviation A32 between a3 and a2, and the waveform deviation A34 between a3 and a4 can be calculated in the same manner according to the above method. Then, the cumulative value of the first waveform deviation between the second heart beat a3 and all other second heart beats (a1, a2, a4) is calculated as: A31+A32+A34; when the second heart beat a4 is used as a template, the waveform deviation A41 between a4 and a1, the waveform deviation A42 between a4 and a2, and the waveform deviation A43 between a4 and a3 can be calculated in the same way as above. Then, the cumulative value of the first waveform deviation between the second heart beat a4 and all other second heart beats (a1, a2, a3) is calculated as: A41+A42+A43.
[0075] Step 340: Determine the second heart beat with the smallest accumulated value of the first waveform deviation among the plurality of second heart beats as the first standard heart beat template.
[0076] Correspondingly, following the example in step 330 of the embodiment, the target ECG signal includes four second heart beats: a1, a2, a3, and a4. After calculating through the above-mentioned embodiment steps the first waveform deviation cumulative value between the second heart beat a1 and all other second heart beats (a2, a3, and a4): A12+A13+A14, the first waveform deviation cumulative value between the second heart beat a2 and all other second heart beats (a1, a3, and a4): A21+A23+A24, the first waveform deviation cumulative value between the second heart beat a3 and all other second heart beats (a1, a2, and a4): A31+A32+A34, and the first waveform deviation cumulative value between the second heart beat a4 and all other second heart beats (a1, a2, and a3): A41+A42+A43, the second ECG signal corresponding to the smallest first waveform deviation cumulative value among the four first waveform deviation cumulative values can be determined as the first standard heart beat template. After comparison, it is determined that (A12+A13+A14)>(A21+A23+A24)>
[0077] (A41+A42+A43)>(A31+A32+A34), then the second heart beat a3 corresponding to the minimum first waveform deviation accumulated value (A31+A32+A34) can be determined as the first standard heart beat template.
[0078] Step 350: Use the first standard heart beat template to filter out motion artifact heart beats from a plurality of first heart beats, and determine the second RR interval after the motion artifact heart beats are filtered out.
[0079] For the embodiment of the present disclosure, the step 350 of using the first standard heart beat template to filter out motion artifact heart beats from a plurality of first heart beats and determining the second RR interval after filtering out the motion artifact heart beats may include the following steps:
[0080] Step 350 - 1 : Determine the first RR interval where the first standard heart beat template is located as the first standard RR interval.
[0081] Step 350-2, determine the motion artifact RR interval that is less than the second preset threshold value among the multiple first RR intervals, determine the first heart beat corresponding to the motion artifact RR interval as the motion artifact heart beat, and remove the motion artifact heart beat from the multiple first heart beats to obtain multiple third heart beats.
[0082] Among them, the motion artifact RR interval is the first RR interval where the motion artifact heartbeat is located; the second preset threshold is a preset multiple of the first standard RR interval; the third heartbeat is part of the first heartbeats retained after the motion artifact heartbeats are screened out from multiple first heartbeats. In a specific application scenario, the preset multiple can be set according to the actual application scenario, such as the preset multiple can be set to 0.5 according to the experimental conclusion. For the embodiment of the present disclosure, after the first RR interval where the first standard heartbeat template is located is set as the first standard RR interval, the first heartbeat that is less than 0.5 times the first standard RR interval can be determined as an abnormal heartbeat, that is, a motion artifact heartbeat. Thereafter, the motion artifact heartbeat can be removed from the multiple first heartbeats to obtain multiple third heartbeats that are retained.
[0083] Step 350 - 3 : Determine a plurality of second R peak positions corresponding to a plurality of third heart beats.
[0084] For the disclosed embodiments, the wfdb.processing.gqrs_detect function can be used to traverse leads I, II, and III or leads II and III in the target ECG signal after the motion artifact heart beats are removed to obtain multiple second R peak positions corresponding to multiple third heart beats.
[0085] Step 350 - 4 : Calculate the second RR interval after filtering out the motion artifact heartbeat based on the adjacent R peak positions among the plurality of second R peak positions.
[0086] After determining the multiple second R peak positions, the distance between two adjacent R waves can be calculated based on the adjacent R peak positions in the multiple second R peak positions, and the distance can be used as the second RR interval after the motion artifact heartbeat is screened out. Specifically, the adjacent R peak positions in the second R peak positions can be substituted into the RR interval calculation formula to obtain the calculation result of the second RR interval.
[0087] Among them, the formula characteristics of the RR interval calculation formula are described as follows:
[0088] RR_interval (i) =R_index (i+1) -R_index (i)
[0089] Where, RR_interval (i) is the ith second RR interval, R_index (i+1) is the position of the second R peak at the i+1th position, R_index (i) is the position of the i-th second R peak.
[0090] Step 360: Use the second RR interval to update the first standard heart beat template, and use the updated second standard heart beat template to detect ventricular premature beats on the electrocardiogram signal to obtain a detection result of the ventricular premature beats corresponding to the target object.
[0091] For the embodiment of the present disclosure, updating the first standard heart beat template by using the second RR interval in step 360 may include the following steps:
[0092] Step 360-1: determine the third heart beat corresponding to the second RR interval that is less than the third preset threshold as a second premature heart beat, and screen out the second premature heart beats from the multiple third heart beats to obtain multiple fourth heart beats.
[0093] Among them, the fourth heartbeat is the part of the third heartbeats retained after the second premature heartbeats are screened out from the multiple third heartbeats; the third preset threshold is a preset multiple of the average value of the RR intervals corresponding to the multiple second RR intervals. The preset multiple can be set according to the actual application scenario, such as the preset multiple can be set to 0.9 according to the experimental conclusion. For the embodiment of the present disclosure, the third heartbeat corresponding to the second RR interval less than 0.9 times the average RR interval in the multiple third heartbeats can be determined as the third premature heartbeat, and the second premature heartbeats can be screened out from the multiple third heartbeats to obtain the retained multiple fourth heartbeats. Among them, the average RR interval is the average value of the multiple second RR intervals. The specific calculation process can refer to the relevant description in step 310-3 of the embodiment, which will not be repeated here.
[0094] Step 360-2, based on the first heart beat data of any fourth heart beat and the third heart beat data of other fourth heart beats, calculate the accumulated value of the second waveform deviation between any fourth heart beat and all other fourth heart beats, wherein the third heart beat data is the heart beat data after performing ECG signal sliding processing on the first heart beat data of each other fourth heart beat.
[0095] For the embodiment of the present disclosure, the specific implementation process can refer to the relevant description in step 330 of the embodiment, which will not be repeated here.
[0096] Step 360-3: Determine the fourth heart beat among the plurality of third heart beats, which corresponds to the smallest accumulated value of the second waveform deviation, as the second standard heart beat template after the first standard heart beat template is updated.
[0097] For the embodiment of the present disclosure, the specific implementation process can refer to the relevant description in step 340 of the embodiment, which will not be repeated here.
[0098] Accordingly, for the embodiment of the present disclosure, the step 360 of performing ventricular premature beat detection on the electrocardiogram signal using the updated second standard heart beat template to obtain the detection result of the ventricular premature beat corresponding to the target object may include the following steps:
[0099] Step 360-4: Calculate the minimum waveform deviation value between the second standard heart beat template and each third heart beat, and arrange them in sequence to obtain a minimum deviation list.
[0100] For the embodiment of the present disclosure, the deviation C between the second standard heart beat template and each other third heart beat j can be calculated. j ; Then use the method in step 330 of the embodiment to calculate the minimum deviation C (j,min) , and then arranged in sequence into the minimum deviation list LC (j,min) .
[0101] For example, it is determined that the target ECG signal after removing the motion artifact heartbeat contains three third heartbeats: a1, a2, and a4, and the third heartbeat a1 is determined to be the second standard heartbeat template through the above-mentioned embodiment steps. Then, the minimum waveform deviation C between the second standard heartbeat template and other third heartbeats j can be calculated. (j,min) Specifically, 100 waveform deviation values corresponding to a1 and a2 can be calculated, and the minimum deviation value among the 100 waveform deviation values can be used as the waveform deviation A12 between a1 and a2; 100 waveform deviation values corresponding to a1 and a4 can be calculated, and the minimum deviation value among the 100 waveform deviation values can be used as the waveform deviation A14 between a1 and a4. Then, the waveform deviations A12 and A14 can be arranged in sequence. When A12 is less than A14, the minimum deviation list LC can be obtained. (j,min) ={A12,A14}.
[0102] Step 360 - 5 , calculating the first preset parameter based on the minimum deviation list, and calculating the second preset parameter based on the first heart beat data corresponding to the second standard heart beat template.
[0103] The first preset parameter includes a preset multiple of the minimum value in the minimum deviation list, which can be expressed as the key threshold K value , the ratio of the minimum value in the minimum deviation list to the third quartile can be expressed as the ratio coefficient FB. The second preset parameter is the average value of the absolute value of the first heart beat data corresponding to the second standard heart beat template, which can be expressed as the adaptive adjustment coefficient AD value .
[0104] Key threshold K value The calculation formula can be:
[0105]
[0106] In the formula, is the tertile of the minimum deviation list, LC (j,min)min is the minimum value in the minimum deviation list, LC (j,min)max is the maximum value in the minimum deviation list. That is, in LC (j,min)max More than 10 times When the critical threshold K value The value is 7 times the LC (j,min)min ; in LC (j,min)max Less than 10 times When the critical threshold K value The value is 3 times the LC (j,min)min .
[0107] The calculation formula of the ratio coefficient FB can be:
[0108]
[0109] In the formula, is the third quartile of the minimum deviation list, LC (j,min)max is the maximum value of the minimum deviation list.
[0110] Step 360-6: Use the first preset parameter and the second preset parameter to determine whether the electrocardiogram signal contains a ventricular premature beat.
[0111] For the disclosed embodiment, for ECG data without ventricular premature beats, it is not necessary to locate ventricular premature beats, and only the complete 10-second ECG data needs to be exempted. The exemption strategy can be specifically as follows: based on the first preset parameter and the second preset parameter, the first preset condition and the second preset condition for judging ventricular premature beats are set, and when it is judged that the ECG signal satisfies at least one of the first preset condition and the second preset condition, it is judged that the ECG signal does not contain ventricular premature beats; otherwise, it is judged that the ECG signal contains ventricular premature beats.
[0112] The first preset condition may be LC (j,min)max Less than 20 times AD value , and the ratio coefficient FB is less than 3.6. The formula of the first preset condition is expressed as follows:
[0113]
[0114] The first preset condition may be LC (j,min)max Less than 7.5 times LC (j,min)min , and the ratio coefficient FB is less than 3.6. The formula of the second preset condition is expressed as follows:
[0115]
[0116] Step 360-7: When it is determined that the electrocardiogram signal includes a ventricular premature beat, the ventricular premature beat is located and identified based on the first preset parameter.
[0117] For the disclosed embodiment, for the 10-second ECG data that is not exempted, it is necessary to locate the beats where the ventricular premature beats occur. When determining that the ECG signal contains ventricular premature beats, it is only necessary to find the beats that meet the third preset condition, and the beats are ventricular premature beats.
[0118] The third preset condition is that the ratio coefficient FB is greater than 3.6, and the minimum deviation C from the second standard heart beat template is (j,min) Greater than K value The third heart beat j is determined to be a ventricular premature beat. The formula of the third preset condition is expressed as follows:
[0119]
[0120] It should be noted that when it is determined that the ECG signal contains ventricular premature beats, the above-mentioned heartbeat positioning method can be used to obtain the ventricular premature beat positioning result corresponding to the ECG signal. The ventricular premature beat positioning result includes at least one ventricular premature beat, that is, when there are multiple ventricular premature beats in the ECG signal, multiple ventricular premature beats can be positioned at the same time.
[0121] In specific application scenarios, the present invention can be deployed on Windows and Linux operating systems, and does not require a graphics card, only a central processing unit (CPU) is needed to complete model training and reasoning, thereby realizing a low-cost, easy-to-deploy, lightweight detection system for ventricular premature beats. The evaluation indicators of the PTB-XL, a large publicly available electrocardiography dataset on the PhysioNet website, are shown in Table 1 during external testing, indicating that the performance of the present invention has reached a practical level.
[0122] Table 1 Evaluation indicators:
[0123] index Sensitivity Specificity Positive predictive value Negative predictive value External Testing 0.958 0.991 0.987 0.985
[0124] In summary, according to the ECG signal processing method provided by the present invention, after acquiring the ECG signal of the target object, the ECG signal can be preprocessed to obtain the ECG signal waveform information; then, based on the ECG signal waveform information, a first standard heartbeat template is determined in the ECG signal, and the first standard heartbeat template is used to screen out motion artifact heartbeats in multiple first heartbeats, and the second RR interval after screening out motion artifact heartbeats is determined; then, the first standard heartbeat template is updated using the second RR interval, and the ECG signal is detected for ventricular premature beats using the updated second standard heartbeat template to obtain the detection result of the ventricular premature beats corresponding to the target object. The technical solution disclosed in the present invention can improve the quality of ECG data by preprocessing the ECG signal, and reduce the influence of data missing and baseline drift on the detection of ventricular premature beats. By selecting and updating the standard heartbeat template, motion artifact heartbeats can be screened out to ensure the accuracy of the selected standard heartbeat template. Using the modified standard heartbeat template to detect ventricular premature beats can avoid the interference of irrelevant factors such as motion artifact heartbeats on the detection of ventricular premature beats, and can improve the detection accuracy of ventricular premature beats.
[0125] Based on the above Figure 2 , Figure 3 A detailed description of the ECG signal processing method is provided, such as Figure 4 As shown, Figure 4 FIG. 1 is a block diagram of an electrocardiogram signal processing device according to an exemplary embodiment. Figure 4 As shown, the device comprises:
[0126] The processing module 41 can be used to obtain the ECG signal of the target object and pre-process the ECG signal to obtain ECG signal waveform information, where the ECG signal waveform information at least includes a plurality of first RR intervals and a plurality of first heart beat data corresponding to a plurality of first heart beats;
[0127] A determination module 42, which can be used to determine a first standard heart beat template in the ECG signal based on the ECG signal waveform information;
[0128] A screening module 43, which can be used to screen out motion artifact heart beats from a plurality of first heart beats using a first standard heart beat template, and determine a second RR interval after the motion artifact heart beats are screened out;
[0129] The detection module 44 can be used to update the first standard heart beat template using the second RR interval, and use the updated second standard heart beat template to detect ventricular premature beats on the electrocardiogram signal to obtain a detection result of the ventricular premature beats corresponding to the target object.
[0130] In some embodiments of the present application, when preprocessing the ECG signal to obtain the ECG signal waveform information, the processing module 41 can be used to perform digital filtering processing on the ECG signal using a bandpass filter to obtain a target ECG signal with a corresponding frequency distribution within a preset cutoff frequency interval; identify multiple first R peak positions corresponding to multiple first heart beats in the target ECG signal; calculate multiple first RR intervals in the target ECG signal based on adjacent R peak positions among the multiple first R peak positions, and calculate the RR interval average of the multiple first RR intervals; determine the first heart beat data corresponding to each first heart beat in the target ECG signal based on the multiple first R peak positions and the RR interval average.
[0131] In some embodiments of the present application, when determining the first heart beat data corresponding to each first heart beat in the target electrocardiogram signal based on multiple first R peak positions and RR interval average values, the processing module 41 can be used to determine the starting position and the ending position of the first heart beat data corresponding to each first heart beat based on the RR interval average value for each first R peak position among the multiple first R peak positions, and determine the electrocardiogram signal data between the starting position and the ending position as the corresponding first heart beat data; wherein the starting position is before the first R peak position, and the distance between the starting position and the first R peak position is a first preset distance, and the distance between the ending position and the first R peak position is a second preset distance.
[0132] In some embodiments of the present application, when determining a first standard heart beat template in an ECG signal based on ECG signal waveform information, a determination module 42 can be used to determine a first heart beat in a target ECG signal whose corresponding first RR interval is less than a first preset threshold as a first premature heart beat, where the first preset threshold is a preset multiple of an average value of RR intervals corresponding to multiple first RR intervals; screen out the first premature heart beats from multiple first heart beats to obtain multiple second heart beats; calculate a first waveform deviation cumulative value between any second heart beat and all other second heart beats based on the first heart beat data of any second heart beat and the second heart beat data of other second heart beats, wherein the second heart beat data is the heart beat data after ECG signal sliding processing is performed on the first heart beat data of each other second heart beat; and determine the second heart beat with the smallest cumulative value of the first waveform deviation among multiple second heart beats as the first standard heart beat template.
[0133] In some embodiments of the present application, when using a first standard heart beat template to screen out motion artifact heart beats from multiple first heart beats and determining a second RR interval after screening out the motion artifact heart beats, the screening module 43 can be used to determine the first RR interval where the first standard heart beat template is located as the first standard RR interval; determine a motion artifact RR interval that is less than a second preset threshold value from multiple first RR intervals, where the second preset threshold value is a preset multiple of the first standard RR interval; determine the first heart beat corresponding to the motion artifact RR interval as a motion artifact heart beat, and remove the motion artifact heart beat from the multiple first heart beats to obtain multiple third heart beats; determine multiple second R peak positions corresponding to the multiple third heart beats; and calculate the second RR interval after screening out the motion artifact heart beat based on adjacent R peak positions among the multiple second R peak positions.
[0134] In some embodiments of the present application, when the second RR interval is used to update the first standard heart beat template, the detection module 44 can be used to determine the third heart beat corresponding to the second RR interval that is less than a third preset threshold as a second premature heart beat, where the third preset threshold is a preset multiple of the average value of the RR intervals corresponding to multiple second RR intervals; screen out the second premature heart beats from the multiple third heart beats to obtain multiple fourth heart beats; based on the first heart beat data of any fourth heart beat and the third heart beat data of other fourth heart beats, calculate the second waveform deviation cumulative value between any fourth heart beat and all other fourth heart beats, wherein the third heart beat data is the heart beat data after the first heart beat data of each other fourth heart beat is subjected to electrocardiogram signal sliding processing; and determine the fourth heart beat with the smallest corresponding second waveform deviation cumulative value among the multiple fourth heart beats as the second standard heart beat template after the first standard heart beat template is updated.
[0135] In some embodiments of the present application, when using the updated second standard heart beat template to detect ventricular premature beats on the electrocardiogram signal and obtaining the detection result of the ventricular premature beats corresponding to the target object, the detection module 44 can be used to calculate the minimum waveform deviation value between the second standard heart beat template and each third heart beat, and arrange them in sequence to obtain a minimum deviation list; calculate the first preset parameter based on the minimum deviation list, and calculate the second preset parameter based on the first heart beat data corresponding to the second standard heart beat template, the first preset parameter includes a preset multiple of the minimum value in the minimum deviation list, the ratio of the minimum value in the minimum deviation list to the third quartile, and the second preset parameter is the average value of the absolute value of the first heart beat data corresponding to the second standard heart beat template; use the first preset parameter and the second preset parameter to determine whether the electrocardiogram signal contains ventricular premature beats; when determining that the electrocardiogram signal contains ventricular premature beats, locate and identify the ventricular premature beats based on the first preset parameter.
[0136] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0137] The embodiments of the present application and the technical solutions disclosed in the present invention can improve the quality of ECG data and reduce the influence of data loss and baseline drift on the detection of ventricular premature beats by preprocessing ECG signals. By selecting and updating the standard heart beat template, motion artifact heart beats can be screened out to ensure the accuracy of the screened standard heart beat template. Using the corrected standard heart beat template for ventricular premature beat detection can avoid the interference of non-related factors such as motion artifact heart beats on ventricular premature beat detection, and can improve the detection accuracy of ventricular premature beats.
[0138] The above text describes the ECG signal processing device of the embodiment of the present invention from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, or can be implemented by a combination of hardware and software modules. Specifically, the steps of the ECG signal processing method embodiment in the embodiment of the present invention can be completed by the hardware integrated logic circuit and / or software instructions in the processor, and the steps of the ECG signal processing method applied in conjunction with the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or can be executed by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps in the above-mentioned ECG signal processing method embodiment in conjunction with its hardware.
[0139] Figure 5 It is a schematic block diagram of an electronic device 700 according to an embodiment of the present invention.
[0140] like Figure 5 As shown, the electronic device 700 may include:
[0141] The memory 710 and the processor 720, the memory 710 is used to store the computer program and transmit the program code to the processor 720. In other words, the processor 720 can call and run the computer program from the memory 710 to implement the method in the embodiment of the present invention.
[0142] For example, the processor 720 may be configured to execute the above method embodiments according to instructions in the computer program.
[0143] In some embodiments of the present invention, the processor 720 may include but is not limited to:
[0144] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0145] In some embodiments of the present invention, the memory 710 includes but is not limited to:
[0146] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
[0147] In some embodiments of the present invention, the computer program may be divided into one or more modules, which are stored in the memory 710 and executed by the processor 720 to complete the method provided by the present invention. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the controller.
[0148] like Figure 5 As shown, the electronic device 700 may further include:
[0149] The transceiver 730 may be connected to the processor 720 or the memory 710 .
[0150] The processor 720 may control the transceiver 730 to communicate with other devices, specifically, to send data to other devices or receive data sent by other devices. The transceiver 730 may include a transmitter and a receiver. The transceiver 730 may further include an antenna, and the number of antennas may be one or more.
[0151] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0152] The present invention also provides a computer storage medium having a computer program stored thereon, which, when executed by a computer, enables the computer to perform the method of the above method embodiment. In other words, an embodiment of the present invention also provides a computer program product containing instructions, which, when executed by a computer, enables the computer to perform the method of the above method embodiment.
[0153] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (Digital Video Disc, DVD)), or a semiconductor medium (e.g., a solid-state drive (Solid State Disk, SSD)), etc.
[0154] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments applied herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0155] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0156] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0157] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this application, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for processing an electrocardiogram signal, characterized in that: include: Acquire an electrocardiogram (ECG) signal of a target object, and preprocess the ECG signal to obtain ECG signal waveform information, wherein the ECG signal waveform information includes at least a plurality of first RR intervals and a plurality of first heartbeat data corresponding to a plurality of first heartbeats; Determine a first standard heart beat template in the electrocardiogram based on the electrocardiogram waveform information; Using the first standard heartbeat template to filter out motion artifact heartbeats from the plurality of first heartbeats, and determining a second RR interval after filtering out the motion artifact heartbeats; The first standard heart beat template is updated by using the second RR interval, and the ventricular premature beat detection is performed on the electrocardiogram signal by using the updated second standard heart beat template to obtain a detection result of the ventricular premature beat corresponding to the target object.
2. The method according to claim 1, characterized in that The preprocessing of the electrocardiogram signal to obtain electrocardiogram signal waveform information includes: Performing digital filtering processing on the ECG signal using a bandpass filter to obtain a target ECG signal whose corresponding frequency distribution is within a preset cutoff frequency interval; Identifying a plurality of first R peak positions corresponding to a plurality of first heart beats in the target electrocardiogram signal; Calculating a plurality of first RR intervals in the target electrocardiogram signal based on adjacent R peak positions among the plurality of first R peak positions, and calculating an RR interval average value of the plurality of first RR intervals; Based on the multiple first R peak positions and the RR interval average value, first heart beat data corresponding to each first heart beat in the target electrocardiogram signal is determined.
3. The method according to claim 2, characterized in that The determining, based on the multiple first R peak positions and the RR interval average value, first heart beat data corresponding to each first heart beat in the target electrocardiogram signal comprises: For each of the multiple first R peak positions, determine the starting position and the ending position of the first heart beat data corresponding to each first heart beat based on the RR interval average value, and determine the electrocardiogram signal data between the starting position and the ending position as the corresponding first heart beat data; The starting position is before the first R peak position, and the distance between the starting position and the first R peak position is a first preset distance, and the ending position is after the first R peak position, and the distance between the starting position and the first R peak position is a second preset distance.
4. The method according to claim 2, characterized in that: The determining a first standard heart beat template in the electrocardiogram signal based on the electrocardiogram signal waveform information comprises: Determine the first heartbeat in the target electrocardiogram signal whose corresponding first RR interval is less than a first preset threshold as a first premature heartbeat, wherein the first preset threshold is a preset multiple of an average value of the RR intervals corresponding to the plurality of first RR intervals; Screening out the first premature heart beat from the multiple first heart beats to obtain multiple second heart beats; Based on the first heartbeat data of any second heartbeat and the second heartbeat data of other second heartbeats, calculating the first waveform deviation cumulative value between any second heartbeat and all other second heartbeats, wherein the second heartbeat data is the heartbeat data after the first heartbeat data of each other second heartbeat is subjected to electrocardiogram signal sliding processing; The second heart beat among the plurality of second heart beats corresponding to the smallest accumulated value of the first waveform deviation is determined as the first standard heart beat template.
5. The method according to claim 1, characterized in that Using the first standard heartbeat template to filter out motion artifact heartbeats from the plurality of first heartbeats, and determining a second RR interval after filtering out the motion artifact heartbeats, comprises: Determine the first RR interval where the first standard heart beat template is located as the first standard RR interval; Determining a motion artifact RR interval that is smaller than a second preset threshold value among the plurality of first RR intervals, wherein the second preset threshold value is a preset multiple of the first standard RR interval; Determine the first heartbeat corresponding to the motion artifact RR interval as a motion artifact heartbeat, and remove the motion artifact heartbeat from the multiple first heartbeats to obtain multiple third heartbeats; determining a plurality of second R peak positions corresponding to the plurality of third heart beats; Based on adjacent R peak positions among the plurality of second R peak positions, a second RR interval is calculated after heart beats with motion artifacts are filtered out.
6. The method according to claim 5, characterized in that The updating of the first standard heart beat template by using the second RR interval comprises: Determine the third heartbeat corresponding to the second RR interval that is less than a third preset threshold as a second premature heartbeat, wherein the third preset threshold is a preset multiple of an average value of the RR intervals corresponding to the plurality of second RR intervals; Screening out the second premature heart beat from the plurality of third heart beats to obtain a plurality of fourth heart beats; Based on the first heartbeat data of any fourth heartbeat and the third heartbeat data of other fourth heartbeats, calculating the second waveform deviation cumulative value between any fourth heartbeat and all other fourth heartbeats, wherein the third heartbeat data is the heartbeat data after the first heartbeat data of each other fourth heartbeat is subjected to electrocardiogram signal sliding processing; The fourth heart beat among the multiple fourth heart beats corresponding to the smallest accumulated value of the second waveform deviation is determined as the second standard heart beat template after the first standard heart beat template is updated.
7. The method according to claim 5, characterized in that The method of performing ventricular premature beat detection on the electrocardiogram signal using the updated second standard heart beat template to obtain a detection result of the ventricular premature beat corresponding to the target object includes: Calculating the minimum waveform deviation value between the second standard heart beat template and each of the third heart beats, and arranging them in sequence to obtain a minimum deviation list; Calculating a first preset parameter based on the minimum deviation list, and calculating a second preset parameter based on the first heart beat data corresponding to the second standard heart beat template, the first preset parameter including a preset multiple of the minimum value in the minimum deviation list, a ratio of the minimum value to the third quartile in the minimum deviation list, and the second preset parameter being an average of the absolute values of the first heart beat data corresponding to the second standard heart beat template; Using the first preset parameter and the second preset parameter, determining whether the electrocardiogram signal includes a ventricular premature beat; When it is determined that the electrocardiogram signal includes a ventricular premature beat, the ventricular premature beat is located and identified based on the first preset parameter.
8. An electrocardiogram signal processing device, characterized in that: include: A processing module, used for acquiring an ECG signal of a target object, and preprocessing the ECG signal to obtain ECG signal waveform information, wherein the ECG signal waveform information at least includes a plurality of first RR intervals and a plurality of first heart beat data corresponding to a plurality of first heart beats; A determination module, configured to determine a first standard heart beat template in the electrocardiogram based on the electrocardiogram waveform information; A screening module, used for screening out motion artifact heart beats from the plurality of first heart beats by using the first standard heart beat template, and determining a second RR interval after screening out the motion artifact heart beats; A detection module is used to update the first standard heart beat template using the second RR interval, and to detect ventricular premature beats on the electrocardiogram signal using the updated second standard heart beat template to obtain a detection result of the ventricular premature beats corresponding to the target object.
9. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 7.
