CN113381766A - Method, terminal and storage medium for electrocardiogram data compression - Google Patents

Method, terminal and storage medium for electrocardiogram data compression Download PDF

Info

Publication number
CN113381766A
CN113381766A CN202110714142.4A CN202110714142A CN113381766A CN 113381766 A CN113381766 A CN 113381766A CN 202110714142 A CN202110714142 A CN 202110714142A CN 113381766 A CN113381766 A CN 113381766A
Authority
CN
China
Prior art keywords
data
point
ordinate
compression
line segment
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.)
Withdrawn
Application number
CN202110714142.4A
Other languages
Chinese (zh)
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.)
Institute Of Applied Mathematics Hebei Academy Of Sciences
Original Assignee
Institute Of Applied Mathematics Hebei Academy Of Sciences
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 Institute Of Applied Mathematics Hebei Academy Of Sciences filed Critical Institute Of Applied Mathematics Hebei Academy Of Sciences
Priority to CN202110714142.4A priority Critical patent/CN113381766A/en
Priority to CN202111031852.3A priority patent/CN113644917B/en
Publication of CN113381766A publication Critical patent/CN113381766A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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
    • A61B5/7203Signal processing specially adapted for physiological signals or for diagnostic purposes for noise prevention, reduction or removal

Landscapes

  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • Veterinary Medicine (AREA)
  • Public Health (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Biophysics (AREA)
  • Pathology (AREA)
  • Biomedical Technology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Medical Informatics (AREA)
  • Molecular Biology (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Psychiatry (AREA)
  • Physiology (AREA)
  • Cardiology (AREA)
  • Theoretical Computer Science (AREA)
  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)

Abstract

The invention provides a method, a terminal and a storage medium for electrocardiogram data compression. The method comprises the following steps: performing piecewise fitting on the electrocardiogram data according to a set error to obtain a plurality of line segment sets, and a starting point abscissa set Hs, an end point abscissa set He, a starting point ordinate set Vs and an end point ordinate set Ve of each line segment; compressing the starting point ordinate set Vs, and determining an updated set Vs of the starting point ordinate according to the starting point ordinate compression result Gvs*(ii) a Based on the update set Vs*And obtaining an updated ordinate upper bound DD by the starting point abscissa HsUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLPerforming line segment fitting to obtain a slope set KK of a segmented line segment or an updated set Ve' of a terminal vertical coordinate; according to the update set Vs*The set of start abscissa Hs and the set of end abscissa He, and the scoreAnd determining compression information by using a slope set KK of the segment line segment or an update set Ve' of the end point vertical coordinate, so as to represent the compressed electrocardiogram data. The invention improves the data compression rate.

Description

Method, terminal and storage medium for electrocardiogram data compression
Technical Field
The invention relates to the technical field of data processing, in particular to a method, a terminal and a storage medium for electrocardiogram data compression.
Background
Stream data is a set of sequential, large, fast, continuous arriving data sequences. In general, streaming data may be viewed as a dynamic collection of data that grows indefinitely over time. For example: in the medical field, the dynamic electrocardiogram is a common clinical screening and disease monitoring means for cardiovascular diseases, and an important diagnosis evaluation basis is obtained by continuously recording electrocardiosignals of patients. In order to prolong the endurance time of equipment and realize long-time signal stable electrocardio monitoring, an electrocardio real-time monitoring system needs to mainly consider the problem of power consumption control. The communication power consumption occupies a larger proportion in the total power consumption of the dynamic electrocardiogram monitoring system, and if the power consumption required by electrocardiogram compression is far less than the communication power consumption required by electrocardiogram data transmission, the integral power consumption reduction multiple of the system is in direct proportion to the compression ratio.
The higher the compression rate, the lower the storage space requirement for the same set of stream data. However, in the conventional methods for compressing stream data, the compression rate is not high enough.
Disclosure of Invention
The embodiment of the invention provides a method, a terminal and a storage medium for electrocardiogram data compression, which aim to solve the problem of low compression rate.
In a first aspect, an embodiment of the present invention provides a method for compressing electrocardiographic data, including:
performing piecewise fitting on the electrocardiogram data according to a set error to obtain a plurality of line segment sets, and a starting point abscissa set Hs, an end point abscissa set He, a starting point ordinate set Vs and an end point ordinate set Ve of each line segment; wherein each ordinate in the starting point ordinate set Vs and the end point ordinate set Ve is represented by a data interval;
compressing the starting point ordinate set Vs, and determining an updated set Vs of the starting point ordinate according to the starting point ordinate compression result Gvs*(ii) a Wherein the set Vs is updated*Each ordinate is represented by a numerical value;
based on the update set Vs*And obtaining an updated ordinate upper bound DD by the starting point abscissa set HsUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLPerforming line segment fitting to obtain a slope set KK of a segmented line segment or an updated set Ve' of a terminal vertical coordinate;
according to the update set Vs*And determining compression information by the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate so as to represent the compressed electrocardiogram data.
In a possible implementation, Vs is set according to the update set*Generating a compressed record by the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate, and comprising:
compressing the updated set Ve' of the end point vertical coordinate to obtain a compression result Gve of the end point vertical coordinate;
with the updated set Vs*The start-point abscissa set Hs, the end-point abscissa set He, and the compression result Gve of the end-point ordinate are compression information.
In a possible implementation, Vs is set according to the update set*Generating a compressed record by the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate, and comprising:
compressing the slope set KK of the segment line segment to obtain a compression result Gkk of the slope;
with the updated set Vs*The start-point abscissa set Hs, the end-point abscissa set He, and the compression result Gkk of the slope as compression information.
In one possible implementation, compressing the starting point ordinate set Vs includes:
determining a first conversion coefficient according to two adjacent vertical coordinates, and determining an updating interval according to the first conversion coefficient;
when a plurality of updating intervals are available, determining a second conversion coefficient according to two adjacent updating intervals, and determining a re-updating interval according to the second conversion coefficient;
ending the compression when the re-updating interval is one, and combining the first conversion coefficient and the second conversion coefficient to be used as a vertical coordinate compression result Gvs; wherein the second conversion coefficient includes one or more.
In one possible implementation, the relationship between the end values of the two ordinates and the first conversion coefficient is as follows:
Figure BDA0003134151560000031
wherein the content of the first and second substances,d iandd i+1left end point as ordinate;
Figure BDA0003134151560000032
and
Figure BDA0003134151560000033
right end point of ordinate; b is the first conversion coefficient; i is an odd number; i is more than or equal to 1 and less than or equal to m1
Figure BDA0003134151560000034
l1Is the current decomposition level; and n is the number of original data.
In a possible implementation manner, the left endpoint of the update interval is:
d=max{d i-b,d i+1+b}
wherein the content of the first and second substances,dis the left end point of the update interval;d iandd i+1left end point as ordinate;
Figure BDA0003134151560000035
and
Figure BDA0003134151560000036
right end point of ordinate; b is the first conversion coefficient; i is an odd number; i is more than or equal to 1 and less than or equal to m1
Figure BDA0003134151560000037
l1Is the current decomposition level; n is the number of original data;
the right endpoint of the update interval is:
Figure BDA0003134151560000038
wherein the content of the first and second substances,
Figure BDA0003134151560000039
is the right end point of the updating interval;dis the left end point of the update interval;d iandd i+1left end point as ordinate;
Figure BDA00031341515600000310
and
Figure BDA00031341515600000311
right end point of ordinate; b is the first conversion coefficient; i is an odd number; i is more than or equal to 1 and less than or equal to m1
Figure BDA00031341515600000312
l1Is the current decomposition level; and n is the number of original data.
In one possible implementation, the updated set of start point ordinates Vs is determined from the start point ordinate compression results Gvs*The method comprises the following steps:
starting from the second stage of the compression result Gvs, obtaining the conversion coefficient corresponding to the current stage and the decompression result of the previous stage;
and determining the decompression result of the current stage number based on the conversion coefficient corresponding to the current stage number and the decompression result of the previous stage number.
In a possible implementation, the updating set Vs is based on*And obtaining an updated ordinate upper bound DD by the starting point abscissa set HsUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLPerforming line segment fitting, including:
based on the update set Vs*And obtaining an updated ordinate upper bound DD by the starting point abscissa set HsUAnd lower boundary DDL
For the updated ordinate upper bound DDUAnd lower boundary DDLA line segment fit is performed and an updated set Ve' of end point ordinates is determined.
In a possible implementation manner, the performing piecewise fitting on the electrocardiographic data according to the set error to obtain a plurality of line segment sets includes:
constructing a plurality of data intervals according to the plurality of data points of the electrocardiogram data and the set error, and representing each data point in the electrocardiogram data based on the data intervals; wherein the set error comprises an upper error limit and a lower error limit;
determining an upper limit straight line, a lower limit straight line, an upper convex shell and a lower convex shell from the first data point and the adjacent data points;
determining a line segment in a data interval corresponding to a data point to be fitted, and updating the upper limit straight line, the lower limit straight line, the upper convex hull and the lower convex hull based on the data point to be fitted when the line segment intersects with the upper limit straight line or the lower limit straight line; and determining a line segment in a data interval corresponding to the data point to be fitted, wherein the line segment does not have an intersection point with the upper limit straight line or the lower limit straight line, and when the data point to be fitted is out of the range of the upper limit straight line and the lower limit straight line, the data point to be fitted is determined as a line segment terminal point.
In one possible implementation, determining the upper limit straight line, the lower limit straight line, the upper convex hull and the lower convex hull includes:
determining an upper limit value and an upper limit value of the first data point and the second data point;
determining the upper limit straight line based on the lower limit value of the first data point and the upper limit value of the second data point;
determining the lower limit straight line based on the upper limit value of the first data point and the lower limit value of the second data point;
determining the lower convex hull based on the upper limit value of the first data point and the upper limit value of the second data point;
determining the convex hull based on the lower bound of the first data point and the lower bound of the second data point.
In a second aspect, an embodiment of the present invention provides an apparatus for compressing electrocardiographic data, including:
the fitting module is used for performing segmented fitting on the electrocardiogram data according to the set error to obtain a plurality of line segment sets, and a starting point abscissa set Hs, an end point abscissa set He, a starting point ordinate set Vs and an end point ordinate set Ve of each line segment; wherein each ordinate in the starting point ordinate set Vs and the end point ordinate set Ve is represented by a data interval;
an obtaining module, configured to compress the starting point ordinate set Vs, and determine an update set Vs of the starting point ordinate according to a starting point ordinate compression result Gvs*(ii) a Wherein the set Vs is updated*Each ordinate is represented by a numerical value;
the fitting module is further configured to update the set Vs*And obtaining an updated ordinate upper bound DD by the starting point abscissa set HsUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLPerforming line segment fitting to obtain a slope set KK of a segmented line segment or an updated set Ve' of a terminal vertical coordinate;
a determination module for determining the set of updates Vs*The set of start abscissa Hs and the set of end abscissa He, andand determining compression information by the slope set KK of the subsection line segment or the updating set Ve' of the end point vertical coordinate, so as to represent the compressed electrocardiogram data.
In a third aspect, an embodiment of the present invention provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect or any possible implementation manner of the first aspect when executing the computer program.
In a fourth aspect, the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the method according to the first aspect or any one of the possible implementation manners of the first aspect.
The embodiment of the invention provides a method, a terminal and a storage medium for compressing electrocardiogram data, which are used for carrying out piecewise fitting on the electrocardiogram data according to set errors to obtain a plurality of line segment sets, determining a starting point abscissa set Hs, an end point abscissa set He, a starting point ordinate set Vs and an end point ordinate set Ve of each line segment, and reducing the number of data points stored in the storage process through line segment fitting. Compressing the starting point ordinate set Vs and determining an updated set of starting point ordinates Vs from the starting point ordinate compression result Gvs*Based on the update set Vs*And obtaining an updated ordinate upper bound DD by the starting point abscissa HsUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLPerforming line segment fitting to obtain a slope set KK of the segment line segment or an updated set Ve' of the end point vertical coordinate according to the updated set Vs*And determining compression information by using the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate, so as to represent the compressed electrocardiogram data. In order to improve the compression efficiency, in the process of recompressing the data after the line segment fitting, the starting point ordinate set Vs is compressed and decompressed, the starting point ordinate of the line segment is updated, and the recompression is performed again based on the updated dataAnd fitting the line segment, and then completing the compression process to obtain the compressed data stream. The electrocardio data compression method provided by the invention is subjected to multiple times of compression, and the data compression rate is high.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1a is a schematic diagram of a data point distribution of streaming data in one embodiment;
FIG. 1b is a schematic diagram of a data point distribution of stream data in another embodiment;
FIG. 2 is a schematic flow chart of a method for compressing electrocardiographic data according to an embodiment of the present invention;
FIG. 3 is a diagram of an exemplary embodiment based on an optimal discontinuity L-a schematic representation of the results of the PCA algorithm compressing the streaming data;
FIG. 4 is a diagram illustrating the results of compression based on the method for compressing electrocardiographic data according to the embodiment of the present invention;
FIG. 5 is a diagram illustrating the result of compressing the set of start and end point ordinates Vsve of stream data based on the F-Shift compression algorithm in another embodiment;
FIG. 6 is a diagram illustrating the result of compressing the vertical coordinate set Vs of the starting point of the stream data based on the F-Shift compression algorithm in another embodiment;
FIG. 7 is a diagram illustrating the result of compressing the set of end point ordinates Ve of stream data based on the F-Shift compression algorithm in another embodiment;
FIG. 8 is a schematic structural diagram of an apparatus for compressing electrocardiographic data according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following description is made by way of specific embodiments with reference to the accompanying drawings.
The compression method is a streaming data-oriented compression technology, aims to ensure that the error of each data point is within a given range, can improve the compression rate and ensure the precision of subsequent query, and belongs to qualitative compression.
Qualitative compression means that the error between the compressed data estimate and the original data value is less than a given value (in a given metric space). For example: the most common compression is in the metric space L2And LThe above.
Wherein the mean error is compressed, i.e. L2The measurement is mainly to make the integral average error between the compressed data estimation value and the original data value, i.e. Euclidean distance, less than a predetermined critical value.
Maximum error compression, i.e. LThe metric, which is mainly to make the error of each data point smaller than a given critical value, improves the compression quality, and therefore, the maximum error compression algorithm is also called quality guarantee compression.
At L2Spatial mean error compression generally does not guarantee the quality of the analysis results based on the compression summary, because mean error compression is measured by the global properties of the compressed data, or on a fixed window basis, e.g. the average error of a given magnitude and mean error compression in quantitative compression, whereas global properties do not match the continuous, infinite properties of the stream data. And at LSpatial maximum error compression controls the error of each data point, hence, the pairEach data point is guaranteed quality, and the method is more suitable for flow data and approximate data calculation.
From the viewpoint of a construction method, the stream data compression method may be classified into a hierarchical compression method and a non-hierarchical compression method.
The hierarchical compression method is mainly an algorithm of wavelet decomposition, and a compression algorithm based on Shift transformation, for example: an F-Shift compression algorithm, an S + -Shift compression algorithm, etc.
The non-hierarchical compression method mainly comprises a Piecewise Constant Approximation (PCA) algorithm, a Piecewise Linear Approximation (PLA) algorithm, and a PCA algorithm with a bounded maximum error, namely LPCA algorithm, etc. The PLA algorithm is divided into a continuous segmented PLA algorithm and a discontinuous segmented PLA algorithm. The compression rate is lower and needs to be further improved by only adopting a hierarchical compression algorithm or a non-hierarchical compression algorithm to perform data compression. Both the hierarchical compression algorithm and the non-hierarchical compression algorithm have certain adaptability, and the hierarchical compression algorithm can obtain better compression ratio for data types with small data value change and flat data overall change trend. And the non-hierarchical compression algorithm can obtain better compression rate for the streaming data with obvious change trend on the whole. As shown in fig. 1a and 1b, the black dots represent the raw data, and the white dots represent the upper and lower bounds of the error range. For the stream data with flat overall variation trend and smaller numerical variation in fig. 1a, the compression is more suitable for the hierarchical compression algorithm. As shown in fig. 1b, the overall data trend is obvious, wherein the overall trend is not limited to three data points, but only three data points are used to illustrate that the overall trend is obvious, and the display of subsequent data points is omitted. Compared with fig. 1a, the data transformation in fig. 1b has a clear trend, and is more suitable for compression by a non-hierarchical compression algorithm.
The method provided by the invention is mainly used for compressing the data which has small numerical value change and is in a fluctuation state continuously based on the advantages of a hierarchical compression algorithm or a non-hierarchical compression algorithm so as to improve the data compression rate. For example: the compression of data types such as electrocardiosignals, electroencephalogram signals, stock data in the financial field, environmental monitoring data and the like is realized. In the field of wireless sensor networks, each sensor node continuously collects surrounding data and forms sensor stream data by taking environmental monitoring data as an example. The energy carried by each sensor is quite limited, with about 80% of the energy being consumed in the data transmission process. Therefore, how to compress the collected streaming data is important to reduce energy consumption by reducing the data volume sent by the nodes and to prolong the service life of the whole wireless sensor network.
The embodiment of the invention mainly explains the method provided by the invention by compressing the electrocardiosignals, and can be used in the fields of compression of electroencephalogram signals, stock data in the financial field and environmental monitoring data, and compression of other data with similar characteristics.
The electrocardiosignal is mainly obtained in a dynamic electrocardiogram form. The dynamic electrocardiogram is a clinical common cardiovascular disease screening means, and by recording continuous electrocardiosignals of a suspicious patient for more than 24 hours in a natural living state, arrhythmia events and ST segment abnormal changes which are difficult to find by the conventional electrocardiogram are found, so that an important diagnosis evaluation basis is obtained.
The real-time maximum error bounded data compression of the electrocardiosignals can greatly reduce the data volume to be sent, and can bring the advantages of reducing the storage space, reducing the communication bandwidth, reducing the communication power consumption and the like on the premise of not influencing the query analysis result, so that the reduction of the communication power consumption by the real-time compression of the electrocardio data is an effective means for reducing the overall power consumption of the dynamic electrocardio monitoring system.
The compression process of the embodiment of the invention mainly adopts the optimal discontinuous L in the discontinuous segmented PLA algorithmPLA algorithm, OptimalPLR algorithm, combined with F-Shift algorithm to realize data compression. Other hierarchical compression algorithms or non-hierarchical compression algorithms may be used during the course of a particular embodiment.
The following description is made with respect to the OptimalPLR algorithm and the F-Shift algorithm.
The data compression by adopting the OptimalPLR algorithm comprises the following steps: an initialization phase, a compression phase and a decompression phase.
Wherein, in an initialization stageSegment, setting the lower limit of error of each point
Figure BDA0003134151560000091
And upper limit of error
Figure BDA0003134151560000092
Converting the original stream data D to { D }1,d2,d3…dnEvery point in (d)j(1. ltoreq. j. ltoreq.n) is represented by a data interval, i.e.
Figure BDA0003134151560000101
The upper bound set of data intervals can be represented as
Figure BDA0003134151560000102
The lower bound set of data intervals can be represented as
Figure BDA0003134151560000103
Let p bejRepresenting the original data point, i.e. pj=(xj,yj)=(j,dj) (ii) a Order to
Figure BDA0003134151560000104
Representing the original data point pjUpper bound data points of, i.e.
Figure BDA0003134151560000105
Order top jRepresenting the original data point pjLower bound data points, i.e.
Figure BDA0003134151560000106
x represents an abscissa axis and y represents an ordinate axis.
In the compression stage, the upper and lower boundaries of the slope of each segment line segment and the position of the passing point are calculated, meanwhile, the horizontal coordinate and the vertical coordinate of the starting point and the end point can be calculated, and then each segment line segment is instantiated.
First, we start with generating the first piecewise line segment. Generating a first piecewise linear segment from a first data point p of the stream data1=(x1,y1) Second data point p2=(x2,y2) Initialization is started. Order to
Figure BDA0003134151560000107
Figure BDA0003134151560000108
Lower limit straight line, i.e. straight line
Figure BDA0003134151560000109
Slope of (a) is a rate
Figure BDA00031341515600001010
Upper limit straight line, i.e. straight line
Figure BDA00031341515600001011
Has a slope of
Figure BDA00031341515600001012
The lower convex shell is
Figure BDA00031341515600001013
I.e. lower convex hull by point
Figure BDA00031341515600001014
And point
Figure BDA00031341515600001015
The connecting line of (1); the upper convex shell is
Figure BDA00031341515600001016
I.e. upward convex hull by point bpAnd point cpThe connection line of (1). Judging whether the lower limit straight line needs to be updated or not according to the position of the next point p ═ x, y
Figure BDA00031341515600001017
Straight line of upper limit
Figure BDA00031341515600001018
And the value of the convex hull, andand (6) adjusting. Up to line segment
Figure BDA00031341515600001019
In a straight line
Figure BDA00031341515600001020
And a straight line
Figure BDA00031341515600001021
Outer part of (i.e. y)<l(x-xa)+yauOr y>u(x-xb)+yblAt this point, the first piecewise line segment may be obtained.
The abscissa of the starting position of the first segment is Hs 11, abscissa He of end position1The upper bound of the slope is
Figure BDA00031341515600001022
Lower bound of slope is
Figure BDA00031341515600001023
Passing point is poI.e. straight line
Figure BDA00031341515600001024
And a straight line
Figure BDA00031341515600001025
Point of intersection po=(xo,yo). While utilizing the upper bound of slope
Figure BDA00031341515600001026
And point poThe corresponding linear equation can be obtained according to the abscissa Hs of the starting point position1And the abscissa He of the end position1Can respectively calculate the horizontal coordinate Hs1Ordinate of (c)
Figure BDA0003134151560000111
And He1Ordinate value of
Figure BDA0003134151560000112
Similarly, using the lower bound of slope
Figure BDA0003134151560000113
And point poCan respectively calculate the horizontal coordinate Hs1Ordinate of (c)
Figure BDA0003134151560000114
And He1Ordinate value of
Figure BDA0003134151560000115
Next, a second piecewise line segment is generated based on the above process.
Then, the upper and lower bounds of the slope of each segment line segment are taken
Figure BDA0003134151560000116
Any value in the segment is used as the slope of the instantiated segment, and the segment passes through the intersection point p obtained by each segmentoIn this manner, each piecewise segment may be instantiated.
Wherein, whether the lower limit straight line needs to be updated or not is judged
Figure BDA0003134151560000117
Straight line of upper limit
Figure BDA0003134151560000118
And the value of the convex shell, and the adjustment is as follows:
when line segment
Figure BDA0003134151560000119
In a straight line
Figure BDA00031341515600001110
And a straight line
Figure BDA00031341515600001111
If p has an upper limit internally or at least at the intersection with a straight line
Figure BDA00031341515600001112
In a straight line
Figure BDA00031341515600001113
And a straight line
Figure BDA00031341515600001114
Inside, then the upper limit straight line and the lower convex shell are updatedcvx(ii) a If the lower limit of ppIn a straight line
Figure BDA00031341515600001115
And a straight line
Figure BDA00031341515600001116
Inside, the lower limit straight line and the upper convex shell are updated
Figure BDA00031341515600001117
Wherein the line segments
Figure BDA00031341515600001118
In a straight line
Figure BDA00031341515600001119
And a straight line
Figure BDA00031341515600001120
Internally or at least with one straight line, when the following formula (1) holds:
l(x-xa)+yau≤y≤u(x-xb)+ybl (1)
wherein, deltauIs the upper error bound, δ, of point plIs the lower error limit for point p.
Upper limit of p
Figure BDA00031341515600001121
In a straight line
Figure BDA00031341515600001122
And a straight line
Figure BDA00031341515600001123
Internally, when the following equation (2) holds:
Figure BDA00031341515600001124
lower limit of ppIn a straight line
Figure BDA00031341515600001125
And a straight line
Figure BDA00031341515600001126
Internally, when the following equation (3) holds:
p=y-δl>l(x-xa)+ya (3)
updating upper limit straight line and lower convex shellcvxThe method comprises the following steps:
from protruding shell
Figure BDA00031341515600001127
Find a point g in such a way that the slope
Figure BDA00031341515600001128
Minimum; then order bpG ═ g; then delete the upper convex shell
Figure BDA00031341515600001129
All points before the time point corresponding to the midpoint g; updating
Figure BDA00031341515600001130
Will be provided with
Figure BDA00031341515600001131
Inserted into the lower convex shellcvxEnding, and updating the lower convex shell by using triangle inspectioncvx
Updating lower convex shell by triangle inspectioncvxThe method comprises the following steps:
from lower convex shellcvxDistance p point of middle timeThe last three points are checked, and if the middle point is located at the upper part of the straight line formed by the other two points or on the straight line, the middle point is removed, and then the lower convex shell is sequentially checked backwardscvxAll points in the table are obtainedcvx(new)Finally order
Figure BDA0003134151560000121
The upper limit straight line is updated.
Updating lower limit straight line and upper convex shell
Figure BDA0003134151560000122
The method comprises the following steps:
from lower convex shellcvxA point g is found such that the slope (g,p) Maximum; then order
Figure BDA0003134151560000123
Then delete the lower convex shellcvxUpdating the slope of all points before the time point corresponding to the middle point g
Figure BDA0003134151560000124
Will be provided withpIs inserted into the upper convex shell
Figure BDA0003134151560000125
And updates the upwarp hull using triangulation
Figure BDA0003134151560000126
Updating the convex hull using triangulation
Figure BDA0003134151560000127
The method comprises the following steps:
from protruding shell
Figure BDA0003134151560000128
Starting the examination at three points with the middle time nearest to the point p, if the middle point is positioned at the lower part of the straight line formed by the other two points or on the straight line, removing the middle point, and then sequentially checking the upper convex hull backwards
Figure BDA0003134151560000129
All points in the table are obtained
Figure BDA00031341515600001210
Finally order cppAnd updating the lower limit straight line.
In the decompression phase, the slope and intersection point of each segment line segment are used to obtain the linear equation of the segment. By using the equation and according to the abscissa of the starting point and the ending point of each segment line segment, the ordinate corresponding to the position of all the time points in the segment can be obtained, and therefore, the reconstructed data can be obtained.
The data compression by adopting the F-Shift algorithm comprises the following steps: an initialization phase, a compression phase and a decompression phase.
Wherein, in the initialization stage, the lower limit of the error of each point is set
Figure BDA00031341515600001211
And upper limit of error
Figure BDA00031341515600001212
The original stream data, or called line vector D ═ D1,d2,d3…dn},n=2LeEach point in (Le. epsilon. N +) is represented by a data interval, i.e.
Figure BDA00031341515600001213
In the compression stage, the adjacent intervals are assumed to be
Figure BDA00031341515600001214
And
Figure BDA00031341515600001215
i is an odd number. Sequentially calculating two adjacent intervals to obtain an updated data interval
Figure BDA00031341515600001216
And a conversion coefficient b, and storing the data sectionThe conversion coefficient is a high frequency component. The specific calculation method is as follows:
when in use
Figure BDA00031341515600001217
When it is, then
Figure BDA00031341515600001218
When in use
Figure BDA00031341515600001219
And b is 0, wherein phi represents an empty set.
The end values of the data interval in the updated data interval are:
Figure BDA0003134151560000131
data interval to be updated
Figure BDA0003134151560000132
Stored in original row vectors
Figure BDA0003134151560000133
Where conversion coefficient b is stored in the original row vector
Figure BDA0003134151560000134
At the position of the air compressor, the air compressor is started,
Figure BDA0003134151560000135
l1representing the number of stages of the current decomposition, 1 ≦ l1≤Le。
And (3) compressing the newly generated low-frequency component part again to obtain a new low-frequency component and a new high-frequency component, calculating step by step until Le level is calculated, wherein only one data interval is left in the low-frequency component part at the moment, and any point in the optional interval is used as an approximate numerical value of the final data interval. The calculated coefficients of each stage may constitute a compression result, i.e., a compression coefficient combination row vector W.
Data ofThe reconstruction method comprises the following steps: let the compression coefficient combination row vector W be [ W1,w2,…,wn]The reconstruction formula at each level is:
Figure BDA0003134151560000136
Figure BDA0003134151560000137
in the formula (I), the compound is shown in the specification,
Figure BDA0003134151560000138
and
Figure BDA0003134151560000139
respectively storing reconstruction data with the positions of i and i +1 in the level row vector, wherein i is an odd number; when l is2When the number is equal to 1, the alloy is put into a container,
Figure BDA00031341515600001310
and
Figure BDA00031341515600001311
for the storage position in the original combined row vector is
Figure BDA00031341515600001312
And
Figure BDA00031341515600001313
the data of (c); when l is2>When the pressure of the mixture is 1, the pressure is lower,
Figure BDA00031341515600001314
and
Figure BDA00031341515600001315
respectively, the storage positions in the previous stage row vector
Figure BDA00031341515600001316
And
Figure BDA00031341515600001317
the data of (c);
Figure BDA00031341515600001318
l2number of stages representing current reconstruction, l 21,2, … Le. I 1,3, … m for each stage of reconstruction2-1。
For the intermediate result set of the optimal discontinuous PLA algorithm, namely the longitudinal coordinate values of the starting point and the end point are an interval, the set of the longitudinal coordinate values of the starting point interval and the end point interval can be compressed and then decompressed, but the line segments determined by the longitudinal coordinate values of the starting point and the end point determined by the decompressed values do not necessarily meet the maximum error requirement, so the invention provides a method for solving the problem to improve the data compression efficiency.
Referring to fig. 2, it shows a flowchart of an implementation of the method for compressing electrocardiographic data according to the embodiment of the present invention, which is detailed as follows:
in step S201, the electrocardiographic data is subjected to segment fitting according to the set error, and a plurality of segment sets, as well as a start-point abscissa set Hs, an end-point abscissa set He, a start-point ordinate set Vs, and an end-point ordinate set Ve of each segment are obtained. Wherein each ordinate in the starting point ordinate set Vs and the end point ordinate set Ve is represented by a data interval.
And compressing by adopting a non-hierarchical compression algorithm to obtain a fitted line segment set. Optionally, the non-hierarchical compression algorithm is PCA algorithm or L-PCA algorithm. Preferably, the non-hierarchical compression algorithm uses the optimal discontinuous LPLA algorithm, OptimalPLR algorithm, to control the error of each data point, reducing the data compression error.
In step S202, the starting point ordinate set Vs is compressed, and an updated set Vs of the starting point ordinate is determined from the starting point ordinate compression result Gvs*(ii) a Wherein the set Vs is updated*Each ordinate is represented by a numerical value.
With the above-mentioned optimum discontinuity LThe specific compression process of the PLA algorithm is known, in order to improve the compression ratioIn the process, an intermediate result set of the optimal discontinuous PLA, that is, a starting point ordinate and an end point ordinate are an interval, and we can compress the set of the interval of the starting point ordinate and the interval of the end point ordinate. When the data is decompressed again in the data restoring process, although the ordinate restoring values of the starting point and the end point of the line segment can be ensured to be within the error range, the segment segments obtained by connecting the reconstruction points cannot ensure that the reconstruction error of each point is within a given range. Therefore, in the embodiment of the present invention, the start-point ordinate set Vs is compressed first, and the end-point ordinate is not compressed temporarily.
In step S203, based on the update set Vs*And obtaining an updated ordinate upper bound DD by the starting point abscissa HsUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLAnd (5) performing line segment fitting to obtain a slope set KK of the segmented line segment or an updated set Ve' of the end point vertical coordinate.
After the start point ordinate is compressed and reconstructed in step S202, the reconstructed start point ordinate error is smaller than the set error, and then the position of the start point of each segment is fixed, and segment fitting is performed again, so that the ordinate range of the end point of each segment can be reduced, and it is ensured that the reconstruction error of each point in the segment obtained by connecting the reconstructed points is within the given range.
In step S204, Vs is updated according to the updated set*And determining compression information by using the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate, so as to represent the compressed electrocardiogram data.
As shown in fig. 1a, the compressed line segment includes a diagonal line. Storage update set Vs*A start abscissa set Hs, an end abscissa set He and a slope set KK of the segment, or an update set Vs is stored*The start point abscissa set Hs, the end point abscissa set He and the end point ordinate update set Ve' can all obtain segment segments.
According to the embodiment of the invention, the electrocardio data is subjected to piecewise fitting according to the set error to obtainAnd a plurality of line segment sets are used for determining a starting point abscissa set Hs, an end point abscissa set He, a starting point ordinate set Vs and an end point ordinate set Ve of each line segment, and the number of data points stored in the storage process is reduced through line segment fitting. Compressing the starting point ordinate set Vs and determining an updated set of starting point ordinates Vs from the starting point ordinate compression result Gvs*Based on the update set Vs*And obtaining an updated ordinate upper bound DD by the starting point abscissa HsUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLPerforming line segment fitting to obtain a slope set KK of the segment line segment or an updated set Ve' of the end point vertical coordinate according to the updated set Vs*And determining compression information by using the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate, so as to represent the compressed electrocardiogram data. In order to improve compression efficiency, in the process of recompressing the data after line segment fitting, a starting point ordinate set Vs is compressed and decompressed, the starting point ordinate of the line segment is updated, line segment fitting is performed again based on the updated data, and then the compression process is completed, so that compressed data flow is obtained. The electrocardio data compression method provided by the invention is subjected to multiple times of compression, and the data compression rate is high.
In different embodiments, the manner in which the information is determined to be compressed in step S204 is different.
In one possible implementation, step S204 includes:
s2041, compressing the updated set Ve' of the end point vertical coordinate to obtain a compression result Gve of the end point vertical coordinate.
Each ordinate in the update set Ve' is represented based on a data interval, and in a specific compression process, a hierarchical compression method is used, and optionally, a compression algorithm based on Shift transformation is used, for example: an F-Shift compression algorithm, an S + -Shift compression algorithm, etc. Preferably, the compression is based on the aforementioned F-Shift algorithm.
S2042, updating the set Vs*The starting point abscissa set Hs, the end point abscissa set He and the end point ordinateThe target compression result Gve serves as compression information.
In one possible implementation, step S204 includes:
s2043, compressing the slope set KK of the segment line segment to obtain a compression result Gkk of the slope.
Each ordinate in the update set Ve' is represented based on a data interval, and in a specific compression process, a hierarchical compression method is used, and optionally, a compression algorithm based on Shift transformation is used, for example: an F-Shift compression algorithm, an S + -Shift compression algorithm, etc. Preferably, the compression is based on the aforementioned F-Shift algorithm.
S2044, updating the set Vs*The start-point abscissa set Hs, the end-point abscissa set He, and the compression result Gkk of the slope as compression information.
The compression process compresses slope set KK to reduce the amount of data stored during the compression process. However, during the reconstruction process after data decompression, the slope set KK and the start-point ordinate update set Vs based on segment segments need to be executed*And determining the ordinate of the end point.
In one possible implementation manner, in step S202, compressing the starting point ordinate set Vs includes:
determining a first conversion coefficient according to two adjacent vertical coordinates, and determining an updating interval according to the first conversion coefficient;
when a plurality of updating intervals are available, determining a second conversion coefficient according to two adjacent updating intervals, and determining a re-updating interval according to the second conversion coefficient;
ending the compression when the re-updating interval is one, and combining the first conversion coefficient and the second conversion coefficient to be used as a vertical coordinate compression result Gvs; wherein the second conversion coefficient includes one or more.
In one possible implementation, the updated set of start point ordinates Vs is determined from the start point ordinate compression results Gvs*The method comprises the following steps:
starting from the second stage of the compression result Gvs, obtaining the conversion coefficient corresponding to the current stage and the decompression result of the previous stage;
and determining the decompression result of the current stage number based on the conversion coefficient corresponding to the current stage number and the decompression result of the previous stage number.
The specific decompression process may be a decompression process according to the F-shift algorithm.
In one possible implementation, determining the first conversion factor according to two adjacent ordinates includes:
when the intersection of two adjacent vertical coordinates is an empty set, determining a first conversion coefficient based on the end values of the two vertical coordinates;
and when the intersection of two adjacent vertical coordinates is an empty set, determining that the first conversion coefficient is zero.
In one possible implementation, the relationship between the end values of the two ordinates and the first conversion factor is as follows:
Figure BDA0003134151560000171
wherein the content of the first and second substances,d iandd i+1left end point as ordinate;
Figure BDA0003134151560000172
and
Figure BDA0003134151560000173
right end point of ordinate; b is a first conversion coefficient; i is an odd number; i is more than or equal to 1 and less than or equal to m1
Figure BDA0003134151560000174
l1Is the current decomposition level; and n is the number of original data.
In one possible implementation, the left endpoint of the update interval is:
d=max{d i-b,d i+1+b}
wherein the content of the first and second substances,dis the left end point of the update interval;d iandd i+1left end point as ordinate;
Figure BDA0003134151560000175
and
Figure BDA0003134151560000176
right end point of ordinate; b is a first conversion coefficient; i is an odd number; i is more than or equal to 1 and less than or equal to m1
Figure BDA0003134151560000177
l1Is the current decomposition level; and n is the number of original data.
The right end point of the update interval is:
Figure BDA0003134151560000178
wherein the content of the first and second substances,
Figure BDA0003134151560000179
is the right end point of the updating interval;dis the left end point of the update interval;d iandd i+1left end point as ordinate;
Figure BDA00031341515600001710
and
Figure BDA00031341515600001711
right end point of ordinate; b is the first conversion factor.
In particular, the data interval to be updated
Figure BDA0003134151560000181
Stored in original row vectors
Figure BDA0003134151560000182
Where conversion coefficient b is stored in the original row vector
Figure BDA0003134151560000183
At the position of the air compressor, the air compressor is started,
Figure BDA0003134151560000184
l1representing the number of stages of the current decomposition, 1 ≦ l1Le is less than or equal to. And only one data interval is left until Le level is calculated, and any point in the interval is selected as an approximate value of the final data interval. And the calculated coefficient combinations of all levels are used as the vertical coordinate compression result Wvs
In one possible implementation manner, in step S203, based on the update set Vs*And the starting point abscissa set Hs and the end point abscissa set He are subjected to line segment fitting, and the line segment fitting comprises the following steps:
based on the update set Vs*Updating the value of the corresponding data point in the electrocardiogram data with the starting point horizontal coordinate set Hs;
based on the update set Vs*And performing line segment fitting on the endpoint abscissa set He and values of other data points in the electrocardiogram data, and determining an updated set Ve' of the endpoint ordinate.
In a possible implementation manner, in step S201, the performing piecewise fitting on the electrocardiographic data according to the set error to obtain a plurality of line segment sets includes:
constructing a plurality of data intervals according to the plurality of data points of the electrocardiogram data and the set error, and representing each data point in the electrocardiogram data based on the data intervals; wherein the set error comprises an upper error limit and a lower error limit;
determining an upper limit straight line, a lower limit straight line, an upper convex shell and a lower convex shell from the first data point and the adjacent data points;
determining a line segment in a data interval corresponding to a data point to be fitted, and updating the upper limit straight line, the lower limit straight line, the upper convex hull and the lower convex hull based on the data point to be fitted when the line segment intersects with the upper limit straight line or the lower limit straight line; and determining a line segment in a data interval corresponding to the data point to be fitted, wherein the line segment does not have an intersection point with the upper limit straight line or the lower limit straight line, and when the data point to be fitted is out of the range of the upper limit straight line and the lower limit straight line, the data point to be fitted is determined as a line segment terminal point.
In some embodiments, determining the upper limit straight line, the lower limit straight line, the upper convex hull, and the lower convex hull comprises:
determining an upper limit value and an upper limit value of the first data point and the second data point;
determining the upper limit straight line based on the lower limit value of the first data point and the upper limit value of the second data point;
determining the lower limit straight line based on the upper limit value of the first data point and the lower limit value of the second data point;
determining the lower convex hull based on the upper limit value of the first data point and the upper limit value of the second data point;
determining the convex hull based on the lower bound of the first data point and the lower bound of the second data point.
The specific determination of the limit straight line, the lower limit straight line, the upper convex hull and the lower convex hull can be found in the above description with respect to the optimum discontinuity L-collective process of PLA algorithm.
The method is illustrated with a specific embodiment:
original stream data D ═ D1,d2,…d10Where {3,4,3,5,6,2.5,3.5,2.5,4.5,5.5}, the original stream data may be represented by a set of points P ═ { P }1,p2,…,p10Represents it. Each data point is a black dot in fig. 3, the upper and lower error limits are equal to 1, and the open dot represents the upper boundary of the original stream data point
Figure BDA0003134151560000191
And lower boundary pointp. Using the above-described non-hierarchical compression algorithm, for example: optimum discontinuity LThe PLA algorithm, i.e. the OptimalPLR algorithm, results in two piecewise line segments. An intermediate result of the compression process can be determined based on two piecewise line segments, the set of ordinates of the start of a line segment Vs ═ Vs1,vs2}={[2,3],[1.5,2.5]And, the set of line segment end point ordinates Ve ═ Ve1,ve2}={[5,6],[4.5,5.5]}. Wherein the ordinate and abscissa of the line segment are connectedAnd (4) data interval representation. For the OptimalPLR algorithm, only any segment in each segment needs to be stored at this time, assuming that the segment of the instantiated segment is p1 5pAnd a line segment p6 10pThen the set of vertical coordinates of the line segment to be stored is [ vs ]1,vs2,ve1,ve2]=[3,2.5,5,4.5]The abscissa of the line segment is set to [ hs ]1,hs2,he1,he2]=[1,6,5,10]At this time, the ordinate and abscissa of the line segment are represented by numerical values.
If the F-shift compression algorithm provided in the above embodiment is used to set VsVe { [2,3 ] of intermediate results Vs and Ve],[1.5,2.5],[5,6],[4.5,5.5]The compression ratio can be further improved by performing compression. As shown in fig. 5, originally for line segment p1 5pAnd a line segment p6 10pIn general, the ordinate needs to store 4 values [ vs ]1,vs2,ve1,vs2]=[3,2.5,5,4.5]After compression, 2 non-zero coefficients [3.5, -1.5 ] need to be stored]And (4) finishing. But from the reconstructed data [2,2,5 ]]To reconstruct two segment segments, e.g. the gray segment in fig. 3 1 5ppIt can be seen that p is in the first piecewise line segment2The point cannot satisfy that the reconstruction error is within a given range. Therefore, based on the gist of the method provided by the invention, the F-Shift compression and decompression can be adopted to ensure that each point can meet the error requirement.
Specifically, an intermediate result Vs ═ Vs { Vs } is obtained based on an OptimalPLR algorithm1,vs2}={[2,3],[1.5,2.5]},Ve={ve1,ve2}={[5,6],[4.5,5.5]After this, i.e. on the ordinate set Vs ═ Vs of the starting point of the line segment1,vs2}={[2,3],[1.5,2.5]The compression result of fig. 6 can be obtained by compressing with the F-shift compression algorithm. From fig. 6 it can be seen that 2 values vs originally need to be stored1=3,vs2After F-shift compression, only 1 nonzero coefficient 2.2 needs to be stored. Then decompression is carried out to obtain reconstructed data
Figure BDA0003134151560000201
Points shown in fig. 4
Figure BDA0003134151560000202
And
Figure BDA0003134151560000203
then, step S202 is executed, i.e., the
Figure BDA0003134151560000204
Replacement data points
Figure BDA0003134151560000205
And 1pordinate, using
Figure BDA0003134151560000206
Numerical replacement data points
Figure BDA0003134151560000207
And 6pand the vertical coordinate and the upper and lower boundary data points of other data points are unchanged, so that the starting point can be ensured to be fixed, and the finally obtained end point data range is further reduced. And the segment line segment after decompression is compressed, so that the reconstruction error of each point can be ensured to be within a given range. Next, step S203 is performed, in which the updated data is compressed again based on the OptimalPLR algorithm, and the result of FIG. 4 is obtained, in which the gray segments
Figure BDA0003134151560000208
And
Figure BDA0003134151560000209
upper and lower border line segments, respectively, of the first segment line segment, a grey line segment
Figure BDA00031341515600002010
And
Figure BDA00031341515600002011
respectively, an upper boundary line segment and a lower boundary line segment of the second piecewise line segment. At this timeThe set of vertical coordinates of the end point of each line segment is Vde ═ Vde1,vde2}={[5.4,5.8],[4.5,4.8]Comparing with fig. 3, it can be seen that the data range of the end point ordinate of each segment line is further reduced, so that it can be ensured that each segment instantiated after further compression and decompression on the basis of the data meets the requirement of reconstruction error. Step S204 is executed next, the newly obtained end point ordinate set Vde is further compressed to increase the compression rate, and the result shown in fig. 7 is obtained, and the compressed data obtained in this step is stored as compressed stream data.
The method provided by the foregoing embodiment is directed to compression of electrocardiographic data, and in a specific application, the reconstruction of data can be completed only by decompressing compressed data.
First, the ordinate compression result Gve ═ w is written1,w2,…,wn]Or Gkk ═ w1,w2,…,wn]Data reconstruction is performed based on the following reconstruction formula:
Figure BDA0003134151560000211
Figure BDA0003134151560000212
in the formula (I), the compound is shown in the specification,
Figure BDA0003134151560000213
and
Figure BDA0003134151560000214
respectively storing reconstruction data with the positions of i and i +1 in the level row vector, wherein i is an odd number; when l is2When the number is equal to 1, the alloy is put into a container,
Figure BDA0003134151560000215
and
Figure BDA0003134151560000216
for original combined row vectorThe middle storage position is
Figure BDA0003134151560000217
And
Figure BDA0003134151560000218
the data of (c); when l is2>When the pressure of the mixture is 1, the pressure is lower,
Figure BDA0003134151560000219
and
Figure BDA00031341515600002110
respectively, the storage positions in the previous stage row vector
Figure BDA00031341515600002111
And
Figure BDA00031341515600002112
the data of (c);
Figure BDA00031341515600002113
l2number of stages representing current reconstruction, l 21,2, … Le. I 1,3, … m for each stage of reconstruction2-1, after decompressing the L stages, the reconstructed data is available.
Decompressing the compression result obtained by the compression method of steps S2041 and S2042 to obtain an end-point ordinate decompression set
Figure BDA00031341515600002114
I.e. the vertical coordinate of the end point after decompression.
Then, the set Vs is updated according to the origin ordinate*End point ordinate decompression set Vde*The starting point abscissa set Hs and the end point abscissa set He can obtain a linear equation of each segment, and the linear equation can be used for obtaining the ordinate of each data point in each segment line segment, so that the final reconstruction data is obtained.
Decompressing the compression result obtained by the compression method of steps S2043 and S2044 to obtain a line segment slope decompression set
Figure BDA00031341515600002115
I.e. the slope of each segment after decompression.
Then, the set Vs is updated by the ordinate of the starting point*Segment slope decompression set KK*The starting point abscissa set Hs and the end point abscissa set He can obtain a linear equation of each segment, and the vertical coordinate of each data point in each segment line can be obtained by using the linear equation, so that the final reconstruction data is obtained.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
The following are embodiments of the apparatus of the invention, reference being made to the corresponding method embodiments described above for details which are not described in detail therein.
Fig. 8 is a schematic structural diagram of an apparatus for compressing electrocardiographic data according to an embodiment of the present invention, and for convenience of description, only the portions related to the embodiment of the present invention are shown, which is detailed as follows:
as shown in fig. 8, the apparatus for compressing electrocardiographic data includes: a fitting module 801, an acquisition module 802 and a determination module 803.
The fitting module 801 is configured to perform piecewise fitting on the electrocardiographic data according to the set error to obtain a plurality of segment sets, and a starting point abscissa set Hs, an end point abscissa set He, a starting point ordinate set Vs, and an end point ordinate set Ve of each segment; wherein each ordinate in the starting point ordinate set Vs and the end point ordinate set Ve is represented by a data interval.
An obtaining module 802, configured to compress the starting point ordinate set Vs, and determine an update set Vs of the starting point ordinate according to the starting point ordinate compression result Gvs*(ii) a Wherein the set Vs is updated*Each ordinate is represented by a numerical value.
A fitting module 801 for further updating the set Vs*And the abscissa Hs of the starting pointTo update the ordinate upper bound DDUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLAnd (5) performing line segment fitting to obtain a slope set KK of the segmented line segment or an updated set Ve' of the end point vertical coordinate.
A determining module 803 for determining the set Vs according to the updated set*And determining compression information by using the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate, so as to represent the compressed electrocardiogram data.
According to the embodiment of the invention, the electrocardio data is subjected to segment fitting according to the set error to obtain a plurality of segment sets, the starting point abscissa set Hs, the end point abscissa set He, the starting point ordinate set Vs and the end point ordinate set Ve of each segment are determined, and the number of data points stored in the storage process is reduced through segment fitting. Compressing the starting point ordinate set Vs and determining an updated set of starting point ordinates Vs from the starting point ordinate compression result Gvs*Based on the update set Vs*And obtaining an updated ordinate upper bound DD by the starting point abscissa HsUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLPerforming line segment fitting to obtain a slope set KK of the segment line segment or an updated set Ve' of the end point vertical coordinate according to the updated set Vs*And determining compression information by using the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate, so as to represent the compressed electrocardiogram data. In order to improve compression efficiency, in the process of recompressing the data after line segment fitting, a starting point ordinate set Vs is compressed and decompressed, the starting point ordinate of the line segment is updated, line segment fitting is performed again based on the updated data, and then the compression process is completed, so that compressed data flow is obtained. The electrocardio data compression method provided by the invention is subjected to multiple times of compression, and the data compression rate is high.
Fig. 9 is a schematic diagram of a terminal according to an embodiment of the present invention. As shown in fig. 9, the terminal 9 of this embodiment includes: a processor 90, a memory 91 and a computer program 92 stored in said memory 91 and executable on said processor 90. The processor 90, when executing the computer program 92, implements the steps in the above-described embodiments of the method for compressing electrocardiographic data, such as the steps S301 to S303 shown in fig. 3. Alternatively, the processor 90, when executing the computer program 92, implements the functions of each module/unit in each device embodiment described above, for example, the functions of the modules 801 to 803 shown in fig. 8.
Illustratively, the computer program 92 may be partitioned into one or more modules/units that are stored in the memory 91 and executed by the processor 90 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 92 in the terminal 9. For example, the computer program 92 may be divided into modules 801 to 803 shown in fig. 8.
The terminal 9 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal 9 may include, but is not limited to, a processor 90, a memory 91. It will be appreciated by those skilled in the art that fig. 9 is only an example of a terminal 9 and does not constitute a limitation of the terminal 9 and may comprise more or less components than those shown, or some components may be combined, or different components, for example the terminal may further comprise input output devices, network access devices, buses, etc.
The Processor 90 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 91 may be an internal storage unit of the terminal 9, such as a hard disk or a memory of the terminal 9. The memory 91 may also be an external storage device of the terminal 9, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) and the like provided on the terminal 9. Further, the memory 91 may also include both an internal storage unit and an external storage device of the terminal 9. The memory 91 is used for storing the computer program and other programs and data required by the terminal. The memory 91 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described apparatus/terminal embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method according to the above embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of the above embodiments of the method for compressing electrocardiographic data. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A method for compression of electrocardiographic data, comprising:
performing piecewise fitting on the electrocardiogram data according to a set error to obtain a plurality of line segment sets, and a starting point abscissa set Hs, an end point abscissa set He, a starting point ordinate set Vs and an end point ordinate set Ve of each line segment; wherein each ordinate in the starting point ordinate set Vs and the end point ordinate set Ve is represented by a data interval;
compressing the vertical coordinate set Vs of the starting point and according to the starting pointThe point ordinate compression result Gvs determines an updated set of start point ordinates Vs*(ii) a Wherein the set Vs is updated*Each ordinate is represented by a numerical value;
based on the update set Vs*And obtaining an updated ordinate upper bound DD by the starting point abscissa HsUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLPerforming line segment fitting to obtain a slope set KK of a segmented line segment or an updated set Ve' of a terminal vertical coordinate;
according to the update set Vs*And determining compression information by the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate so as to represent the compressed electrocardiogram data.
2. The method according to claim 1, wherein Vs is selected from the updated set*Generating a compressed record by the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate, and comprising:
compressing the updated set Ve' of the end point vertical coordinate to obtain a compression result Gve of the end point vertical coordinate;
with the updated set Vs*The start-point abscissa set Hs, the end-point abscissa set He, and the compression result Gve of the end-point ordinate are compression information.
3. The method according to claim 1, wherein Vs is selected from the updated set*Generating a compressed record by the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point ordinate, and comprising:
compressing the slope set KK of the segment line segment to obtain a compression result Gkk of the slope;
with the updated set Vs*The starting point abscissa set Hs and the end point abscissa setThe compression result Gkk of He and slope is combined as compression information.
4. The method according to claim 1, wherein compressing the set of start point ordinates Vs comprises:
determining a first conversion coefficient according to two adjacent vertical coordinates, and determining an updating interval according to the first conversion coefficient;
when a plurality of updating intervals are available, determining a second conversion coefficient according to two adjacent updating intervals, and determining a re-updating interval according to the second conversion coefficient;
ending the compression when the re-updating interval is one, and combining the first conversion coefficient and the second conversion coefficient to be used as a vertical coordinate compression result Gvs; wherein the second conversion coefficient includes one or more.
5. The method of claim 4, wherein the updated set of start point ordinates Vs is determined from the start point ordinate compression results Gvs*The method comprises the following steps:
starting from the second stage of the compression result Gvs, obtaining the conversion coefficient corresponding to the current stage and the decompression result of the previous stage;
and determining the decompression result of the current stage number based on the conversion coefficient corresponding to the current stage number and the decompression result of the previous stage number.
6. The method according to claim 1, wherein the updating Vs is based on the set of updates*And obtaining an updated ordinate upper bound DD by the starting point abscissa HsUAnd lower boundary DDLFor said updated ordinate upper bound DDUAnd lower boundary DDLPerforming line fitting to perform line fitting, including:
based on the update set Vs*Updating the value of the corresponding data point in the electrocardiogram data with the starting point abscissa set Hs to obtain an updated ordinate upper bound DDUAnd lower boundary DDL
For the updated ordinate upper bound DDUAnd lower boundDDLA line segment fit is performed and an updated set Ve' of end point ordinates is determined.
7. The method of claim 1, wherein the step of performing piecewise fitting on the electrocardiographic data according to the set error to obtain a plurality of line segment sets comprises:
constructing a plurality of data intervals according to the plurality of data points of the electrocardiogram data and the set error, and representing each data point in the electrocardiogram data based on the data intervals; wherein the set error comprises an upper error limit and a lower error limit;
determining an upper limit straight line, a lower limit straight line, an upper convex shell and a lower convex shell from the first data point and the adjacent data points;
determining a line segment in a data interval corresponding to a data point to be fitted, and updating the upper limit straight line, the lower limit straight line, the upper convex hull and the lower convex hull based on the data point to be fitted when the line segment intersects with the upper limit straight line or the lower limit straight line; and determining a line segment in a data interval corresponding to the data point to be fitted, wherein the line segment does not have an intersection point with the upper limit straight line or the lower limit straight line, and when the data interval is out of the range of the upper limit straight line and the lower limit straight line, the previous data point of the data point to be fitted is determined as a line segment terminal point.
8. The method of claim 7, wherein determining an upper limit line, a lower limit line, an upper convex hull, and a lower convex hull comprises:
determining an upper limit value and an upper limit value of the first data point and the second data point;
determining the upper limit straight line based on the lower limit value of the first data point and the upper limit value of the second data point;
determining the lower limit straight line based on the upper limit value of the first data point and the lower limit value of the second data point;
determining the lower convex hull based on the upper limit value of the first data point and the upper limit value of the second data point;
determining the convex hull based on the lower bound of the first data point and the lower bound of the second data point.
9. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of the preceding claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202110714142.4A 2021-06-25 2021-06-25 Method, terminal and storage medium for electrocardiogram data compression Withdrawn CN113381766A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110714142.4A CN113381766A (en) 2021-06-25 2021-06-25 Method, terminal and storage medium for electrocardiogram data compression
CN202111031852.3A CN113644917B (en) 2021-06-25 2021-09-03 Method, terminal and storage medium for electroencephalogram and electrocardio data compression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110714142.4A CN113381766A (en) 2021-06-25 2021-06-25 Method, terminal and storage medium for electrocardiogram data compression

