A method, terminal and storage medium for detecting quality of electrocardiogram signal
By extracting target feature points and index items from the ECG signal and performing segmentation processing based on sliding windows, the problem of low ECG signal detection efficiency in the existing technology is solved, and fast and accurate ECG signal quality detection is achieved, which is suitable for Wearable devices.
Patent Information
- Application Number
- CN202410564399.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-09
AI Technical Summary
In the existing technology, deep learning algorithm models for ECG signal quality detection require a large amount of sample data and complex network structures, resulting in low detection efficiency and long time consumption, making it difficult to apply to wearable electronic devices in real time.
By extracting target feature points and indicator items in the ECG signal, performing segmentation processing based on sliding windows, calculating signal quality data, avoiding the use of large amounts of sample data and complex network models, and achieving rapid detection.
It improves the efficiency and accuracy of ECG signal detection, reduces detection complexity and time-consuming, and is suitable for real-time applications of wearable electronic devices.
Smart Images

Figure CN118141384B
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal processing technology, and in particular to an electrocardiogram signal quality detection method, terminal and storage medium. Background Art
[0002] The terminal device provides cardiovascular health monitoring functions. For example, the pulse wave velocity (PWV) monitoring function and the electrocardiogram (ECG) signal monitoring function. In the related technology, the terminal device is a wearable electronic device. The wearable electronic device can collect the user's ECG signal. The ECG signal quality is detected through the deep learning algorithm model. The ECG signal detection results are output to the user for the user to refer to the cardiovascular health status.
[0003] However, the deep learning algorithm model requires a large amount of sample data for training, and the algorithm model is generally large, with a complex network structure and many network parameters. The process of quality detection of ECG signals is relatively complicated, and the algorithm model runs slowly, resulting in a longer time-consuming detection of ECG signals and reducing the detection efficiency of ECG signals. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, a terminal and a storage medium for detecting the quality of an electrocardiogram signal, so as to improve the efficiency of detecting an electrocardiogram signal. The specific technical solution is as follows:
[0005] In a first aspect, in order to achieve the above-mentioned purpose, the embodiments of the present application provide a method, a terminal and a storage medium for detecting quality of an electrocardiogram signal, the method comprising:
[0006] Obtaining collected ECG signals;
[0007] Extracting features of a designated waveform in the electrocardiogram signal to obtain target feature points of the electrocardiogram signal;
[0008] Calculating quality data of each index item of the electrocardiogram signal based on distribution information of the target feature point in the electrocardiogram signal;
[0009] Based on the quality data of each indicator item of the electrocardiogram signal, the target quality data of the electrocardiogram signal is calculated.
[0010] As can be seen from the above, the solution provided by this embodiment extracts target feature points in the ECG signal. The distribution information of the target feature points in the ECG signal can reflect the quality of different signal segments in the ECG signal. The quality data of each indicator item of the ECG signal calculated based on the distribution information of the target feature points in the ECG signal can reflect the quality of the ECG signal. The target quality data determined based on the quality data of each indicator item of the ECG signal can also represent the quality of the ECG signal. There is no need to use a large amount of sample data to train the algorithm model, nor is there a need to use the algorithm model to detect the quality of the ECG signal. The amount of data required is small, and no complex network structure and a large number of network parameters will be generated. The running speed is fast, which can reduce the complexity of detecting the ECG signal, and can also reduce the time consumption of detecting the ECG signal, thereby improving the detection efficiency of the ECG signal.
[0011] In one embodiment of the present application, the step of extracting features from a specified waveform in the electrocardiogram signal to obtain target feature points of the electrocardiogram signal includes:
[0012] According to the preset size of the sliding window, feature extraction is performed on a designated waveform of the electrocardiogram signal within the sliding window to obtain target feature points of the electrocardiogram signal within the sliding window.
[0013] As can be seen from the above, the solution provided in this embodiment establishes a sliding window in the time domain to extract the target feature points of the ECG signal, which can segment the ECG signal, improve the accuracy of the extracted target feature points, and further improve the accuracy of the quality detection of the ECG signal.
[0014] In one embodiment of the present application, the calculating of the quality data of each indicator item of the electrocardiogram signal based on the distribution information of the target feature point in the electrocardiogram signal includes:
[0015] For each sliding window, quality data of each indicator item of the electrocardiogram signal in the sliding window is calculated based on the distribution information of the target feature point in the sliding window.
[0016] As can be seen from the above, the solution provided in this embodiment establishes a sliding window in the time domain, and determines the quality data of each indicator item of the ECG signal in each sliding window respectively. The ECG signal can be processed in segments, thereby improving the accuracy of the quality data of each indicator item of the ECG signal in the calculated sliding window, and further improving the accuracy of the quality detection of the ECG signal.
[0017] In one embodiment of the present application, the specified waveform includes at least one of the following: a P wave, a Q wave, an R wave, an S wave, and a T wave;
[0018] The index items include at least one of the following: an index item related to R wave; an index item related to S wave and T wave; an index item related to T wave and P wave; an index item related to Q wave and S wave; an index item related to characteristic points; and an index item related to waveform.
[0019] As can be seen from the above, the solution provided in this embodiment combines the characteristics of the Q wave, R wave, S wave, T wave and P wave in the ECG signal to perform ECG signal detection, thereby improving the accuracy of quality detection of the ECG signal.
[0020] In one embodiment of the present application, for each sliding window, based on the distribution information of the target feature point in the sliding window, calculating the quality data of each indicator item of the electrocardiogram signal in the sliding window includes:
[0021] For each sliding window, based on the amplitude of the target feature point of each R wave in the sliding window and the distance between the target feature points of adjacent R waves, the quality data of the index item related to the R wave of the electrocardiogram signal in the sliding window is calculated; wherein the target feature point of the R wave is the peak;
[0022] Based on the slope of the target feature point of each S wave and the adjacent T wave in the sliding window, and the spacing between the target feature points of the S wave and the adjacent T wave, the quality data of the index items related to the S wave and the T wave of the electrocardiogram signal in the sliding window are calculated; wherein the target feature point of the S wave is the trough; and the target feature point of the T wave is the peak;
[0023] Based on the slope of the target feature point of each T wave and the adjacent P wave in the sliding window, and the distance between the target feature points of the T wave and the adjacent P wave, the quality data of the index items related to the T wave and the P wave of the electrocardiogram signal in the sliding window are calculated; wherein the target feature point of the P wave is the peak;
[0024] Based on the amplitude of the target feature point of each Q wave and the adjacent S wave in the sliding window, the quality data of the index items related to the Q wave and the S wave of the electrocardiogram signal in the sliding window are calculated; wherein the target feature point of the Q wave is the trough;
[0025] Calculating quality data of index items related to the feature points of the electrocardiogram signal in the sliding window based on the total number of target feature points in the sliding window;
[0026] Based on the instantaneous slope of each S wave and the adjacent T wave in the sliding window, and / or the instantaneous slope of each T wave and the adjacent P wave, the quality data of the waveform-related index items of the electrocardiogram signal in the sliding window are calculated; wherein the instantaneous slope of the S wave and the adjacent T wave includes: the slope of each sampling point between the target feature points of the S wave and the adjacent T wave; the instantaneous slope of the T wave and the adjacent P wave includes: the slope of each sampling point between the target feature points of the T wave and the adjacent P wave.
[0027] As can be seen from the above, the solution provided in this embodiment determines the quality data of each indicator based on multiple evaluation parameters such as the peak-to-peak distance of the R wave, the Y value (amplitude) of the R peak, the slope fluctuation coefficient of TP and the proportion of positive and negative slope changes, the slope fluctuation coefficient of ST and the proportion of positive and negative slope changes. It can perform ECG signal detection in combination with the characteristics of the Q wave, R wave, S wave, T wave and P wave in the ECG signal, thereby improving the accuracy of quality detection of the ECG signal.
[0028] In one embodiment of the present application, the calculating of the quality data of the index item related to the R wave of the electrocardiogram signal in the sliding window based on the amplitude of the target feature point of each R wave in the sliding window and the distance between the target feature points of adjacent R waves includes:
[0029] For each R wave in the sliding window, calculate the degree of deviation of the amplitude of the target feature point of the R wave relative to the reference amplitude to obtain a first deviation degree; wherein the reference amplitude is the amplitude mean of the amplitudes of the target feature points of each R wave in the sliding window;
[0030] Determine, from each R wave in the sliding window, the number of R waves having a first offset degree greater than an offset threshold, to obtain a first number;
[0031] Determine quality data of a first indicator item related to the R wave of the electrocardiogram signal within the sliding window based on the first number;
[0032] For each R wave in the sliding window, calculate the degree of deviation of the distance between the target feature points of the R wave and the adjacent R wave relative to the first reference distance to obtain a second deviation degree; wherein the first reference distance is the distance average of the distances between the target feature points of each adjacent R wave in the sliding window;
[0033] Determine the number of R waves whose second offset degree is greater than the offset threshold from each R wave in the sliding window to obtain a second number; wherein different indicator items correspond to different offset thresholds;
[0034] Based on the second number, quality data of a second indicator item related to the R wave of the electrocardiogram signal within the sliding window is determined.
[0035] In one embodiment of the present application, the quality data of the index items related to the S wave and the T wave of the electrocardiogram signal in the sliding window is calculated based on the slope of the target feature point of each S wave and the adjacent T wave in the sliding window, and the spacing between the target feature points of the S wave and the adjacent T wave, including:
[0036] For each S wave in the sliding window, the degree of deviation of the slope fluctuation coefficient of the S wave and the adjacent T wave relative to the first reference coefficient is calculated to obtain a third degree of deviation; wherein the first reference coefficient is the coefficient mean of the slope fluctuation coefficients of each S wave and the adjacent T wave in the sliding window; the slope fluctuation coefficient of the S wave and the adjacent T wave represents: the slope change of each sampling point between the target feature point of the S wave and the target feature point of the adjacent T wave;
[0037] Determine, from each S wave in the sliding window, the number of S waves whose third offset degree is greater than the offset threshold, to obtain a third number; wherein different indicator items correspond to different offset thresholds;
[0038] Determine quality data of a first indicator item related to the S wave and the T wave of the electrocardiogram signal in the sliding window based on the third number;
[0039] For each S wave in the sliding window, calculate the degree of deviation of the spacing between the target feature points of the S wave and the adjacent T wave relative to the second reference spacing, and obtain a fourth deviation degree; wherein the second reference spacing is the spacing average of the spacings between the target feature points of each S wave and the adjacent T wave in the sliding window;
[0040] Determine, from each S wave in the sliding window, the number of S waves whose fourth offset degree is greater than the first offset threshold and the number of S waves whose fourth offset degree is less than the second offset threshold, to obtain a fourth number; wherein the first offset threshold is less than the second offset threshold;
[0041] Quality data of a second indicator item related to the S wave and the T wave of the electrocardiogram signal within the sliding window is determined based on the fourth number.
[0042] In one embodiment of the present application, the quality data of the index items related to the T wave and the P wave of the electrocardiogram signal in the sliding window is calculated based on the slope of the target feature point of each T wave and the adjacent P wave in the sliding window, and the distance between the target feature points of the T wave and the adjacent P wave, including:
[0043] For each T wave in the sliding window, the degree of deviation of the slope fluctuation coefficient of the T wave and the adjacent P wave relative to the second reference coefficient is calculated to obtain a fifth deviation degree; wherein the second reference coefficient is the coefficient mean of the slope fluctuation coefficients of each T wave and the adjacent P wave in the sliding window; the slope fluctuation coefficient of the T wave and the adjacent P wave represents: the slope change of each sampling point between the target feature point of the T wave and the target feature point of the adjacent P wave;
[0044] Determine the number of T waves whose fifth offset degree is greater than the offset threshold from each T wave in the sliding window to obtain a fifth number; wherein the offset thresholds corresponding to different indicator items;
[0045] Determine quality data of a first indicator item related to the T wave and the P wave of the electrocardiogram signal in the sliding window based on the fifth number;
[0046] For each T wave in the sliding window, calculate the degree of deviation of the spacing between the target feature points of the T wave and the adjacent P wave relative to the third reference spacing to obtain a sixth deviation degree; wherein the third reference spacing is the spacing average of the spacings between the target feature points of each T wave and the adjacent P wave in the sliding window;
[0047] Determine, from each T wave in the sliding window, the number of T waves whose sixth offset degree is greater than the first offset threshold and the number of T waves whose sixth offset degree is less than the second offset threshold, to obtain a sixth number; wherein the first offset threshold is less than the second offset threshold;
[0048] Based on the sixth number, quality data of a second indicator item related to the T wave and the P wave of the electrocardiogram signal within the sliding window is determined.
[0049] In one embodiment of the present application, the calculating of the quality data of the index items related to the Q wave and the S wave of the electrocardiogram signal in the sliding window based on the amplitude of the target feature point of each Q wave and the adjacent S wave in the sliding window includes:
[0050] For each Q wave in the sliding window, the degree of deviation of the amplitude difference coefficient of the target feature point of the Q wave and the adjacent S wave relative to the third reference coefficient is calculated to obtain a seventh deviation degree; wherein the third reference coefficient is the coefficient mean of the amplitude difference coefficients of the target feature points of each Q wave and the adjacent S wave in the sliding window; the amplitude difference coefficient of the target feature point of the Q wave and the adjacent S wave represents the amplitude change of the target feature point of the Q wave and the adjacent S wave;
[0051] Determine the number of Q waves whose seventh offset degree is greater than an offset threshold from among the Q waves in the sliding window, and obtain a seventh number; wherein different indicator items correspond to different offset thresholds;
[0052] Quality data of index items related to the Q wave and the S wave of the electrocardiogram signal within the sliding window are determined based on the seventh number.
[0053] In one embodiment of the present application, the calculating, based on the total number of target feature points in the sliding window, quality data of index items related to the feature points of the electrocardiogram signal in the sliding window includes:
[0054] For each sliding window, when the total number of target feature points in the sliding window is not greater than a first reference number, determining that the quality data of the first indicator item related to the feature points of the electrocardiogram signal in the sliding window is a preset value;
[0055] When the number of target feature points not extracted in the sliding window is greater than a second reference number, the quality data of the second indicator item related to the feature points of the electrocardiogram signal in the sliding window is determined to be a preset value; wherein different preset values correspond to different indicator items.
[0056] In one embodiment of the present application, the calculating of the quality data of the index item related to the waveform of the electrocardiogram signal in the sliding window based on the instantaneous slope of each S wave and the adjacent T wave in the sliding window, and / or the instantaneous slope of each T wave and the adjacent P wave, includes:
[0057] When the ratio of positive values to negative values in the instantaneous slopes of the S wave and the adjacent T wave in the first waveform within the sliding window is greater than the first reference ratio, and / or the ratio of positive values to negative values in the instantaneous slopes of the T wave and the adjacent P wave in the first waveform is greater than the first reference ratio, it is determined that the quality data of the indicator items related to the waveform of the electrocardiogram signal within the sliding window is a preset value.
[0058] In one embodiment of the present application, the calculating target quality data of the electrocardiogram signal based on the quality data of each indicator item of the electrocardiogram signal includes:
[0059] For each sliding window, a weighted sum of the quality data of each indicator item in the sliding window is calculated to obtain the quality data of the electrocardiogram signal in the sliding window;
[0060] Based on the quality data of the electrocardiographic signal in each sliding window, target quality data of the electrocardiographic signal is calculated.
[0061] As can be seen from the above, the solution provided in this embodiment establishes a sliding window in the time domain, and determines the quality data of each indicator item of the ECG signal in each sliding window respectively. The ECG signal can be processed in segments, thereby improving the accuracy of the quality data of each indicator item of the ECG signal in the calculated sliding window, and further improving the accuracy of the quality detection of the ECG signal.
[0062] In one embodiment of the present application, the calculating target quality data of the electrocardiogram signal based on the quality data of the electrocardiogram signal in each sliding window includes:
[0063] Based on the quality data of the ECG signal in each sliding window and a preset formula, the target quality data of the ECG signal is calculated; wherein the preset formula is:
[0064] S= a 0 - ∑ m=1 M [ ∑ n=1 N a n k n ] ;
[0065] S represents the target quality data of the electrocardiogram signal; represents the preset initial quality data of the ECG signal; M represents the number of sliding windows; m represents the sequence number of the sliding window; N represents the number of indicator items; Represents the quality data of the nth indicator item in the mth sliding window; Represents the weight coefficient of the nth indicator item in the mth sliding window; Represents the quality data of the ECG signal in the mth sliding window.
[0066] As can be seen from the above, the solution provided in this embodiment establishes a sliding window in the time domain, and determines the quality data of each indicator item of the ECG signal in each sliding window respectively. The ECG signal can be processed in segments, and the target quality data can be determined by combining the quality data of the ECG signal in each sliding window. That is, the overall quality of the ECG signal is determined by combining the quality of the signal segments of the ECG signal, thereby improving the accuracy of quality detection of the ECG signal.
[0067] In one embodiment of the present application, the feature extraction of a specified waveform of the electrocardiogram signal within the sliding window according to a preset sliding window size to obtain a target feature point of the electrocardiogram signal within the sliding window includes:
[0068] For each sliding window, determining a specified waveform in the electrocardiogram signal within the sliding window; wherein the specified waveform includes at least one of the following: a P wave, a Q wave, an R wave, an S wave, and a T wave;
[0069] Extracting a feature point of the specified waveform in the sliding window to obtain a first feature point;
[0070] Based on the spacing of the first feature points, determining a second waveform in which an abnormality occurs when extracting feature points within the sliding window;
[0071] Based on the first feature point and a result of feature extraction of the second waveform in the sliding window, a target feature point of the electrocardiogram signal in the sliding window is determined.
[0072] From the above, it can be seen that the solution provided in this embodiment detects whether an abnormality occurs during feature extraction based on the extracted first feature point, and re-extracts the missed feature points when an abnormality occurs, and removes the over-extracted feature points, which can improve the accuracy of the extracted target feature points, and thereby improve the accuracy of quality detection of ECG signals.
[0073] In one embodiment of the present application, determining the target feature point of the electrocardiogram signal in the sliding window based on the first feature point and the result of feature extraction of the second waveform in the sliding window includes:
[0074] Extract feature points from the first type of second waveform, and add the obtained feature points to the first feature points; determine the first feature points that are extracted in excess in the second type of second waveform, remove the excess first feature points, and return to execute the step of determining the second waveform in which an abnormality occurs when extracting feature points within the sliding window based on the spacing of the first feature points; wherein there are unextracted feature points in the first type of second waveform; and wherein there are excess extracted feature points in the second type of second waveform.
[0075] From the above, it can be seen that the solution provided in this embodiment detects whether an abnormality occurs during feature extraction based on the extracted first feature point, and re-extracts the missed feature points when an abnormality occurs, and removes the over-extracted feature points, which can improve the accuracy of the extracted target feature points, and thereby improve the accuracy of quality detection of ECG signals.
[0076] In one embodiment of the present application, determining, based on the spacing of the first feature points, a second waveform in which an abnormality occurs when extracting feature points within the sliding window, includes:
[0077] For each specified waveform, calculating the distance between the first characteristic point of the specified waveform and an adjacent specified waveform to obtain a plurality of peak-to-peak distances;
[0078] Based on the plurality of peak-to-peak intervals, determining an abnormality detection threshold; wherein the abnormality detection threshold is used to detect whether the waveform between two adjacent specified waveforms is the second waveform where an abnormality occurs when extracting feature points;
[0079] If the distance between the first characteristic point of the specified waveform and the adjacent specified waveform is greater than the first abnormality detection threshold, determine that the waveform between the specified waveform and the adjacent specified waveform is a first-type second waveform; wherein there are unextracted characteristic points in the first-type second waveform;
[0080] If the distance between the first feature point of the specified waveform and the adjacent specified waveform is less than the second anomaly detection threshold, the waveform between the specified waveform and the adjacent specified waveform is determined to be a second type second waveform; wherein there are multiple extracted feature points in the second type second waveform; and the first anomaly detection threshold is greater than the second anomaly detection threshold.
[0081] In one embodiment of the present application, when the designated waveform is an R wave, the adjacent designated waveform of the R wave is the R wave; the target characteristic point of the R wave is the wave peak;
[0082] When the designated waveform is a T wave, the adjacent designated waveform of the T wave is a P wave; the target characteristic points of the T wave and the P wave are the peaks;
[0083] When the designated waveform is an S wave, the adjacent designated waveform of the S wave is a T wave; the target characteristic point of the S wave is a trough;
[0084] When the designated waveform is a Q wave, the adjacent designated waveform of the Q wave is an S wave; and the target characteristic point of the Q wave is a trough.
[0085] In a second aspect, an embodiment of the present application further provides a terminal, including:
[0086] one or more processors and memory;
[0087] The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the terminal to execute any one of the above-mentioned electrocardiogram signal quality detection methods.
[0088] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, comprising a computer program, which, when executed on a terminal, enables the terminal to execute any of the above-mentioned electrocardiogram signal quality detection methods.
[0089] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes executable instructions. When the executable instructions are executed on a terminal, the terminal executes any of the above-mentioned electrocardiogram signal quality detection methods.
[0090] In the fifth aspect, an embodiment of the present application also provides a chip system, which is applied to a terminal, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the terminal inputs data into the chip system, and executes any of the above-mentioned ECG signal quality detection methods to process the data and output the processing results.
[0091] The beneficial effects of the solutions provided by the embodiments in the second, third, fourth and fifth aspects can refer to the beneficial effects of the solutions provided by the embodiments in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in 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 paying creative labor.
[0093] Figure 1 A structural diagram of a terminal provided in an embodiment of the present application;
[0094] Figure 2 A software structure diagram of a terminal provided in an embodiment of the present application;
[0095] Figure 3a A diagram of an application scenario of the first type of ECG signal quality detection provided in an embodiment of the present application;
[0096] Figure 3b A display interface for the detection result of the first electrocardiogram signal provided in an embodiment of the present application;
[0097] Figure 3c A diagram of an application scenario of the second type of ECG signal quality detection provided in an embodiment of the present application;
[0098] Figure 3d A display interface for the detection result of the second electrocardiogram signal provided in an embodiment of the present application;
[0099] Figure 3e A display interface for the detection result of the third electrocardiogram signal provided in an embodiment of the present application;
[0100] Figure 4 A flowchart of a first electrocardiogram signal quality detection method provided in an embodiment of the present application;
[0101] Figure 5a A diagram of an application scenario of the third type of ECG signal quality detection provided in an embodiment of the present application;
[0102] Figure 5b for Figure 5a Four intentions for ECG signal quality detection in the application scenario shown;
[0103] Figure 6 A waveform diagram of the first electrocardiogram signal provided in an embodiment of the present application;
[0104] Figure 7 A flowchart of a second electrocardiogram signal quality detection method provided in an embodiment of the present application;
[0105] Figure 8 A waveform diagram of a second electrocardiogram signal provided in an embodiment of the present application;
[0106] Fig. 9 A flowchart of a third electrocardiogram signal quality detection method provided in an embodiment of the present application;
[0107] Fig.10 A flowchart of a fourth electrocardiogram signal quality detection method provided in an embodiment of the present application;
[0108] Fig.11 A waveform diagram of a third electrocardiogram signal provided in an embodiment of the present application;
[0109] Fig.12a A waveform diagram of a fourth electrocardiogram signal provided in an embodiment of the present application;
[0110] Figure 12bA waveform diagram of a fifth electrocardiogram signal provided in an embodiment of the present application;
[0111] Fig.13a A waveform diagram of a sixth electrocardiogram signal provided in an embodiment of the present application;
[0112] Fig.13b A waveform diagram of a seventh electrocardiogram signal provided in an embodiment of the present application;
[0113] Fig.14 A flowchart of an implementation method of an electrocardiogram signal quality detection method provided in an embodiment of the present application;
[0114] Fig.15 A structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0115] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0116] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first instruction and the second instruction are to distinguish different user instructions, and their order is not limited. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit them to be different.
[0117] It should be noted that, in this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0118] The ECG signal quality detection method provided in the embodiment of the present application is applied to a terminal. The terminal may be a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable electronic device (such as a watch, a bracelet), etc. The terminal may acquire the ECG signal of the user and perform quality detection on the acquired ECG signal according to the ECG signal detection method provided in the embodiment of the present application.
[0119] For example, Figure 1The structure diagram of the terminal 100 is shown. The terminal 100 may include a processor 110, a display screen 120, a camera 130, an internal memory 140, a subscriber identification module (Subscriber Identification Module, SIM) card interface 150, a universal serial bus (Universal Serial Bus, USB) interface 160, a charging management module 170, a battery management module 171, a battery 172 with a battery cell and a battery protection device, a sensor module 180, a mobile communication module 190, a wireless communication module 200, an antenna 1 and an antenna 2, etc. The sensor module 180 may include a pressure sensor 180A, a fingerprint sensor 180B, a touch sensor 180C, an ambient light sensor 180D, etc.
[0120] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0121] The processor 110 may include one or more processing units, for example: the processor 110 may include a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processor (NPU), etc. Among them, different processing units may be independent components or integrated into one or more processors. In some embodiments, the terminal 100 may also include one or more processors 110. Among them, the controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. In some other embodiments, a memory may also be provided in the processor 110 for storing instructions and data. Exemplarily, the memory in the processor 110 may be a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the terminal 100 in processing data or executing instructions.
[0122] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, a SIM card interface and / or a USB interface, etc. Among them, the USB interface 160 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 160 can be used to connect a charger to charge the terminal 100, and can also be used to transmit data between the terminal 100 and peripheral devices. The USB interface 160 can also be used to connect headphones to play audio through the headphones.
[0123] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is for illustrative purposes only and does not constitute a structural limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0124] The wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 190, the wireless communication module 200, the modem processor and the baseband processor.
[0125] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0126] The terminal 100 implements the display function through a GPU, a display screen 120, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 120 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0127] The display screen 120 is used to display images, videos, etc. The display screen 120 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal 100 may include one or more display screens 120.
[0128] In some embodiments of the present application, when the display panel is made of materials such as OLED, AMOLED, FLED, etc., the above Figure 1 The display screen 120 in the embodiment can be bent. Here, the display screen 120 can be bent means that the display screen can be bent to any angle at any position and can be kept at the angle, for example, the display screen 120 can be folded in half from the middle to the left or right. It can also be folded in half from the middle to the top or bottom.
[0129] The display screen 120 of the terminal 100 may be a flexible screen. Currently, flexible screens have attracted much attention for their unique characteristics and great potential. Compared with traditional screens, flexible screens are flexible and bendable, which can provide users with a new interaction method based on the bendable characteristics, and can meet more user demands for the terminal. For a terminal equipped with a foldable display screen, the foldable display screen on the terminal can be switched between a small screen in a folded form and a large screen in an unfolded form at any time. Therefore, users are using the split-screen function on terminals equipped with foldable displays more and more frequently.
[0130] The terminal 100 can realize the shooting function through the ISP, the camera 130, the video codec, the GPU, the display screen 120 and the application processor, etc., wherein the camera 130 includes a front camera and a rear camera.
[0131] The ISP is used to process the data fed back by the camera 130. For example, when shooting, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can perform algorithm optimization on the noise 15, brightness and color of the image. The ISP can also optimize the exposure and color temperature of the shooting scene and other parameters. In some embodiments, the ISP can be set in the camera 130.
[0132] The camera 130 is used to take photos or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard red green blue (RGB), YUV or other format. In some embodiments, the terminal 100 may include 1 or N cameras 130, where N is a positive integer greater than 1.
[0133] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0134] Video codecs are used to compress or decompress digital videos. Terminal 100 may support one or more video codecs. Thus, terminal 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0135] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0136] The internal memory 140 can be used to store one or more computer programs, which include instructions. The processor 110 can execute the above instructions stored in the internal memory 140, so that the terminal 100 executes the electronic card swiping method provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 140 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system; the program storage area can also store one or more applications (such as a gallery, contacts, etc.). The data storage area can store data (such as photos, contacts, etc.) created during the use of the terminal 100. In addition, the internal memory 140 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (Universal Flash Storage, UFS), etc. In some embodiments, the processor 110 can execute the electronic card swiping method provided in the embodiment of the present application, as well as other applications and data processing by running the instructions stored in the internal memory 140 and / or the instructions stored in the memory provided in the processor 110.
[0137] The internal memory 140 can be used to store the relevant programs of the electronic card swiping method provided in the embodiment of the present application, and the processor 110 can be used to call the relevant programs of the electronic card swiping method stored in the internal memory 140 when displaying information, and execute the electronic card swiping method of the embodiment of the present application.
[0138] The sensor module 180 may include a pressure sensor 180A, a fingerprint sensor 180B, a touch sensor 180C, an ambient light sensor 180D, and the like.
[0139] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 120. There are many types of pressure sensors 180A, for example, they can be resistive pressure sensors, inductive pressure sensors or capacitive pressure sensors. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When the force acts on the pressure sensor 180A, the capacitance between the electrodes changes, and the terminal 100 determines the intensity of the pressure according to the change in capacitance. When the touch operation acts on the display screen 120, the terminal 100 detects the touch operation according to the pressure sensor 180A. The terminal 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on a short message application icon, an instruction to view the short message is executed; when a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on a short message application icon, an instruction to create a new short message is executed.
[0140] The fingerprint sensor 180B is used to collect fingerprints. The terminal 100 can use the collected fingerprint characteristics to realize functions such as unlocking, accessing application locks, taking pictures, and answering calls.
[0141] The touch sensor 180C is also called a touch control device. The touch sensor 180C can be arranged on the display screen 120, and the touch sensor 180C and the display screen 120 form a touch screen, which is also called a touch control screen. The touch sensor 180C is used to detect a touch operation acting on or near it. The touch sensor 180C can pass the detected touch operation to the application processor to determine the type of touch event. A visual output related to the touch operation can be provided through the display screen 120. In other embodiments, the touch sensor 180C can also be arranged on the surface of the terminal 100, and is arranged at a different position from the display screen 120.
[0142] The ambient light sensor 180D is used to sense the ambient light brightness. The terminal 100 can adaptively adjust the brightness of the display screen 120 according to the perceived ambient light brightness. The ambient light sensor 180D can also be used to automatically adjust the white balance when shooting. The ambient light sensor 180D can also transmit the environment information of the device to the GPU.
[0143] The ambient light sensor 180D is also used to obtain the brightness, light ratio, color temperature, etc. of the environment in which the camera 130 captures images.
[0144] Figure 2A software structure block diagram of a terminal applicable to an embodiment of the present application. The software system of the terminal can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The layered architecture divides the software system of the terminal into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the software system can be divided into three layers, namely, an application layer (applications), an application framework layer (application framework), and a driver layer (hardware abstract layer, HAL).
[0145] The application layer can include a series of application packages. The application layer runs applications by calling the application programming interface (API) provided by the application framework layer. Figure 2 As shown, the application package may include multiple applications, such as camera, sports health, browser, music, etc. It can be understood that the port of each of the above applications can be used to receive data.
[0146] The application framework layer provides API and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, and a Dynamic Host Configuration Protocol (DHCP) module.
[0147] The driver layer is a layer between hardware and software, used to drive the hardware to make it work. The driver layer can be installed with multiple drivers for driving the hardware to work. For example, camera drivers, display drivers, audio drivers, and sensor drivers.
[0148] In addition, the terminal also includes a hardware layer, which may include a camera, a speaker, an AP, etc. The hardware layer is connected to the driver layer.
[0149] The following describes the internal workflow of the terminal executing the ECG signal quality detection solution provided in the embodiment of the present application.
[0150] Method 1:
[0151] The terminal is a wearable electronic device, such as a watch. The user sends an application program ( Figure 2The application runs in the processor. The calling module in the application calls the sensor to collect the user's ECG signal. The sensor returns the collected ECG signal to the application. The evaluation module in the application performs quality detection on the ECG signal to obtain the detection result of the ECG signal.
[0152] Method 2:
[0153] The terminal is a mobile phone and performs wireless communication with a wearable electronic device (such as a watch). For example, the terminal and the mobile phone are connected via Bluetooth.
[0154] The user sends the application to the application layer of the mobile phone ( Figure 2 Then, the calling module in the application calls the communication module to send the collection instruction to the wearable electronic device. After receiving the collection instruction, the communication module in the wearable electronic device calls the sensor to collect the user's ECG signal. The sensor returns the collected ECG signal to the communication module in the wearable electronic device. The communication module in the wearable electronic device uploads the collected ECG signal to the mobile phone. The communication module in the mobile phone returns the received ECG signal to the application, and the evaluation module in the application performs quality detection on the ECG signal to obtain the detection result of the ECG signal.
[0155] The application scenarios of the embodiments of the present application are described below.
[0156] In one application scenario, a watch (wearable electronic device) has a built-in ECG detection function. Accordingly, the user clicks the ECG detection function icon in the watch to instruct the watch to collect the user's ECG signal. Then, Figure 3a As shown, the user places his finger on the detection position on the side of the watch, and the watch starts to collect the user's ECG signal and displays the measurement waiting interface on the display screen of the watch. The measurement waiting interface shows that the current heart rate per minute is 80 and the remaining measurement time is 22 seconds. After collecting the ECG signal, the watch executes the method provided in the embodiment of the present application to perform quality detection on the ECG signal and outputs the detection result of the ECG signal.
[0157] Alternatively, after collecting the ECG signal, the watch can also upload the collected ECG signal to the mobile phone (terminal). The mobile phone executes the method provided in the embodiment of the present application to perform quality detection on the ECG signal and obtain the detection result of the ECG signal. In order to facilitate the user to browse the detection result of the ECG signal, the mobile phone can display Figure 3b The interface shown. Figure 3b The detection result of the ECG signal and the waveform of the ECG signal are displayed.
[0158] For example, Figure 3b The user's ECG signal type is shown as Sinus Rhythm. The user performed the ECG test on Dec 13, 2021 at 10:08 AM. The average heart rate (BPM average) is 66.
[0159] Figure 3b The sample details (SAMPLE DETAILS) are also displayed. Specifically, they include: Start Time: Dec 13, 2021 at 10:04:05 AM, and End Time: Dec 13, 2021 at 10:01:35 AM.
[0160] Figure 3b The app also displays prompts for users, including: This ECG does not show signs of atrial fibrillation, Export a PDF for Your Doctor, and If you believe you're having a heart attack or a medical emergency, call emergency service.
[0161] In another application scenario, a watch (wearable electronic device) has a built-in PWV detection function. Accordingly, the user clicks the icon of the PWV detection function in the watch to instruct the watch to collect the user's ECG signal and photoplethysmography (PPG) signal. Then, Figure 3c As shown, the user places his finger on the detection position on the side of the watch, and the watch starts to collect the user's ECG signal and PPG signal. In addition, the watch displays the measurement waiting interface.
[0162] In addition, during the measurement process, the mobile phone wirelessly connected to the watch can also display the measurement waiting interface. The measurement waiting interface shows that the current heart rate per minute is 70, the prompt message "Please keep your finger light and do not move during the test", and the remaining time of the measurement is 7 seconds.
[0163] Then, the watch uploads the user's ECG signal and PPG signal to the mobile phone (terminal). The mobile phone detects the user's PPG signal to obtain the detection result of the PPG signal, and executes the method provided in the embodiment of the present application to perform quality detection on the ECG signal to obtain the detection result of the ECG signal. Then, based on the detection result of the PPG signal and the detection result of the ECG signal, the detection result of the PWV is obtained. In order to facilitate the user to browse the PWV detection result, the mobile phone can display Figure 3d The interface shown.
[0164] Figure 3d The PWV test results shown include: arterial elasticity is normal, pulse wave velocity is 7.7m / s, heart rate is 88bmp, and the measurement time is 2022 / 4 / 25 19:16.
[0165] Figure 3d The following prompts are also displayed for the user:
[0166] The result of this arterial elasticity assessment is "normal", indicating that your arteries are currently soft.
[0167]
Health Advice
[0168] [Doctor's Tips] Maintaining normal arterial elasticity can reduce the risk of coronary heart disease, stroke and other events. A good diet structure helps maintain the health of arteries.
[0169] This test is not used as a basis for professional clinical diagnosis of vascular disease.
[0170] Users can Figure 3d Click the "History" operation button to view the historical PWV test results, and click the "Retest" operation button to perform PWV test again.
[0171] In addition, the user can view the user's pulse wave conduction waveform by clicking the "View Waveform" operation button. Figure 3e The interface shown. Figure 3e The PWV test results also show that the arterial elasticity is normal, the pulse wave velocity is 7.7m / s, and the heart rate is 88 bmp. The measurement time is 2022 / 4 / 25 19:16. And the prompt message: Your arteries are currently soft. This test is not used as a professional clinical diagnosis basis for vascular diseases.
[0172] Figure 3eThe waveform diagram also shows the comparison between the PWV test results of user A and the PWV test results of people of the same age. The waveform diagram records the target curve of pulse wave velocity (m / s) and age. The target area includes the standard curve, the high curve, and the low curve. It can be seen from the waveform diagram that the pulse wave velocity of user A is on the standard curve. Figure 3e There is also a prompt message displayed: The test results show that your risk of cardiovascular disease is within the standard range compared with people of the same age.
[0173] Users can Figure 3e Click the "Home" button in the menu to view the home page of the "Sports Health" app. Click the "Discover" button to search for relevant information. In addition, users can perform PWV detection by clicking the "Start Measurement" button. Click the "Device" button to view the wearable electronic devices connected to the terminal. Click the "My" button to view user-related information.
[0174] In another application scenario, it can also be applicable to other ECG two-lead acquisition scenarios. ECG two-lead refers to a method of using electrodes to connect to specified parts of the human body surface, and collecting the potential difference generated at the specified parts of the human body surface during the heart's electrical activity, and generating ECG signals based on the collected potential difference.
[0175] However, in the process of collecting ECG signals, there may be interference from various noises, such as the dryness or wetness of the finger skin, the slight friction between the skin electrodes, external interference, etc. These noises will seriously affect the quality of the collected ECG signals. In addition, the complexity of the ECG signal characteristics and the various interferences that may exist during the monitoring process make it difficult to ensure the accuracy of feature extraction and analysis of ECG signals, which in turn leads to low accuracy of ECG signal detection results, and feedback of low-accuracy detection results to users, which reduces user experience.
[0176] In the related art, there are not many ways to detect the quality of ECG signals of wearable electronic devices. Usually, ECG signals are detected through machine learning algorithm models or big data algorithms. However, the above methods have the following problems:
[0177] 1. The algorithm model using machine learning or big data algorithm also needs to be trained. There are data volume requirements and the process is relatively complex. The technical requirements are quite high. The algorithm model is generally large, the network structure is complex, and there are many network parameters. It is usually deployed on servers with strong processor capabilities. If it is deployed on wearable electronic devices with relatively low processor capabilities, the process of quality detection of ECG signals is relatively complicated, which will cause the algorithm model to run slower, resulting in a longer time-consuming detection of ECG signals, and reducing the detection efficiency of ECG signals.
[0178] 2. It is impossible to perform quality detection on ECG signals in real time. If the algorithm model is deployed on wearable electronic devices with relatively low processor capabilities, the algorithm model will use more processor resources, which will affect the performance of the wearable electronic devices. Therefore, the ECG signal evaluation method used in wearable electronic devices needs to be able to be transplanted into wearable electronic devices to achieve online evaluation of ECG signals without affecting the performance of the wearable electronic devices.
[0179] 3. When detecting ECG signals, analysis and evaluation are performed based on the characteristics of the ECG signals in the frequency domain (such as the power spectrum). If the power spectrum of the complete ECG signal is used for analysis and evaluation, errors in the evaluation will occur due to the overlap of the spectrum of a large amount of noise with the spectrum of the QRS complex. This will have a certain evaluation bias and reduce the accuracy of ECG signal quality detection.
[0180] Therefore, how to improve the efficiency, accuracy and reliability of ECG signal quality detection and evaluation is a technical problem to be solved by those skilled in the art.
[0181] In order to solve the above problems, the embodiment of the present application provides an ECG signal quality detection method, which extracts features from the specified waveform of the acquired ECG signal to obtain the target feature points of the ECG signal, wherein the distribution information in the target feature point ECG signal can reflect the quality of different signal segments in the ECG signal, and the quality data of each index item of the ECG signal calculated based on the distribution information of the target feature point in the ECG signal can reflect the quality of the ECG signal. The target quality data determined based on the quality data of each index item of the ECG signal can also represent the quality of the ECG signal, which can improve the accuracy and reliability of the detection of the ECG signal. Moreover, there is no need to use an algorithm model to perform quality detection on the ECG signal, which reduces the complexity of detecting the ECG signal, and can also reduce the time consumption of detecting the ECG signal, thereby improving the detection efficiency of the ECG signal. In addition, the ECG signal quality detection method provided in the embodiment of the present application can be transplanted into wearable electronic devices, that is, it can be directly applied to wearable electronic devices to realize online real-time evaluation of ECG signals without affecting the performance of the wearable electronic devices.
[0182] Next, the ECG signal quality detection method provided in the embodiment of the present application is described in detail through specific embodiments.
[0183] In one embodiment of the present application, see Figure 4 , Figure 4 A flowchart of an electrocardiogram signal quality detection method provided in an embodiment of the present application, the method is applied to a terminal, and the method may include the following steps:
[0184] S401: Acquire collected ECG signals.
[0185] S402: Extract features from a designated waveform in the ECG signal to obtain target feature points of the ECG signal.
[0186] S403: Calculate quality data of each indicator item of the ECG signal based on the distribution information of the target feature point in the ECG signal.
[0187] S404: Calculate target quality data of the ECG signal based on the quality data of each indicator item of the ECG signal.
[0188] As can be seen from the above, in the technical solution provided by this embodiment, the distribution information in the target feature ECG signal is the feature of the ECG signal in the time domain, and can reflect the quality of different signal segments in the ECG signal. The quality data of each index item of the ECG signal calculated based on the distribution information of the target feature point in the ECG signal can reflect the quality of the ECG signal. The target quality data determined based on the quality data of each index item of the ECG signal can also represent the quality of the ECG signal, avoiding the overlap of the spectrum of the noise and the spectrum of the QRS complex in the frequency domain to cause evaluation errors, and can improve the accuracy and reliability of the detection of the ECG signal.
[0189] Furthermore, there is no need to use a large amount of sample data to train the algorithm model, nor is there a need to use the algorithm model to perform quality detection on the ECG signal. The amount of data required is relatively small, and no complex network structure and a large number of network parameters will be generated. The technical solution provided in this embodiment is simple in process and runs at a relatively fast speed, which can reduce the complexity of detecting the ECG signal, and can also reduce the time consumption of detecting the ECG signal, thereby improving the detection efficiency of the ECG signal. In addition, the ECG signal quality detection method provided in the embodiment of the present application can be transplanted into wearable electronic devices, that is, it can be directly applied to wearable electronic devices to realize online real-time evaluation of ECG signals, use less processor resources of the terminal, and does not affect the performance of the wearable electronic device.
[0190] For step S401, the terminal acquires the collected ECG signal. When the terminal is a wearable electronic device such as a watch, the terminal directly collects the user's ECG signal. For example, Figure 5a The watch shown has an "ECG" application installed. When the user clicks the application icon of the "ECG" application, the watch determines that it has received the collection instruction. The watch starts collecting the user's ECG signal and displays Figure 5b In the measurement waiting interface shown, “measuring” indicates that the user’s ECG signal is being collected.
[0191] When the terminal is a mobile phone or other device, the terminal is wirelessly connected to the wearable electronic device. The wearable electronic device is connected according to Figure 5a and Figure 5b The method shown collects the user's electrocardiogram signal, and after the user's electrocardiogram signal is collected, the collected electrocardiogram signal is uploaded to the terminal.
[0192] In some embodiments, when collecting ECG signals, the user may not be completely still, and the user's movement amplitude may affect the quality of the collected ECG signals. Therefore, after collecting the ECG signals, the ECG signals with large user movement amplitudes are filtered out, and the filtered ECG signals are used for subsequent quality detection. For example, Fig.10 In step 1, the data with large motion interference is filtered out through the ACC signal to obtain the filtered data (i.e., the filtered ECG signal). The ACC signal refers to the signal indicating the user's motion amplitude detected by the level meter.
[0193] With respect to step S402, after acquiring the ECG signal, the terminal extracts the target feature points in the ECG signal. Figure 6 , Figure 6 A waveform diagram of an electrocardiogram signal provided in an embodiment of the present application, the waveform diagram represents a standard electrocardiogram signal. Figure 6 It can be seen that the ECG signal includes T wave (T wave), Q wave (Q wave), R wave (R wave), S wave (S wave) and P wave (P wave).
[0194] Among them, the P wave reflects the potential change of the atrial muscle depolarization process. The excitement of the heart originates from the sinoatrial node and is first transmitted to the atrium, causing it to be excited. Therefore, the P wave appears first in the waveform of the ECG signal. The duration of the Р wave (i.e. the width of the wave) is usually less than 0.11 seconds.
[0195] Q wave, R wave and S wave are all waveforms that reflect ventricular excitation, collectively known as QRS (QRS Complex). QRS complex reflects the potential changes during the depolarization of ventricular muscle. The QRS complex includes three closely connected waves. The first downward wave is the Q wave, the first upward wave is the R wave, and the downward wave after the R wave is the S wave. The total duration of the Q wave, R wave and S wave does not exceed 0.1 seconds.
[0196] The T wave reflects the potential changes caused by the late repolarization process of the ventricular muscle. The direction of the T wave is usually consistent with the direction of the R wave.
[0197] The PR interval is the interval from the starting point of the Р wave to the starting point of the QRS complex (i.e. the starting point of the Q wave), reflecting the total duration from the depolarization of the atrial muscle to the beginning of the depolarization of the ventricular muscle, usually in the range of 0.12-0.2 seconds.
[0198] The PR segment is the interval from the end of the P wave to the beginning of the QRS complex, reflecting the process from the excitement to the contraction of the atrial muscle. It can be used to evaluate the conduction time of the atrioventricular node and the excitability of the atrial muscle. The PR segment is usually 0.06-0.1 seconds. The PR segment usually coincides with the baseline.
[0199] The ST segment is the interval from the end of the QRS complex (i.e. the end of the S wave) to the beginning of the T wave, reflecting the total time from the completion of ventricular depolarization to the beginning of repolarization. The ST segment usually coincides with the baseline.
[0200] The QT interval is the interval from the start of the QRS complex to the end of the T wave, reflecting the total time from the beginning of depolarization to the completion of repolarization of the entire ventricular muscle, also known as the cardiac electrical contraction time. The value of cardiac electrical contraction time varies with the heart rate. Usually, when the heart rate is 60-90 beats / minute, the QT interval is about 0.36-0.43 seconds.
[0201] The terminal extracts features of a specified waveform in the ECG signal to obtain feature points of the specified waveform, thereby obtaining target feature points of the ECG signal.
[0202] The specified waveform includes at least one of the following: P wave, Q wave, R wave, S wave and T wave. That is, the terminal can choose to extract the characteristic points of the P wave of the electrocardiogram signal, or choose to extract the characteristic points of the QRS complex, or choose to extract the characteristic points of the T wave, etc.
[0203] Among them, the target characteristic point of the P wave is the wave crest, such as Figure 6 The target characteristic point of the Q wave is the trough, as shown in Figure 6 The target characteristic point of the R wave is the peak, as shown in Figure 6 The target characteristic point of the S wave is the trough, as shown in Figure 6 The target characteristic point of the T wave is the wave crest, as shown in Figure 6 As shown at point T in .
[0204] When the specified waveform includes P wave, Q wave, R wave, S wave and T wave, the extracted target feature points also include: the peak of the P wave, the trough of the Q wave, the peak of the R wave, the trough of the S wave, and the peak of the T wave.
[0205] In some embodiments, step S402 includes: performing feature extraction on a designated waveform of the ECG signal within the sliding window according to a preset sliding window size to obtain target feature points of the ECG signal within the sliding window.
[0206] When performing ECG signal detection, ECG signals of 1 minute in length are usually collected. In order to accurately extract the target feature points of the ECG signal, the ECG signal can be divided into multiple signal segments according to the preset sliding window size. The ECG signal within a sliding window is a signal segment, and then the specified waveform of the ECG signal in each sliding window is feature extracted to obtain the target feature points of the ECG signal in the sliding window.
[0207] The size of the sliding window is set according to the requirements. For example, the size of the sliding window may be 10 seconds. Alternatively, the size of the sliding window may be 20 seconds, which is not specifically limited in this embodiment.
[0208] As can be seen from the above, the solution provided in this embodiment establishes a sliding window in the time domain to extract the target feature points of the ECG signal, which can segment the ECG signal, improve the accuracy of the extracted target feature points, and further improve the accuracy of the quality detection of the ECG signal.
[0209] In some embodiments, Figure 4 Based on Figure 7 , the method for the terminal to extract the target feature points of the electrocardiogram signal may include the following steps:
[0210] S4021: For each sliding window, determine a specified waveform in the electrocardiogram signal in the sliding window.
[0211] The specified waveform includes at least one of the following: P wave, Q wave, R wave, S wave and T wave.
[0212] S4022: Extract feature points of a specified waveform within the sliding window to obtain a first feature point.
[0213] S4023: Based on the spacing of the first feature points, determine a second waveform in which an abnormality occurs when extracting feature points within the sliding window.
[0214] S4024: Determine a target feature point of the electrocardiogram signal in the sliding window based on the first feature point and a result of feature extraction of the second waveform in the sliding window.
[0215] For each sliding window, the terminal first determines the specified waveform in the ECG signal in the sliding window. That is, the P wave, Q wave, R wave, S wave and T wave in the sliding window are determined. Then, the determined specified waveform is feature extracted to obtain the first feature point. At this time, the first feature point includes the feature points of the P wave, Q wave, R wave, S wave and T wave extracted for the first time.
[0216] Since the ECG signal may be interfered when being collected, some waveforms of the ECG signal may not have obvious features, and feature points may be missed, or noise points caused by interference may lead to multiple feature points being extracted. Therefore, the terminal detects the second waveform in which an abnormality occurs when extracting feature points within the sliding window based on the spacing of the first feature points that have been extracted.
[0217] In some embodiments, step S4023 may include the following steps: for each specified waveform, calculating the distance between the first feature point of the specified waveform and the adjacent specified waveform to obtain multiple peak-to-peak distances. Based on the multiple peak-to-peak distances, determining an anomaly detection threshold. The anomaly detection threshold is used to detect whether the waveform between two adjacent specified waveforms is the second waveform where an anomaly occurs when extracting feature points.
[0218] If the distance between the first feature point of the specified waveform and the adjacent specified waveform is greater than the first abnormality detection threshold, the waveform between the specified waveform and the adjacent specified waveform is determined to be a first type second waveform. There are unextracted feature points in the first type second waveform. If the distance between the first feature point of the specified waveform and the adjacent specified waveform is less than the second abnormality detection threshold, the waveform between the specified waveform and the adjacent specified waveform is determined to be a second type second waveform. There are multiple extracted feature points in the second type second waveform; the first abnormality detection threshold is greater than the second abnormality detection threshold.
[0219] In some embodiments, when the specified waveform is an R wave, the adjacent specified waveform of the R wave is the R wave; and the target characteristic point of the R wave is the peak. When the specified waveform is a T wave, the adjacent specified waveform of the T wave is the P wave; and the target characteristic points of the T wave and the P wave are the peak. When the specified waveform is an S wave, the adjacent specified waveform of the S wave is the T wave; and the target characteristic point of the S wave is the trough. When the specified waveform is a Q wave, the adjacent specified waveform of the Q wave is the S wave; and the target characteristic point of the Q wave is the trough.
[0220] As can be seen from the above, the solution provided in this embodiment combines the characteristics of the Q wave, R wave, S wave, T wave and P wave in the ECG signal to perform ECG signal detection, thereby improving the accuracy of quality detection of the ECG signal.
[0221] For different designated waveforms, the terminal may detect the second waveform in different ways.
[0222] Method 1:
[0223] The specified waveform is an R wave, and the adjacent specified waveform of the R wave is the next R wave. Figure 8 The R wave adjacent to R1 is R2.
[0224] Correspondingly, the distance between the first characteristic points of every two adjacent R waves in the sliding window is calculated to obtain multiple peak-to-peak distances; that is, the interval between the peak of each R wave and the peak of the next R wave is calculated to obtain multiple peak-to-peak distances. If no abnormality occurs when extracting characteristic points, the distance between every two adjacent R waves is close, that is, the difference in the multiple peak-to-peak distances is small. If the peak-to-peak distance between one R wave and the adjacent R wave is much larger than the peak-to-peak distance between other R waves and the adjacent R waves, it can be considered that there are missed characteristic points between the R wave and the adjacent R wave, that is, the waveform between the R wave and the adjacent R wave is the second waveform with abnormality. If the peak-to-peak distance between one R wave and the adjacent R wave is much smaller than the peak-to-peak distance between other R waves and the adjacent R waves, it can be considered that the R wave and the adjacent R wave may be missed characteristic points, that is, the waveform between the R wave and the adjacent R wave is the second waveform with abnormality.
[0225] Accordingly, an anomaly detection threshold is determined based on multiple peak-to-peak spacings. For example, quantiles of multiple peak-to-peak spacings, such as quartiles, are calculated. A first multiple of the quantile is determined as a first anomaly detection threshold, and a second multiple of the quantile is determined as a second anomaly detection threshold.
[0226] The first abnormality detection threshold is used to detect whether the waveform between every two adjacent R waves misses a feature point, and the second abnormality detection threshold is used to detect whether every two adjacent R waves are multiple feature points. The first abnormality detection threshold needs to be greater than the second abnormality detection threshold. Accordingly, the first multiple is greater than the second multiple. For example, the first multiple is 1.5, or 1.3, etc., and the second multiple is 0.5, or 0.3, etc., which is not specifically limited in the embodiments of the present application.
[0227] For each R wave in the sliding window, if the distance between the first characteristic point of the R wave and the adjacent R wave is greater than the first abnormality detection threshold, there is a missed characteristic point between the R wave and the adjacent R wave, and the waveform between the two adjacent R waves is determined to be a first-type target waveform with a missed characteristic point. If the distance between the first characteristic point of the R wave and the adjacent R wave is less than the second abnormality detection threshold, the R wave and the adjacent R wave may be multiple characteristic points, and the waveform between the two adjacent R waves is determined to be a second-type target waveform with multiple characteristic points.
[0228] Method 2:
[0229] The specified waveform is a T wave, and the adjacent specified waveform of the T wave is the next P wave. That is, the adjacent T wave and P wave refer to the waveform between two adjacent R waves, and there is no R wave between the adjacent T wave and P wave. For example, Figure 8 The P wave adjacent to T1 is P2.
[0230] For each T wave in the sliding window, the spacing between the first characteristic points of the T wave and the adjacent P wave is calculated to obtain multiple peak spacings. If no abnormality occurs when extracting the characteristic points, the spacing between the T wave and the adjacent P wave is close, that is, the difference in the multiple peak spacings is small. If the peak spacing between a T wave and an adjacent P wave is much larger than the peak spacing between other T waves and adjacent P waves, it can be considered that there are missed characteristic points between the T wave and the adjacent P wave, that is, the waveform between the T wave and the adjacent P wave is the second waveform with an abnormality. If the peak spacing between a T wave and an adjacent P wave is much smaller than the peak spacing between other T waves and adjacent P waves, it can be considered that the T wave and the adjacent P wave may be multiple characteristic points, that is, the waveform between the T wave and the adjacent P wave is the second waveform with an abnormality.
[0231] Accordingly, an anomaly detection threshold is determined based on multiple peak-to-peak spacings. For example, quantiles of multiple peak-to-peak spacings, such as quartiles, are calculated. A first multiple of the quantile is determined as a first anomaly detection threshold, and a second multiple of the quantile is determined as a second anomaly detection threshold.
[0232] The first abnormality detection threshold is used to detect whether the waveform between the T wave and the adjacent P wave misses a feature point, and the second abnormality detection threshold is used to detect whether the T wave and the adjacent P wave are multiple feature points. The first abnormality detection threshold needs to be greater than the second abnormality detection threshold. Correspondingly, the first multiple is greater than the second multiple. For example, the first multiple is 1.5, or 1.3, etc., and the second multiple is 0.5, or 0.3, etc., which is not specifically limited in the embodiments of the present application.
[0233] For each T wave in the sliding window, if the distance between the first characteristic point of the T wave and the adjacent P wave is greater than the first abnormality detection threshold, there is a missed characteristic point between the T wave and the adjacent P wave, and the waveform between the T wave and the adjacent P wave is determined to be a first-type target waveform with a missed characteristic point. If the distance between the first characteristic point of the T wave and the adjacent P wave is less than the second abnormality detection threshold, the T wave and the adjacent P wave may be multiple characteristic points, and the waveform between the T wave and the adjacent P wave is determined to be a second-type target waveform with multiple characteristic points.
[0234] Method 3:
[0235] The specified waveform is the S wave, and the adjacent specified waveform of the S wave is the next T wave. That is, the adjacent S wave and T wave refer to the waveform between two adjacent R waves, and there is no R wave between adjacent S waves and T waves. Figure 6 In the cerebral ischemia, the S wave and the T wave are adjacent. Figure 8 The T wave adjacent to S1 is T1, and the T wave adjacent to S2 is T2.
[0236] For each S wave in the sliding window, the spacing between the first characteristic points of the S wave and the adjacent T wave is calculated to obtain multiple peak spacings. If no abnormality occurs when extracting the characteristic points, the spacing between the S wave and the adjacent T wave is close, that is, the difference between the multiple peak spacings is small. If the peak spacing between an S wave and an adjacent T wave is much larger than the peak spacing between other S waves and adjacent T waves, it can be considered that there are missed characteristic points between the S wave and the adjacent T wave, that is, the waveform between the S wave and the adjacent T wave is the second waveform with abnormality. If the peak spacing between an S wave and an adjacent T wave is much smaller than the peak spacing between other S waves and adjacent T waves, it can be considered that the S wave and the adjacent T wave may be multiple characteristic points, that is, the waveform between the S wave and the adjacent T wave is the second waveform with abnormality.
[0237] Accordingly, an anomaly detection threshold is determined based on multiple peak-to-peak spacings. For example, quantiles of multiple peak-to-peak spacings, such as quartiles, are calculated. A first multiple of the quantile is determined as a first anomaly detection threshold, and a second multiple of the quantile is determined as a second anomaly detection threshold.
[0238] The first abnormality detection threshold is used to detect whether the waveform between the S wave and the adjacent T wave misses a feature point, and the second abnormality detection threshold is used to detect whether the S wave and the adjacent T wave are multiple feature points. The first abnormality detection threshold needs to be greater than the second abnormality detection threshold. Correspondingly, the first multiple is greater than the second multiple. For example, the first multiple is 1.5, or 1.3, etc., and the second multiple is 0.5, or 0.3, etc., which is not specifically limited in the embodiments of the present application.
[0239] For each S wave in the sliding window, if the distance between the first characteristic point of the S wave and the adjacent T wave is greater than the first abnormality detection threshold, there is a missed characteristic point between the S wave and the adjacent T wave, and the waveform between the S wave and the adjacent T wave is determined to be a first-type target waveform with a missed characteristic point. If the distance between the first characteristic point of the S wave and the adjacent T wave is less than the second abnormality detection threshold, the S wave and the adjacent T wave may be multiple characteristic points, and the waveform between the S wave and the adjacent T wave is determined to be a second-type target waveform with multiple characteristic points.
[0240] Method 4:
[0241] The specified waveform is the Q wave, and the adjacent specified waveform of the Q wave is the next S wave. That is, the adjacent Q wave and S wave refer to the Q wave on the left of the R wave and the S wave on the right of the R wave, that is, there is an R wave between the adjacent Q wave and S wave. Figure 6 In the , Q wave and S wave are adjacent. Figure 8 The S wave adjacent to Q1 is S1, and the S wave adjacent to Q2 is S2.
[0242] For each Q wave in the sliding window, the distance between the first characteristic point of the Q wave and the adjacent S wave is calculated to obtain multiple peak-to-peak distances. If no abnormality occurs when extracting characteristic points, the distance between the Q wave and the adjacent S wave is close, that is, the difference in the multiple peak-to-peak distances is small. If the peak-to-peak distance between a Q wave and an adjacent S wave is much larger than the peak-to-peak distance between other Q waves and adjacent S waves, it can be considered that there are missed characteristic points between the Q wave and the adjacent S wave, that is, the waveform between the Q wave and the adjacent S wave is the second waveform where an abnormality occurs. If the peak-to-peak distance between a Q wave and an adjacent S wave is much smaller than the peak-to-peak distance between other Q waves and adjacent S waves, it can be considered that the Q wave and the adjacent S wave may be missed characteristic points, that is, the waveform between the Q wave and the adjacent S wave is the second waveform where an abnormality occurs.
[0243] Accordingly, an anomaly detection threshold is determined based on multiple inter-peak distances. For example, the mean of multiple inter-peak distances is calculated. A first multiple of the mean is determined as a first anomaly detection threshold, and a second multiple of the quantile is determined as a second anomaly detection threshold.
[0244] The first abnormality detection threshold is used to detect whether the waveform between the Q wave and the adjacent S wave misses a feature point, and the second abnormality detection threshold is used to detect whether the Q wave and the adjacent S wave are multiple feature points. The first abnormality detection threshold needs to be greater than the second abnormality detection threshold. Accordingly, the first multiple is greater than the second multiple. For example, the first multiple is 2.5, or 2, etc., and the second multiple is 0.5, or 0.2, etc., which is not specifically limited in the embodiments of the present application.
[0245] For each Q wave in the sliding window, if the distance between the first feature point of the Q wave and the adjacent S wave is greater than the first anomaly detection threshold, there is a missed feature point between the Q wave and the adjacent S wave, and the waveform between the Q wave and the adjacent S wave is determined to be a first-type target waveform with a missed feature point. If the distance between the first feature point of the Q wave and the adjacent S wave is less than the second anomaly detection threshold, the Q wave and the adjacent S wave may be multiple feature points, and the waveform between the Q wave and the adjacent S wave is determined to be a second-type target waveform with multiple feature points.
[0246] In some embodiments, step S4024 may include the following steps: extracting feature points in the first type second waveform, adding the obtained feature points to the first feature points, determining multiple extracted first feature points in the second type second waveform, removing the multiple extracted first feature points, and returning to execute step S4023.
[0247] There are unextracted feature points in the first type of second waveform, and there are over-extracted feature points in the second type of second waveform.
[0248] After determining that there is a first-type second waveform with unextracted feature points, the terminal can perform fine feature extraction on the first-type second waveform, such as using an amplifier to extract features of the first-type second waveform, obtain newly extracted feature points, and add the newly extracted feature points to the first feature points.
[0249] After determining that there is a second type of second waveform with multiple extracted feature points, the terminal can remove the multiple extracted first feature points from the first feature points. Exemplarily, if the third R wave and the fourth R wave in the sliding window are the second type of second waveform, the peak-to-peak spacing between the third R wave and the second R wave, and the peak-to-peak spacing between the fourth R wave and the fifth R wave are obtained. If the peak-to-peak spacing between the third R wave and the second R wave is not less than the second abnormality detection threshold, the third R wave is not a multiple extracted feature point, and if the peak-to-peak spacing between the fourth R wave and the fifth R wave is less than the second abnormality detection threshold, the fourth R wave is a multiple extracted feature point, and the feature point of the fourth R wave is removed.
[0250] After adding the newly extracted feature points to the first feature points and removing the feature points that are extracted more than once in the first feature points, the current first feature points are obtained, and the current first feature points include the feature points extracted for the first time and the feature points extracted for the second time. Based on the spacing of the current first feature points, the terminal detects the second waveform that is abnormal when extracting the feature points in the sliding window again, and determines the current first feature point based on the current first feature points and the result of feature extraction of the second waveform determined this time, and so on, until the second waveform that is abnormal when extracting the feature points in the sliding window is not detected, and the target feature point of the electrocardiogram signal in the sliding window is obtained.
[0251] From the above, it can be seen that the solution provided in this embodiment detects whether an abnormality occurs during feature extraction based on the extracted first feature point, and re-extracts the missed feature points when an abnormality occurs, and removes the over-extracted feature points, which can improve the accuracy of the extracted target feature points, and thereby improve the accuracy of quality detection of ECG signals.
[0252] For step S403, the distribution information of the target feature points in the ECG signal includes information such as the distance between the target feature points, the amplitude of the target feature points, the slope of the target feature points, etc. The distribution information of the target feature points is used to reflect the quality of different signal segments in the ECG signal.
[0253] Accordingly, the quality data of each indicator item of the electrocardiogram signal can be calculated based on the distribution information of the target feature point in the electrocardiogram signal.
[0254] In some embodiments, the specified waveform includes at least one of the following: P wave, Q wave, R wave, S wave and T wave. Correspondingly, the index item includes at least one of the following: R wave related index item; S wave and T wave related index item; T wave and P wave related index item; Q wave and S wave related index item; characteristic point related index item; waveform related index item.
[0255] As can be seen from the above, the solution provided in this embodiment combines the characteristics of the Q wave, R wave, S wave, T wave and P wave in the ECG signal to perform ECG signal detection, thereby improving the accuracy of quality detection of the ECG signal.
[0256] The index items related to R wave are used to reflect the quality of the signal segment of R wave; the index items related to S wave and T wave are used to reflect the quality of the signal segment from S wave to T wave; the index items related to T wave and P wave are used to reflect the quality of the signal segment from T wave to P wave; the index items related to Q wave and S wave are used to reflect the quality of the signal segment from Q wave to S wave; the index items related to feature points are used to reflect the overall quality of ECG signals; the index items related to waveform are used to reflect the quality of the signal segment from S wave to T wave, and the signal segment from T wave to P wave.
[0257] In some embodiments, step S403 may include the following steps: for each sliding window, based on the distribution information of the target feature point in the sliding window, calculating the quality data of each indicator item of the electrocardiogram signal in the sliding window.
[0258] According to the sliding window, the quality data of each indicator item in each sliding window is calculated respectively. For example, Fig.10 Step 2 in the above method is to extract various signal evaluation parameters from the filtered data. The filtered data is the filtered ECG signal in the above embodiment.
[0259] As can be seen from the above, the solution provided in this embodiment establishes a sliding window in the time domain, and determines the quality data of each indicator item of the ECG signal in each sliding window respectively. The ECG signal can be processed in segments, thereby improving the accuracy of the quality data of each indicator item of the ECG signal in the calculated sliding window, and further improving the accuracy of the quality detection of the ECG signal.
[0260] In some embodiments, Figure 4 Based on Fig. 9 , step S403 may include the following steps:
[0261] S4031: For each sliding window, based on the amplitude of the target feature point of each R wave in the sliding window and the distance between the target feature points of adjacent R waves, calculate the quality data of the index items related to the R wave of the ECG signal in the sliding window.
[0262] Among them, the target characteristic point of the R wave is the wave peak.
[0263] S4032: Calculate the quality data of the index items related to the S wave and the T wave of the ECG signal in the sliding window based on the slope of the target feature points of each S wave and the adjacent T wave in the sliding window, and the distance between the target feature points of the S wave and the adjacent T wave.
[0264] Among them, the target characteristic point of the S wave is the trough; the target characteristic point of the T wave is the peak.
[0265] S4033: Based on the slope of the target feature points of each T wave and the adjacent P wave in the sliding window, and the distance between the target feature points of the T wave and the adjacent P wave, the quality data of the index items related to the T wave and the P wave of the ECG signal in the sliding window are calculated.
[0266] Among them, the target characteristic point of the P wave is the wave crest.
[0267] S4034: Calculate the quality data of the index items related to the Q wave and the S wave of the electrocardiogram signal in the sliding window based on the amplitude of the target feature point of each Q wave and the adjacent S wave in the sliding window.
[0268] Among them, the target characteristic point of the Q wave is the trough.
[0269] S4035: Based on the total number of target feature points in the sliding window, calculate quality data of index items related to the feature points of the electrocardiogram signal in the sliding window.
[0270] S4036: Calculate quality data of indicators related to the waveform of the ECG signal in the sliding window based on the instantaneous slope of each S wave and the adjacent T wave in the sliding window, and / or the instantaneous slope of each T wave and the adjacent P wave.
[0271] Among them, the instantaneous slope of the S wave and the adjacent T wave includes: the slope of each sampling point between the target feature points of the S wave and the adjacent T wave; the instantaneous slope of the T wave and the adjacent P wave includes: the slope of each sampling point between the target feature points of the T wave and the adjacent P wave.
[0272] The R wave related index item includes a first index item and a second index item. For each sliding window, the quality data of the first index item related to the R wave of the electrocardiogram signal in the sliding window is calculated based on the amplitude of the target feature point of each R wave in the sliding window. And the quality data of the second index item related to the R wave of the electrocardiogram signal in the sliding window is calculated based on the spacing between the target feature points of adjacent R waves.
[0273] For each sliding window, the mean amplitude of the target feature points of each R wave in the sliding window is calculated to obtain the reference amplitude. Fig.10In step 3, the R peak value (amplitude) of each QRS complex in the window and the mean amplitude of the entire window are calculated.
[0274] For each R wave in the sliding window, a first offset degree of the amplitude of the target feature point of the R wave relative to the reference amplitude is calculated. From each R wave in the sliding window, a first number of R waves whose first offset degree is greater than an offset threshold is determined. The offset threshold may be 60%.
[0275] Then, the quality data of the first indicator item related to the R wave of the electrocardiogram signal in the sliding window is determined based on the first number. For example, the first number is used as the quality data of the first indicator item related to the R wave of the electrocardiogram signal in the sliding window.
[0276] For each sliding window, the mean value of the distance between each two adjacent target feature points of the R wave in the sliding window is calculated to obtain the first reference distance. Fig.10 In step 4, calculate each RR distance (peak-to-peak distance) within the window and the mean distance of the entire window.
[0277] For each R wave in the sliding window, a second offset degree of the distance between the target feature point of the R wave and the adjacent R wave relative to the first reference distance is calculated. From each R wave in the sliding window, a second number of R waves whose second offset degree is greater than an offset threshold is determined. The offset threshold may be 30%.
[0278] Then, the quality data of the second indicator item related to the R wave of the electrocardiogram signal in the sliding window is determined based on the second number. For example, the second number is used as the quality data of the second indicator item related to the R wave of the electrocardiogram signal in the sliding window.
[0279] The index items related to the S wave and the T wave include a first index item and a second index item. For each sliding window, based on the slope of the target feature points of each S wave and the adjacent T wave in the sliding window, the quality data of the first index item related to the S wave and the T wave of the electrocardiogram signal in the sliding window is calculated. And based on the spacing between the target feature points of the S wave and the adjacent T wave, the quality data of the second index item related to the S wave and the T wave of the electrocardiogram signal in the sliding window is calculated.
[0280] For each S wave in the sliding window, each sampling point between the target feature point of the S wave and the target feature point of the adjacent T wave is determined, and the target feature point of the S wave, the target feature point of the adjacent T wave, and the slope of each determined sampling point are calculated respectively. Each sampling point is a sampling point when the ECG signal is collected.
[0281] Then, the target feature point of the S wave, the target feature point of the adjacent T wave, and the standard deviation of the slope of each determined sampling point are calculated to obtain the slope fluctuation coefficient of the S wave and the adjacent T wave. Correspondingly, the slope fluctuation coefficient of the S wave and the adjacent T wave represents: the slope change of each sampling point between the target feature point of the S wave and the target feature point of the adjacent T wave.
[0282] The average of the slope fluctuation coefficients of each S wave and the adjacent T wave in the sliding window is calculated to obtain the first reference coefficient. Fig.10 Step 1 in the above method calculates the ST slope fluctuation coefficient (standard deviation) of each RR interval in the window and the fluctuation mean of the entire window. For each S wave in the sliding window, calculate the third offset degree of the slope fluctuation coefficient of the S wave and the adjacent T wave relative to the first reference coefficient. From each S wave in the sliding window, determine the third number of S waves whose third offset degree is greater than the offset threshold; wherein the offset threshold is 50%.
[0283] Furthermore, the quality data of the first indicator item related to the S wave and the T wave of the electrocardiogram signal in the sliding window is determined based on the third number. For example, the third number is used as the quality data of the first indicator item related to the S wave and the T wave of the electrocardiogram signal in the sliding window.
[0284] For each S wave in the sliding window, the distance between the target feature point of the S wave and the adjacent T wave is calculated, and the distance average of the distances between the target feature points of each S wave and the adjacent T wave is calculated to obtain a second reference distance. Fig.10 In step 1, the ST interval of each RR interval in the window and the fluctuation mean of the entire window are calculated.
[0285] For each S wave in the sliding window, a fourth offset degree of the distance between the target feature point of the S wave and the adjacent T wave relative to the second reference distance is calculated. The sum of the number of S waves whose fourth offset degree is greater than the first offset threshold and the number of S waves whose fourth offset degree is less than the second offset threshold is calculated to obtain a fourth number. The first offset threshold is 30% and the second offset threshold is 40%.
[0286] Furthermore, the quality data of the second indicator item related to the S wave and the T wave of the electrocardiogram signal in the sliding window is determined based on the fourth number. For example, the fourth number is used as the quality data of the second indicator item related to the S wave and the T wave of the electrocardiogram signal in the sliding window.
[0287] The index items related to T waves and P waves include a first index item and a second index item. For each sliding window, based on the slope of the target feature points of each T wave and the adjacent P wave in the sliding window, the quality data of the first index item related to the T wave and the P wave of the electrocardiogram signal in the sliding window is calculated. And based on the spacing between the target feature points of the T wave and the adjacent P wave, the quality data of the second index item related to the T wave and the P wave of the electrocardiogram signal in the sliding window is calculated.
[0288] For each T wave in the sliding window, each sampling point between the target feature point of the T wave and the target feature point of the adjacent P wave is determined, and the target feature point of the T wave, the target feature point of the adjacent P wave, and the slope of each determined sampling point are calculated respectively. The standard deviation of the target feature point of the T wave, the target feature point of the adjacent P wave, and the slope of each determined sampling point is calculated to obtain the slope fluctuation coefficient of the T wave and the adjacent P wave. Accordingly, the slope fluctuation coefficient of the T wave and the adjacent P wave represents: the slope change of each sampling point between the target feature point of the T wave and the target feature point of the adjacent P wave.
[0289] The average of the slope fluctuation coefficients of each T wave and the adjacent P wave in the sliding window is calculated to obtain the second reference coefficient. Fig.10 Step 2 in the sliding window calculates the TP slope fluctuation coefficient (standard deviation) of each RR interval in the window and the fluctuation mean of the window as a whole. For each T wave in the sliding window, calculate the fifth offset degree of the slope fluctuation coefficient of the T wave and the adjacent P wave relative to the second reference coefficient. From each T wave in the sliding window, determine the fifth number of T waves whose fifth offset degree is greater than the offset threshold. The offset threshold is 50%.
[0290] Furthermore, the quality data of the first indicator item related to the T wave and the P wave of the electrocardiogram signal in the sliding window is determined based on the fifth number. For example, the fifth number is used as the quality data of the first indicator item related to the T wave and the P wave of the electrocardiogram signal in the sliding window.
[0291] For each T wave in the sliding window, the distance between the target feature point of the T wave and the adjacent P wave is calculated, and the distance average of the distances between the target feature points of each T wave and the adjacent P wave is calculated to obtain a third reference distance. Fig.10 In step 2, the TP interval of each RR interval in the window and the overall fluctuation mean of the window are calculated.
[0292] For each T wave in the sliding window, the sixth offset degree of the interval between the target feature point of the T wave and the adjacent P wave relative to the third reference interval is calculated. The sum of the number of T waves whose sixth offset degree is greater than the first offset threshold and the number of T waves whose sixth offset degree is less than the second offset threshold is calculated to obtain the sixth number. The first offset threshold is 30% and the second offset threshold is 40%.
[0293] Furthermore, the quality data of the second indicator item related to the T wave and the P wave of the electrocardiogram signal in the sliding window is determined based on the sixth number. For example, the sixth number is used as the quality data of the second indicator item related to the T wave and the P wave of the electrocardiogram signal in the sliding window.
[0294] For each Q wave in the sliding window, the amplitude difference between the target feature point of the Q wave and the adjacent S wave is calculated to obtain the amplitude difference coefficient. The amplitude difference coefficient between the target feature point of the Q wave and the adjacent S wave represents the amplitude change of the target feature point of the Q wave and the adjacent S wave. The average of the amplitude difference coefficients of each Q wave and the adjacent S wave is calculated to obtain the third reference coefficient. Fig.10 In step 5, the amplitude difference of each QRS complex QS in the window and the mean of the differences of the entire window are calculated.
[0295] For each Q wave in the sliding window, the seventh offset degree of the amplitude difference coefficient of the target feature point of the Q wave and the adjacent S wave relative to the third reference coefficient is calculated. From each Q wave in the sliding window, the seventh number of Q waves whose seventh offset degree is greater than the offset threshold is determined; wherein the offset threshold is 50%.
[0296] Furthermore, the quality data of the index item related to the Q wave and the S wave of the electrocardiogram signal in the sliding window is determined based on the seventh number. For example, the seventh number is used as the quality data of the index item related to the Q wave and the S wave of the electrocardiogram signal in the sliding window.
[0297] The index items related to the feature points include a first index item and a second index item. The quality data of the first index item related to the feature points of the ECG signal in the sliding window and the quality data of the second index item related to the feature points of the ECG signal in the sliding window are calculated based on the total number of target feature points in the sliding window.
[0298] For each sliding window, count the total number of target feature points in the sliding window. Fig.10 Step 6 in the above method is to calculate the number of Q, R, S, T, and P feature points in the window. When the total number of target feature points in the sliding window is not greater than a first reference number, the quality data of the first indicator item related to the feature points of the electrocardiogram signal in the sliding window is determined to be a preset value. The first reference number is 15.
[0299] For each sliding window, count the total number of feature points missed in the sliding window. Fig.10In step 7, the number of missed feature points in the window is calculated. Ideally, each complete ECG signal includes T wave, Q wave, R wave, S wave and P wave, so 5 target feature points can be extracted from each complete ECG signal. If only 3 feature points are extracted from an ECG signal, it can be determined that 2 feature points are missed.
[0300] Furthermore, when the number of target feature points not extracted in the sliding window is greater than the second reference number, the quality data of the second indicator item related to the feature point is determined to be a preset value. Wherein, the preset values corresponding to different indicator items are different. For example, when the total number of target feature points in the sliding window is not greater than the first reference number, the quality data of the first indicator item related to the feature point is determined to be 2. When the number of target feature points not extracted in the sliding window is greater than the second reference number, the quality data of the second indicator item related to the feature point is determined to be 1.
[0301] The first waveform is a regular burr waveform in the ECG signal. Fig.11 As shown, the first waveform between S1 and T1, the first waveform between T1 and P2, and the first waveform between S2 and T2.
[0302] Ideally, if Figure 8 As shown, there is a straight line between the S wave and the adjacent T wave, and there is a straight line between the T wave and the adjacent P wave. If there is a fluctuation between the S wave and the adjacent T wave, and / or, there is a fluctuation between the T wave and the adjacent P wave, it indicates that the ECG signal is disturbed.
[0303] If the fluctuation pattern between the S wave and the adjacent T wave changes up and down, this fluctuation has little interference on the ECG signal, and the quality of the signal segment from the S wave to the T wave cannot be measured by the slope fluctuation coefficient of the S wave and the adjacent T wave. And / or, the fluctuation pattern between the T wave and the adjacent P wave changes up and down, this fluctuation also has little interference on the ECG signal, and the quality of the signal segment from the T wave to the P wave cannot be measured by the slope fluctuation coefficient of the T wave and the adjacent P wave.
[0304] Therefore, based on the instantaneous slope of each S wave and the adjacent T wave in the sliding window, and / or the instantaneous slope of each T wave and the adjacent P wave, quality data of indicators related to the waveform of the ECG signal in the sliding window is calculated.
[0305] For each S wave in the sliding window, determine each sampling point from the target feature point of the S wave to the target feature point of the adjacent T wave, calculate the target feature point of the S wave, the target feature point of the adjacent T wave, and the slope (i.e., instantaneous slope) of each determined sampling point. Count the number of positive values and the number of negative values in the instantaneous slopes of the S wave and the adjacent T wave, and calculate the ratio of the number of positive values to the number of negative values in the instantaneous slopes of the S wave and the adjacent T wave.
[0306] For each T wave in the sliding window, determine each sampling point from the target feature point of the T wave to the target feature point of the adjacent P wave, and calculate the target feature point of the T wave, the target feature point of the adjacent P wave, and the slope (i.e., instantaneous slope) of each determined sampling point. Count the number of positive values and the number of negative values in the instantaneous slopes of the T wave and the adjacent P wave, and calculate the ratio of the number of positive values to the number of negative values in the instantaneous slopes of the T wave and the adjacent P wave. Fig.10 In step 8, the ratio of positive and negative times of the instantaneous slopes of ST and TP of the RR interval within the window is calculated.
[0307] If the ratio of positive values to negative values in the instantaneous slopes of the S wave and the adjacent T wave in the first waveform within the sliding window is greater than the first reference ratio, and / or the ratio of positive values to negative values in the instantaneous slopes of the T wave and the adjacent P wave in the first waveform is greater than the first reference ratio, it is determined that the quality data of the indicator items related to the waveform of the electrocardiogram signal within the sliding window is a preset value.
[0308] As can be seen from the above, the solution provided in this embodiment determines the quality data of each indicator based on multiple evaluation parameters such as the peak-to-peak distance of the R wave, the Y value (amplitude) of the R peak, the slope fluctuation coefficient of TP and the proportion of positive and negative slope changes, the slope fluctuation coefficient of ST and the proportion of positive and negative slope changes. It can perform ECG signal detection in combination with the characteristics of the Q wave, R wave, S wave, T wave and P wave in the ECG signal, thereby improving the accuracy of quality detection of the ECG signal.
[0309] For step S404, for each sliding window, after calculating the quality data of each indicator item of the ECG signal in the sliding window, the weighted sum of the quality data of each indicator item in the sliding window is calculated to obtain the quality data of the ECG signal in the sliding window. Then, the target quality data of the ECG signal is calculated based on the quality data of the ECG signal in each sliding window. Fig.10 In step three, based on the input evaluation parameters, a score value (i.e., target quality data) and a signal quality result (i.e., a quality level in subsequent embodiments) are output.
[0310] In some embodiments, the terminal calculates the quality data of the ECG signal within a sliding window based on the following formula (1).
[0311] (1);
[0312] E represents the quality data of the ECG signal in the sliding window; N represents the number of indicator items; Represents the quality data of the nth indicator item in the sliding window; Represents the weight coefficient of the nth indicator item in the sliding window.
[0313] The value of N can be 10, that is, the weighted sum of the quality data of the 10 indicator items in the sliding window is calculated. The above formula (1) can also be expressed as the following formula (2):
[0314] (2);
[0315] E represents the quality data of the ECG signal in the sliding window. len(v1) represents the quality data of the first indicator item, which is the first indicator item related to the R wave; the weight coefficient of len(v1) is 1 / 2. len(v2) represents the quality data of the second indicator item, which is the second indicator item related to the R wave; the weight coefficient of len(v2) is 2. len(v3) represents the quality data of the third indicator item, which is the first indicator item related to the S wave and the T wave; the weight coefficient of len(v3) is 1. len(v4) represents the quality data of the fourth indicator item, which is the second indicator item related to the S wave and the T wave; the weight coefficient of len(v4) is 1. len(v5) represents the quality data of the fifth indicator item, which is the first indicator item related to the T wave and the P wave; the weight coefficient of len(v5) is 1. len(v6) represents the quality data of the 6th indicator item, which is the second indicator item related to the T wave and the P wave; the weight coefficient of len(v6) is 1. len(v7) represents the quality data of the 7th indicator item, which is the indicator item related to the Q wave and the S wave; the weight coefficient of len(v7) is 1 / 2. len(v8) represents the quality data of the 8th indicator item, which is the first indicator item related to the feature point; the weight coefficient of len(v8) is 1. len(v9) represents the quality data of the 9th indicator item, which is the second indicator item related to the feature point; the weight coefficient of len(v9) is 0.5. len(v10) represents the quality data of the 10th indicator item, which is the indicator item related to the waveform; the weight coefficient of len(v10) is 1 / 2.
[0316] As can be seen from the above, the solution provided in this embodiment establishes a sliding window in the time domain, and determines the quality data of each indicator item of the ECG signal in each sliding window respectively. The ECG signal can be processed in segments, thereby improving the accuracy of the quality data of each indicator item of the ECG signal in the calculated sliding window, and further improving the accuracy of the quality detection of the ECG signal.
[0317] In some embodiments, in order to avoid the calculated target quality data of the ECG signal being low, resulting in abnormal detection results being fed back to the user, affecting the user's daily experience, an upper limit value of the quality data is set for the sliding window, and when the calculated quality data of a sliding window is greater than the upper limit value, the quality data of the sliding window is determined to be the upper limit value.
[0318] Then, based on the quality data of the ECG signal in each sliding window and a preset formula, the target quality data of the ECG signal is calculated. The preset formula is:
[0319] S= a 0 - ∑ m=1 M [ ∑ n=1 N a n k n ] (3);
[0320] S represents the target quality data of the ECG signal; represents the preset initial quality data of the ECG signal; M represents the number of sliding windows; m represents the sequence number of the sliding window; N represents the number of indicator items; Represents the quality data of the nth indicator item in the mth sliding window; Represents the weight coefficient of the nth indicator item in the mth sliding window; Represents the quality data of the ECG signal in the mth sliding window.
[0321] When the value of N is 10, When is 100, the above formula (3) can also be expressed as the following formula (4):
[0322] S=100 - ∑ m=1 M [ len(v2)×2+len(v9)×0.5+len(v3)+len(v5)+ len(v8)+(len(v1) / 2)+len(v4)+len(v6)+(len(v7) / 2)+(len(v10) / 2) ] (4);
[0323] As can be seen from the above, the solution provided in this embodiment establishes a sliding window in the time domain, and determines the quality data of each indicator item of the ECG signal in each sliding window respectively. The ECG signal can be processed in segments, and the target quality data can be determined by combining the quality data of the ECG signal in each sliding window. That is, the overall quality of the ECG signal is determined by combining the quality of the signal segments of the ECG signal, thereby improving the accuracy of quality detection of the ECG signal.
[0324] In some embodiments, when the target quality data of the ECG signal is calculated, the quality level of the ECG signal can also be determined according to the target quality data of the ECG signal. For example, when the target quality data is greater than 90, the quality level of the ECG signal is determined to be excellent; for example, Fig.12a and Figure 12b Shown is an ECG signal with target quality data greater than 90 (i.e., a high-quality signal). Fig.12a and Figure 12b The horizontal axis is time and the vertical axis is voltage value. Fig.12a and Figure 12b The waveform shown changes regularly and is close to the standard waveform.
[0325] When the target quality data is [85, 90], the quality level of the ECG signal is determined to be passing; when the target quality data is less than 85, the quality level of the ECG signal is determined to be poor. For example, Fig.13a and Fig.13b The electrocardiogram signal shown here is one with a target quality data of less than 90 (i.e., a non-high-quality signal). Fig.13a and Fig.13b The horizontal axis is time and the vertical axis is voltage value. Fig.13a and Fig.13b The waveform shown changes irregularly and is quite different from the standard waveform.
[0326] The terminal can output the target quality data and quality level of the ECG signal to the user. In addition, when the target quality data of the ECG signal is low and the quality level is poor, for example, when the target quality data is less than 85, the quality level of the ECG signal is determined to be poor. The terminal can also output prompt information to the user to remind the user to re-measure. That is, the user can be guided to adjust the measurement posture and acquisition environment for signals of poor quality to avoid the problem of low accuracy of ECG signal detection results caused by interference from the measurement posture and acquisition environment.
[0327] See also Fig.14 , Fig.14 This is a flow chart of the implementation of the ECG signal quality detection method according to an embodiment of the present application.
[0328] Step 1: Extract the signal data by drawing.
[0329] In this step, input data: ECG data in different scenarios. Different scenarios include high-quality scenarios where the user is stationary and measured in a quiet environment, and low-quality scenarios where the user is in motion and / or in a noisy environment.
[0330] Processing method: Window-based ECG waveform feature extraction. That is, according to the preset sliding window size, the target feature points of the ECG signal in each sliding window are extracted. Then, the abnormal spacing feature points are identified, that is, the signal with the feature points extracted is further processed for abnormal feature extraction (i.e., optimization after extraction). For specific implementation methods, please refer to Figure 7 Related introduction of implementation examples.
[0331] Output data: ECG waveform and significant feature points under each window, that is, the ECG signal in each sliding window and the target feature points of the ECG signal in the sliding window.
[0332] Step 2: waveform feature point evaluation.
[0333] In this step, the ECG segmentation information is input, that is, the ECG signal in each sliding window and the target feature points of the ECG signal in the sliding window.
[0334] Processing method: Evaluate the waveform characteristics of each window from the perspective of time domain. That is, calculate Fig.10 Evaluation parameters of steps 1 to 8 in . For example, the peak-to-peak distance of the R wave, the Y value (amplitude) of the R peak, the slope fluctuation coefficient and the proportion of positive and negative changes in the slope of TP, the slope fluctuation coefficient and the proportion of positive and negative changes in the slope of ST, etc.
[0335] Through the data in different scenarios, the offset threshold of each significant feature is designed. That is, the offset threshold of different indicators is set, and based on the offset degree of the calculated evaluation parameter relative to the offset threshold, the deviation of each evaluation parameter from the threshold is obtained, and then the quality data of each indicator item of the ECG signal in each sliding window is calculated, and the quality data of the ECG signal in each sliding window is calculated.
[0336] Then, the scores of different types of deviation features are deducted, that is, based on the preset initial quality data, the quality data of the ECG signal in each sliding window is subtracted to obtain the final evaluation score (i.e., quality data) of the ECG signal.
[0337] Output data: the final evaluation score of the ECG data, that is, the quality data of the ECG signal, and the data drawing scores in each scenario, that is, the waveform graph and score of the ECG signal in the high-quality scenario, and the waveform graph and score of the ECG signal in the non-high-quality scenario.
[0338] Step 3: Improve the ECG waveform quality scoring system.
[0339] In this step, input data: a score sheet of signal data (ie, ECG signal) and a waveform drawing of the signal data, ie, a waveform drawing and a score of the ECG signal in a high-quality scenario, and a waveform drawing and a score of the ECG signal in a non-high-quality scenario.
[0340] Processing method: Find the data with abnormal scores in each scene and perform waveform evaluation alignment, that is, check whether the score calculation is wrong for special data or data with large score differences. For example, the quality data of the ECG signal collected in the high-quality scene should theoretically be above 90. If the quality data of the ECG signal collected in the high-quality scene is lower than 90, it is determined that the quality data calculation of the ECG signal is incorrect. The quality data of the ECG signal collected in the non-high-quality scene should theoretically be lower than 90. If the quality data of the ECG signal collected in the non-high-quality scene is higher than 90, it is determined that the quality data calculation of the ECG signal is incorrect.
[0341] Then, the threshold range of the evaluation is improved for the data with abnormal score distribution in different scenarios. That is, the offset threshold is adjusted, a new offset threshold is determined, and the quality data of the ECG signal is calculated again based on the new offset threshold, and so on, until the quality data of the ECG signal in different scenarios is accurate, and the final quality evaluation result of the ECG signal data is output.
[0342] Output data: a stable ECG signal quality scoring system, that is, the ECG signal quality detection method provided in the embodiment of the present application.
[0343] As can be seen from the above, the technical solution of this embodiment establishes a sliding window for high-quality signals and low-quality signals (i.e., non-high-quality signals) in the time domain to calculate the activity coefficient (i.e., evaluation parameter) of the significant features of the ECG signal, and then combines the activity coefficients of the significant features of all ECG signals in different scenarios to divide the activity coefficient thresholds of the significant features of high-quality signals and low-quality signals, and finally combines the thresholds of multiple activity coefficients to establish a quality data evaluation formula, and evaluates the score of each window, thereby obtaining the quality evaluation score and evaluation result of the ECG signal. In addition, the technical implementation process is simple, does not require a long and complex process, has strong compatibility, and can be embedded in the online software end (i.e., the application installed in the terminal) and wearable electronic devices. In addition, the collected ECG signals can be distinguished in real time, long time and effectively, and the ECG signals can be evaluated for quality, divided into unusable ECG signals (i.e., the target quality data is below 85), ECG signals with good quality (i.e., the target quality data is greater than 90) and ECG signals with poor quality (i.e., the target quality data is between 85 and 90), providing users with more intuitive and effective feedback.
[0344] In the technical solution of the present application, the operations of acquiring, storing, using, processing, transmitting, providing and disclosing the user's ECG signals and PPG signals are all carried out with the user's authorization.
[0345] In a specific implementation, the present application also provides a terminal, which includes one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the terminal to execute some or all of the steps in the above method embodiments.
[0346] The present application also provides a computer-readable storage medium, including a computer program, which, when executed on a terminal, enables the terminal to execute some or all of the steps in the above method embodiment. The above storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0347] In a specific implementation, an embodiment of the present application further provides a computer program product, which includes executable instructions. When the executable instructions are executed on a terminal, the terminal executes some or all of the steps in the above method embodiment.
[0348] like Fig.15 As shown, the present application also provides a chip system, which is applied to a terminal. The chip system includes one or more processors 1501. The processor 1501 is used to call computer instructions so that the terminal inputs the data to be processed into the chip system. The chip system processes the data based on the image display method provided in the embodiment of the present application and outputs the processing result.
[0349] In a possible implementation, the chip system also includes input and output interfaces for inputting and outputting data.
[0350] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.
[0351] Program code may be applied to input instructions to perform the functions described herein and to generate output information. The output information may be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0352] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0353] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer-readable media. Therefore, a machine-readable medium may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including but not limited to floppy disks, optical disks, optical disks, compact disc read-only memories (Compact Disc Read Only Memory, CD-ROMs), magneto-optical disks, read-only memories, random access memories, erasable programmable read-only memories (Erasable Programmable Read Only Memory, EPROM), electrically erasable programmable read-only memories (Electrically Erasable Programmable Read Only Memory, EEPROM), magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Accordingly, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
[0354] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings of the specification. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0355] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.
[0356] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0357] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.
Claims
1. A method for detecting the quality of an electrocardiogram signal, characterized in that: The method comprises: Obtaining collected ECG signals; Extracting features of a designated waveform in the electrocardiogram signal to obtain target feature points of the electrocardiogram signal; Calculating quality data of each index item of the electrocardiogram signal based on distribution information of the target feature point in the electrocardiogram signal; Calculating target quality data of the electrocardiogram signal based on quality data of each indicator item of the electrocardiogram signal; The step of extracting features from a designated waveform in the electrocardiogram signal to obtain target feature points of the electrocardiogram signal includes: According to a preset sliding window size, feature extraction is performed on a specified waveform of the electrocardiogram signal within the sliding window to obtain a target feature point of the electrocardiogram signal within the sliding window; The calculating the quality data of each index item of the electrocardiogram signal based on the distribution information of the target feature point in the electrocardiogram signal includes: For each sliding window, based on the distribution information of the target feature point in the sliding window, calculate the quality data of each indicator item of the electrocardiogram signal in the sliding window; The calculating target quality data of the electrocardiogram signal based on the quality data of each indicator item of the electrocardiogram signal comprises: For each sliding window, a weighted sum of the quality data of each indicator item in the sliding window is calculated to obtain the quality data of the electrocardiogram signal in the sliding window; Based on the quality data of the electrocardiographic signal in each sliding window, target quality data of the electrocardiographic signal is calculated.
2. The method according to claim 1, characterized in that The specified waveform includes at least one of the following: a P wave, a Q wave, an R wave, an S wave, and a T wave; The index items include at least one of the following: an index item related to R wave; an index item related to S wave and T wave; an index item related to T wave and P wave; an index item related to Q wave and S wave; an index item related to characteristic points; an index item related to waveform; The step of calculating, for each sliding window, quality data of each indicator item of the electrocardiogram signal in the sliding window based on distribution information of the target feature point in the sliding window includes: For each sliding window, based on the amplitude of the target feature point of each R wave in the sliding window and the distance between the target feature points of adjacent R waves, the quality data of the index item related to the R wave of the electrocardiogram signal in the sliding window is calculated; wherein the target feature point of the R wave is the peak; Based on the slope of the target feature point of each S wave and the adjacent T wave in the sliding window, and the spacing between the target feature points of the S wave and the adjacent T wave, the quality data of the index items related to the S wave and the T wave of the electrocardiogram signal in the sliding window are calculated; wherein the target feature point of the S wave is the trough; and the target feature point of the T wave is the peak; Based on the slope of the target feature point of each T wave and the adjacent P wave in the sliding window, and the distance between the target feature points of the T wave and the adjacent P wave, the quality data of the index items related to the T wave and the P wave of the electrocardiogram signal in the sliding window are calculated; wherein the target feature point of the P wave is the peak; Based on the amplitude of the target feature point of each Q wave and the adjacent S wave in the sliding window, the quality data of the index items related to the Q wave and the S wave of the electrocardiogram signal in the sliding window are calculated; wherein the target feature point of the Q wave is the trough; Calculating quality data of index items related to the feature points of the electrocardiogram signal in the sliding window based on the total number of target feature points in the sliding window; Based on the instantaneous slope of each S wave and the adjacent T wave in the sliding window, and / or the instantaneous slope of each T wave and the adjacent P wave, the quality data of the waveform-related index items of the electrocardiogram signal in the sliding window are calculated; wherein the instantaneous slope of the S wave and the adjacent T wave includes: the slope of each sampling point between the target feature points of the S wave and the adjacent T wave; the instantaneous slope of the T wave and the adjacent P wave includes: the slope of each sampling point between the target feature points of the T wave and the adjacent P wave.
3. The method according to claim 2, characterized in that The calculating, based on the amplitude of the target feature point of each R wave in the sliding window and the distance between the target feature points of adjacent R waves, the quality data of the index item related to the R wave of the electrocardiogram signal in the sliding window includes: For each R wave in the sliding window, calculate the degree of deviation of the amplitude of the target feature point of the R wave relative to the reference amplitude to obtain a first deviation degree; wherein the reference amplitude is the amplitude mean of the amplitudes of the target feature points of each R wave in the sliding window; Determine, from each R wave in the sliding window, the number of R waves having a first offset degree greater than an offset threshold, to obtain a first number; Determine quality data of a first indicator item related to the R wave of the electrocardiogram signal within the sliding window based on the first number; For each R wave in the sliding window, calculate the degree of deviation of the distance between the target feature points of the R wave and the adjacent R wave relative to the first reference distance to obtain a second deviation degree; wherein the first reference distance is the distance average of the distances between the target feature points of each adjacent R wave in the sliding window; Determine the number of R waves whose second offset degree is greater than the offset threshold from each R wave in the sliding window to obtain a second number; wherein different indicator items correspond to different offset thresholds; Based on the second number, quality data of a second indicator item related to the R wave of the electrocardiogram signal within the sliding window is determined.
4. The method according to claim 2, characterized in that: The step of calculating the quality data of the index items related to the S wave and the T wave of the electrocardiogram signal in the sliding window based on the slope of the target feature point of each S wave and the adjacent T wave in the sliding window, and the distance between the target feature points of the S wave and the adjacent T wave, comprises: For each S wave in the sliding window, the degree of deviation of the slope fluctuation coefficient of the S wave and the adjacent T wave relative to the first reference coefficient is calculated to obtain a third degree of deviation; wherein the first reference coefficient is the coefficient mean of the slope fluctuation coefficients of each S wave and the adjacent T wave in the sliding window; the slope fluctuation coefficient of the S wave and the adjacent T wave represents: the slope change of each sampling point between the target feature point of the S wave and the target feature point of the adjacent T wave; Determine, from each S wave in the sliding window, the number of S waves whose third offset degree is greater than the offset threshold, to obtain a third number; wherein different indicator items correspond to different offset thresholds; Determine quality data of a first indicator item related to the S wave and the T wave of the electrocardiogram signal in the sliding window based on the third number; For each S wave in the sliding window, calculate the degree of deviation of the spacing between the target feature points of the S wave and the adjacent T wave relative to the second reference spacing, and obtain a fourth deviation degree; wherein the second reference spacing is the spacing average of the spacings between the target feature points of each S wave and the adjacent T wave in the sliding window; Determine, from each S wave in the sliding window, the number of S waves whose fourth offset degree is greater than the first offset threshold and the number of S waves whose fourth offset degree is less than the second offset threshold, to obtain a fourth number; wherein the first offset threshold is less than the second offset threshold; Quality data of a second indicator item related to the S wave and the T wave of the electrocardiogram signal within the sliding window is determined based on the fourth number.
5. The method according to claim 2, characterized in that: The method of calculating the quality data of the index items related to the T wave and the P wave of the electrocardiogram signal in the sliding window based on the slope of the target feature point of each T wave and the adjacent P wave in the sliding window and the distance between the target feature points of the T wave and the adjacent P wave includes: For each T wave in the sliding window, the degree of deviation of the slope fluctuation coefficient of the T wave and the adjacent P wave relative to the second reference coefficient is calculated to obtain a fifth deviation degree; wherein the second reference coefficient is the coefficient mean of the slope fluctuation coefficients of each T wave and the adjacent P wave in the sliding window; the slope fluctuation coefficient of the T wave and the adjacent P wave represents: the slope change of each sampling point between the target feature point of the T wave and the target feature point of the adjacent P wave; Determine the number of T waves whose fifth offset degree is greater than the offset threshold from each T wave in the sliding window to obtain a fifth number; wherein the offset thresholds corresponding to different indicator items; Determine quality data of a first indicator item related to the T wave and the P wave of the electrocardiogram signal within the sliding window based on the fifth number; For each T wave in the sliding window, calculate the degree of deviation of the spacing between the target feature points of the T wave and the adjacent P wave relative to the third reference spacing to obtain a sixth deviation degree; wherein the third reference spacing is the spacing average of the spacings between the target feature points of each T wave and the adjacent P wave in the sliding window; Determine, from each T wave in the sliding window, the number of T waves whose sixth offset degree is greater than the first offset threshold and the number of T waves whose sixth offset degree is less than the second offset threshold, to obtain a sixth number; wherein the first offset threshold is less than the second offset threshold; Based on the sixth number, quality data of a second indicator item related to the T wave and the P wave of the electrocardiogram signal within the sliding window is determined.
6. The method according to claim 2, characterized in that The step of calculating the quality data of the index items related to the Q wave and the S wave of the electrocardiogram signal in the sliding window based on the amplitude of the target feature point of each Q wave and the adjacent S wave in the sliding window comprises: For each Q wave in the sliding window, the degree of deviation of the amplitude difference coefficient of the target feature point of the Q wave and the adjacent S wave relative to the third reference coefficient is calculated to obtain a seventh deviation degree; wherein the third reference coefficient is the coefficient mean of the amplitude difference coefficients of the target feature points of each Q wave and the adjacent S wave in the sliding window; the amplitude difference coefficient of the target feature point of the Q wave and the adjacent S wave represents the amplitude change of the target feature point of the Q wave and the adjacent S wave; Determine the number of Q waves whose seventh offset degree is greater than an offset threshold from among the Q waves in the sliding window, and obtain a seventh number; wherein different indicator items correspond to different offset thresholds; Based on the seventh number, quality data of index items related to the Q wave and the S wave of the electrocardiogram signal within the sliding window are determined.
7. The method according to claim 2, characterized in that The calculating, based on the total number of target feature points in the sliding window, quality data of index items related to the feature points of the electrocardiogram signal in the sliding window comprises: For each sliding window, when the total number of target feature points in the sliding window is not greater than a first reference number, determining that the quality data of the first indicator item related to the feature points of the electrocardiogram signal in the sliding window is a preset value; When the number of target feature points not extracted in the sliding window is greater than a second reference number, the quality data of the second indicator item related to the feature points of the electrocardiogram signal in the sliding window is determined to be a preset value; wherein different preset values correspond to different indicator items.
8. The method according to claim 2, characterized in that: The step of calculating the quality data of the index item related to the waveform of the electrocardiogram signal in the sliding window based on the instantaneous slope of each S wave and the adjacent T wave in the sliding window, and / or the instantaneous slope of each T wave and the adjacent P wave in the sliding window, comprises: When the ratio of positive values to negative values in the instantaneous slopes of the S wave and the adjacent T wave in the first waveform within the sliding window is greater than the first reference ratio, and / or the ratio of positive values to negative values in the instantaneous slopes of the T wave and the adjacent P wave in the first waveform is greater than the first reference ratio, it is determined that the quality data of the indicator items related to the waveform of the electrocardiogram signal within the sliding window is a preset value.
9. The method according to claim 1, characterized in that: The calculating target quality data of the electrocardiogram signal based on the quality data of the electrocardiogram signal in each sliding window includes: Based on the quality data of the electrocardiogram signal in each sliding window and a preset formula, the target quality data of the electrocardiogram signal is calculated; wherein the preset formula is: ; S represents the target quality data of the electrocardiogram signal; represents the preset initial quality data of the ECG signal; M represents the number of sliding windows; m represents the sequence number of the sliding window; N represents the number of indicator items; Represents the quality data of the nth indicator item in the mth sliding window; Represents the weight coefficient of the nth indicator item in the mth sliding window; Represents the quality data of the ECG signal in the mth sliding window.
10. The method according to claim 1, characterized in that The step of extracting features of a designated waveform of the electrocardiogram signal within the sliding window according to a preset sliding window size to obtain target feature points of the electrocardiogram signal within the sliding window includes: For each sliding window, determining a specified waveform in the electrocardiogram signal within the sliding window; wherein the specified waveform includes at least one of the following: a P wave, a Q wave, an R wave, an S wave, and a T wave; Extracting a feature point of the specified waveform in the sliding window to obtain a first feature point; Based on the spacing of the first feature points, determining a second waveform in which an abnormality occurs when extracting feature points within the sliding window; Based on the first feature point and a result of feature extraction of the second waveform in the sliding window, a target feature point of the electrocardiogram signal in the sliding window is determined.
11. The method according to claim 10, characterized in that The step of determining a target feature point of the electrocardiogram signal in the sliding window based on the first feature point and a result of feature extraction of the second waveform in the sliding window comprises: Extract feature points from the first type of second waveform, and add the obtained feature points to the first feature points; determine the first feature points that are extracted in excess in the second type of second waveform, remove the excess first feature points, and return to execute the step of determining the second waveform in which an abnormality occurs when extracting feature points within the sliding window based on the spacing of the first feature points; wherein there are unextracted feature points in the first type of second waveform; and wherein there are excess extracted feature points in the second type of second waveform.
12. The method according to claim 10, characterized in that The determining, based on the spacing of the first feature points, that an abnormal second waveform occurs when extracting feature points within the sliding window, comprises: For each specified waveform, calculating the distance between the first characteristic point of the specified waveform and an adjacent specified waveform to obtain a plurality of peak-to-peak distances; Based on the plurality of peak-to-peak intervals, determining an abnormality detection threshold; wherein the abnormality detection threshold is used to detect whether the waveform between two adjacent specified waveforms is the second waveform where an abnormality occurs when extracting feature points; If the distance between the first characteristic point of the specified waveform and the adjacent specified waveform is greater than the first abnormality detection threshold, determine that the waveform between the specified waveform and the adjacent specified waveform is a first-type second waveform; wherein there are unextracted characteristic points in the first-type second waveform; If the distance between the first feature point of the specified waveform and the adjacent specified waveform is less than the second anomaly detection threshold, the waveform between the specified waveform and the adjacent specified waveform is determined to be a second type second waveform; wherein there are multiple extracted feature points in the second type second waveform; and the first anomaly detection threshold is greater than the second anomaly detection threshold.
13. The method according to claim 12, characterized in that When the designated waveform is an R wave, the adjacent designated waveform of the R wave is the R wave; the target characteristic point of the R wave is the wave peak; When the designated waveform is a T wave, the adjacent designated waveform of the T wave is a P wave; the target characteristic points of the T wave and the P wave are the peaks; When the designated waveform is an S wave, the adjacent designated waveform of the S wave is a T wave; the target characteristic point of the S wave is a trough; When the designated waveform is a Q wave, the adjacent designated waveform of the Q wave is an S wave; and the target characteristic point of the Q wave is a trough.
14. A terminal, characterized in that: include: one or more processors and memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, where the computer program codes include computer instructions. The one or more processors call the computer instructions to enable the terminal to execute the method according to any one of claims 1 to 13.
15. A computer-readable storage medium, characterized in that: The method comprises a computer program, and when the computer program is run on a terminal, the terminal is caused to execute the method according to any one of claims 1 to 13.
16. A computer program product, characterized in that The computer program product comprises executable instructions, and when the executable instructions are executed on a terminal, the terminal is caused to execute the method according to any one of claims 1 to 13.
17. A chip system, characterized in that: The chip system is applied to a terminal, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the terminal inputs data into the chip system, and executes the method described in any one of claims 1-13 to process the data and then output the processing results.
