CN117271977A - HRV data preprocessing method and device and electronic equipment - Google Patents

HRV data preprocessing method and device and electronic equipment Download PDF

Info

Publication number
CN117271977A
CN117271977A CN202311265053.1A CN202311265053A CN117271977A CN 117271977 A CN117271977 A CN 117271977A CN 202311265053 A CN202311265053 A CN 202311265053A CN 117271977 A CN117271977 A CN 117271977A
Authority
CN
China
Prior art keywords
data
hrv
target
hrv data
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311265053.1A
Other languages
Chinese (zh)
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kingfar International Inc
Original Assignee
Kingfar International Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingfar International Inc filed Critical Kingfar International Inc
Priority to CN202311265053.1A priority Critical patent/CN117271977A/en
Publication of CN117271977A publication Critical patent/CN117271977A/en
Pending legal-status Critical Current

Links

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/02Detecting, measuring or recording pulse, heart rate, blood pressure or blood flow; Combined pulse/heart-rate/blood pressure determination; Evaluating a cardiovascular condition not otherwise provided for, e.g. using combinations of techniques provided for in this group with electrocardiography or electroauscultation; Heart catheters for measuring blood pressure
    • A61B5/024Detecting, measuring or recording pulse rate or heart rate
    • A61B5/02405Determining heart rate variability
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • A61B5/346Analysis of electrocardiograms
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • A61B5/346Analysis of electrocardiograms
    • A61B5/349Detecting specific parameters of the electrocardiograph cycle
    • A61B5/352Detecting R peaks, e.g. for synchronising diagnostic apparatus; Estimating R-R interval
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/9035Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/14Fourier, Walsh or analogous domain transformations, e.g. Laplace, Hilbert, Karhunen-Loeve, transforms
    • G06F17/141Discrete Fourier transforms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/10Pre-processing; Data cleansing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2433Single-class perspective, e.g. one-against-all classification; Novelty detection; Outlier detection

Abstract

The application relates to a HRV data preprocessing method, a device and electronic equipment, wherein the method comprises the following steps: acquiring HRV data corresponding to the sliding window; determining variances of a plurality of target peaks corresponding to the HRV data, and taking the HRV data with the variances conforming to a preset variance range as first target HRV data; determining RR interval sequences of first target HRV data based on a plurality of target peaks, judging whether each RR interval of the RR interval sequences accords with a preset heartbeat time interval range, and determining second target HRV data; and extracting time domain features, frequency domain features and nonlinear features of the second target HRV data. And filtering the abnormal data twice to obtain second target HRV data which is high in accuracy and accords with the heartbeat characteristic of the human body so as to extract accurate HRV characteristics.

Description

