Edge ai and personalized template library-based electrocardiosignal compression transmission method, device and system

CN122602099APending Publication Date: 2026-08-18GUANGDONG BIOLIGHT MEDITECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610744921.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-27
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0005]本发明的第一目的是提供一种基于边缘AI与个性化模板库的心电信号压缩传输方法,解决现有心电监测设备数据量大、功耗高、无法兼顾波形完整性与高压缩比,未考虑不同患者心电个体差异的问题

Benefits of technology

[0009]As can be seen from the above scheme, this invention utilizes the periodicity and individual characteristic stability of electrocardiogram (ECG) signals to achieve ultra-high compression ratio data packet transmission through template matching with a personalized template library. Compared to methods that only transmit parameters such as heart rate, this invention can reconstruct complete P-QRS-T waveforms, allowing doctors to obtain diagnostic information equivalent to the original data. This invention performs feature extraction and matching at the edge of the ECG signal compression transmission device, transmitting only a very small amount of data, while the waveform reconstruction and analysis are completed at the cloud-based ECG signal reconstruction device, achieving a reasonable allocation of computational load. This invention can reduce wireless transmission power consumption and improve device battery life. Due to the small amount of data transmitted, this invention has relatively lower network requirements. This invention extracts monitoring feature vectors based on encoder neural networks, which is more accurate, faster, and more applicable than existing manual feature extraction methods using rule-based feature engineering. This invention establishes a personalized template library for each patient, which can self-optimize for the ECG characteristics of different patients, taking into account both universality and individual differences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122602099A_ABST
    Figure CN122602099A_ABST
Patent Text Reader

Abstract

The application provides an electrocardiosignal compression transmission method, device and system based on edge AI and a personalized template library, wherein the scheme comprises the following steps: acquiring a monitoring electrocardiosignal; processing the monitoring electrocardiosignal through an encoder neural network to obtain a monitoring feature vector; determining target template information matched with the monitoring feature vector according to a locally stored personalized template library; and transmitting a target data packet to an external electrocardiosignal reconstruction device according to the target template information, wherein the electrocardiosignal reconstruction device is used for reconstructing a target electrocardiosignal matched with the monitoring electrocardiosignal according to a decoder neural network and the target data packet. The application solves the problems of large data volume, high power consumption, inability to balance waveform integrity and high compression ratio of existing electrocardiosignal monitoring equipment, and insufficient consideration of electrocardiosignal individual differences of the same patient, and significantly reduces data transmission volume under the premise of ensuring high-fidelity reconstruction of electrocardiosignal waveforms, and takes into account individual differences of patients, and realizes reliable transmission under a low-bandwidth network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical data processing technology, specifically to a method, apparatus, and system for compressing and transmitting electrocardiogram signals based on edge AI and a personalized template library. Background Technology

[0002] Traditional electrocardiogram (ECG) monitoring devices primarily employ two data transmission methods. The first is raw data transmission, where wearable devices transmit the collected raw ECG waveform data completely to the cloud or mobile terminal. This approach suffers from high power consumption and transmission latency due to the massive data volume, placing high demands on network bandwidth and cloud storage capabilities. A typical example is the traditional Holter monitor. The second method involves feature extraction followed by transmission. This involves simple signal processing on the device side, extracting and transmitting only limited feature parameters such as R-wave position and average heart rate. While this significantly reduces the data volume, it loses crucial waveform morphological information such as the P wave, QRS complex, and T wave, making it impossible to reconstruct the complete waveform at the receiving end. This severely limits its clinical diagnostic value. A typical example is some simplified versions of ECG monitors.

[0003] The existing technologies have the following main shortcomings: First, there is a contradiction between data volume and power consumption. Transmitting raw data leads to excessive power consumption, while transmitting simple features results in the loss of important clinical information. Second, there is a bottleneck in power consumption and battery life. Continuous wireless data transmission is the main source of power consumption for wearable devices, which seriously restricts the device's battery life. Third, there is poor personalization and adaptation capabilities. Most existing solutions are general designs, which make it difficult to achieve adaptive optimization based on the patient's unique ECG characteristics.

[0004] For example, a method for transmitting electrocardiogram and heart sound data is disclosed as follows: a vector database stores multiple data packet feature vector groups, each data packet feature vector group corresponding to a unique vector identifier; for the first, second, and third data packets obtained after processing in a cardiac cycle, the data packet feature vectors corresponding to each data packet are obtained and combined to obtain a data packet feature vector group; the similarity between this data packet feature vector group and each data packet feature vector group in the vector database is calculated; the data packet feature vector with the highest similarity exceeding the preset data is obtained, and its corresponding vector identifier is determined as the cardiac cycle compressed package; the server stores the correspondence between data packet identifiers and data packet features, and the server restores the corresponding data packet features based on the received data packet identifiers. However, this solution does not consider the individual differences in ECGs among different patients and uses a general data packet feature database for comparison, which requires a large amount of local storage space, has low processing efficiency, and is difficult to dynamically optimize. Furthermore, the feature extraction (peak position, time period, peak amplitude) is a conventional rule-based feature engineering, and the weights and parameters have already been set in the code stage, resulting in poor deep feature expression capabilities. In addition, since it does not involve anomaly handling mechanisms, it cannot cope with abnormal waveforms of unknown features and has inherent analysis and alarm delays, making it unsuitable for critical cardiac monitoring scenarios with high real-time requirements. Summary of the Invention

[0005] The primary objective of this invention is to provide a method for compressing and transmitting electrocardiogram (ECG) signals based on edge AI and a personalized template library, addressing the problems of existing ECG monitoring devices, such as large data volume, high power consumption, inability to balance waveform integrity and high compression ratio, and failure to consider individual differences in ECG data among different patients.

[0006] A second objective of this invention is to provide an apparatus for implementing the above-described method for compressing and transmitting electrocardiogram signals based on edge AI and a personalized template library.

