Long-term electrocardiogram data online compression method, system, device and storage medium

By introducing a fault-tolerant matching mechanism with signal-to-noise ratio constraints through the TECA algorithm, the problem of low compression rate of long-term electrocardiogram data is solved, achieving efficient and real-time lossy compression, and ensuring the diagnosticability and computational efficiency of the signal.

CN120811394BActive Publication Date: 2026-01-06ANHUI PROVINCIAL HOSPITAL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511256246.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2026-01-06
Estimated Expiration
2045-09-04

AI Technical Summary

Technical Problem

Existing long-term electrocardiogram (ECG) data compression technologies struggle to balance the demands for high compression ratios, low computational complexity, and online real-time processing while ensuring signal diagnosticability (SNR≥20dB). In particular, the compression rate of traditional algorithms drops sharply in long-term ECGs.

Method used

The ECG compression algorithm based on transcription (TECA algorithm) is adopted, and a fault-tolerant matching mechanism with signal-to-noise ratio constraint is introduced. By adjusting the dictionary region size, the initial sliding window size and the lower limit of signal-to-noise ratio, imperfect matching is allowed to achieve lossy compression, and the computational load is reduced by using a parallel scanning queue.

Benefits of technology

While ensuring data quality, efficient online compression of long-term electrocardiograms was achieved, improving the compression rate, while meeting the low computational requirements of wearable devices and ensuring the diagnostic and real-time nature of the signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120811394B_ABST
    Figure CN120811394B_ABST
Patent Text Reader

Abstract

The application discloses a long-range electrocardiogram data online compression method, system and device and a storage medium, relates to the technical field of wearable medical monitoring, and comprises the following steps: receiving an electrocardiogram signal sequence in real time, and initializing a sliding window size; dynamically maintaining a reconstructed signal sequence in a dictionary area; calculating the local signal-to-noise ratio of each historical segment of the current sliding window and the dictionary area; if there is a segment that meets the requirement, the sliding window is dynamically expanded to the longest similar segment that meets the lower limit of the signal-to-noise ratio to the right, the window before expansion is compressed into a copy segment, and a copy instruction is output; if there is no segment that meets the requirement, the leftmost signal of the sliding window is moved into an original segment cache area to wait for output, and the sliding window is right-shifted by one bit for iteration until a segment that meets the requirement appears, then the signal in the original segment cache area is compressed into an original segment for output; and real-time decompression output data and dictionary area updating are performed. The method has the advantages of high compression ratio, settable signal-to-noise ratio lower limit, online encoding and decoding, and small computing power.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wearable medical monitoring technology, and in particular to a method, system, device, and storage medium for online compression of long-term electrocardiogram data. Background Technology

[0002] With the development of wearable medical devices, long-term dynamic electrocardiogram (ECG) monitoring technology has become an important tool for arrhythmia diagnosis and daily health management due to its ability to continuously record ECG signals for several days or even weeks. Since the ECG monitor itself only collects ECG signals and does not have the function of analyzing ECG data, the data usually needs to be sent to a server for analysis and storage. However, sending large amounts of data not only affects the battery life of the ECG monitor, thus shortening the monitoring cycle, but also incurs considerable data communication costs, increasing the cost of use.

[0003] To reduce data volume, existing electrocardiogram compression technologies are mainly divided into the following four categories:

[0004] 1. Frequency domain signal transformation, including Fourier transform and wavelet transform, was first applied to audio signal processing and later migrated to ECG data compression, but it did not fully consider the characteristics of ECG data. These methods involve complex convolutional transformations, and are therefore usually offline algorithms with a large computational load, while also causing a certain degree of signal distortion.

[0005] 2. Based on artificial intelligence models, including convolutional neural networks, autoencoders, and long short-term memory networks. This technique typically requires pre-training of the model to more accurately capture the temporal correlations of waveform data. These methods are usually offline algorithms, essentially involving encryption and compression. The compressed data lacks a strict format definition, and decompression requires well-trained model parameters. While this technique achieves high compression ratios, it involves enormous computational demands.

[0006] 3. Based on compressed sensing technology, this method can extract the main components of data in the frequency domain and ensure compression and fidelity performance through random sampling. However, due to the limitations of random sampling, this method is also an offline algorithm. Although the fidelity is good, the compression ratio is lower than other methods.