HRV data preprocessing method and device and electronic equipment
Technical Field
The application relates to the technical field of machine learning, in particular to a method and a device for preprocessing HRV data and electronic equipment.
Background
Biological signal classification is an important diagnostic tool in biomedical applications, and can help medical professionals to automatically classify monitored biological signal samples, and obtain classified normal biological signals and abnormal biological signals. Most biological signals are random and non-stationary in nature, meaning that their values are time dependent, with their statistics changing at different points in time.
HRV (Heart rate variability ) is an important class of bio-signal data, HRV being the change in heart rate rhythm over time. The clinical practice proves that the HRV can be used as an independent prediction index of sudden cardiac death risk, and has important significance in evaluating the prognosis of cardiovascular diseases and predicting acute cardiovascular events. Generally, HRV characteristic values can be extracted after preprocessing a large amount of collected physiological raw data, machine learning can be performed based on the extracted characteristic values, models such as cognitive load and the like can be trained, and the models can be used for predicting states such as fatigue and diseases.
However, the existing HRV signal data sources are electrocardiographic data or electrocardiographic monitor equipment, and due to the problems that the accuracy of the acquisition equipment is insufficient or the change of emotion actions of acquired personnel is large in a short time, and the like, some abnormal data exist in the acquired HRV signal data, the prior art adopts the obtained original HRV data to directly perform feature extraction, so that abnormal data or interference data exist in the extracted HRV data features, and the accuracy of predicting diseases according to the HRV data features in clinic is affected.
Disclosure of Invention
In order to solve the problem that the accuracy of HRV characteristic data obtained by the prior art is low, the application provides a HRV data preprocessing method, a device and electronic equipment.
In a first aspect, the present application provides a HRV data preprocessing method, which adopts the following technical scheme:
a HRV data preprocessing method comprising:
acquiring HRV data corresponding to the sliding window;
based on HRV data, determining a plurality of target peaks corresponding to the HRV data, calculating variances of the target peaks, and taking the HRV data, the variances of which accord with a preset variance range, as first target HRV data;
determining an RR interval sequence of first target HRV data based on the plurality of target peaks of the first target HRV data, judging whether each RR interval of the RR interval sequence accords with a preset heartbeat time interval range, and taking HRV data, of which each RR interval accords with the preset heartbeat time interval range, in the first target HRV data as second target HRV data; and extracting time domain features, frequency domain features and nonlinear features of the second target HRV data.
By adopting the technical scheme, HRV data corresponding to the sliding window is obtained; determining a plurality of target peaks corresponding to the HRV data, calculating variances of the plurality of target peaks, and screening the HRV data based on the variances corresponding to the HRV data, so that the HRV data with larger variances, namely the HRV data with large fluctuation degree and possibly abnormal, can be eliminated, and the first target HRV data which is high in accuracy and stable and accords with a preset variance range is obtained; determining an RR interval sequence of the first target HRV data based on a plurality of target peaks of the first target HRV data, wherein the RR interval in the RR interval sequence represents the time difference between two adjacent peaks and represents the time interval between two heartbeats of a human body, and the first target HRV data corresponding to abnormal heartbeats can be eliminated based on a preset heartbeat time interval range to obtain normal data, namely second target HRV data, and extracting the characteristics of each second target HRV data; and filtering the abnormal data twice through the variance and the preset heartbeat time interval range to obtain second target HRV data which is high in accuracy and accords with the heartbeat characteristic of the human body, and extracting the characteristics based on the second target HRV data to obtain accurate HRV characteristics.
The present application may be further configured in a preferred example to: the determining, based on the HRV data, a plurality of target peaks corresponding to the HRV data includes:
determining a plurality of initial peaks in the HRV data based on a shortest cardiac interval count, wherein the shortest cardiac interval count is a number of data points contained in one heartbeat in the HRV data;
determining a first upper envelope and a first lower envelope of the HRV data;
determining a voltage threshold for the HRV data based on a percentage threshold, the first upper envelope, and the first lower envelope; and selecting a peak value exceeding the voltage threshold value from the plurality of initial peak values to obtain a plurality of target peak values of the sub-HRV data.
By adopting the technical scheme, the peak value represents the maximum voltage amplitude of one heartbeat, the peak value corresponding to normal HRV data is in a set range, a plurality of initial peak values in the HRV data are determined based on the shortest cardiac interval number, and the voltage threshold of the HRV data is calculated based on the percentage threshold and the first upper envelope and the first lower envelope of the HRV data, wherein the voltage threshold represents the minimum peak value conforming to the human body characteristics, and the peak value conforming to the human body characteristics can be selected from the plurality of initial peak values through the voltage threshold as a target peak value, so that the target peak value is more accurate.
The present application may be further configured in a preferred example to: the obtaining HRV data corresponding to the sliding window includes:
acquiring first initial HRV data corresponding to a sliding window, and determining a second upper envelope curve and a second lower envelope curve of the first initial HRV data;
determining a maximum amplitude difference between the second upper envelope and the second lower envelope;
determining an amplitude adjustment ratio of each data point in the first initial HRV data based on a second upper envelope value, a second lower envelope value and the maximum amplitude difference value corresponding to each data point in the first initial HRV data;
and carrying out amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment proportion corresponding to the data point to obtain the HRV data.
By adopting the technical scheme, the first initial HRV data corresponding to the sliding window is obtained, the second upper envelope line and the second lower envelope line of the first initial HRV data and the maximum amplitude difference value of the second upper envelope line and the second lower envelope line are determined, the amplitude adjustment proportion of each data point in the initial total HRV data is determined based on the second upper envelope line value, the second lower envelope line value and the maximum amplitude difference value corresponding to each data point in the first initial HRV data, and then each data point is adjusted based on the amplitude adjustment proportion, so that the amplitude of the adjusted first initial HRV data is still in the original second upper envelope line and the original second lower envelope line, the amplitude of the data with too high amplitude is reduced, the amplitude of the data with too low amplitude is increased, and finally the amplitude of each data point in the first initial HRV data is adjusted in a reasonable amplitude interval, so that smooth and effective HRV data is obtained.
The present application may be further configured in a preferred example to: the performing amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment proportion corresponding to the data point to obtain HRV data, including:
performing amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment proportion corresponding to the data point to obtain first HRV data after the amplitude adjustment;
performing anomaly detection on the first HRV data after amplitude adjustment to determine an anomaly point;
and correcting the value of the abnormal point based on the mean value or the median value corresponding to the data points before or after the abnormal point to obtain the HRV data.
By adopting the technical scheme, the abnormal detection is carried out on the first HRV data after the amplitude adjustment, the abnormal point is determined, the value of the abnormal point is corrected based on the mean value or the median value of the surrounding data of the abnormal point, the abnormal value of the abnormal point can be returned to the normal value, and the accuracy and the smoothness of the HRV data are ensured.
The present application may be further configured in a preferred example to: the performing anomaly detection on the first HRV data after the amplitude adjustment to determine an anomaly point includes:
determining a first difference value between a target data point and a previous data point in the first HRV data after amplitude adjustment and a second difference value between the target data point and a next data point, wherein the target data point is any one data in the first sub-HRV data; calculating a first ratio of the first difference to the target data point and a second ratio of the second difference to the target data point;
And when the first ratio and the second ratio of the target data point are both larger than a preset ratio threshold, judging the target data point as an abnormal point.
By adopting the technical scheme, the first ratio and the second ratio of the target data point in the first HRV data after the amplitude adjustment are determined, if the first ratio and the second ratio of the target data point exceed the preset ratio threshold, the fact that the target data point generates numerical mutation compared with surrounding data points is indicated, the target data point is determined to be an abnormal point, and the abnormal point can be accurately determined through the change condition of the target data point compared with the surrounding data point.
The present application may be further configured in a preferred example to: the performing anomaly detection on the first HRV data after the amplitude adjustment to determine an anomaly point includes:
determining a median value of the amplitude-adjusted first HRV data, and determining a median deviation of a target data point in the amplitude-adjusted first HRV data based on the median value;
and when the median deviation of the target data point is larger than a preset deviation threshold value, judging the target data point as an abnormal point.
By adopting the technical scheme, the median value of the first HRV data after the amplitude adjustment is determined, the median deviation of the target data points in the first HRV data after the amplitude adjustment is determined based on the median value, if the median deviation of the target data points is larger than the preset deviation threshold value, the degree of the target data points shifting the median value of the first HRV data exceeds the normal range, the target data points are judged to be abnormal points, and the abnormal points with overlarge median values of the shifting data can be accurately screened out.
The present application may be further configured in a preferred example to: the obtaining the first initial HRV data corresponding to the sliding window includes:
acquiring second initial HRV data corresponding to the sliding window;
performing fast Fourier transform on the time domain signal corresponding to the second initial HRV data to obtain a frequency domain signal corresponding to the second initial HRV data;
judging whether the frequency domain signal corresponding to the second initial HRV data is an effective frequency domain signal or not based on a preset frequency domain interval;
if the effective frequency domain signal is effective, carrying out segment filtering on the effective frequency domain signal, integrating the effective frequency domain signal after segment filtering, and carrying out fast Fourier inverse transformation to obtain first initial HRV data after filtering.
Through adopting above-mentioned technical scheme, after the time domain signal converted into the frequency domain signal, judge effective frequency domain signal through predetermineeing the frequency domain interval, can get rid of the unusual data of frequency, obtain effective data, combine the segmentation filter operation again and denoise effective data, can accurately get rid of noise interference, improve the accuracy of first initial HRV data.
The present application may be further configured in a preferred example to: extracting nonlinear features of the second target HRV data, comprising:
Drawing a poincare scattergram and a difference scattergram based on the second target HRV data;
determining an ellipse major axis standard deviation and an ellipse minor axis standard deviation of the poincare scattergram;
determining the number of midpoints of a first quadrant and a third quadrant in the difference scatter diagram;
wherein the nonlinear feature comprises: the standard deviation of the major axis of the ellipse, the standard deviation of the minor axis of the ellipse, the number of midpoints of the first quadrant and the number of midpoints of the third quadrant.
By adopting the technical scheme, the Poincar scatter diagram and the difference scatter diagram are drawn based on the second target HRV data, the standard deviation of the major axis of the ellipse and the standard deviation of the minor axis of the ellipse obtained from the Poincar scatter diagram can reflect parasympathetic activity of a human body, the number of midpoints of the first quadrant and the number of midpoints of the third quadrant obtained from the difference scatter diagram can reflect two continuous cardiac interval changes, the heart rate and the sympathetic activity are indicated, and the physiological state of the human body can be evaluated based on the nonlinear indexes.
In a second aspect, the present application provides an HRV data preprocessing apparatus, which adopts the following technical scheme:
an HRV data preprocessing apparatus comprising:
the acquisition module is used for acquiring HRV data corresponding to the sliding window;
The first processing module is used for determining a plurality of target peaks corresponding to the HRV data based on the HRV data, calculating variances of the target peaks, and taking the HRV data with the variances conforming to a preset variance range as first target HRV data; the second processing module is used for determining an RR interval sequence of the first target HRV data based on the plurality of target peaks of the first target HRV data, judging whether each RR interval of the RR interval sequence accords with a preset heartbeat time interval range, and taking HRV data, of which each RR interval accords with the preset heartbeat time interval range, in the first target HRV data as second target HRV data;
and the extraction module is used for extracting the time domain features, the frequency domain features and the nonlinear features of the second target HRV data.
In a third aspect, the present application provides an electronic device, which adopts the following technical scheme:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: a HRV data preprocessing method as claimed in any one of the first aspects is performed.
In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
a computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the HRV data pre-processing method as claimed in any one of the first aspects.
In summary, the present application includes the following beneficial technical effects:
the method comprises the steps of obtaining HRV data corresponding to a sliding window; determining a plurality of target peaks corresponding to the HRV data, calculating variances of the plurality of target peaks, and screening the HRV data based on the variances corresponding to the HRV data, so that the HRV data with larger variances, namely the HRV data with large fluctuation degree and possibly abnormal, can be eliminated, and the first target HRV data which is high in accuracy and stable and accords with a preset variance range is obtained; determining an RR interval sequence of the first target HRV data based on a plurality of target peaks of the first target HRV data, wherein the RR interval in the RR interval sequence represents the time difference between two adjacent peaks and represents the time interval between two heartbeats of a human body, and the first target HRV data corresponding to abnormal heartbeats can be eliminated based on a preset heartbeat time interval range to obtain normal data, namely second target HRV data, and extracting the characteristics of each second target HRV data; and filtering the abnormal data twice through the variance and the preset heartbeat time interval range to obtain second target HRV data which is high in accuracy and accords with the heartbeat characteristic of the human body, and extracting the characteristics based on the second target HRV data to obtain accurate HRV characteristics.
Drawings
Fig. 1 is a schematic flow chart of an HRV data preprocessing method according to an embodiment of the present application;
FIG. 2 is a partial time domain signal waveform provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of a first upper envelope and a first lower envelope provided by an embodiment of the present application;
FIG. 4 is a schematic diagram of a target peak provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of waveforms before amplitude adjustment according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a waveform with amplitude adjustment according to an embodiment of the present application;
FIG. 7 is a graph showing waveforms before and after amplitude adjustment according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a power spectrum waveform provided by an embodiment of the present application;
FIG. 9 is a Pond-plus-Law scatter plot provided by an embodiment of the present application;
fig. 10 is a schematic structural diagram of an HRV data preprocessing apparatus according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present application is described in further detail below in conjunction with figures 1-11.
The present embodiment is merely illustrative of the present application and is not intended to be limiting, and those skilled in the art, after having read the present specification, may make modifications to the present embodiment without creative contribution as required, but is protected by patent laws within the scope of the claims of the present application.
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In addition, the term "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In this context, unless otherwise specified, the term "/" generally indicates that the associated object is an "or" relationship.
For ease of understanding, the terms involved in this scheme are explained as follows:
RR interval: the time difference, defined as the time difference between two consecutive peaks, also called NN Interval or IBI (Interval), is an important data for calculating HRV indicators, usually in ms.
Heart rate: indicating the number of beats per minute of a normal person in a quiet state.
ECG: the electrocardiogram can be used for recording the electric activity change generated by each cardiac cycle of the heart from the body surface of the human body.
PPG: the photoelectric volume diagram is characterized in that a photoelectric sensor is used for detecting the difference of reflected light intensities after absorption by human blood and tissues, and the change of the volume of a blood vessel in a cardiac cycle is traced.
The HRV data may be a time sequence of pulse intervals extracted from a normal human body electrocardiosignal ECG or a pulse signal PPG, and a signal waveform of the HRV data is a time domain signal, which represents a time-dependent change condition of voltage generated by human body heartbeat, wherein an abscissa of the time domain signal waveform represents time and an ordinate represents voltage.
The embodiment of the application provides a HRV data preprocessing method, as shown in fig. 1, where the method provided in the embodiment of the application may be executed by an electronic device, and the electronic device may be a server or a terminal device, where the server may be an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud computing services. The terminal device may be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto, and the terminal device and the server may be directly or indirectly connected through a wired or wireless communication manner, which is not limited herein.
The HRV data preprocessing method provided by the embodiment of the application mainly solves the problem that the accuracy of feature extraction is carried out on physiological original signals in a real-time prediction process, and due to the fact that the accuracy of acquisition equipment is insufficient or deviation possibly occurs in wearing, abnormal data exist in the acquired HRV data, the HRV data is preprocessed, the abnormal data in the HRV data are removed, the accuracy of the HRV data is improved, and therefore more accurate data features are extracted, and the method comprises the following steps:
s101, acquiring HRV data corresponding to the sliding window.
In the embodiment of the application, real-time HRV data is acquired, and the real-time HRV data is segmented according to the sliding window, so that the HRV data corresponding to the sliding window is obtained.
Specifically, the sliding window slides for a specific time length, so that the data of the sliding window time length is segmented from the HRV data acquired in real time, and when the time length of acquiring the real-time HRV data is longer than the sliding window time length, the real-time HRV data can be segmented through the sliding window. Assuming that the duration of the sliding window is set to 15s, the sliding specific duration of the sliding window is set to 1s, when the duration of acquiring real-time HRV data exceeds 15s, the sliding window can divide the real-time HRV data once to acquire the HRV data of 0-15s corresponding to the sliding window, and when the duration of the real-time HRV data exceeds the sum of the duration of the sliding window and the sliding specific duration, namely 16s, the sliding window is used for dividing the real-time HRV data for the second time to acquire the HRV data of 1-16s corresponding to the sliding window. And by analogy, each time the sliding window slides, the HRV data of 15s can be obtained, and finally a plurality of HRV data are obtained.
The embodiment of the application is not limited to a specific sliding duration and a sliding window duration, and a user can set the sliding duration according to actual requirements.
And the sliding window divides the real-time HRV data according to the sliding specific time length to obtain the HRV data corresponding to the sliding window. The sequential relation in the time sequence can be reserved through the sliding window segmentation data, so that the long sequence is segmented into a plurality of shorter window data, namely HRV data, the adjacent HRV data have data redundancy, the relative integrity of the whole data can be ensured even if part of window data are removed in the subsequent data processing process, finer changes and fluctuation can be captured through the window data, and further, the data are removed according to the abnormal conditions in the fine changes and fluctuation, so that the finally reserved data are more accurate.
S102, determining a plurality of target peaks corresponding to the HRV data based on the HRV data, calculating variances of the target peaks, and taking the HRV data with the variances in accordance with a preset variance range as first target HRV data.
In the embodiment of the present application, it is assumed that n target peaks corresponding to a certain sliding window are respectively: r1, R2 … … Rn. Calculating the average avg of n target peaks, wherein the expression is as follows:
Calculating the variance s of n target peaks 2 The expression is:
wherein n represents the number of target peaks, R i The i-th target peak value of the n target peak values is represented, and avg represents the average value of the n target peak values.
Judging whether the variance accords with a preset variance range, if the variance does not accord with the preset variance range, the method indicates that the target peak value corresponding to the sub HRV data generates larger fluctuation possibly caused by network delay of the acquisition equipment worn by a human body or shaking of the acquisition equipment worn by the human body, and eliminating the HRV data for the accuracy of the whole data, and only retaining the HRV data with the variance accord with the preset variance range as first target HRV data. The preset variance range represents the fluctuation degree of the target peak value and can be set to 0-1 according to actual requirements.
S103, determining an RR interval sequence of the first target HRV data based on a plurality of target peaks of the first target HRV data, judging whether each RR interval of the RR interval sequence accords with a preset heartbeat time interval range, and taking the HRV data, of which each RR interval accords with the preset heartbeat time interval range, in the first target HRV data as second target HRV data.
In this embodiment of the present application, for the first target HRV data, the time corresponding to each of the plurality of target peaks is obtained, the time difference between two adjacent target peaks in the first target HRV data is calculated, so as to obtain an RR interval sequence corresponding to the first target HRV data, assuming that the number of target peaks of the first target HRV data is n+1, and the abscissa time corresponding to the target peaks is R1, R … … rn+1, respectively, where the number of RR intervals obtained by calculating the time difference between each two adjacent target peaks is n, and the corresponding RR interval sequence may be represented as [ RR1, RR2 … … RRn ], where rrn=rn+1-Rn.
FIG. 2 shows a partial time domain signal waveform corresponding to first target HRV data, with the abscissa representing time and the ordinate representing voltage magnitude corresponding to time; the peak value represents the maximum voltage generated by one heartbeat, 3 target peaks are shown in fig. 2, the corresponding abscissa is R1, R2, R3, the time difference between R1 and R2 is R2-R1, the RR interval formed by R1 and R2 is RR1, and similarly, the RR interval formed by R2 and R3: rr2=r3-R2. The QST wave groups in FIG. 2 represent ventricular depolarization; p-waves represent atrial activation; t-wave represents ventricular repolarization; QT interval represents the time from ventricular depolarization to complete repolarization; the ST segment indicates that ventricular depolarization is complete and repolarization has not yet begun for a period of time.
The preset heartbeat time interval range represents the maximum value of the RR interval under normal conditions, and can be determined according to the age of the tested person. If RR intervals which do not accord with the preset heartbeat time interval exist in the RR interval sequence corresponding to the first target HRV data, the first target HRV data corresponding to the abnormal data are removed, and the first target HRV data, of which each RR interval accords with the preset heartbeat time interval range, are reserved as second target HRV data.
S104, extracting time domain features, frequency domain features and nonlinear features of the second target HRV data.
In the embodiment of the present application, the HRV data corresponding to the sliding window is obtained; determining a plurality of target peaks corresponding to the HRV data, calculating variances of the plurality of target peaks, and screening the HRV data based on the variances corresponding to the HRV data, so that the HRV data with larger variances, namely the HRV data with large fluctuation degree and possibly abnormal, can be eliminated, and the first target HRV data which is high in accuracy and stable and accords with a preset variance range is obtained; determining an RR interval sequence of the first target HRV data based on a plurality of target peaks of the first target HRV data, wherein the RR interval in the RR interval sequence represents the time difference between two adjacent peaks and represents the time interval between two heartbeats of a human body, and the first target HRV data corresponding to abnormal heartbeats can be eliminated based on a preset heartbeat time interval range to obtain normal data, namely second target HRV data, and extracting the characteristics of each second target HRV data; and filtering the abnormal data twice through the variance and the preset heartbeat time interval range to obtain second target HRV data which is high in accuracy and accords with the heartbeat characteristic of the human body, and extracting the characteristics based on the second target HRV data to obtain accurate HRV characteristics.
One possible implementation manner of the embodiments of the present application, based on HRV data, determines a plurality of target peaks corresponding to the HRV data, including:
determining a plurality of initial peaks in the HRV data based on a shortest cardiac interval number, wherein the shortest cardiac interval number is the number of data points contained in one heartbeat in the HRV data;
determining a first upper envelope and a first lower envelope of HRV data;
determining a voltage threshold for HRV data based on the percentage threshold, the first upper envelope, and the first lower envelope;
and selecting a peak value exceeding a voltage threshold value from the plurality of initial peak values to obtain a plurality of target peak values of the sub-HRV data.
In this embodiment, the number of shortest cardiac interval points represents the number of data points corresponding to at least one heartbeat, which can be calculated by an expression:
wherein, winSize is the shortest cardiac interval point number, maxRatePerMin1 represents the maximum heart rate, namely the maximum number of heartbeats per minute of a normal person in a quiet state, and can be set to 120 according to the characteristics of a human body; freq is the sampling rate set when the original HRV data is acquired, representing how many data points are acquired per second; 60 denotes that 1min is 60s for unit conversion.
In the embodiment of the application, all maximum value points and minimum value points in HRV data are determined; segmenting the HRV time domain signal waveform (namely HRV data) according to the shortest cardiac interval point number to obtain a plurality of data segments, wherein the number of data points contained in each data segment is the shortest cardiac interval point number; for each data segment, if the data segment does not contain a maximum value, the initial peak value is not selected, if the data segment contains a maximum value, the maximum value is used as the initial peak value, and if the data segment contains two or more maximum values, one of the two or more maximum values with the largest amplitude is selected as the initial peak value, so that a plurality of initial peak values corresponding to the HRV data are obtained.
And screening the initial peak value through a voltage threshold value to obtain a target peak value which accords with the human body characteristics. Specifically, as shown in fig. 3, all maximum points are connected by a smooth curve to form a first upper envelope of HRV data, and for a minimum point between two adjacent maximum points, the minimum point is selected as a trough, and all troughs are connected by a smooth curve to form a first lower envelope of HRV data.
Determining the amplitude difference value of a first upper envelope curve and a first lower envelope curve corresponding to each data point in HRV data, wherein the expression of the difference value is as follows:
maxThresholdi=upperEnvelopei-underEnvelopei
Wherein maxThresholdi represents the difference between the first upper envelope corresponding to the i-th data point in the HRV data and the first lower envelope, uperdenvelopei represents the amplitude of the first upper envelope corresponding to the i-th data point in the HRV data, and underdenvelopei represents the amplitude of the first lower envelope corresponding to the i-th data point in the HRV data.
A maximum value maxThreshold1 of the amplitude difference before the first upper envelope and the first lower envelope is determined.
Calculating a voltage threshold, which is also called a percentage line value, and representing the minimum value of a peak value in HRV data collected by a normal human body, wherein the expression of the percentage line value Y is as follows:
Y=maxThreshold1×thersholdPercent+underEnvelope
wherein, thermoshalddpercent is a preset percentage threshold, which can be set according to historical HRV data, such as 70%; maxThreshold1 is the maximum value of the amplitude difference before the first upper envelope and the first lower envelope; the underEnvelope is the magnitude of the first lower envelope corresponding to maxThreshold1.
As shown in fig. 4, the curve is the time domain signal waveform of the sub-HRV data, the straight line is a percentage line, and the corresponding amplitude is the voltage threshold, wherein the initial peak exceeding the voltage threshold is determined as the target peak.
It can be seen that, in the embodiment of the present application, the peak value represents the maximum voltage amplitude of one heartbeat, the peak value corresponding to the normal HRV data is in a set range, multiple initial peak values in the HRV data are determined based on the number of shortest cardiac intervals, and based on the percentage threshold and the first upper envelope and the first lower envelope of the HRV data, the voltage threshold of the HRV data is calculated, the voltage threshold represents the minimum peak value conforming to the human body characteristics, and the peak value conforming to the human body characteristics can be selected from the multiple initial peak values as the target peak value through the voltage threshold, so that the target peak value is more accurate.
Further, to improve the accuracy of HRV data, calculating the variance of the plurality of target peaks includes: calculating the time difference between two adjacent target peaks as an RR interval; judging whether the RR interval is in a preset time interval range, if any RR interval is not in a heartbeat time interval range, determining the HRV data as abnormal data; if all RR intervals are in the range of the heartbeat time interval, calculating variances of a plurality of target peaks, and taking HRV data with variances conforming to a preset variance range as first target data. The heartbeat time interval range accords with the RR interval corresponding to the sub-HRV data acquired from the normal human body, and can be set to be 0-3s.
In one possible implementation manner of the embodiment of the present application, obtaining HRV data corresponding to a sliding window includes:
acquiring first initial HRV data corresponding to the sliding window, and determining a second upper envelope curve and a second lower envelope curve of the first initial HRV data;
determining a maximum amplitude difference between the second upper envelope and the second lower envelope;
determining an amplitude adjustment ratio of each data point in the first initial HRV data based on a second upper envelope value, a second lower envelope value and a maximum amplitude difference value corresponding to each data point in the first initial HRV data;
And carrying out amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment proportion corresponding to the data point to obtain the HRV data.
Specifically, the second upper envelope and the second lower envelope of the first initial HRV data are determined, and the process of generating the envelopes may refer to the process of generating the first upper envelope and the first lower envelope described above.
The expression for the amplitude adjustment ratio of the current data point is:
wherein h1 is the amplitude at the second upper envelope corresponding to the current data point, h2 is the amplitude at the second lower envelope corresponding to the current data point, and maxThreshold2 is the maximum value of the amplitude difference between the second upper envelope and the second lower envelope.
The expression of the amplitude result h3 after the current data point adjustment is:
where h is the amplitude before the current data point is adjusted, h2 is the amplitude at the second lower envelope corresponding to the current data point, and ratio is the amplitude adjustment ratio of the current data point.
The amplitude of the original HRV data collected by the device is voltage, the amplitude of the original HRV data can be converted into percentage from the voltage, the HRV data can be conveniently processed and analyzed, specifically, the ratio of the voltage amplitude of all the HRV data points to the set value is taken as the amplitude of the updated data point, and the first original HRV data with the amplitude represented by the percentage is obtained, wherein the set value is set according to actual requirements, so that the original voltage amplitude is adjusted to be in a proper percentage range through the set value.
FIG. 5 is a graph of waveforms before amplitude adjustment of first initial HRV data, with the horizontal axis of the waveform representing time and the vertical axis representing amplitude in percent; FIG. 6 is a waveform diagram of HRV data after amplitude adjustment; fig. 7 is a comparison of waveforms before and after amplitude adjustment, and it can be seen that the waveform after amplitude adjustment is in a smaller amplitude range, and the waveform after amplitude adjustment is more gentle.
It can be seen that, in this embodiment of the present application, the first initial HRV data corresponding to the sliding window is obtained, the second upper envelope and the second lower envelope of the first initial HRV data, and the maximum amplitude difference between the second upper envelope and the second lower envelope are determined, the amplitude adjustment proportion of each data point in the initial total HRV data is determined based on the second upper envelope value, the second lower envelope value, and the maximum amplitude difference corresponding to each data point in the first initial HRV data, and then each data point is adjusted based on the amplitude adjustment proportion, so that the amplitude of the adjusted first initial HRV data is still in the original second upper envelope and lower envelope, the amplitude of the data with too high amplitude is reduced, the amplitude of the data with too low amplitude is increased, and finally, the amplitude of each data point in the first initial HRV data is adjusted in a reasonable amplitude interval, so as to obtain smooth and effective HRV data.
In one possible implementation manner of the embodiment of the present application, performing amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment proportion corresponding to the data point, to obtain HRV data, including:
performing amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment proportion corresponding to the data point to obtain first HRV data after the amplitude adjustment;
performing anomaly detection on the first HRV data after amplitude adjustment to determine an anomaly point;
and correcting the value of the abnormal point based on the mean value or the median value corresponding to the data points before or after the abnormal point to obtain HRV data.
The first initial HRV data is overall non-smooth, and the accuracy of the data may be improved by detecting and correcting anomalous data. For the detected abnormal points, the embodiment provides two correction methods, namely a mean value correction method and a median value correction method.
Specifically, for each abnormal point, taking the average value or the median value corresponding to a plurality of data points before or after the abnormal point as the replacement value of the abnormal point. The plurality of data points may be a specific number of data points before or after the abnormal point, or the plurality of data points are data points corresponding to a specific time period before or after the abnormal point, wherein the specific number and the specific time period are set according to actual requirements, and optionally, the specific number is set to 75, and the specific time period is set to 2.5s.
Therefore, in the embodiment of the application, the abnormal detection is performed on the first HRV data after the amplitude adjustment, the abnormal point is determined, and the value of the abnormal point is corrected based on the mean value or the median value of the surrounding data of the abnormal point, so that the abnormal value of the abnormal point can be returned to the normal value, and the accuracy and the smoothness of the HRV data are ensured.
In one possible implementation manner of the embodiment of the present application, performing anomaly detection on the first HRV data after amplitude adjustment, and determining an outlier includes:
determining a first difference value between a target data point and a previous data point in the first HRV data after the amplitude adjustment and a second difference value between the target data point and a next data point, wherein the target data point is any one data in the first sub-HRV data;
calculating a first ratio of the first difference to the target data point and a second ratio of the second difference to the target data point;
and when the first ratio and the second ratio of the target data point are both larger than the preset ratio threshold, determining the target data point as an abnormal point.
In the present embodiment, the percentage detection is used to detect outliers that produce an abrupt change in amplitude compared to neighboring data points. The preset ratio threshold value represents the change degree of the amplitude of the target data point compared with the previous data point or the next data point, and the change degree of the amplitude of the target data point can be set to be 20% according to actual requirements.
Specifically, assuming that the amplitude of the target datase:Sub>A point is B, the amplitude of the previous datase:Sub>A point of the target datase:Sub>A point is ase:Sub>A, the amplitude of the next datase:Sub>A point of the target datase:Sub>A point is C, the difference between the target datase:Sub>A point and the previous datase:Sub>A point is ase:Sub>A first difference B-ase:Sub>A, and the difference between the target datase:Sub>A point and the next datase:Sub>A point is ase:Sub>A second difference B-C. The absolute value of the ratio of the first difference B-A to the target datase:Sub>A point, namely the first ratio I (B-A)/B multiplied by 100% |, and the absolute value of the ratio of the second difference B-C to the target datase:Sub>A point, namely the second ratio I (B-C)/B multiplied by 100% |, if the first ratio and the second ratio of the target datase:Sub>A point are both larger than ase:Sub>A preset ratio threshold value, the target datase:Sub>A point is judged to be an abnormal point.
It can be seen that, in the embodiment of the present application, the first ratio and the second ratio of the target data point in the first HRV data after the amplitude adjustment are determined, if the first ratio and the second ratio of the target data point both exceed the preset ratio threshold, the first ratio and the second ratio of the target data point indicate that the target data point generates a numerical mutation compared with surrounding data points, the target data point is determined to be an abnormal point, and the abnormal point can be accurately determined through the change condition of the target data point compared with the surrounding data points.
In one possible implementation manner of the embodiment of the present application, performing anomaly detection on the first HRV data after amplitude adjustment, and determining an outlier includes:
Determining a median value of the amplitude-adjusted first HRV data, and determining a median deviation of a target data point in the amplitude-adjusted first HRV data based on the median value;
and when the median deviation of the target data point is larger than a preset deviation threshold value, judging the target data point as an abnormal point.
In the embodiment of the application, determining a median of the first HRV data after the amplitude adjustment; calculating the absolute value of the difference value between each data point and the median value to generate a difference value set; the median diff of the set of differences is determined.
Calculating the median deviation f of the target data points, wherein the expression is as follows:
where k is an empirically set coefficient, and the value of k is 1.483.
If the median deviation of the target data point is greater than the preset deviation threshold, the target data point is judged to be an abnormal point. The preset threshold value represents the maximum degree of the target data point offset data median value, and can be set to be 4 according to practical experience.
It can be seen that, in the embodiment of the present application, the median value of the first HRV data after the amplitude adjustment is determined, and the median deviation of the target data point in the first HRV data after the amplitude adjustment is determined based on the median value, if the median deviation of the target data point is greater than the preset deviation threshold, it indicates that the degree of the target data point shifting the median value of the first HRV data exceeds the normal range, and the target data point is determined as an abnormal point, so that the abnormal point with the excessively large median value of the shift data can be accurately screened out.
In one possible implementation manner of the embodiment of the present application, obtaining first initial HRV data corresponding to a sliding window includes:
acquiring second initial HRV data corresponding to the sliding window;
performing fast Fourier transform on the time domain signal corresponding to the second initial HRV data to obtain a frequency domain signal corresponding to the second initial HRV data;
judging whether a frequency domain signal corresponding to the second initial HRV data is a valid frequency domain signal or not based on a preset frequency domain interval;
if the effective frequency domain signal is effective, carrying out segment filtering on the effective frequency domain signal, integrating the effective frequency domain signal after segment filtering, and carrying out fast Fourier inverse transformation to obtain first initial HRV data after filtering.
The main principle of the filtering is that the time domain signal is converted into the frequency domain signal by segmentation, the frequency domain signal is filtered and then converted back into the time domain signal, and the obtained second initial HRV data corresponding to the sliding window is subjected to fast Fourier transform to obtain the frequency domain signal.
The frequency domain signals of the HRV data are mainly concentrated in a preset frequency domain interval, the ratio of the signal energy in the preset frequency domain interval to the total energy of the frequency domain is calculated, if the ratio is larger than a preset ratio threshold, the HRV data corresponding to the frequency domain signals are effective data, and the effective HRV data are selected for filtering to obtain accurate first initial HRV data. Wherein, the preset frequency domain interval of the PPG signal can be selected to be 0.5-4Hz; the preset frequency domain interval of the ECG signal can be selected to be 0.25-45Hz, and the preset ratio threshold can be set to be 90% according to practical experience.
The effective frequency domain signal is subjected to the segment filtering, and the segment filtering has the advantages that no phase deviation exists, but the data cannot be too long, and the window length in the real-time filtering cannot be too long, so in the embodiment of the application, a window with the length of 4096 is selected as a filtering window, and each filtering window represents one segment of HRV data, wherein 4096 data points are contained.
Further, the window filtering may employ high pass filtering. The high-pass filtering is set to enable the high-frequency signal to normally pass, and the low-frequency signal lower than the set frequency critical value is blocked or weakened, so that the data puncture can be solved, and the power frequency interference in the environment can be removed. Data skip refers to random and transient spikes, jitter, or outliers in the data that occur due to quality problems with the data source, sampling bias, equipment failure, or other external factors. Because other equipment interference exists or the acquisition equipment is easy to shake when being an ear clip sensor, power frequency interference signals can be generated, the power frequency interference signals are generally 50Hz or 60Hz, and the interference signals are mainly represented by sine waves or superposition of other signals and sine waves which can occur during signal measurement.
It can be seen that in the embodiment of the present application, after the time domain signal is converted into the frequency domain signal, the effective frequency domain signal is determined through the preset frequency domain interval, so that the data with abnormal frequency can be removed, the effective data is obtained, and then the effective data is denoised by combining the segmentation filtering operation, so that noise interference can be accurately removed, and the accuracy of the first initial HRV data is improved.
In one possible implementation manner of the embodiment of the present application, before filtering the second initial HRV data, performing wavelet decomposition on the second initial HRV data corresponding to the sliding window, where the wavelet coefficient generated by the wavelet decomposition contains important information of the HRV data, the wavelet coefficient corresponding to the effective data after the wavelet decomposition is larger, the wavelet coefficient corresponding to the noise is smaller, and the wavelet coefficient of the noise is smaller than the wavelet coefficient of the effective signal, selecting a suitable preset threshold value for screening, where the wavelet coefficient greater than the threshold value is considered as the effective signal, the wavelet coefficient smaller than the threshold value is considered as the noise, adjusting the wavelet coefficient based on the preset threshold value, and performing wavelet reconstruction on the adjusted wavelet coefficient of each layer to obtain the second initial HRV data after the wavelet denoising;
the number of layers of wavelet decomposition is set according to actual requirements, and can be five layers; the preset threshold is set according to the noise level in the history data, and may be set to 30db.
Further, the wavelet coefficients are adjusted based on the preset threshold, and the wavelet coefficients smaller than the preset threshold can be zeroed, the wavelet coefficients not smaller than the preset threshold are not processed, or the difference value between the wavelet coefficients and the preset threshold is used for replacing the wavelet coefficients not smaller than the preset threshold.
In one possible implementation manner of the embodiment of the present application, before sub HRV data, in which each RR interval in the first target HRV data conforms to a preset heartbeat time interval range, is used as the second target HRV data, the method further includes:
determining the age of a person corresponding to the HRV data;
determining a preset heartbeat time interval range corresponding to the personnel age based on the personnel age corresponding to the HRV data and a preset normal heartbeat list;
the normal heartbeat list represents the corresponding relation between different age groups and normal heartbeat ranges.
In practical situations, the heart rates of people in different age groups are different, and the corresponding RR intervals are also different, so that the normal RR interval range can be determined by combining the ages of the people.
Specifically, the normal heart rate corresponding to different age groups may refer to a preset normal heart rate list: neonates (birth to 4 weeks): 100-205; infants (4 weeks to 1 year): 100-180; infants (1 to 3 years): 98-140; preschool shift (3 to 5 years): 80-120 parts; age of school (5 to 12 years): 75-118; teenagers (13 to 18 years): 60-100; adult (18 years old or older): 60-100; adult athletes: 40-60.
And determining a preset heartbeat time interval range according to the personnel age corresponding to the HRV data and a preset normal heartbeat list, wherein RR interval=60000/heart rate, and 60000 represents 1 min=60000 ms.
Judging whether each RR interval of the RR interval sequence accords with a preset heartbeat time interval range, if the RR interval which does not accord with the preset heartbeat time interval range exists in the first target HRV data, eliminating the first target HRV data, and taking the HRV data, of which each RR interval accords with the preset heartbeat time interval range, in the first target HRV data as second target HRV data.
Embodiments of the present application are further described with respect to extracting features of the second target HRV data.
In one implementation, the second target HRV data is considered as a function of time, and the time domain features of the second target HRV data are obtained through analysis, where the time domain features may include: meanRR (ms), meanHR (bpm), SDNN (ms), SDANN (ms), RMSSD (ms), SDSD (ms), pNN50 (%) and pNN20 (%).
Time domain features of the second target HRV data, comprising:
MeanRR: the mean value of N RR intervals is expressed in ms, and the expression is:
MeanHR represents the average heart rate value expressed as:
where 60000 denotes 1 min=60 s=60000 ms, and meanrr denotes the mean of N RR intervals.
SDNN: the standard deviation representing N RR intervals can reflect the slow change of heart rate, is a sensitive index for evaluating the sympathetic nerve function, and has the expression:
Wherein RR i Representing the ith RR roomA period; meanRR represents the mean of N RR intervals.
SDANN: the standard deviation of the RR interval mean value in the preset time is represented, and the assumption is that M sliding windows exist in the preset time, wherein the M sliding windows correspond to the M RR interval mean values and are respectively as follows: the expression of MeanRR1, meanRR2 … … meanrm, SDANN is:
wherein MeanRR z The expression of the average value of M RR interval averages is:
RMSSD: root mean square representing consecutive adjacent RR intervals, expressed as:
wherein RR i Represents the i-th RR interval, RR i-1 Indicating the i-1 st RR interval.
SDSD: the standard deviation representing the difference between adjacent RR intervals is expressed as:
/>
wherein RR i Represents the i-th RR interval, RR i-1 Represents the i-1 th RR interval, N is the number of RR intervals, and MeanRR represents the average of N RR intervals.
pNN50: representing the percentage of the number of RR intervals with the difference between adjacent RR intervals being greater than 50ms to the total number of RR intervals, assuming the number of RR intervals is N, calculating the absolute value of the difference between each RR interval and the previous RR interval to obtain the absolute value of N-1 differences, wherein the absolute value of a differences is greater than 50ms, the NN50 value is a, and the pNN50 expression is:
pNN20: representing the percentage of the number of RR intervals with the difference between adjacent RR intervals being more than 20ms to the total number of RR intervals, assuming that the number of RR intervals is N, calculating the absolute value of the difference between each RR interval and the previous RR interval to obtain the absolute value of N-1 differences, wherein the absolute value of b differences is more than 20ms, the value of NN20 is b, and the expression of pNN20 is:
In one implementation, extracting frequency domain features of the second target HRV data includes: converting the time domain signal of the second target HRV data into a frequency domain signal by using fast fourier transform, and further extracting features of the frequency domain signal, where the obtained frequency domain features may include: the frequency bands comprise ultra-low frequency, low frequency and high frequency, and frequency ranges corresponding to the frequency bands; total Power (ms 2) represents the sum of the Power of ultra-low frequency, low frequency and high frequency; power (ms 2), which represents the percentage of the total Power of the Power band of the band; power Percent (%) represents Power Normalized, and represents the percentage of low frequency and high frequency Power in the sum of the low frequency and high frequency Power, respectively; peak (Hz), which represents the frequency corresponding to the maximum power value in different frequency bands; LF/HF, which represents the ratio of low-band to high-band power.
Specifically, the frequency domain features of the second target HRV data include:
converting the frequency domain signal corresponding to the second target HRV data from the frequency domain spectrum to the power spectrum, wherein the obtained power spectrum waveform is shown in fig. 8, and the signal in fig. 8 is divided into 4 frequency bands, which are respectively: ultra-low frequency ULF, the frequency range is 0-0.0033Hz; very low frequency VLF, the frequency range of which is 0.0033-0.04Hz; low frequency LF, its range frequency is 0.04-0.15Hz; high frequency HF, which has a frequency in the range of 0.15-0.4Hz.
The Power of the frequency band can be represented by the area of a graph formed by a frequency band time axis and a waveform, so that the Power corresponding to 4 frequency bands is obtained, and the Power is respectively: ultra-low frequency power bilf, ultra-low frequency power PVLF, low frequency power PLF, high frequency power PHF.
Total Power: the expression of the sum of ultra-low frequency power PULF, ultra-low frequency power PVLF, low frequency power PLF and high frequency power PHF is:
Total Power=P ULF +P VLF +P LF +P HF
power percentage: the power of the frequency band is expressed as a percentage of the total power, and the ultra-low frequency ULF is taken as an example, and the expression of the percentage of the power of the frequency band is as follows:
the Total Power is the sum of ultra-low frequency Power PULF, ultra-low frequency Power PVLF, low frequency Power PLF and high frequency Power PHF.
Power Normalized: the low frequency and high frequency power are expressed as the percentage of the sum of the low frequency and high frequency power, and the low frequency LF is taken as an example, and the percentage expression of the power of the low frequency and high frequency power is as follows:
wherein PLF represents low frequency power and PHF represents high frequency power.
Peak: and the frequency corresponding to the power maximum value in different frequency bands is represented, and the frequency corresponding to the power maximum value in different frequency bands can be determined based on the power spectrum.
LF/HF: representing the ratio of the low-band to high-band power, i.e., PLF/PHF.
One possible implementation manner of the embodiment of the present application, extracting the nonlinear feature of the second target HRV data includes:
drawing a poincare scattergram and a difference scattergram based on the second target HRV data;
determining the standard deviation of the elliptic long axis and the standard deviation of the elliptic short axis of the Pond-plus-minus plot;
determining the number of midpoints of a first quadrant and a third quadrant in the difference scatter diagram;
wherein the nonlinear feature comprises: the standard deviation of the major axis of the ellipse, the standard deviation of the minor axis of the ellipse, the number of midpoints of the first quadrant and the number of midpoints of the third quadrant.
Poincare: the poincare scattergram, which is an image drawn by using RR interval changes, each RR interval is affected by the previous RR interval, as shown in fig. 9, the abscissa of the poincare scattergram is the IBI interval (RR interval), the ordinate is the next IBI interval (RR interval), and the poincare scattergram reveals the correlation between successive values in the time sequence, includes the linear and nonlinear change trend of HRV, gives visual display of heart fluctuation, and can reveal nonlinear process and aperiodic motion.
The nonlinear index extracted from the poincare scattergram includes: an ellipse major axis standard deviation SD1, an ellipse minor axis standard deviation SD2, wherein:
SD1, representing short term variability, generally reflects parasympathetic activity, which decreases when SD1 decreases, increases, and SD1 has the expression:
where SDSD represents the standard deviation of the difference between adjacent RR intervals in the time domain feature.
SD2, representing long term variability, correlates more strongly with sympathetic activity than parasympathetic activity, and increases when SD2 decreases, with SD2 expressed as:
wherein, the standard deviation of N RR intervals in the time domain feature is represented, and the SDSD is represented by the standard deviation of the difference between adjacent RR intervals in the time domain feature.
Scatter: a difference scatter plot, also called a second order difference plot, for evaluating the intersectionThe balance of the sensory and parasympathetic nerves and the spectral analysis estimates, the advantage is to utilize a stable associated RR interval sequence. The difference scatter diagram is used for making difference values in three continuous RR intervals to obtain a coordinate point diagram, and the x-axis of the difference scatter diagram represents the duration RR of the current heart beat i With the previous heart beat RR i-1 The coordinates of the ith point on the x-axis are:
x i =RR i -RR i-1
the y-axis of the difference scatter plot represents the current heart beat RR i Duration RR of the next heart beat i+1 The coordinates of the ith point on the y-axis are:
y i =RR i -RR i+1
the difference scatter plot represents the correlation between successive rate values in the time series, and the nonlinear index extracted from the difference scatter plot is: the number of midpoints A++ in the first quadrant and the number of midpoints B- -, in the third quadrant, with the units of ms on the abscissa.
A++, the first quadrant points represent two consecutive cardiac interval increases, the heart rate decreases, representing parasympathetic activity.
B-, the third quadrant points represent two successive heart interval decreases, and the heart rate increases, representing sympathetic activity.
For the time domain features, the frequency domain features and the nonlinear features extracted after HRV data processing, the features can be used for machine learning training, so that the human physiological state is predicted through a trained model, and the accuracy of prediction is improved.
The above embodiments describe a HRV data preprocessing method from the viewpoint of a method flow, and the following embodiments describe a HRV data preprocessing apparatus from the viewpoint of a virtual module or a virtual unit, which are described in detail in the following embodiments.
An embodiment of the present application provides an HRV data preprocessing apparatus, as shown in fig. 10, the apparatus may include:
an obtaining module 1001, configured to obtain HRV data corresponding to a sliding window;
The first processing module 1002 is configured to determine a plurality of target peaks corresponding to HRV data, calculate variances of the plurality of target peaks, and use HRV data whose variances conform to a preset variance range as first target HRV data;
the second processing module 1003 is configured to determine an RR interval sequence of the first target HRV data based on a plurality of target peaks of the first target HRV data, determine whether each RR interval of the RR interval sequence accords with a preset heartbeat time interval range, and use HRV data in the first target HRV data, where each RR interval accords with the preset heartbeat time interval range, as second target HRV data;
the extracting module 1004 is configured to extract a time domain feature, a frequency domain feature, and a nonlinear feature of the second target HRV data.
The present application may be further configured in a preferred example to: the first processing module 1002 is specifically configured to, when executing the determination of the plurality of target peaks corresponding to the HRV data based on the HRV data:
determining a plurality of initial peaks in the HRV data based on a shortest cardiac interval number, wherein the shortest cardiac interval number is the number of data points contained in one heartbeat in the HRV data;
determining a first upper envelope and a first lower envelope of HRV data;
Determining a voltage threshold for HRV data based on the percentage threshold, the first upper envelope, and the first lower envelope;
and selecting a peak value exceeding a voltage threshold value from the plurality of initial peak values to obtain a plurality of target peak values of the sub-HRV data.
The present application may be further configured in a preferred example to: the obtaining module 1001 is specifically configured to, when performing obtaining HRV data corresponding to a sliding window:
acquiring first initial HRV data corresponding to the sliding window, and determining a second upper envelope curve and a second lower envelope curve of the first initial HRV data;
determining a maximum amplitude difference between the second upper envelope and the second lower envelope;
determining an amplitude adjustment ratio of each data point in the first initial HRV data based on a second upper envelope value, a second lower envelope value and a maximum amplitude difference value corresponding to each data point in the first initial HRV data;
and carrying out amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment proportion corresponding to the data point to obtain the HRV data.
The present application may be further configured in a preferred example to: the obtaining module 1001 is specifically configured to, when performing amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment ratio corresponding to the data point to obtain HRV data:
Performing amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment proportion corresponding to the data point to obtain first HRV data after the amplitude adjustment;
performing anomaly detection on the first HRV data after amplitude adjustment to determine an anomaly point;
and correcting the value of the abnormal point based on the mean value or the median value corresponding to the data points before or after the abnormal point to obtain HRV data.
The present application may be further configured in a preferred example to: the obtaining module 1001 is specifically configured to, when performing anomaly detection on the first HRV data after the amplitude adjustment and determining an anomaly point:
determining a first difference value between a target data point and a previous data point in the first HRV data after the amplitude adjustment and a second difference value between the target data point and a next data point, wherein the target data point is any one data in the first sub-HRV data;
calculating a first ratio of the first difference to the target data point and a second ratio of the second difference to the target data point;
and when the first ratio and the second ratio of the target data point are both larger than the preset ratio threshold, determining the target data point as an abnormal point.
The present application may be further configured in a preferred example to: the obtaining module 1001 is specifically configured to, when performing anomaly detection on the first HRV data after the amplitude adjustment and determining an anomaly point:
Determining a median value of the amplitude-adjusted first HRV data, and determining a median deviation of a target data point in the amplitude-adjusted first HRV data based on the median value;
and when the median deviation of the target data point is larger than a preset deviation threshold value, judging the target data point as an abnormal point.
The present application may be further configured in a preferred example to: the obtaining module 1001 is specifically configured to, when executing obtaining first initial HRV data corresponding to a sliding window:
acquiring second initial HRV data corresponding to the sliding window;
performing fast Fourier transform on the time domain signal corresponding to the second initial HRV data to obtain a frequency domain signal corresponding to the second initial HRV data;
judging whether a frequency domain signal corresponding to the second initial HRV data is a valid frequency domain signal or not based on a preset frequency domain interval;
if the effective frequency domain signal is effective, carrying out segment filtering on the effective frequency domain signal, integrating the effective frequency domain signal after segment filtering, and carrying out fast Fourier inverse transformation to obtain first initial HRV data after filtering.
The present application may be further configured in a preferred example to: the extracting module 1004, when executing the extracting of the nonlinear feature of the second target HRV data, is specifically configured to:
drawing a poincare scattergram and a difference scattergram based on the second target HRV data;
Determining the standard deviation of the elliptic long axis and the standard deviation of the elliptic short axis of the Pond-plus-minus plot;
determining the number of midpoints of a first quadrant and a third quadrant in the difference scatter diagram;
wherein the nonlinear feature comprises: the standard deviation of the major axis of the ellipse, the standard deviation of the minor axis of the ellipse, the number of midpoints of the first quadrant and the number of midpoints of the third quadrant.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, a specific working process of the HRV data preprocessing apparatus described above may refer to a corresponding process in the foregoing method embodiment, which is not described herein again.
In an embodiment of the present application, as shown in fig. 11, an electronic device 1100 shown in fig. 11 includes: a processor 1101 and a memory 1103. The processor 1101 is coupled to a memory 1103, such as via a bus 1102. Optionally, the electronic device 1100 may also include a transceiver 1104. It should be noted that, in practical applications, the transceiver 1104 is not limited to one, and the structure of the electronic device 1100 is not limited to the embodiments of the present application.
The processor 1101 may be a CPU (Central Processing Unit ), general purpose processor, DSP (Digital Signal Processor, data signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic device, transistor logic device, hardware components, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor 1101 may also be a combination that performs computing functions, such as a combination comprising one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 1102 may include a path that communicates information between the components. Bus 1102 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect Standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. Bus 1102 may be divided into address bus, data bus, control bus, and the like. For ease of illustration, only one thick line is shown in fig. 11, but not only one bus or type of bus.
The Memory 1103 may be, but is not limited to, a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory ) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory ), a CD-ROM (Compact Disc Read Only Memory, compact disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 1103 is used for storing application program codes for executing the present application and is controlled to be executed by the processor 1101. The processor 1101 is configured to execute application code stored in the memory 1103 to implement what has been described above for the HRV data preprocessing method embodiment.
Among them, electronic devices include, but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. But may also be a server or the like. The electronic device shown in fig. 11 is only an example, and should not impose any limitation on the functionality and scope of use of the embodiments of the present application.
The present application provides a computer readable storage medium having a computer program stored thereon, which when run on a computer, causes the computer to perform the corresponding method embodiments described above.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present application and it should be noted that, for a person skilled in the art, several improvements and modifications can be made without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for HRV data preprocessing, comprising:
acquiring HRV data corresponding to the sliding window;
based on HRV data, determining a plurality of target peaks corresponding to the HRV data, calculating variances of the target peaks, and taking the HRV data, the variances of which accord with a preset variance range, as first target HRV data;
determining an RR interval sequence of first target HRV data based on the plurality of target peaks of the first target HRV data, judging whether each RR interval of the RR interval sequence accords with a preset heartbeat time interval range, and taking HRV data, of which each RR interval accords with the preset heartbeat time interval range, in the first target HRV data as second target HRV data;
and extracting time domain features, frequency domain features and nonlinear features of the second target HRV data.
2. The method of claim 1, wherein the determining a plurality of target peaks corresponding to HRV data based on HRV data comprises:
Determining a plurality of initial peaks in the HRV data based on a shortest cardiac interval count, wherein the shortest cardiac interval count is a number of data points contained in one heartbeat in the HRV data;
determining a first upper envelope and a first lower envelope of the HRV data;
determining a voltage threshold for the HRV data based on a percentage threshold, the first upper envelope, and the first lower envelope;
and selecting a peak value exceeding the voltage threshold value from the plurality of initial peak values to obtain a plurality of target peak values of the sub-HRV data.
3. The method of claim 1, wherein the obtaining HRV data corresponding to the sliding window comprises:
acquiring first initial HRV data corresponding to a sliding window, and determining a second upper envelope curve and a second lower envelope curve of the first initial HRV data;
determining a maximum amplitude difference between the second upper envelope and the second lower envelope;
determining an amplitude adjustment ratio of each data point in the first initial HRV data based on a second upper envelope value, a second lower envelope value and the maximum amplitude difference value corresponding to each data point in the first initial HRV data;
And carrying out amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment proportion corresponding to the data point to obtain the HRV data.
4. The method of claim 3, wherein the performing the amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment ratio corresponding to the data point to obtain HRV data comprises:
performing amplitude adjustment on each data point in the first initial HRV data based on the amplitude adjustment proportion corresponding to the data point to obtain first HRV data after the amplitude adjustment;
performing anomaly detection on the first HRV data after amplitude adjustment to determine an anomaly point;
and correcting the value of the abnormal point based on the mean value or the median value corresponding to the data points before or after the abnormal point to obtain the HRV data.
5. The method of claim 4, wherein the anomaly detection of the amplitude-adjusted first HRV data to determine the anomaly point comprises:
determining a first difference value between a target data point and a previous data point in the first HRV data after amplitude adjustment and a second difference value between the target data point and a next data point, wherein the target data point is any one data in the first sub-HRV data;
Calculating a first ratio of the first difference to the target data point and a second ratio of the second difference to the target data point;
and when the first ratio and the second ratio of the target data point are both larger than a preset ratio threshold, judging the target data point as an abnormal point.
6. The method of claim 4, wherein the anomaly detection of the amplitude-adjusted first HRV data to determine the anomaly point comprises:
determining a median value of the amplitude-adjusted first HRV data, and determining a median deviation of a target data point in the amplitude-adjusted first HRV data based on the median value;
and when the median deviation of the target data point is larger than a preset deviation threshold value, judging the target data point as an abnormal point.
7. A method according to claim 3, wherein the obtaining the first initial HRV data corresponding to the sliding window comprises:
acquiring second initial HRV data corresponding to the sliding window;
performing fast Fourier transform on the time domain signal corresponding to the second initial HRV data to obtain a frequency domain signal corresponding to the second initial HRV data;
judging whether the frequency domain signal corresponding to the second initial HRV data is an effective frequency domain signal or not based on a preset frequency domain interval;
If the effective frequency domain signal is effective, carrying out segment filtering on the effective frequency domain signal, integrating the effective frequency domain signal after segment filtering, and carrying out fast Fourier inverse transformation to obtain first initial HRV data after filtering.
8. The method according to any one of claims 1 to 7, wherein extracting nonlinear features of the second target HRV data comprises:
drawing a poincare scattergram and a difference scattergram based on the second target HRV data;
determining an ellipse major axis standard deviation and an ellipse minor axis standard deviation of the poincare scattergram;
determining the number of midpoints of a first quadrant and a third quadrant in the difference scatter diagram;
wherein the nonlinear feature comprises: the standard deviation of the major axis of the ellipse, the standard deviation of the minor axis of the ellipse, the number of midpoints of the first quadrant and the number of midpoints of the third quadrant.
9. An HRV data preprocessing apparatus, comprising:
the acquisition module is used for acquiring HRV data corresponding to the sliding window;
the first processing module is used for determining a plurality of target peaks corresponding to the HRV data based on the HRV data, calculating variances of the target peaks, and taking the HRV data with the variances conforming to a preset variance range as first target HRV data;
The second processing module is used for determining an RR interval sequence of the first target HRV data based on the plurality of target peaks of the first target HRV data, judging whether each RR interval of the RR interval sequence accords with a preset heartbeat time interval range, and taking HRV data, of which each RR interval accords with the preset heartbeat time interval range, in the first target HRV data as second target HRV data;
and the extraction module is used for extracting the time domain features, the frequency domain features and the nonlinear features of the second target HRV data.
10. An electronic device, comprising:
at least one processor;
a memory;
at least one application program, wherein the at least one application program is stored in the memory and configured to be executed by the at least one processor, the at least one application program configured to: a HRV data preprocessing method as claimed in any one of claims 1 to 8.
CN202311265053.1A 2023-09-27 2023-09-27 HRV data preprocessing method and device and electronic equipment Pending CN117271977A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311265053.1A CN117271977A (en) 2023-09-27 2023-09-27 HRV data preprocessing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311265053.1A CN117271977A (en) 2023-09-27 2023-09-27 HRV data preprocessing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117271977A true CN117271977A (en) 2023-12-22

Family

ID=89217419

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311265053.1A Pending CN117271977A (en) 2023-09-27 2023-09-27 HRV data preprocessing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117271977A (en)

Similar Documents

Publication Publication Date Title
Acharya et al. Study of heart rate variability signals at sitting and lying postures
Chong et al. Photoplethysmograph signal reconstruction based on a novel hybrid motion artifact detection–reduction approach. Part I: Motion and noise artifact detection
US11311201B2 (en) Feature selection for cardiac arrhythmia classification and screening
US11234658B2 (en) Photoplethysmogram data analysis and presentation
Bansal et al. A review of measurement and analysis of heart rate variability
KR20210018202A (en) Optical blood flow measurement data analysis and presentation
Hossain et al. A robust ECG denoising technique using variable frequency complex demodulation
Antink et al. Reducing false alarms in the ICU by quantifying self-similarity of multimodal biosignals
KR101366101B1 (en) System and method for classificating normal signal of personalized ecg
Costin et al. Atrial fibrillation onset prediction using variability of ECG signals
CN114732419B (en) Exercise electrocardiogram data analysis method and device, computer equipment and storage medium
US20200107786A1 (en) Method for assessing electrocardiogram signal quality
Chen et al. A novel method based on Adaptive Periodic Segment Matrix and Singular Value Decomposition for removing EMG artifact in ECG signal
CN106539580B (en) Continuous monitoring method for dynamic change of autonomic nervous system
Rankawat et al. Robust heart rate estimation from multimodal physiological signals using beat signal quality index based majority voting fusion method
CN114732418A (en) High-frequency QRS waveform curve analysis method and device, computer equipment and storage medium
Dora et al. Efficient detection and correction of variable strength ECG artifact from single channel EEG
Bolea et al. On the standardization of approximate entropy: Multidimensional approximate entropy index evaluated on short-term HRV time series
Zhang et al. An improved real-time R-wave detection efficient algorithm in exercise ECG signal analysis
Choi et al. Attention-lrcn: long-term recurrent convolutional network for stress detection from photoplethysmography
CN114742113B (en) High-frequency QRS waveform curve analysis method and device, computer equipment and storage medium
CN117271977A (en) HRV data preprocessing method and device and electronic equipment
Timothy et al. Data preparation step for automated diagnosis based on HRV analysis and machine learning
Jokić et al. An efficient approach for heartbeat classification
Tobón et al. Improved heart rate variability measurement based on modulation spectral processing of noisy electrocardiogram signals

Legal Events

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