Electrocardiogram signal processing method and electronic device

Through regional division and sliding window processing of ECG data, the problem of noise interference when wearable devices collect ECG signals is solved, and the accuracy and clarity of the signals are improved.

CN117617984BActive Publication Date: 2024-08-27HONOR DEVICE CO LTD

Patent Information

Application Number
CN202210948840.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-09
Publication Date
2024-08-27
Estimated Expiration
2042-08-09

AI Technical Summary

Technical Problem

When collecting ECG signals, wearable devices are susceptible to factors such as human body movement, breathing, and environmental electromagnetic interference, resulting in noise interference and affecting signal accuracy.

Method used

By preprocessing the ECG data and dividing it into different areas, using fixed-length and variable-length sliding windows for smoothing, the processed data is integrated to reduce noise interference.

Benefits of technology

It effectively reduces the interference of noise on ECG signals, improves the accuracy and clarity of signals, and enhances the smoothing effect on ECG data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117617984B
    Figure CN117617984B
Patent Text Reader

Abstract

The present application provides a method for processing an electrocardiogram signal and an electronic device, the method comprising: the electronic device preprocesses the electrocardiogram data to obtain first data; the electronic device divides the data points in the first data into data points in a first type of area, data points in a second type of area and data points in a buffer type of area, the electronic device smoothes the data points in the second type of area through multiple fixed-length windows to obtain second data; the electronic device smoothes the data points in the third type of area through multiple fixed-length windows to obtain third data; the electronic device smoothes the data points in the fourth type of area through multiple non-fixed-length windows to obtain fourth data; the electronic device integrates the second data, the third data, the fourth data and the data points in the first type of area to obtain fifth data after smoothing the electrocardiogram data. In this way, the electronic device can perform smoothing processing on different areas to reduce the interference of noise on the electrocardiogram signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to an electrocardiogram signal processing method and electronic equipment. Background Art

[0002] With the development of terminal technology, wearable devices are gradually used in people's work and life. In order to meet the users' ever-increasing needs for their own health management, wearable devices can provide a variety of health data detection services for users, such as heart rate monitoring, sleep monitoring, and ECG signal monitoring.

[0003] Normally, ECG signals are weak. When wearable devices collect ECG signals, they are easily interfered by factors such as human movement, breathing, and electromagnetic interference in the environment, resulting in noise in the ECG signals collected by wearable devices.

[0004] In a possible implementation, wearable devices can use filters to filter out some noise, such as baseline drift and power frequency interference. However, the ECG signal output by the wearable device is still not very accurate. Summary of the invention

[0005] The embodiments of the present application provide an electrocardiogram signal processing method and an electronic device, which can reduce the interference of noise on the electrocardiogram signal by dividing the electrocardiogram data into regions and performing different smoothing processes on different regions.

[0006] In the first aspect, the embodiment of the present application provides a method for processing an electrocardiogram signal, which is applied to an electronic device, and the method includes: the electronic device preprocesses the electrocardiogram data to obtain first data; the electronic device divides the data points in the first data into data points in the first category area, data points in the second category area and data points in the buffer category area; the electronic device smoothes the data points in the second category area through multiple fixed-length windows to obtain second data; the electronic device smoothes the data points in the third category area through multiple fixed-length windows to obtain third data; the electronic device smoothes the data points in the fourth category area through multiple non-fixed-length windows to obtain fourth data; the electronic device integrates the second data, the third data, the fourth data and the data points in the first category area to obtain the fifth data after smoothing the electrocardiogram data. In this way, the electronic device uses a fixed-length sliding window to smooth the relatively flat data points in the second category area and the data points in the third category area, and the electronic device uses a variable-length sliding window to smooth the data points in the fourth category area, thereby smoothing the noise in the electrocardiogram signal and reducing the interference of the noise on the electrocardiogram signal.

[0007] In a possible implementation, when the fourth type of area is a transition area from the first type of area to the third type of area, the lengths of the multiple windows of non-fixed lengths gradually increase over time; or, when the fourth type of area is a transition area from the third type of area to the first type of area, the lengths of the multiple windows of non-fixed lengths gradually decrease over time. In this way, the electronic device can set the length of the window of non-fixed length according to the characteristics of the data points between the first type of area and the third type of area, thereby improving the smoothing effect on the data points of the fourth type of area.

[0008] In a possible implementation, the first variability is related to determining the data points of the first type of area, the data points of the third type of area, and the data points of the fourth type of area; the electronic device divides the data points in the first data into the data points of the first type of area, the data points of the second type of area, the data points of the third type of area, and the data points of the fourth type of area, including: the electronic device calculates the first variability of the data points in the first data; when the first variability is lower than the first variability threshold, the electronic device determines that the data points in the first data are data points of the second type of area; or, when the first variability is not lower than the first variability threshold, the electronic device determines that the data points in the first data are data points of the first type of area or data points of the third type of area or data points of the fourth type of area. In this way, the electronic device can divide the second type of area and other areas according to the first variability, so that the subsequent electronic device can perform partition smoothing processing on the electrocardiogram data.

[0009] In a possible implementation, the second variability is related to determining the data points of the first category area, and the electronic device divides the data points in the first data into data points of the first category area, data points of the second category area, data points of the third category area, and data points of the fourth category area, and further includes: the electronic device calculates the second variability of the data points of the first category area, the data points of the third category area, or the data points of the fourth category area; when the second variability is not lower than the second variability threshold, the electronic device determines that the data points in the first data are data points of the first category area; or, when the second variability is lower than the second variability threshold, the electronic device determines that the data points in the first data are data points of the third category area or data points of the fourth category area. In this way, the electronic device can divide the first category area and the buffer category area according to the second variability, so that the subsequent electronic device can perform partition smoothing processing on the ECG data.

[0010] In a possible implementation, the first variability M1 satisfies the following formula: M1 = mean(abs(diff(X1))) / (2k + 1); where k is a positive integer, the window length selected when calculating M1 is 2k + 2, and X1 is a set of data points of 2k + 2 first data in the window; the second variability M2 satisfies the following formula: M2 = mean(abs(diff(X2))) / (2j + 1); where j is a positive integer, the window selected when calculating M2 is 2j + 2, and X2 is a set of data points of 2j + 2 first data in the window. In this way, the electronic device can divide regions according to the first variability and the second variability, so as to perform partition smoothing processing on the electrocardiogram data by the electronic device subsequently.

[0011] In a possible implementation, is the data point of the second data at time t, and the data point of the second data satisfies the following formula: where x t is the data point of the first data at time t, x t-H is the data point of the first data at time t - H, x t+H is the data point of the first data at time t + H, H is a positive integer and H is a constant, and the window length selected when calculating is 2H + 1. In this way, the electronic device can perform partition smoothing processing on the data points in the second type of region to obtain the second data.

[0012] In a possible implementation, the preset length is q, is the data point of the third data at time t, and the data point of the third data satisfies the following formula: where x t-Q is the data point of the first data at time t - Q, x t+Q is the data point of the first data at time t + Q, Q is a positive integer and Q is a constant, Q < H, and the window length selected when calculating is 2Q + 1, and the value range of the window length is [1, q]. In this way, the electronic device can perform partition smoothing processing on the data points in the third type of region to obtain the third data.

