CN113812959B - Electrocardiogram data processing method for small-sized data processing device, electronic device, and storage medium - Google Patents

Electrocardiogram data processing method for small-sized data processing device, electronic device, and storage medium Download PDF

Info

Publication number
CN113812959B
CN113812959B CN202110846860.7A CN202110846860A CN113812959B CN 113812959 B CN113812959 B CN 113812959B CN 202110846860 A CN202110846860 A CN 202110846860A CN 113812959 B CN113812959 B CN 113812959B
Authority
CN
China
Prior art keywords
data
electrocardiographic
processing
packet
compressed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110846860.7A
Other languages
Chinese (zh)
Other versions
CN113812959A (en
Inventor
马宏途
侯桂文
张宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Haisimin Medical Technology Co ltd
Original Assignee
Beijing Haisimin Medical Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Haisimin Medical Technology Co ltd filed Critical Beijing Haisimin Medical Technology Co ltd
Priority to CN202110846860.7A priority Critical patent/CN113812959B/en
Publication of CN113812959A publication Critical patent/CN113812959A/en
Application granted granted Critical
Publication of CN113812959B publication Critical patent/CN113812959B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B2560/00Constructional details of operational features of apparatus; Accessories for medical measuring apparatus
    • A61B2560/02Operational features
    • A61B2560/0266Operational features for monitoring or limiting apparatus function
    • A61B2560/0276Determining malfunction

Abstract

The embodiment of the invention provides an electrocardio data processing method for small-sized data processing equipment, electronic equipment and a storage medium. The electrocardio data processing method comprises the following steps: continuously receiving and caching electrocardio data from electrocardio acquisition equipment, detecting electrocardio acquisition abnormal events, and inserting an abnormal event mark corresponding to the electrocardio acquisition abnormal events into a position corresponding to the receiving time of the electrocardio acquisition abnormal events in the cached electrocardio data; performing compression processing including bit operation on the cached electrocardiograph data with a certain time length to obtain whole-packet compression data with a preset length; adding a data packet number at a starting position or an ending position of the whole packet of compressed data; and storing the whole packet of compressed data added with the data packet number in a storage device of the small data processing equipment, wherein the length of the whole packet of compressed data added with the data packet number is a preset integer multiple of a storage unit of the storage device.

Description

Electrocardiogram data processing method for small-sized data processing device, electronic device, and storage medium
Technical Field
The embodiment of the invention relates to an electrocardiograph data processing technology, in particular to an electrocardiograph data processing method and device for small-sized data processing equipment, electronic equipment and a storage medium.
Background
In recent years, people perform information processing, communication, social and dedicated functions by means of portable devices having various functions, such as smart watches for performing monitoring of pulse, body temperature, blood pressure, sports, sleep, etc. In the field of electrocardiographic monitoring, a technology for acquiring and processing electrocardiographic data by using small-sized equipment is also gradually introduced.
However, the small-sized device is limited by its limited power supply, computing resources and storage resources, and has problems of low processing efficiency and low storage capacity in the long-time electrocardiographic data processing.
Disclosure of Invention
The embodiment of the invention provides an electrocardio data processing scheme for small-sized data processing equipment, which is beneficial to the small-sized data processing equipment to effectively compress and store electrocardio data.
According to a first aspect of the present invention, there is provided an electrocardiographic data processing method for a small-sized data processing device, comprising: continuously receiving and caching electrocardio data from electrocardio acquisition equipment, and detecting electrocardio acquisition abnormal events; if the electrocardio acquisition abnormal event is detected, inserting an abnormal event mark corresponding to the electrocardio acquisition abnormal event into a position corresponding to the receiving time of the electrocardio acquisition abnormal event in the cached electrocardio data, wherein the length of the abnormal event mark is the same as that of single electrocardio data; performing compression processing including bit operation on the cached electrocardiograph data with a certain time length to obtain whole-packet compression data with a preset length; adding a data packet number at the starting position or the ending position of the whole packet of compressed data, wherein the data packet number is continuous with the data packet number of the whole packet of compressed data obtained by the last compression; and storing the whole packet of compressed data added with the data packet number in a storage device of the small data processing equipment, wherein the length of the whole packet of compressed data added with the data packet number is a preset integer multiple of a storage unit of the storage device.
Optionally, the electrocardiographic data is single-lead electrocardiographic data, the lengths of each single-lead electrocardiographic data and the abnormal event mark are double bytes and each comprise non-valid data bits, and the non-valid data bits of the abnormal event mark correspond to the non-valid data bits of the single-lead electrocardiographic data. The method for obtaining the whole packet of compressed data with a preset length comprises the following steps: taking the initial position of the cached single-lead electrocardiograph data with a certain time length as a first current position, and iteratively performing the following processing until the whole packet of compressed data with a preset length is obtained: acquiring a first preset number of single-lead electrocardiograph data from a first current position; respectively carrying out bit translation on the first preset number of single-lead electrocardiograph data to obtain data of effective digits in the single-lead electrocardiograph data; byte-combining the data of the effective digits in each single-lead electrocardiograph data according to a preset first combination rule to obtain compressed data of a first preset byte number; splicing the compressed data of the first predetermined number of bytes to existing compressed data; if the length of the existing compressed data obtained by splicing is smaller than the preset length, the first current position is advanced by the first preset number of lengths to serve as a new first current position, and next iteration processing is conducted; and taking the existing compressed data obtained through iterative processing as the whole-packet compressed data.
Optionally, the non-valid data bits are 4 consecutive high bits in the single-lead electrocardiographic data, the first predetermined number is 2, and the first predetermined number of bytes is 3.
Optionally, the electrocardiographic data is multi-lead electrocardiographic data, and each of the multi-lead electrocardiographic data and the abnormal event marker is 3 bytes in length.
Optionally, the compressing the cached electrocardiograph data with a certain duration including bit operation to obtain whole-packet compressed data with a predetermined length includes: taking the initial position of the cached multi-lead electrocardiograph data with a certain time length as a second current position, and iteratively performing the following processing until the whole packet of compressed data with a preset length is obtained: acquiring 2 multi-lead electrocardiographic data from a second current position; respectively acquiring continuous 20 data in the middle of each acquired multi-lead electrocardiograph data; byte-combining 2 continuous 20-bit data according to a preset second combination rule to obtain 5-byte compressed data; splicing the compressed data to existing compressed data; if the length of the spliced existing compressed data is smaller than the preset length, the second current position is advanced by 2 lengths of the multi-lead electrocardiograph data as a new second current position so as to carry out next iteration processing; and taking the existing compressed data obtained through iterative processing as the whole-packet compressed data.
Optionally, the compressing the cached electrocardiograph data with a certain duration including bit operation to obtain whole-packet compressed data with a predetermined length includes: taking the first multi-lead electrocardio data of the cached multi-lead electrocardio data with a certain time length as the current multi-lead electrocardio data, and iteratively performing the following processing until the whole packet of compressed data with a preset length is obtained: taking continuous 20-bit data positioned in the middle of the current multi-lead electrocardiograph data as current middle data; if the current multi-lead electrocardiograph data is the first multi-lead electrocardiograph data, the current intermediate data is used as current difference data; if the current multi-lead electrocardiograph data is not the first multi-lead electrocardiograph data, performing difference calculation on the current intermediate data and the intermediate data of the previous multi-lead data to obtain current difference data; taking continuous 16-bit data positioned in the middle of the current difference value data as compressed data of current multi-lead electrocardiograph data; splicing the compressed data to accumulated compressed data; if the length of the accumulated compressed data obtained by splicing is smaller than the preset length, acquiring next multi-lead electrocardio data so as to carry out next iteration processing; and taking the accumulated compressed data obtained through iterative processing as the whole-packet compressed data.
Optionally, the continuously receiving and buffering electrocardiograph data from the electrocardiograph acquisition device, and detecting an electrocardiograph acquisition abnormal event, further includes: detecting a user event; the method for obtaining the whole packet of compressed data with a preset length comprises the following steps: if the user event is detected, performing compression processing including bit operation on the cached electrocardiograph data with a certain time length to obtain whole-packet compressed data with the length of a preset length minus 2 bytes, and writing a user event mark corresponding to the user event in the 2 bytes at the tail end of the whole-packet compressed data, wherein the length of the user event mark is single byte or double bytes.
According to a second aspect of the present invention, there is provided an electrocardiographic data processing method for a small-sized data processing device, comprising: acquiring whole-package core voltage compression data added with a data package number, wherein the length of the whole-package core voltage compression data is a preset integer multiple of a storage unit of a storage device; acquiring the data packet number from the whole-packet electrocardiograph compressed data, and performing decompression processing including bit operation on electrocardiograph compressed data except the data packet number to obtain restored electrocardiograph data; and splicing the restored electrocardiograph data to the tail end of electrocardiograph data corresponding to the data packet number before the data packet number.
Optionally, the whole-package cardiac electrical compression data also contains an abnormal event mark corresponding to an electrocardiographic acquisition abnormal event, and the length of the abnormal event mark is the same as that of the single electrocardiographic data.
Optionally, the restored electrocardiographic data is single-lead electrocardiographic data, the length of each single-lead electrocardiographic data and the length of each abnormal event mark are double bytes and each abnormal event mark comprises an invalid data bit, and the invalid data bits of the abnormal event marks correspond to the invalid data bits of the single-lead electrocardiographic data. The step of decompressing the electrocardiographic compressed data except the data packet number to obtain restored electrocardiographic data comprises the following steps: taking the starting position of the electrocardiographic compressed data divided by the data packet number as a third current position, and iteratively performing the following processing until the electrocardiographic compressed data processing is completed: acquiring the electrocardiographic compression data of a third preset byte number from a third current position; splitting and combining the electrocardiographic compressed data of the third predetermined byte number into intermediate data of a third predetermined number according to a predetermined first splitting and combining rule, wherein each intermediate data contains a plurality of continuous valid bit data; adding non-valid data bits with the value of 0 to each intermediate data to form a third preset number of data with the length of double bytes of the data subjected to the electrocardiographic compression; sequentially splicing the third preset number of the electrocardiographically compressed data to the existing electrocardiographically compressed data; taking the length of the third preset byte number of the third current position forward as a new third current position so as to carry out the next iteration processing; and taking the electrocardiographically compressed data obtained through iterative processing as restored electrocardiographic data.
Optionally, the non-valid data bits are 4 consecutive high bits in the single-lead electrocardiographic data, the third predetermined number of bytes is 3, and the third predetermined number is 2.
Optionally, the restored electrocardiographic data is multi-lead electrocardiographic data, and each of the multi-lead electrocardiographic data and the abnormal event marker is 3 bytes in length.
Optionally, the decompressing processing including bit operation is performed on the electrocardiographic compressed data except the data packet number to obtain restored electrocardiographic data, which includes: taking the starting position of the electrocardiographic compressed data divided by the data packet number as a fourth current position, and iteratively performing the following processing until the electrocardiographic compressed data processing is completed: acquiring 5 bytes of the electrocardiographic compressed data from a fourth current position; splitting specified bytes of data among the 5 bytes of the electrocardiographic compressed data into 2 20-bit intermediate data; respectively adding 2-bit filling data with a value of 0 at two ends of 2 20-bit intermediate data to form 2 data with a length of 3 bytes; splicing the 2 pieces of electrocardiographically compressed data to the existing electrocardiographically compressed data in sequence; taking the length of the fourth current position shifted forward by 5 bytes as a new fourth current position to perform next iteration processing; and taking the electrocardiographically compressed data obtained through iterative processing as restored electrocardiographic data.
Optionally, the decompressing processing including bit operation is performed on the electrocardiographic compressed data except the data packet number to obtain restored electrocardiographic data, which includes: taking the starting position of the electrocardiographic compressed data divided by the data packet number as a fifth current position, and iteratively performing the following processing until the electrocardiographic compressed data processing is completed: acquiring 2 bytes of electrocardiographic compressed data from the fifth current position as current intermediate data; respectively expanding 4 bits at two ends of the current intermediate data, and setting the value of the 4 expanded bits to 0 to obtain current difference data of 3 bytes; if the fifth current position is the starting position, taking the current difference value data as current electrocardiographic compression data; if the fifth current position is not the starting position, adding the current difference value data with the previous electrocardiographically compressed data to obtain current electrocardiographically compressed data; splicing the current electrocardiographically compressed data to the existing electrocardiographically compressed data in sequence; taking the length of the 2 bytes of forward movement of the fifth current position as a new fifth current position to perform the next iteration processing; and taking the electrocardiographically compressed data obtained through iterative processing as restored electrocardiographic data.
Optionally, after acquiring the whole-packet cardiac compression data added with the data packet number, the method further includes: detecting a user event mark at the tail end of the whole packet of compressed data, and if the user event mark is detected, acquiring the user event mark, wherein the decompressing processing of the electrocardiograph compressed data except for the data packet number, including bit operation, is performed to acquire restored electrocardiograph data, and the method comprises the following steps: if the user event mark is detected, decompressing the electrocardio compressed data except the data packet number and the user event mark by bit operation to obtain restored electrocardio data.
According to a third aspect of the present invention, there is provided an electronic device comprising: a processor and a memory; the memory is configured to store at least one executable instruction that causes the processor to perform any of the foregoing steps of an electrocardiographic data processing method for a small-form factor data processing device.
According to a fourth aspect of the present invention, there is provided a computer-readable storage medium storing executable instructions for causing the processor to perform the steps of any of the foregoing electrocardiographic data processing methods for small-sized data processing devices.
According to the electrocardio data processing scheme for the small-sized data processing equipment, compression processing comprising bit operation is carried out on continuously acquired electrocardio data from the electrocardio acquisition equipment, a data packet number is added to the compressed whole packet of compressed data obtained by compression, and the whole packet of compressed data added with the data packet number is stored in the storage device. Therefore, the characteristic of the electrocardio data is fully utilized in the compression processing of the electrocardio data comprising bit operation, the operation is simple and quick, the storage unit of the compressed electrocardio data and the storage unit of the storage device are adapted, the electrocardio data is more effectively stored, the storage efficiency is improved, and the electrocardio data processing method is very suitable for small-sized data processing equipment with limited resources and calculation processing capacity.
Drawings
Fig. 1 shows an example of electrocardiographic waveform data;
FIG. 2 is a flow chart illustrating an electrocardiographic data processing method for a small-scale data processing device according to some embodiments of the present invention;
fig. 3 is a flowchart illustrating an exemplary process of step S230 in fig. 2;
fig. 4 is a flowchart showing another exemplary process of step S230 in fig. 2;
Fig. 5 is a flowchart illustrating still another exemplary process of step S230 in fig. 2;
FIG. 6 is a flow chart illustrating an electrocardiographic data processing method for a small-scale data processing device according to further embodiments of the present invention;
fig. 7 is a flowchart illustrating an exemplary process of step S620 in fig. 6;
fig. 8 is a flowchart showing another exemplary process of step S620 in fig. 6;
fig. 9 is a flowchart showing still another exemplary process of step S620 in fig. 6;
fig. 10 is a schematic diagram illustrating a structure of an electronic device according to some embodiments of the invention.
Detailed Description
The following description of embodiments of the present invention will be made in further detail with reference to the drawings (like numerals designate like elements throughout the several views) and examples. The following examples are illustrative of the invention and are not intended to limit the scope of the invention.
It will be appreciated by those of skill in the art that the terms "first," "second," etc. in embodiments of the present invention are used merely to distinguish between different steps, devices or modules, etc., and do not represent any particular technical meaning nor necessarily logical order between them.
Fig. 1 shows an example of electrocardiographic waveform data. As shown in fig. 1, electrocardiographic data is characterized by periodicity, continuity, and non-variability. The electrocardiographic data processing method proposed by the present general inventive concept is to compress and store electrocardiographic data acquired by an electrocardiograph electrode to obtain electrocardiographic data suitable for processing and storage by a small-sized data processing device (portable device) in consideration of limitations of limited resources and limited computing processing capability of the small-sized data processing device.
Processing of the electrocardiographic data processing method for a small-sized data processing apparatus according to an embodiment of the present invention will be described in detail below with reference to fig. 2 to 5.
Fig. 2 is a flow chart illustrating an electrocardiographic data processing method for a small-sized data processing device according to some embodiments of the present invention. The method of processing electrocardiographic data is performed in a small data processing device connected to an electrocardiographic electrode, which may be a mobile communication device (e.g., a cell phone, a smart watch, etc.), a tablet computer, or a portable dedicated device.
Referring to fig. 2, in step S210, electrocardiographic data from an electrocardiographic acquisition device is continuously received and buffered, and an electrocardiographic acquisition abnormal event is detected.
While continuously receiving electrocardiographic data from an electrocardiographic acquisition device (e.g., an electrocardiographic electrode or an electrocardiographic acquisition device containing an electrocardiographic electrode), the electrocardiographic data may be cached in a memory of a processor. These electrocardiographic data may be, for example, electrocardiographic voltage data, electrocardiographic waveform data, and the like. The electrocardiographic data may be single-lead electrocardiographic data or multi-lead electrocardiographic data, each electrocardiographic data having a determined length.
In addition, an abnormal event such as electrode fall-off may occur in the electrocardiographic data acquisition by the electrocardiographic acquisition device. Accordingly, in step S210, the electrocardiographic acquisition abnormal event is also detected.
If the electrocardiographic acquisition abnormal event is detected, the process of step S220 is performed. In step S220, an abnormal event marker corresponding to the electrocardiographic acquisition abnormal event is inserted into a position corresponding to the receiving time of the electrocardiographic acquisition abnormal event in the cached electrocardiographic data, where the length of the abnormal event marker is the same as the length of a single electrocardiographic data.
For example, assuming that the length of single electrocardiographic data is two bytes, after electrocardiographic data with a value of 0x2158 is received, an abnormal event of electrocardiographic electrode falling is detected, and after electrocardiographic data with a value of 0x2158, a double-byte abnormal event flag with a value of 0x7777 is inserted.
After step S220 is performed or in the case where an electrocardiographic acquisition abnormal event is not detected, step S230 is performed.
In step S230, compression processing including bit operation is performed on the cached electrocardiograph data for a certain period of time, so as to obtain whole-packet compressed data with a predetermined length.
Because the collected electrocardio data has the characteristics of continuity and non-variability and has certain data precision, and the small data processing equipment for executing the electrocardio data processing method has limited computing resources and operation processing capacity, the cached electrocardio data with certain duration can be subjected to compression processing based on relatively simple bit operation so as to obtain compressed data with reduced data volume.
For example, the number of bits per electrocardiograph data may be reduced to compress the electrocardiograph data at the expense of accuracy of the electrocardiograph data; for another example, for electrocardiographic data in which non-valid data bits exist, the non-valid data bits may be filtered by a bit shifting operation and the obtained valid data byte-combined to compress the electrocardiographic data. These compression processes by bit manipulation are simple and fast and are suitable for execution in small data processing devices. Some exemplary processes of step S230 will be described later.
The whole package of compressed data obtained by compressing the cached electrocardiograph data for a certain time length has a preset length, and the preset length is based on a storage unit of a storage device of the small data processing equipment so as to effectively store and read the compressed electrocardiograph data.
Thereafter, in step S240, a packet number is added to the start position or the end position of the whole packet of compressed data, and the packet number is continuous with the packet number of the whole packet of compressed data obtained by the last compression.
Through the processing of step S240, in the process of performing the electrocardiograph data processing method according to the embodiment of the present invention on the continuously collected electrocardiograph data, the sequence of each whole packet of compressed data is identified according to the data packet number, and when each whole packet of compressed data is read subsequently, the packet loss (data loss) phenomenon is detected.
In step S250, the whole packet of compressed data to which the packet number is added is stored in the storage device of the small-sized data processing apparatus, wherein the length of the whole packet of compressed data to which the packet number is added is a predetermined integer multiple of the storage unit of the storage device.
That is, the total length of the whole packet of compressed data obtained in step S230 and the packet number added in step S240 is a predetermined integer multiple of the storage unit of the storage device of the small-sized data processing apparatus, whereby the storage space of the storage device can be effectively utilized.
The storage means of the small data processing device may be, for example, a Flash memory, an SD memory card, a hard disk, a U-disk, etc. For example, the memory unit of the Flash memory chip is 512 bytes. The length of the whole packet of compressed data to which the packet number is added may be set to 512 bytes (single multiple), 1024 bytes (multiple 2), 2048 bytes (multiple 4), or the like, even 4096 bytes (multiple 8), but is not limited thereto.
Through the processing in steps S210 to S250, the electrocardiograph data processing method according to the embodiment of the present invention performs compression processing including bit operation on the electrocardiograph data continuously collected from the electrocardiograph collection device, and adds a data packet number to the whole packet of compressed data obtained by compression, so that the length of the whole packet of compressed data added with the data packet number is adapted to the storage unit of the storage device of the small-sized data processing device, and then the whole packet of compressed data added with the data packet number is stored in the storage device. Therefore, the characteristic of the electrocardio data is fully utilized in the compression processing of the electrocardio data comprising bit operation, the operation is simple and quick, the storage unit of the compressed electrocardio data and the storage unit of the storage device are adapted, the electrocardio data is more effectively stored, the storage efficiency is improved, and the electrocardio data processing method is very suitable for small-sized data processing equipment with limited resources and calculation processing capacity.
The stored electrocardiographic compressed data can be read for decompression processing, and can be transmitted to a server for archiving, analysis and the like.
As previously described, the acquired electrocardiographic data may be single-lead electrocardiographic data or multi-lead electrocardiographic data, and the length and content information of the single-lead electrocardiographic data and the multi-lead electrocardiographic data are generally different. An exemplary compression process of the single-lead electrocardiographic data in step S230 is described in detail below with reference to fig. 3, and an exemplary compression process of the multi-lead electrocardiographic data in step S230 is described in detail below with reference to fig. 4 to 5.
Exemplary compression processing for Single lead Electrocardiogram data in step S230
According to an exemplary embodiment of the present invention, the foregoing electrocardiographic data is single-lead electrocardiographic data, each of the single-lead electrocardiographic data and the abnormal event flag is double-byte in length and each contains a non-valid data bit, and the non-valid data bit of the abnormal event flag corresponds to the non-valid data bit of the single-lead electrocardiographic data. For example, the single lead electrocardiographic data and the non-valid data bits of the anomaly event marker may each be 2 or 4 consecutive high-order bits.
Referring to fig. 3, in step S230, the compression process is iteratively performed with the starting position of the buffered single-lead electrocardiographic data for a certain period of time as the first current position until the whole packet of compressed data of a predetermined length is obtained. Specifically, step S230 includes the following processing of steps S310 to S370.
In step S310, the first current position is set as a starting position of single-lead electrocardiographic data.
In step S320, a first predetermined number of said single-lead electrocardiographic data is obtained from the first current location.
The first predetermined number may be determined based on the length of non-valid data bits in the single-lead electrocardiographic data. For example, assuming that the length of the non-valid data bits is 4 bits, the first predetermined number may be 2; for another example, assuming that the non-valid data bits are 2 bits in length, the first predetermined number may be 4 so that valid data in the first predetermined number of electrocardiographic data can be combined into an integer number of bytes.
In step S330, the first predetermined number of single-lead electrocardiograph data are respectively subjected to bit translation, so as to obtain valid bit data in the single-lead electrocardiograph data.
For example, assuming that the length of the non-valid data bit is 4 bits, each single-lead electrocardiographic data is shifted to the left (to the upper position) by 4 bits respectively, the non-valid data is filtered out, and the data of the valid bit number is obtained.
In step S340, byte-combining the valid bit data in the single-lead electrocardiograph data according to a predetermined first combination rule to obtain compressed data with a first predetermined number of bytes.
Assuming that two single-lead electrocardiographic data x0158 and 0x0263 are acquired, after filtering out non-valid data bit and byte combinations, 3 bytes of compressed data can be obtained: 0x58,0x12,0x63.
Assuming that two single-lead electrocardiographic data x0158 and 0x0777 (abnormal event markers) are acquired, after filtering out non-valid data bit and byte combinations, 3 bytes of compressed data can be obtained: 0x58,0x17,0x77.
In step S350, the compressed data of the first predetermined number of bytes is spliced to the existing compressed data.
Specifically, if the first current position is the initial position of the cached single-lead electrocardiograph data, taking the obtained compressed data with the first preset byte number as the existing compressed data; and splicing the compressed data with the first preset byte number to the existing compressed data obtained before if the first current position is not the initial position of the cached single-lead electrocardiographic data.
In step S360, it is determined whether the length of the existing compressed data obtained by splicing reaches the predetermined length.
If it is determined in step S360 that the length of the existing compressed data obtained by splicing is less than the predetermined length, step S370 is performed: and taking the first current position forward by the length of the first preset number as a new first current position, and returning to execute the step S320 to perform the next iteration processing.
If it is determined in step S360 that the length of the existing compressed data obtained by splicing reaches the predetermined length, the aforementioned iterative process is ended, and step S380 is performed.
In step S380, the existing compressed data obtained through the iterative process is used as the whole packet of compressed data.
Through the processing, the whole-packet compressed data with reduced data volume can be obtained by filtering non-valid data bits in single-lead electrocardiographic data and byte-combining the rest valid data.
Optionally, the non-valid data bits of the single-lead electrocardiographic data are 4 consecutive high bits in the single-lead electrocardiographic data, the first predetermined number is 2, and the first predetermined byte number is 3. In this case, the compressed electrocardiographic data is 75% of the original electrocardiographic data.
Alternatively, the non-valid data bits of the single-lead electrocardiographic data may be 2 consecutive high-order bits of the single-lead electrocardiographic data, the first predetermined number is 4, and the first predetermined number of bytes is 7, but is not limited thereto. In this case, the compressed electrocardiographic data is 87.5% of the original electrocardiographic data.
An exemplary compression process for multi-lead electrocardiographic data in step S230
According to an exemplary embodiment of the present invention, the received and buffered electrocardiographic data is multi-lead electrocardiographic data, and each of the multi-lead electrocardiographic data and the abnormal event marker is 3 bytes in length.
Referring to fig. 4, in step S230, the following compression process is iteratively performed with the starting position of the buffered multi-lead electrocardiographic data for a certain length of time as the second current position until the whole packet of compressed data of a predetermined length is obtained. Specifically, step S230 includes the following processing of steps S410 to S470.
In step S410, the second current position is set as the starting position of the single-lead electrocardiographic data.
In step S420, 2 of the multi-lead electrocardiographic data are acquired from the second current location.
In step S430, for each of the acquired multi-lead electrocardiographic data, continuous 20 data located in the middle is acquired respectively.
That is, for each 24-bit multi-lead electrocardiographic data, 2 high-order and 2 low-order data are removed, and intermediate continuous 20 data are acquired. The highest 2 high order bits in the multi-lead electrocardiographic data are usually 0, so that the removal of the 2 high order bits does not normally affect the data accuracy; the lowest 2 low-order bits in the multi-lead electrocardiograph data are the lowest-precision bits in the electrocardiograph data, and the removal of the 2 low-order bits sacrifices a little precision information of the multi-lead electrocardiograph data. Removing the 4-bit data has less effect on data accuracy, but shortens the length of the multi-lead electrocardiographic data, i.e., shortens the length of the multi-lead electrocardiographic data from 24 bits to 20 bits.
Thereafter, in step S440, 2 consecutive 20-bit data are byte-combined according to a predetermined second combination rule, obtaining 5 bytes of compressed data.
2 continuous 20-bit data can be spliced and byte combination is carried out to obtain 5 bytes of compressed data; the first 16 bits of data in 2 consecutive 20 bits of data may be respectively combined into 2 bytes, and the remaining 4 bits of 2 consecutive 20 bits of data may be combined into 1 byte, thereby obtaining 5 bytes of compressed data.
In step S450, the compressed data is spliced to existing compressed data.
Specifically, if the second current position is the initial position of the cached multi-lead electrocardiograph data, taking the currently obtained compressed data of 5 bytes as the existing compressed data; if the second current location is not the starting location of the cached multi-lead electrocardiographic data, the currently obtained 5 bytes of compressed data is spliced to the existing compressed data that has been previously obtained.
In step S460, it is determined whether the length of the existing compressed data obtained by splicing has reached the predetermined length.
If it is determined in step S460 that the length of the existing compressed data obtained by splicing is smaller than the predetermined length, the process of step S470 is performed: and taking the length of the 2 multi-lead electrocardiograph data of the second current position as a new second current position to carry out the next iteration processing.
If it is determined in step S460 that the length of the existing compressed data obtained by splicing has reached the predetermined length, the aforementioned iterative process is ended, and step S480 is performed.
In step S480, the existing compressed data obtained through the iterative process is used as the whole packet of compressed data.
Through the processing, the whole package of compressed data with reduced data volume can be obtained by removing the high data bit and the low data bit at the two ends of the multi-lead electrocardiograph data and performing byte combination on the rest effective data.
Another exemplary compression process for multi-lead electrocardiographic data in step S230
According to another exemplary embodiment of the present invention, as previously described, the received and buffered electrocardiographic data is multi-lead electrocardiographic data, each of the multi-lead electrocardiographic data and the anomaly event marker being 3 bytes in length.
Referring to fig. 5, in step S230, the following compression process is iteratively performed with the first multi-lead electrocardiograph data of the cached multi-lead electrocardiograph data for a certain length as current multi-lead electrocardiograph data until a whole packet of compressed data of a predetermined length is obtained. Specifically, step S230 includes the following processing of steps S510 to S590.
In step S510, the current multi-lead electrocardiographic data is set as the first multi-lead electrocardiographic data.
In step S520, continuous 20-bit data located in the middle of the current multi-lead electrocardiographic data is taken as current intermediate data.
The processing of this step is the same as the processing of each multi-lead electrocardiographic data in the aforementioned step S430, and will not be described here again.
Thereafter, the process of step S530 or S540 is performed according to whether the current multi-lead electrocardiographic data is the first multi-lead electrocardiographic data.
If the current multi-lead electrocardiographic data is the first multi-lead electrocardiographic data, the current intermediate data is used as current difference data in step S530.
If the current multi-lead electrocardiograph data is not the first multi-lead electrocardiograph data, in step S540, a difference calculation is performed on the current intermediate data and the intermediate data of the previous multi-lead data, so as to obtain current difference data.
Because of continuity and non-variability of two adjacent electrocardiograph data in time sequence, the current difference data obtained by carrying out the difference calculation is relatively smaller, and the storage and the processing are facilitated.
In step S550, the continuous 16-bit data located in the middle of the current difference data is taken as the compressed data of the current multi-lead electrocardiographic data.
After the current multi-lead electrocardiograph data is calculated to obtain current difference data, the current difference data is further subjected to digit reduction processing. Likewise, the highest 2 bits and the lowest 2 bits are removed from the current difference data (20 bits) obtained by the calculation, and the middle 16-bit data is obtained as compressed data of the current multi-lead electrocardiographic data. Thus, the length of compressed data obtained by compression is shortened at the cost of slightly reducing the data precision by reducing the number of data bits twice.
In step S560, the compressed data is spliced to the accumulated compressed data.
In step S570, it is determined whether the length of the accumulated compressed data obtained by the splicing reaches the predetermined length.
If it is determined in step S570 that the length of the accumulated compressed data obtained by the concatenation is smaller than the predetermined length, step S580 is performed: and acquiring next multi-lead electrocardiographic data to perform next iteration processing.
If it is determined in step S570 that the length of the accumulated compressed data obtained by the concatenation has reached the predetermined length, the aforementioned iterative process is ended, and step S590 is performed.
In step S590, the accumulated compressed data obtained through the iterative process is taken as the whole-packet compressed data.
Through the processing of the foregoing steps S510 to S580, the whole packet of compressed data with reduced data volume can be obtained by removing the high data bits and the low data bits at both ends of the multi-lead electrocardiographic data and performing the difference calculation on the remaining effective data.
Furthermore, during the continuous acquisition of multi-lead electrocardiographic data, some operations of the user may occur, such as the user pressing a certain key. In this case, operations by these users also need to be recorded. Accordingly, in accordance with an alternative embodiment of the present invention, in addition to continuously receiving and buffering electrocardiographic data from an electrocardiographic acquisition device and detecting an electrocardiographic acquisition abnormal event, a user event, such as a user' S key click event, is detected at step S210. If a user event is detected, in step S230, compression processing including bit operation is performed on the cached electrocardiograph data for a certain period of time, whole packet compressed data with a length of a predetermined length minus 2 bytes is obtained, and a user event flag corresponding to the user event is written in 2 bytes at the tail end of the whole packet compressed data, where the length of the user event flag is a single byte or a double byte.
Compression and storage processes for electrocardiographic data are described above. Processing of an electrocardiographic data processing method for a small-sized data processing device according to other embodiments of the present invention to decompress stored compressed electrocardiographic data is described below with reference to fig. 6 to 8. Here, for an operation corresponding to the compression process in the decompression process, those of ordinary skill in the art can easily understand that a detailed description is not given.
Fig. 6 is a flowchart illustrating an electrocardiographic data processing method for a small-sized data processing device according to other embodiments of the present invention.
Referring to fig. 6, in step S610, whole-packet core voltage compression data to which a data packet number is added, the length of which is a predetermined integer multiple of a storage unit of a storage device, is acquired.
For example, for a small data processing apparatus, whole-package cardiac compression data having a length of a predetermined integer multiple of the storage unit of the storage device can be read from the storage device thereof. For other devices, it is possible to receive a data packet containing the whole-packet data from a small data processing device, for example, and to acquire the whole-packet data added with the data packet number from the data packet.
Optionally, as described above, the whole-package cardiac electrical compression data further contains an abnormal event marker corresponding to an abnormal event of electrocardiographic acquisition, and the length of the abnormal event marker is the same as that of a single electrocardiographic data.
In step S620, the data packet number is obtained from the whole-packet cardiac compression data, and decompression processing including bit operation is performed on cardiac compression data except for the data packet number, so as to obtain restored cardiac data.
In order to perform the electrocardiographic data processing method in a small-sized data processing apparatus having limited computing resources and computing processing capabilities, corresponding to the compression processing of the foregoing step S230, decompression processing based on relatively simple bit operations is performed on the entire packed electrocardiographic compressed data to restore electrocardiographic data.
In step S630, the restored electrocardiograph data is spliced to the end of the electrocardiograph data corresponding to the previous data packet number of the data packet number.
Through the processing of the foregoing steps S610 to S630, the whole packet core voltage compressed data with the length being a predetermined multiple of the storage unit of the storage device and added with the data packet number is obtained, and the decompression processing including the bit operation is performed on the whole packet compressed data obtained through the compression processing including the bit operation, so that the operation is simple and quick, and the method is very suitable for small-sized data processing equipment with limited resources and computing processing capacity.
As previously described, the restored electrocardiographic data may be single-lead electrocardiographic data or multi-lead electrocardiographic data. An exemplary decompression process of the single-lead electrocardiographic data in step S230 is described in detail below with reference to fig. 7, and an exemplary decompression process of the multi-lead electrocardiographic data in step S620 is described in detail below with reference to fig. 8 to 9.
Exemplary decompression processing for Single lead cardiac compression data in step S620
According to an exemplary embodiment of the present invention, the restored electrocardiographic data is single-lead electrocardiographic data, each of the single-lead electrocardiographic data and the abnormal event flag is double-byte in length and contains non-valid data bits, and the non-valid data bits of the abnormal event flag correspond to the non-valid data bits of the single-lead electrocardiographic data.
Referring to fig. 7, in step S620, in the process of performing decompression processing including bit operation on the electrocardiographic compressed data except for the packet number to obtain restored electrocardiographic data, the decompression processing is iteratively performed with the start position of the electrocardiographic compressed data except for the packet number as the third current position until the processing of electrocardiographic compressed data is completed, specifically including the following steps S710 to S780.
In step S710, the third current position is set as the start position of the cardiac compression data except for the packet number.
In step S720, the cardiac compression data of a third predetermined number of bytes is acquired from a third current position.
The third predetermined number of bytes may be determined based on the length of non-valid data bits in the restored single-lead electrocardiographic data. For example, assuming that the non-valid data bits are 4 bits in length, the third predetermined number of bytes may be 3; for another example, assuming that the non-valid data bits are 2 bits in length, the third predetermined number of bytes may be 7, so that valid data in the restored electrocardiographic data can be combined into an integer number of bytes.
In step S730, the cardiac compression data of the third predetermined number of bytes are split and combined into a third predetermined number of intermediate data according to a predetermined first split and combination rule, where each of the intermediate data contains a continuous plurality of valid bit data.
For example, assuming that the non-valid data bit is 4 bits in length and the third predetermined byte number is 3, a predetermined one (e.g., middle byte) of the 3 bytes of electrocardiographic compressed data is split into 2 4 bits of middle data, and the 4 bits of middle data are respectively part of valid data in the restored electrocardiographic data.
In step S740, a third predetermined number of cardiac electrolytic compression data of double bytes in length is formed by adding non-valid data bits of 0 value to each of the intermediate data.
Continuing with the previous example, assuming that the non-valid data bits are 4 bits in length, the third predetermined byte number is 3, splitting one of the cardiac compression data of 3 byte numbers into 2 4-bit intermediate data, and adding the 2 4-bit intermediate data to the non-valid data bits having a value of 0 at the high order in step S740, thereby forming 2 bytes of data; and respectively byte-combining the data of the 2 bytes with other two corresponding bytes of electrocardiographic compression data to form 2 pieces of electrocardiographic compression data with double bytes of length.
In step S750, the third predetermined number of the electrocardiographically compressed data is spliced to the existing electrocardiographically compressed data in sequence.
Specifically, if the third current position is the starting position of the electrocardiographic compression data except the data packet number, taking the currently obtained third preset number of electrocardiographic compression data as the existing electrocardiographic compression data; otherwise, the third preset number of the currently obtained electrocardiographically compressed data are spliced to the existing electrocardiographically compressed data in sequence.
In step S760, the third current position is advanced by a length of a third predetermined number of bytes as a new third current position, so as to perform the next iteration process.
In step S770, it is determined whether the new third current position has reached the end of the whole-core compressed data.
If it is determined in step S770 that the new third current position has reached the end of the whole-core compressed data, the aforementioned iterative process is ended, and step S780 is performed; otherwise, the process returns to step S720, and the next iteration process is continued.
In step S780, the electrocardiographically compressed data obtained through the iterative processing is used as restored electrocardiographic data.
By the foregoing processing, decompression can be performed by bit operation and byte combination processing, and restored electrocardiographic data containing non-valid data bits can be obtained.
As previously described, optionally, the non-valid data bits are 4 consecutive high-order bits in the single-lead electrocardiographic data, the third predetermined number of bytes is 3, and the third predetermined number is 2.
An exemplary decompression process for multi-lead cardiac compression data in step S620
According to an exemplary embodiment of the present invention, the restored electrocardiographic data is multi-lead electrocardiographic data, and each of the multi-lead electrocardiographic data and the abnormal event marker is 3 bytes in length.
Referring to fig. 8, in step S620, in the process of performing decompression processing including bit operation on the electrocardiographic compressed data with the data packet number removed and obtaining restored electrocardiographic data, the decompression processing is iteratively performed with the start position of the electrocardiographic compressed data with the data packet number removed as the fourth current position until the processing of electrocardiographic compressed data is completed, specifically including the following steps S810 to S880.
In step S810, the fourth current position is set as the start position of the electrocardiographic compression data except for the packet number.
In step S820, the cardiac compression data of 5 bytes is acquired from the fourth current position.
In step S830, specified bytes of data among the cardiac compression data of the 5 bytes are split into 2 20-bit intermediate data.
In step S840, padding data with a value of 0 for 2 bits is added to both ends of the 2 intermediate data for 20 bits, respectively, to form 2 pieces of data for cardiac electrolytic compression with a length of 3 bytes.
In step S850, the 2 pieces of electrocardiographically compressed data are spliced in sequence to existing electrocardiographically compressed data.
In step S860, the fourth current position is shifted forward by a length of 5 bytes as a new fourth current position, so as to perform the next iteration process.
In step S870, it is determined whether the new fourth current position has reached the end of the electrocardiographic compression data excluding the packet number.
If step S870 determines that the new fourth current position has reached the end of the cardiac compression data except the packet number, the iterative process for cardiac compression data is ended, and step S880 is performed; if it is determined in step S870 that the new fourth current position does not reach the end of the cardiac compression data except the packet number, the process returns to step S820 to continue the next iteration process.
In step S880, the electrocardiographically compressed data obtained through the iterative processing is used as restored electrocardiographic data.
The processing in steps S810 to S880 corresponds to the processing in step S230 in fig. 4, and will not be described here.
Another exemplary decompression process for multi-lead cardiac compression data in step S620
According to another exemplary embodiment of the present invention, the restored electrocardiographic data is multi-lead electrocardiographic data, and each of the multi-lead electrocardiographic data and the abnormal event marker is 3 bytes in length.
Referring to fig. 9, in step S620, the decompression process is iteratively performed with the start position of the electrocardiographic compressed data divided by the packet number as the fifth current position until the processing of the electrocardiographic compressed data is completed, specifically including the following steps S910 to S990.
In step S910, the fifth current position is set as the start position of the electrocardiographic compression data except for the packet number.
In step S920, electrocardiographic compressed data of 2 bytes is acquired from the fifth current position as current intermediate data.
In step S930, 4 bits are extended at two ends of the current intermediate data, and the value of the extended 4 bits is set to 0, so as to obtain 3 bytes of current difference data.
In step S940, if the fifth current position is the start position, the current difference data is taken as current cardiac electrolytic compression data.
In step S950, if the fifth current position is not the start position, the current difference data is added to the previous electrocardiographically compressed data to obtain current electrocardiographically compressed data.
In step S960, the current electrocardiographically compressed data is spliced in turn to existing electrocardiographically compressed data.
In step S970, the fifth current position is advanced by a length of 2 bytes as a new fifth current position to perform the next iteration process.
In step S980, it is determined whether the new fifth current location has reached the end of the cardiac compression data except for the packet number.
If step S980, determining that the new fifth current position has reached the end of the cardiac compression data except the data packet number, ending the iterative processing of the cardiac compression data, and executing step S990; if step S980 determines that the new fifth current position does not reach the end of the cardiac compression data except the packet number, the process returns to step S920 to continue the next iteration process.
In step S990, the electrocardiographically compressed data obtained through the iterative processing is taken as restored electrocardiographic data.
The processing of steps S910 to S990 corresponds to the processing of step S230 in fig. 5, and will not be described here.
Furthermore, according to an alternative embodiment of the present invention, after acquiring the whole-packet cardiac compression data to which the data packet number is added in step S610, the electrocardiographic data processing method further includes: and detecting a user event mark at the tail end of the whole packet of compressed data, and if the user event mark is detected, acquiring the user event mark so as to carry out subsequent corresponding processing according to the user event mark.
In this case, in step S620, the decompressing process including the bit operation is performed on the electrocardiographic compressed data except for the data packet number to obtain the restored electrocardiographic data, including: if the user event mark is detected, decompressing the electrocardio compressed data except the data packet number and the user event mark by bit operation to obtain restored electrocardio data.
The present invention also provides a computer readable storage medium storing computer program instructions of any of the foregoing methods of electrocardiographic data processing for a small-sized data processing device.
The embodiment of the invention also provides electronic equipment. Fig. 10 is a schematic diagram showing the structure of an electronic apparatus 1000 according to an embodiment of the present invention. The electronic device 1000 may be, for example, a mobile terminal, a Personal Computer (PC), a tablet computer, a server, etc.
As shown in fig. 10, the electronic device 1000 may include a memory and a processor. In particular, the electronic device 1000 includes one or more processors, communication elements, etc., such as: one or more Central Processing Units (CPUs) 1001, and/or one or more electrocardiographic data processors (GPUs) 1013 for small data processing devices, etc., the processor may perform various suitable actions and processes according to executable instructions stored in a read-only memory (ROM) 1002 or executable instructions loaded from a storage portion 1008 into a Random Access Memory (RAM) 1003. The communication elements include a communication component 1012 and/or a communication interface 1009. Wherein the communication component 1012 may include, but is not limited to, a network card, which may include, but is not limited to, a IB (Infiniband) network card, the communication interface 1009 includes a communication interface of a network interface card such as a LAN card, a modem, etc., the communication interface 1009 performs communication processing via a network such as the internet.
The processor may communicate with the rom 1002 and/or the ram 1003 to execute executable instructions, and may be coupled to the communication module 1012 by the communication bus 1004 and communicate with other target devices via the communication module 1012, thereby completing operations corresponding to any of the methods for processing electrocardiographic data for small-sized data processing devices according to embodiments of the present invention. For example, continuously receiving and buffering electrocardiographic data from an electrocardiographic acquisition device, and detecting electrocardiographic acquisition abnormal events; if the electrocardio acquisition abnormal event is detected, inserting an abnormal event mark corresponding to the electrocardio acquisition abnormal event into a position corresponding to the receiving time of the electrocardio acquisition abnormal event in the cached electrocardio data, wherein the length of the abnormal event mark is the same as that of single electrocardio data; performing compression processing including bit operation on the cached electrocardiograph data with a certain time length to obtain whole-packet compression data with a preset length; adding a data packet number at the starting position or the ending position of the whole packet of compressed data, wherein the data packet number is continuous with the data packet number of the whole packet of compressed data obtained by the last compression; and storing the whole packet of compressed data added with the data packet number in a storage device of the small data processing equipment, wherein the length of the whole packet of compressed data added with the data packet number is a preset integer multiple of a storage unit of the storage device. Or, for another example, acquiring whole-package core voltage compressed data added with a data package number, wherein the length of the whole-package core voltage compressed data is a preset integer multiple of a storage unit of a storage device; acquiring the data packet number from the whole-packet electrocardiograph compressed data, and performing decompression processing including bit operation on electrocardiograph compressed data except the data packet number to obtain restored electrocardiograph data; and splicing the restored electrocardiograph data to the tail end of electrocardiograph data corresponding to the data packet number before the data packet number.
In addition, in the RAM 1003, various programs and data required for device operation can also be stored. The CPU 1001 or the GPU 1013, the ROM 1002, and the RAM 1003 are connected to each other through a communication bus 1004. In the case of RAM 1003, ROM 1002 is an optional module. The RAM 1003 stores executable instructions or writes executable instructions into the ROM 1002 at the time of execution, the executable instructions causing the processor to execute operations corresponding to the above-described communication method. An input/output (I/O) interface 1005 is also connected to the communication bus 1004. Communication component 1012 may be integrally provided or may be provided with multiple sub-modules (e.g., multiple IB network cards) and over a communication bus link.
The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output portion 1007 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk or the like; and a communication interface 1009 including a network interface card such as a LAN card, modem, or the like. The drive 1010 is also connected to the I/O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in the drive 1010, so that a computer program read out therefrom is installed as needed in the storage section 1008.
It should be noted that the architecture shown in fig. 10 is only an alternative implementation, and in a specific practical process, the number and types of components in fig. 10 may be selected, deleted, added or replaced according to actual needs; in the setting of different functional components, implementation manners such as separation setting or integration setting can also be adopted, for example, the GPU and the CPU can be separated or the GPU can be integrated on the CPU, the communication element can be separated or the communication element can be integrated on the CPU or the GPU, and the like. These alternative embodiments fall within the scope of the invention.
The electronic device according to the embodiment of the present invention may be used to implement the corresponding method for processing electrocardiographic data for a small-sized data processing device in the foregoing embodiment, and each device in the electronic device may be used to perform each step in the foregoing method embodiment, for example, the method for processing electrocardiographic data for a small-sized data processing device described above may be implemented by calling, by a processor of the electronic device, a related instruction stored in a memory, which is not described herein for brevity.
The processes described above with reference to flowcharts may be implemented as a computer program product according to embodiments of the invention. For example, embodiments of the present invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method shown in the flowcharts, the program code may include instructions corresponding to the steps of performing the methods provided by embodiments of the present invention. For example, instructions for continuously receiving and buffering electrocardiographic data from an electrocardiographic acquisition device and detecting electrocardiographic acquisition abnormal events; if the electrocardio acquisition abnormal event is detected, inserting an abnormal event mark corresponding to the electrocardio acquisition abnormal event into a position corresponding to the receiving time of the electrocardio acquisition abnormal event in the cached electrocardio data, wherein the length of the abnormal event mark is the same as that of single electrocardio data; the method comprises the steps of performing compression processing including bit operation on cached electrocardiograph data with a certain time length to obtain an instruction of whole-packet compressed data with a preset length; instructions for adding a data packet number at a start position or an end position of the whole packet of compressed data, wherein the data packet number is continuous with a data packet number of the whole packet of compressed data obtained by last compression; and instructions for storing the whole packet of compressed data with the data packet number added in a storage device of the small-sized data processing apparatus, wherein the length of the whole packet of compressed data with the data packet number added is a predetermined integer multiple of a storage unit of the storage device. Or, for another example, an instruction for acquiring whole-packet data added with a data packet number, the length of the whole-packet data being a predetermined integer multiple of a storage unit of the storage device; the instruction is used for acquiring the data packet number from the whole-packet electrocardiograph compressed data, and performing decompression processing comprising bit operation on electrocardiograph compressed data except the data packet number to obtain restored electrocardiograph data; and the instructions are used for splicing the restored electrocardio data to the tail end of the electrocardio data corresponding to the data packet number before the data packet number. In such embodiments, the computer program may be downloaded and installed from a network via a communications element, and/or installed from a removable medium 1011. The functions disclosed in the methods of the embodiments of the present invention are performed when the computer program is executed by a processor.
The methods and apparatus, electronic devices and storage media of the present invention may be implemented in a number of ways. For example, the methods and apparatus, electronic devices, and storage media of embodiments of the invention may be implemented in software, hardware, firmware, or any combination of software, hardware, firmware. The above-described sequence of steps for a method is for illustration only, and the steps of a method of an embodiment of the present invention are not limited to the sequence specifically described above unless specifically stated otherwise. Furthermore, in some embodiments, the present invention may also be implemented as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to embodiments of the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the embodiment of the present invention.
The description of the embodiments of the invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or to limit the invention to the precise form disclosed, and many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.

Claims (18)

1. An electrocardiographic data processing method for a small-sized data processing device, comprising:
continuously receiving and caching electrocardio data from electrocardio acquisition equipment, and detecting electrocardio acquisition abnormal events, wherein the electrocardio data is single-lead electrocardio data;
if the electrocardio acquisition abnormal event is detected, inserting an abnormal event mark corresponding to the electrocardio acquisition abnormal event into a position corresponding to the receiving time of the electrocardio acquisition abnormal event in the cached electrocardio data, wherein the lengths of each single-lead electrocardio data and the abnormal event mark are double bytes and contain non-valid data bits, and the non-valid data bits of the abnormal event mark correspond to the non-valid data bits of the single-lead electrocardio data;
performing compression processing including bit operation on the cached electrocardiograph data with a certain time length to obtain whole-packet compression data with a preset length;
adding a data packet number at the starting position or the ending position of the whole packet of compressed data, wherein the data packet number is continuous with the data packet number of the whole packet of compressed data obtained by the last compression;
storing the whole packet of compressed data added with the data packet number in a storage device of the small data processing apparatus, wherein the length of the whole packet of compressed data added with the data packet number is a predetermined integer multiple of a storage unit of the storage device,
The method for obtaining the whole packet of compressed data with a preset length comprises the following steps:
taking the initial position of the cached single-lead electrocardiograph data with a certain time length as a first current position, and iteratively performing the following processing until the whole packet of compressed data with a preset length is obtained:
acquiring a first preset number of single-lead electrocardiograph data from a first current position;
respectively carrying out bit translation on the first preset number of single-lead electrocardiograph data to obtain data of effective digits in the single-lead electrocardiograph data;
byte-combining the data of the effective digits in each single-lead electrocardiograph data according to a preset first combination rule to obtain compressed data of a first preset byte number;
splicing the compressed data of the first predetermined number of bytes to existing compressed data;
if the length of the existing compressed data obtained by splicing is smaller than the preset length, the first current position is advanced by the first preset number of lengths to serve as a new first current position, and next iteration processing is conducted;
and taking the existing compressed data obtained through iterative processing as the whole-packet compressed data.
2. The method of claim 1, wherein the non-valid data bits are 4 consecutive high-order bits in the single-lead electrocardiographic data, the first predetermined number is 2, and the first predetermined number of bytes is 3.
3. An electrocardiographic data processing method for a small-sized data processing device, comprising:
continuously receiving and caching electrocardio data from electrocardio acquisition equipment, and detecting electrocardio acquisition abnormal events, wherein the electrocardio data are multi-lead electrocardio data;
if the electrocardio acquisition abnormal event is detected, inserting an abnormal event mark corresponding to the electrocardio acquisition abnormal event into a position corresponding to the receiving time of the electrocardio acquisition abnormal event in the cached electrocardio data, wherein the length of the abnormal event mark is the same as that of single electrocardio data and is 3 bytes;
performing compression processing including bit operation on the cached electrocardiograph data with a certain time length to obtain whole-packet compression data with a preset length;
adding a data packet number at the starting position or the ending position of the whole packet of compressed data, wherein the data packet number is continuous with the data packet number of the whole packet of compressed data obtained by the last compression;
Storing the whole packet of compressed data added with the data packet number in a storage device of the small data processing apparatus, wherein the length of the whole packet of compressed data added with the data packet number is a predetermined integer multiple of a storage unit of the storage device,
the method for obtaining the whole packet of compressed data with a preset length comprises the following steps:
taking the initial position of the cached multi-lead electrocardiograph data with a certain time length as a second current position, and iteratively performing the following processing until the whole packet of compressed data with a preset length is obtained:
acquiring 2 multi-lead electrocardiographic data from a second current position;
respectively acquiring continuous 20-bit data in the middle of each acquired multi-lead electrocardiograph data;
byte-combining 2 continuous 20-bit data according to a preset second combination rule to obtain 5-byte compressed data;
splicing the compressed data to existing compressed data;
if the length of the spliced existing compressed data is smaller than the preset length, the second current position is advanced by 2 lengths of the multi-lead electrocardiograph data as a new second current position so as to carry out next iteration processing;
Taking the existing compressed data obtained through iterative processing as the whole packet of compressed data,
or, performing compression processing including bit operation on the cached electrocardiograph data with a certain duration to obtain whole-packet compressed data with a predetermined length, where the compression processing includes:
taking the first multi-lead electrocardio data of the cached multi-lead electrocardio data with a certain time length as the current multi-lead electrocardio data, and iteratively performing the following processing until the whole packet of compressed data with a preset length is obtained:
taking continuous 20-bit data positioned in the middle of the current multi-lead electrocardiograph data as current middle data;
if the current multi-lead electrocardiograph data is the first multi-lead electrocardiograph data, the current intermediate data is used as current difference data;
if the current multi-lead electrocardiograph data is not the first multi-lead electrocardiograph data, performing difference calculation on the current intermediate data and the intermediate data of the previous multi-lead data to obtain current difference data;
taking continuous 16-bit data positioned in the middle of the current difference value data as compressed data of current multi-lead electrocardiograph data;
splicing the compressed data to accumulated compressed data;
If the length of the accumulated compressed data obtained by splicing is smaller than the preset length, acquiring next multi-lead electrocardio data so as to carry out next iteration processing;
and taking the accumulated compressed data obtained through iterative processing as the whole-packet compressed data.
4. The method of claim 3, wherein continuously receiving and buffering electrocardiographic data from an electrocardiographic acquisition device and detecting electrocardiographic acquisition anomalies further comprises:
detecting a user event;
the method for obtaining the whole packet of compressed data with a preset length comprises the following steps:
if the user event is detected, performing compression processing including bit operation on the cached electrocardiograph data with a certain time length to obtain whole-packet compressed data with the length of a preset length minus 2 bytes, and writing a user event mark corresponding to the user event in the 2 bytes at the tail end of the whole-packet compressed data, wherein the length of the user event mark is single byte or double bytes.
5. An electrocardiographic data processing method for a small-sized data processing device, comprising:
acquiring whole-package core voltage compression data added with a data package number, wherein the length of the whole-package core voltage compression data is a preset integer multiple of a storage unit of a storage device;
Acquiring the data packet number from the whole-packet electrocardiograph compressed data, and performing decompression processing including bit operation on electrocardiograph compressed data except the data packet number to obtain restored electrocardiograph data, wherein the restored electrocardiograph data is single-lead electrocardiograph data;
splicing the restored electrocardiograph data to the tail end of electrocardiograph data corresponding to the previous data packet number of the data packet number,
wherein each single lead electrocardiographic data is double-byte in length and comprises valid data bits and non-valid data bits,
the step of decompressing the electrocardiographic compressed data except the data packet number to obtain restored electrocardiographic data comprises the following steps:
taking the starting position of the electrocardiographic compressed data divided by the data packet number as a third current position, and iteratively performing the following processing until the electrocardiographic compressed data processing is completed:
acquiring the electrocardiographic compression data of a third preset byte number from a third current position;
splitting and combining the electrocardiographic compressed data of the third predetermined byte number into intermediate data of a third predetermined number according to a predetermined first splitting and combining rule, wherein each intermediate data contains a plurality of continuous valid bit data;
Adding non-valid data bits with the value of 0 to each intermediate data to form a third preset number of data with the length of double bytes of the data subjected to the electrocardiographic compression;
sequentially splicing the third preset number of the electrocardiographically compressed data to the existing electrocardiographically compressed data;
taking the length of the third preset byte number of the third current position forward as a new third current position so as to carry out the next iteration processing;
and taking the electrocardiographically compressed data obtained through iterative processing as restored electrocardiographic data.
6. The method of claim 5, wherein the whole-package cardiac electrical compression data further comprises an abnormal event marker corresponding to an abnormal event of electrocardiographic acquisition, the abnormal event marker having a length identical to that of a single electrocardiographic data and comprising a valid data bit and a non-valid data bit, and the non-valid data bit of the abnormal event marker corresponds to the non-valid data bit of the single-lead electrocardiographic data.
7. The method of claim 6, wherein the non-valid data bits are 4 consecutive high-order bits in the single-lead electrocardiographic data, the third predetermined number of bytes is 3, and the third predetermined number is 2.
8. An electrocardiographic data processing method for a small-sized data processing device, comprising:
acquiring whole-package core voltage compression data added with a data package number, wherein the length of the whole-package core voltage compression data is a preset integer multiple of a storage unit of a storage device;
acquiring the data packet number from the whole-packet electrocardiograph compressed data, and performing decompression processing including bit operation on electrocardiograph compressed data except the data packet number to obtain restored electrocardiograph data;
splicing the restored electrocardiograph data to the tail end of electrocardiograph data corresponding to the previous data packet number of the data packet number,
wherein the restored electrocardio data is multi-lead electrocardio data, the length of each multi-lead electrocardio data is 3 bytes,
the step of decompressing the electrocardiographic compressed data except the data packet number to obtain restored electrocardiographic data comprises the following steps:
taking the starting position of the electrocardiographic compressed data divided by the data packet number as a fourth current position, and iteratively performing the following processing until the electrocardiographic compressed data processing is completed:
acquiring 5 bytes of the electrocardiographic compressed data from a fourth current position;
Splitting specified bytes of data among the 5 bytes of the electrocardiographic compressed data into 2 20-bit intermediate data;
respectively adding 2-bit filling data with a value of 0 at two ends of 2 20-bit intermediate data to form 2 data with a length of 3 bytes;
splicing the 2 pieces of electrocardiographically compressed data to the existing electrocardiographically compressed data in sequence;
taking the length of the fourth current position shifted forward by 5 bytes as a new fourth current position to perform next iteration processing;
the electrocardiographic compression data obtained through the iterative processing is used as restored electrocardiographic data,
or alternatively, the process may be performed,
the step of decompressing the electrocardiographic compressed data except the data packet number to obtain restored electrocardiographic data comprises the following steps:
taking the starting position of the electrocardiographic compressed data divided by the data packet number as a fifth current position, and iteratively performing the following processing until the electrocardiographic compressed data processing is completed:
acquiring 2 bytes of electrocardiographic compressed data from the fifth current position as current intermediate data;
respectively expanding 4 bits at two ends of the current intermediate data, and setting the value of the 4 expanded bits to 0 to obtain current difference data of 3 bytes;
If the fifth current position is the starting position, taking the current difference value data as current electrocardiographic compression data;
if the fifth current position is not the starting position, adding the current difference value data with the previous electrocardiographically compressed data to obtain current electrocardiographically compressed data;
splicing the current electrocardiographically compressed data to the existing electrocardiographically compressed data in sequence;
taking the length of the 2 bytes of forward movement of the fifth current position as a new fifth current position to perform the next iteration processing;
and taking the electrocardiographically compressed data obtained through iterative processing as restored electrocardiographic data.
9. The method of claim 8, wherein the whole-package cardiac electrical compression data further comprises an abnormal event marker corresponding to an abnormal event of electrocardiographic acquisition, and the abnormal event marker has a length identical to that of the single electrocardiographic data.
10. The method according to claim 8 or 9, wherein after acquiring the whole-packet cardiac compression data to which the data packet number is added, the method further comprises:
detecting a user event marker at the end of the whole packet of cardiac compression data,
If the user event marker is detected, the user event marker is acquired,
the step of decompressing the electrocardiographic compressed data except the data packet number to obtain restored electrocardiographic data comprises the following steps:
if the user event mark is detected, decompressing the electrocardio compressed data except the data packet number and the user event mark by bit operation to obtain restored electrocardio data.
11. A computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, which when executed by a processor, are configured to implement the method for processing electrocardiographic data according to any one of claims 1-2.
12. A computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions for implementing the method for processing electrocardiographic data according to any one of claims 3 to 4 when the computer program instructions are executed by a processor.
13. An electronic device, comprising: a processor and a memory;
the memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform the method for processing electrocardiographic data according to any one of claims 1-2.
14. An electronic device, comprising: a processor and a memory;
the memory is configured to store at least one executable instruction that causes the processor to perform the method for processing electrocardiographic data according to any one of claims 3-4.
15. A computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, which when executed by a processor, are configured to implement the method for processing electrocardiographic data according to any one of claims 5 to 7.
16. A computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, which when executed by a processor, are configured to implement the method for processing electrocardiographic data according to any one of claims 8 to 10.
17. An electronic device, comprising: a processor and a memory;
the memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform the method for processing electrocardiographic data according to any one of claims 5-7.
18. An electronic device, comprising: a processor and a memory;
The memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform the method for processing electrocardiographic data according to any one of claims 8-10.
CN202110846860.7A 2021-07-26 2021-07-26 Electrocardiogram data processing method for small-sized data processing device, electronic device, and storage medium Active CN113812959B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110846860.7A CN113812959B (en) 2021-07-26 2021-07-26 Electrocardiogram data processing method for small-sized data processing device, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110846860.7A CN113812959B (en) 2021-07-26 2021-07-26 Electrocardiogram data processing method for small-sized data processing device, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN113812959A CN113812959A (en) 2021-12-21
CN113812959B true CN113812959B (en) 2023-10-13

Family

ID=78923903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110846860.7A Active CN113812959B (en) 2021-07-26 2021-07-26 Electrocardiogram data processing method for small-sized data processing device, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN113812959B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115940959B (en) * 2023-02-16 2023-06-23 国网山东省电力公司营销服务中心(计量中心) Low-power consumption electric energy data acquisition management system
CN116616787B (en) * 2023-07-26 2023-09-22 苏州维伟思医疗科技有限公司 Electrocardiogram data display method, terminal equipment and storage medium in wireless communication

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008052483A1 (en) * 2006-11-02 2008-05-08 Huawei Technologies Co., Ltd. Data compression method and apparatus, and automatic repeat request feedback system
CN103560795A (en) * 2013-10-29 2014-02-05 东软熙康健康科技有限公司 Compression method, transmission method, reconstruction method and device for electrocardiograph signals
CN111160139A (en) * 2019-12-13 2020-05-15 中国科学院深圳先进技术研究院 Electrocardiosignal processing method and device and terminal equipment
CN111557661A (en) * 2020-05-15 2020-08-21 深圳清华大学研究院 Electrocardiosignal processing method and device
JP6831944B1 (en) * 2020-08-21 2021-02-17 生物島実験室 How to extend ECG data and its devices, electronic devices and media

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008052483A1 (en) * 2006-11-02 2008-05-08 Huawei Technologies Co., Ltd. Data compression method and apparatus, and automatic repeat request feedback system
CN103560795A (en) * 2013-10-29 2014-02-05 东软熙康健康科技有限公司 Compression method, transmission method, reconstruction method and device for electrocardiograph signals
CN111160139A (en) * 2019-12-13 2020-05-15 中国科学院深圳先进技术研究院 Electrocardiosignal processing method and device and terminal equipment
CN111557661A (en) * 2020-05-15 2020-08-21 深圳清华大学研究院 Electrocardiosignal processing method and device
JP6831944B1 (en) * 2020-08-21 2021-02-17 生物島実験室 How to extend ECG data and its devices, electronic devices and media

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
远程心电诊断传输系统的实现;戚继文,高国升;数据采集与处理(第04期);全文 *

Also Published As

Publication number Publication date
CN113812959A (en) 2021-12-21

Similar Documents

Publication Publication Date Title
CN113812959B (en) Electrocardiogram data processing method for small-sized data processing device, electronic device, and storage medium
JP5826114B2 (en) Data decompression device, data compression device, data decompression program, data compression program, and compressed data distribution system
US9509334B2 (en) Non-transitory computer-readable recording medium, compression method, decompression method, compression device and decompression device
CN110799959B (en) Data compression method, decompression method and related equipment
CN109802684B (en) Method and device for data compression
CN102841901A (en) Web page display method and device
JP2002529849A (en) Data compression method for intermediate object code program executable in embedded system supplied with data processing resources, and embedded system corresponding to this method and having multiple applications
CN112037792B (en) Voice recognition method and device, electronic equipment and storage medium
CN112532998B (en) Method, device and equipment for extracting video frame and readable storage medium
CN106849956B (en) Compression method, decompression method, device and data processing system
CN104410424B (en) The fast and lossless compression method of embedded device internal storage data
CN103914404A (en) Configuration information cache device in coarseness reconfigurable system and compression method
KR101848192B1 (en) System and method for conserving power consumption in a memory system
CN109088636B (en) Data processing method and system, electronic equipment and storage medium
CN114330820A (en) Patient disease prognosis prediction method, system, storage medium and electronic device
CN108416425A (en) A kind of convolution method and device
CN102906740B (en) The method and system of packed data record and process packed data record
CN104219537B (en) The method, apparatus and system of video data processing
CN107797898B (en) Data acquisition method and device thereof
CN112269541B (en) Method, device and equipment for processing additional data and readable storage medium
CN111863043B (en) Audio transfer file generation method, related equipment and readable storage medium
CN116418348A (en) Data compression method, device, equipment and storage medium
CN110457239B (en) Method for extracting solid state disk basic key
CN113972005A (en) Artificial intelligence auxiliary diagnosis and treatment method and system, storage medium and electronic equipment
CN115250351A (en) Compression method, decompression method and related products for image data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant