Blood oxygen and heart rate monitoring system and method based on PPG signals and motion data

By integrating PPG signal and motion data processing modules in wearable devices, combining deep learning models and multi-layer filtering technology, the identification of motion state and high-precision monitoring of blood oxygen and heart rate data is achieved, solving the problem of insufficient monitoring of existing equipment in dynamic scenarios.

CN119896478AActive Publication Date: 2025-04-29NANTONG RUIYUE INFORMATION TECH CO LTD +1

Patent Information

Application Number
CN202510376829.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-04-29
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

Existing wearable devices lack the function of identifying the state of motion in dynamic health monitoring, lack of signal interference suppression ability, and limited application scenarios, which cannot meet users' health monitoring needs in dynamic scenarios such as exercise and fitness.

Method used

The blood oxygen and heart rate monitoring system based on PPG signals and motion data is adopted, including PPG signal acquisition module, motion sensor module, signal preprocessing module, dynamic signal segmentation and quality evaluation module, blood oxygen saturation calculation module, heart rate calculation module, motion state recognition module and adaptive Kalman filtering module, and the identification of motion state and high-precision monitoring of blood oxygen and heart rate data is achieved through deep learning models and multi-layer filtering technology.

Benefits of technology

It significantly improves the measurement accuracy and robustness of blood oxygen saturation and heart rate, realizes accurate identification of exercise status, expands the application scenarios of the equipment, and is suitable for health monitoring in complex dynamic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119896478A_ABST
    Figure CN119896478A_ABST
Patent Text Reader

Abstract

The invention relates to a blood oxygen and heart rate monitoring system and method based on PPG signals and motion data, and relates to the technical field of medical health and intelligent wearable equipment. The system comprises a PPG signal acquisition module, a motion sensor module, a signal preprocessing module, a dynamic signal segmentation and quality evaluation module, an oxyhemoglobin saturation calculation module, a heart rate calculation module, a motion state recognition module, a self-adaptive Kalman filtering module and an output display module. The method and the device have the effects of realizing a function of identifying the motion state by the wearable equipment, improving the signal interference suppression capability and widening the application scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of medical health and intelligent wearable devices, and in particular to a blood oxygen and heart rate monitoring system and method based on PPG signals and motion data. Background Art

[0002] In recent years, the application of wearable devices in health detection and sports management has gradually become popular, especially in the real-time detection of physiological indicators such as blood oxygen and heart rate. However, most of the wearable devices on the market are aimed at health monitoring under static or simple exercise conditions, and fail to fully combine the user's dynamic motion state information, which poses a challenge to the comprehensive practicality and multi-scenario adaptability of the equipment; in the existing technology, wearable devices have the following problems in the field of dynamic health monitoring: 1. Lack of motion state recognition function. Most wearable devices on the market focus on single physiological indicator detection and fail to combine motion sensor data to realize motion state recognition. 1. Effective identification of motion status, and motion status information is of great significance for interpreting the dynamic changes of physiological signals; 2. The signal interference suppression capability is insufficient, and the interference of motion artifacts and dynamic environmental noise on PPG (photoplethysmography) signals has not been effectively solved, resulting in a decrease in the accuracy of blood oxygen and heart rate measurement; 3. The application scenarios are limited. Since the existing equipment lacks the ability to adapt to the motion state, its application scenarios are mainly concentrated in static or low-intensity activities, which cannot meet the health monitoring needs of users in dynamic scenarios such as sports and fitness; Based on the above deficiencies, the present application provides a blood oxygen and heart rate monitoring system and method based on PPG signals and motion data. Summary of the invention

[0003] In order to realize the function of wearable devices to recognize the motion state, improve the signal interference suppression capability, and broaden the application scenarios, the present application provides a blood oxygen and heart rate monitoring system and method based on PPG signals and motion data.

[0004] In the first aspect, the blood oxygen and heart rate monitoring system based on PPG signals and motion data provided by the present application adopts the following technical solutions: Blood oxygen and heart rate monitoring system based on PPG signals and motion data, including: PPG signal acquisition module, used to collect red light, infrared light and green light PPG signals; A motion sensor module for collecting acceleration signals and angular velocity signals of the user; Signal preprocessing module for denoising, baseline drift removal and adaptive filtering to ensure signal quality; Dynamic signal segmentation and quality assessment module, which is used for signal segmentation processing and evaluates signal quality through peak-to-valley ratio and autocorrelation coefficient; A blood oxygen saturation calculation module is used to calculate blood oxygen saturation based on an improved blood oxygen algorithm and high-quality red light and infrared light PPG signals; Heart rate calculation module, which is used to accurately detect heart rate based on improved heart rate algorithm, high-quality green light PPG signal and exercise status; A motion state recognition module for recognizing the motion state of a human body based on a deep learning model, acceleration, and angular velocity data; Adaptive Kalman filter module, used to smooth blood oxygen and heart rate data through Kalman filtering to optimize real-time monitoring data; The output display module is used to display blood oxygen saturation, heart rate and exercise status results in real time.

[0005] In the second aspect, the blood oxygen and heart rate monitoring method based on PPG signals and motion data provided by the present application adopts the following technical solution: comprising the following steps: S1: PPG signal and motion data acquisition; S2: signal preprocessing; S3: Improved oxygen saturation calculation; S4: Improved heart rate detection algorithm; S5: motion state recognition; S6: Result output.

[0006] Preferably, the step S1: PPG signal and motion data collection includes: S11: PPG signal acquisition, real-time acquisition of red light, infrared light, and green light PPG signals through sensors; S12: Motion data acquisition, using a three-axis accelerometer and gyroscope to obtain acceleration data [ ] and angular velocity data[ ]; S13: Data segmentation: the collected data is windowed with 200 points, the window length is 800 points, and the sampling rate is 100 Hz to obtain the segmented data. , and .

[0007] Preferably, the step S2: signal preprocessing comprises: S21: PPG signal de-jumping, by removing the discontinuity point algorithm, remove the jump noise between data frames, ensure the data continuity between data frames, and thus obtain a continuous PPG signal And the corresponding acceleration and angular velocity data ,; S22: Remove baseline drift, collect least squares method and fourth-order polynomial fitting, remove the baseline drift of PPG signal, and obtain , the formula is as follows: A(i, j) = ; Where i = [1∶800], which is the length of the data frame; j = [1∶4]; A (i, j) represents i to the jth power, which is a 4th-order polynomial matrix: coeff = ; in represents the transpose of A, express The inverse matrix of , coeff is the 1×5 matrix coefficient; =coeff ; S23: Signal valid detection, The 200-point data collected by Zhongxin [601∶800] is judged to exceed the upper and lower thresholds ( and ), if the number of points exceeds a certain number P, the point data of [401∶600] is used to replace the 200 point data of [601∶800], and the output waveform is marked as ; ; S24: Bandpass filtering, bandpass filtering (0.8-3.5Hz) is performed on the PPG signal and the acceleration and angular velocity data respectively, and Z-Score normalization is performed on the PPG signal to obtain data , , , Z-Score normalization is as shown in the formula: ; Where x is the original data point, μ is the mean of the data set, σ is the standard deviation of the data set, and z is the normalized result. S25: Motion artifact removal, based on the obtained and , using the least mean square algorithm for time-domain adaptive filtering, the filter is at the sampling point Input As shown in the formula: ; in, is the 3-axis acceleration signal of the accelerometer, is the 3-axis angular velocity signal of the gyroscope; According to the input signal Estimation of artifact signal , and from the target signal To remove these artifacts, When sampling, the artifact signal estimated by the filter output is: ; in is the weight vector of the adaptive filter, and the net target signal output by the filter is for: ; Filter pass error To update the filter weights, ; ; in, is the step size parameter, which controls the speed of weight update. Repeat the above steps until the error Converge to get a signal with motion artifacts removed , thus obtaining the PPG signal with motion artifacts removed ; S26: Downsampling, , and downsampled to 25Hz to obtain data and .