[0013] In a possible implementation, is the data point of the fourth data at time t, and the data point of the fourth data satisfies the following formula: where x t-u is the data point of the first data at time t - u, x t+u is the data point of the first data at time t + u, u is a positive integer and u is a variable, and when calculating The window length selected is 2u+1. In this way, the electronic device can perform partition smoothing processing on the data points of the fourth type of area to obtain fourth data.

[0014] In a possible implementation, the method further includes: when the electronic device receives a trigger operation for starting ECG data detection, the electronic device displays a data point of the fifth data. In this way, the electronic device can display the ECG data after noise removal.

[0015] In a possible implementation, the electronic device includes a wearable device, and the wearable device includes one or more of the following: a smart watch, a smart bracelet, or smart glasses.

[0016] In a second aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device executes the method for processing electrocardiogram signals as described in the first aspect or any one of the implementations of the first aspect.

[0017] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the computer executes the method for processing electrocardiogram signals as described in the first aspect or any one of the implementations of the first aspect.

[0018] In a fourth aspect, a computer program product includes a computer program, and when the computer program is executed, the computer executes the method for processing an electrocardiogram signal as described in the first aspect or any one of the implementations of the first aspect.

[0019] It should be understood that the second to fourth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A schematic diagram of a scenario provided for an embodiment of the present application;

[0021] Figure 2 A schematic diagram of the structure of a wearable device provided in an embodiment of the present application;

[0022] Figure 3 A schematic diagram of the software structure of a smart watch provided in an embodiment of the present application;

[0023] Figure 4 A schematic diagram of the regional division of an electrocardiogram signal provided in an embodiment of the present application;

[0024] Figure 5A flowchart of a method for processing an electrocardiogram signal provided in an embodiment of the present application;

[0025] Figure 6 A schematic diagram of a curve of variability of electrocardiogram data provided in an embodiment of the present application;

[0026] Figure 7 A schematic diagram of a scenario of a method for processing an electrocardiogram signal provided in an embodiment of the present application;

[0027] Figure 8 A schematic diagram of a curve of first data and fifth data provided in an embodiment of the present application;

[0028] Fig. 9 A schematic diagram of the structure of an electrocardiogram signal processing device provided in an embodiment of the present application;

[0029] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] 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, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first value and the second value are only used to distinguish different values, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0031] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" 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 "exemplary" or "for example" is intended to present related concepts in a specific way.

[0032] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple.

[0033] In order to meet the ever-increasing needs of users for their own health management, wearable devices can provide a variety of user health data detection services, such as heart rate monitoring, sleep monitoring, and ECG signal monitoring. Usually, ECG signals are weak, and in the process of wearable devices collecting ECG signals, they are easily interfered by factors such as human movement, breathing, and electromagnetic interference in the environment, resulting in noise in the ECG signals collected by wearable devices.

[0034] In a possible implementation, wearable devices can use filters to filter out some noise, such as baseline drift and power frequency interference. However, many noises (e.g., myoelectric noise, motion noise, etc.) interfere throughout the entire frequency band. These noises are relatively weak and difficult to eliminate. For ECG signals, these noises have a more obvious impact on the relatively weak and stable segments of ECG signals, thereby reducing the accuracy of ECG signals.

[0035] For example, Figure 1 A schematic diagram of a scenario of a method for processing an ECG signal provided in an embodiment of the present application, such as Figure 1 As shown:

[0036] The electronic device may be configured with an "ECG" application, which may enable the electronic device to measure the user's ECG signal. The electronic device may display Figure 1 The a interface, Figure 1 The a interface may include an "electrocardiogram" icon. When the electronic device detects a touch operation on the "electrocardiogram" icon, the terminal device starts the "electrocardiogram" application program, and the user can use the electrocardiogram monitoring service. The electronic device enters the Figure 1 The interface shown in b. Figure 1 The b interface can display the ECG signal collected and processed by the electronic device in real time. The user can view the ECG intuitively. In some embodiments, the electronic device can be a smart watch, and the smart watch can establish a connection with electronic devices such as mobile phones. In this way, the user can understand his or her own health status, and reasonable health guidance can also be provided to the user.

[0037] In a possible implementation, the electronic device collects the original ECG signal, filters it through a filter, removes some noise (such as baseline drift and power frequency interference), and displays the processed ECG signal on the electronic device. However, for some noise (such as myoelectric noise and motion noise), it is difficult for the filter to eliminate these noises. The ECG signal is interfered by this part of the noise, which may cause the ECG trace to be distorted.

[0038] In view of this, an embodiment of the present application provides a method for processing an ECG signal, wherein an electronic device pre-processes ECG data to obtain first data; the electronic device divides the data points in the first data into data points in a first region, data points in a second region, and data points in a buffer region; the electronic device smoothes the data points in the second region through multiple fixed-length windows to obtain second data; the electronic device smoothes the data points in the third region through multiple fixed-length windows to obtain third data; the electronic device smoothes the data points in the fourth region through multiple non-fixed-length windows to obtain fourth data; the electronic device integrates the second data, the third data, the fourth data, and the data points in the first region to obtain fifth data after smoothing the ECG data. In this way, the electronic device uses a fixed-length sliding window to smooth the relatively flat data points in the second region and the data points in the third region, and the electronic device uses a variable-length sliding window to smooth the data points in the fourth region, thereby smoothing the noise in the ECG signal and reducing the interference of the noise on the ECG signal.

[0039] It can be understood that in the embodiments of the present application, the electronic device is a smart watch among wearable devices for example, and this example does not constitute a limitation on the embodiments of the present application.

[0040] It is understandable that the electronic device in the embodiment of the present application can support the measurement of electrocardiogram, and the electronic device may include: mobile phone, smart TV, wearable device, tablet computer (Pad), computer with wireless transceiver function, virtual reality (VR) terminal device, augmented reality (AR) device, wireless device in industrial control, wireless device in self-driving. Among them, the wearable device may include: smart watch, smart bracelet, smart gloves, smart glasses, virtual reality (VR) terminal device or smart belt and other devices.

[0041] The specific forms of the electronic device and the wearable device in the embodiments of the present application are not specifically limited. In order to better understand the embodiments of the present application, the structure of the wearable device in the embodiments of the present application is introduced below. For example, Figure 2 A schematic diagram of the structure of a wearable device provided in an embodiment of the present application.

[0042] The wearable device may include a processor 110, an internal memory 121, a universal serial bus (USB) interface, a charging management module 140, a power management module 141, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a sensor module 180, a button 190, an indicator 192, a camera 193, and a display screen 194. The sensor module 180 may include a gyroscope sensor 180B, a barometer 180C, a magnetic sensor 180D, an acceleration sensor 180E, a proximity light sensor 180G, a temperature sensor 180J, a touch sensor 180K, and an ambient light sensor 180L.

[0043] It is understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the wearable device. In other embodiments of the present application, the wearable device 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 illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0044] The processor 110 may include one or more processing units. Different processing units may be independent devices or integrated into one or more processors. The processor 110 may also be provided with a memory for storing instructions and data.

[0045] The charging management module 140 is used to receive charging input from a charger, which may be a wireless charger or a wired charger. The power management module 141 is used to connect the charging management module 140 to the processor 110 .

[0046] The wireless communication function of the wearable device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.