[0007] A third objective of this invention is to provide a system for implementing the above-described method for compressing and transmitting electrocardiogram signals based on edge AI and a personalized template library.

[0008] To achieve the aforementioned first objective, this invention provides a method for compressing and transmitting electrocardiogram (ECG) signals based on edge AI and a personalized template library, comprising the following steps: acquiring a monitored ECG signal; processing the monitored ECG signal through an encoder neural network to obtain a monitored feature vector; determining target template information matching the monitored feature vector based on a locally stored personalized template library; and sending a target data packet to an external ECG signal reconstruction device based on the target template information, wherein the ECG signal reconstruction device is used to reconstruct a target ECG signal matching the monitored ECG signal based on the decoder neural network and the target data packet.

[0009] As can be seen from the above scheme, this invention utilizes the periodicity and individual characteristic stability of electrocardiogram (ECG) signals to achieve ultra-high compression ratio data packet transmission through template matching with a personalized template library. Compared to methods that only transmit parameters such as heart rate, this invention can reconstruct complete P-QRS-T waveforms, allowing doctors to obtain diagnostic information equivalent to the original data. This invention performs feature extraction and matching at the edge of the ECG signal compression transmission device, transmitting only a very small amount of data, while the waveform reconstruction and analysis are completed at the cloud-based ECG signal reconstruction device, achieving a reasonable allocation of computational load. This invention can reduce wireless transmission power consumption and improve device battery life. Due to the small amount of data transmitted, this invention has relatively lower network requirements. This invention extracts monitoring feature vectors based on encoder neural networks, which is more accurate, faster, and more applicable than existing manual feature extraction methods using rule-based feature engineering. This invention establishes a personalized template library for each patient, which can self-optimize for the ECG characteristics of different patients, taking into account both universality and individual differences.

[0010] A further approach includes acquiring an initial electrocardiogram (ECG) signal; determining a preset number of cardiac cycle waveforms based on the initial ECG signal; processing the cardiac cycle waveforms through an encoder neural network to obtain the corresponding initial feature vectors; storing the initial feature vectors as initial template information in a personalized template library; and uploading the personalized template library to the ECG signal reconstruction device.

[0011] Therefore, the present invention can construct initial template information based on the patient's electrocardiogram data over a certain historical period (1-2 minutes), ensuring that the template is highly consistent with the patient's individual characteristics.

[0012] A further approach is to determine the target template information that matches the monitoring feature vector based on the locally stored personalized template library, including the following steps: determining whether there is candidate template information that matches the monitoring feature vector in the personalized template library; if so, using the candidate template information that matches the monitoring feature vector as the target template information; if not, forming new template information from the monitoring feature vector, storing the new template information in the personalized template library, and using the new template information as the target template information.

[0013] Therefore, it can be seen that the present invention enables dynamic updating of the personalized template library during the monitoring process, which is more adaptable to the individual differences in electrocardiograms of different patients.

[0014] A further approach involves sending the target data packet to the ECG signal reconstruction device based on the target template information, including: analyzing and monitoring whether the ECG signal is abnormal according to a set period; if so, the target data includes the monitored ECG signal and triggers a local abnormality alarm mechanism.

[0015] Therefore, this invention adjusts the transmission strategy for abnormal scenarios, eliminating the need to wait for the receiving end to unpack the data before making a judgment on the abnormal ECG. It can quickly trigger local audible and visual alarms, and transmits the original ECG monitoring signal during the abnormal period to the receiving end without compression, thus meeting the clinical needs for real-time ECG monitoring and early warning.

[0016] A further approach is to target the data packet as a template number data packet, a new template data packet, or an abnormal data packet.

[0017] Therefore, this invention implements a configurable transmission strategy. For normal ECG signals, a template number data packet is transmitted, which does not need to include the target feature vector; for ECG signals that differ significantly from previous transmissions, a new template data packet is transmitted, which needs to upload the target feature vector along with the signal; for abnormal data packets, the abnormal data packet is transmitted to achieve real-time alarm and transmit the original fragment data.

[0018] A further approach is to acquire the ECG signal at a set sampling rate; and to preprocess the ECG signal before processing it through the encoder neural network.

[0019] This demonstrates that the quality of the input signal can be improved to better extract features.

[0020] A further approach is to implement the encoder neural network and decoder neural network based on convolutional neural networks. The encoder neural network processes the monitored ECG signal by: progressively extracting local details, mesoscale morphology and global features of the monitored ECG signal based on three depthwise separable convolutional layers to obtain convolutional features. After the convolutional features are reduced in dimension by a global average pooling layer, the monitored feature vector is output through a fully connected layer.

[0021] Therefore, this invention captures multi-layer features of local details, mesoscale morphology and global correlation through 3-layer depthwise separable convolution, which has better expressive power and is suitable for efficient operation on resource-constrained microcontrollers.

[0022] To achieve the second objective mentioned above, this invention provides an electrocardiogram (ECG) signal compression and transmission device based on edge AI and a personalized template library, comprising: a main control module, an ECG acquisition module, a wireless transmission module, a storage module, and an alarm module. The main control module is connected to the ECG acquisition module, the wireless transmission module, the storage module, and the alarm module. The ECG acquisition module is used to acquire human ECG signals; the wireless transmission module is used to connect to an ECG signal reconstruction device; the storage module is used to store the personalized template library and the original ECG data under abnormal conditions; the alarm module is used to issue alarms for abnormal situations; and the main control module is used to implement the aforementioned ECG signal compression and transmission method based on edge AI and a personalized template library.

[0023] To achieve the third objective mentioned above, the present invention provides an electrocardiogram (ECG) signal compression and transmission system based on edge AI and a personalized template library, comprising: an ECG signal reconstruction device and the aforementioned ECG signal compression and transmission device based on edge AI and a personalized template library, wherein the ECG signal reconstruction device is connected to the ECG signal compression and transmission device based on edge AI and a personalized template library; the ECG signal reconstruction device is equipped with a cloud template library, which stores different user template libraries.