[0008] Preferably, the step S3: improved blood oxygen saturation calculation comprises: S31: Signal quality assessment, through The red part of the signal and infrared light Calculate the peak-to-valley ratio and autocorrelation coefficient of the data , select high-quality signals for subsequent blood oxygen saturation calculation, peak-to-valley ratio for: ; in is the peak value, is the valley value, calculate the average value of all peaks and valleys As the peak-to-valley ratio of the overall signal: ; in is the number of peak-valley pairs detected within the window, It is The peak-to-valley ratio of the peak-to-valley pairs; Autocorrelation coefficient As shown in the formula: ; ; in, It's a signal Delay in time The autocorrelation value under Indicates the PPG signal at time point The value at is the total number of samples of the signal, The value range is from 0 to Find the first significant peak of the autocorrelation coefficient , when the PPG signal in the sliding window satisfies > as well as > When , keep the signal. and They are the set peak-to-valley ratio threshold and autocorrelation coefficient threshold respectively; S32: Blood oxygen saturation calculation, based on PPG signal, uses the absorption difference of light of different wavelengths when passing through tissue to measure the ratio of oxygenated hemoglobin and reduced hemoglobin, and calculates the blood perfusion rate of red light data With infrared data The ratio of blood perfusion rate With infrared data As shown in the formula: ; ; in, is the red light data Signal amplitude, is the red light data Signal amplitude, Infrared data Signal amplitude, Infrared data Signal amplitude; Red light perfusion rate Infrared light perfusion rate The ratio is set to , The calculation formula is as shown in the formula: ; Blood oxygen saturation and The oxygen reduction experiment was carried out by expressing the functional relationship between the blood oxygen saturation value in the experimental data and the corresponding The value is fitted to obtain the blood oxygen saturation and The functional relationship between The function polynomial of is a first-order polynomial, then the reference formula of the first-order polynomial is: ; in, , are the coefficients of the first-order polynomial that needs to be fitted; If the experimentally fitted blood oxygen saturation is If the function polynomial of the value is a quadratic polynomial, then the reference formula of the quadratic polynomial is: ; in, , , are the coefficients of the quadratic polynomial that need to be fitted; S33: Weighted calculation of blood oxygen saturation. In the sliding window, the preliminary blood oxygen saturation is calculated based on the peaks and valleys corresponding to each red light and infrared light. , using historical blood oxygen saturation Perform weighted processing on the preliminary calculated values ​​to obtain the comprehensive blood oxygen saturation within the current window , the weighted formula is as follows: ; in, represents the number of peak-valley pairs in the sliding window, It is an adjustment parameter used to control the decay rate of the weight; S34: Blood oxygen saturation smoothing, using adaptive Kalman filtering to smooth the calculated blood oxygen saturation, combined with historical blood oxygen saturation data, improve the consistency of the time series, and dynamically adjust the process noise covariance and the observation noise covariance , in order to adaptively cope with the uncertainty under different measurement conditions; Kalman filter first initializes the parameters and sets the initial blood oxygen estimation value is the initial measurement value of the system The filtering process includes prediction and update. In the prediction step, based on the last estimated value , calculate the current blood oxygen prediction value and its covariance ,Right now: ; ; in, is the state transfer matrix, which describes the evolution of the system state. In the model with a smooth change in blood oxygen saturation, Set as , indicating that there is no significant jump between the current blood oxygen saturation and the previous moment's blood oxygen saturation. is the process noise covariance, reflecting the uncertainty of the system, through the current measurement value Calculate residuals : = ; in, is the observation matrix, which is used to transform the predicted state Mapped to the observation space, with the current measurement value By comparison, in the model with steady changes in blood oxygen saturation, Set as ; In the update step, the Kalman gain is first calculated : = ; in, is the observation noise covariance, reflecting the measurement uncertainty, and based on the Kalman gain, updates the estimated blood oxygen saturation and covariance : ; ; Dynamic update by monitoring the estimated error and residual changes and : ; ; in, and is an adjustment factor used to dynamically adjust for changes in process noise and observation noise.