[0047] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The antennas in the wearable device 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.

[0048] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to wearable devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.

[0049] The wireless communication module 160 can provide wireless communication solutions for wearable devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), etc.

[0050] The wearable device implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.

[0051] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the wearable device may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0052] The wearable device can realize the shooting function through an ISP, a camera 193, a video codec, a GPU, a display 194, and an application processor.

[0053] The camera 193 is used to capture static images or videos. In some embodiments, the wearable device may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0054] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 can include a program storage area and a data storage area.

[0055] The wearable device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, and the application processor.

[0056] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The wearable device can listen to music or listen to hands-free calls through the speaker 170A. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. When the wearable device answers a call or voice message, the voice can be answered by placing the receiver 170B close to the human ear.

[0057] The gyro sensor 180B may be used to determine the motion posture of the wearable device. The magnetic sensor 180D includes a Hall sensor.

[0058] The barometer 180C is used to measure air pressure. In some embodiments, the wearable device can calculate the altitude through the air pressure value measured by the barometer 180C to assist positioning and navigation. In the embodiment of the present application, the barometer 180C is used to measure the air pressure of the wearable device. For example, the barometer 180C can be used to detect whether the wearable device is underwater.

[0059] The acceleration sensor 180E can detect the magnitude of the acceleration of the wearable device in various directions (generally three axes). In the embodiment of the present application, the acceleration sensor 180E is used to detect whether the wearable device is in motion.

[0060] The proximity light sensor 180G can be used to detect the proximity and distance between an object and the wearable device. The ambient light sensor 180L is used to sense the ambient light brightness. The temperature sensor 180J is used to detect the temperature. In the embodiment of the present application, the temperature sensor is used to detect the temperature of the environment in which the wearable device is located.

[0061] The touch sensor 180K is also called a “touch control device.” The touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch control screen.”

[0062] The button 190 includes a power button, a volume button, etc. The button 190 may be a mechanical button. It may also be a touch button. The wearable device may receive the button input and generate a key signal input related to the user settings and function control of the wearable device. The indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, message, missed call, notification, etc.

[0063] The software system of the wearable device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. The embodiment of the present application takes a system of a layered architecture as an example to exemplify the software structure of the wearable device.

[0064] For example, taking a wearable device as a smart watch, Figure 3 A schematic diagram of the software structure of a smart watch provided in an embodiment of the present application.

[0065] like Figure 3 As shown, the layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the software architecture of the smart watch can be divided into five layers, from top to bottom: application (APP) layer, system service layer, algorithm layer, hardware abstraction layer (HAL), and kernel layer.

[0066] The application layer may include a series of application programs, such as a watch face application, a sports record application, a call application, and a workout application.

[0067] The system service layer is used to provide system support for the application programs in the application layer. For example, the system service layer may include modules such as step counting service, heart rate service, calorie service, heart health service, etc.

[0068] The algorithm layer is used to provide algorithm support for the system service layer. For example, the algorithm layer may include: heart rate algorithm, dimming algorithm, sleep algorithm, and wearing algorithm. In the embodiment of the present application, the heart rate algorithm, dimming algorithm, sleep algorithm, and wearing algorithm can be used together to support the heart rate service and realize the detection of the heart rate characteristics of users in different states.

[0069] In the hardware abstraction layer, all hardware operations required by the upper layer of the system need to call the HAL-related application programming interface (API). The software architecture layer of each hardware device has some standardized functions, and the HAL layer can be used to implement these functions.

[0070] The hardware abstraction layer may include: an interface corresponding to a C++ library, a storage interface, a display interface, a touch interface, a Bluetooth interface, and a global positioning system (GPS) interface.

[0071] The kernel layer can be a layer between hardware and software. The kernel refers to a system software that provides hardware abstraction layer, disk and file system control, multitasking and other functions. Among them, the kernel is the core of an operating system and the most basic part of the operating system. It is responsible for managing the system's processes, memory, device drivers, files and network systems, etc., and determines the performance and stability of the system. It is a part of the software that provides secure access to computer hardware for many applications. This access is limited, and the kernel determines when a program can operate on a certain part of the hardware and for how long.

[0072] The kernel layer may be an operating system kernel (OS kernel).

[0073] Let's combine Figure 4 The definitions involved in the embodiments of the present application are explained in the form of schematic diagrams. Figure 4 FIG. 4 shows a schematic diagram of the regional division of the ECG signal in an embodiment of the present application. Figure 4 As shown:

[0074] The embodiment of the present application divides the ECG data into four areas, including: a first area, a second area, a third area, and a fourth area. For example, the first area, the second area, the third area, and the fourth area can be as follows: Figure 4 As shown. The first type of area can be a part of the QRS wave band in the electrocardiogram data, and the first type of area includes the R wave; the second type of area can include the area from the starting point of the T wave to the end point of the P wave; it can be understood that there is a buffer area between the first type of area and the second type of area, and the buffer area includes the third type of area and the fourth type of area. The third type of area is an area of ​​a preset length adjacent to the boundary of the second type of area in the buffer area; the fourth type of area is an area in the buffer area except the third type of area.

[0075] It should be noted that, in the embodiment of the present application, the nth type of area can be an area composed of data points of different signal characteristic types in the ECG data, rather than a fixed area composed of data points of a fixed time period in the ECG data. For example, the ECG data uses time as the horizontal axis unit, and the electronic device collects two sets of ECG data. The time periods of the first type of area and the second type of area of ​​the two sets of ECG data are generally different.

[0076] It is understandable that the ECG data may include the QRS band with a larger ECG signal amplitude, as well as the PR band, ST band, T band and U band with a smaller ECG signal amplitude. The ECG signal processing method of the embodiment of the present application may define the first type of area as a non-suppression area and the second type of area as a suppression area according to the degree of interference of noise on ECG data of different amplitudes. The non-suppression area can be understood as: the noise has a weaker interference on the ECG signal with a high amplitude, and at the same time, smoothing this part of the ECG signal may lose the signal characteristics of the original ECG signal. Therefore, the embodiment of the present application does not suppress the noise of this part of the ECG signal. The suppression area can be understood as: the noise has a strong interference on the ECG signal with a low amplitude. The ECG signal processing method of the embodiment of the present application is used to suppress the interference of noise on the ECG signal with a low amplitude. Suppression can be understood as reducing the energy amplitude of the noise. Taking ECG data as an example, suppression can be to numerically reduce the size of the noise in the ECG data.

[0077] Furthermore, in order to improve the smoothing effect on the noise in the ECG data, in the embodiment of the present application, the data points of the buffer area are divided into data points of the third area and data points of the fourth area, wherein the third area is an area of ​​preset length adjacent to the boundary of the second area in the buffer area; the fourth area is the area of ​​the buffer area excluding the third area. In the embodiment of the present application, the electronic device can divide the ECG data into data points of the first area, the second area, the third area and the fourth area. According to the suppression effect on the ECG signal noise, the first area can be defined as a non-suppression area, the second area can be defined as a strong suppression area, the third area can be defined as a weak suppression area, and the fourth area can be defined as a non-suppression buffer.

[0078] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0079] For example, Figure 5 A schematic diagram of a process flow of an electrocardiogram signal processing method provided in an embodiment of the present application is shown. Figure 5 As shown:

[0080] S501. The electronic device preprocesses the ECG data to obtain first data. The preprocessing is used to filter out baseline drift and power frequency interference noise in the ECG data.

[0081] In the embodiment of the present application, the electronic device can perform high-pass filtering and low-pass filtering on the ECG data, and these two filters can usually filter out the noise outside the effective range of the ECG signal. The filtered noise can be baseline drift noise and power frequency interference noise.

[0082] For example, the electronic device may use an n-th order high-pass filter to pre-process the ECG data, and the lower limit of the pre-processing frequency setting may be F l .

[0083] Electronic devices can use m-order low-pass filters to preprocess ECG data. The upper limit of the preprocessing frequency can be F h Among them, F l With F h Customizable settings.

[0084] The electronic device obtains the filtered first data.

[0085] S502: The electronic device divides the data points in the first data into data points in a first category area, data points in a second category area, and data points in a buffer category area.

[0086] The electronic device can divide the ECG data into different areas according to the amplitude of the data points in the first data, which may include a first type of area, a second type of area and a buffer type of area. The first type of area may be a part of the QRS wave band in the ECG data, and the first type of area includes the R wave; the second type of area may include the area from the starting point of the T wave to the end point of the P wave; there is a buffer type of area between the first type of area and the second type of area. The buffer type of area includes a third type of area and a fourth type of area. The third type of area is an area of ​​a preset length adjacent to the boundary of the second type of area in the buffer type of area, and the fourth type of area is an area in the buffer type of area other than the third type of area.

[0087] It can be understood that the first type of area, the second type of area and the buffer area can appear periodically, and the data points of each type of area have certain characteristics or waveforms. The electronic device can divide the various types of areas based on the characteristics of the various types of data points, and can also divide the various types of areas based on the waveform of the ECG data. The embodiment of the present application does not limit the specific division method of the various types of areas.

[0088] S503: The electronic device performs smoothing processing on the data points in the second type of area through a plurality of windows of fixed lengths to obtain second data.

[0089] The window used to process the second type of area can be a sliding window with a fixed length. Multiple windows of fixed length can be understood as a window with a length of a taking the first data point as the center point at the first moment; and a window with a length of a taking the second data point as the center point at the second moment; wherein the ECG data is a discrete data point, the first data point can be the previous data point adjacent to the second data point, and the first moment is earlier than the second moment. By analogy, windows at different moments can show the effect of sliding similar windows on ECG data according to time.

[0090] The electronic device can smooth the data points in the window in the second type of region to obtain the processed data points of the second type of region. In the embodiments of the present application, the processed data points of the second type of region can be defined as the second data.

[0091] Among them, the smoothing process can be understood as removing or processing data points that form spikes, etc., so that the values of the smoothed data points form a relatively smooth curve.

[0092] S504. The electronic device smooths the data points in the third type of region through multiple fixed-length windows to obtain the third data; among them, the length of the fixed window used for smoothing the third type of region is less than the length of the fixed window used for smoothing the second type of region.

[0093] The window used for processing the third type of region can be a window with a fixed length. Among them, the window length set in step S504 can be less than the window length set in step S503. The electronic device can smooth the data points in the window in the third type of region to obtain the processed data points of the third type of region. In the embodiments of the present application, the processed data points of the third type of region can be defined as the third data.

[0094] It can be understood that the third type of region is in the buffer region between the first type of region and the second type of region. The amplitude difference between adjacent data points in the third type of region can be slightly higher than the amplitude difference between adjacent data points in the second type of region. The noise interferes strongly with the electrocardiogram signal in the second type of region. Therefore, the electronic device can select a longer fixed-length window to process the electrocardiogram data to make the second type of region achieve a better smoothing effect. However, the area covered by the third type of region is smaller. If the electronic device selects a longer window, it may over-smooth the electrocardiogram data in the third type of region, resulting in the loss of the characteristics of some data points. Therefore, the electronic device can use a shorter fixed window to smooth the electrocardiogram data in the third type of region.

[0095] S505. The electronic device smooths the data points in the fourth type of region through multiple non-fixed-length windows to obtain the fourth data.

[0096] The window used for processing the fourth type of region can be a variable-length sliding window. Multiple non-fixed-length windows can be understood as follows: at the first moment, a window with a length of a has the first data point as the center point; at the second moment, a window with a length of b (b > a or b < a) has the second data point as the center point, and so on.

[0097] Multiple non-fixed-length windows can be set as follows:

[0098] In a possible implementation, when the fourth type of area is a transition area from the first type of area to the third type of area, the lengths of multiple windows of non-fixed lengths gradually increase with time. For example, the window length a at the first moment is less than the window length b at the second moment; the window length at the second moment is less than the window length c at the third moment, and so on, the window length gradually increases with time.

[0099] It is understandable that the amplitude of the ECG data in the first category area is higher, and the amplitude of the ECG data in the third category area is lower; the amplitude of the ECG data in the fourth category area, which transitions from the first category area to the third category area, gradually decreases. When multiple fixed-length windows are used to smooth the ECG data in the fourth category area, if the window length is large, the ECG data close to the first category area may be over-smoothed and the features of the ECG signal may be lost; if the window length is small, the features of the ECG data close to the first category area are retained, but the ECG data close to the second category area does not achieve a good smoothing effect, and the noise may be mistaken for the ECG features. Therefore, for the ECG data in the fourth category area, it is difficult for electronic devices to find a fixed-length window suitable for the entire fourth category area.

[0100] Based on this, in the embodiment of the present application, the window length can be planned according to the amplitude of the ECG data in the fourth category area. For the fourth category area transitioning from the first category area to the third category area, the amplitude of the ECG data in this area gradually decreases over time, and accordingly, the selected window length can gradually increase over time.

[0101] In another possible implementation method, when the fourth type of area is a transition area from the third type of area to the first type of area, the lengths of multiple windows of non-fixed lengths gradually decrease over time. For example, the window length a at the first moment is greater than the window length b at the second moment; the window length b at the second moment is greater than the window length c at the third moment, and so on, the window length gradually decreases over time.

[0102] It can be understood that the amplitude of the ECG data of the fourth type area transitioning from the third type area to the first type area gradually increases with time, and a window with a length gradually decreasing with time can be selected to smooth the ECG data of this area.

[0103] S506: The electronic device integrates the second data, the third data, the fourth data and the data points of the first type of area to obtain fifth data after smoothing the electrocardiogram data.

[0104] The electronic device integrates the processed data points of the second type of area, the processed data points of the third type of area, the processed data points of the fourth type of area and the unprocessed data points of the first type of area to obtain smoothed ECG data.

[0105] In one possible manner, the electronic device updates the data points of the second category area to the data points of the second data; updates the data points of the third category area to the data points of the third data; updates the data points of the fourth category area to the data points of the fourth data; and the electronic device retains the data points of the first category area, thereby updating the first data to the fifth data.

