Lossless compression method, lossless compression device, lossless decompression method and lossless decompression device for electrocardiogram signals

By detecting QRS complex waves through morphological filters and using the historical moments of the QRS buffer to determine and predict QRS complex waves, the problem of hardware efficiency and compression ratio in electrocardiogram signal compression is solved, and efficient compression and decompression effects are achieved.

CN118573201APending Publication Date: 2024-08-30TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410530279.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-29
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

It is difficult for the existing technology to ensure the hardware utilization efficiency of ECG signals while maintaining an excellent compression ratio. In particular, there are challenges in data management and transmission efficiency of portable medical devices.

Method used

Real-time detection of QRS complex wave fragments through morphological filters, using historical moments in the QRS buffer to determine and predict QRS complex waves, and sending prediction results of non-QRS complex waves based on the difference, reducing hardware resource occupation and improving hardware utilization efficiency.

Benefits of technology

Efficient hardware resource utilization is achieved while maintaining an excellent compression ratio, reducing the dynamic range and data volume of the ECG signal, adapting to various effective bit lengths, and optimizing power and area resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118573201A
    Figure CN118573201A
Patent Text Reader

Abstract

The invention relates to a lossless compression method and device and a decompression method and device for electrocardiogram signals. The lossless compression method comprises the steps that whether an ECG contains a QRS complex wave fragment or not is detected in real time through a morphological filter; when it is detected that the target ECG fragment contains a QRS complex wave fragment, a detection timestamp sequence of the QRS complex wave fragment is sent to a user terminal, and a predicted QRS complex wave corresponding to the target ECG signal fragment is determined based on the QRS complex wave fragment at the historical moment; or, under the condition that it is detected that the target ECG fragment does not contain the QRS complex wave fragment, the predicted QRS complex wave corresponding to the target ECG fragment is set to be 0; and based on the target ECG fragment and the difference value of the predicted QRS complex wave corresponding to the target ECG fragment, determining and sending a prediction result of the non-QRS complex wave in the target ECG fragment to the user terminal. The high hardware utilization efficiency is guaranteed, and meanwhile the excellent compression ratio is kept.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electrocardiogram signal compression, and in particular to a lossless compression method and device, and a decompression method and device for electrocardiogram signals. Background Art

[0002] In the rapidly developing field of healthcare technology, the acquisition and processing of electrocardiogram (ECG) signals are crucial. However, the large amount of data generated by multi-lead ECG recording devices poses significant challenges in data management, transmission efficiency and power consumption of portable medical devices. The on-chip ECG signal compression feature enables fast and cost-effective transmission of ECG information between medical institutions, ensuring timely access to diagnosis and treatment plans.

[0003] Although there are some compression methods in the prior art for compressing ECG signals, the existing compression solutions are generally difficult to ensure high hardware utilization efficiency while maintaining an excellent compression ratio (CR). Summary of the invention

[0004] The present invention provides a lossless compression method and device, and a decompression method and device for electrocardiogram signals, which are used to solve the problem of difficulty in ensuring high hardware utilization efficiency while maintaining an excellent compression ratio, and to achieve the goal of ensuring high hardware utilization efficiency while maintaining an excellent compression ratio.

[0005] The present invention provides a lossless compression method for an electrocardiogram signal, which is applied to a lossless compression device for an electrocardiogram signal, comprising: detecting in real time whether an electrocardiogram signal contains a QRS complex wave segment through a morphological filter; sending a detection timestamp sequence of the QRS complex wave segment to a user terminal when it is detected that a target electrocardiogram signal segment contains a QRS complex wave segment, and determining a predicted QRS complex wave corresponding to the target electrocardiogram signal segment based on the QRS complex wave segment at a historical moment in a QRS buffer; or, when it is detected that the target electrocardiogram signal segment does not contain a QRS complex wave segment, setting the predicted QRS complex wave corresponding to the target electrocardiogram signal segment to 0; determining and sending a predicted result of a non-QRS complex wave in the target electrocardiogram signal segment to the user terminal based on a difference between the target electrocardiogram signal segment and the predicted QRS complex wave corresponding to the target electrocardiogram signal segment.

[0006] In one of the embodiments, determining the predicted QRS complex wave corresponding to the target electrocardiogram signal segment based on the QRS complex wave segments at historical moments in the QRS buffer includes: determining the predicted QRS complex wave corresponding to the target electrocardiogram signal segment based on the average value of the QRS complex wave segments at historical moments in the QRS buffer.

[0007] In one of the embodiments, the method of determining and sending a prediction result of a non-QRS complex wave in a target electrocardiogram signal segment based on a difference between a target electrocardiogram signal segment and a predicted QRS complex wave corresponding to the target electrocardiogram signal segment to a user terminal includes: determining the non-QRS complex wave in the target electrocardiogram signal segment based on a difference between a target electrocardiogram signal segment and a predicted QRS complex wave corresponding to the target electrocardiogram signal segment; inputting the non-QRS complex wave in the target electrocardiogram signal segment into a preset linear predictor and a packager to obtain a prediction result of the non-QRS complex wave in the target electrocardiogram signal segment.