[0009] Preferably, the step S4: improving the heart rate detection algorithm comprises: S41: Signal frequency domain transformation, The green part Data and acceleration data Perform a 1024-point FFT transformation, intercept the spectrum data within [0.8-3.5] Hz, and normalize the acceleration data to the maximum value, limiting the value to the range of [0, 1], and obtain and ; S42: Frame motion state calibration, using three-axis acceleration The mean of the sum of squares of the data With threshold and For comparison, > ,like > The current frame is determined to be a motion frame, and the state weight of the current frame is calibrated =a; if < < The current frame is calibrated as a micro-motion frame, and its state weight =b; if < Then the current frame is calibrated as a relatively static frame, and its state weight =c, where 0<a<b<c<1, and a+b+c=1, , The value of is determined by the user using the accelerometer. The calculation formula is as follows: ; Among them, ACCX, ACCY and ACCZ are The x, y, and z direction vectors; S43: Use a double-layer frequency domain Wiener filter to further filter out motion artifacts in the PPG signal in the frequency domain through the motion state represented by the accelerometer. The process of Wiener filtering is as follows: First, calculate the first N frames The spectrum mean of is normalized to the maximum value, and we get , and calculate the weights of the first layer of Wiener filter : =1-( ) ; in, Represents point division, calculates the weight of the second layer Wiener filter : = ( ); right and For the part where the weight is less than 0, the clamp is set to -1, and two weights are used to obtain two filter outputs: = ; =; in, Represents dot product. For the above two filter outputs, weighted fusion is performed according to the standard deviation to obtain the filter output of the current frame. : = ; in, and They are and The standard deviation of Perform maximum normalization and get ; S44: Joint adaptive weighted filtering for historical M frames The spectrum is weighted according to three weights: Gaussian weight, state weight, and concentration weight; Gaussian weight: Take the current data frame as the starting frame and generate the Gaussian weights of the previous M data frames. The Gaussian weight symbol is , where 1< <M; State weight: Use the corresponding historical M frames As the state weight, where 1< <M; Concentration weight: Use the peak concentration corresponding to the historical M frames As the concentration weight, where 1< <M; The peak concentration is based on The highest peak of the spectrum With its top 10 peaks The difference is obtained by summing the differences, where the highest peak needs to be removed and 2 < <10, the peak concentration calculation formula for each data frame is as follows: ; Among them, the peak concentration is used to characterize the cleanliness of the spectrum signal. The peak concentration is the highest in the single-peak condition, and the more artifact peaks there are, the lower the peak concentration is. The final joint weight of the historical M frames Determined using the product of the three weights above: = × × ; Based on this weight, the historical M frames Perform weighted summation to obtain ; = × ; S45: Piecewise function weighting, first obtain the historical K data frames × ,in, K, find the largest three × Corresponding data frame The highest peak index in the spectrum is denoted by ,in, , averaging these three indices, we get As shown in the formula: ; is a piecewise function. Based on this piecewise function, the obtained The weight of each point in the spectrum is assigned. Assume that there are N points in the spectrum, that is, 1 < <N, then the formula is as follows: ; Based on this weight, Weighted calculation , the formula is as follows: ; in, It is the spectrum and The index of the previous point, N, N is the total number of points on the spectrum; S46: Adaptive heart rate search, set an adaptive variable ,in, ; in is the current frame, Representation History Frame, Start Frame Use 20 as the initial value, and then adjust the value adaptively. is the heart rate value of the corresponding frame; Set the adaptive search interval and : ( ); ( ); in is the spectrum resolution, expressed as follows: ; Among them, H represents the signal frequency after PPG, F represents the number of Fourier points, and the obtained The heart rate interval size of the unit index interval mapping in the spectrum is Based on this interval, the heart rate value corresponding to the index of each point in the spectrum can be obtained, thereby generating a , i.e., a heart rate lookup table mapped according to the spectrum index, which is used to subsequently look up the corresponding heart rate according to the index of the highest peak value found; When the search interval [ , ]Exceed When the spectrum range is within the range of [ , Search in Index of the highest peak ,Right now: = ; After getting the index, it can be mapped to the heart rate: ; S47: Heart rate post-processing, using R heart rate data obtained from the past R data frames to calculate a linear prediction value , using the above and Weighted , the formula is as follows: ; in, Weighted value for heart rate; Perform frame difference heart rate determination by comparing the current heart rate with the previous frame heart rate The difference is used to limit the possible large-scale jump, and the final heart rate As shown below: ; in, , The value should be determined based on the actual situation.

[0010] Preferably, the step S5: motion state identification includes: S51: Data preprocessing and feature extraction, Original dataset construction: and The data is transmitted to the server via Bluetooth, and the data is labeled with motion status according to the motion status when the data is collected, thereby constructing the original data set; Data loading: load the three-axis acceleration and angular velocity data from the original data set and extract the motion state label; Label encoding: Use Encode the motion state label into integer form and convert it to one-hot encoding ; Time series sliding window: Slice the data using sliding window technology to generate time series input features while retaining the contextual information in the time series; Normalization: Normalize the sliced ​​data to ensure that the input feature range is consistent and reduce the impact of noise; S52: Data partitioning: randomly shuffle the data set according to , , The ratio is divided into training set, validation set and test set to ensure the generalization ability of the model. , , The values ​​are 0.8, 0.1, 0.1; S53: Model design and construction, Input layer: receives multi-dimensional time series input of three-axis acceleration and angular velocity data; Convolutional layer: extracts local spatiotemporal features and enhances the model's ability to perceive short-term change patterns; Pooling layer: through the maximum pooling operation Reduce data dimensions, extract important features, and reduce the amount of calculation; Two-Way Layer: Through two-way Capture the dependencies between time series and enhance the model's ability to learn long-term dependency patterns; Attention mechanism: The multi-head attention layer highlights the features of key time steps and improves the model's ability to classify motion states; Fully connected layer: classifies the features output by the attention layer and maps the results into the probability distribution of each motion state; S54: Model training and optimization, Loss Function: Choice As a loss function, used for multi-classification tasks; Optimizer: Adopts Adam optimizer to converge quickly and avoid local optimal solutions; Evaluation indicators: Use accuracy, precision, recall, and F1-score as the main evaluation indicators to monitor model performance in real time; S55: Model evaluation and testing, Prediction classification: Use the trained model to predict the motion state category in the test set and output the prediction results; Accuracy calculation: Compare the prediction results with the actual labels, calculate the model classification accuracy, and verify its performance on the test set; S56: Actual effect: By combining the CNN, BiLSTM and attention mechanism models, complex motion patterns are classified, and high-precision classification of multiple motion states is achieved for motion state monitoring needs in multiple scenarios.

[0011] Preferably, in step S6: the result is output, the blood oxygen saturation and heart rate after smoothing are displayed by the device, and at the same time and The data is transmitted to the server via Bluetooth, and the server responds to the data sent and The data is classified into exercise status and transmitted back to the device via Bluetooth for display. At the same time, the blood oxygen saturation, heart rate and exercise status are uploaded to the web page, APP, etc. for user use.

[0012] In summary, the present application includes at least one of the following beneficial technical effects: 1. This application significantly improves the measurement accuracy and robustness of blood oxygen saturation through adaptive filtering, dynamic signal segmentation and quality assessment, weighted fusion and adaptive Kalman filtering technology. The improved algorithm can effectively suppress motion artifacts in motion, screen out high-quality PPG signals for calculation, and reduce noise interference through weighted historical data and Kalman filtering smoothing, ensuring the continuity and stability of blood oxygen saturation data, which is suitable for complex dynamic scenes; 2. This application proposes a double-layer frequency domain Wiener filtering, adaptive search interval and smoothing processing method, combined with motion state calibration and multi-weight fusion, to improve the accuracy and dynamic adaptability of heart rate detection, and solve the problem of large heart rate recognition error in traditional methods in sports scenes; 3. This application realizes real-time monitoring and accurate classification of human motion status by combining CNN, BiLSTM and attention mechanism models, improves the comprehensiveness and practicality of health monitoring, and expands the application scenarios of wearable devices; 4. This application combines PPG signals with motion sensor data, and effectively removes motion artifacts and environmental noise through filtering and noise suppression technology, ensuring high quality and high precision of blood oxygen saturation and heart rate detection, which is particularly suitable for health monitoring needs in dynamic motion environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is a flow chart of a blood oxygen and heart rate monitoring system based on PPG signals and motion data in an embodiment of the present application.

[0014] Figure 2 It is a structural schematic diagram of a blood oxygen and heart rate monitoring system based on PPG signals and motion data in an embodiment of the present application.

[0015] Figure 3 It is a flow chart of a blood oxygen and heart rate monitoring method based on PPG signals and motion data in an embodiment of the present application.

[0016] Figure 4 It is a schematic diagram of removing signal jumps of the PPG signal in an embodiment of the present application.

[0017] Figure 5 It is a schematic diagram of removing baseline drift of a PPG signal in an embodiment of the present application.

[0018] Figure 6 , Figure 7 It is a comparison diagram of the signals before and after bandpass filtering and motion artifact removal in the embodiment of the present application.

[0019] Figure 8Schematic diagram of AC and DC values ​​of the PPG signal in an embodiment of the present application.

[0020] Fig. 9 This is a diagram showing the effect of the adaptive Kalman filter in the actual blood oxygen saturation measurement in the embodiment of the present application.

[0021] Fig.10 Schematic diagram of Gaussian weights in an embodiment of the present application.

[0022] Fig.11 In the embodiment of this application Schematic diagram of the piecewise function.

[0023] Fig.12 This is a comparison chart between the heart rate algorithm of the present application and the common heart rate algorithm.

[0024] Explanation of the accompanying drawings: 1. PPG signal acquisition module; 2. Motion sensor module; 3. Signal preprocessing module; 4. Dynamic signal segmentation and quality assessment module; 5. Blood oxygen saturation calculation module; 6. Heart rate calculation module; 7. Motion state recognition module; 8. Adaptive Kalman filter module; 9. Output display module. DETAILED DESCRIPTION

[0025] The following is combined with Figure 1-12 This application is described in further detail.

[0026] The present application embodiment discloses a blood oxygen and heart rate monitoring system based on PPG signals and motion data. Figure 1 ,include PPG signal acquisition module 1, used to collect red light, infrared light and green light PPG signals; Motion sensor module 2, used to collect acceleration signals and angular velocity signals of the user; Signal preprocessing module 3, used for denoising, baseline drift removal and adaptive filtering to ensure signal quality; Dynamic signal segmentation and quality assessment module 4, used for signal segmentation processing and evaluating signal quality through peak-to-valley ratio and autocorrelation coefficient; A blood oxygen saturation calculation module 5, for calculating blood oxygen saturation according to an improved blood oxygen algorithm, high-quality red light, and infrared light PPG signals; A heart rate calculation module 6, for realizing accurate heart rate detection based on an improved heart rate algorithm, high-quality green light PPG signals, and exercise status; A motion state recognition module 7, for recognizing the motion state of a human body according to a deep learning model, acceleration and angular velocity data; An adaptive Kalman filter module 8 is used to smooth the blood oxygen and heart rate data through Kalman filtering to optimize the real-time monitoring data; The output display module 9 is used to display the blood oxygen saturation, heart rate and exercise status results in real time.

[0027] The embodiment of the present application also discloses a blood oxygen and heart rate monitoring system based on PPG signals and motion data, comprising the following steps: S1: PPG signal and motion data acquisition; S11: PPG signal acquisition, real-time acquisition of red light, infrared light, and green light PPG signals through sensors; S12: Motion data acquisition, using a three-axis accelerometer and gyroscope to obtain acceleration data [ ] and angular velocity data[ ]; S13: Data segmentation: the collected data is windowed with 200 points, the window length is 800 points, and the sampling rate is 100 Hz to obtain the segmented data. , and .

[0028] S2: signal preprocessing; S21: PPG signal de-jumping, by removing the discontinuity point algorithm, remove the jump noise between data frames to ensure the data continuity between data frames, so as to obtain the following Figure 4 The continuous PPG signal shown And the corresponding acceleration and angular velocity data , ; S22: Remove baseline drift, collect least squares method and fourth-order polynomial fitting, remove the baseline drift of PPG signal, and obtain , the formula is as follows, which has a better baseline removal effect than the traditional median filtering method: A(i, j) = ; Where i = [1∶800], which is the length of the data frame; j = [1∶4]; A (i, j) represents i to the jth power, which is a 4th-order polynomial matrix: coeff = ; in represents the transpose of A, express The inverse matrix of , coeff is the 1×5 matrix coefficient; =coeff ; The effect of removing the baseline is as follows Figure 5 As shown; S23: Signal valid detection, The 200-point data collected by Zhongxin [601∶800] is judged to exceed the upper and lower thresholds ( and ), if it exceeds a certain number of points P, the point data of [401∶600] is used to replace the 200 point data of [601∶800] to ensure that the data of each frame is within a reasonable range, and the output waveform is marked as ; ; S24: Bandpass filtering, bandpass filtering (0.8-3.5Hz) is performed on the PPG signal and the acceleration and angular velocity data respectively, and Z-Score normalization is performed on the PPG signal to obtain data , , , Z-Score normalization is as shown in the formula: ; Where x is the original data point, μ is the mean of the data set, σ is the standard deviation of the data set, and z is the normalized result. The role of using Z-Score normalization is to adjust the data to a zero-mean normal distribution. Z-Score normalization is less sensitive to outliers. If the values ​​of some points in the data are much larger or smaller than other data points (i.e., outliers), the overall impact of these outliers on the data set will be relatively reduced after normalization. S25: Motion artifact removal, based on the obtained and , using the least mean square (LMS) algorithm for time-domain adaptive filtering, the filter is at the sampling point Input As shown in the formula: ; in, is the 3-axis acceleration signal of the accelerometer, is the 3-axis angular velocity signal of the gyroscope; The purpose of the LMS adaptive filter is to To estimate the artifact signal , and from the target signal To remove these artifacts, The filter outputs an estimated artifact signal at times the sampling rate for: ; in is the weight vector of the adaptive filter, and the net target signal output by the filter is (i.e. the signal after removing artifacts) is: ; Filter pass error To update the filter weights, ; ; in, is the step size parameter, which controls the speed of weight update. Repeat the above steps until the error Converge to get a signal with motion artifacts removed The resulting PPG signal with motion artifacts removed ; The signal comparison before and after bandpass filtering and motion artifacts is shown in Figure 2. Figure 6 and Figure 7 As shown: S26: Downsampling, , and Downsample to 25Hz and get data and .

[0029] S3: Improved oxygen saturation calculation; S31: Signal quality assessment, through The red part of the signal and infrared light Calculate the peak-to-valley ratio and autocorrelation coefficient of the data , select high-quality signals for subsequent blood oxygen saturation calculation. The peak-to-valley ratio indicates the amplitude change of the signal and reflects the strength of the PPG signal. A larger peak-to-valley ratio indicates that there is obvious pulse fluctuation in the signal, which is helpful for subsequent blood oxygen calculation. For a pair of peaks and troughs, the peak-to-valley ratio for: ; in is the peak value, For all the peaks and troughs in a sliding window, calculate the average value of all the peaks and troughs As the peak-to-valley ratio of the overall signal: ; in is the number of peak-valley pairs detected within the window, It is The peak-to-valley ratio of the peak-to-valley pairs; The PPG signal is a periodic signal, so the autocorrelation coefficient can help evaluate the stability and periodic consistency of the signal. As shown in the formula: ; ; in, It's a signal Delay in time The autocorrelation value under Indicates the PPG signal at time point The value at is the total number of samples of the signal, The value range is from 0 to In this range, find the first significant peak of the autocorrelation coefficient , the more obvious the main peak is and the closer it is to 1, the stronger the signal periodicity is and the better the quality is. Therefore, when the PPG signal in the sliding window meets > as well as > When , keep the signal. and They are the set peak-to-valley ratio threshold and autocorrelation coefficient threshold respectively; S32: Blood oxygen saturation calculation ( ), based on PPG signals, the ratio of oxygenated hemoglobin (HbO2) and reduced hemoglobin (Hb) is measured by using the absorption difference of light of different wavelengths when passing through tissues. That is, according to the Beer-Lambert law, red light and infrared light are used to illuminate human tissues, and the electrical signal obtained by converting the reflected light intensity signal is used to calculate the blood oxygen saturation. In the process of calculating the blood oxygen saturation, the blood perfusion rate of the red light data is calculated. With infrared data The ratio of blood perfusion rate With infrared data As shown in the formula: ; ; in, is the red light data Signal amplitude, is the red light data Signal amplitude, Infrared data Signal amplitude, Infrared data Signal amplitude; Signal Signal and The value of the signal is Figure 8 As shown: Red light perfusion rate Infrared light perfusion rate The ratio is set to , The calculation formula is as shown in the formula: ; Blood oxygen saturation and The oxygen reduction experiment was carried out by expressing the functional relationship between the blood oxygen saturation value in the experimental data and the corresponding The value is fitted to obtain the blood oxygen saturation and The functional relationship between The function polynomial of is a first-order polynomial, then the reference formula of the first-order polynomial is: ; in, , are the coefficients of the first-order polynomial that needs to be fitted; If the experimentally fitted blood oxygen saturation is If the function polynomial of the value is a quadratic polynomial, then the reference formula of the quadratic polynomial is: ; in, , , is the coefficient of the quadratic polynomial that needs to be fitted. Based on the fitted formula, The corresponding blood oxygen saturation is calculated based on the value; S33: Weighted calculation of blood oxygen saturation. In the sliding window, the preliminary blood oxygen saturation is calculated based on the peaks and valleys corresponding to each red light and infrared light. , using historical blood oxygen saturation Perform weighted processing on the preliminary calculated values ​​to obtain the comprehensive blood oxygen saturation within the current window , the weighted formula is as follows: ; in, represents the number of peak-valley pairs in the sliding window, It is an adjustment parameter used to control the decay rate of the weight; S34: Blood oxygen saturation smoothing, using adaptive Kalman filtering to smooth the calculated blood oxygen saturation, combined with historical blood oxygen saturation data to improve the consistency of the time series, this method dynamically adjusts the process noise covariance and the observation noise covariance , in order to adaptively cope with the uncertainty under different measurement conditions; Kalman filter first initializes the parameters and sets the initial blood oxygen estimation value is the initial measurement value of the system , initial covariance Set to a larger value to reflect the high initial uncertainty and the initial process noise covariance Usually set to a smaller value, indicating that the system fluctuation is small, and the initial observation noise covariance Usually set to a larger value, indicating that the uncertainty of the initial measurement is high. Next, the filtering process includes prediction and update. In the prediction step, based on the previous estimate , calculate the current blood oxygen prediction value and its covariance ,Right now: ; ; in, is the state transfer matrix, which describes the evolution of the system state. In the model with a smooth change in blood oxygen saturation, Set as , indicating that there is no significant jump between the current blood oxygen saturation and the previous moment's blood oxygen saturation. is the process noise covariance, reflecting the uncertainty of the system, through the current measurement value Calculate residuals : = ; in, is the observation matrix, which is used to transform the predicted state Mapped to the observation space, with the current measurement value By comparison, in the model with steady changes in blood oxygen saturation, Set as ; In the update step, the Kalman gain is first calculated : = ; in, is the observation noise covariance, reflecting the measurement uncertainty, and based on the Kalman gain, updates the estimated blood oxygen saturation and covariance : ; ; Dynamic update by monitoring the estimated error and residual changes and : ; ; in, and is an adjustment factor used to dynamically adjust for changes in process noise and observation noise.

[0030] Adaptive Kalman filtering can automatically adjust the noise covariance according to the changes in the real-time measurement environment, optimize the filtering effect, ensure the continuity and accuracy of blood oxygen saturation estimation, reduce measurement noise interference, and enhance the smoothness of the time series. Its effect in actual blood oxygen saturation measurement is as follows: Fig. 9As shown in the figure, the square represents the true value, the triangle represents the blood oxygen saturation calculated by the common algorithm, and the circle represents the blood oxygen saturation calculated by the optimized algorithm. By comparison, the blood oxygen saturation calculated by the optimized algorithm is closer to the true value, while the result obtained by the common algorithm shows a large fluctuation;

[0031] S4: Improved heart rate detection algorithm; S41: Signal frequency domain transformation, The green part Data and acceleration data Perform a 1024-point FFT transformation, intercept the spectrum data within [0.8-3.5] Hz, and normalize the acceleration data to the maximum value, limiting the value to the range of [0, 1], and obtain and ; S42: Frame motion state calibration, using three-axis acceleration The mean of the sum of squares of the data With threshold and For comparison, > ,like > The current frame is determined to be a motion frame, and the state weight of the current frame is calibrated =a; if < < The current frame is calibrated as a micro-motion frame, and its state weight =b; if < Then the current frame is calibrated as a relatively static frame, and its state weight =c, where 0<a<b<c<1, and a+b+c=1, , The value of is determined by the user using the accelerometer. The calculation formula is as follows: ; Among them, ACCX, ACCY and ACCZ are The x, y, and z direction vectors; S43: Since heart rate measurement is usually performed in sports scenarios, the movement of the user's body or arms may cause The signal contains more motion artifacts, so a double-layer frequency domain Wiener filter is used to further filter out the motion artifacts in the PPG signal in the frequency domain through the motion state represented by the accelerometer. The process of Wiener filtering is as follows: First, calculate the first N frames The spectrum mean of is normalized to the maximum value, and we get , and calculate the weights of the first layer of Wiener filter : =1-( ) ; in, Represents point division, calculates the weight of the second layer Wiener filter : = ( ); right and For the part where the weight is less than 0, the clamp is set to -1, and two weights are used to obtain two filter outputs: = ; = ; in, Represents dot product. For the above two filter outputs, weighted fusion is performed according to the standard deviation to obtain the filter output of the current frame. : = ; in, and They are and The standard deviation of Perform maximum normalization and get ; S44: Joint adaptive weighted filtering for historical M frames The spectrum is weighted according to three weights: Gaussian weight, state weight, and concentration weight, to ensure accurate calculation of heart rate regardless of whether it is in a chaotic or regular periodic motion state; Gaussian weight: Taking the current data frame as the starting frame, generate the Gaussian weights of the previous M data frames. The newer the frame, the larger the weight, so as to ensure that the newer frame has a larger weight to meet the real-time calculation of the heart rate. The Gaussian weight symbol is , where 1< <M, the Gaussian weight of the data frame is as follows Fig.10 As shown: State weight: Use the corresponding historical M frames As the state weight, where 1< <M; Concentration weight: Use the peak concentration corresponding to the historical M frames As the concentration weight, where 1< <M; The peak concentration is based on The highest peak of the spectrum With its top 10 peaks The difference is obtained by summing the differences, where the highest peak needs to be removed and 2 < <10, the peak concentration calculation formula for each data frame is as follows: ; Among them, the peak concentration is used to characterize the cleanliness of the spectrum signal. The peak concentration is the highest in the single-peak condition, and the more artifact peaks there are, the lower the peak concentration is. The final joint weight of the historical M frames Determined using the product of the three weights above: = × × ; Based on this weight, the historical M frames Perform weighted summation to obtain ; = × ; The introduction of state weight and concentration weight can increase the weight of frames with fewer spectral artifact peaks and less body or arm movement. For example, if the current frame is in a static state, the state weight and concentration weight are both high, and the weight of the frame is high in the end; if the current frame is in a chaotic motion state, the state weight and concentration weight are both small, and the proportion is small in the end; if the current frame is in a periodic motion state (periodic arm swinging), the state weight is small, the peak concentration weight is high, and the final proportion of the two weights multiplied together will also be small, which ensures that the heart rate can be calculated accurately regardless of whether it is in a chaotic motion state or a regular periodic motion; S45: Piecewise function weighting, first obtain the historical K data frames × ,in, K, find the largest three × Corresponding data frame The highest peak index in the spectrum is denoted by ,in, , averaging these three indices, we get As shown in the formula: ; is a piecewise function. The image of the piecewise function is Fig.11 As shown: Based on this piecewise function, the obtained The weight of each point in the spectrum Assume that there are N points in the spectrum, that is, 1< <N, then the formula is as follows: ; Based on this weight, Weighted calculation , the formula is as follows: ; in, It is the spectrum and The index of the previous point, N, N is the total number of points on the spectrum; represent The peak subscript mean corresponding to the highest three frames, that is, the subscript mean corresponding to the highest peak of the three data frames without disorderly motion or periodic motion, is used The peak index as a piecewise function can ensure that the peak near the index has a greater chance of being selected during the search, thereby further ensuring the accuracy of the heart rate search; S46: Adaptive heart rate search, set an adaptive variable ,in, ; in is the current frame, Representation History Frame, Start Frame Use 20 as the initial value, and then adjust the value adaptively. is the heart rate value of the corresponding frame; Set the adaptive search interval and : ( ); ( ); in is the spectrum resolution, expressed as follows: ; Among them, H represents the signal frequency after PPG, F represents the number of Fourier points, and the obtained The heart rate interval size of the unit index interval mapping in the spectrum is Based on this interval, the heart rate value corresponding to the index of each point in the spectrum can be obtained, thereby generating a , i.e., a heart rate lookup table mapped according to the spectrum index, which is used to subsequently look up the corresponding heart rate according to the index of the highest peak value found; Here, The larger the value is, the greater the heart rate jump in the past few frames is, indicating that the heart rate may be in motion. At this time, the search interval will become smaller according to the above formula. Similarly, when hours, it means that the heart rate has not changed much in the past few frames, and the person is in a resting state. At this time, you can safely increase the search interval. Adaptive interval search ensures that even if the search interval is reduced when in motion, it will be increased after turning to a resting state, avoiding erroneous searches; In addition, when the search interval [ , ]Exceed When the spectrum range is within the range of [ , Search in Index of the highest peak ,Right now: = ; After getting the index, it can be mapped to the heart rate: ; S47: Heart rate post-processing, using R heart rate data obtained from the past R data frames to calculate a linear prediction value , using the above and Weighted , the formula is as follows: ; in, Weighted value for heart rate; Perform frame difference heart rate judgment to prevent the heart rate from jumping too fast, and compare the current heart rate with the heart rate of the previous frame. The difference is used to limit the possible large-scale jump, and the final heart rate As shown below: ; in, , The value should be determined according to the actual situation. Generally speaking, a person's heart rate increases faster than it decreases, but it is always within a reasonable range. Using frame difference heart rate discrimination, the measured heart rate increase should not exceed 5bpm within 2s, and the heart rate decrease should not exceed 3bpm, to prevent misjudgment of the measurement.

[0032] The effect comparison between the optimized heart rate algorithm and the ordinary heart rate algorithm is as follows: Fig.12 As shown, it can be seen that the optimized algorithm can calculate the user's heart rate more accurately, especially when the heart rate changes rapidly;

[0033] S5: Motion state recognition: Through the three-axis acceleration and gyroscope data, a deep learning model based on CNN, bidirectional LSTM (BiLSTM) and multi-head attention mechanism is constructed to classify the human motion state, including stillness, sitting, turning over, walking, going up and down stairs, running, cycling, playing basketball and other sports. The specific implementation steps of the model are as follows: S51: Data preprocessing and feature extraction, Original dataset construction: and The data is transmitted to the server via Bluetooth, and the data is labeled with motion status according to the motion status when the data is collected, thereby constructing the original data set; Data loading: load the three-axis acceleration and angular velocity data from the original data set and extract the motion state label; Label encoding: Use Encode the motion state label into integer form and convert it to one-hot encoding ; Time series sliding window: Slice the data using sliding window technology to generate time series input features while retaining the contextual information in the time series; Normalization: Normalize the sliced ​​data to ensure that the input feature range is consistent and reduce the impact of noise; S52: Data partitioning: randomly shuffle the data set according to , , The ratio is divided into training set, validation set and test set to ensure the generalization ability of the model. , , The values ​​are 0.8, 0.1, 0.1; S53: Model design and construction, Input layer: receives multi-dimensional time series input of three-axis acceleration and angular velocity data; Convolutional layer: extracts local spatiotemporal features and enhances the model's ability to perceive short-term change patterns; Pooling layer: through the maximum pooling operation Reduce data dimensions, extract important features, and reduce the amount of calculation; Bidirectional Layer: Through two-way Capture the dependencies between time series and enhance the model's ability to learn long-term dependency patterns; Attention mechanism: The multi-head attention layer highlights the features of key time steps and improves the model's ability to classify motion states; Fully connected layer: classifies the features output by the attention layer and maps the results into the probability distribution of each motion state; S54: Model training and optimization, Loss Function: Choice As a loss function, used for multi-classification tasks; Optimizer: Adopts Adam optimizer to converge quickly and avoid local optimal solutions; Evaluation indicators: Use accuracy, precision, recall, and F1-score as the main evaluation indicators to monitor model performance in real time; S55: Model evaluation and testing, Prediction classification: Use the trained model to predict the motion state category in the test set and output the prediction results; Accuracy calculation: Compare the prediction results with the actual labels, calculate the model classification accuracy, and verify its performance on the test set; S56: Actual effect: By combining the CNN, BiLSTM and attention mechanism models, complex motion patterns are classified, and high-precision classification of multiple motion states is achieved for motion state monitoring needs in multiple scenarios.

[0034] S6: Result output, the device displays the smoothed blood oxygen saturation and heart rate. and The data is transmitted to the server via Bluetooth, and the server responds to the data sent and The data is classified into exercise status and transmitted back to the device via Bluetooth for display. At the same time, the blood oxygen saturation, heart rate and exercise status are uploaded to the web page, APP, etc. for user use.

[0035] The specific implementation process includes the following steps: Step 1: Blood oxygen detection method based on PPG signal and motion sensor data 1. Equipment and Materials Hardware equipment: including red light (600nm) and infrared light (940nm) PPG sensors for collecting photoplethysmographic signals; three-axis accelerometer and three-axis gyroscope for collecting motion sensing data; Control module: embedded microcontroller (such as STM32), used for signal acquisition, processing and transmission; Software environment: MATLAB or Python programming environment for algorithm development and testing; 2. Experimental Procedure Data collection: Wear the device on the user's wrist to collect red and infrared PPG signals, as well as three-axis acceleration and angular velocity data in real time. The sampling rate is set to 100 Hz, the sliding window is set to 200 points (2 seconds), and the window length is 800 points (8 seconds); Signal Processing: a. Remove jump noise and baseline drift: Use the least squares method and polynomial fitting method to remove the jump noise and baseline drift in the PPG signal; b. Bandpass filtering: Perform 0.8-3.5Hz bandpass filtering on PPG signals and motion sensor data to remove high-frequency and low-frequency noise; c. Motion artifact removal: Combined with the LMS (least mean square) adaptive filtering algorithm, the acceleration and angular velocity data are used as reference signals to remove the interference of motion artifacts on the PPG signal; 3. Blood oxygen calculation Using the improved blood oxygen algorithm, the perfusion rate ratio of red light to infrared light is calculated: R = = ; Calculate blood oxygen saturation based on the fitted polynomial relationship : = ; Use adaptive Kalman filtering to smooth blood oxygen data and improve time series consistency; Step 2: Heart rate detection method based on green light PPG signal 1. Equipment and Materials Sensor: Green light (500nm) PPG sensor, used to collect heart rate signals; Data acquisition module: embedded microcontroller (such as STM32), used for signal acquisition, processing and transmission; 2. Experimental Procedure Signal preprocessing: a. Remove jump noise and baseline drift: Use the least squares method and polynomial fitting method to remove jump noise and baseline drift in the PPG signal; b. Frequency domain analysis: Perform 0.8-3.5Hz bandpass filtering on the PPG signal and motion sensor data to remove high-frequency and low-frequency noise, and perform FFT transformation on the PPG signal to extract the 0.8-3.5Hz spectrum signal; Motion state calibration: The motion state is calibrated according to the mean value of the square sum of acceleration and the state weight is assigned (stationary, micro-motion, motion); Double-layer Wiener filter: Combine acceleration data and PPG signals to construct a double-layer Wiener filter to remove frequency domain noise; 3. Heart rate calculation Adaptively search the filtered spectrum signal to determine the heart rate peak index and map it to the heart rate value through a lookup table ;; Use linear prediction and smoothing algorithms to adjust the heart rate results and get the final heart rate value , reduce abnormal jumps; Step 3: Motion state recognition method 1. Equipment and Materials Sensors: Three-axis accelerometer and three-axis gyroscope for collecting motion data; Deep learning model: classification network based on CNN, bidirectional LSTM (BiLSTM) and multi-head attention mechanism; 2. Experimental Procedure Data preprocessing: Sliding window segmentation, slicing the motion data into units of 200 points (2 seconds); Normalize the segmented data to ensure that the input data range is consistent; Model construction: CNN layer: extract local features; BiLSTM layer: captures the previous and next dependencies in the time series; Attention mechanism: highlight key time step features and improve classification performance; Fully connected layer: maps features into probability distribution of motion states; Model training: Use the training set for model training, Adam is the optimizer, and the loss function is categorical cross entropy; Testing and verification: Verify the model performance in the test set, and the classification accuracy reaches more than 95%; Step 4: Data display and transmission method 1. Equipment and Materials Display module: embedded OLED screen, used to display blood oxygen, heart rate and exercise status; Wireless transmission module: Bluetooth communication module, used for data synchronization and remote monitoring; 2. Experimental Procedure Data display: blood oxygen, heart rate and exercise status results are updated in real time and presented in charts and numerical forms on the display screen; Data transmission: Data is synchronized to the server via Bluetooth, and users can view historical data and health reports through mobile apps or web pages.

[0036] The implementation principle of the blood oxygen and heart rate monitoring system and method based on PPG signals and motion data in the embodiment of the present application is as follows: through multi-step optimization and signal fusion technology, the problems of signal interference, insufficient measurement accuracy and lack of motion state recognition function in dynamic environments in the prior art are effectively solved, and a high-precision and stable technical solution is provided for health monitoring of wearable devices; the method of the present application improves the accuracy and robustness of blood oxygen and heart rate detection, realizes comprehensive health detection in motion, improves data stability and continuity, and expands the application scenarios of wearable devices.

[0037] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A blood oxygen and heart rate monitoring system based on PPG signals and motion data, characterized by: include: A PPG signal acquisition module (1) for acquiring red light, infrared light and green light PPG signals; A motion sensor module (2) for collecting acceleration signals and angular velocity signals of a user; A signal preprocessing module (3) for denoising, baseline drift removal and adaptive filtering to ensure signal quality; A dynamic signal segmentation and quality assessment module (4) for signal segmentation processing and evaluating signal quality through peak-to-valley ratio and autocorrelation coefficient; A blood oxygen saturation calculation module (5) for calculating blood oxygen saturation based on an improved blood oxygen algorithm and high-quality red light and infrared light PPG signals; A heart rate calculation module (6) for accurately detecting the heart rate based on an improved heart rate algorithm, high-quality green light PPG signals, and exercise status; A motion state recognition module (7) for recognizing the motion state of a human body based on a deep learning model, acceleration and angular velocity data; An adaptive Kalman filter module (8) is used to smooth the blood oxygen and heart rate data through Kalman filtering to optimize the real-time monitoring data; The output display module (9) is used to display the blood oxygen saturation, heart rate and exercise status results in real time.

2. A blood oxygen and heart rate monitoring method based on PPG signals and motion data, characterized in that: The steps include: S1: PPG signal and motion data acquisition; S2: signal preprocessing; S3: Improved oxygen saturation calculation; S4: Improved heart rate detection algorithm; S5: motion state recognition; S6: Result output.

3. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 2, characterized in that: The step S1: PPG signal and motion data collection includes: S11: PPG signal acquisition, real-time acquisition of red light, infrared light, and green light PPG signals through sensors; S12: Motion data acquisition, using a three-axis accelerometer and gyroscope to obtain acceleration data [ ] and angular velocity data[ ]; S13: Data segmentation: the collected data is windowed with 200 points, the window length is 800 points, and the sampling rate is 100 Hz to obtain the segmented data. , and .

4. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 3, characterized in that: The step S2: signal preprocessing, comprises: S21: PPG signal de-jumping, by removing the discontinuity point algorithm, remove the jump noise between data frames, ensure the data continuity between data frames, and thus obtain a continuous PPG signal And the corresponding acceleration and angular velocity data , ; S22: Remove baseline drift, collect least squares method and fourth-order polynomial fitting, remove the baseline drift of PPG signal, and obtain , the formula is as follows: A(i,j)= Among them, i=[1∶800] is the length of the data frame; j=[1∶4]; A(i,j) represents i to the jth power, which is a 4th-order polynomial matrix: coeff= ; in represents the transpose of A, express The inverse matrix of , coeff is the 1×5 matrix coefficient; =coeff ; S23: Signal valid detection, The 200-point data collected by Zhongxin [601∶800] is judged to exceed the upper and lower thresholds ( and ), if the number of points exceeds a certain number P, the point data of [401∶600] is used to replace the 200 point data of [601∶800], and the output waveform is marked as ; ; S24: Bandpass filtering, bandpass filtering (0.8-3.5Hz) is performed on the PPG signal and the acceleration and angular velocity data respectively, and Z-Score normalization is performed on the PPG signal to obtain data , , , Z-Score normalization is as shown in the formula: ; Where x is the original data point, μ is the mean of the data set, σ is the standard deviation of the data set, and z is the normalized result. S25: Motion artifact removal, based on the obtained and , using the least mean square algorithm for time-domain adaptive filtering, the filter is at the sampling point Input As shown in the formula: ; in, is the 3-axis acceleration signal of the accelerometer, is the 3-axis angular velocity signal of the gyroscope; According to the input signal Estimation of artifact signal , and from the target signal To remove these artifacts, The filter outputs an estimated artifact signal at times the sampling rate for: ; in is the weight vector of the adaptive filter, and the net target signal output by the filter is for: ; Filter pass error To update the filter weights, ; ; in, is the step size parameter, which controls the speed of weight update. Repeat the above steps until the error Converge to get a signal with motion artifacts removed , thus obtaining the PPG signal with motion artifacts removed ; S26: Downsampling, , and Downsample to 25Hz and get data and .

5. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 4, characterized in that: The step S3: improved blood oxygen saturation calculation comprises: S31: Signal quality assessment, through The red part of the signal and infrared light Calculate the peak-to-valley ratio and autocorrelation coefficient of the data , select high-quality signals for subsequent blood oxygen saturation calculation, peak-to-valley ratio for: ; in is the peak value, is the valley value, calculate the average value of all peaks and valleys As the peak-to-valley ratio of the overall signal: ; in is the number of peak-valley pairs detected within the window, It is The peak-to-valley ratio of the peak-to-valley pairs; Autocorrelation coefficient As shown in the formula: ; ; in, It's a signal Delay in time The autocorrelation value under Indicates the PPG signal at time point The value at is the total number of samples of the signal, The value range is from 0 to Find the first significant peak of the autocorrelation coefficient , when the PPG signal in the sliding window satisfies > as well as > When , keep the signal. and They are the set peak-to-valley ratio threshold and autocorrelation coefficient threshold respectively; S32: Blood oxygen saturation calculation, based on PPG signal, uses the absorption difference of light of different wavelengths when passing through tissue to measure the ratio of oxygenated hemoglobin and reduced hemoglobin, and calculates the blood perfusion rate of red light data With infrared data The ratio of blood perfusion rate With infrared data As shown in the formula: ; ; in, is the red light data Signal amplitude, is the red light data Signal amplitude, Infrared data Signal amplitude, Infrared data Signal amplitude; Red light perfusion rate Infrared light perfusion rate The ratio is set to , The calculation formula is as shown in the formula: ; Blood oxygen saturation and The oxygen reduction experiment was carried out by expressing the functional relationship between the blood oxygen saturation value in the experimental data and the corresponding The value is fitted to obtain the blood oxygen saturation and The functional relationship between The function polynomial of is a first-order polynomial, then the reference formula of the first-order polynomial is: ; in, , are the coefficients of the first-order polynomial that needs to be fitted; If the experimentally fitted blood oxygen saturation is If the function polynomial of the value is a quadratic polynomial, then the reference formula of the quadratic polynomial is: ; in, , , are the coefficients of the quadratic polynomial that need to be fitted; S33: Weighted calculation of blood oxygen saturation. In the sliding window, the preliminary blood oxygen saturation is calculated based on the peaks and valleys corresponding to each red light and infrared light. , using historical blood oxygen saturation Perform weighted processing on the preliminary calculated values ​​to obtain the comprehensive blood oxygen saturation within the current window , the weighted formula is as follows: ; in, represents the number of peak-valley pairs in the sliding window, It is an adjustment parameter used to control the decay rate of the weight; S34: Blood oxygen saturation smoothing, using adaptive Kalman filtering to smooth the calculated blood oxygen saturation, combined with historical blood oxygen saturation data, improve the consistency of the time series, and dynamically adjust the process noise covariance and the observation noise covariance , in order to adaptively cope with the uncertainty under different measurement conditions; Kalman filter first initializes the parameters and sets the initial blood oxygen estimation value is the initial measurement value of the system. The filtering process includes prediction and update. In the prediction step, based on the last estimated value , calculate the current blood oxygen prediction value and its covariance ,Right now: ; ; in, is the state transfer matrix, which describes the evolution of the system state. In the model with a smooth change in blood oxygen saturation, Set as , indicating that there is no significant jump between the current blood oxygen saturation and the previous moment's blood oxygen saturation. is the process noise covariance, reflecting the uncertainty of the system, through the current measurement value Calculate residuals : = ; in, is the observation matrix, which is used to transform the predicted state Mapped to the observation space, with the current measurement value By comparison, in the model with a steady change in blood oxygen saturation, Set as ; In the update step, the Kalman gain is first calculated : = ; in, is the observation noise covariance, reflecting the measurement uncertainty, and based on the Kalman gain, updates the estimated blood oxygen saturation and covariance : ; ; Dynamic update by monitoring the estimated error and residual changes and : ; ; in, and is an adjustment factor used to dynamically adjust for changes in process noise and observation noise.

6. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 5, characterized in that: The step S4: improving the heart rate detection algorithm comprises: S41: Signal frequency domain transformation, The green part Data and acceleration data Perform a 1024-point FFT transformation, intercept the spectrum data within [0.8-3.5] Hz, and normalize the acceleration data to the maximum value, limiting the value to the range of [0, 1], and obtain and ; S42: Frame motion state calibration, using three-axis acceleration The mean of the sum of squares of the data With threshold and For comparison, > ,like > The current frame is determined to be a motion frame, and the state weight of the current frame is calibrated =a; if < < The current frame is calibrated as a micro-motion frame, and its state weight =b; if < Then the current frame is calibrated as a relatively static frame, and its state weight =c, where 0<a<b<c<1, and a+b+c=1, , The value of is determined by the user using the accelerometer. The calculation formula is as follows: ; Among them, ACCX, ACCY and ACCZ are The x, y, and z direction vectors; S43: Use a double-layer frequency domain Wiener filter to further filter out motion artifacts in the PPG signal in the frequency domain through the motion state represented by the accelerometer. The process of Wiener filtering is as follows: First, calculate the first N frames The spectrum mean of is normalized to the maximum value, and we get , and calculate the weights of the first layer of Wiener filter : =1-( ) ; in, Represents point division, and calculates the weight of the second layer Wiener filter: = ( ); right and For the part with weight less than 0, the clamp is set to -1, and two weights are used to obtain two filter outputs: =; = ; in, Represents dot product. For the above two filter outputs, weighted fusion is performed according to the standard deviation to obtain the filter output of the current frame. : = ; in, and They are and The standard deviation of Perform maximum normalization and get ; S44: Joint adaptive weighted filtering for historical M frames The spectrum is weighted according to three weights: Gaussian weight, state weight, and concentration weight; Gaussian weight: Take the current data frame as the starting frame and generate the Gaussian weights of the previous M data frames. The Gaussian weight symbol is , where 1< <M; State weight: Use the corresponding historical M frames As the state weight, where 1< <M; Concentration weight: Use the peak concentration corresponding to the historical M frames As the concentration weight, where 1< <M; The peak concentration is based on The highest peak of the spectrum With its top 10 peaks The difference is obtained by summing the differences, where the highest peak needs to be removed and 2 < <10, the peak concentration calculation formula for each data frame is as follows: ; Among them, the peak concentration is used to characterize the cleanliness of the spectrum signal. The peak concentration is the highest in the single-peak condition, and the more artifact peaks there are, the lower the peak concentration is. The final joint weight of the historical M frames Determined using the product of the three weights above: = × × ; Based on this weight, the historical M frames Perform weighted summation to obtain ; = × ; S45: Piecewise function weighting, first obtain the historical K data frames × ,in, K, find the largest three × Corresponding data frame The highest peak index in the spectrum is denoted by , where , and the average of these three indexes is obtained as shown in the formula: ; is a piecewise function. Based on this piecewise function, the obtained The weight of each point in the spectrum Assume that there are N points in the spectrum, that is, 1< <N, then the formula is as follows: ;; Based on this weight, Weighted calculation , the formula is as follows: ; in, It is the spectrum and The index of the previous point, N, N is the total number of points on the spectrum; S46: Adaptive heart rate search, set an adaptive variable ,in, ; in is the current frame, Representation History Frame, Start The frame uses 20 as the initial value, and then adaptively takes the value as the heart rate value of the corresponding frame; Set the adaptive search interval and: ( ); ( ); in is the spectrum resolution, expressed as follows: ; Among them, H represents the signal frequency after PPG, F represents the number of Fourier points, and the obtained The heart rate interval size of the unit index interval mapping in the spectrum is Based on this interval, the heart rate value corresponding to the index of each point in the spectrum can be obtained, thereby generating a , i.e., a heart rate lookup table mapped according to the spectrum index, which is used to subsequently look up the corresponding heart rate according to the index of the highest peak value found; When the search interval [ , ]Exceed When the spectrum range is within the range of [ , Search in Index of the highest peak ,Right now: = ; After getting the index, it can be mapped to the heart rate: ; S47: Heart rate post-processing, using R heart rate data obtained from the past R data frames to calculate a linear prediction value , using the above and Weighted , the formula is as follows: ; in, Weighted value for heart rate; Perform frame difference heart rate determination by comparing the current heart rate with the previous frame heart rate The difference is used to limit the possible large-scale jump, and the final heart rate As shown below: ; in, , The value should be determined based on the actual situation.

7. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 6, characterized in that: The step S5: motion state identification includes: S51: Data preprocessing and feature extraction, Original dataset construction: and The data is transmitted to the server via Bluetooth, and the data is labeled with motion status according to the motion status when the data is collected, thereby constructing the original data set; Data loading: load the three-axis acceleration and angular velocity data from the original data set and extract the motion state label; Label encoding: Use the motion state label to encode it into integer form and convert it into a one-hot encoding ; Time series sliding window: Slice the data using sliding window technology to generate time series input features while retaining the contextual information in the time series; Normalization: Normalize the sliced ​​data to ensure that the input feature range is consistent and reduce the impact of noise; S52: Data partitioning: randomly shuffle the data set according to , , The ratio is divided into training set, validation set and test set to ensure the generalization ability of the model. , , The values ​​are 0.8, 0.1, 0.1; S53: Model design and construction, Input layer: receives multi-dimensional time series input of three-axis acceleration and angular velocity data; Convolutional layer: extracts local spatiotemporal features and enhances the model's ability to perceive short-term change patterns; Pooling layer: through the maximum pooling operation Reduce data dimensions, extract important features, and reduce the amount of calculation; Two-Way Layer: Through two-way Capture the dependencies between time series and enhance the model's ability to learn long-term dependency patterns; Attention mechanism: The multi-head attention layer highlights the features of key time steps and improves the model's ability to classify motion states; Fully connected layer: classifies the features output by the attention layer and maps the results into the probability distribution of each motion state; S54: Model training and optimization, Loss Function: Choice As a loss function, used for multi-classification tasks; Optimizer: Adopts Adam optimizer to converge quickly and avoid local optimal solutions; Evaluation indicators: Use accuracy, precision, recall, and F1-score as the main evaluation indicators to monitor model performance in real time; S55: Model evaluation and testing, Prediction classification: Use the trained model to predict the motion state category in the test set and output the prediction results; Accuracy calculation: Compare the prediction results with the actual labels, calculate the model classification accuracy, and verify its performance on the test set; S56: Actual effect: By combining the CNN, BiLSTM and attention mechanism models, complex motion patterns are classified, and high-precision classification of multiple motion states is achieved for motion state monitoring needs in multiple scenarios.

8. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 7, characterized in that: Step S6: Result output, the device displays the smoothed blood oxygen saturation and heart rate. and The data is transmitted to the server via Bluetooth, and the server responds to the data sent and The data is classified into exercise status and transmitted back to the device via Bluetooth for display. At the same time, the blood oxygen saturation, heart rate and exercise status are uploaded to the web page, APP, etc. for user use.

Citation Information

Patent Citations

  • Dynamic heart rate and blood oxygen measuring method based on Pearson's correlation coefficient

    CN107456219A

  • Blood oxygen detection device based on green light, blood oxygen detection method thereof and medium

    CN114073520A

  • Health monitoring bracelet detection method and system capable of detecting pulse rate and blood oxygen in real time

    CN119097310A

  • Heart rate self-calibration monitoring system and method based on deep learning model

    CN119453970A

Cited By

  • Sleep apnea monitoring method and device, electronic monitoring equipment and storage medium

    CN120284214A

  • Skin-attached oxyhemoglobin saturation monitoring device and system based on wireless remote measurement

    CN120419953A

  • Wearable double-layer adaptive Kalman filtering ambulatory blood pressure monitoring system

    CN120501395A

  • Wearable dual-layer adaptive kalman filtering ambulatory blood pressure monitoring system

    CN120501395B

  • Intelligent processing method and system for heart rate monitoring data

    CN120597329A