Machine learning-based blood glucose trend prediction model construction method
Patent Information
- Application Number
- CN202611134054.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-10-27
AI Technical Summary
[0005]本发明的主要目的在于提供基于机器学习的血糖趋势预测模型构建方法,以解决现有技术中依赖单一域特征导致预测精度不稳定的技术问题
[0016]本发明有益效果在于:通过时域特征提取通道与频域特征提取通道的跨域融合生成多维特征表示,经预存的血糖波动模式库进行典型波动模式匹配,调用对应趋势判定边界参数驱动带模式自适应分裂约束的梯度提升树模型输出血糖趋势强度等级值,实现全过程可追溯的个性化趋势预测,并将预测结果转化为可执行的模型参数更新指令,满足连续血糖监测场景下实时趋势预测与模型自适应优化的需求。
Smart Images

Figure CN122986718A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical and health data processing technology, and in particular to a method for constructing a blood glucose trend prediction model based on machine learning. Background Technology
[0002] With the continued rise in diabetes prevalence and the widespread adoption of continuous glucose monitoring technology, blood glucose trend prediction has become a crucial basis for diabetes management. Accurate blood glucose trend prediction can help patients and healthcare professionals identify the risk of hyperglycemia or hypoglycemia in advance and take timely intervention measures.
[0003] Current blood glucose prediction methods have significant limitations: First, they rely on single-domain features for prediction, which cannot simultaneously characterize the rapid changes and cyclical rhythms of blood glucose fluctuations, resulting in one-sided feature representation and limited prediction accuracy. Second, they are significantly affected by individual physiological differences, leading to unstable prediction accuracy and difficulty in adapting to different patients' blood glucose fluctuation patterns. Third, the prediction results lack interpretability and cannot provide full-process traceability of the prediction basis, resulting in insufficient trust in the prediction results by clinical users.
[0004] Therefore, there is an urgent need for a blood glucose trend prediction method that can integrate multi-dimensional feature information, adapt to individual differences, and provide interpretable prediction basis to meet the needs of real-time trend prediction and model adaptive optimization in continuous blood glucose monitoring scenarios. Summary of the Invention
[0005] The main objective of this invention is to provide a method for constructing a blood glucose trend prediction model based on machine learning, so as to solve the technical problem of unstable prediction accuracy caused by relying on single-domain features in the prior art.
[0006] To achieve the above objectives, the present invention provides a method for constructing a blood glucose trend prediction model based on machine learning, comprising the following steps: S1. Obtain the blood glucose sampling value, sampling timestamp and sampling interval parameters output by the continuous blood glucose monitoring device, and generate a blood glucose time series data stream; S2. Perform gap filling and anomaly removal on the blood glucose time-series data stream to obtain clean blood glucose time-series data; S3. Simultaneously extract time-domain feature vectors and frequency-domain feature vectors from the clean blood glucose time-series data, and concatenate the time-domain feature vectors and the frequency-domain feature vectors according to the channel dimension to form a cross-domain fusion feature vector; S4. Call the pre-stored blood glucose fluctuation pattern library, and use the pattern matching working mode and similarity calculation mode to calculate the similarity between the cross-domain fusion feature vector and the pattern feature vector of each typical fluctuation pattern in the blood glucose fluctuation pattern library, and take the typical fluctuation pattern with the largest similarity value as the current matching mode. S5. Based on the current matching mode, retrieve the corresponding trend judgment boundary parameters, input the cross-domain fusion feature vector into the gradient boosting tree model with mode adaptive splitting constraint, and output the blood glucose trend intensity level value within the future preset time period. S6. The blood glucose trend intensity level value and the corresponding prediction probability value are weighted and fused to generate a blood glucose trend prediction result. At the same time, the blood glucose trend prediction result is fed back to the model training end to trigger the parameter iterative update of the gradient boosting tree model.
[0007] Optionally, step S1, acquiring the blood glucose time-series data stream, includes: The data frames of the continuous blood glucose monitoring device are read at a fixed sampling frequency. The instantaneous blood glucose concentration and the cumulative number of sampling points are extracted from the blood glucose sampling values. The relative offset between the current time and the reference time is extracted from the sampling timestamp. The deviation rate between the actual interval duration and the nominal interval duration is extracted from the sampling interval parameter. The above data is concatenated according to the time sequence dimension to generate the blood glucose time-series data stream; When the instantaneous blood glucose concentration is detected to exceed the physiological effective range or the deviation rate exceeds the preset tolerance, a data quality anomaly identifier is generated, the blood glucose time series data stream is marked as pending verification, the current data cache queue is frozen, and all data within the time window from before the anomaly is triggered to the time window after the anomaly is triggered is retained.
[0008] Optionally, step S2, determining the vacancy-filling strategy, includes: Identify the set of missing data in the blood glucose time series data stream, extract the blood glucose sampling values of adjacent time points before and after the missing data, and use the arithmetic mean of the blood glucose sampling values of adjacent time points as the missing data filling value; Calculate the blood glucose median and absolute median difference of the blood glucose in the blood glucose time series data stream. Use the blood glucose median plus or minus three times the absolute median difference of the blood glucose as the anomaly removal threshold. Mark blood glucose sampling values that exceed the anomaly removal threshold as anomalies and remove them to obtain the clean blood glucose time series data.
[0009] Optionally, step S3, controlling the extraction of time-domain and frequency-domain feature vectors, includes: Monitor the current status of the clean blood glucose time-series data, and when a data quality anomaly is detected, trigger the cross-domain feature extraction system composed of the time-domain feature extraction channel and the frequency-domain feature extraction channel to take over; Based on the activation state of the cross-domain feature extraction system, the blood glucose change rate calculation, blood glucose change acceleration calculation, and blood glucose fluctuation amplitude calculation are performed on the clean blood glucose time series data to obtain the time domain feature vector. Based on the activation state of the cross-domain feature extraction system, the main frequency identification of blood glucose fluctuations and the energy distribution calculation of blood glucose fluctuations are performed on the clean blood glucose time series data to obtain the frequency domain feature vector; The time-domain feature vector and the frequency-domain feature vector are concatenated along the channel dimension to obtain the cross-domain fusion feature vector.
[0010] Optionally, step S3 further includes generating a cross-domain fusion feature vector association data chain, specifically: When the data quality anomaly flag is detected, the regular feature extraction process is interrupted, the pointer position of the current window data block is frozen, and historical data and real-time data in the cache queue are extracted to form a data packet to be fused. Based on the effective data density of the data packets to be fused, the sampling granularity parameters of the time-domain feature vector and the frequency-domain feature vector are dynamically adjusted, and the cross-domain feature extraction system is controlled to enable the multi-channel parallel fusion mode and perform cross-domain splicing operation simultaneously. The cross-domain fusion feature vector is associated and bound with the batch number, channel number, and feature extraction time of the corresponding window data block to generate a data chain that can be traced back to the entire process of a single feature extraction.
[0011] Optionally, step S4, which synchronously calls the blood glucose fluctuation pattern library, includes: The pattern matching working mode and similarity calculation mode are invoked to collect the feature values to be matched of the cross-domain fusion feature vector and the pattern feature vectors of each typical fluctuation pattern in the blood glucose fluctuation pattern library, respectively. The feature value to be matched is aligned with the pattern feature vector according to the feature dimension. The feature value to be matched is then weighted and corrected using the weight distribution of the pattern feature vector. The weight distribution of the pattern feature vector is obtained by statistical analysis of the historical matching frequency of each typical fluctuation pattern. The similarity value is generated after correction. The similarity value is associated with the pattern number, matching time and current matching pattern identifier of the corresponding typical fluctuation pattern to generate a data chain that can be traced back to the entire process of a single pattern matching.
[0012] Optionally, step S5, generating the blood glucose trend intensity level value, includes: The typical fluctuation curves, trend turning features, and amplitude grading parameters pre-stored in the blood glucose fluctuation pattern library are called, and the cross-domain fusion feature vector is compared and calculated with the trend judgment boundary parameters corresponding to the current matching mode to generate the blood glucose trend intensity level value. The blood glucose trend intensity level is divided into five intervals based on the rate of blood glucose change: Level 1 is a rate of decrease of blood glucose greater than or equal to 1.5 mmol / L·h; Level 2 is a rate of decrease of blood glucose greater than or equal to 0.5 mmol / L·h and less than 1.5 mmol / L·h; Level 3 is an absolute rate of change of blood glucose less than 0.5 mmol / L·h; Level 4 is a rate of increase of blood glucose greater than or equal to 0.5 mmol / L·h and less than 1.5 mmol / L·h; and Level 5 is a rate of increase of blood glucose greater than or equal to 1.5 mmol / L·h.
[0013] Optionally, step S6 generates blood glucose trend prediction results including: A weighted fusion operation is performed on the blood glucose trend intensity level values of each time window. The weighted fusion operation uses the prediction probability value of each window as the first weight and the trend continuation coefficient as the second weight. The blood glucose trend intensity level values are weighted, summed, and normalized to obtain the fused blood glucose trend prediction result. The trend continuation coefficient is used to correct the trend jump error at the window boundary. Its value is determined based on the trend consistency index in the overlapping area of the previous window and the current window. The trend consistency index is the proportion of the number of sampling points in the overlapping area whose predicted trend direction is the same as that of the previous window and the current window to the total number of sampling points in the overlapping area. Generate a blood glucose trend prediction report that includes the predicted probability of each trend level, trend reversal warning indicators, and insufficient confidence prompts. Send a display command to the blood glucose monitoring terminal through the data communication link to trigger the color coding switch or the warning icon flashing on the trend visualization interface.
[0014] Optionally, step S6, generating model parameter update instructions, includes: The prediction deviation level in the blood glucose trend prediction report is analyzed, the model parameter update instruction is generated, and transmitted to the model training end. After the model training end detects the model parameter update instruction, it switches the learning rate parameter connected to the gradient boosting tree model from the current value to the updated value and sets the retraining flag in the status register. When the predicted probability value of the first level exceeds a preset threshold, the lower limit of the trend determination boundary parameter is tightened to reduce the risk of misjudging extreme trends; when the predicted probability value of the fifth level exceeds a preset threshold, the upper limit of the trend determination boundary parameter is tightened to reduce the risk of misjudging extreme trends; when the predicted probability value of the third level exceeds a preset threshold, the overlap length parameter of the time window is increased to capture more trend turning point information; when the frequency of insufficient confidence prompts exceeds a preset threshold, the template update cycle of the blood glucose fluctuation pattern library is shortened to accelerate mode adaptation. Each adjustment parameter acts independently on the prediction channel of the corresponding trend level. The predicted probability value of each level corresponds to the blood glucose decrease rate level.
[0015] Optionally, the blood glucose fluctuation pattern library includes: The postprandial fluctuation pattern has the following feature vectors: the slope of the blood glucose rise segment is greater than the postprandial rise threshold, the peak position appears in the first time period after the start of sampling, and the absolute value of the slope of the decline segment is less than the postprandial decline threshold. The nighttime stable mode is characterized by blood glucose fluctuation amplitude values being less than the nighttime amplitude threshold, frequency domain energy distribution being concentrated in the low frequency band, and the absolute value of the rate of change being less than the nighttime rate threshold. The dawn phenomenon pattern has the following feature vectors: the acceleration value of blood glucose change is greater than the dawn acceleration threshold, the main frequency value corresponds to the early morning period, and the slope of the rising segment is increasing. The exercise response pattern, whose feature vector includes an absolute value of the slope of the blood glucose decline segment being greater than the exercise decline threshold, a sudden increase in the fluctuation amplitude value in the post-exercise period, and a shift of energy distribution to the high-frequency range; The drug intervention model has the following characteristic vectors: the absolute value of the rate of change of blood glucose drops sharply after the intervention, the peak position is related to the time of administration, and the slope of the decline is distributed in a step-like manner.
[0016] The beneficial effects of this invention are as follows: by cross-domain fusion of time-domain feature extraction channels and frequency-domain feature extraction channels to generate multi-dimensional feature representations, typical fluctuation patterns are matched through a pre-stored blood glucose fluctuation pattern library, and the corresponding trend judgment boundary parameters are called to drive the gradient boosting tree model with pattern adaptive splitting constraints to output blood glucose trend intensity level values, thereby realizing personalized trend prediction with full traceability and converting the prediction results into executable model parameter update instructions, which meets the needs of real-time trend prediction and model adaptive optimization in continuous blood glucose monitoring scenarios. Attached Figure Description
[0017] Figure 1 A flowchart illustrating a method for constructing a machine learning-based blood glucose trend prediction model according to an embodiment of this application; Figure 2A flowchart illustrating the cross-domain feature extraction process of a machine learning-based blood glucose trend prediction model construction method according to an embodiment of the present invention. Figure 3 A flowchart illustrating the pattern matching process for constructing a blood glucose trend prediction model based on machine learning, as provided in an embodiment of the present invention. Figure 4 A flowchart illustrating the trend determination process of a machine learning-based blood glucose trend prediction model construction method according to an embodiment of the present invention. Figure 5 The flowchart illustrates the confidence assessment and iterative update of model parameters in a method for constructing a blood glucose trend prediction model based on machine learning, as provided in an embodiment of the present invention.
[0018] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention.
[0019] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the following embodiments are for illustrative purposes only and are not intended to limit the invention.
[0021] See Figure 1 The main solution of this invention is: a method for constructing a blood glucose trend prediction model based on machine learning. This method generates a multi-dimensional feature representation through cross-domain fusion of time-domain feature extraction channels and frequency-domain feature extraction channels. Typical fluctuation patterns are matched using a pre-stored blood glucose fluctuation pattern library. The corresponding trend judgment boundary parameters are called to drive a gradient boosting tree model with pattern adaptive splitting constraints to output a blood glucose trend intensity level value. The blood glucose trend intensity level value is divided into multiple levels according to the rate of blood glucose change. Finally, the trend prediction result is generated by weighted fusion of prediction probabilities and fed back to trigger iterative updates of model parameters.
[0022] Because existing technologies rely on single-domain features or end-to-end training methods, they cannot effectively characterize the cyclical rhythm and rapid changes in blood glucose fluctuations. Furthermore, they are significantly affected by individual physiological differences, leading to unstable prediction accuracy. At the same time, it is difficult to achieve interpretable personalized trend prediction through typical pattern matching and cross-domain feature fusion. The blood glucose trend prediction model construction method based on machine learning provided by this invention can work in concert with the cross-domain feature extraction chain of time-domain analysis and frequency-domain transformation and the matching and recognition chain of the pre-stored pattern library to provide a trend prediction basis that is traceable throughout the process. It also transforms the prediction results into executable model parameter update instructions, thereby meeting the needs of real-time trend prediction and model adaptive optimization in continuous blood glucose monitoring scenarios.
[0023] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can understand it.
[0024] The method for constructing a blood glucose trend prediction model based on machine learning provided in this embodiment of the invention includes the following sub-steps in step S1.
[0025] S101, the continuous glucose monitoring device acquires the patient's blood glucose sampling value and records the corresponding sampling timestamp data.
[0026] The blood glucose sampling values include the glucose concentration values of subcutaneous interstitial fluid collected by a continuous glucose monitoring device at a fixed sampling frequency. Each sampling point contains blood glucose concentration information and corresponding time information. The sampling timestamp data includes the absolute timestamp corresponding to each sampling point. To ensure that the system captures rapid fluctuations and cyclical rhythms of blood glucose without omission, the sampling frequency of the continuous glucose monitoring device is configured to be once every 5 minutes, thus providing sufficient data granularity for subsequent cross-domain fusion feature extraction.
[0027] S102 performs time-series alignment processing on blood glucose sampling values and sampling timestamp data.
[0028] The timestamp information attached to the two sets of underlying data is parsed, and each sampling point is aligned using a unified clock reference. Based on this, using the time axis of blood glucose sampling values as a reference, the sampling timestamp data is matched and aligned with the blood glucose sampling values according to the principle of timestamp consistency, thereby outputting synchronized time-series data pairs with unified time labels.
[0029] To ensure the reliability of data fusion, a maximum allowable time deviation threshold is preset before performing the aforementioned timing alignment calculation. When the time interval between adjacent valid sampling points actually received exceeds this maximum allowable time deviation threshold, the observation update calculation for the current time period is immediately blocked to avoid timing distortion caused by over-reliance on mathematical interpolation when severe point loss occurs due to signal transmission jitter. The maximum allowable time deviation threshold is set to be 1.5 to 2 times the ideal time interval between two adjacent sampling points, i.e., 7.5 minutes to 10 minutes.
[0030] Through the aforementioned time-series constraint mechanism, blood glucose sampling values and sampling timestamp data are effectively aligned to a unified time reference plane.
[0031] S103 performs data quality checks on the synchronized time-series data pairs and generates data quality anomaly flags.
[0032] The instantaneous blood glucose concentration is extracted from the blood glucose sampling value, the relative offset between the current time and the reference time is extracted from the sampling timestamp, and the deviation rate between the actual interval duration and the nominal interval duration is extracted from the sampling interval parameter.
[0033] When the instantaneous blood glucose concentration is detected to exceed the physiological effective range or the deviation rate exceeds the preset tolerance, a data quality anomaly identifier is generated, the blood glucose time series data stream is marked as pending verification, the current data cache queue is frozen, and all data within the time window from before the anomaly is triggered to the time window after the anomaly is triggered is retained.
[0034] The physiologically valid range is 2.0 mmol / L to 25.0 mmol / L. This range is determined based on clinical medical consensus: below 2.0 mmol / L indicates a severe hypoglycemic crisis, and above 25.0 mmol / L indicates a severe hyperglycemic crisis. Sampling values outside this range may be due to sensor malfunction or transmission errors and do not have physiological reliability.
[0035] The preset tolerance is 20%. This tolerance is set according to the sampling accuracy specifications of the continuous glucose monitoring device, and is calculated by dividing the absolute value of the difference between the actual interval and the nominal interval by the nominal interval. For example, if the nominal sampling interval is 5 minutes, and the actual interval exceeds 6 minutes or is less than 4 minutes, the deviation rate exceeds 20%, and it is judged as an abnormal sampling interval.
[0036] All data within the time window from before the anomaly is triggered to the time window after the anomaly is triggered is retained. The duration of the time window is configured to be 30 minutes to ensure that there is enough data before and after the anomaly for subsequent verification and analysis.
[0037] In this embodiment, step S2 specifically includes the following:
[0038] After time alignment is completed, gaps are filled and anomalies are removed from the synchronized data stream, and finally clean blood glucose time series data is output.
[0039] In this computational phase, a data repair model is constructed based on the general principles of nearest neighbor interpolation and statistical distribution. Glucose values from adjacent sampling points are used to fill gaps, and the median absolute deviation method is used for anomaly identification. Glucose sampling values from adjacent time points before and after the gap are extracted from the blood glucose time-series data stream. Arithmetic mean interpolation is then performed using these adjacent time points to generate the filled-in blood glucose estimate. For the calculation process of outlier identification and removal, those skilled in the art can use well-known statistical distribution judgment methods. The threshold setting and data filtering logic are well-known techniques in the field and will not be elaborated upon here.
[0040] Using the supplemented blood glucose time-series data as input, and based on a statistical distribution model, anomaly detection thresholds for the system state are calculated. The median absolute deviation method is then used to correct for anomalies in blood glucose values. Considering the inherent random sensor error during blood glucose sampling, the anomaly removal threshold is periodically calculated using the blood glucose median and the absolute median difference. In the standard median absolute deviation logic, upper and lower bound thresholds are constructed by combining the blood glucose median and its corresponding three times absolute median difference, and anomaly sampling points exceeding these thresholds are removed. An adaptive threshold adjustment mechanism is configured in the above solution process. When blood glucose fluctuations are detected to approach zero (i.e., a stable state), a minimal positive bias coefficient is dynamically injected into the lower bound of the anomaly removal threshold. This minimal positive bias coefficient ranges from a constant of 0.1 to 0.5, thus mitigating the systemic risk of misjudging normal low-amplitude fluctuations due to threshold contraction.
[0041] After introducing this bias mechanism, the corrected anomaly removal threshold is calculated, and the clean blood glucose time series data used to characterize the data quality status is robustly updated using this corrected threshold.
[0042] Based on the cross-domain fusion architecture, after generating clean blood glucose time-series data, the clean blood glucose time-series data is continuously transmitted to the cross-domain feature extraction channel.
[0043] See Figure 2 In this embodiment, step S3 specifically includes the following sub-steps.
[0044] S301 acquires clean blood glucose time-series data and simultaneously extracts time-domain and frequency-domain feature vectors.
[0045] Considering that a single feature domain cannot simultaneously characterize the synergistic properties of rapid blood glucose fluctuations and circadian rhythms, directly training the model in a single feature space can easily lead to information bias. Based on this phenomenon, we utilize time-domain analysis and frequency-domain transformation channels to find the optimal fusion path that complements global information between two different feature domains.
[0046] The specific implementation process of this cross-domain fusion mechanism is as follows: Blood glucose change rate, blood glucose change acceleration, and blood glucose fluctuation amplitude are extracted from clean blood glucose time-series data to construct a time-domain feature vector. Simultaneously, the dominant frequency and energy distribution of blood glucose fluctuations are extracted to construct a frequency-domain feature vector. The time-domain feature vector captures the rapid fluctuation characteristics of blood glucose over a short period, while the frequency-domain feature vector captures the periodic rhythm characteristics of blood glucose over a longer time range. Through this nonlinear feature domain complementarity mechanism, the biased information error of single-domain features is effectively eliminated, allowing focus on the synergistic characterization of the multi-dimensional characteristics of blood glucose fluctuations. The final output is a multi-dimensional feature representation that can quantitatively characterize the current blood glucose state and trend changes.
[0047] Let the formula for the rate of change of blood glucose in the time-domain feature vector be: In the formula, v represents the rate of change of blood glucose. This represents the blood glucose sampling value at the t-th sampling time. This represents the blood glucose sampling value at the (t-1)th sampling time, and mean represents the arithmetic mean operation.
[0048] Let the formula for the acceleration of blood glucose change in the time-domain feature vector be: In the formula, 'a' represents the acceleration of blood glucose change. This represents the blood glucose sampling value at the (t-2)th sampling time.
[0049] Let the formula for the blood glucose fluctuation amplitude in the time-domain feature vector be: Where A represents the maximum fluctuation range of blood sugar, max represents the operation of taking the maximum value, and min represents the operation of taking the minimum value.
[0050] Let the formula for the principal frequency of blood glucose fluctuations in the frequency domain eigenvector be: In the formula, Indicates the dominant frequency of blood glucose fluctuations. argmax represents the complex value of the k-th frequency component after the discrete Fourier transform, and argmax represents the frequency index operation corresponding to the maximum amplitude.
[0051] Let the formula for the energy distribution of blood glucose fluctuations in the frequency domain eigenvector be: In the formula, E represents the energy distribution of blood glucose fluctuations, and Σ represents the summation operation over all frequency components.
[0052] S302, in order to transform the parameters reflecting the characteristics of a single domain into a multi-dimensional feature representation with trend prediction business significance, a cross-domain fusion feature vector is generated based on the extraction results.
[0053] Before proceeding to the specific calculation steps, a fusion logic is constructed based on the general mathematical principles of channel splicing. In this embodiment, a cross-domain fusion splicing formula is used to calculate the cross-domain fusion feature vector. The cross-domain fusion splicing formula is as follows: In the formula, X represents the cross-domain fusion feature vector, v represents the rate of change of blood glucose, a represents the acceleration of change of blood glucose, and A represents the maximum amplitude of blood glucose fluctuation. E represents the dominant frequency of blood glucose fluctuations, and E represents the energy distribution of blood glucose fluctuations. · This indicates concatenation operations based on channel dimensions.
[0054] The purpose of introducing this cross-domain fusion and splicing formula is to construct a multi-dimensional complementary logic for feature representation. As a preferred approach, the dimensional ratio of the time-domain feature vector to the frequency-domain feature vector is set to 3:2, with its specific value dynamically configured based on the proportion of fluctuation and periodic characteristics under different monitoring scenarios. The physical meaning of this dimensional ratio lies in controlling the fusion weight of rapid fluctuation information in the time domain and periodic rhythm information in the frequency domain. Since both the time-domain and frequency-domain feature vectors are non-negative physical quantities, and information loss is avoided through channel-dimensional splicing, this formula effectively preserves the complete dynamic characteristics of blood glucose fluctuations. When rapid blood glucose fluctuations are significant, the time-domain feature vector dimension dominates; when blood glucose periodic rhythms are significant, the frequency-domain feature vector dimension provides supplementary information.
[0055] S303, after completing cross-domain feature fusion, proceeds to the data caching and association binding stage before pattern matching. The cross-domain fused feature vector is associated with the batch number, channel number, and feature extraction time of the corresponding window data block.
[0056] To achieve full traceability of the feature extraction process, an independent data chain node is constructed for each feature extraction operation under the cross-domain fusion feature vector. In this embodiment, an association-binding storage method is used to record the extracted association information. Specifically, a binding factor is set to associate and store the newly generated cross-domain fusion feature vector with the batch number, channel number, and feature extraction time of the corresponding window data block.
[0057] The data processing logic for this association-binding storage operation is as follows: A fixed data chain identifier is assigned to the newly generated cross-domain fusion feature vector, and complementary association attributes (batch number, channel number, and feature extraction time) are assigned to the corresponding window data block. These two are linearly added to generate the updated data chain state of the feature extraction node. This dynamic binding mechanism based on association logic ensures that the final established data chain objectively reflects the temporal evolution of the feature extraction operation and effectively correlates with batch data fluctuations caused by window segmentation.
[0058] See Figure 3 In this embodiment, step S4 specifically includes the following sub-steps.
[0059] S401, Construction and initialization of the blood glucose fluctuation pattern library.
[0060] In this embodiment, the blood glucose fluctuation pattern library is implemented using an offline construction and online access method. First, historical continuous blood glucose monitoring data is collected and divided into multiple data segments according to time windows. Each data segment contains the blood glucose sampling value and the corresponding timestamp information. Second, the data segments are manually or semi-automatically labeled to identify and mark different fluctuation pattern types. Then, statistical features are calculated for each labeled pattern data segment to construct a pattern feature vector.
[0061] The specific thresholds and determination methods for the feature vectors of each mode are as follows: The pattern feature vector of postprandial blood glucose fluctuation includes: a slope greater than the postprandial rise threshold, a peak position occurring in the first time interval after sampling begins, and an absolute value of the slope of the decline segment less than the postprandial decline threshold. The postprandial rise threshold is determined based on statistical analysis of postprandial blood glucose responses in healthy individuals, ranging from 1.5 mmol / L·min to 2.5 mmol / L·min. The first time interval is 30 to 60 minutes after sampling begins. The postprandial decline threshold ranges from 0.5 mmol / L·min to 1.5 mmol / L·min.
[0062] The characteristic vector of the nighttime stable pattern includes: blood glucose fluctuation amplitude values less than the nighttime amplitude threshold, frequency domain energy distribution concentrated in the low-frequency band, and the absolute value of the rate of change less than the nighttime rate threshold. The nighttime amplitude threshold ranges from 0.3 mmol / L to 0.8 mmol / L. The low-frequency band refers to frequency components with frequencies below 0.01 Hz. The nighttime rate threshold ranges from 0.1 mmol / L·min to 0.3 mmol / L·min.
[0063] The characteristic vector of the dawn phenomenon pattern includes: a blood glucose acceleration value greater than the dawn acceleration threshold; a dominant frequency value corresponding to the early morning period; and an increasing slope in the rising phase. The dawn acceleration threshold ranges from 0.05 mmol / L·min² to 0.15 mmol / L·min². The early morning period is from 4:00 to 7:00.
[0064] The pattern feature vector of the exercise response mode includes: the absolute value of the slope of the blood glucose decline segment is greater than the exercise decline threshold; the fluctuation amplitude increases sharply in the post-exercise period; and the energy distribution shifts to the high-frequency range. The exercise decline threshold ranges from 2.0 mmol / L·min to 4.0 mmol / L·min. The post-exercise period is from 0 minutes to 30 minutes after the end of exercise. The high-frequency range refers to frequency components with frequencies higher than 0.05 Hz.
[0065] The characteristic vectors of the drug intervention model include: a sharp drop in the absolute value of the rate of blood glucose change in the post-intervention period; a peak position correlated with the time of administration; and a step-like distribution of the slope of the decline. The post-intervention period is 15 to 45 minutes after administration.
[0066] When the system is first deployed, since there is no historical matching frequency data, a preset initial weight coefficient is used for similarity calculation. This initial weight coefficient is determined as follows: based on the correlation strength analysis between each feature dimension and the accuracy of blood glucose fluctuation pattern recognition, specifically using a mutual information calculation method known in the field, to quantify the correlation strength between each feature dimension, including blood glucose change rate, blood glucose change acceleration, blood glucose fluctuation amplitude, blood glucose fluctuation dominant frequency, and blood glucose fluctuation energy distribution, and the pattern category label. The larger the mutual information value, the larger the corresponding initial weight coefficient.
[0067] Taking the postprandial fluctuation pattern as an example, the correlation strength of the blood glucose change rate dimension is the highest, with an initial weight coefficient of 0.3; the correlation strength of the blood glucose change acceleration dimension and the blood glucose fluctuation amplitude dimension is the second highest, with an initial weight coefficient of 0.2 for each; the correlation strength of the blood glucose fluctuation main frequency dimension and the blood glucose fluctuation energy distribution dimension is relatively low, with an initial weight coefficient of 0.15 for each.
[0068] Taking the nighttime stable mode as an example, the correlation strength between the main frequency dimension of blood glucose fluctuation and the energy distribution dimension of blood glucose fluctuation is the highest, with an initial weight coefficient of 0.3 for each; the correlation strength between the blood glucose change rate dimension and the blood glucose fluctuation amplitude dimension is the second highest, with an initial weight coefficient of 0.15 for each; and the correlation strength between the blood glucose change acceleration dimension is the lowest, with an initial weight coefficient of 0.1.
[0069] During system operation, the initial weighting coefficients mentioned above are gradually replaced by statistically obtained dynamic weighting coefficients as the historical matching frequency of each typical fluctuation pattern accumulates.
[0070] S402, parse the received cross-domain fusion feature vector and calculate the corresponding similarity value.
[0071] Considering the objective physical differences in the feature space distribution corresponding to different typical fluctuation patterns, using a fixed and uniform similarity calculation method can easily lead to misjudgment of patterns in dense feature distribution states or missed detection of patterns in sparse feature distribution states. Based on this feature space condition, a similarity modulation logic dynamically correlated with the pattern feature vector is constructed. In this embodiment, a similarity calculation formula is used to calculate the similarity value. The similarity calculation formula is as follows: In the formula, sim represents the similarity score. Indicates the comprehensive feature value to be matched. Indicates the comprehensive feature value within the library. This represents the absolute value of the difference between the composite feature value to be matched and the composite feature value in the database.
[0072] Introducing this similarity calculation formula helps to give the system adaptive pattern recognition flexibility. When the spatial distance between the cross-domain fusion feature vector and the pattern feature vector of a certain typical fluctuation pattern is small, the corresponding similarity value is large, and a high pattern matching confidence score is output to confirm the current blood glucose fluctuation type. As the spatial distance increases, the value decays, and the similarity value decreases smoothly, thus gradually exploring other typical fluctuation patterns.
[0073] S403, based on the similarity value, calculate the maximum similarity selection for each typical fluctuation pattern in the blood glucose fluctuation pattern library.
[0074] The selection priority of typical fluctuation patterns is positively correlated with the magnitude of the similarity score. To construct a pattern matching mechanism with tiered discriminative power, the maximum similarity selection formula is used to determine the current matching pattern. The maximum similarity selection formula is as follows: In the formula, Indicates the current matching mode. This represents the numerical similarity to the postprandial fluctuation pattern. This represents a numerical value indicating the similarity to the nighttime stable pattern. This represents the numerical similarity to the dawn phenomenon pattern. This represents a numerical value indicating the similarity to the motion response pattern. This represents the numerical similarity to the drug intervention pattern, and argmax represents the pattern index operation corresponding to the maximum value.
[0075] The physical meaning of this formula lies in establishing a dynamic decay model for pattern recognition. In a preferred embodiment, the priority order of postprandial fluctuation patterns, nighttime stable patterns, dawn phenomenon patterns, exercise response patterns, and drug intervention patterns is statically configured based on their clinical frequency. Through the constraints of this priority logic, both the waste of computational resources or the risk of response delay caused by full pattern traversal are avoided, while differentiated pattern recognition for different blood glucose fluctuation states is achieved. For blood glucose fluctuation states with concentrated feature distributions, the typical fluctuation pattern with the highest similarity value is selected first to form a clear pattern determination; while for blood glucose fluctuation states with dispersed feature distributions, other typical fluctuation patterns are tried sequentially according to the similarity value until the matching threshold is met.
[0076] S404 compares the current matching pattern output by the solution with the preset matching threshold.
[0077] The current matching pattern is compared with a preset matching threshold in real time through local caching. This threshold comparison matching mechanism enables high-frequency pattern type confirmation tasks to be completed independently based on the latest matching status in the local cache, without relying on repeated calculations of high-dimensional features. This processing architecture, which combines macro-level offloading of feature calculation with local execution of threshold comparison, effectively overcomes the physical defect of pattern matching lag caused by the curse of dimensionality in traditional methods of repeated calculation of high-dimensional features.
[0078] See Figure 4 In this embodiment, step S5 specifically includes the following sub-steps.
[0079] S501, based on the preset pattern matching results on the edge, initiates the parameter retrieval mechanism for trend determination.
[0080] In this embodiment, the trend determination boundary retrieval formula is used to extract the corresponding boundary parameters. The trend determination boundary retrieval formula is as follows: B={L,U} In the formula, B represents the set of boundary parameters for trend determination, L represents the vector of lower limit values for blood glucose change, and U represents the vector of upper limit values for blood glucose change.
[0081] S502 calls the gradient boosting tree model with pattern adaptive splitting constraints as the dynamic boundary for trend determination.
[0082] Considering the inherent sensor noise and occasional high-frequency drift in the underlying data acquisition during continuous blood glucose monitoring, relying solely on extreme value deviations at a single sampling point to trigger trend level determination could easily lead to frequent false alarms and interfere with normal monitoring operations. Based on this characteristic, a cumulative determination mechanism based on a preset future time period is introduced.
[0083] As a preferred approach, the duration of the preset time period is dynamically set based on clinical monitoring needs, configured to include a continuous effective sampling interval of 30 to 60 minutes, whose corresponding time span precisely covers the basic blood glucose fluctuation cycle in the human body. Multiple consecutive sampling points within the current observation period are extracted, and the difference in blood glucose values between the first and last sampling points is calculated. Only when this difference falls within the boundary interval of the corresponding trend level is the current blood glucose level determined to be in a true trend change state. This multi-dimensional time period and amplitude joint determination logic effectively avoids one-sided decisions caused by relying on a single outlier. When the blood glucose value difference falls within the corresponding boundary interval, a trend level determination instruction is generated based on a gradient boosting tree model with pattern adaptive splitting constraints, and the calculated probability distribution is encapsulated and written into the underlying data payload of this instruction.
[0084] In this embodiment, the gradient boosting tree model with pattern adaptive splitting constraints is implemented as follows: During the model training phase, for a given feature vector sample x and the current matching mode m, the trend judgment boundary parameter interval B(m)=[L(m),U(m)] corresponding to the mode is obtained, where L(m) is the lower limit vector of blood glucose change and U(m) is the upper limit vector of blood glucose change.
[0085] When constructing the t-th decision tree, for a candidate split point s, calculate the sample set S of the left child nodes after the split. L and the right child node sample set S R Mean μ of the predicted values L and μ R Determine μ L and μ R Whether all matches fall within the boundary parameter interval B(m) corresponding to the current matching pattern m, i.e., satisfying L(m) ≤ μ L ≤U(m) and L(m)≤μ R ≤U(m).
[0086] If the above conditions are met, the split is allowed, and the decrease in the loss function ΔLoss(s) resulting from the split is calculated; if the above conditions are not met, the split point is disabled or a penalty term is applied. , where λ is the penalty coefficient, ranging from 0.1 to 0.5. The physical meaning of the penalty term is to suppress split paths that produce cross-modal prediction bias, forcing the model to learn within a data distribution space that conforms to the current physiological pattern.
[0087] Among all candidate split points that pass the constraint test, the split point that maximizes the decrease in the modified loss function is selected for splitting. The formula for calculating the decrease in the modified loss function is as follows: ΔLoss'(s)=ΔLoss(s)-λ·Penalty(s) In the formula, Penalty(s) is the penalty term when the constraint test fails, and Penalty(s) = 0 when the constraint test passes.
[0088] The above splitting process is recursively executed until the stopping condition is met, such as the tree depth reaching the preset upper limit or the number of node samples falling below the threshold, thus generating a decision tree adaptively coupled with the current matching mode.
[0089] Through the aforementioned adaptive splitting constraint mechanism, the model develops differentiated splitting paths under different blood glucose fluctuation patterns: in the postprandial fluctuation pattern, the model tends to select a larger splitting threshold to quickly respond to the rising blood glucose trend; in the nighttime stable pattern, the model tends to select a smaller splitting threshold to suppress false positives caused by noise; in the dawn phenomenon pattern, the model adaptively adjusts the splitting direction to match the increasing upward slope; in the exercise response pattern, the model prioritizes identifying rapidly declining splitting features; and in the drug intervention pattern, the model adjusts the splitting sequence according to the time of drug administration to capture step-like changes. This adaptive coupling between the model structure and the patient's current fluctuation pattern significantly improves the accuracy of trend intensity level determination and individual adaptability.
[0090] S503, in conjunction with the aforementioned generated judgment instruction, completes the physical mapping of trend strength. Through the feature transmission channel, the trend level judgment instruction, encapsulated with a probability distribution, is transmitted to the trend quantization stage. The instruction payload is received and parsed, and the probability distribution is extracted to configure the internal level encoding parameters.
[0091] After parameter modulation, the system receives the corresponding probability distribution signal and outputs a trend level code of appropriate intensity to achieve trend quantification. Through this end-side closed-loop control execution logic, a differentiated level determination matching the current fluctuation type can be given the instantaneous occurrence of a substantial trend change in blood glucose status. This closed-loop mechanism not only realizes the transformation from feature space pattern recognition to trend space intensity quantification but also assists clinical monitoring personnel in gradually establishing standardized early warning response habits through explicit level coding.
[0092] Meanwhile, to ensure the physical continuity of subsequent feedback adjustments, the output action is simultaneously used as a trigger anchor point to open a deviation monitoring window for the prediction results at the instant the trend level judgment command is output, which is beneficial for subsequent model parameter iteration updates.
[0093] The intensity of blood glucose trend is divided into five levels based on the rate of change of blood glucose: Level 1 is a rate of decrease of blood glucose ≥ 1.5 mmol / L·h, Level 2 is a rate of decrease of blood glucose ≥ 0.5 mmol / L·h and < 1.5 mmol / L·h, Level 3 is an absolute rate of change of blood glucose < 0.5 mmol / L·h, Level 4 is a rate of increase of blood glucose ≥ 0.5 mmol / L·h and < 1.5 mmol / L·h, and Level 5 is a rate of increase of blood glucose ≥ 1.5 mmol / L·h.
[0094] See Figure 5 In this embodiment, step S6 specifically includes the following sub-steps.
[0095] S601, based on the output of the above trend level determination instruction, simultaneously activate the quantitative monitoring mechanism for the confidence level of the prediction results.
[0096] In this embodiment, during the hardware interrupt cycle that outputs the trend level determination instruction to the outside, the system time of the current system master clock is extracted and recorded as the prediction start absolute timestamp. This prediction start absolute timestamp serves as the starting physical anchor point for subsequent result evaluation in the time domain.
[0097] To effectively record the true statistical characteristics of the predicted probability distribution and the evolution of confidence, a forward-covering confidence assessment window is constructed based on the absolute timestamp of the prediction start.
[0098] Considering the objective differences in the statistical characteristics of the predicted probability distributions for different trend levels, and the varying confidence assessment periods required for different types of blood glucose fluctuations, using a fixed and uniform assessment duration could lead to premature truncation of confidence data with low probability distributions or the introduction of a large amount of redundant and stable data with high probability distributions. Based on these multi-source differentiated conditions, an adaptive window logic is constructed that is positively correlated with probability dispersion and negatively correlated with trend stability.
[0099] The prediction confidence level is calculated using the dynamic confidence level assessment formula, which is as follows: In the formula, Conf represents the prediction confidence level. This represents the maximum probability value. This represents the second-highest probability value.
[0100] Introducing this dynamic confidence assessment formula helps to endow the system with adaptive confidence assessment capabilities. In the preferred approach, the threshold for predicted confidence is statically calibrated based on the error tolerance requirements of clinical monitoring, with its actual value ranged between 0.6 and 0.9. To ensure dimensional consistency in the formula calculation, the physical unit of predicted confidence is a dimensionless ratio, whose value is dynamically calculated based on the concentration of the probability distribution, representing the leading degree of the highest probability value relative to the second-highest probability value. The physical execution logic of this formula is that when the difference between the highest and second-highest probability values in the predicted probability distribution is large, a higher predicted confidence is output to confirm the reliability of the current trend judgment; conversely, the confidence is reduced, triggering a physical-level model parameter update prompt.
[0101] S602, based on the above dynamic confidence boundary, performs weighted fusion calculation on the blood glucose trend intensity level values of each time window.
[0102] The weighted fusion operation uses the predicted probability value of each window as the first weight and the trend continuation coefficient as the second weight to perform weighted summation and normalization on the blood glucose trend intensity level values, and obtains the fused blood glucose trend prediction result.
[0103] The trend continuation coefficient is used to correct trend jump errors at the window boundary. Its value is determined based on the trend consistency index within the overlapping area of the preceding and current windows. The trend consistency index is the proportion of sampling points within the overlapping area whose predicted trend direction is the same as that of the preceding and current windows, out of the total number of sampling points in the overlapping area. For example, if the overlapping area of the preceding and current windows contains 10 sampling points, and 8 of these sampling points have the same trend direction (both increasing or decreasing), then the trend consistency index is 0.8, and the trend continuation coefficient is 1.2, which is greater than 1, thus increasing the weight of this window. If only 3 sampling points have the same trend direction, then the trend consistency index is 0.3, and the trend continuation coefficient is 0.7, which is less than 1, thus decreasing the weight of this window.
[0104] The trend continuation coefficient ranges from 0.5 to 1.5. When the trend direction is consistent, the trend continuation coefficient is greater than 1, and when the trend direction is inconsistent, the trend continuation coefficient is less than 1. Through the above dual-weighted fusion mechanism, the system considers both the confidence level of the prediction probability and corrects the trend jump error at the window boundary, generating a fused blood glucose trend prediction result.
[0105] S603 generates a blood glucose trend prediction report that includes the prediction probability of each trend level, trend reversal warning indicators, and insufficient confidence level prompts.
[0106] The system sends display commands to the blood glucose monitoring terminal via a data communication link, triggering color coding switching or warning icon flashing on the trend visualization interface. For example, when the predicted probability value for level 4 exceeds a preset threshold, the interface switches to yellow coding; when the predicted probability value for level 5 exceeds a preset threshold, the interface switches to red coding and triggers a flashing warning icon; when the confidence assessment result is lower than a preset threshold, the interface displays an insufficient confidence warning, reminding clinical monitoring personnel to pay attention to the reliability of the prediction results.
[0107] S604, parse the prediction deviation level in the blood glucose trend prediction report, generate the model parameter update instruction and transmit it to the model training end.
[0108] After the model training terminal detects the model parameter update instruction, it switches the learning rate parameter connected to the gradient boosting tree model from the current value to the updated value and sets the retraining flag in the status register.
[0109] The updated value of the learning rate parameter is calculated using the learning rate decay formula, which is: In the formula, This represents the updated learning rate parameter. This represents the current learning rate parameter, and α represents the learning rate decay coefficient.
[0110] S605 performs conditional multi-stage regulation.
[0111] When the predicted probability value of the fifth level is detected to exceed a preset threshold, the upper limit of the trend determination boundary parameter is tightened to reduce the risk of misjudgment. For example, the upper limit of the trend determination boundary parameter is multiplied by a tightening coefficient of 0.8, making the model more stringent in its determination of a sharp rise and avoiding misjudging normal fluctuations as a sharp rise.
[0112] When the predicted probability value of the third level is detected to exceed a preset threshold, the overlap length parameter of the time window is increased to capture more trend reversal information. For example, the overlap length parameter of the time window is increased to 1.5 times the original length, enabling the system to more smoothly track the transition process from a stable state to an upward or downward state.
[0113] When the frequency of insufficient confidence alerts exceeds a preset threshold, the template update cycle of the blood glucose fluctuation pattern library is shortened to accelerate pattern adaptation. For example, the template update cycle is shortened to 0.5 times the original cycle, allowing the pattern library to adapt to changes in the patient's blood glucose fluctuation characteristics more quickly.
[0114] Each adjustment parameter acts independently on the prediction channel corresponding to its trend level, without affecting each other. Through the above-mentioned conditional parameter adjustment mechanism, the system achieves differentiated adaptive optimization for different prediction states.
[0115] To further illustrate the execution logic and physical control process of the technical solution of the present invention in a real medical scenario, a specific deduction of the above-mentioned method for constructing a blood glucose trend prediction model based on machine learning is now made in combination with a continuous blood glucose monitoring application scenario for diabetic patients.
[0116] The patient begins routine monitoring by wearing a continuous glucose monitoring device. Initially, the device collects glucose concentration parameters from subcutaneous interstitial fluid at a preset, fixed sampling frequency. After receiving these raw parameters, the blood glucose samples are aligned with the sampling timestamps along a time-series dimension to generate a blood glucose time-series data stream.
[0117] Gap imputation and anomaly removal are performed on the blood glucose time-series data stream. A set of gaps is identified, and blood glucose samples from adjacent time points before and after the gaps are extracted, with the arithmetic mean used as the imputation value. The median blood glucose level and the absolute median difference are calculated. An anomaly removal threshold is set at the median blood glucose level plus or minus three times the absolute median difference. Blood glucose samples exceeding this threshold are removed to obtain clean blood glucose time-series data.
[0118] Time-domain and frequency-domain feature vectors are extracted simultaneously from clean blood glucose time-series data. The rate of change, acceleration of change, and fluctuation amplitude are calculated on the clean blood glucose time-series data to obtain the time-domain feature vector; the main frequency is identified and energy distribution is calculated to obtain the frequency-domain feature vector. The time-domain and frequency-domain feature vectors are concatenated along the channel dimension to obtain a cross-domain fused feature vector.
[0119] The system calls upon a pre-stored blood glucose fluctuation pattern library and calculates the similarity between the cross-domain fused feature vector and the pattern feature vectors of each typical fluctuation pattern in the library. It collects the feature value to be matched and the pattern feature vectors of each typical fluctuation pattern in the library, aligns them according to feature dimensions, and then performs weighted correction using a weight distribution to generate a similarity score. The typical fluctuation pattern with the highest similarity score is selected as the current matching pattern.
[0120] Assuming the currently acquired cross-domain fusion feature vector has the highest similarity value with the pattern feature vector of the postprandial fluctuation pattern, then the current matching pattern is the postprandial fluctuation pattern. Based on the current matching pattern, the corresponding trend determination boundary parameters are retrieved, and the cross-domain fusion feature vector is input into a gradient boosting tree model with pattern adaptive splitting constraints, outputting the blood glucose trend intensity level value within a preset future time period.
[0121] Assuming the current blood glucose change is within the boundary of the fourth level (i.e., the rate of blood glucose increase is ≥0.5 mmol / L·h and <1.5 mmol / L·h), the gradient boosting tree model with pattern adaptive splitting constraint outputs the probability distribution of each level. The level with the highest probability value is taken as the blood glucose trend intensity level, i.e., the fourth level.
[0122] The prediction reliability index is calculated by multiplying the blood glucose trend intensity level value of each time window by the prediction probability value and trend continuation coefficient of that window, summing the results, and dividing by the total number of windows. A blood glucose trend prediction report is generated, including the prediction probability of each trend level, trend reversal warning indicators, and insufficient confidence prompts, and a display command is sent via a data communication link.
[0123] Suppose that the current predicted probability value of the fifth level exceeds the preset threshold, that is, the predicted probability value of the blood glucose rise rate ≥ 1.5 mmol / L·h exceeds the preset threshold, the model training end receives the model parameter update instruction, switches the learning rate parameter connected to the gradient boosting tree model from the current value to the updated value, sets the retraining flag, and tightens the upper limit of the trend judgment boundary parameter to reduce the risk of misjudgment.
[0124] In subsequent monitoring, real-time blood glucose parameters of the patient were continuously collected, and the blood glucose time-series data stream was updated periodically. Gap filling, cross-domain feature extraction, pattern matching, trend determination, and weighted fusion were performed collaboratively to reassess the patient's blood glucose trend intensity level and prediction reliability index. Model parameters were dynamically adjusted based on the updated prediction bias level. If the fifth-level prediction probability value dropped below a preset threshold, a standard pattern model parameter update instruction was generated; if the third-level prediction probability value exceeded a preset threshold, a model parameter update instruction to increase the overlap length was generated; if the frequency of insufficient confidence alerts exceeded a preset threshold, a model parameter update instruction to shorten the template update cycle was generated. The trend prediction trajectory and model parameter adjustment log for the patient throughout the entire monitoring period were recorded, completing a single business loop.
[0125] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 6 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores blood glucose sampling values, sampling timestamps, clean blood glucose time-series data, cross-domain fusion feature vectors, a blood glucose fluctuation pattern library, and model parameter data. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with an external continuous glucose monitoring device via a network connection. When the computer program is executed by the processor, it implements a method for constructing a machine learning-based blood glucose trend prediction model.
[0126] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0127] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0128] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0129] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0130] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0131] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0132] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchain. The processors involved in the embodiments provided in this application may be, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc.
[0133] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0134] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for constructing a blood glucose trend prediction model based on machine learning, characterized in that, Includes the following steps: S1. Obtain the blood glucose sampling value, sampling timestamp and sampling interval parameters output by the continuous blood glucose monitoring device, and generate a blood glucose time series data stream; S2. Perform gap filling and anomaly removal on the blood glucose time-series data stream to obtain clean blood glucose time-series data; S3. Simultaneously extract time-domain feature vectors and frequency-domain feature vectors from the clean blood glucose time-series data, and concatenate the time-domain feature vectors and the frequency-domain feature vectors according to the channel dimension to form a cross-domain fusion feature vector; S4. Call the pre-stored blood glucose fluctuation pattern library, and use the pattern matching working mode and similarity calculation mode to calculate the similarity between the cross-domain fusion feature vector and the pattern feature vector of each typical fluctuation pattern in the blood glucose fluctuation pattern library, and take the typical fluctuation pattern with the largest similarity value as the current matching mode. S5. Based on the current matching mode, retrieve the corresponding trend judgment boundary parameters, input the cross-domain fusion feature vector into the gradient boosting tree model with mode adaptive splitting constraint, and output the blood glucose trend intensity level value within the future preset time period. S6. The blood glucose trend intensity level value and the corresponding prediction probability value are weighted and fused to generate a blood glucose trend prediction result. At the same time, the blood glucose trend prediction result is fed back to the model training end to trigger the parameter iterative update of the gradient boosting tree model.
2. The method according to claim 1, characterized in that, Step S1 also includes: The data frames of the continuous blood glucose monitoring device are read at a fixed sampling frequency. The instantaneous blood glucose concentration and the cumulative number of sampling points are extracted from the blood glucose sampling values. The relative offset between the current time and the reference time is extracted from the sampling timestamp. The deviation rate between the actual interval duration and the nominal interval duration is extracted from the sampling interval parameter. The above data is concatenated according to the time sequence dimension to generate the blood glucose time-series data stream; When the instantaneous blood glucose concentration is detected to exceed the physiological effective range or the deviation rate exceeds the preset tolerance, a data quality anomaly identifier is generated, the blood glucose time series data stream is marked as pending verification, the current data cache queue is frozen, and all data within the time window from before the anomaly is triggered to the time window after the anomaly is triggered is retained.
3. The method according to claim 1, characterized in that, Step S2 determines the vacancy filling strategy, including: Identify the set of missing data in the blood glucose time series data stream, extract the blood glucose sampling values of adjacent time points before and after the missing data, and use the arithmetic mean of the blood glucose sampling values of adjacent time points as the missing data filling value; Calculate the blood glucose median and absolute median difference of the blood glucose in the blood glucose time series data stream. Use the blood glucose median plus or minus three times the absolute median difference of the blood glucose as the anomaly removal threshold. Mark blood glucose sampling values that exceed the anomaly removal threshold as anomalies and remove them to obtain the clean blood glucose time series data.
4. The method according to claim 2, characterized in that, Step S3, controlling the extraction of time-domain and frequency-domain feature vectors, includes: Monitor the current status of the clean blood glucose time-series data, and when a data quality anomaly is detected, trigger the cross-domain feature extraction system composed of the time-domain feature extraction channel and the frequency-domain feature extraction channel to take over; Based on the activation state of the cross-domain feature extraction system, the blood glucose change rate calculation, blood glucose change acceleration calculation, and blood glucose fluctuation amplitude calculation are performed on the clean blood glucose time series data to obtain the time domain feature vector. Based on the activation state of the cross-domain feature extraction system, the main frequency identification of blood glucose fluctuations and the energy distribution calculation of blood glucose fluctuations are performed on the clean blood glucose time series data to obtain the frequency domain feature vector; The time-domain feature vector and the frequency-domain feature vector are concatenated along the channel dimension to obtain the cross-domain fusion feature vector.
5. The method according to claim 4, characterized in that, Step S3 also includes generating a cross-domain fusion feature vector association data chain, specifically: When the data quality anomaly flag is detected, the regular feature extraction process is interrupted, the pointer position of the current window data block is frozen, and historical data and real-time data in the cache queue are extracted to form a data packet to be fused. Based on the effective data density of the data packets to be fused, the sampling granularity parameters of the time-domain feature vector and the frequency-domain feature vector are dynamically adjusted, and the cross-domain feature extraction system is controlled to enable the multi-channel parallel fusion mode and perform cross-domain splicing operation simultaneously. The cross-domain fusion feature vector is associated and bound with the batch number, channel number, and feature extraction time of the corresponding window data block to generate a data chain that can be traced back to the entire process of a single feature extraction.
6. The method according to claim 1, characterized in that, Step S4, which synchronously calls the blood glucose fluctuation pattern library, includes: The pattern matching working mode and similarity calculation mode are invoked to collect the feature values to be matched of the cross-domain fusion feature vector and the pattern feature vectors of each typical fluctuation pattern in the blood glucose fluctuation pattern library, respectively. The feature value to be matched is aligned with the pattern feature vector according to the feature dimension. The feature value to be matched is then weighted and corrected using the weight distribution of the pattern feature vector. The weight distribution of the pattern feature vector is obtained by statistical analysis of the historical matching frequency of each typical fluctuation pattern. The similarity value is then generated after correction. The similarity value is associated with the pattern number, matching time and current matching pattern identifier of the corresponding typical fluctuation pattern to generate a data chain that can be traced back to the entire process of a single pattern matching.
7. The method according to claim 1, characterized in that, Step S5 generates the blood glucose trend strength level value, including: The typical fluctuation curves, trend turning features, and amplitude grading parameters pre-stored in the blood glucose fluctuation pattern library are called, and the cross-domain fusion feature vector is compared and calculated with the trend judgment boundary parameters corresponding to the current matching mode to generate the blood glucose trend intensity level value. The blood glucose trend intensity level is divided into five intervals based on the rate of blood glucose change: Level 1 is a rate of decrease of blood glucose greater than or equal to 1.5 mmol / L·h; Level 2 is a rate of decrease of blood glucose greater than or equal to 0.5 mmol / L·h and less than 1.5 mmol / L·h; Level 3 is an absolute rate of change of blood glucose less than 0.5 mmol / L·h; Level 4 is a rate of increase of blood glucose greater than or equal to 0.5 mmol / L·h and less than 1.5 mmol / L·h; and Level 5 is a rate of increase of blood glucose greater than or equal to 1.5 mmol / L·h.
8. The method according to claim 1, characterized in that, Step S6 generates the blood glucose trend prediction results, including: A weighted fusion operation is performed on the blood glucose trend intensity level values of each time window. The weighted fusion operation uses the prediction probability value of each window as the first weight and the trend continuation coefficient as the second weight. The blood glucose trend intensity level values are weighted, summed, and normalized to obtain the fused blood glucose trend prediction result. The trend continuation coefficient is used to correct the trend jump error at the window boundary. Its value is determined based on the trend consistency index in the overlapping area of the previous window and the current window. The trend consistency index is the proportion of the number of sampling points in the overlapping area whose predicted trend direction is the same as that of the previous window and the current window to the total number of sampling points in the overlapping area. Generate a blood glucose trend prediction report that includes the predicted probability of each trend level, trend reversal warning indicators, and insufficient confidence prompts. Send a display command to the blood glucose monitoring terminal via the data communication link to trigger the color coding switch or the warning icon flashing on the trend visualization interface.
9. The method according to claim 8, characterized in that, Step S6 generates model parameter update instructions, including: The prediction deviation level in the blood glucose trend prediction report is analyzed, the model parameter update instruction is generated, and transmitted to the model training end. After the model training end detects the model parameter update instruction, it switches the learning rate parameter connected to the gradient boosting tree model from the current value to the updated value and sets the retraining flag in the status register. When the predicted probability value of the first level exceeds a preset threshold, the lower limit of the trend determination boundary parameter is tightened to reduce the risk of misjudging extreme trends; when the predicted probability value of the fifth level exceeds a preset threshold, the upper limit of the trend determination boundary parameter is tightened to reduce the risk of misjudging extreme trends; when the predicted probability value of the third level exceeds a preset threshold, the overlap length parameter of the time window is increased to capture more trend turning point information; when the frequency of insufficient confidence prompts exceeds a preset threshold, the template update cycle of the blood glucose fluctuation pattern library is shortened to accelerate mode adaptation. Each adjustment parameter acts independently on the prediction channel of the corresponding trend level, wherein the predicted probability value of the level corresponds to the blood glucose decrease rate level.
10. The method according to claim 1, characterized in that, The blood glucose fluctuation pattern library includes: The postprandial fluctuation pattern has the following feature vectors: the slope of the blood glucose rise segment is greater than the postprandial rise threshold, the peak position appears in the first time period after the start of sampling, and the absolute value of the slope of the decline segment is less than the postprandial decline threshold. The nighttime stable mode is characterized by blood glucose fluctuation amplitude values being less than the nighttime amplitude threshold, frequency domain energy distribution being concentrated in the low frequency band, and the absolute value of the rate of change being less than the nighttime rate threshold. The dawn phenomenon pattern has the following feature vectors: the acceleration value of blood glucose change is greater than the dawn acceleration threshold, the main frequency value corresponds to the early morning period, and the slope of the rising segment is increasing. The exercise response pattern, whose feature vector includes an absolute value of the slope of the blood glucose decline segment being greater than the exercise decline threshold, a sudden increase in the fluctuation amplitude value in the post-exercise period, and a shift of energy distribution to the high-frequency range; The drug intervention model has the following characteristic vectors: the absolute value of the rate of change of blood glucose drops sharply after the intervention period, the peak position is related to the time of administration, and the slope of the decline segment is distributed in a step-like manner.