Publications (1)

Publication Number Publication Date
CN113381766A true CN113381766A (en) 2021-09-10

Family

ID=77579295

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202110714142.4A Withdrawn CN113381766A (en) 2021-06-25 2021-06-25 Method, terminal and storage medium for electrocardiogram data compression
CN202111031852.3A Active CN113644917B (en) 2021-06-25 2021-09-03 Method, terminal and storage medium for electroencephalogram and electrocardio data compression

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202111031852.3A Active CN113644917B (en) 2021-06-25 2021-09-03 Method, terminal and storage medium for electroencephalogram and electrocardio data compression

Country Status (1)

Country Link
CN (2) CN113381766A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113872607A (en) * 2021-09-29 2021-12-31 河北省科学院应用数学研究所 Quality-guaranteeing compression method and device for physiological monitoring data and terminal equipment
CN115310038A (en) * 2022-10-11 2022-11-08 北京中科心研科技有限公司 PLA-based real-time physiological data processing method, device, storage medium and system
CN116418349A (en) * 2023-03-07 2023-07-11 东华大学 Sequence data compression method, device and system based on maximum error criterion

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102006047994A1 (en) * 2006-10-10 2008-04-17 Rohde & Schwarz Gmbh & Co. Kg Method and apparatus for displaying ordinate-abscissa value pairs on a display device
CN101807925B (en) * 2010-02-08 2013-01-30 江苏瑞中数据股份有限公司 Historical data compression method based on numerical ordering and linear fitting
CN102437854B (en) * 2011-11-03 2014-03-26 电子科技大学 Industrial real-time data compression method with high compression ratio
CN103795419B (en) * 2014-01-27 2017-08-04 宁波良和路桥科技有限公司 A kind of piecewise linearity compression method of Wave data Real Time Compression
CN108073138B (en) * 2016-11-08 2020-08-11 沈阳高精数控智能技术股份有限公司 Elliptical arc smooth compression interpolation algorithm suitable for high-speed high-precision machining
CN107994906A (en) * 2017-08-01 2018-05-04 河北省科学院应用数学研究所 One kind is based on L∞The semicontinuous optimal segmentation linear approximation method of criterion
CN110007854A (en) * 2019-02-21 2019-07-12 湖南大唐先一科技有限公司 One kind being based on time series data compression method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113872607A (en) * 2021-09-29 2021-12-31 河北省科学院应用数学研究所 Quality-guaranteeing compression method and device for physiological monitoring data and terminal equipment
CN113872607B (en) * 2021-09-29 2022-06-28 河北省科学院应用数学研究所 Quality-guaranteeing compression method and device for physiological monitoring data and terminal equipment
CN115310038A (en) * 2022-10-11 2022-11-08 北京中科心研科技有限公司 PLA-based real-time physiological data processing method, device, storage medium and system
CN116418349A (en) * 2023-03-07 2023-07-11 东华大学 Sequence data compression method, device and system based on maximum error criterion
CN116418349B (en) * 2023-03-07 2024-01-26 东华大学 Sequence data compression method, device and system based on maximum error criterion