[0024] A further approach is to update the cloud template library and the personalized template library according to the set merging and / or elimination rules of the ECG signal reconstruction device.

[0025] Therefore, this invention avoids database redundancy by merging similar template information with outdated template information, improves matching accuracy, and provides adaptability far exceeding that of general databases. Attached Figure Description

[0026] Figure 1 This is a system framework diagram of an embodiment of the ECG signal compression and transmission system based on edge AI and personalized template library of the present invention.

[0027] Figure 2 This is a system framework diagram of the ECG signal compression and transmission device in an embodiment of the ECG signal compression and transmission system based on edge AI and personalized template library of the present invention.

[0028] Figure 3 This is a flowchart of the ECG signal compression and transmission device in the initialization phase of the first embodiment of the ECG signal compression and transmission method based on edge AI and personalized template library of the present invention.

[0029] Figure 4 This is a flowchart of the ECG signal compression and transmission device in the real-time monitoring stage in the first embodiment of the ECG signal compression and transmission method based on edge AI and personalized template library of the present invention.

[0030] Figure 5 This is a flowchart of the ECG signal reconstruction device in the real-time monitoring stage in the first embodiment of the ECG signal compression and transmission method based on edge AI and personalized template library of the present invention.

[0031] Figure 6 This is a flowchart of the ECG signal compression and transmission device in the real-time monitoring stage in the second embodiment of the ECG signal compression and transmission method based on edge AI and personalized template library of the present invention.