[0007] 4. General compression techniques, such as ZIP, typically have lower compression ratios than lossy compression because they fail to adequately account for the periodicity of ECG data and sensor noise. In particular, sensor errors and noise result in fewer precise matching patterns in the data, thus limiting the compression performance of lossless compression, and rendering lossless compression largely meaningless.

[0008] Crucially, current research is largely based on short-term ECG datasets (such as the 30-minute MIT-BIH arrhythmia database), whose signal patterns differ significantly from long-term ECGs. Long-term ECGs, due to their longer monitoring periods, contain more baseline drift, motion artifacts, and random noise, making it difficult for traditional compression algorithms that rely on "exact matching" to extract longer, similar segments, resulting in a sharp decrease in compression efficiency.

[0009] It is evident that there is an urgent need to research an online compression technology specifically designed for long-term electrocardiogram scenarios, which balances the requirements of high compression ratio, low computational complexity, and online real-time processing while ensuring signal diagnosticability (e.g., SNR≥20dB). Summary of the Invention

[0010] In a first aspect, to address the aforementioned technical problems, this invention provides an online compression method for long-term electrocardiogram (ECG) data. This method employs a transcription-based ECG compression algorithm and introduces a fault-tolerant matching mechanism with signal-to-noise ratio (SNR) constraints to balance compression ratio and fidelity. The adjustable parameters in the transcription-based ECG compression algorithm include dictionary size, initial sliding window size, and lower SNR limit. The fault-tolerant matching mechanism with signal-to-noise ratio constraints includes the following steps:

[0011] (a) Real-time reception of electrocardiogram signal sequences, wherein the initial sliding window size is ;

[0012] (b) The reconstructed signal sequence is dynamically maintained in the dictionary area, which is a queue of a certain length for storing the most recently decompressed ECG signal sequence;

[0013] (c) Calculate the local signal-to-noise ratio of the current sliding window to each historical segment of the dictionary region. :

[0014] If there exists a satisfying For the segment, the sliding window is dynamically expanded to the right until the lower signal-to-noise ratio limit is met. Find the longest similar segment, compress the expanded front window into the copied segment, and output the copying instructions;

[0015] If not satisfied If a segment is found to be missing, the leftmost signal of the sliding window is moved into the original segment buffer to await output, and the sliding window is shifted one position to the right for iteration until a segment that satisfies the condition is found. If the original fragment is a segment, then the signal in the original fragment buffer is compressed into the original fragment output;

[0016] (d) Decompress the output data in real time and update the reconstructed signal sequence of the dictionary area.

[0017] Furthermore, the local signal-to-noise ratio The calculation formula is:

[0018]

[0019] In the formula, The current window length; This represents the total number of signals processed. The original signal; This is the mean of the processed original signal; The signal to be compressed within the current window; This is the dictionary segment to be copied into the current window; These are correction values ​​used during copying, and can be obtained through... It can be calculated.

[0020] Furthermore, the copying instruction includes a copying offset. Copying length And correction values ​​for each value during copying. .

[0021] Furthermore, the transcribed fragment is stored as follows:

[0022] First byte: The copy offset encoded in varint. ;

[0023] Subsequent bytes: the length of the transcription encoded in varint. and the correction value .

[0024] Furthermore, the original fragment is stored as:

[0025] First byte: Fragment length ;

[0026] Subsequent bytes: A continuous set of raw signal values.

[0027] Furthermore, the dynamic maintenance of the reconstructed signal sequence specifically includes:

[0028] Set the size of the dictionary area. Create a length of An empty queue;

[0029] For the original fragment, the original signal value is directly output during decompression;

[0030] For the transcribed fragment, decompression should be performed according to... Reconstructing the electrocardiogram signal, among which, This is a decompressed signal sequence; For the total signal sequence; This refers to the copying offset; The length of the copy; The correction value;

[0031] The decompressed signals are appended sequentially to the end of the dictionary queue, and the length of the dictionary queue exceeds the size of the dictionary. When this happens, the oldest signal at the head of the dictionary queue is automatically removed.

[0032] Furthermore, the initial size of the sliding window satisfies the following relationship:

[0033]

[0034] in, The length of the segment to be compressed; the number of bytes for copying instructions, due to the use of varint encoding, has a maximum value determined by the dictionary size. Decide.

