Method, terminal and storage medium for electroencephalogram and electrocardio data compression

文档序号:1834391 发布日期:2021-11-12 浏览:8次 中文

阅读说明:本技术 用于脑电、心电数据压缩的方法、终端及存储介质 (Method, terminal and storage medium for electroencephalogram and electrocardio data compression ) 是由 黎彤亮 庞超逸 李晓云 赵环宇 范瑞琴 冯春雨 史玉盼 于 2021-09-03 设计创作,主要内容包括:本发明提供一种用于脑电、心电数据压缩的方法、终端及存储介质。该方法包括:根据设定误差对脑电心电数据进行分段拟合,获得多个线段集合,及每个线段的起点横坐标集合Hs、终点横坐标集合He、起点纵坐标集合Vs和终点纵坐标集合Ve;对起点纵坐标集合Vs进行压缩,并根据起点纵坐标压缩结果Gvs确定起点纵坐标的更新集合Vs~(*);基于更新集合Vs~(*)和起点横坐标Hs得到更新纵坐标上界DD~(U)和下界DD~(L),对更新纵坐标上界DD~(U)和下界DD~(L)进行线段拟合,获得分段线段的斜率集合KK或终点纵坐标的更新集合Ve';根据更新集合Vs~(*)、起点横坐标集合Hs和终点横坐标集合He,以及分段线段的斜率集合KK或终点纵坐标的更新集合Ve'确定压缩信息,以用于表示压缩后的脑电心电数据。本发明提高了数据压缩率。(The invention provides a method, a terminal and a storage medium for electroencephalogram and electrocardio data compression. The method comprises the following steps: performing segmented fitting on the electroencephalogram electrocardiograph 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; 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 * (ii) a Based on the set of updates Vs * Obtaining an updated ordinate upper bound DD from the origin abscissa Hs U And lower boundary DD L To update the ordinate upper bound DD U And lower boundary DD L Performing 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 * A set of start and end abscissas Hs and He, and a set of slopes for the piecewise line segmentsKK or an update set Ve' of the end point vertical coordinate determines compression information to be used for representing the compressed electroencephalogram and electrocardiograph data. The invention improves the data compression rate.)

1. A method for compressing electroencephalogram and electrocardiograph data is characterized by comprising the following steps:

performing segmented fitting on the electroencephalogram electrocardiograph 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;

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 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 the starting point horizontal coordinate set Hs, the end point horizontal coordinate set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point vertical coordinate determine compressed information so as to represent the compressed electroencephalogram and electrocardio 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 compression results of the starting point abscissa set Hs, the end point abscissa set He and the end point ordinateGve as compressed 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 start-point abscissa set Hs, the end-point abscissa set He, and the compression result Gkk of the slope 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 electroencephalogram electrocardio 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 boundary DDLA 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 electroencephalogram and 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 electroencephalogram and electrocardio data and the set error, and representing each data point in the electroencephalogram and electrocardio data based on the data interval; 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.

Technical Field

The invention relates to the technical field of data processing, in particular to a method, a terminal and a storage medium for electroencephalogram and 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, dynamic electroencephalograms and electrocardiograms are common clinical screening and disease monitoring means for cardiovascular diseases, and important diagnosis and evaluation basis is obtained by continuously recording electrocardiosignals and electroencephalogram signals of patients. In order to prolong the endurance time of equipment and realize the long-time electrocardio-electroencephalogram monitoring with stable signals, the electrocardio-electroencephalogram real-time monitoring system and the electroencephalogram real-time monitoring system need 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 electrocardio-electroencephalogram monitoring system, and if the power consumption required by electrocardio-electroencephalogram compression is far less than the communication power consumption required by transmitting electrocardio-electroencephalogram data and electroencephalogram data, 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 electroencephalogram and electrocardio data compression, and aims to solve the problem of low compression rate.

In a first aspect, an embodiment of the present invention provides a method for compressing electroencephalogram and electrocardiograph data, including:

performing segmented fitting on the electroencephalogram electrocardiograph 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;

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 the starting point horizontal coordinate set Hs, the end point horizontal coordinate set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point vertical coordinate determine compressed information so as to represent the compressed electroencephalogram and electrocardio data.

In one possible implementation, the rootAccording to the update set Vs*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:

wherein the content of the first and second substances,d iandd i+1left end point as ordinate;andright 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 m1l1Is 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;andright 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 m1l1Is the current decomposition level; n is the number of original data;

the right endpoint of the update interval is:

wherein the content of the first and second substances,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;andright 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 m1l1Is 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 segment fitting on the electroencephalogram and 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 electroencephalogram and electrocardio data and the set error, and representing each data point in the electroencephalogram and electrocardio data based on the data interval; 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 electroencephalogram and electrocardiograph data compression, including:

the fitting module is used for performing segmented fitting on the electroencephalogram and electrocardio 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*And the starting point horizontal coordinate set Hs, the end point horizontal coordinate set He, the slope set KK of the subsection line segment or the updating set Ve' of the end point vertical coordinate determine compressed information so as to represent the compressed electroencephalogram and electrocardio 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 compression of electroencephalogram and electrocardio data, which are obtained by performing segmented fitting on the electroencephalogram and electrocardio data according to a set errorAnd 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 by multiple line segment sets, and reducing the number of data points stored in the storage process by 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 compressed information by using the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection segment or the updating set Ve' of the end point ordinate, so as to represent the compressed electroencephalogram and electrocardio 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 electroencephalogram and 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 flow chart of a method for electroencephalogram and electrocardiograph data compression 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 result of compression based on the method for compressing electroencephalogram and electrocardiographic data according to the embodiment of the present invention in an embodiment;

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 electroencephalogram and electrocardiograph data compression 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. Particularly for compression processing of electroencephalogram data and electrocardio data, the method provided by the invention can improve the data storage efficiency, save the data storage space, ensure the accuracy of subsequent electroencephalogram data and electrocardio data query, and further improve the accuracy of executing other research and analysis processes or formulating treatment schemes according to the electroencephalogram data and the electrocardio data.

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 and is therefore guaranteed quality for each data point and more suitable for streaming data and approximation data calculations.

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 and a Piecewise linear Approximation (P)iecise Linear Approximation, PLA) algorithm, maximum error bounded PCA algorithm, i.e., 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 electroencephalogram and electrocardio data compression, and can be used in the fields of stock data and environmental monitoring data compression in the financial field and other data compression with similar characteristics.