[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments. Detailed Implementation

[0033] This invention achieves ultra-high compression ratio data transmission by deploying a neural network on a wearable device to encode the features of electrocardiogram (ECG) signals and combining it with a dynamically updated personalized template library. This reduces the amount of data transmission and power consumption while ensuring high-fidelity reconstruction of ECG waveforms.

[0034] Example of an ECG signal compression and transmission system based on edge AI and personalized template library: See Figure 1 This embodiment includes an electrocardiogram (ECG) signal compression and transmission device 10 and an ECG signal reconstruction device 20. The ECG signal compression and transmission device 10 is connected to the ECG signal reconstruction device 20 to realize data transmission between the ECG signal compression and transmission device 10 and the ECG signal reconstruction device 20. There can be multiple ECG signal compression and transmission devices 10, so that multiple ECG signal compression and transmission devices 10 communicate with one ECG signal reconstruction device 20 respectively to realize data transmission.

[0035] The ECG signal compression and transmission device 10, acting as a signal transmitter, establishes and maintains a personalized template library describing ECG characteristics for the corresponding users. Through a deployed encoder neural network, it encodes the real-time acquired ECG signals into monitoring feature vectors and matches them against the personalized template library. If the monitoring feature vector successfully matches a candidate template in the personalized template library, that candidate template is used as the target template. When transmitting the target data packet to the ECG signal reconstruction device 20, the template number corresponding to the target template is transmitted as an indication, without needing to transmit the feature vector. If the monitoring feature vector does not successfully match any candidate template in the personalized template library, it means that the ECG signal has a new form. In this case, the target data packet transmitted to the ECG signal reconstruction device 20 needs to include the complete monitoring feature vector. Simultaneously, both the ECG signal compression and transmission device 10 and the ECG signal reconstruction device 20 set up new template information to describe the monitoring feature vector.

[0036] The personalized template library includes information on multiple candidate templates. Each candidate template includes a candidate feature vector, a unique template ID, and the time of its creation. The candidate template information can be generated from the initial ECG signal during the initialization phase, or from the monitored ECG signal during the real-time monitoring phase.

[0037] The ECG signal reconstruction device 20 acts as a signal receiver. Based on the target data packet sent by the ECG signal compression and transmission device 10, it determines the ECG waveform of the user corresponding to the ECG signal compression and transmission device 10 and displays the ECG waveform.

[0038] The ECG signal reconstruction device 20 is equipped with a cloud-based template library, which stores different user template libraries. Each user template library stores multiple user template information, and each user template information includes a corresponding user ECG feature vector. Each user template library corresponds to a personalized template library stored in an ECG signal compression and transmission device 10. Therefore, based on the target template information of the ECG signal compression and transmission device 10, the ECG signal reconstruction device 20 can determine the target user template information in the corresponding target user template library, and then, based on the deployed decoder neural network, reconstruct the corresponding ECG waveform from the target user ECG feature vector of the target template information.

[0039] In other embodiments, the candidate template information of the ECG signal compression and transmission device 10 may include a vector template and corresponding index information. The vector template includes a candidate feature vector, a unique template number, a formation time, and the original waveform segment corresponding to the feature vector. The index information includes the unique template number, the formation time, and the waveform period. Alternatively, in some embodiments, the vector template may include the candidate feature vector, the unique template number, and the formation time, but not the original waveform segment corresponding to the feature vector, and the index information may not include the waveform period. Since the user template information and the candidate template information point to the same content, in these different embodiments, the user template information of the ECG signal reconstruction device 20 adopts the same form as the candidate template information of the ECG signal compression and transmission device 10.

[0040] In this embodiment, the ECG signal compression and transmission device 10 is preferably a wearable device. See also Figure 2 The electrocardiogram (ECG) signal compression and transmission device 10 specifically includes a main control module 101, an ECG acquisition module 102, a wireless transmission module 103, a storage module 104, and an audible and visual alarm module 105. The main control module 101 is connected to the ECG acquisition module 102, the wireless transmission module 103, the storage module 104, and the audible and visual alarm module. Furthermore, the ECG signal compression and transmission device 10 is also equipped with a power supply module to provide power to the connected main control module 101, ECG acquisition module 102, wireless transmission module 103, storage module 104, and audible and visual alarm module 105.

[0041] The ECG acquisition module 102 is used to acquire human ECG signals. The wireless transmission module 103 is used to connect to the ECG signal reconstruction device 20. The storage module 104 is used to store a personalized template library and raw ECG data under abnormal conditions. The alarm module 105 is used to trigger alarms for abnormal situations.

[0042] The main control module 101 forms a target data packet based on the human electrocardiogram (ECG) signal collected by the ECG acquisition module 102, and sends the target data packet to the ECG signal reconstruction device 20 through the wireless transmission module 103. Thus, the ECG signal reconstruction device 20 can reconstruct the ECG signal based on the target data packet.

[0043] The target data packet can be a template number data packet, a new template data packet, or an abnormal data packet, and will be sent according to the different situations.

[0044] In the first scenario, if the monitoring feature vector corresponding to the collected ECG signal has matching candidate template information in its own personalized template library, then the target data packet is a template number data packet. The template number data packet does not need to include the feature vector corresponding to the collected human ECG signal; instead, it includes fields such as a unique template number, timestamp, and patient ID.

[0045] In the second scenario, if the monitoring feature vector corresponding to the collected ECG signal does not have a matching candidate template in its own personalized template library, it is necessary to form a new template information from the feature vector corresponding to the collected human ECG signal and store it in the personalized template library. In this case, the target data packet is the new template data packet. The new template data packet includes fields such as monitoring feature vector, unique number, timestamp, and patient ID.

[0046] In the third scenario, when the collected ECG signal is analyzed within a set period and an anomaly is identified—for example, when the analysis reveals poor consistency in the waveform (a correlation coefficient of less than 0.85 for consecutive cardiac cycles is marked as poor consistency) or when arrhythmias occur—it is necessary to switch to transmitting the complete waveform without compression and increase the upload frequency (e.g., once every 10 seconds). In this case, the target data packet is an abnormal data packet. The abnormal data packet includes fields such as an anomaly identifier, monitored ECG signal, monitoring feature vector (optional), unique number, timestamp, and patient ID.

[0047] The template unique number is used to uniquely identify the candidate template information. The timestamp is used to provide a time reference, such as the formation time of the candidate template information and the acquisition time of the monitored ECG signal. The patient ID is used to uniquely identify the user of the ECG signal compression and transmission device 10. The anomaly identifier is used to identify that the data packet is a data packet under abnormal circumstances. In addition, the template number data packet, the new template data packet, and the abnormal data packet may also include the contents of other fields, such as the heart rate value field and the CRC check code field. The heart rate value field is used to adjust the time scale when reconstructing the waveform.

[0048] In this embodiment, the template number data packet is approximately 100 to 300 bytes (taking 1 minute as an example, it includes a timestamp, patient ID, template number sequence, real-time heart rate sequence (or RR interval sequence), and checksum). The abnormal data packet contains approximately 1KB of monitored ECG signal.

[0049] The hardware and connection relationships of the ECG signal compression and transmission device 10 are further described below.

[0050] The main control module 101 in this embodiment includes a main control chip, preferably an STM32N647 microcontroller, which integrates a neural network processing unit (NPU) with a maximum clock frequency of 800MHz and 2.4MB of on-chip SRAM. The encoder neural network can be stored in this on-chip SRAM. The main control module implements ECG signal preprocessing, feature extraction, template matching, data packaging, and wireless transmission control. Feature extraction is achieved by running the encoder neural network through the NPU, which can reduce the feature extraction time to less than 10ms, thereby reducing the main CPU load by more than 60%.

[0051] The ECG acquisition module 102 in this embodiment includes ECG electrodes and an analog front-end (AFE). The ECG electrodes are used for stable contact with human skin to acquire single-lead ECG signals from chest or limb leads. The ECG electrodes are preferably disposable Ag / AgCl electrodes with a signal acquisition area of ​​10mm × 15mm and a contact impedance of less than 5kΩ; their disposable design avoids cross-infection. The analog front-end achieves high-precision ECG signal acquisition, suppresses power frequency interference (50 / 60Hz) and electromyographic noise, and amplifies and converts weak ECG signals (μV level) into digital signals. The preferred model for the analog front-end is the ADS1292 chip, which has 24-bit resolution, a configurable sampling rate (200-500Hz), an input impedance greater than 100MΩ, and a common-mode rejection ratio (CMRR) greater than 110dB.

[0052] The wireless transmission module 103 in this embodiment is used to realize short-range data transmission between the transmitting end and the receiving end, supports the interrupted transmission protocol, and has a transmission success rate of more than 98% in signal obstruction scenarios. The preferred model of the wireless transmission module 103 is the nRF24L01+ chip, which operates in the 2.4GHz frequency band, has a transmission rate of 1 to 2Mbps, a receiving current of 12mA, and a transmitting current of 11mA.

[0053] In this embodiment, the storage module 104 is used for temporary storage of the acquired raw electrocardiogram data (under abnormal scenarios) and a personalized template library. The storage module 104 preferably uses an external 4GB eMMC flash memory with a read / write speed greater than 100MB / s and an erase / write lifespan greater than 100,000 cycles.

[0054] In this embodiment, the power module supplies power to the entire ECG signal transmission and compression device. The power module preferably uses a lithium polymer battery (3.7V / 1000mAh) and an AXP192 power management chip. It supports 5V / 1A charging, has a static power consumption of less than 10μA, and features overcharge, over-discharge, and overcurrent protection. The AXP192 chip can dynamically adjust the power supply voltage of each module, reducing the device's power consumption to below 50μA in standby mode, thus extending battery life.

[0055] Therefore, the hardware system is built around the core requirements of low power consumption, high integration, and strong computing power. The ADS1292 chip of the ECG analog front-end communicates with the STM32N647 microcontroller of the main control module through the SPI interface to transmit the acquired digital ECG signals to the STM32N647 microcontroller; the nRF24L01+ chip of the wireless module connects to the main controller through the SPI interface to realize data upload; the power supply module provides stable voltage to each module through a low dropout linear regulator (LDO); and the external eMMC flash memory is connected to the STM32N647 microcontroller through the SDIO interface for expanding storage.

[0056] In this embodiment, the encoder and decoder neural networks are pre-trained lightweight 1D CNN encoders and decoders, which can be implemented based on existing convolutional neural networks (CNNs). They employ an autoencoder architecture and are trained using existing deep learning methods. Through training with a large amount of ECG data, the encoder and decoder neural networks continuously adjust their parameters to minimize the difference between the ECG signal input to the encoder neural network and the ECG signal output by the decoder neural network. The encoder neural network compresses the ECG signal into a low-dimensional feature vector (128 dimensions), and the decoder neural network restores the ECG signal from the low-dimensional feature vector.

[0057] Furthermore, to ensure the stability of feature extraction, the encoder neural network first standardizes the input ECG signal, extracts a certain duration of cardiac cycle segment centered on the R wave, and uniformly resamples it to 250Hz to form an input vector with 75 sampling points. Then, Z-score normalization is used to eliminate individual amplitude differences, and low-pass filtering is used to suppress noise, providing highly consistent input for subsequent feature extraction.

[0058] In the convolutional layers of the encoder neural network, three depthwise separable convolutional layers are used to progressively extract local details, mesoscale morphology, and global features of the ECG signal, resulting in convolutional features. Specifically, for local detail feature extraction, the first layer uses a 3×1 convolutional kernel to capture subtle changes such as the rising edge of the P wave and the beginning of the QRS complex, and enhances the nonlinear expression through the ReLU activation function; for mesoscale morphological feature extraction, the second layer uses a 5×1 convolutional kernel to cover a longer time window and extract features such as the width of the QRS complex and the complete contour of the P wave; for global feature extraction, the third layer uses a large 7×1 convolutional kernel to capture long-range dependencies such as T wave polarity and the PR interval.

[0059] After the convolutional features are reduced in dimensionality by the global average pooling layer, the 64-dimensional features are mapped to a 128-dimensional vector through the output of the fully connected layer. The final output is a feature encoding that covers the complete morphological information of the P-QRS-T waveform, which is the corresponding feature vector.

[0060] To adapt to resource-constrained embedded environments, this embodiment reduces the computational cost to 1 / 8 of that of standard convolution by employing depthwise separable convolution, keeping the number of parameters below 500,000, and supporting INT8 quantization and channel pruning. With NPU acceleration, the time for a single feature extraction is ≤10ms. In addition, the Dropout layer (rate=0.1) is used to improve the model's generalization ability and avoid overfitting.

[0061] The structure of the decoder neural network is similar to that of the encoder neural network, but the specific operations are reversed. Specifically, the decoder neural network uses three depthwise separable transposed convolutional layers, and the output of the decoder neural network needs to be aligned with the normalized input of the encoder neural network.

[0062] First embodiment of an ECG signal compression and transmission method based on edge AI and personalized template library: This embodiment is based on the ECG signal compression and transmission system of the aforementioned edge AI and personalized template library.

[0063] This embodiment includes an initialization phase and a real-time monitoring phase. The initialization phase is executed when the ECG signal compression and transmission device is powered on or when the user uses it for the first time. Its purpose is to establish a user-specific personalized template library within the ECG signal compression and transmission device, and to upload this personalized template library to the cloud model library of the ECG signal reconstruction device as part of the cloud template library. The real-time monitoring phase enables the ECG signal compression and transmission device to acquire ECG signals in real time, and sequentially perform preprocessing, feature extraction, template matching, and data transmission. The target data packet is then sent to the ECG signal reconstruction device, which receives and parses the data, reconstructs and displays the waveform, and updates the cloud template library and the corresponding personalized template library according to set merging and / or elimination rules.

[0064] See Figure 3 The steps performed by the ECG signal compression and transmission device during the initialization phase include: S11: Acquire the initial electrocardiogram signal.

[0065] S12: Determine a preset number of cardiac cycle waveforms based on the initial electrocardiogram signal.

[0066] S13: Process the cardiac cycle waveform through the encoder neural network to obtain the corresponding initial feature vector.

[0067] S14: Store the initial template information formed by the initial feature vector in the personalized template library.

[0068] S15: Upload the personalized template library to the ECG signal reconstruction device.

[0069] In step S11 above, after the user wears the ECG signal compression and transmission device, the device automatically powers on. The STM32N647 microcontroller initializes the ADS1292 chip, the wireless transmission module (configuring the transmission channel and baud rate), and the STM32N647 microcontroller's NPU (loading the encoder neural network). Simultaneously, it initializes the local storage partitions, dividing them into a raw data buffer area, a template library storage area, and a log storage area. The raw data buffer area is used to cache the raw signals acquired by the ADS1292 chip, the template library storage area is used to store personalized template libraries, and the log storage area is used to store runtime-related information, such as upload time and template matching results. Thus, the ADS1292 chip can acquire the user's human ECG signal through the ECG electrodes, i.e., acquire the initial ECG signal.

[0070] In step S12 above, the ADS1292 chip is controlled to continuously acquire ECG signals for 1 to 2 minutes. The STM32N647 microcontroller performs 50Hz power frequency filtering, electromyography noise removal and baseline correction on the initial ECG signals acquired by the ADS1292 chip. The processed signal is divided into individual cardiac cycles (located by R-wave detection algorithm, each cycle is about 0.8 to 1.2 seconds), and a preset number (30 in this implementation) of cardiac cycle waveforms with complete shape and no noise interference are selected.

[0071] In step S13 above, the NPU is invoked to run the encoder neural network, converting each cardiac cycle waveform into a corresponding initial feature vector. Each initial feature vector is a 128-dimensional feature vector, thus obtaining 128-dimensional feature vectors corresponding to the 30 cardiac cycle waveforms.

[0072] In step S14 above, a unique template number is assigned to each initial feature vector, and initial template information is formed by the formation time and the initial feature vector. The initial template information is stored in the local template library as candidate template information. That is, the candidate feature vector of a candidate template information is the initial feature vector, the unique template number of the candidate template information is the unique template number of the initial feature vector, and the formation time of the candidate template information is the formation time of the initial feature vector.

[0073] In other embodiments, the candidate template information may include vector templates and corresponding index information. The sequence "template unique number - initial feature vector - corresponding original waveform segment" is associated and stored in the local template library as a vector template, and corresponding index information is generated simultaneously. The template library index table includes index information corresponding to each vector template, a unique template number and formation time shared by each index information and its corresponding vector template, and the corresponding waveform period (e.g., which waveform period the initial feature vector corresponds to). By setting the template library index table, the ECG signal reconstruction device can more quickly determine the corresponding vector template, thereby more quickly determining the corresponding feature vector.

[0074] In step S15 above, the STM32N647 microcontroller uploads the personalized template library to the ECG signal reconstruction device 20 via a wireless transmission module. The upload process can use CRC32 verification to ensure integrity. After receiving the data, the ECG signal reconstruction device 20 parses it, establishes the user template library corresponding to the patient ID in the cloud template library, and returns a "upload successful" confirmation command to the terminal.

[0075] See Figure 4 The steps performed by the ECG signal compression and transmission device during the real-time monitoring phase include: S21: Acquire and monitor ECG signals.

[0076] S22: Preprocess the monitored electrocardiogram signal.

[0077] S23: The monitoring feature vector is obtained by processing the preprocessed monitoring ECG signal through the encoder neural network.

[0078] S24: Determine whether there is candidate template information in the personalized template library that matches the monitored feature vector.

[0079] If the judgment result is yes, continue to execute step S25; if the judgment result is no, jump to step S27.

[0080] S25: Use the candidate template information that matches the monitoring feature vector as the target template information.

[0081] S26: Send the template number data packet to the external ECG signal reconstruction device according to the target template information.

[0082] S27: Store the new template information formed by the monitored feature vector in the personalized template library and use it as the target template information.

[0083] S28: Send a new template data packet to an external ECG signal reconstruction device based on the target template information.

[0084] In step S21 above, the ADS1292 chip is controlled to continuously acquire human electrocardiogram (ECG) signals at a sampling rate of 250Hz, and the output of the ADS1292 chip is the ECG monitoring signal.

[0085] In step S22 above, the STM32N647 microcontroller performs preprocessing (filtering, noise reduction, baseline correction) on the acquired ECG signal every second, and calculates the real-time heart rate using the R-wave detection algorithm.

[0086] In step S23 above, a complete monitoring ECG signal is extracted for each or several cardiac cycles, and the NPU is called to execute the encoder neural network to extract the feature vector of the signal segment, resulting in a corresponding 128-dimensional feature vector, which is the monitoring feature vector.

[0087] In step S24 above, the existence of candidate template information matching the monitored feature vector is determined by calculating cosine similarity. Specifically, the cosine similarity between the monitored feature vector and the candidate feature vectors of all candidate feature information in the personalized template library is calculated (calculation formula: cosθ = (A...). B) / (|A|×|B|), where A is the real-time feature vector and B is the candidate feature vector. If there is a candidate template vector with a cosine similarity greater than or equal to 95%, then it is determined that there is candidate template information that matches the monitored feature vector.

[0088] In step S25 above, after determining the candidate template vector with a cosine similarity greater than or equal to 95% with the monitored feature vector, the candidate template information corresponding to the candidate feature vector is used as the target template information.

[0089] In step S26 above, the corresponding unique template number of the target template information is extracted, and multiple unique template numbers are concatenated in sequence to form a template number sequence. The field content corresponding to "timestamp + patient ID + template number sequence + real-time heart rate sequence (or RR interval sequence) + check bit" is packaged into a data packet of 100 to 300 bytes (taking a 1-minute data packet as an example) and uploaded to the ECG signal reconstruction device.

[0090] In step S27 above, after determining that there is no candidate template vector with a cosine similarity greater than or equal to 95% with the monitored feature vector, the monitored feature vector is used to form new template information, which is stored as candidate template information in the personalized template library. The specific process of storing initial template information as candidate template information in the personalized template library will not be elaborated here.

[0091] In step S28 above, the unique template number assigned to the new template information is extracted. A new template data package is formed based on the unique template number, the corresponding feature vector, formation time, patient ID, real-time heart rate, and checksum, and is then uploaded to the ECG signal reconstruction device. The ECG signal reconstruction device can update the user template library based on the new template data package.

[0092] See Figure 5 The steps performed by the ECG signal reconstruction device during the real-time monitoring phase include: S31: Determine the target ECG feature vector based on the target data packet.

[0093] S32: Reconstruct the complete waveform based on the decoder neural network and the target ECG feature vector.

[0094] S33: Displays the complete waveform.

[0095] S34: Update the cloud template library.

[0096] In step S31 above, the received target data packet is first checked using CRC32. After the check passes, the data packet content is parsed to distinguish between template number data and new template data packets, and the parsing result is stored in a database exclusive to each patient (associated with patient ID and timestamp).

[0097] When the target data packet is a template number data packet, the corresponding target user template library in the cloud template library is determined based on the patient ID of the template number data packet. Then, the target user template information in the target user template library is determined based on the unique template number of the template number data packet, thereby determining the target user ECG feature vector corresponding to the target user template.

[0098] When the target data packet is a new template data packet, the corresponding target user template library in the cloud template library is determined based on the patient ID of the new template data packet. Then, the target user template library is updated based on the new template data packet, and new user template information is added to the target user template library. The feature vector of the new template data packet is used as the target ECG feature vector.

[0099] In step S32 above, the decoder neural network (trained in conjunction with the terminal encoder, using a deconvolution structure) is invoked to parse the received target data packet and extract the template number sequence and RR interval sequence. Based on each number in the template number sequence, the corresponding standardized single-cardiac cycle waveform segment is retrieved from the cloud template library corresponding to that patient. Strictly following the order of the template number sequence and according to the adjacent heartbeat time intervals indicated by the real-time heart rate sequence (or RR interval sequence), these waveform segments are sequentially connected on the time axis to form a preliminary continuous waveform. Smoothing filtering is performed at the connection points of the waveform segments to reconstruct a complete target ECG signal that matches the monitored ECG signal at the transmitting end in both morphology and rhythm.

[0100] In step S33 above, the target ECG signal obtained in step S32 is displayed on a visual LCD screen, thereby intuitively displaying the reconstructed complete waveform.

[0101] Step S34 above includes updating the cloud template library according to the set merging and elimination rules. Specifically, the merging rule is set to merge user template information corresponding to user ECG feature vectors with a cosine similarity ≥ 98% into one, retaining the user template information with the most recent generation time and the highest usage frequency, and deleting the remaining user template information. The elimination rule is set to statistically analyze the usage frequency of user template information over a set period (e.g., 7 days). If the number of uses is < 3 times and the generation time is more than 3 days, the user template information is automatically deleted from the user template library, releasing storage resources. After triggering the update of the cloud template library, the merged / deleted / added user template information is synchronized to the corresponding ECG signal compression and transmission device according to the specific updated user template library, so that the personalized template library of the ECG signal compression and transmission device is consistent with the corresponding user template library in the cloud template library.

[0102] It should be noted that the above-mentioned S34 can be performed automatically according to a set update cycle to optimize the cloud template library, and is not limited to... Figure 5 The execution order in the process.

[0103] Second embodiment of the ECG signal compression and transmission method based on edge AI and personalized template library: The difference between this embodiment and the first embodiment described above is that this embodiment also analyzes and monitors whether the electrocardiogram signal is abnormal according to a set period. If it is abnormal, the data packet sent is an abnormal data packet, and a local abnormal alarm mechanism is triggered.

[0104] See details Figure 6The difference for the ECG signal reconstruction device lies in step S46 after step S45 and step S49 after step S48, which are both steps to determine whether there is an abnormal situation, and step S51 when an abnormal situation is determined to exist, which sends an abnormal data packet to the external ECG signal reconstruction device and triggers the local abnormal alarm mechanism.

[0105] Specifically, in steps S46 and S49, the STM32N647 microcontroller calls a publicly available ECG feature library (such as the feature model in the MIT-BIH arrhythmia database) to perform a preliminary analysis of the monitored ECG signal every minute, detecting the presence of abnormal features such as atrial fibrillation (AF), premature ventricular contractions (PVC), bradycardia / tachycardia. If an abnormality is detected, step S51 is executed, triggering the audible and visual alarm module to sound an alarm (e.g., through a buzzer and LED connected to the STM32N647 microcontroller), and sending an abnormal data packet to the ECG signal reconstruction device. The abnormal data includes an abnormal marker, the original signal segment corresponding to the time period (approximately 1KB), the template number / new feature vector, and the heart rate field content, and the upload frequency is increased to once every 10 seconds until the abnormality is resolved.

[0106] For ECG signal reconstruction devices, when the received target data packet is an abnormal data packet, the original signal segment of the abnormal time period is reconstructed first, and the abnormal area is marked with a red box on the display interface, and an alarm prompt is popped up. At the same time, the patient's historical abnormal records are automatically associated.

[0107] In summary, the ECG signal compression and transmission device of this invention achieves an ultra-high compression ratio, with a data compression ratio ≥150:1 under normal conditions; the device's battery life can reach several weeks (20 to 30 days); based on the target data packet of this invention, the ECG signal reconstruction device 20 can reconstruct the P-QRS-T waveform with a correlation coefficient ≥0.98; this invention achieves high clinical diagnostic value, with the reconstructed waveform being comparable to the original data, supporting the diagnosis of diseases such as arrhythmia and myocardial ischemia; this invention achieves personalized adaptation, establishing a dedicated template library for each patient with a matching accuracy rate ≥95%; this invention achieves high anomaly response speed, issuing an alarm within 1 second after anomaly detection and increasing the upload frequency to 10 seconds / time.

[0108] It is evident that this invention has high clinical value, including: (1) improving the coverage of remote ECG monitoring: the low power consumption and long battery life characteristics enable the device to support continuous monitoring for 1-4 weeks without frequent charging, making it suitable for long-term home monitoring of elderly people and patients with chronic diseases (such as coronary heart disease and atrial fibrillation) in the community, making up for the shortcomings of the traditional Holter scheme, which has short monitoring time and requires carrying a recorder. (2) ensuring diagnostic accuracy: by reconstructing the P-QRS-T waveform, doctors can obtain diagnostic information that is almost equivalent to the original data, supporting accurate judgment of diseases such as arrhythmia classification (such as supraventricular tachycardia, premature ventricular bigeminy), myocardial ischemia (ST segment abnormality), avoiding misdiagnosis and missed diagnosis caused by the loss of waveform details in traditional feature transmission technology. (3) realizing real-time risk warning: the terminal's real-time pre-alarm function can trigger an alarm within 1 second when an arrhythmia occurs, and the host computer synchronously receives abnormal data, allowing doctors to contact patients in a timely manner for intervention, reducing the risk of acute cardiovascular events such as myocardial infarction and sudden death.

[0109] It is evident that this invention possesses high technological innovation value, including (1) promoting the application of edge AI in medical devices: deploying lightweight neural networks (encoders / decoders) on the terminal NPU to achieve localized processing of data acquisition, feature extraction, and template matching, reducing reliance on cloud computing power, and providing a technological paradigm for the intelligentization and miniaturization of wearable medical devices. (2) constructing a medical data transmission architecture that coordinates the local transmitter and the cloud receiver. The local transmitter is responsible for data compression and preliminary analysis, while the cloud receiver is responsible for waveform reconstruction and template optimization, achieving a reasonable allocation of computing load, reducing terminal power consumption, and improving cloud data processing efficiency, providing a reference for the design of medical Internet of Things (IoT) systems.

[0110] It is evident that this invention has high economic and social value, including: (1) reducing medical costs: the terminal equipment has low hardware costs and reduced cloud storage requirements, which can significantly reduce the investment of medical institutions in the procurement of ECG monitoring equipment and the deployment of data storage servers; at the same time, the practical long-term home monitoring of this invention can reduce the number of times patients travel to and from the hospital, and reduce indirect costs such as transportation and registration. (2) facilitating the implementation of hierarchical diagnosis and treatment: community health service centers can realize a remote collaboration mode of grassroots collection and higher-level diagnosis through this invention. Doctors in higher-level hospitals can access the real-time ECG data of community patients through the cloud, and complete the diagnosis without the need for patient referral, thereby improving the efficiency of medical resource utilization and alleviating the pressure on large hospitals.

[0111] Finally, it should be emphasized that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for compressing and transmitting electrocardiogram (ECG) signals based on edge AI and a personalized template library, characterized in that, Includes the following steps: Acquire and monitor electrocardiogram signals; The monitored electrocardiogram signal is processed by an encoder neural network to obtain a monitoring feature vector; The target template information that matches the monitoring feature vector is determined based on the locally stored personalized template library; According to the target template information, a target data packet is sent to an external ECG signal reconstruction device. The ECG signal reconstruction device is used to reconstruct a target ECG signal that matches the monitored ECG signal based on the decoder neural network and the target data packet.

2. The ECG signal compression and transmission method based on edge AI and personalized template library as described in claim 1, characterized in that, Also includes: Acquire initial electrocardiogram (ECG) signals; A preset number of cardiac cycle waveforms are determined based on the initial electrocardiogram signal; The cardiac cycle waveform is processed by the encoder neural network to obtain the corresponding initial feature vector; The initial feature vector is used to form initial template information, which is stored in the personalized template library, and the personalized template library is uploaded to the electrocardiogram signal reconstruction device.

3. The ECG signal compression and transmission method based on edge AI and personalized template library as described in claim 1, characterized in that: Determining target template information that matches the monitored feature vector based on a locally stored personalized template library includes the following steps: Determine whether there is candidate template information in the personalized template library that matches the monitoring feature vector. If yes, use the candidate template information that matches the monitoring feature vector as the target template information. If no, form new template information from the monitoring feature vector, store the new template information in the personalized template library, and use the new template information as the target template information.

4. The ECG signal compression and transmission method based on edge AI and personalized template library as described in claim 1, characterized in that: Before sending the target data packet to the ECG signal reconstruction device according to the target template information, the process includes: The monitoring ECG signal is analyzed according to a set period to determine if it is abnormal. If so, the target data includes the monitoring ECG signal, and a local abnormality alarm mechanism is triggered.

5. The ECG signal compression and transmission method based on edge AI and personalized template library as described in claim 1, characterized in that: The target data packet is a template number data packet, a new template data packet, or an abnormal data packet.

6. The ECG signal compression and transmission method based on edge AI and personalized template library as described in claim 1, characterized in that: When acquiring the monitored electrocardiogram (ECG) signal, the monitored ECG signal is collected according to a set sampling rate; Before processing the monitored ECG signal through the encoder neural network, the monitored ECG signal is preprocessed.

7. The ECG signal compression and transmission method based on edge AI and personalized template library as described in any one of claims 1 to 6, characterized in that: The encoder neural network and the decoder neural network are implemented based on convolutional neural networks; The encoder neural network processes the monitored electrocardiogram signal including: Based on three depthwise separable convolutional layers, local details, mesoscale morphology and global features of the monitored electrocardiogram signal are extracted stepwise to obtain convolutional features. After dimensionality reduction by a global average pooling layer, the convolutional features are output as the monitoring feature vector through a fully connected layer.

8. A device for compressing and transmitting electrocardiogram signals based on edge AI and a personalized template library, characterized in that, include: The system includes a main control module, an ECG acquisition module, a wireless transmission module, a storage module, and an alarm module, with the main control module connected to the ECG acquisition module, the wireless transmission module, the storage module, and the alarm module, respectively. The electrocardiogram (ECG) acquisition module is used to acquire human ECG signals; The wireless transmission module is used to connect to the electrocardiogram signal reconstruction device; The storage module is used to store the personalized template library and the original electrocardiogram data under abnormal conditions; The alarm module is used to alert for abnormal situations; The main control module is used to implement the ECG signal compression and transmission method based on edge AI and personalized template library as described in any one of claims 1 to 7.

9. A ECG signal compression and transmission system based on edge AI and a personalized template library, characterized in that, include: The electrocardiogram (ECG) signal reconstruction device and the ECG signal compression and transmission device based on edge AI and personalized template library as described in claim 8, wherein the ECG signal reconstruction device is connected to the ECG signal compression and transmission device based on edge AI and personalized template library; The electrocardiogram signal reconstruction device is equipped with a cloud template library, which stores different user template libraries.

10. The ECG signal compression and transmission system based on edge AI and a personalized template library as described in claim 9, characterized in that: The ECG signal reconstruction device updates the cloud template library and the personalized template library according to the set merging and / or elimination rules.