[0008] In one of the embodiments, the method of determining the non-QRS complex wave in the target electrocardiogram signal segment based on the difference between the target electrocardiogram signal segment and the predicted QRS complex wave corresponding to the target electrocardiogram signal segment includes: when it is detected that the target electrocardiogram signal segment contains a QRS complex wave segment, solving a first difference between the target electrocardiogram signal segment and the predicted QRS complex wave corresponding to the target electrocardiogram signal segment, and determining the non-QRS complex wave in the target electrocardiogram signal segment based on a second difference between the first difference and an actual value at an initial moment in the target electrocardiogram signal segment; or, when it is detected that the target electrocardiogram signal segment does not contain a QRS complex wave segment, determining the non-QRS complex wave in the target electrocardiogram signal segment based on a third difference between the target electrocardiogram signal segment and the predicted QRS complex wave corresponding to the target electrocardiogram signal segment.

[0009] In one of the embodiments, the real-time detection of whether the electrocardiogram signal contains a QRS complex wave segment through a morphological filter includes: detecting the waveform of the QRS complex wave shape in the electrocardiogram signal through a morphological filter; inputting the waveform of the QRS complex wave shape into a threshold comparator to determine whether the electrocardiogram signal contains a QRS complex wave segment.

[0010] The present invention also provides a decompression method for an electrocardiogram signal, which is applied to a user terminal, and comprises: receiving a detection timestamp sequence of a QRS complex wave segment from a compressor and a prediction result of a non-QRS complex wave in a target electrocardiogram signal segment; the QRS complex wave segment is detected by a morphological filter; the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment is determined based on the lossless compression method for the electrocardiogram signal according to any one of claims 1 to 5; based on the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment, determining the non-QRS complex wave in the target electrocardiogram signal segment; based on the detection timestamp sequence of the QRS complex wave segment and the non-QRS complex wave in the target electrocardiogram signal segment, determining the target electrocardiogram signal segment.

[0011] The present invention provides a lossless compression device for electrocardiogram signals, comprising: a lead module, a QRS detection module, a QRS prediction module, a two-choice selector, a delay buffer, a linear prediction module, a packer and a sending module; wherein the lead module is used to obtain an electrocardiogram signal; the QRS detection module comprises a morphological filter, a threshold comparator and a timer; the morphological filter is used to filter a waveform of a QRS complex wave shape in the electrocardiogram signal, the threshold comparator is used to determine an actual QRS complex wave from the waveform of the QRS complex wave shape; the timer is used to determine a timestamp sequence corresponding to the actual QRS complex wave; the QRS prediction module comprises a QRS buffer and a QRS predictor; the QRS buffer is used to buffer the actual QRS complex wave The QRS predictor is used to determine the predicted QRS complex wave based on the actual QRS complex wave cached in the QRS buffer; the two-to-one selector is used to output the predicted QRS complex wave when the actual QRS complex wave is detected, or output 0 when the actual QRS complex wave is not detected; the delay buffer is used to align the predicted actual QRS complex wave and the predicted QRS complex wave; the linear prediction module is used to determine the prediction result of the non-QRS complex wave in the electrocardiogram signal based on the electrocardiogram signal and the predicted QRS complex wave; the packager is used to package the prediction result of the non-QRS complex wave; the sending module is used to send the timestamp sequence corresponding to the actual QRS complex wave and the prediction result of the non-QRS complex wave to the user terminal.

[0012] The present invention provides a decompression device for an electrocardiogram signal, comprising: a receiving module, used to receive a detection timestamp sequence of a QRS complex wave segment from a compressor and a prediction result of a non-QRS complex wave in a target electrocardiogram signal segment; the QRS complex wave segment is detected by a morphological filter; the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment is determined based on the lossless compression method for the electrocardiogram signal according to any one of claims 1 to 5; a first determination module, used to determine the non-QRS complex wave in the target electrocardiogram signal segment based on the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment; and a second determination module, used to determine the target electrocardiogram signal segment based on the detection timestamp sequence of the QRS complex wave segment and the non-QRS complex wave in the target electrocardiogram signal segment.

[0013] A computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the above-mentioned lossless compression method for electrocardiogram signals.

[0014] A storage medium storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the above-mentioned lossless compression method for electrocardiogram signals.

[0015] The above-mentioned lossless compression method and device, decompression method and device of the electrocardiogram signal, by utilizing the repeatability of the ECG waveform, detects the QRS complex wave with large amplitude changes and repetitive existence therein, and sends its corresponding timestamp sequence to the user terminal, so that the user terminal can reconstruct the QRS complex wave according to the timestamp sequence and the repeatability of the QRS complex wave, and at the same time, by determining the predicted QRS complex wave corresponding to the target electrocardiogram signal segment based on the QRS complex wave segment at the historical moment in the QRS buffer, predicting the predicted QRS complex wave corresponding to the target electrocardiogram signal segment, and based on the difference between the target electrocardiogram signal segment and the predicted QRS complex wave corresponding to the target electrocardiogram signal segment, determining and sending the predicted result of the non-QRS complex wave in the target electrocardiogram signal segment to the user terminal, In order to utilize the repeatability of the QRS wave, it is only necessary to send the detection timestamp sequence of the QRS complex wave segment to the user terminal, and it is not necessary to repeatedly send the QRS complex wave to the user terminal. It is only necessary to send the fluctuation of the non-QRS complex wave caused by the prediction of the QRS complex wave to the user terminal (the difference between the target electrocardiogram signal segment and the predicted QRS complex wave corresponding to the target electrocardiogram signal segment). Therefore, the QRS segment with a large amplitude change is removed, so that the prediction result of the non-QRS complex wave has a higher compression rate. At the same time, since the QRS is detected by a simple hardware morphological filter, the corresponding hardware resources are less occupied, and the area of ​​the compressor of the electrocardiogram signal can also be greatly reduced. Therefore, it is possible to ensure high hardware utilization efficiency while maintaining an excellent compression ratio. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of an ECG signal, a QRS complex wave, and a waveform after the QRS complex wave is removed provided in one embodiment;