[0106] In the embodiment of the present application, the electronic device preprocesses the ECG data to obtain the first data; the electronic device divides the data points in the first data into data points in the first category area, data points in the second category area and data points in the buffer category area, and the electronic device smoothes the data points in the second category area through multiple fixed-length windows to obtain the second data; the electronic device smoothes the data points in the third category area through multiple fixed-length windows to obtain the third data; the electronic device smoothes the data points in the fourth category area through multiple non-fixed-length windows to obtain the fourth data; the electronic device integrates the second data, the third data, the fourth data and the data points in the first category area to obtain the fifth data after smoothing the ECG data. In this way, the electronic device uses different windows to smooth the data points in the second category area, the third category area and the fourth category area, respectively, so as to smooth the noise in the ECG signal and reduce the interference of the noise on the ECG signal.

[0107] The following is a detailed description of step S502 in the embodiment of the present application in combination with steps S601-S606. Exemplarily, the electronic device divides the data points in the first data into data points of the first type of area, data points of the second type of area, data points of the third type of area, and data points of the fourth type of area, including:

[0108] The electronic device calculates the variability of the data point in the first data; the electronic device determines the region to which the data point of the first data belongs according to the variability of the data point in the first data and the variability threshold. The variability can reflect the relative discreteness of the data point in the first data, and the electronic device can determine the region type of the data point according to the variability of the data point in the first data.

[0109] Illustratively, an embodiment of the present application provides a method for distinguishing data points of a first type of region, a second type of region, a third type of region, and a fourth type of region according to a degree of variation.

[0110] S601: The electronic device calculates a first variability of data points in the first data, wherein the variability includes a first variability and a second variability, and the first variability is related to determining data points of the first type of area, data points of the third type of area, and data points of the fourth type of area.

[0111] In a possible implementation, the electronic device may take a window with a length of 2k+2 to calculate the first variability M1 of the data points of the first data. The electronic device may calculate the first variability of the data points in the first data to satisfy the following formula:

[0112] M1=mean(abs(diff(X1))) / (2k+1)(k is a positive integer) (1)

[0113] Where X1 = [x t-k-1 ,…,x t ,…x t+k ], X1 can be understood as a window with a length of 2k+2 that intercepts 2k+2 adjacent data points on the first data; x t is the data point of the first data at time t; x t-k-1 is the data point of the first data at time tk-1; x t+k is the data point of the first data at time t+k. The electronic device can use the 2k+2 data points in X1 to calculate the data point x t The first degree of variation.

[0114] The calculation logic of formula (1) is as follows: For data point x t The first variation M1, the electronic device selects the data point x t The first k+1 data points, data point x t And the data point x t The last k data points are taken as X1. First, the electronic device performs differential processing on the 2k+2 data points in X1, for example, x t -x t-1 , and obtain the difference of 2k+1 adjacent data points. Then, the electronic device sums and averages the absolute values ​​of the difference of 2k+1 adjacent data points to calculate and obtain the first variation M1.

[0115] For example, taking k=2 and X1=[1,3,4,2,3,2], the calculation process of M1 is explained.

[0116] diff(X1)=[2,1,-2,1,-1]

[0117] abs(diff(X1))=[|2|,|1|,|-2|,|1|,|-1|]=[2,1,2,1,1]

[0118] mean(abs(diff(X1)))=2+1+2+1+1=7

[0119] M1=mean(abs(diff(X1))) / (2k+1)=1.4

[0120] It can be understood that the above embodiment exemplarily introduces the electronic device calculating a data point x in the first data. t In the process of M1 corresponding to the first data, the electronic device can use a window of length 2k+2 to traverse all data points in the first data, thereby obtaining the first variation M1 corresponding to each data point. The steps of traversing other data points are similar to step S601, and will not be repeated in this embodiment of the application.

[0121] S602: When the first variation is lower than a first variation threshold, the electronic device determines that a data point in the first data is a data point of a second type of area.

[0122] The first variability threshold is used to obtain data points of the first category area, the third category area, and the fourth category area. The first variability threshold may be C1 (derived based on data statistical experience). In a possible implementation, the first variability threshold may be derived based on a variability characteristic curve of historical ECG data. Exemplarily, the electronic device may obtain data points of historical ECG data, calculate the variability of the data points of the historical ECG data, and define the variability of the boundary points that can distinguish between the second category area and other categories of areas (the first category area, the third category area, and the fourth category area) as C1.

[0123] The electronic device may calculate M1 of a data point of the first data. When the value of M1 is lower than C1, it indicates that the data point is located in the second type of area.

[0124] Alternatively, S603: when the first variation is not lower than the first variation threshold, the electronic device determines that the data point in the first data is a data point of the first type of area, a data point of the third type of area, or a data point of the fourth type of area.

[0125] When the value of M1 is not lower than C1, it indicates that the data point is not located in the second type of area, and the data point may be a data point in the first type of area, the third type of area, or the fourth type of area.

[0126] For example, Figure 6 As shown in a, Figure 6 a can be a characteristic curve of the first variability M1 of the data points of the first data, Figure 6 The solid line C1 in a can be the boundary between the second type of area and other types of areas, wherein the data points in the first data whose M1 is below C1 are data points in the second type of area, and the data points in the first data whose M1 is above C1 can be data points in other types of areas.

[0127] It can be understood that step S602 and step S603 do not have a sequence. Step S602 is a possible implementation method after the electronic device executes step S601; step S603 is another possible implementation method after the electronic device executes step S601. After obtaining the data point of the first data at time t, the electronic device calculates the first variability of the data point. If the first variability is lower than the first variability threshold, then the data point is a data point of the second category area. The electronic device may no longer divide the data point. If the first variability is not lower than the first variability threshold, then the data point is not a data point of the second category area, and the electronic device needs to continue to determine the area to which the data point belongs. After step S603, the electronic device may also execute step S604.

[0128] Exemplarily, S604: the electronic device calculates a second degree of variation of the data points of the first type of area, the data points of the third type of area, or the data points of the fourth type of area.

[0129] The electronic device continues to calculate the data points other than the second type of area to obtain a second variability, which is related to the data points that determine the first type of area.

[0130] In a possible implementation, the electronic device may take a window of length 2j+2 to calculate the second variability M2 of the data points of the first data. The electronic device may calculate the second variability of the data points of the first type of area, the third type of area, or the fourth type of area to satisfy the following formula:

[0131] M2=mean(abs(diff(X2))) / (2j+1)(j is a positive integer) (2)

[0132] Where X2 = [x t-j-1 ,…,x t ,…x t+j ], X2 can be understood as a window of length 2j+2 that intercepts 2j+2 adjacent data points on the data. The electronic device can use the 2j+2 data points in X2 to calculate the data point x t The second degree of variation.

[0133] It can be understood that M2 can be calculated for the data points of the first type of area, the third type of area, or the fourth type of area, the number of data points is less than the number of data points of the first data, and M2 is used to distinguish the first type of area. Therefore, the window for calculating M2 is generally not the same as the window for calculating M1, that is, j may not be equal to k.

[0134] In the embodiment of the present application, the operation logic of formula (2) is similar to the operation logic of formula (1), and will not be further illustrated here.

[0135] S605: When the second variation is not lower than the second variation threshold, the electronic device determines that the data point in the first data is a data point of the first type of area.

[0136] The second variability threshold is used to obtain data points of the first category area. The second variability threshold may be C2 (derived based on data statistical experience). In a possible implementation, the second variability threshold may be derived based on a variability characteristic curve of historical ECG data. Exemplarily, the electronic device may obtain data points of historical ECG data, calculate the variability of the data points of the historical ECG data, and define the variability of the boundary points that can distinguish between the first category area and the buffer category area (third category area and fourth category area) as C2.