The electroencephalogram and electrocardiogram data are mainly obtained in the forms of dynamic electroencephalogram and electrocardiogram. The dynamic electroencephalogram and electrocardiogram are common clinical screening means for cardiovascular diseases, and by recording the electrocardiosignals and the electroencephalogram signals of suspicious patients in a natural living state for more than 24 hours continuously, arrhythmia events and ST segment abnormal changes which are difficult to be found by the conventional electroencephalogram and electrocardiogram are found, so that important diagnosis and evaluation basis is obtained.

The electroencephalogram and electrocardio data are subjected to real-time maximum error bounded data compression, so that the data volume to be sent can be greatly reduced, and on the premise of not influencing the query analysis result, the advantages of reducing the storage space, reducing the communication bandwidth, reducing the communication power consumption and the like can be brought. In the specific monitoring process, optionally, electroencephalogram and electrocardiograph data are monitored simultaneously, or electroencephalogram data or electrocardiograph data are monitored separately, so that the method provided by the embodiment of the invention can be used for compressing the electroencephalogram and electrocardiograph data simultaneously, or compressing the electroencephalogram data or the electrocardiograph data specifically.

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 the initialization stage, the lower limit of the error of each point is setAnd upper limit of errorConverting 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.The upper bound set of data intervals can be represented asThe lower bound set of data intervals can be represented as

Let p bejRepresenting the original data point, i.e. pj=(xj,yj)=(j,dj) (ii) a Order toRepresenting the original data point pjUpper bound data points of, i.e.Order top jRepresenting the original data point pjLower bound data points, i.e.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 Lower limit straight line, i.e. straight lineSlope of (a) is a rateUpper limit straight line, i.e. straight lineHas a slope ofThe lower convex shell isI.e. lower convex hull by pointAnd pointThe connecting line of (1); the upper convex shell isI.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, yStraight line of upper limitAnd the value of the convex shell, and adjusting. Up to line segmentIn a straight lineAnd a straight lineOuter 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 Hs11, abscissa He of end position1The upper bound of the slope isLower bound of slope isPassing point is poI.e. straight lineAnd a straight linePoint of intersection po=(xo,yo). While utilizing the upper bound of slopeAnd 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)And He1Ordinate value ofSimilarly, using the lower bound of slopeAnd point poCan respectively calculate the horizontal coordinate Hs1Ordinate of (c)And He1Ordinate value of

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 takenAny 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 judgedStraight line of upper limitAnd the value of the convex shell, and the adjustment is as follows:

when line segmentIn a straight lineAnd a straight lineIf p has an upper limit internally or at least at the intersection with a straight lineIn a straight lineAnd a straight lineInside, then the upper limit straight line and the lower convex shell are updatedcvx(ii) a If the lower limit of ppIn a straight lineAnd a straight lineInside, the lower limit straight line and the upper convex shell are updated

Wherein the line segmentsIn a straight lineAnd a straight lineInternally 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 pIn a straight lineAnd a straight lineInternally, when the following equation (2) holds:

lower limit of ppIn a straight lineAnd a straight lineInternally, 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 shellFind a point g in such a way that the slopeMinimum; then order bpG ═ g; then delete the upper convex shellAll points before the time point corresponding to the midpoint g; updatingWill be provided withInserted 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 shellcvxStarting the examination at three points with the middle time nearest to the point p, if the middle point is positioned at the upper 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 lower convex hull backwardscvxAll points in the table are obtainedcvx(new)At the mostBack reamThe upper limit straight line is updated.

Updating lower limit straight line and upper convex shellThe method comprises the following steps:

from lower convex shellcvxA point g is found such that the slope (g,p) Maximum; then orderThen delete the lower convex shellcvxUpdating the slope of all points before the time point corresponding to the middle point gWill be provided withpIs inserted into the upper convex shellAnd updates the upwarp hull using triangulation

Updating the convex hull using triangulationThe method comprises the following steps:

from protruding shellStarting 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 backwardsAll points in the table are obtainedFinally 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 setAnd upper limit of errorThe 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.

In the compression stage, the adjacent intervals are assumed to beAndi is an odd number. Sequentially calculating two adjacent intervals to obtain an updated data intervalAnd a conversion coefficient b, and storing the data interval as a low frequency component and the conversion coefficient as a high frequency component. The specific calculation method is as follows:

when in useWhen it is, then

When in useWhen b is 0, wherein,indicating an empty set.

The end values of the data interval in the updated data interval are:

data interval to be updatedStored in original row vectorsWhere conversion coefficient b is stored in the original row vectorAt the position of the air compressor, the air compressor is started,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.

The data 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:

in the formula (I), the compound is shown in the specification,andrespectively 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,andfor the storage position in the original combined row vector isAndthe data of (c); when l is2>When the pressure of the mixture is 1, the pressure is lower,andrespectively, the storage positions in the previous stage row vectorAnddata of (2);l2Number of stages representing current reconstruction, l21,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 electroencephalogram and electrocardiograph data compression according to the embodiment of the present invention, which is detailed as follows:

in step S201, segment fitting is performed on the electroencephalogram electrocardiographic data according to a set error, so as 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.

Optionally, the electroencephalogram and electrocardiography data includes: electrocardiographic data and/or electroencephalographic data. 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, and the compression rate is improvedIn the middle result set of the optimal discontinuous PLA, that is, the starting point ordinate and the end point ordinate are one section, we can compress the set of the section of the starting point ordinate and the section 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*Obtaining an updated ordinate upper bound DD from the origin abscissa HsUAnd lower boundary DDLTo update the 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 compressed information by using the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection segment or the updating set Ve' of the end point ordinate, so as to represent the compressed electroencephalogram and electrocardio data.

In a possible implementation manner, after step S204, the method further includes:

storage update set Vs*A set Hs of start abscissa and a set He of end abscissa, and a set KK of slope of the segment or an updated set Ve' of end ordinate.

In a possible implementation mode, the set Vs is correspondingly stored and updated according to the electroencephalogram type and the electrocardio type*A set of start abscissa Hs and an set of end abscissa He, and segmentationThe slope set KK of the segment or the updated set Ve' of the end-point ordinate. That is, when the electroencephalogram and electrocardiograph data includes electroencephalogram data and electrocardiograph data in step S201, after data compression is completed according to the scheme provided in this embodiment, the compressed data is stored in a classified manner according to the electroencephalogram type and the electrocardiograph type, which is convenient for subsequent query and targeted analysis of the electroencephalogram and electrocardiograph 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 electroencephalogram and electrocardio data are subjected to segmented fitting according to the set error to obtain a plurality of segment sets, 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 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*Obtaining an updated ordinate upper bound DD from the origin abscissa HsUAnd lower boundary DDLTo update the 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 compressed information by using the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection segment or the updating set Ve' of the end point ordinate, so as to represent the compressed electroencephalogram and electrocardio 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 electroencephalogram and 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, to update the set Vs*The compression result Gve of the start-point abscissa set Hs, the end-point abscissa set He, and the end-point ordinate is used 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, to update 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, the 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 comprises 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:

wherein the content of the first and second substances,d iandd i+1left end point as ordinate;andright 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 m1l1Is 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;andright 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 m1l1Is the current decomposition level; and n is the number of original data.

The right end point of the update interval is:

wherein the content of the first and second substances,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;andright end point of ordinate; b is the first conversion factor.

In particular, the data interval to be updatedStored in original row vectorsWhere conversion coefficient b is stored in the original row vectorAt the position of the air compressor, the air compressor is started,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, in step S203, based on the update set Vs*And performing line segment fitting on the starting point abscissa set Hs and the end point abscissa set He, wherein the line segment fitting comprises the following steps:

based on the set of updates Vs*Updating the value of the corresponding data point in the electroencephalogram and electrocardio data with the starting point horizontal coordinate set Hs;

based on the set of updates Vs*And performing line segment fitting on the value of the horizontal coordinate set He of the endpoint and the values of other data points in the electroencephalogram and electrocardio data, and determining an updated set Ve' of the vertical coordinate of the endpoint.

In a possible implementation manner, in step S201, performing segment fitting on the electroencephalogram and electrocardiographic data according to a set error to obtain a plurality of line segment sets, including:

constructing a plurality of data intervals according to a plurality of data points of the electroencephalogram and electrocardio data and a set error, and representing each data point in the electroencephalogram and electrocardio 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 the data point to be fitted, and updating the upper limit straight line, the lower limit straight line, the upper convex shell and the lower convex shell 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 an 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 a 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 a lower convex hull based on the upper limit value of the first data point and the upper limit value of the second data point;

the convex hull is determined 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 pointAnd 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 represented by the data interval. 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 dataPoints shown in fig. 4Andthen, step S202 is executed, i.e., theReplacement data pointsAnd 1pordinate, usingNumerical replacement data pointsAnd 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 segmentsAndupper and lower border line segments, respectively, of the first segment line segment, a grey line segmentAndrespectively, an upper boundary line segment and a lower boundary line segment of the second piecewise line segment. In this case, the set of vertical coordinates of each line segment end point 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 embodiment aims at the compression of electroencephalogram and electrocardiograph data, and the reconstruction of the data can be completed only by decompressing the compressed data in specific application.

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:

in the formula (I), the compound is shown in the specification,andrespectively 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,andfor the storage position in the original combined row vector isAndthe data of (c); when l is2>When the pressure of the mixture is 1, the pressure is lower,andrespectively, the storage positions in the previous stage row vectorAndthe data of (c);l2number of stages representing current reconstruction, l21,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 setI.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 setI.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 electroencephalogram and electrocardiograph data compression 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, and detailed descriptions are as follows:

as shown in fig. 8, the device for electroencephalogram and electrocardiograph data compression comprises: 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 electroencephalogram and electrocardiographic data according to a 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*Obtaining an updated ordinate upper bound DD from the origin abscissa HsUAnd lower boundary DDLTo update the 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 compressed information by using the starting point abscissa set Hs, the end point abscissa set He, the slope set KK of the subsection segment or the updating set Ve' of the end point ordinate, so as to represent the compressed electroencephalogram and electrocardio data.

According to the embodiment of the invention, the electroencephalogram and electrocardio data are subjected to segmented fitting according to the set error to obtain a plurality of segment sets, 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 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*Obtaining an updated ordinate upper bound DD from the origin abscissa HsUAnd lower boundary DDLTo update the 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*Determining compression information for expressing the pressure by a starting point abscissa set Hs, an end point abscissa set He, a slope set KK of a segment line segment or an updating set Ve' of an end point ordinateAnd (5) the shrunk electroencephalogram and electrocardio 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 electroencephalogram and 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 method embodiments for electroencephalogram and electrocardiograph data compression, 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 electroencephalogram and electrocardiograph data compression. 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.

24页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于有限域傅里叶变换的QC-LDPC码构造方法、系统及设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类