[0017] Figure 2 A schematic diagram of a framework of a lossless compression device for electrocardiogram signals provided in one embodiment;

[0018] Figure 3 One of the flowcharts of a method for lossless compression of an electrocardiogram signal provided in one embodiment;

[0019] Figure 4 The second flowchart of the method for lossless compression of electrocardiogram signals provided in one embodiment;

[0020] Figure 5A schematic diagram showing the difference between having offset compensation and not having offset compensation after detecting a QRS complex wave provided in one embodiment;

[0021] Figure 6 A schematic flow chart of a method for decompressing an electrocardiogram signal provided in one embodiment;

[0022] Figure 7 A schematic diagram of a framework of an electrocardiogram signal decompression device provided in one embodiment;

[0023] Figure 8 One of the schematic diagrams of experimental results provided in one embodiment;

[0024] Fig. 9 The second schematic diagram of the experimental results provided in an embodiment. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0026] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0027] In order to facilitate understanding, the inventive concept of the present invention is firstly explained.

[0028] It is understandable that ECG signals usually show repetitive patterns that are relatively consistent in individuals with normal heart rhythms, making ECG signals one of the most standardized and recognizable biomedical signals in healthcare. The QRS complex wave is the most important characteristic wave in the electrocardiogram signal, and its characteristic information is an important basis for the analysis and diagnosis of heart disease. A typical QRS complex wave consists of three connected waves. The first downward wave is the Q wave, and the narrow and high upward wave following the Q wave is the R wave. Another downward wave connected to the R wave is the S wave. Because these three waves are closely connected and the total time does not exceed 0.10 seconds, they are collectively called QRS complex waves.

[0029] In order to improve the transmission efficiency of ECG signals, the present invention utilizes the repeatability of ECG signals to detect QRS complex waves with large amplitude changes and repetitions, and uses a hardware-efficient morphological filter method to detect and store QRS complex waves for pattern-based prediction and QRS removal, thereby reducing the dynamic range (DR) of ECG signals. Specifically, the structural diagram of ECG signals is shown in FIG. Figure 1 As shown in (a), combined with Figure 1 As can be seen from the red area in (a), there are multiple QRS complex waves in the ECG signal. Figure 1 In the gray area of ​​(b), it can be seen that multiple QRS complexes show similar waveforms. Figure 1 The black line in (b) represents the average of multiple QRS complexes, combined with Figure 1 The gray area in (c) represents the waveforms after multiple QRS complex waves are removed from the QRS complex waves, which effectively reduces the dynamic range of the ECG signal. The non-QRS (Non-QRS, N-QRS) signal generated after QRS removal is linearly predicted (linear prediction, LP), and then a 32-bit format packer is used to format the linearly predicted non-QRS into a compressed structure to adapt to various effective bit lengths. In addition, the present invention adopts 40nm CMOS technology and a real-time 360Hz slow clock frequency to optimize power and area resources. By utilizing the repeatability of the ECG waveform, the proposed compressor can significantly reduce the amount of data that needs to be stored or transmitted without compromising the diagnostic accuracy of the signal.

[0030] The following describes the lossless compression method and device, and the decompression method and device of the electrocardiogram signal of the present invention in conjunction with the accompanying drawings.

[0031] Figure 2 FIG. 1 is a schematic diagram of a framework of a lossless compression device for electrocardiogram signals provided in one embodiment. Figure 2As shown, a lead module, a QRS detection module, a QRS prediction module, a two-choice selector, a delay buffer, a linear prediction module, a packer and a sending module; wherein the lead module is used to obtain an electrocardiogram signal; the QRS detection module includes a morphological filter, a threshold comparator and a timer; the morphological filter is used to filter the waveform of the QRS complex wave shape in the electrocardiogram signal, and the threshold comparator is used to determine the actual QRS complex wave from the waveform of the QRS complex wave shape; the timer is used to determine the timestamp sequence corresponding to the actual QRS complex wave; the QRS prediction module includes a QRS buffer and a QRS predictor; the QRS buffer is used to cache the actual QRS complex wave, and the QRS predictor is used to The method comprises the following steps: determining a predicted QRS complex wave based on the actual QRS complex wave cached in the QRS buffer; the two-to-one selector is used to output the predicted QRS complex wave when the actual QRS complex wave is detected, or output 0 when the actual QRS complex wave is not detected; the delay buffer is used to align the predicted actual QRS complex wave with the predicted QRS complex wave; the linear prediction module is used to determine the prediction result of the non-QRS complex wave in the electrocardiogram signal based on the electrocardiogram signal and the predicted QRS complex wave; the packager is used to package the prediction result of the non-QRS complex wave; the sending module is used to send a timestamp sequence corresponding to the actual QRS complex wave and the prediction result of the non-QRS complex wave to the user terminal.