[0137] The electronic device may calculate M2 of the data point of the first type of area, the third type of area, or the fourth type of area in step S603. When the value of M2 is not less than C2, it indicates that the data point is located in the first type of area.

[0138] Alternatively, S606: when the second variation is lower than the second variation threshold, the electronic device determines that the data point in the first data is a data point of the third type of area or a data point of the fourth type of area.

[0139] When the value of M2 is lower than that of C2, it indicates that the data point is located in the third or fourth category area. Figure 6 As shown in b, Figure 6 b may be a characteristic curve of the data point M2 of the first type of area, the third type of area, and the fourth type of area in step S604, Figure 6 The dotted line C2 in b can be the boundary between the first type of area and the buffer type of area (the third type of area and the fourth type of area), among which M2 below C2 is the data point of the third type of area or the fourth type of area, and M2 above C2 can be the data point of the first type of area.

[0140] It should be noted that, in order to facilitate the description of the method for dividing regions, the embodiment of the present application exemplarily shows the characteristic curve of M1 in step S601 and the characteristic curve of M2 in step S604. In actual operation, the characteristic curves of the two are not the same, and C1 and C2 have no specific size relationship.

[0141] It is understandable that step S605 and step S606 do not have a sequential order. Step S605 is a possible implementation method after the electronic device executes step S604; step S606 is another possible implementation method after the electronic device executes step S604. In the embodiment of the present application, the electronic device can execute steps S601-S606 for a data point in the first data to determine the type of area to which the data point belongs. Subsequently, the electronic device uses the method provided in the embodiment of the present application to traverse all the data points in the ECG data, and obtains the following Figure 4 The ECG data is divided into different types of regions.

[0142] In order to improve the ECG signal processing method of the embodiment of the present application, the ECG noise suppression effect is further divided into the data points of the third area and the data points of the fourth area. The method of dividing the third area and the fourth area is described below.

[0143] In addition to the first and second types of regions, there is also a buffer type region in the first data, and the buffer type region may include a third type of region and a fourth type of region. In a possible implementation, the embodiment of the present application may intercept an area of ​​a preset length in the buffer type region at the boundary between the second type of region and the buffer type region as a data point of the third type of region. The third type of region is an area of ​​a preset length adjacent to the boundary of the second type of region in the buffer type region.

[0144] For example, after the electronic device executes steps S601-S606, data points of the first type of area, data points of the second type of area, and data points of the buffer type of area can be obtained. Figure 7 As shown in a, the data point x t-1 Located at point A, data point x t Located at point B, where the data point x t With data point x t-1 are two adjacent data points, and the data point x t-1 In the buffer area, data point x t In the second type of area. At this time, the data point x t-1 With data point x t There may be a dividing line between the second type of area and the buffer type area.

[0145] The area of ​​preset length can be as follows Figure 7 The third type of area shown in b, wherein the preset length q can be customized. The electronic device selects an area with a length of q in the buffer area from the dividing line to obtain the third type of area. The data points of the third type of area may include [x t-q ,…,x t ).

