Health data collection method and system for big data analysis
By performing run-encoding and segmentation of ECG data, combined with principal component analysis and dynamic time regularization algorithm, effective classification and storage of ECG data is achieved, solving the problem that abnormal data cannot be retrieved separately in the existing technology, and improving the efficiency of big data analysis.
Patent Information
- Application Number
- CN202410555315.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-05-07
AI Technical Summary
The existing run-time coding algorithm encodes and compresses and stores abnormal ECG data at the same time, resulting in the inability to retrieve abnormal data separately during big data analysis, which increases the load on analyzing normal data and reduces the analysis efficiency.
By collecting the patient's ECG data, after using run encoding compression, the data is divided into multiple data segments according to the segmentation intensity of the compressed tuple, the data is standardized and aligned using principal component analysis and dynamic time regularization algorithm, and then the abnormality of the data is judged based on the degree of time offset and the degree of ECG data offset, and the normal and abnormal data are stored separately.
It realizes effective classification and storage of ECG data, reduces the processing volume of normal data during big data analysis, improves analysis efficiency, and can retrieve and analyze abnormal data separately.
Smart Images

Figure CN118398148B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a health data collection method and system for big data analysis. Background Art
[0002] Big data analysis has a wide range of applications in the field of health data, and can provide important insights and decision-making support for health management, disease prediction, early diagnosis, personalized treatment, and public health. By collecting and analyzing personal health data, it is possible to monitor and evaluate personal health status in real time, and discover potential diseases and risk factors. And through the analysis of large-scale clinical data, it is possible to discover the effectiveness and safety of drugs, screen patient groups, assist in clinical trial design and results analysis, and accelerate the process of drug development and promotion.
[0003] Run-length encoding can be applied to data compression to reduce the transmission bandwidth and storage requirements of health data analysis systems. Health data usually contains time series data, such as heart rate, blood pressure, blood sugar, etc. In these continuously measured data, there are often long sequences of identical values. The run-length encoding algorithm can compress the sequence of consecutive identical values into a form of a value and the number of repetitions, thereby reducing the number of bits required for data storage and transmission, improving data transmission efficiency, and reducing the demand for storage space. However, when collecting and storing health data, the run-length encoding algorithm encodes and compresses abnormal ECG data that differs from the main trend of ECG data and normal ECG data at the same time, and stores them in the same storage, resulting in the inability to retrieve abnormal data separately when using big data to analyze abnormal ECG data, generating a load for analyzing normal data on the big data analysis system, and reducing analysis efficiency. Summary of the invention
[0004] The present invention provides a health data collection method and system for big data analysis to solve the problem that the existing run-length encoding algorithm encodes and compresses abnormal ECG data that differs from the main trend of the ECG data and normal ECG data at the same time, and stores them in the same memory, resulting in the inability to retrieve the abnormal data separately when using big data to analyze the abnormal ECG data, which creates a load for the big data analysis system to analyze normal data and reduces the analysis efficiency.
[0005] The health data collection method and system for big data analysis of the present invention adopts the following technical solutions:
[0006] In a first aspect, an embodiment of the present invention provides a health data collection method for big data analysis, the method comprising the following steps:
[0007] Collect the patient's ECG data at all times;
[0008] Compress the patient's ECG data using run-length coding to obtain a number of compressed tuples; obtain the segmentation strength of each compressed tuple according to the local difference of each compressed tuple, and divide the ECG data using the segmentation strength to obtain a number of component data segments; obtain the standard data segments of all component data segments according to the principal components of all component data segments; obtain the aligned compressed tuple of each compressed tuple of each component data segment according to the compressed tuple alignment relationship between each compressed tuple and the standard data segment, obtain the time offset degree of each compressed tuple of each component data segment according to each compressed tuple and the aligned compressed tuple, and obtain the ECG data offset degree of each compressed tuple of each component data segment; obtain the abnormality degree of each component data segment according to all the time offset degrees and ECG data offset degrees of each component data segment; divide each ECG data segment into a normal data set and an abnormal data set according to the abnormality degree;
[0009] The collected ECG data belonging to the normal data set are stored in the first storage area, and the collected ECG data belonging to the abnormal data set are stored in the second storage area.
[0010] Further, obtaining the segmentation strength of each compressed tuple according to the local difference of each compressed tuple includes:
[0011] The i-th compressed tuple is recorded as (M i ,n i ), M i is the repeated data string of the i-th compressed tuple, n i is the number of repetitions of the i-th compressed tuple, the repeated data string M i The first ECG data collection time is recorded as t i , t i The ECG data at the moment is The i-th compressed tuple (M i ,n i ) is calculated as:
[0012]
[0013] Where f i ′ is the partition coefficient of the i-th compressed tuple, Indicates that the i-th compressed tuple is in the t-th i -m i +q moment ECG data, Indicates that the i-th compressed tuple is in the t-th i +q time ECG data, m i is the number of ECG data of the i-th compression tuple, the segmentation coefficient of the i-th compression tuple is linearly normalized, and the result is recorded as the segmentation strength of the i-th compression tuple.
[0014] Furthermore, the specific method of using the segmentation strength to divide the ECG data into several component data segments is:
[0015] The partition strength of the i-th compressed tuple is denoted as f i , preset the first threshold T 1 , when the partition strength of the i-th compressed tuple satisfies f i ≥T 1 When , the i-th compressed tuple is recorded as a split point;
[0016] Calculate the segmentation strength of all compressed tuples to obtain all segmentation points, record the first ECG data and the last ECG data as segmentation points, start from the first segmentation point, record all ECG data between every two segmentation points and the ECG data of the first segmentation point between the two segmentation points as an ECG data segment, and so on, until there is only the last segmentation point in the ECG data, merge the last segmentation point into the last ECG data segment, obtain several ECG data segments, and expand each ECG data segment to obtain component data segments.
[0017] Further, the step of expanding each ECG data segment to obtain a component data segment includes:
[0018] Select the ECG data segment with the largest number of ECG data among all ECG data segments, and record the number of ECG data in the ECG data segment with the largest number of ECG data as the extended length; select any ECG data segment, if the number of ECG data in the ECG data segment is less than the extended length, then copy the ECG data segment for the first time and fill it after the ECG data segment to obtain the first ECG data segment, when the length of the first ECG data segment is less than the extended length, then copy the ECG data segment for the second time and fill it after the first ECG data segment to obtain the second ECG data segment, and so on, until the number of ECG data in the filled ECG data segment is equal to the extended length, and record the filled ECG data segment as a component data segment; fill all ECG data segments to obtain several component data segments.
[0019] Further, obtaining the standard data segments of all component data segments according to the principal components of all component data segments includes:
[0020] The ECG data of each component data segment is a sequence of a group of ECG data, the serial number of each ECG data is recorded as a dimension, each ECG data is recorded as a vector under the dimension, the vectors under all dimensions of each component data segment are recorded as a group of multidimensional vectors, the maximum dimension of each group of multidimensional vectors is equal to the expansion length, all component data segments form multiple groups of multidimensional vectors, the PCA algorithm is used to obtain several principal components of all component data segments, each of the principal components has multiple dimensions, the mean ECG data of all principal components in each dimension is calculated and recorded as the standard data of each dimension, the standard data of all dimensions are compressed by run-length encoding to obtain standard data segments.
[0021] Further, obtaining the aligned compressed tuple of each compressed tuple of each component data segment includes:
[0022] The ECG data sequence of the j-th component data segment is recorded as the j-th query sequence, and the ECG data sequence of the standard data segment is recorded as the template sequence. The j-th query sequence and the template sequence are input into the dynamic time warping algorithm DTW. According to the ECG data length and ECG data value of the k-th compressed tuple in the query sequence and the template sequence, the aligned compressed tuple of the k-th compressed tuple in the j-th component data segment on the standard data segment is obtained.
[0023] Further, obtaining the time offset degree of each compressed tuple of each component data segment includes:
[0024] The time offset degree dt of the kth compressed tuple in the jth component data segment j,k The calculation method is:
[0025] dt j,k =|t′-s|
[0026] Wherein t′ is the time coordinate of the first ECG data of the kth compressed tuple in the jth component data segment, and s is the time coordinate of the first ECG data of the aligned compressed tuple of the kth compressed tuple in the jth component data segment on the standard data segment.
[0027] Further, obtaining the ECG data deviation degree of each compressed tuple of each component data segment includes:
[0028] The kth compressed tuple in the jth component data segment is denoted as (M j ' ,k ,n j ' ,k ), then the ECG data deviation degree dP of the kth compressed tuple in the jth component data segment j,k The calculation method is:
[0029]
[0030] Where m j,k is the number of ECG data in the kth compressed tuple in the jth component data segment, m k′ is the number of ECG data of the k′th compressed tuple in the standard data segment, P j ' ,k,t′+u is the ECG data of the kth compressed tuple at time t′+u in the jth component data segment, parameter a is the upper limit of u, E′ k,j,s+v The ECG data of the aligned compressed tuple of the kth compressed tuple in the jth component data segment on the standard data segment B at the s+vth time, the parameter c is the upper limit of the value of v, t′ is the time coordinate of the first ECG data of the kth compressed tuple in the jth component data segment, and s is the time coordinate of the first ECG data of the aligned compressed tuple of the kth compressed tuple in the jth component data segment on the standard data segment B;
[0031] Denoted as the first deviation of the ECG data between the kth compression tuple and the k′th compression tuple, max{} is the maximum value function, which means obtaining the maximum value of the first deviation of all ECG data between the kth compression tuple and the k′th compression tuple.
[0032] Further, obtaining the abnormality degree of each component data segment according to all time offset degrees and electrocardiogram data offset degrees of each component data segment includes:
[0033] The jth component data segment B j The degree of abnormality is calculated as:
[0034]
[0035] in, represents the abnormal coefficient of the jth component data segment, is the variance of all time offsets of the jth component data segment, dP j,k Indicates the degree of ECG data deviation of the kth compressed tuple of the jth component data segment, dP j,k″ Indicates the degree of deviation of the k″th compressed tuple in the jth component data segment except the kth compressed tuple;
[0036] The abnormal coefficient of the j-th component data segment is linearly normalized, and the result is recorded as the abnormal degree of the j-th component data segment.
[0037] Furthermore, a health data collection system for big data analysis includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of any health data collection method for big data analysis are implemented.
[0038] The beneficial effects of the technical solution of the present invention are as follows: the present invention obtains a compressed tuple by using run-length coding compression on the collected ECG data, and obtains a plurality of ECG data segments according to the segmentation strength of the ECG data by the compressed tuple, so that the ECG data in each ECG data segment is similar, and the ECG data between each ECG data segment has a small degree of repetition and a large numerical difference, which is conducive to distinguishing normal and abnormal data; obtains a plurality of component data segments according to the ECG data segments, and eliminates abnormal errors between different component data segments caused by different heart rates according to the time offset degree and the ECG data offset degree of each component data segment compared with the standard data segment; then obtains the abnormality degree of each component data segment according to the time offset degree and the ECG data offset degree of each component data segment, judges the ECG data segment according to the abnormality degree, obtains a normal data set and an abnormal data set, constructs a first storage device for normal ECG data and a second storage device for abnormal ECG data, so that when big data analyzes health data, only normal or abnormal data is analyzed, thereby reducing the data processing volume of big data analysis of patient health data and improving the system analysis efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 The figure is a flowchart of the steps of the health data collection method for big data analysis of the present invention. DETAILED DESCRIPTION
[0041] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the health data collection method and system for big data analysis proposed by the present invention, its specific implementation method, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in an embodiment may be combined in any suitable form.
[0042] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0043] The specific scheme of the health data collection method and system for big data analysis provided by the present invention is described in detail below with reference to the accompanying drawings.
[0044] See also Figure 1 , which shows a flow chart of the steps of a health data collection method for big data analysis provided by an embodiment of the present invention, the method comprising the following steps:
[0045] Step S001: Collect the patient's dynamic electrocardiogram activity to obtain the patient's electrocardiogram data.
[0046] The purpose of this embodiment is to analyze whether the collected health data is normal or abnormal, to achieve distributed storage of health data, thereby reducing the analysis pressure of big data analysis of all health data, and to achieve the purpose of improving analysis efficiency. Therefore, it is necessary to collect health data first. This embodiment uses the heart rate monitoring data of the hospital as a kind of health data for analysis. Other embodiments can use other data as health data for big data analysis, which is not specifically limited in this embodiment.
[0047] Specifically, the ECG data is obtained by using a dynamic electrocardiograph to monitor the patient's dynamic electrocardiograph activity (Holter monitoring) for 24 hours. The horizontal axis of the ECG data is time. The sampling frequency of the dynamic electrocardiograph is 125-1000 times / second. In this embodiment, every 0.002 seconds is recorded as a collection moment, and the vertical axis is the voltage of the ECG activity in millivolts. The ECG activity of a patient at all times for 24 hours is collected and recorded as the ECG data of the patient.
[0048] At this point, the ECG data of a patient has been obtained.
[0049] Step S002: compress the patient's ECG data using run-length coding to obtain a number of compressed tuples.
[0050] It should be noted that when the collected ECG data is stored, since the ECG data of a normal heartbeat has fixed P waves, QRS waves, T waves and U waves, the ECG data generated by the heartbeats over a period of time have high similarity; run-length coding uses tuples to represent repeated data or data strings, and has a high compression effect on continuous repeated and highly redundant data. Therefore, in order to meet the needs of real-time storage of ECG data and reduce storage load, run-length coding is selected to compress ECG data. The compression result includes several compressed tuples, of which the i-th compressed tuple is recorded as (M i ,n i ), M i is a repeated data string of a compressed tuple, and the repeated data string M of the i-th compressed tuple i The number of repetitions is recorded as the number of repetitions n of the i-th compressed tuple iFor example, when part of the ECG data is [a,b,c,a,b,c,a,b,c,d,e,f,e,f], where each character represents the voltage of an ECG activity, the compression result obtained by run-length encoding is [(abc,3),(d,1),(ef,2)], where (abc,3) is a compressed tuple, "abc" is a repeated data string, and "3" is the number of repetitions of the repeated data string "abc".
[0051] So far, all compressed tuples of ECG data have been obtained.
[0052] Step S003: Obtain the segmentation strength of each compressed tuple according to the neighborhood local difference of the ECG data, and obtain a number of ECG data segments according to the segmentation strength.
[0053] It should be noted that the purpose of this embodiment is to store normal ECG data and abnormal ECG data in different memories, and the ECG data generated by normal heartbeats only differ in heart rate, that is, the number of heartbeats per minute is affected by exercise or environmental factors. When the values of the ECG data of several heartbeats are greatly different from those of other heartbeats, it means that these heartbeats may be abnormal heartbeats. After run-length coding compression, the segmented ECG data have large differences due to the small data repetition before and after the compressed tuple. Therefore, this embodiment obtains the segmentation strength of each compressed tuple according to the difference between the data before and after the compressed tuple.
[0054] Specifically, the i-th compressed tuple (M i ,n i ) in the repeated data string M i Contains several ECG data, n i is the number of repetitions of the i-th compressed tuple, where the repeated data string M i The first ECG data collection time is recorded as t i , t i The ECG data at the moment is The repeated data string M of the i-th compressed tuple i The number of ECG data is m i . Then according to the i-th compressed tuple (M i ,n i ) before, the ECG data with the same number as the ECG data of the i-th compression tuple, obtain the i-th compression tuple (M i ,n i ) is calculated as:
[0055]
[0056] Where f i ′ is the partition coefficient of the i-th compressed tuple, Indicates that the i-th compressed tuple is in the t-th i -m i +q moment ECG data, Indicates that the i-th compressed tuple is in the t-th i +q time ECG data, m i is the number of ECG data in the i-th compressed tuple.
[0057] Run-length encoding compresses data according to the redundancy of the data. Therefore, when the difference between the i-th compressed tuple and the ECG data at each corresponding position before the compressed tuple is larger, it means that the repetition degree between the i-th compressed tuple and the ECG data before the compressed tuple is smaller or the numerical difference is larger, and they belong to different heartbeat states. In this case, the segmentation strength of the i-th compressed tuple for the ECG data is greater; when the difference between the i-th compressed tuple and the ECG data at each corresponding position before the compressed tuple is smaller, it means that the redundancy degree between the i-th compressed tuple and the ECG data before the compressed tuple is larger or the numerical difference is smaller, and they belong to the same heartbeat state. In this case, the segmentation strength of the i-th compressed tuple for the ECG data is smaller; the segmentation coefficient of each compressed tuple is obtained according to the above method, all the segmentation coefficients are linearly normalized, and the result is recorded as the segmentation strength of each compressed tuple.
[0058] Furthermore, the segmentation strength of the i-th compressed tuple is recorded as f i , preset the first threshold T of segmentation strength 1 In this embodiment, the evaluation threshold is T 1 = 0.78, when the segmentation strength of the i-th compressed tuple satisfies f i ≥T 1 When , it means that there is a big difference between the ECG data before the i-th compression tuple and the data after the i-th compression tuple, that is, the heartbeat state before and after the i-th compression tuple is different, then the i-th compression tuple is recorded as a segmentation point; when the segmentation strength of the i-th compression tuple satisfies f i <T 1 When , it indicates that there is a small difference between the ECG data before the i-th compression tuple and the data after the i-th compression tuple, that is, the heartbeat states before and after the i-th compression tuple are the same, and the i-th compression tuple is not processed.
[0059] Similarly, the segmentation strength of all compressed tuples is calculated, and the first threshold of the segmentation strength is used to determine all the segmentation points of the ECG data. The first ECG data and the last ECG data are both recorded as segmentation points. Starting from the first segmentation point, all the ECG data between every two segmentation points and the ECG data of the first segmentation point of the two segmentation points are recorded as an ECG data segment, and so on, until there is only the last segmentation point in the ECG data. The last segmentation point is merged into the last ECG data segment to obtain several ECG data segments; a segment of ECG data [a, Taking [a,b,c,a,b,c,a,b,c,d,e,f,e,f] as an example, the compression result is [(abc,3),(d,1),(ef,2)], where the compression tuple (abc,3) is the first segmentation point and (ef,2) is the second segmentation point. Then [a,b,c,a,b,c,a,b,c,d] is recorded as the first ECG data segment, and the corresponding compression tuple is [(abc,3),(d,1)], then [e,f,e,f] is recorded as the second ECG data segment, and the corresponding compression tuple is [(ef,2)].
[0060] At this point, several ECG data segments are obtained by analyzing each compressed tuple.
[0061] Step S004, standardize each ECG data segment to obtain component data segments, and extract the principal components of the component data segments to obtain standard data segments. After dynamically time-warping each component data segment using the standard data segments, obtain the compressed tuple of each component data segment compared to the aligned compressed tuple of the standard data segment, as well as the time offset degree and ECG data offset degree of each compressed tuple.
[0062] It should be noted that since the time interval between each two segmentation points is different, the lengths of the ECG data segments obtained after segmentation are different. Therefore, when calculating the difference between data segments to obtain the degree of abnormality of each ECG data segment, ECG data segments of different lengths have different degrees of influence on the data abnormality. Therefore, this embodiment expands each ECG data segment to obtain component data segments based on the characteristics of high redundancy and small numerical difference of the ECG data in each ECG data segment.
[0063] Specifically, the method for expanding each ECG data segment to obtain component data segments is as follows: select the ECG data segment with the largest number of ECG data among all ECG data segments, and record the number of ECG data in the ECG data segment with the largest number of ECG data as the expanded length; select any ECG data segment, if the number of ECG data in the ECG data segment is less than the expanded length, then copy the ECG data segment for the first time and fill it after the ECG data segment to obtain the first ECG data segment, when the length of the first ECG data segment is less than the expanded length, then copy the ECG data segment for the second time and fill it after the first ECG data segment to obtain the second ECG data segment, and so on, until the number of ECG data in the filled ECG data segment is equal to the expanded length, and record the filled ECG data segment as a component data segment; fill all ECG data segments to obtain several component data segments; it should be noted that if the length of the vacancy is insufficient to fill all the ECG data in the ECG data segment, then fill as many vacancy lengths as there are.
[0064] Taking the first ECG data segment [a,b,c,a,b,c,a,b,c,d] and the second ECG data segment [e,f,e,f] as examples, the extended length is the total number of ECG data in the first ECG data segment, 10, and the component data segments obtained by padding the second ECG data segment according to the extended length are [e,f,e,f,e,f,f,e,f,e,f].
[0065] Furthermore, since the patient is affected by his own activities when using a dynamic electrocardiogram instrument to monitor the ECG data for 24 hours, the patient's heart rate has different characteristics in different time periods, which makes it possible to misjudge the abnormal and normal conditions based on the differences in different component data segments due to the inconsistency of the heartbeat cycle lengths in different time periods. However, the patient's ECG data is highly repetitive data, and the ECG activity is relatively normal at most times. Therefore, the main trend of the ECG data can be used as standard data to determine whether each component data segment is normal. Therefore, this method reduces the dimensionality of all component data segments, extracts the overall trend of all component data segments to obtain principal components, and quantifies the principal components to obtain standard data segments as reference standards for abnormal judgment.
[0066] Specifically, the ECG data of each component data segment is a sequence of a group of ECG data, the serial number of the ECG data of each component data segment is recorded as a dimension, each ECG data is recorded as a vector under the dimension, and the vectors under all dimensions of each component data segment are recorded as a group of multidimensional vectors, wherein the maximum dimension of each group of multidimensional vectors is equal to the expansion length, and all component data segments constitute multiple groups of multidimensional vectors, and multiple groups of multidimensional vectors constitute a two-dimensional matrix space; it should be noted that since the component data segment is composed of a number of compressed tuples, the repeated data string of this compressed tuple occupies as many dimensions in the two-dimensional matrix space as the number of ECG data contained, and therefore the ECG data in some dimensions are compressed, that is, the dimension where the compressed ECG data is located is an empty dimension. In order to use the PCA algorithm to reduce the dimensionality and obtain the principal component as the overall trend of the data to obtain standard data, these empty dimensions need to be filled with 0 values. Taking the first component data segment [a,b,c,,,,,,d] and the second component data segment [e,f,,,e,f,,,e,f] as examples, the results after run-length coding compression and filling are [a,b,c,0,0,0,0,0,0,d] and [e,f,0,0,e,f,0,0,e,f]. The PCA algorithm is used to reduce the dimensionality of the two-dimensional matrix space to obtain several principal components of all component data segments, each of which has multiple dimensions. The mean value of the ECG data of the principal component in each dimension is calculated and recorded as the standard data of the dimension. The standard data of all dimensions are compressed by run-length coding and filled with 0 values to form a standard data segment. The run-length coding compression and 0-filling method of the standard data segment are the same as those of the component data segments. The PCA algorithm is used to obtain the principal components, which is a well-known technology and will not be described in detail in this embodiment.
[0067] Furthermore, after obtaining the standard data segments of all component data segments, since the change in normal heart rate only results in differences in heart rate, while the voltage changes of the heartbeat are relatively consistent, the data with greater differences compared to the standard data segments is more likely to be abnormal data. Therefore, this embodiment uses each component data segment as a query sequence and the standard data segment as a template sequence, and inputs the query sequence and the template sequence into a dynamic time warping algorithm (Dynamic Time Warping, DTW) to obtain the alignment relationship between each component data segment and the standard data segment.
[0068] Specifically, take the jth component data segment B j For example, the kth compressed tuple in the jth component data segment is (M j ' ,k ,n j ' ,k ), M j ' ,k Represents the repeated data string of the kth compressed tuple, n j ' ,kRepresents the repeated data string M of the kth compressed tuple j ' ,k The number of repetitions is simply the number of repetitions of the kth compressed tuple, m j,k is the number of ECG data of the kth compressed tuple in the jth component data segment; i The ECG data at this moment is P j ' ,k,t′ , n j ' ,k is the number of repetitions of the kth compressed tuple. The ECG data sequence of the jth component data segment is recorded as the jth query sequence, and the ECG data sequence of the standard data segment is recorded as the template sequence. Then the jth query sequence and the template sequence are input into the dynamic time warping algorithm DTW to obtain the kth compressed tuple (M) in the jth component data segment. j ' ,k ,n j ' ,k ) aligned compressed tuple (M′) on the standard data segment B k′ ,n′ k′ ), M′ k′ is the repeated data string of the aligned compressed tuple of the kth compressed tuple, n′ k′ is the number of repetitions of the alignment compression tuple of the kth compression tuple. It should be noted that the matching method is to select the compression tuple with the closest value and the smallest length difference between the repeated data string of the compression tuple of the jth query sequence and the repeated data string of all the compression tuples in the template sequence as the alignment compression tuple. If there are multiple ECG data in the compression tuple, the time of the first ECG data is used for alignment.
[0069] Taking [a,b,c,0,0,0,0,0,0,d] as an example, if the standard data segment is [x,y,x,0,0,0,u,0,0,v], if the values of "abc" and "xyx" are closest and the length difference is the smallest, then "xyx" is the aligned compressed tuple of "abc".
[0070] Then the kth compressed tuple (M j ' ,k ,n j ' ,k )’s time offset dt j,k The calculation method is:
[0071] dt j,k =|t′-s|
[0072] Where dt j,k is the kth compressed tuple (M j ' ,k ,nj ' ,k ), t′ is the time coordinate of the first ECG data of the kth compressed tuple in the jth component data segment, and s is the aligned compressed tuple (M′) of the kth compressed tuple in the jth component data segment on the standard data segment B. k′ ,n′ k′ ). When the time difference between the compressed tuple of the jth component data segment and the aligned compressed tuple on the standard data segment B is larger, it means that the heart rate of the jth component data segment is larger than that of the standard data segment, and it is more likely to be abnormal data.
[0073] Then the kth compressed tuple (M j ' ,k ,n j ' ,k ) of the ECG data deviation degree dP j,k The calculation method is:
[0074]
[0075] Where dP j,k is the kth compressed tuple (M j ' ,k ,n j ' ,k ) ECG data deviation degree, m j,k is the number of ECG data in the kth compressed tuple in the jth component data segment, m k′ is the number of ECG data of the k′th compressed tuple in the standard data segment, P j ' ,k,t′+u is the ECG data of the kth compressed tuple at time t′+u in the jth component data segment, a is the upper limit of u, E′ k,j,s+v The ECG data of the aligned compressed tuple of the kth compressed tuple in the jth component data segment on the standard data segment B at the s+vth moment, the parameter c is the upper limit of the value of v, t′ is the time coordinate of the first ECG data of the kth compressed tuple in the jth component data segment, and the parameter s is the time coordinate of the first ECG data of the aligned compressed tuple of the kth compressed tuple in the jth component data segment on the standard data segment B. is the cumulative distribution of the kth compressed tuple in the jth component segment under parameter a, is the cumulative distribution of aligned compressed tuples in the standard data segment under parameter c;
[0076] It is denoted as the first deviation of the ECG data between the kth compression tuple and the k′th compression tuple, max{} is the maximum value function, which means obtaining the maximum value of the first deviation of all ECG data between the kth compression tuple and the k′th compression tuple. The greater the difference between the ECG data of the kth compression tuple of the jth component data segment and the aligned compression tuple on the standard data segment B, the more likely the ECG data monitored by the kth compression tuple of the jth component data segment is to be abnormal data.
[0077] The time offset degree and ECG data offset degree of all compressed tuples in the jth component data segment are calculated, and similarly, the time offset degree and ECG data offset degree of each compressed tuple in each component data segment are calculated.
[0078] So far, the time offset degree and the ECG data offset degree of each compressed tuple of each component data segment are obtained.
[0079] Step S005, obtaining the abnormality degree of each component data segment according to the time offset degree of each compressed tuple of each component data segment and the ECG data offset degree, judging whether each component data segment belongs to normal data or abnormal data according to the abnormality degree, and obtaining a normal data set and an abnormal data set.
[0080] It should be noted that if there is a difference in heart rate between a component data segment and a standard data segment, then the time offset degree of each compressed tuple of the component data segment is approximately the same as that of the standard data segment, and the value of the ECG data offset degree of a normal heartbeat is smaller. Therefore, this embodiment obtains the degree of abnormality of each component data segment based on the time offset degree of each compressed tuple of each component data segment and the size and distribution of the ECG data offset degree.
[0081] Specifically, take the jth component data segment B j Take as an example, the calculation method of the abnormality degree of the jth component data segment is:
[0082]
[0083] in, represents the abnormal coefficient of the jth component data segment, is the variance of all time offsets of the jth component data segment, dP j,k Indicates the degree of ECG data deviation of the kth compressed tuple of the jth component data segment, dP j,k″ Indicates the degree of deviation of the k″th compressed tuple in the jth component data segment except the kth compressed tuple. The value of is affected by the time offset of each compressed tuple in the component data segment compared to the standard data segment. If the value distribution of all time offsets is similar, it means that the time offset of the jth component data segment is caused by the change of heart rate. Then the time offset of the jth component data segment dt j The smaller the variance value is, the smaller the abnormal coefficient of the j-th component data segment is; if the distribution of the values of all time offset degrees is disordered, it means that the time offset degree of the j-th component data segment is a monitoring anomaly, then the time offset degree dt of the j-th component data segment is j The larger the variance value is, the larger the abnormal coefficient of the j-th component data segment is. The data of each compressed tuple representing the j-th component data segment is different from the data of other compressed tuples. The greater the difference in ECG data, the more disordered the ECG data of the j-th component data segment is compared with the ECG data of the standard data segment, and the more likely it is a monitored abnormality. The abnormality coefficient of each component data segment is obtained according to the above method, all abnormality coefficients are linearly normalized, and the results are recorded as the abnormality degree of each component data segment.
[0084] Furthermore, the abnormality degree of the jth component data segment is recorded as Preset the second threshold value T of abnormality 2 In this embodiment, the evaluation threshold is T 2 = 0.65; if the abnormality value of the jth component data segment satisfies It means that the ECG data of the jth component data segment is different from the standard data segment only by the heart rate, then the ECG data segment of the jth component data segment is recorded as a normal data segment; when the abnormality value of the jth component data segment satisfies This indicates that the time offset of the ECG data of the j-th component data segment compared to the standard data segment is not affected by the heart rate, or the voltage value of the monitored ECG data is significantly different from the normal data. This indicates that the data is more likely to be abnormal data, and the ECG data segment of the j-th component data segment is recorded as an abnormal data segment.
[0085] Similarly, a second threshold T of abnormality is used for all component data segments. 2 Judge and obtain all normal data segments and abnormal data segments, all normal data segments constitute a normal data set, and all abnormal data segments constitute an abnormal data set.
[0086] At this point, the abnormality level of each component data segment is obtained, and a normal data set and an abnormal data set of the electrocardiogram data are obtained according to the abnormality level.
[0087] Step S006: store the collected ECG data belonging to the normal data set in the first storage area, and store the collected ECG data belonging to the abnormal data set in the second storage area, thereby completing the collection of health data for big data analysis.
[0088] It should be noted that after obtaining the normal data set and the abnormal data set, in order to facilitate doctors to analyze only the abnormal ECG data or use the normal ECG data to determine whether the data is abnormal when analyzing the ECG data, the present embodiment constructs a first memory for storing normal ECG data and a second memory for storing abnormal data. The component data segments of all ECG data of the normal data set are stored in the first memory for normal ECG data, and the component data segments of all ECG data of the abnormal data set are stored in the second memory for abnormal ECG data. When the big data analysis system needs normal or abnormal data, only the first memory or the second memory is called for big data analysis to monitor the patient's heart rate.
[0089] The health data collection system for big data analysis provided in an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement steps S001 to S005 as described above.
[0090] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A health data collection method for big data analysis, characterized in that: The method comprises the following steps: Collect the patient's ECG data at all times; Compress the patient's ECG data using run-length coding to obtain a number of compressed tuples; obtain the segmentation strength of each compressed tuple according to the local difference of each compressed tuple, and divide the ECG data using the segmentation strength to obtain a number of component data segments; obtain the standard data segments of all component data segments according to the principal components of all component data segments; obtain the aligned compressed tuple of each compressed tuple of each component data segment according to the compressed tuple alignment relationship between each compressed tuple and the standard data segment, obtain the time offset degree of each compressed tuple of each component data segment according to each compressed tuple and the aligned compressed tuple, and obtain the ECG data offset degree of each compressed tuple of each component data segment; obtain the abnormality degree of each component data segment according to all the time offset degrees and ECG data offset degrees of each component data segment; divide each ECG data segment into a normal data set and an abnormal data set according to the abnormality degree; storing the collected ECG data belonging to the normal data set in the first storage area, and storing the collected ECG data belonging to the abnormal data set in the second storage area; The obtaining the segmentation strength of each compressed tuple according to the local difference of each compressed tuple comprises: The i-th compressed tuple is recorded as (M i ,n i ), M i is the repeated data string of the i-th compressed tuple, n i is the number of repetitions of the i-th compressed tuple, the repeated data string M i The first ECG data collection time is recorded as t i , t i The ECG data at the moment is The i-th compressed tuple (M i ,n i ) is calculated as: Where f i ′ is the partition coefficient of the i-th compressed tuple, Indicates that the i-th compressed tuple is in the t-th i -m i +q moment ECG data, Indicates that the i-th compressed tuple is in the t-th i +q time ECG data, m i is the number of ECG data of the ith compression tuple, the segmentation coefficient of the ith compression tuple is linearly normalized, and the result is recorded as the segmentation strength of the ith compression tuple; The specific method of using the segmentation strength to divide the ECG data into several component data segments is as follows: The partition strength of the i-th compressed tuple is denoted as f i , preset the first threshold T1, when the segmentation strength of the i-th compressed tuple meets f i When ≥T1, the i-th compressed tuple is recorded as a split point; Calculate the segmentation strength of all compressed tuples to obtain all segmentation points, record the first ECG data and the last ECG data as segmentation points, start from the first segmentation point, record all ECG data between every two segmentation points and the ECG data of the first segmentation point of the two segmentation points as an ECG data segment, and so on, until there is only the last segmentation point in the ECG data, merge the last segmentation point into the last ECG data segment, obtain several ECG data segments, and expand each ECG data segment to obtain component data segments; The step of expanding each ECG data segment to obtain a component data segment comprises: Select the ECG data segment with the largest number of ECG data among all ECG data segments, and record the number of ECG data in the ECG data segment with the largest number of ECG data as the extended length; select any ECG data segment, if the number of ECG data in the ECG data segment is less than the extended length, then copy the ECG data segment for the first time and fill it after the ECG data segment to obtain the first ECG data segment, when the length of the first ECG data segment is less than the extended length, then copy the ECG data segment for the second time and fill it after the first ECG data segment to obtain the second ECG data segment, and so on, until the number of ECG data in the filled ECG data segment is equal to the extended length, and record the filled ECG data segment as a component data segment; fill all ECG data segments to obtain several component data segments.
2. The health data collection method for big data analysis according to claim 1, characterized in that: The step of obtaining the standard data segments of all component data segments according to the principal components of all component data segments comprises: The ECG data of each component data segment is a sequence of a group of ECG data, the serial number of each ECG data is recorded as a dimension, each ECG data is recorded as a vector under the dimension, the vectors under all dimensions of each component data segment are recorded as a group of multidimensional vectors, the maximum dimension of each group of multidimensional vectors is equal to the expansion length, all component data segments form multiple groups of multidimensional vectors, the PCA algorithm is used to obtain several principal components of all component data segments, each of the principal components has multiple dimensions, the mean ECG data of all principal components in each dimension is calculated and recorded as the standard data of each dimension, the standard data of all dimensions are compressed by run-length encoding to obtain standard data segments.
3. The health data collection method for big data analysis according to claim 1, characterized in that: The obtaining of the aligned compressed tuple of each compressed tuple of each component data segment comprises: The ECG data sequence of the j-th component data segment is recorded as the j-th query sequence, and the ECG data sequence of the standard data segment is recorded as the template sequence. The j-th query sequence and the template sequence are input into the dynamic time warping algorithm DTW. According to the ECG data length and ECG data value of the k-th compressed tuple in the query sequence and the template sequence, the aligned compressed tuple of the k-th compressed tuple in the j-th component data segment on the standard data segment is obtained.
4. The health data collection method for big data analysis according to claim 1, characterized in that: The obtaining of the time offset degree of each compressed tuple of each component data segment comprises: The time offset degree dt of the kth compressed tuple in the jth component data segment j,k The calculation method is: dt j,k =|t′-s| Wherein t′ is the time coordinate of the first ECG data of the kth compressed tuple in the jth component data segment, and s is the time coordinate of the first ECG data of the aligned compressed tuple of the kth compressed tuple in the jth component data segment on the standard data segment.
5. The health data collection method for big data analysis according to claim 1, characterized in that: The step of obtaining the ECG data deviation degree of each compressed tuple of each component data segment comprises: The kth compressed tuple in the jth component data segment is denoted as (M j ' ,k ,n j ' ,k ), then the ECG data deviation degree dP of the kth compressed tuple in the jth component data segment j,k The calculation method is: Where m j,k is the number of ECG data in the kth compressed tuple in the jth component data segment, m k′ is the number of ECG data of the k′th compressed tuple in the standard data segment, P j ' ,k,t′+u is the ECG data of the kth compressed tuple at time t′+u in the jth component data segment, parameter a is the upper limit of u, E′ k,j,s+v The ECG data of the aligned compressed tuple of the kth compressed tuple in the jth component data segment on the standard data segment at the s+vth time, the parameter c is the upper limit of the value of v, t′ is the time coordinate of the first ECG data of the kth compressed tuple in the jth component data segment, and s is the time coordinate of the first ECG data of the aligned compressed tuple of the kth compressed tuple in the jth component data segment on the standard data segment; Denoted as the first deviation of the ECG data between the kth compression tuple and the k′th compression tuple, max{} is the maximum value function, which means obtaining the maximum value of the first deviation of all ECG data between the kth compression tuple and the k′th compression tuple.
6. The health data collection method for big data analysis according to claim 1, characterized in that: The step of obtaining the abnormality degree of each component data segment according to all time offset degrees and electrocardiogram data offset degrees of each component data segment comprises: The jth component data segment B j The degree of abnormality is calculated as: in, represents the abnormal coefficient of the jth component data segment, is the variance of all time offsets of the jth component data segment, dP j,k Indicates the degree of ECG data deviation of the kth compressed tuple of the jth component data segment, dP j,k″ Indicates the degree of deviation of the k″th compressed tuple in the jth component data segment except the kth compressed tuple; The abnormal coefficient of the j-th component data segment is linearly normalized, and the result is recorded as the abnormal degree of the j-th component data segment.
7. A health data collection system for big data analysis, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the health data collection method for big data analysis as claimed in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Data compression method, encoding circuit and arithmetic device
CN111290697A
Electrocardiogram data processing method for small data processing equipment, electronic equipment and storage medium
CN113812959A