[0032] Among them, the lead module can include 12 leads, and different leads come from different recording sites. The morphological filter is used to assert a valid signal when the morphological result exceeds a predetermined threshold, indicating a successful QRS detection. Each lead channel is equipped with a local two-step QRS buffer, a 37-depth delay FIFO for data synchronization, and a 9-depth buffer for storing packaged operation data. When QRS is detected, a timestamp is generated by a local timer. The two-step QRS buffer uses a ping-pong buffer to optimize data movement operations.

[0033] Figure 3 FIG. 1 is a flow chart of a lossless compression method for electrocardiogram signals provided in one embodiment. It can be understood that Figure 3 The lossless compression method of the electrocardiogram signal shown in FIG. 1 can be performed by the lossless compression device of the electrocardiogram signal described above. Figure 3 As shown, the lossless compression method of electrocardiogram signal provided by the present invention comprises the following steps:

[0034] Step 310: Detect in real time whether the electrocardiogram signal contains a QRS complex wave segment by using a morphological filter.

[0035] Among them, the morphological filter is used to extract and identify the waveform features of the QRS complex wave. It can be understood that the effectiveness of the hybrid compression method of the electrocardiogram signal depends to a large extent on the accurate detection of the QRS wave. However, ECG signals are often affected by slowly changing background noise, resulting in a gradual change in DC offset. In addition, the QRS complex wave signal has different types of shapes. Therefore, the present invention detects QRS through a morphological filter with simple hardware. Compared with other QRS detection methods, it can not only reduce the hardware resource occupation, but also greatly reduce the area of ​​the compressor of the electrocardiogram signal, and can also have better detection accuracy.

[0036] In the present invention, the process of extracting features from the waveform of the QRS complex wave by a morphological filter specifically includes: erosion / expansion, opening / closing, and moving the final result. Among them, the expression corresponding to the expansion operation is: Where f represents the original ECG signal, g() represents a step trigonometric function with a length of L of 25, and L ranges from 0 to 24; the expression corresponding to the erosion operation is:

[0037]

[0038] The expression corresponding to the open operation is:

[0039] The expression corresponding to the close operation is:

[0040] The expressions corresponding to the moves and operations are: Among them, TB=f-1 / 2·[f◇g+f*g].

[0041] In one embodiment, in combination Figure 1 , an electrocardiogram signal can be obtained from lead 1, and then the real-time acquired electrocardiogram signal is input into a morphological filter to detect a waveform of a QRS complex wave shape in the electrocardiogram signal; finally, the waveform of the QRS complex wave shape is input into a threshold comparator to determine whether the electrocardiogram signal contains a QRS complex wave segment.

[0042] Specifically, after the waveform of the QRS complex wave shape is input into the threshold comparator, if the amplitude value of the waveform of the QRS complex wave shape is greater than the preset threshold value in the threshold comparator, it is determined that the target target electrocardiogram signal segment contains a QRS complex wave segment; or, if the amplitude value of the waveform of the QRS complex wave shape is less than or equal to the preset threshold value in the threshold comparator, it is determined that the target target electrocardiogram signal segment does not contain a QRS complex wave segment.

[0043] Step 320, when it is detected that the target electrocardiogram signal segment contains a QRS complex wave segment, a detection timestamp sequence of the QRS complex wave segment is sent to the user terminal, and a predicted QRS complex wave corresponding to the target electrocardiogram signal segment is determined based on the QRS complex wave segment at a historical moment in the QRS buffer; or, when it is detected that the target electrocardiogram signal segment does not contain a QRS complex wave segment, the predicted QRS complex wave corresponding to the target electrocardiogram signal segment is set to 0.

[0044] Specifically, combined Figure 2 When a QRS complex wave segment is detected in the target electrocardiogram signal segment, the timestamp sequence corresponding to the QRS complex wave segment can be marked by a timer, and the detection timestamp sequence of the QRS complex wave segment can be sent to the user terminal. Figure 2 , when it is detected that the target electrocardiogram signal segment contains a QRS complex wave segment, the output of the corresponding two-choice selector is: based on the QRS complex wave segment at the historical moment in the QRS buffer, the predicted QRS complex wave S corresponding to the target electrocardiogram signal segment is determined P When it is detected that the target ECG signal segment contains a QRS complex wave segment, the output of the corresponding two-or-one selector is 0: that is, it can be understood that the target ECG signal segment is a non-QRS complex wave segment, or the predicted QRS complex wave corresponding to the target ECG signal segment is 0.

[0045] In one of the embodiments, the predicted QRS complex corresponding to the target electrocardiogram signal segment may be determined based on an average value of QRS complex segments at historical moments in a QRS buffer.

[0046] The QRS complex wave segment at the historical moment in the QRS buffer may be QRS complex wave segments at at least two historical moments, and the QRS complex wave segments at the at least two historical moments are located before the QRS complex wave segment corresponding to the target electrocardiogram signal segment. Correspondingly, in one embodiment, the expression of the predicted QRS complex wave corresponding to the target electrocardiogram signal segment is: S P =1 / 2·S0+1 / 2·S1, where S0 and S1 represent the QRS complex wave segment at the first historical moment and the QRS complex wave segment at the second historical moment, respectively, the QRS complex wave segment at the first historical moment and the QRS complex wave segment at the second historical moment are both located before the QRS complex wave segment corresponding to the target electrocardiogram signal segment, and the QRS complex wave segment at the second historical moment is adjacent to the QRS complex wave segment corresponding to the target electrocardiogram signal segment. In another embodiment, the predicted QRS complex wave S corresponding to the target electrocardiogram signal segment P The expression is: S P=1 / (m+1)·S0+1 / (m+1)·S1+…+1 / (m+1)·S m , where S0, S1, S m respectively represent the QRS complex wave segment of the first historical moment, the QRS complex wave segment of the second historical moment and the QRS complex wave segment of the m-th historical moment, wherein the QRS complex wave segment of the first historical moment, the QRS complex wave segment of the second historical moment and the QRS complex wave segment of the m-th historical moment are all located before the QRS complex wave segment corresponding to the target electrocardiogram signal segment, and the QRS complex wave segment of the m-th historical moment is adjacent to the QRS complex wave segment corresponding to the target electrocardiogram signal segment.