[0035] A second aspect of the present invention provides a compression device for long-term electrocardiogram data, comprising:

[0036] The signal receiving module is used to acquire ECG sample data in real time;

[0037] The dictionary area management module is configured to dynamically maintain and reconstruct the signal sequence;

[0038] A fault-tolerant matching engine is configured to perform the sliding window of the method and the local signal-to-noise ratio calculation at each location in the dictionary region management module; and

[0039] The output encoding module is used to output the original fragment or the copied fragment data stream.

[0040] A third aspect of the present invention provides a long-term electrocardiogram monitoring system, comprising:

[0041] The wearable electrocardiogram (ECG) device uses the aforementioned compression device to compress data in real time.

[0042] A cloud server is used to receive and decompress the compressed data.

[0043] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions that, when executed, implement the steps of the method.

[0044] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0045] This invention balances compression ratio and fidelity by employing a copy-based electrocardiogram compression algorithm and introducing a fault-tolerant matching mechanism with signal-to-noise ratio constraints. By setting a lower limit for the signal-to-noise ratio, imperfect matching is allowed while ensuring the quality of the compressed data with loss. At the same time, when calculating the signal-to-noise ratio, the copy-based electrocardiogram compression algorithm establishes a scanning queue in parallel for each position in the dictionary region, reducing the amount of computation. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a flowchart of the logic process disclosed in this invention;

[0048] Figure 2 This is a compressed format example of the handwritten electrocardiogram format disclosed in the embodiments of the present invention;

[0049] Figure 3 This is a sample of the decompressed format of the copy-style electrocardiogram format disclosed in the embodiments of the present invention. Detailed Implementation

[0050] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0051] Please see Figure 1 This invention aims to provide an online compression method for long-term electrocardiogram (ECG) data. It adopts a Transcript-based ECG Compression Algorithm (TECA algorithm) to introduce a fault-tolerant matching mechanism with signal-to-noise ratio constraints to balance compression rate and fidelity.

[0052] The TECA algorithm improves upon the classic LZ77 algorithm to increase compression ratio through fault tolerance. The key difference between TECA and LZ77 is that LZ77 requires perfect matching, while TECA allows for some matching error through signal-to-noise ratio (SNR) constraints. This design addresses the fact that long-range single-lead data contains more random noise than standard ECG data, resulting in shorter perfectly matched segments that become a bottleneck for compression performance. TECA sets a lower SNR limit, allowing for imperfect matching while maintaining lossy data quality after compression. When aligning new segments to the dictionary region, TECA uses a sliding window to select the longest similar segment within the dictionary region with an SNR not lower than the set lower limit for compression. Furthermore, when calculating the SNR, TECA establishes a parallel scan queue for each position in the dictionary region to reduce computational load, thereby improving the compression ratio.

[0053] This invention first defines a compressed file format for electrocardiogram (ECG) data—the Transcript-based ECG Format (TEF). This format only compresses and stores the digital signal data of the ECG waveform converted from the analog signal of the sensor; device parameter information such as sampling rate can be saved in a separate file. TEF compression and decompression do not rely on any dictionary or key; it contains complete information itself and can be compressed and decompressed according to the file format definition. The specific format definition of TEF is as follows:

[0054] A TEF file contains two types of fragments: original fragments and transcribed fragments. A file consists of multiple fragments, each with its first byte as a signed integer value. Determine the type of the segment it belongs to: , then it is the original fragment; This refers to copying a segment. The copying instructions include the copying offset. Copying length And correction values ​​for each value during copying. .

[0055] If it is a raw fragment, the raw fragment is stored as follows: the first byte indicates the fragment length. The following bytes are A series of raw signal values. Specifically, the first byte represents the length of the segment, denoted as... ;heel This is the raw ADC data signal. During decompression, this is the direct output. One electrocardiogram signal.

[0056] If it is a copied fragment, the copied fragment is stored as: the copy offset of the first byte encoded in varint. Subsequent bytes use varint encoding for the copy length. and correction value Specifically, the first byte is parsed in varint encoding (i.e., bytes are read continuously, with the last 7 bits of each byte forming an unsigned integer, until the highest bit is 1, at which point reading stops), and the copy offset is read. Then, an integer is read using varint encoding as the copy length. Next, another byte is read as a signed integer, representing the correction value for each value during copying. During decompression, let the output signal be... Then retrieve , each element Output afterwards. For example... Figure 2 This is an example of a compressed format. Figure 3 It means Figure 2 The result after sample decompression.