Also Published As

Publication number Publication date
CN113644917A (en) 2021-11-12
CN113644917B (en) 2022-06-07

Similar Documents

Publication Publication Date Title
CN113644917B (en) Method, terminal and storage medium for electroencephalogram and electrocardio data compression
US9118345B2 (en) Data compression profiler for configuration of compression
US8055095B2 (en) Parallel and adaptive signal processing
CN102597948B (en) The method and apparatus of the block floating point compression of signal data
US8290295B2 (en) Multi-modal tone-mapping of images
CN113381767B (en) Method, terminal and storage medium for electrocardiogram data compression
CN108876733B (en) Image enhancement method, device, equipment and storage medium
US6697529B2 (en) Data compression method and recording medium with data compression program recorded therein
CN110620586B (en) Data compression method and device and terminal equipment
Li et al. Metaheuristic FIR filter with game theory based compression technique-A reliable medical image compression technique for online applications
CN103281537B (en) A kind of dynamic range of images compression method and device
CN110335276B (en) Medical image segmentation model, method, storage medium and electronic device
CN110139102B (en) Method, device, equipment and storage medium for predicting video coding complexity
CN117393116B (en) Medical image data transmission system and method of portable DR equipment
CN114863225A (en) Image processing model training method, image processing model generation device, image processing equipment and image processing medium
CN117542488B (en) Intelligent processing method for brain tumor CT data
CN113222856A (en) Inverse halftone image processing method, terminal equipment and readable storage medium
WO2023198150A1 (en) Data compression method for electroencephalogram data, chip, device, and storage medium
CN116095291A (en) Image preprocessing method for media stream image transmission
CN113288158B (en) Method, device and equipment for removing baseline drift and high-frequency noise
Arabboev et al. Development of a novel method of adaptive image interpolation for image resizing using artificial intelligence.
CN112383366B (en) Frequency spectrum monitoring method and device of digital fluorescence spectrum and storage medium
CN112102216B (en) Self-adaptive weight total variation image fusion method
CN113872607B (en) Quality-guaranteeing compression method and device for physiological monitoring data and terminal equipment
CN114118177A (en) Bit plane noise reduction method and system based on singular spectrum analysis and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20210910