[0047] Step 330 , based on the target electrocardiogram signal segment and the difference between the predicted QRS complex wave corresponding to the target electrocardiogram signal segment, determine and send the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment to the user terminal.

[0048] In combination with the above step 320, it can be known that through real-time detection, when the target ECG signal segment contains a QRS complex wave, the predicted QRS complex wave corresponding to the target ECG signal segment can be determined, thereby determining the change of the QRS complex wave corresponding to the target ECG signal segment relative to the QRS complex wave at the historical moment, so that it is convenient to remove the corresponding QRS complex wave from the target ECG signal segment, and only compress the predicted result of the non-QRS complex wave to send it to the user terminal, thereby reducing the compression rate. At the same time, combined with the detection timestamp sequence of the QRS complex wave segment that has been sent to the user terminal in the previous text, the user terminal can reconstruct the target ECG signal segment.

[0049] The lossless compression method of electrocardiogram signal provided by the present invention detects QRS complex waves with large amplitude changes and repetitions therein by utilizing the repeatability of ECG waveform, and sends the corresponding timestamp sequence thereof to the user terminal, so that the user terminal can reconstruct the QRS complex wave according to the timestamp sequence and the repeatability of the QRS complex wave, and at the same time, determines the predicted QRS complex wave corresponding to the target electrocardiogram signal segment based on the QRS complex wave segment at the historical moment in the QRS buffer, predicts the predicted QRS complex wave corresponding to the target electrocardiogram signal segment, and determines and sends the predicted result of the non-QRS complex wave in the target electrocardiogram signal segment to the user terminal based on the difference between the target electrocardiogram signal segment and the predicted QRS complex wave corresponding to the target electrocardiogram signal segment. To eliminate the repeatability of RS waves, it is only necessary to send the detection timestamp sequence of the QRS complex wave segment to the user terminal. It is not necessary to repeatedly send the QRS complex wave to the user terminal. It is only necessary to send the fluctuation of the non-QRS complex wave caused by the prediction of the QRS complex wave to the user terminal (the difference between the target electrocardiogram signal segment and the predicted QRS complex wave corresponding to the target electrocardiogram signal segment). Therefore, the QRS segment with a large amplitude change is removed, so that the prediction result of the non-QRS complex wave has a higher compression rate. At the same time, since the QRS is detected by a simple hardware morphological filter, the corresponding hardware resources are less occupied, and the area of ​​the compressor of the electrocardiogram signal can also be greatly reduced. Therefore, it is possible to ensure high hardware utilization efficiency while maintaining an excellent compression ratio.

[0050] In one of the implementations such as Figure 4 As shown, the above step 330 includes:

[0051] Step 410 , determining a non-QRS complex in the target electrocardiogram signal segment based on a difference between the target electrocardiogram signal segment and a predicted QRS complex corresponding to the target electrocardiogram signal segment.

[0052] In combination with the above step 320, it can be known that the target electrocardiogram signal segment may not contain a QRS complex wave, and the predicted QRS complex wave corresponding to the corresponding target electrocardiogram signal segment is set to 0. Therefore, whether the target electrocardiogram signal segment contains a QRS complex wave needs to be discussed on a case-by-case basis. Therefore, step 410 includes step 4101 or step 4102.

[0053] Step 4101, when it is detected that a target electrocardiogram signal segment contains a QRS complex wave segment, solve the first difference between the target electrocardiogram signal segment and the predicted QRS complex wave corresponding to the target electrocardiogram signal segment, and determine the non-QRS complex wave in the target electrocardiogram signal segment based on the second difference between the first difference and the actual value at the initial moment in the target electrocardiogram signal segment.

[0054] The expression of the first difference is: SE0=S N -S P , where S N represents the target electrocardiogram signal segment. The expression of the second difference is: SE = SE0-S N [0], where S N [0] represents the actual value at the initial moment in the target electrocardiogram signal segment.

[0055] It is understandable that Figure 5 As shown in (b), when it is detected that the target ECG signal segment contains a QRS complex wave segment, the first difference is directly used as the non-QRS complex wave in the target ECG signal segment, which will introduce discontinuity at the boundary of the QRS duration. Therefore, the second difference can be further determined as the non-QRS complex wave in the target ECG signal segment based on the second difference between the first difference and the actual value at the initial moment in the target ECG signal segment.

[0056] Step 4102, when it is detected that the target ECG signal segment does not contain a QRS complex wave segment, determine the non-QRS complex wave in the target ECG signal segment based on the third difference between the target ECG signal segment and the predicted QRS complex wave corresponding to the target ECG signal segment.