[0057] The following is a detailed description of the online compression method for long-term electrocardiogram data based on the TECA algorithm provided by this invention.

[0058] Adjustable parameters in the TECA algorithm include dictionary size. Initial sliding window size and lower limit of signal-to-noise ratio It is used to balance three performance indicators: compression ratio, signal-to-noise ratio, and computational load.

[0059] It should be noted that modifying or replacing adjustable parameters in the TECA algorithm (such as the sliding window size, dictionary area size, etc.) is essentially still part of the technical concept of this invention.

[0060] TECA algorithm input: Digital signal data array acquired by long-term electrocardiogram (ECG) monitoring dictionary size lower limit of signal-to-noise ratio Initial size of the sliding window .

[0061] TECA algorithm output: compressed potential data array .

[0062] In this embodiment, the default value of the dictionary area is 100,000. Although a larger dictionary area can improve the compression rate, it will increase the computational load of the algorithm and slow down the running speed.

[0063] lower limit of signal-to-noise ratio The default setting is 20dB to ensure that data distortion after decompression does not affect interpretation. While a higher lower limit for signal-to-noise ratio can further reduce data distortion, it will also reduce the compression ratio.

[0064] Sliding window initial size It should be set to the shortest original signal sequence length that can be reduced in bytes when compressed into a transcribed fragment, i.e. .in, This represents the length of the segment to be compressed. The maximum value of the transcription instruction bytes, due to the use of varint encoding, is determined by the dictionary size. Decide and simultaneously slide the initial window size. It also depends on the data type of the original signal. For example, if BF is 100000 and the original signal is a 16-bit integer, then... 3 is an acceptable value.

[0065] The TECA algorithm reads new signal data into an input buffer and processes it in real time. The compressed data is then output to a compressed file. Simultaneously with the real-time output of compressed data, it also decompresses and reconstructs the compressed data, placing the decompressed data into a dictionary area as the basis for subsequent compression.

[0066] Specifically, the fault-tolerant matching mechanism with signal-to-noise ratio constraints includes the following steps:

[0067] (a) Receive ECG signal sequences in real time, and initialize the sliding window size to... ;

[0068] (b) Dynamically maintain the reconstructed signal sequence in the dictionary area;

[0069] (c) Calculate the local signal-to-noise ratio between the current sliding window and each historical segment in the dictionary region. :

[0070] If there exists a satisfying For the segment, the sliding window will be dynamically expanded to the right until the lower limit of the signal-to-noise ratio is met. Find the longest similar segment, compress the expanded front window into the copied segment, and output the copying instructions;

[0071] If not satisfied If a segment is found, the leftmost signal of the sliding window is moved into the original segment buffer to await output, and the sliding window is shifted one position to the right for iteration until a segment that satisfies the condition is found. The original fragment is compressed into the original fragment output;

[0072] (d) Decompress and output data in real time and update the dictionary area.

[0073] In this scheme, the reconstructed signal sequence refers to the signal sequence obtained by compressing the original ECG signal sequence using the TECA algorithm and then decompressing it using the TECA algorithm. Since the TECA algorithm is a lossy compression algorithm, the reconstructed signal sequence is not entirely identical to the original signal sequence and exhibits subtle differences. The purpose of real-time signal sequence reconstruction is to feed it into the dictionary area, using the reconstructed signal sequence as a dictionary for subsequent signal compression.

[0074] In this scheme, the copied segment refers to the smallest record unit in the compressed TEF format. It indicates that the segment to be compressed is highly similar to a certain segment in the dictionary area, so only the start and end positions of the copy need to be specified, without retaining the full text, thus achieving data compression. In contrast, the original segment indicates that the segment to be compressed is not similar enough to any segment in the dictionary area, so it is not compressed and is directly output to the compressed format.

[0075] When new signal data is ready in the input buffer, the TECA algorithm will use an initial size of... A sliding scan window is used to scan the data. In each iteration, all signal data within the scan window is treated as a single segment, compared to each position in the dictionary region, and the transcription correction value is determined by calculating the mean difference. Then, the local signal-to-noise ratio (SNR) at each position can be calculated. Initially, its local SNR is... The calculation formula can be expressed as:

[0076] (1)

[0077] In the formula, The current window length; This represents the total number of signals processed. The original signal; This is the mean of the processed original signal; The signal to be compressed within the current window; This is the dictionary segment to be copied into the current window; These are correction values ​​used during copying, and can be obtained through... It can be calculated.

[0078] Among them, the molecular part of Enumerate all before The input signal is used to estimate an approximate value of the numerator of the overall signal-to-noise ratio. Then, the coefficients are used to... The global estimate is scaled to the number of signals within the sliding window region. In practice, it's not necessary to enumerate all previous signals each time in the algorithm implementation. Therefore, according to formula (2), this value in the numerator can be quickly calculated by continuously updating the average and sum of squares of the input signals:

[0079] (2)

[0080] denominator of Only the signals within the sliding window are enumerated, and the sum of squared differences is calculated. This calculation process can also be accelerated by using a similar form of the above formula (2), specifically: for each position in the dictionary region, maintain the sum of squared differences and the mean difference between it and the current sliding window. In this way, each time a new correction value is iterated, the denominator of the local signal-to-noise ratio can be quickly calculated according to formula (3):

[0081] (3)

[0082] As the sliding window changes, the sum of squared differences and the mean of differences can also be kept updated by adding or subtracting the first and last elements of the sliding window.

[0083] In summary, the local signal-to-noise ratio is finally obtained. The calculation formula can be expressed as:

[0084] (4)

[0085] In the formula, The current window length; This represents the total number of signals processed. The original signal; This is the mean of the processed original signal; The signal to be compressed within the current window; This is the dictionary segment to be copied into the current window; These are correction values ​​used during copying, and can be obtained through... It can be calculated.

[0086] In a further embodiment, dynamically maintaining the reconstructed signal sequence specifically includes:

[0087] Set dictionary size Create a length of An empty queue;

[0088] For the original fragment, the original signal value is directly output during decompression;

[0089] For the copied passages, follow the instructions during decompression. Reconstructing the electrocardiogram signal, among which, This is a decompressed signal sequence; for The number of elements in the middle; This is the offset for copying; This refers to the length of the text to be copied. This is a correction value;

[0090] The decompressed signals are appended sequentially to the end of the dictionary queue, and the dictionary queue length exceeds the dictionary size. When this happens, the oldest signal at the head of the dictionary queue is automatically removed.

[0091] In summary, the method provided by this invention, after obtaining the local signal-to-noise ratio of the current sliding window and all positions in the dictionary region, processes the data in two ways:

[0092] The first scenario: If the local signal-to-noise ratio (SNR) at all locations is below the lower SNR limit, meaning the sliding window segment cannot be compressed while satisfying the SNR constraint, then the earliest (leftmost, smallest memory address) signal in the sliding window is placed in the original segment buffer for later output. The sliding window then moves forward (to the right, towards higher memory addresses) by one signal and enters the next iteration. This process is repeated until a local SNR exceeds the lower SNR limit, at which point the signal in the original segment buffer is compressed into the original segment for output.

[0093] The second scenario: If the local signal-to-noise ratio (SNR) at one or more locations is higher than the lower SNR limit, it indicates that the current sliding window is compressible. In this case, the left side of the sliding window remains unchanged, while the right side is extended forward by one signal, entering the next iteration to attempt to compress a longer segment. This extension process continues until the local SNR at all locations is lower than the lower SNR limit, at which point the previous sliding window is compressed into a transcription segment.

[0094] In a specific example, such as Figure 1 The diagram illustrates the online compression process of the TECA algorithm in this technical solution. Specifically, the process begins with the input of the signal sequence and the initialization of the sliding window. The TECA algorithm first determines whether the input signal has ended; if so, it outputs all buffered signals; otherwise, it enters the core processing loop. Based on the signal-to-noise ratio... Binary decision-making: Calculate the local signal-to-noise ratio (SNR) of the current sliding window relative to all historical fragments within the dictionary region, and find the maximum value. Next, the process will proceed according to... Has the preset lower limit of signal-to-noise ratio been reached? It is divided into two processing paths:

[0095] Firstly, when If the signal-to-noise ratio (SNR) is similar to a historical signal in the dictionary within the tolerance range, the TECA algorithm does not compress immediately. Instead, it attempts to dynamically expand the sliding window one position to the right to find a longer similar segment, thereby maximizing compression efficiency. This expansion process is iterative until the SNR drops below the limit. Subsequently, the TECA algorithm compresses the unexpanded window content into a single copied segment and outputs it.

[0096] Secondly, when If a signal is not found, it means that no similar historical fragment can be found in the current window. In this case, the TECA algorithm moves the leftmost signal of the window into the original fragment buffer U, shifts the sliding window one position to the right, and enters the next iteration. Simultaneously, the process checks the length of the original fragment buffer. If its cumulative length has exceeded the initial window size This process packages these incompressible signals into a single raw fragment for output, ensuring that data is not cached indefinitely. This path guarantees that data can still be reliably output in its original format even when there is no matching signal.

[0097] Finally, regardless of whether the output is a copied fragment or the original fragment, the scheme decompresses the output data in real time and appends it to the end of the dictionary queue for subsequent matching reference. If the dictionary length exceeds a set size... Then the oldest signal at the head will be automatically removed, enabling dynamic updates of the dictionary area.

[0098] As can be seen, in this scheme, the output signal is reconstructed in real time and fed back to update the dictionary area, which in turn provides a basis for subsequent sliding window matching, thus realizing true online real-time compression and decompression.

[0099] To verify the effectiveness of the method provided in this invention, the following evaluation is conducted using three metrics: Compression Ratio (CR), Signal-to-Noise Ratio (SNR), and Percent Root-mean-square Difference (PRD).

[0100] This is the ratio of the original data size to the compressed data size. A higher value indicates higher compression efficiency, and it is widely accepted as a standard for compression efficiency. The specific formula is as follows:

[0101]

[0102] In the formula, This represents the size of the data before compression. This represents the size of the compressed data.

[0103] It is the ratio of the original signal centering value to the signal error after compression and reconstruction, used to compare the sensor noise level with the expected actual signal level. The higher the value, the better the signal is preserved. If V represents the input signal and R represents the reconstructed signal after decompression, then... The formula can be expressed as:

[0104]

[0105] PRD is the percentage of the root mean square error of the reconstructed signal to the root mean square error of the original signal, used to measure the degree to which the reconstructed signal deviates from the original signal. A smaller PRD indicates better quality of the reconstructed signal. The specific formula is as follows:

[0106]

[0107] Experimental data: Data were collected from patients who wore CardioSTAT recorders for an average of one week. Signals were recorded at a sampling rate of 250 Hz and a resolution of 16 bits, with a monitoring duration of up to two weeks. Heartbeats were annotated by 20 certified technicians, with annotations including heartbeat type (e.g., normal beat, atrial premature beats (PAC), ventricular premature beats (PVC)) and heart rhythm type (e.g., sinus rhythm, atrial fibrillation (AF), atrial flutter (AFL).

[0108] Experimental results:

[0109]

[0110] The experimental results show that the long-term electrocardiogram data compression method based on the TECA algorithm provided in this invention, compared with existing wavelet transform methods, compressed sensing methods, and gzip (DEFLATE), achieves significant improvements. , as well as It has significant advantages in all three metrics. Specifically, this invention overcomes the precise matching limitations of the traditional LZ77 algorithm by introducing a fault-tolerant matching mechanism with signal-to-noise ratio constraints. Combined with dynamic expansion of the sliding window and real-time updating of statistics, it ensures the quality of ECG signal diagnosis while maintaining accuracy. Under the premise of ≥20dB, achieve efficient online compression of long-term electrocardiograms (ECG). >20), while meeting the low computational requirements of wearable devices.

[0111] This invention also protects a compression device for long-term electrocardiogram (ECG) data, comprising a signal receiving module, a dictionary management module, a fault-tolerant matching engine, and an output encoding module. The signal receiving module is used to acquire ECG sample data in real time; the dictionary management module is configured to dynamically maintain and reconstruct the signal sequence; the fault-tolerant matching engine is configured to perform the sliding window of the above method and the local signal-to-noise ratio calculation at each position in the dictionary management module; and the output encoding module is used to output the original segment or copied segment data stream.

[0112] The present invention also protects a long-term electrocardiogram monitoring system, comprising a wearable electrocardiograph and a cloud server, wherein the wearable electrocardiograph uses the aforementioned compression device to compress data in real time; and the cloud server is used to receive and decompress the compressed data.

[0113] Furthermore, a computer-readable storage medium storing computer instructions that, when executed, implement the steps of the above-described method are also within the scope of protection of this invention.

[0114] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A long-term electrocardiogram data online compression method, characterized in that, The balance between compression rate and fidelity is achieved by introducing a signal-to-noise ratio (SNR) constrained fault-tolerant matching mechanism into a copy-based electrocardiogram (ECG) compression algorithm, wherein adjustable parameters in the copy-based ECG compression algorithm include a dictionary size, an initial sliding window size, and a lower limit of SNR The SNR constrained fault-tolerant matching mechanism includes the following steps: (a) receiving a sequence of electrocardiogram signals in real time, the initial sliding window size being ; (b) dynamically maintaining a reconstructed signal sequence in the dictionary area, the reconstructed signal sequence being a signal sequence after compression and decompression of the original ECG signal sequence; (c) calculating a local signal-to-noise ratio of the current sliding window with each historical segment of the dictionary region : If there is a segment of , the sliding window is dynamically extended to the right to meet the minimum signal-to-noise ratio of the longest similar segment, and the window before expansion is compressed into a copy segment, and a copy instruction is output. If no segment is found, the leftmost signal of the sliding window is moved into the original segment buffer for output, and the sliding window is right-shifted by one bit for iteration until a segment satisfying is found, and the signal in the original segment buffer is compressed for original segment output. (d) real-time decompression of the output data and updating the reconstructed signal sequence in the dictionary area.

2. The long-term electrocardiogram data online compression method according to claim 1, wherein, The local signal-to-noise ratio The calculation formula is: wherein, is the current window length; is the total number of processed signals; is the original signal; is the mean of the processed original signal; is the signal to be compressed in the current window; is the segment of the dictionary area to be transcribed into the current window; is the correction value when transcribing, which can be calculated by .

3. The long-term electrocardiogram data online compression method of claim 1, wherein, The copy instruction includes a copy offset , a copy length , and a correction value for each value at the time of copying .

4. The long-term electrocardiogram data online compression method according to claim 3, wherein, The copied fragment is stored as: First byte: the copy offset encoded using varint ; Subsequent bytes: the copy length encoded as a varint and the correction value .

5. The long-term electrocardiogram data online compression method of claim 1, wherein, The original fragment is stored as: Start byte: fragment length ; Subsequent bytes: one consecutive raw signal value.

6. The long-term electrocardiogram data online compression method according to claim 3, wherein, The dynamically maintained reconstructed signal sequence specifically comprises: setting the dictionary area size , an empty queue of length is created; For the original fragment, the original signal value is directly output during decompression; For the copy fragment, decompression is performed according to reconstructing an electrocardiogram signal, wherein is a decompressed signal sequence; is is the number of elements in the middle; is the copy offset; is the copy length; is the correction value; The decompressed signals are appended in order to the tail of the dictionary queue, and when the dictionary queue length exceeds the dictionary size the oldest signal at the head of the dictionary queue is automatically removed.

7. The long-term electrocardiogram data online compression method of claim 1, wherein, The initial size of the sliding window satisfies the relationship: wherein, is the length of the segment to be compressed; the number of bytes of the copy instruction has a maximum value determined by the size of the dictionary area because of the use of varint encoding.

8. An apparatus for compressing long-term electrocardiogram data, characterized by Comprise: A signal receiving module, configured to acquire ECG sampling data in real time; A dictionary area management module, configured to dynamically maintain a reconstructed signal sequence; A fault-tolerant matching engine, configured to perform the calculation of the local signal-to-noise ratio of the sliding window and each position in the dictionary area management module according to any one of the methods in claims 1-7; and An output encoding module, configured to output the original fragment or the copied fragment data stream.

9. A long-term electrocardiographic monitoring system, characterized by Comprise: A wearable ECG device, which adopts the compression device in claim 8 to compress data in real time; A cloud server, configured to receive and decompress the compressed data.

10. A computer readable storage medium storing computer instructions, characterized in that, The instructions, when executed, implement the steps of any one of the methods in claims 1-7.

Citation Information

Patent Citations

  • Cache data compression method

    CN115514375A

  • Bedside toilet electrocardiogram

    CN117440776A