[0146] For example, Figure 7 As shown in c and d, the data point x t Located in the second type of area, the data point x t+1 Located in the buffer area, data point x t With data point x t+1 are two adjacent data points. At this time, the data point x t+1 With data point x tThere may be a boundary line between the buffer area and the second area. The electronic device selects an area of ​​length q in the buffer area from the boundary line to obtain a third area. The data points of the third area may include (x t ,…,x t+q It is understandable that the ECG signal can be regarded as a periodic signal, and a single cycle may include two buffer regions. The electronic device processes the data points of the buffer regions in a similar manner. The present application embodiment will not be further described. Figure 7 Please explain c and d in detail.

[0147] It is understandable that, except for the third type of area in the buffer area, the remaining area is the fourth type of area. The buffer area is a transition area between the first type of area and the second type of area. The buffer area may include areas with higher amplitudes and areas with lower amplitudes. The embodiment of the present application can further divide the area into the third type of area and the fourth type of area to improve the effect of subsequent smoothing of the ECG signal.

[0148] The above embodiments provide a method for dividing ECG data into regions. The following describes a method for smoothing data points in various regions according to an embodiment of the present application.

[0149] S701. The electronic device does not process the data points in the first type of area.

[0150] After executing step S605, the electronic device can obtain the data points of the first category area. At this time, the electronic device can execute step S701. Among them, the amplitude of the data points of the first category area is relatively high. If the electronic device performs smoothing processing on the data points of this area, the signal characteristics of the data points of this area may be lost. Therefore, for the data points of this area, the electronic device may not perform smoothing processing on them and directly output the data points of the first category area, that is,

[0151] S702: The electronic device performs smoothing processing on the data points in the second type of area through a plurality of windows of fixed lengths to obtain second data.

[0152] After executing step S602, the electronic device can obtain data points of the second type of area, and at this time, the electronic device can execute step S702. The amplitude of the data points of the second type of area is low and gentle, and the second type of area covers a large range. For the data points in this area, the electronic device can use a fixed length window to perform smoothing processing to obtain second data.

[0153] The data point of the second data The following formula can be satisfied:

[0154]

[0155] The length of window X3 is 2H+1, and the length of window X3 is fixed, X3=[x t-H ,…,x t ,…,x t+H ], x t is the first data point at time t, x t-H is the data point of the first data at time tH, x t+H It is the data point of the first data at time t+H.

[0156] It is understood that window X3 may include data points x t The first H data points and data point x t The electronic device can sum the data points in window X3 and take the average value to obtain the data point x. t The corresponding data point of the second data In the embodiment of the present application, the electronic device can achieve the effect of suppressing noise by processing the amplitude of the data point where the noise is located as the average value of the amplitudes of the adjacent data points around the data point.

[0157] S703: The electronic device performs smoothing processing on the data points of the third type of area through a plurality of windows of fixed lengths to obtain third data. The length of the fixed window used for smoothing the third type of area is less than the length of the fixed window used for smoothing the second type of area.

[0158] After executing step S606, the electronic device can obtain the data points of the third category area, and at this time, the electronic device can execute step S703. Among them, the third category area is part of the buffer category area, and the third category area is adjacent to the second category area. The amplitude of the data points in the third category area changes relatively slowly, and the electronic device can still use a fixed-length window to smooth it. However, the range covered by the third category area is smaller than the range covered by the second category area, and the amplitude of the data points in the fourth category area may be slightly higher, so the window length used by the electronic device to process the data points of the third category area can be smaller than the window length used to process the data points of the second category area.

[0159] The third data point The following formula can be satisfied:

[0160]

[0161] Among them, the length of window X4 is 2Q+1, and the length of window X4 is fixed, X4=[x t-Q ,…,x t ,…,x t+Q ], x t is the first data point at time t, x t-Qis the first data point at time tQ, x t+Q is the data point of the first data at time t+Q. It can be understood that the third type of area is an area of ​​preset length q. When the electronic device calculates the data point of the third type of area, the selected window length should not exceed the length of the third type of area. Therefore, the value interval of the length of window X4 is [1, q].

[0162] S704: The electronic device performs smoothing processing on the data points of the fourth type of area through a plurality of windows of non-fixed lengths to obtain fourth data.

[0163] After executing step S606, the electronic device can obtain data points of the fourth category area. At this time, the electronic device can execute step S704. Among them, the fourth category area is a part of the buffer category area, and the fourth category area is adjacent to the first category area. The amplitude difference between adjacent data points in the fourth category area can show a trend of gradually increasing or gradually decreasing. Exemplarily, when the data points of the fourth category area are adjacent to the first category area, the amplitude difference between adjacent data points is large; when the data points of the fourth category area are adjacent to the third category area, the amplitude difference between adjacent data points is small. In view of the characteristics of the data points of the fourth category area, the electronic device can use multiple windows of non-fixed length to smooth the data points of the fourth category area to obtain fourth data.

[0164]

[0165] The length of window X5 is 2u+1, and the length of window X5 is variable, X5=[x t-u ,…,x t ,…,x t+u ], x t is the first data point at time t, x t-u is the data point of the first data at time tu, x t+u It is the data point of the first data at time t+u.

[0166] Exemplarily, one cycle of the electrocardiogram data may include two fourth-category regions. The fourth-category region may be a region where the first-category region transitions to the third-category region, or the fourth-category region may be a region where the third-category region transitions to the first-category region.

[0167] In a possible implementation, when the fourth category area is a transition area from the first category area to the third category area, the amplitude of the data points in the fourth category area gradually decreases. Therefore, for the data points in the fourth category area close to the first category area, the electronic device can select a shorter window for smoothing; for the data points in the fourth category area close to the third category area, the electronic device can select a longer window for smoothing. The length of window X5 gradually increases, and the multiple windows of non-fixed length can be multiple windows whose lengths gradually increase over time. For example, the value of u can be [1,2,…,Q).

[0168] In another possible implementation, when the fourth category area is a transition area from the third category area to the first category area, the amplitude of the data points in the fourth category area gradually increases. Therefore, for the data points in the fourth category area close to the first category area, the electronic device can select a shorter window for smoothing; for the data points in the fourth category area close to the third category area, the electronic device can select a longer window for smoothing. The length of window X5 gradually decreases, and the multiple windows of non-fixed length can be multiple windows whose lengths gradually decrease over time. For example, the value of u can be (Q,…,2,1].

[0169] It should be noted that there is no sequential order between steps S701-S704. The electronic device obtains the data point x of the first data. t Afterwards, the region to which the data point belongs can be determined according to steps S601-S606. Correspondingly, the electronic device selects a processing method for the corresponding region according to the region of the data point.

[0170] S705 , the electronic device integrates the second data, the third data, the fourth data and the data points of the first type of area to obtain fifth data after smoothing the electrocardiogram data.

[0171] The electronic device may integrate the data obtained in steps S701-S704. For example, the electronic device integrates the data points. Data Points Data Points With data points Reconstruct and output the fifth data after smoothing the electrocardiogram data.

[0172] In the embodiment of the present application, the electronic device classifies the data points of the first data and outputs the smoothed fifth data, thereby improving the noise suppression effect in the ECG data and reducing the influence of irregular noise in the ECG data on the ECG signal.

[0173] Combine the following Figure 8 The application scenario of the method for processing an electrocardiogram signal provided in the embodiment of the present application is described. Figure 8 As shown:

[0174] When the electronic device receives a trigger operation for starting electrocardiogram signal detection, the electronic device displays a data point of the fifth data.

[0175] Exemplarily, the electronic device receives a trigger operation for starting ECG signal detection; in response to the trigger operation for starting ECG signal detection, the electronic device starts to collect ECG data; after collecting each data point of ECG data, the electronic device pre-processes the data point to obtain a data point of the first data; the electronic device processes the data point of the first data into a data point of the fifth data, and displays the data point of the fifth data on the display screen. After traversing all the data points, the electronic device can display the fifth data.

[0176] It is understandable that in the embodiment of the present application, the electronic device can process and display the fifth data after smoothing after collecting the ECG data. In some embodiments, the electronic device can delay the display of the fifth data. Exemplarily, the electronic device divides the area to which the data points of the first data belong based on the window and performs smoothing. Then, when the electronic device calculates a certain data point, it must ensure that there are still n data points after the data point, and the value of n is not less than the maximum value among k, j, H, Q and u, that is, n ≥ max (k, j, H, Q, u). When the electronic device collects the data point x t+n The fifth data point can be output on the display screen. However, in actual operation, the time taken by the electronic device to collect n data points is very short, which can be regarded as the electronic device displaying the fifth data in real time.

[0177] The curve graph of the ECG signal can be shown as Figure 8 As shown, Figure 8 a is the curve graph of the first data, Figure 8 b is a curve diagram of the fifth data. It can be seen that when the amplitude of the data point in the first data is low, the ECG signal is greatly affected by noise, and an unsmooth curve appears. The curve of the fifth data processed by the method of the embodiment of the present application is relatively smooth in the band with low amplitude. Figure 8 c is a comparison chart of the first data and the fifth data. For the first type of area, the fifth data overlaps with the first data, which can more completely retain the ECG signal characteristics of the data points in the first type of area; for other areas, the fifth data is relatively smoother than the first data, indicating that the ECG signal processing method provided in the embodiment of the present application can effectively suppress the influence of noise on the ECG signal. Figure 8 The curve graph shown in b.

[0178] In one possible implementation, the electronic device may save the original ECG data, the first data, and the fifth data. In another possible implementation, the electronic device may delete the original ECG data after obtaining the first data based on the original ECG data preprocessing; and after obtaining the fifth data based on the first data processing, the electronic device deletes the first data, so that the memory occupied by the data can be reduced. The embodiments of the present application are not limited to this.

[0179] Combined with the above Figure 1-Figure 8 The method for processing an electrocardiogram signal provided in an embodiment of the present application is explained, and the device for executing the above method provided in an embodiment of the present application is described below.

[0180] For example, Fig. 9 The electrocardiogram signal processing device 900 provided in the embodiment of the present application includes an acquisition module 901 , a preprocessing module 902 , a region division module 903 , a smoothing processing module 904 and a data reconstruction module 905 .

[0181] The acquisition module 901 is used to acquire original ECG data. For example, the ECG data may be electrocardiography (ECG) data.

[0182] The preprocessing module 902 is used to execute the steps related to preprocessing in the embodiment of the present application. For example, the preprocessing module can execute step S501 to perform conventional noise reduction processing on the ECG data through high-pass filtering and low-pass filtering to obtain first data.

[0183] The region division module 903 is used to divide the first data into a first type of region, a second type of region, a third type of region, and a fourth type of region. For example, the region division module can execute steps S601-S606, and the electronic device obtains data points of the first type of region, data points of the second type of region, data points of the third type of region, and data points of the fourth type of region.

[0184] The smoothing processing module 904 is used to perform smoothing processing on the data points in different types of regions through windows of different lengths to obtain the second data, the third data, and the fourth data, respectively. For example, the smoothing processing module can execute steps S701-S704 to obtain smoothed data.

[0185] The data reconstruction module 905 is used to integrate the second data, the third data, the fourth data and the data points of the first type of area to obtain the fifth data after smoothing the ECG data. For example, the data reconstruction module can execute step S705 to obtain and output the fifth data.

[0186] The electronic device for executing the above method provided in the embodiment of the present application is described below. Fig.10 As shown, Fig.10A schematic diagram of the structure of an electronic device that supports the method for processing electrocardiogram signals provided in an embodiment of the present application. The electronic device may be a terminal device in an embodiment of the present application, or a chip or chip system in a terminal device.

[0187] like Fig.10 As shown, the electronic device 1000 can be used in a communication device, a circuit, a hardware component or a chip, and the electronic device includes: a display 1001 and a processor 1002. The display 1001 is used to support the electronic device to perform the display step; the processor 1002 is used to support the electronic device to perform the information processing step.

[0188] In a possible implementation, the electronic device 1000 may also include an interface circuit 1003. Specifically, the interface circuit is used to support the electronic device 1000 to perform the steps of sending and receiving data. The interface circuit 1003 may be an input or output interface, a pin or a circuit.

[0189] In a possible embodiment, the electronic device may further include: a memory 1004. The processor 1002 and the memory 1004 are connected via a line. The memory 1004 may be a device in one or more devices or circuits for storing programs or data. The memory 1004 may exist independently and be connected to the processor 1002 of the electronic device via a communication line. The memory 1004 may also be integrated with the processor 1002.

[0190] The memory 1004 may store computer-executable instructions of the method in the terminal device so that the processor 1002 executes the method in the above embodiment. The memory 1004 may be a register, a cache, or a RAM, etc. The memory 1004 may be integrated with the processor 1002. The memory 1004 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, and the memory 1004 may be independent of the processor 1002.

[0191] In the above embodiments, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory, or may be downloaded and installed in the memory in the form of software.

[0192] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium can include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (digital versatile disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0193] The embodiments of the present application also provide a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.

[0194] As a possible design, the computer readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while optical discs reproduce data optically using lasers.

[0195] The above combinations should also be included in the scope of computer-readable media. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for processing an electrocardiogram signal, characterized in that: Applied to electronic equipment, the method comprises: The electronic device preprocesses the ECG data to obtain first data; the preprocessing is used to filter out baseline drift and power frequency interference noise in the ECG data; The electronic device divides the data points in the first data into data points of a first area, data points of a second area and data points of a buffer area, wherein the first area is a part of the QRS wave band in the electrocardiogram data, and the first area includes the R wave; the second area includes the area from the starting point of the T wave to the end point of the P wave; the buffer area includes a third area and a fourth area, wherein the third area is an area of ​​a preset length adjacent to a boundary of the second area in the buffer area; and the fourth area is an area in the buffer area excluding the third area; The electronic device performs smoothing processing on the data points in the second type of area through a plurality of windows of fixed length to obtain second data; The electronic device performs smoothing processing on the data points in the third type of area through a plurality of windows of fixed lengths to obtain third data; wherein the length of the fixed window used for smoothing the third type of area is less than the length of the fixed window used for smoothing the second type of area; The electronic device performs smoothing processing on the data points in the fourth type of area through a plurality of windows of unfixed lengths to obtain fourth data; The electronic device integrates the second data, the third data, the fourth data and the data points of the first type of area to obtain fifth data after smoothing the electrocardiogram data.

2. The method according to claim 1, characterized in that When the fourth type of area is a transition area from the first type of area to the third type of area, the lengths of the multiple windows of non-fixed lengths gradually increase with time; Alternatively, when the fourth type of area is a transition area from the third type of area to the first type of area, the lengths of the multiple windows of non-fixed lengths gradually decrease over time.

3. The method according to claim 1 or 2, characterized in that: The first degree of variation is related to determining the data points of the first type of area, the data points of the third type of area, and the data points of the fourth type of area; the electronic device divides the data points in the first data into the data points of the first type of area, the data points of the second type of area, the data points of the third type of area, and the data points of the fourth type of area, including: The electronic device calculates the first variability of the data points in the first data; When the first degree of variation is lower than a first degree of variation threshold, the electronic device determines that the data point in the first data is a data point of the second type of area; Alternatively, when the first variability is not lower than the first variability threshold, the electronic device determines that the data point in the first data is a data point of the first category area, a data point of the third category area, or a data point of the fourth category area.

4. The method according to claim 3, characterized in that The second variability is related to determining the data points of the first type of area, the electronic device divides the data points in the first data into data points of the first type of area, data points of the second type of area, data points of the third type of area and data points of the fourth type of area, and further includes: The electronic device calculates the second variability of the data points of the first type of area, the data points of the third type of area, or the data points of the fourth type of area; When the second variability is not lower than a second variability threshold, the electronic device determines that the data point in the first data is a data point of the first type of area; Alternatively, when the second variability is lower than the second variability threshold, the electronic device determines that the data point in the first data is a data point of the third type of area or a data point of the fourth type of area.

5. The method according to claim 4, characterized in that The first variation M1 satisfies the following formula: M1=mean(abs(diff(X1))) / (2k+1); wherein k is a positive integer, the window length selected when calculating M1 is 2k+2, and X1 is a set of 2k+2 data points of the first data in the window; The second variation M2 satisfies the following formula: M2=mean(abs(diff(X2))) / (2j+1); wherein j is a positive integer, the window selected when calculating M2 is 2j+2, and X2 is a set of 2j+2 data points of the first data in the window.

6. The method according to any one of claims 1 to 5, characterized in that: is the data point of the second data at time t, the data point of the second data Satisfies the following formula: Among them, x t is the data point of the first data at time t, x t-H is the data point of the first data at time tH, x t+H is the data point of the first data at time t+H, H is a positive integer and H is a constant, calculate The selected window length is 2H+1.

7. The method according to any one of claims 1 to 5, characterized in that: The preset length is q, is the data point of the third data at time t, the data point of the third data Satisfies the following formula: where x t-Q is the data point of the first data at time t - Q, x t+Q is the data point of the first data at time t + Q, Q is a positive integer and Q is a constant, Q < H, when calculating the window length selected is 2Q + 1, and the value range of the window length is [1, q].

8. The method according to any one of claims 1 to 5, characterized in that: is the data point of the fourth data at time t, the data point of the fourth data Satisfies the following formula: Among them, x t-u is the data point of the first data at time tu, x t+u is the data point of the first data at time t+u, u is a positive integer and u is a variable, calculate The window length selected is 2u+1.

9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: When the electronic device receives a trigger operation for starting electrocardiogram data detection, the electronic device displays a data point of the fifth data.

10. The method according to any one of claims 1 to 9, characterized in that: The electronic device includes a wearable device, and the wearable device includes one or more of the following: a smart watch, a smart bracelet, or smart glasses.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the electronic device executes the method according to any one of claims 1 to 10.

12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the computer is caused to perform the method according to any one of claims 1 to 10.

13. A computer program product, characterized in that The method comprises a computer program which, when being executed, causes a computer to execute the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Noise segment recognition method, ECG signal processing method and device

    CN108158578A

  • Electrocardiosignal filtering method and device, computer equipment and storage medium

    CN114521899A

  • Method for adaptive filtration of electric cardiosignal

    RU2568817C1

  • Fetal electrocardiosignal separation method and device

    WO2018023697A1

Cited By

  • Electrocardiogram signal processing method and electronic device

    EP4454562A1

  • Electrocardiogram signal processing method and electronic device

    WO2024032063A1