[0057] It can be understood that, when it is detected that the target electrocardiogram signal segment does not include a QRS complex wave segment, the predicted QRS complex wave corresponding to the target electrocardiogram signal segment is 0.

[0058] Step 420, inputting the non-QRS complex wave in the target electrocardiogram signal segment into a preset linear predictor and a packer to obtain a prediction result of the non-QRS complex wave in the target electrocardiogram signal segment.

[0059] The preset linear predictor can be a two-step linear predictor. Different from using adaptive prediction coefficients, a simple fixed prediction function is implemented by simple shift and addition operations. After passing through the preset linear predictor, the corresponding prediction error Es is Es[n]=N[n]-1 / 2·N[n-1]-1 / 2·N[n-2]. Figure 2 It can be seen that N[n] represents the non-QRS complex wave in the target electrocardiogram signal segment, N[n-1] represents the previous adjacent non-QRS complex wave of the target electrocardiogram signal segment, and N[n-2] represents the previous adjacent non-QRS complex wave of the N[n-1].

[0060] In addition, the signal after the linear predictor processing is organized into 32-bit formatted packets with 6 different effective width changes, effective width w=3, 4, 5, 6, 7, 10.

[0061] Figure 5 A schematic diagram showing the difference between having offset compensation and not having offset compensation after detecting a QRS complex wave provided by the present invention. Figure 5 The left side of (a) is a schematic diagram of the original QRS complex wave. Figure 5 (b) is a schematic diagram of the first difference between the original QRS complex and the predicted QRS complex of the original QRS complex (without offset compensation), Figure 5 (c) in FIG. 1 is a schematic diagram showing a first difference value and a second difference value of an actual value at an initial moment in the original electrocardiogram signal segment (with offset compensation).

[0062] Figure 6 A decompression method for an electrocardiogram signal provided by the present invention is applied to a user terminal and comprises the following steps:

[0063] Step 610, receiving a detection timestamp sequence of a QRS complex wave segment from a compressor and a prediction result of a non-QRS complex wave in a target electrocardiogram signal segment.

[0064] The QRS complex wave segment is detected by a morphological filter; and the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment is determined based on the lossless compression method of the electrocardiogram signal described in any of the above embodiments.

[0065] Step 620: Determine the non-QRS complex wave in the target electrocardiogram signal segment based on the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment.

[0066] Specifically, this process is a symmetrical process with the above-mentioned process of predicting and packaging the non-QRS complex waves in the target electrocardiogram signal segment, and for the sake of brevity, it will not be repeated here.

[0067] Specifically, the prediction result Es of the non-QRS complex wave can be recovered from the packet by copying the leading bit with sign extension, and then the non-QRS complex wave N0 in the target electrocardiogram signal segment is obtained by the retention operation of the linear predictor.

[0068] Step 630: determine a target electrocardiogram signal segment based on the detection timestamp sequence of the QRS complex wave segment and the non-QRS complex wave in the target electrocardiogram signal segment.

[0069] Specifically, the QRS complex wave segment can be reconstructed based on the detection timestamp sequence of the QRS complex wave segment, and then the target electrocardiogram signal segment is determined based on the sum (Q0+N0) of the reconstructed QRS complex wave segment Q0 and the non-QRS complex wave N0 in the target electrocardiogram signal segment.

[0070] It is understandable that the first QRS complex segment With the decompressed non-QRS complex same, and the Nth QRS complex segment that follows It can be obtained by the following calculation formula: in is the corresponding Nth segment of the non-QRS complex signal.

[0071] Figure 7 The present invention provides a decompression device for an electrocardiogram signal, comprising:

[0072] A receiving module 710, configured to receive a detection timestamp sequence of a QRS complex wave segment from a compressor and a prediction result of a non-QRS complex wave in a target electrocardiogram signal segment; the QRS complex wave segment is detected by a morphological filter; the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment is determined based on the lossless compression method of the electrocardiogram signal described in any of the above embodiments;

[0073] A first determination module 720, configured to determine the non-QRS complex wave in the target electrocardiogram signal segment based on the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment;

[0074] The second determination module 730 is configured to determine a target electrocardiogram signal segment based on the detection timestamp sequence of the QRS complex wave segment and the non-QRS complex wave in the target electrocardiogram signal segment.

[0075] For ease of understanding, the effectiveness of the electrocardiogram signal lossless compression method and device, and decompression method and device of the present invention are explained below in conjunction with comparative experimental results.

[0076] Specifically, the proposed lossless compressor is evaluated using the MIT-BIH ECG arrhythmia database (see "PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals", and "The impact of the MIT-BIH arrhythmia database"), which consists of 48 sets of 30-minute ECG records. The average QRS detection accuracy of the morphological filter is 99.37%. The CR performance of different record sets is shown in Figure 2. Figure 8 As shown. Figure 8 As shown, the left bar graph of each two parallel bar graphs represents the result without removing the QRS complex wave, while the left bar graph of each two parallel bar graphs shows the result obtained by using the method proposed by the present invention. It can be understood that, in combination with the foregoing, the method proposed by the present invention is applicable to normal electrocardiograms with similar QRS segment shapes. Figure 8 As shown in the green bars in the figure, patients with mainly normal heartbeats showed more than 4% improvement in CR, patients with less than 4% increase in CR are shown in blue, and patients with less than 1% slight CR reduction due to arrhythmias are shown in orange. This decrease is attributed to the limitations of simple QRS prediction methods in dealing with different pattern shapes. Overall, the proposed method increased CR by 3% compared to the method without QRS wave removal.

[0077] Comparison with other lossless ECG signal compressors (JSSC'14, TBioCAS'17, TVLSI'17, TCAS-II'20 and TCAS-II'21) is shown in Fig. 9As shown. Specifically, JSSC'14 can refer to the document "An ECG-on-chip with 535nW / channel integrated lossless data compressor for wireless sensors", TBioCAS'17 can refer to the document "A hybrid data compression scheme for power reduction in wireless sensors for IoT", TVLSI'17 can refer to the document "A0.45V 147–375nW ECG compression processor with wavelet shrinkage and adaptive temporal decimation architectures", TCAS-II'20 can refer to the document "VLSI implementation of lossless ECG compression algorithm for low power devices", and TCAS-II'21 can refer to the document "VLSI implementation of multi-channel ECG lossless compression system". The LSP and packaging methods in JSSC'14 show a 3% smaller CR but require 3 times more power consumption. The WS, ATD, and MHRLC methods in TVLSI'17 require 53 times more area. The ALP and GRC methods in TCAS-II'20 result in 660 times higher power consumption. The MLP, ALP and GRC methods in TCAS-II'20 achieved higher CR on different PTB datasets (see Nutzung der EKG-Signaldatenbank CARDIODAT der PTB uber das internet for details), assuming an effective estimation of an 8-lead signal using 4 reference leads. However, this improvement comes at the expense of significantly higher area consumption. The work proposed in this paper is the only one that takes into account the repetitive patterns inherent in the ECG signal, allowing to retrieve the ECG QRS and detection timestamps separately from the compressed results. Moreover, the large storage requirements for the erosion and dilation operations during QRS detection are shared by up to 12 linear prediction modules and the packer, reducing the resource allocation per channel. In addition, a figure of merit (FoM) is introduced to evaluate the overall power and area efficiency, defined as FoM = 1×10 6 CR / (power x area).

[0078] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer, the computer can execute the lossless compression method of the electrocardiogram signal and the decompression method of the electrocardiogram signal provided by the present invention, wherein the lossless compression method of the electrocardiogram signal is applied to the lossless compression device of the electrocardiogram signal, including: detecting in real time through a morphological filter whether the electrocardiogram signal contains a QRS complex wave segment; when the target electrocardiogram signal segment contains a QRS complex wave segment, In the case of an S complex wave segment, a detection timestamp sequence of the QRS complex wave segment is sent to the user terminal, and the predicted QRS complex wave corresponding to the target ECG signal segment is determined based on the QRS complex wave segment at the historical moment in the QRS buffer; or, in the case of detecting that the target ECG signal segment does not contain a QRS complex wave segment, the predicted QRS complex wave corresponding to the target ECG signal segment is set to 0; based on the difference between the target ECG signal segment and the predicted QRS complex wave corresponding to the target ECG signal segment, a prediction result of the non-QRS complex wave in the target ECG signal segment is determined and sent to the user terminal.

[0079] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the lossless compression method for electrocardiogram signals and the decompression method for electrocardiogram signals provided by the present invention, wherein the lossless compression method for electrocardiogram signals is applied to a lossless compression device for electrocardiogram signals, including: detecting in real time through a morphological filter whether the electrocardiogram signal contains a QRS complex wave segment; in the case where it is detected that the target electrocardiogram signal segment contains a QRS complex wave segment, sending a detection timestamp sequence of the QRS complex wave segment to a user terminal, and determining a predicted QRS complex wave corresponding to the target electrocardiogram signal segment based on the QRS complex wave segment at a historical moment in the QRS buffer; or, in the case where it is detected that the target electrocardiogram signal segment does not contain a QRS complex wave segment, setting the predicted QRS complex wave corresponding to the target electrocardiogram signal segment to 0; based on the difference between the target electrocardiogram signal segment and the predicted QRS complex wave corresponding to the target electrocardiogram signal segment, determining and sending the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment to the user terminal.

[0080] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A lossless compression method for electrocardiogram signals, characterized in that: Applied in the lossless compression device of electrocardiogram signal, including: The morphological filter is used to detect in real time whether the electrocardiogram signal contains QRS complex wave segments; When it is detected that the target electrocardiogram signal segment contains a QRS complex wave segment, a detection timestamp sequence of the QRS complex wave segment is sent to the user terminal, and a predicted QRS complex wave corresponding to the target electrocardiogram signal segment is determined based on the QRS complex wave segment at a historical moment in the QRS buffer; or, when it is detected that the target electrocardiogram signal segment does not contain a QRS complex wave segment, the predicted QRS complex wave corresponding to the target electrocardiogram signal segment is set to 0; Based on the target electrocardiogram signal segment and the difference between the predicted QRS complex wave corresponding to the target electrocardiogram signal segment, a prediction result of a non-QRS complex wave in the target electrocardiogram signal segment is determined and sent to the user terminal.

2. The lossless compression method for electrocardiogram signals according to claim 1, characterized in that: The step of determining a predicted QRS complex wave corresponding to a target electrocardiogram signal segment based on a QRS complex wave segment at a historical moment in a QRS buffer includes: Based on the average value of the QRS complex wave segments at historical moments in the QRS buffer, a predicted QRS complex wave corresponding to the target electrocardiogram signal segment is determined.

3. The lossless compression method for electrocardiogram signals according to claim 1, characterized in that: The method of determining and sending a prediction result of a non-QRS complex wave in the target electrocardiogram signal segment to the user terminal based on the target electrocardiogram signal segment and the difference between the predicted QRS complex wave corresponding to the target electrocardiogram signal segment comprises: determining a non-QRS complex in the target electrocardiogram signal segment based on a difference between the target electrocardiogram signal segment and a predicted QRS complex corresponding to the target electrocardiogram signal segment; The non-QRS complex wave in the target electrocardiogram signal segment is input into a preset linear predictor and a packer to obtain a prediction result of the non-QRS complex wave in the target electrocardiogram signal segment.

4. The method for lossless compression of electrocardiogram signals according to claim 3, characterized in that: The step of determining the non-QRS complex wave in the target electrocardiogram signal segment based on the target electrocardiogram signal segment and the difference between the predicted QRS complex wave corresponding to the target electrocardiogram signal segment comprises: In the case where a QRS complex wave segment is detected in the target electrocardiogram signal segment, solving a first difference between the target electrocardiogram signal segment and a predicted QRS complex wave corresponding to the target electrocardiogram signal segment, and determining a non-QRS complex wave in the target electrocardiogram signal segment based on a second difference between the first difference and an actual value at an initial moment in the target electrocardiogram signal segment; or, When it is detected that the target electrocardiogram signal segment does not contain a QRS complex wave segment, a non-QRS complex wave in the target electrocardiogram signal segment is determined based on a third difference between the target electrocardiogram signal segment and a predicted QRS complex wave corresponding to the target electrocardiogram signal segment.

5. The lossless compression method for electrocardiogram signals according to claim 1, characterized in that: The method of detecting in real time whether the electrocardiogram signal contains a QRS complex wave segment by using a morphological filter comprises: Detecting a QRS complex wave shape waveform in the electrocardiogram signal by a morphological filter; The QRS complex wave shape waveform is input into a threshold comparator to determine whether the electrocardiogram signal contains a QRS complex wave segment.

6. A method for decompressing an electrocardiogram signal, characterized in that: Applied to user terminals, including: Receiving a detection timestamp sequence of a QRS complex wave segment from a compressor and a prediction result of a non-QRS complex wave in a target electrocardiogram signal segment; the QRS complex wave segment is detected by a morphological filter; the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment is determined based on the lossless compression method of the electrocardiogram signal according to any one of claims 1 to 5 above; Determining the non-QRS complex wave in the target electrocardiogram signal segment based on the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment; A target electrocardiogram signal segment is determined based on the detection timestamp sequence of the QRS complex wave segment and the non-QRS complex wave in the target electrocardiogram signal segment.

7. A lossless compression device for electrocardiogram signals, characterized in that: include: Lead module, QRS detection module, QRS prediction module, two-choice selector, delay buffer, linear prediction module, packager and sending module; Wherein, the lead module is used to obtain electrocardiogram signals; The QRS detection module includes a morphological filter, a threshold comparator and a timer; the morphological filter is used to filter the waveform of the QRS complex wave shape in the electrocardiogram signal, the threshold comparator is used to determine the actual QRS complex wave from the waveform of the QRS complex wave shape; the timer is used to determine the timestamp sequence corresponding to the actual QRS complex wave; The QRS prediction module includes a QRS buffer and a QRS predictor; the QRS buffer is used to cache the actual QRS complex wave, and the QRS predictor is used to determine the predicted QRS complex wave based on the actual QRS complex wave cached in the QRS buffer; The one-to-two selector is used to output a predicted QRS complex wave if an actual QRS complex wave is detected, or to output 0 if an actual QRS complex wave is not detected; The delay buffer is used to align the predicted actual QRS complex wave with the predicted QRS complex wave; The linear prediction module is used to determine the prediction result of the non-QRS complex wave in the electrocardiogram signal based on the electrocardiogram signal and the predicted QRS complex wave; The packager is used for packaging the prediction results of the non-QRS complex wave; The sending module is used to send the timestamp sequence corresponding to the actual QRS complex wave and the prediction result of the non-QRS complex wave to the user terminal.

8. A decompression device for electrocardiogram signal, characterized in that: include: A receiving module, used for receiving a detection timestamp sequence of a QRS complex wave segment from a compressor and a prediction result of a non-QRS complex wave in a target electrocardiogram signal segment; the QRS complex wave segment is detected by a morphological filter; the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment is determined based on the lossless compression method of the electrocardiogram signal according to any one of claims 1 to 5 above; A first determination module, configured to determine the non-QRS complex wave in the target electrocardiogram signal segment based on the prediction result of the non-QRS complex wave in the target electrocardiogram signal segment; The second determination module is used to determine the target electrocardiogram signal segment based on the detection timestamp sequence of the QRS complex wave segment and the non-QRS complex wave in the target electrocardiogram signal segment.

9. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, characterized in that: When the computer-readable instructions are executed by the processor, the processor executes the steps of the lossless compression method for electrocardiogram signals according to any one of claims 1 to 5 or the lossless decompression method for electrocardiogram signals according to claim 6.

10. A storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the lossless compression method for electrocardiogram signals as described in any one of claims 1 to 5 or the lossless decompression method for electrocardiogram signals as described in claim 6.