Intelligent Blood Glucose Management and Monitoring Method and System Based on CGM

By using a CGM-based intelligent blood glucose management system, the system dynamically identifies insulin lag characteristics and combines LSTM and FCN models with time axis translation correction to solve the blood glucose management problem for patients after pancreatectomy. This enables personalized blood glucose prediction and precise management, reduces the risk of misjudgment, and improves patient recovery outcomes.

CN121795897BActive Publication Date: 2026-06-30ZHEJIANG CANCER HOSPITAL
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-03-11
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing blood glucose management methods cannot achieve real-time and precise management of patients after pancreatectomy, especially due to prediction bias caused by the mismatch between insulin and blood glucose timing, and the lack of personalized dietary guidance, which affects the patient's recovery.

Method used

The intelligent blood glucose management system based on CGM dynamically identifies the characteristic value of insulin lag, combines a blood glucose prediction model with parallel LSTM and FCN and a time axis translation correction mechanism, integrates dietary image recognition function, and generates personalized blood glucose prediction curves.

Benefits of technology

It improves the accuracy of predicting blood glucose changes in patients after pancreatectomy, reduces the risk of misjudging hyperglycemia and hypoglycemia, provides personalized intervention guidance, reduces patient suffering and medical workload, and improves patient prognosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121795897B_ABST
    Figure CN121795897B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of intelligent blood glucose management technology, and discloses a method and system for intelligent blood glucose management and monitoring based on CGM (Continuous Glucose Membrane). The method includes: collecting interstitial fluid glucose concentration data from a patient using a CGM sensor and aligning it with insulin injection events to form a continuous time series; setting an observation interval after insulin injection, identifying the inflection point of blood glucose decline, and calculating the insulin lag time; statistically generating lag feature values ​​through a preset sliding time window; embedding these feature values ​​into a blood glucose prediction model composed of LSTM and FCN to predict future blood glucose changes; and finally, performing time axis shift correction on the prediction curve based on these feature values. This method requires no additional hardware, improves blood glucose prediction accuracy, reduces misjudgments of hyperglycemia and hypoglycemia, provides reliable support for clinical and home blood glucose management, and helps improve patient prognosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent blood glucose management technology, and more specifically, to an intelligent blood glucose management and monitoring method and system based on CGM. Background Technology

[0002] Pancreatic cancer, a common malignant tumor of the digestive tract, is characterized by high malignancy and poor prognosis, with a 5-year survival rate of only about 10%. In recent years, the incidence of pancreatic cancer in China has ranked 10th among malignant tumors, and the cancer-related mortality rate ranks 6th, with a gradually increasing trend, making it one of the diseases of great clinical concern. Currently, pancreatectomy is the main treatment for pancreatic cancer. However, as a key endocrine organ, the pancreas's removal leads to a significant loss of pancreatic A cells and B cells. Coupled with the impact of surgical trauma, patients are highly susceptible to perioperative blood glucose disturbances such as hypoglycemia and hyperglycemia, seriously threatening their recovery. Therefore, postoperative blood glucose management has become a core aspect of clinical nursing care.

[0003] Current blood glucose management methods primarily rely on finger-prick blood glucose sampling or venous blood testing. These methods have significant limitations. Firstly, frequent blood draws cause considerable discomfort to patients and significantly increase nurses' workload. Secondly, such monitoring only provides interim data and cannot achieve real-time tracking, failing to fully reflect the patient's blood glucose fluctuation trends. For patients requiring insulin pump therapy during fasting periods, current methods mainly rely on manual dosage calculation and adjustment, lacking information-based and intelligent management tools, resulting in insufficient monitoring accuracy. Furthermore, for patients in the semi-liquid diet phase and those discharged and staying at home, low patient and family compliance makes it difficult to obtain personalized dietary guidance, further impacting blood glucose control.

[0004] The advent of continuous glucose monitoring (CGM) technology has made real-time blood glucose monitoring possible, but existing CGM-based management systems do not fully consider the unique physiological state of patients after pancreatectomy. These patients almost completely lack endogenous insulin secretion, and there is a significant time lag between the onset and peak time of exogenous insulin injection and the changes in interstitial fluid blood glucose monitored by CGM, with substantial individual variations. Existing blood glucose prediction models typically assume a stable insulin-blood glucose time-response relationship, leading to a systematic accumulation of prediction biases and failing to meet the needs of precise clinical management. Summary of the Invention

[0005] In response, the present invention provides a method and system for intelligent blood glucose management and monitoring based on CGM, so as to at least partially solve the above-mentioned technical problems.

[0006] This invention provides a method for intelligent blood glucose management and monitoring based on CGM, comprising the following steps:

[0007] S1, based on the CGM sensor, collects interstitial fluid glucose concentration data of patients after pancreatic resection;

[0008] S2, Align the interstitial fluid glucose concentration data with insulin injection events on the same patient's timeline to form a continuous time series, wherein the insulin injection events include at least an injection timestamp and an injection dose;

[0009] S3. After each insulin injection event, set an observation time interval, identify the inflection point of the decrease in interstitial fluid glucose concentration within the interval, and calculate the time difference between the inflection point and the injection time as the insulin lag time for that event.

[0010] S4, Statistically analyze all insulin action lag times within the preset sliding time window, and generate insulin action lag characteristic values ​​within the time window;

[0011] S5, The insulin hysteresis feature value is embedded as a time-series parameter into the blood glucose prediction model to predict future changes in interstitial fluid glucose concentration;

[0012] S6, at least based on the insulin action hysteresis characteristic value, perform time axis translation correction on the predicted future blood glucose curve to generate a corrected blood glucose prediction curve.

[0013] In one possible embodiment, identifying the inflection point specifically involves performing a first-order difference on the interstitial fluid glucose concentration sequence within the observation time interval. When the continuous difference value changes from non-negative to a continuously negative value and the decrease exceeds a preset threshold, the time point at which the condition is first met is recorded as the inflection point.

[0014] In one possible embodiment, the step of statistically analyzing all insulin action lag times within a preset sliding time window includes removing abnormal insulin action lag times within the sliding time window that deviate from the mean by more than a preset range, and then calculating the mean or median of the remaining values ​​as the insulin action lag characteristic value.

[0015] In one possible embodiment, the blood glucose prediction model is constructed by extracting features in parallel from a long short-term memory network and a fully convolutional network, then concatenating the features, and finally outputting the prediction results through a fully connected layer; the insulin action lag feature value is written into the input gate time offset of the long short-term memory network.

[0016] In one possible implementation, the statistics are re-executed and the insulin action lag characteristic value is updated every time the sliding time window moves forward by a fixed step.

[0017] In one possible embodiment, the method further includes receiving images of the patient's diet, analyzing the types and nutritional components of the food based on an image recognition model, and incorporating the analysis results as auxiliary input features into the feature matrix of the blood glucose prediction model.

[0018] In another aspect, this application also provides a CGM-based intelligent patient blood glucose management and monitoring system, comprising:

[0019] The data acquisition module is used to collect interstitial fluid glucose concentration data of patients after pancreatectomy via a CGM sensor;

[0020] The data alignment module is used to align interstitial fluid glucose concentration data with insulin injection events on the same patient's timeline to form a continuous time series, wherein the insulin injection event includes at least an injection timestamp and an injection dose.

[0021] The lag time calculation module is used to set an observation time interval after each insulin injection event, identify the inflection point of the decrease in interstitial fluid glucose concentration within the interval, and calculate the time difference between the inflection point and the injection time as the lag time of insulin action for that event.

[0022] The feature value generation module is used to statistically analyze all insulin action lag times within a preset sliding time window and generate insulin action lag feature values ​​within that time window.

[0023] The blood glucose prediction module is used to embed the insulin action lag feature value as a time-series parameter into the input feature of the blood glucose prediction model to predict future changes in interstitial fluid glucose concentration.

[0024] The prediction correction module is used to perform time axis translation correction on the predicted future blood glucose curve based at least on the insulin action hysteresis feature value, and generate a corrected blood glucose prediction curve.

[0025] In another aspect, this application also provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the CGM-based intelligent blood glucose management and monitoring method for post-pancreatectomy patients as described above.

[0026] In another aspect, this application provides a computer-readable storage medium having stored thereon computer program instructions that can be executed by a processor to implement the CGM-based intelligent blood glucose management and monitoring method described above.

[0027] Another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the CGM-based intelligent blood glucose management and monitoring method as described above.

[0028] This application addresses the specific needs of blood glucose management in patients after pancreatectomy. By dynamically identifying and incorporating individualized insulin lag characteristics, it effectively solves the prediction bias problem caused by insulin-blood glucose timing mismatch in existing technologies. It achieves dynamic parameter updates through a sliding time window, combining a parallel LSTM and FCN blood glucose prediction model with a time axis translation correction mechanism, significantly improving the prediction accuracy of future blood glucose changes in postoperative patients and reducing the risk of misjudging hyperglycemia and hypoglycemia. Simultaneously, the system integrates dietary image recognition, providing comprehensive auxiliary features for blood glucose prediction and enabling personalized intervention guidance. This solution is easy to operate and compatible with existing CGM management systems, reducing patient pain during blood collection and the workload of medical staff, while providing reliable support for precise clinical blood glucose management and home rehabilitation guidance, helping to reduce the incidence of postoperative complications and improve patient prognosis. Attached Figure Description

[0029] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0030] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0031] Figure 1 This is a framework diagram of a postoperative blood glucose intelligent management system based on CGM, provided in an embodiment of this disclosure.

[0032] Figure 2 This is a schematic diagram of a CGM-based intelligent blood glucose management and monitoring method provided in an embodiment of this disclosure.

[0033] Figure 3 This is a schematic diagram of the blood glucose prediction model structure provided in an embodiment of this disclosure.

[0034] Figure 4 This is a schematic diagram of the output correction process provided in an embodiment of the present disclosure.

[0035] Figure 5 This is a schematic diagram of the parameter update process provided in the embodiments of this disclosure.

[0036] Figure 6 This is a schematic diagram of the structure of a CGM-based intelligent blood glucose management and monitoring system provided in an embodiment of the present invention.

[0037] Figure 7 This is a schematic diagram of the structure of a device provided in an embodiment of the present invention. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0039] It should be noted that all user information (including but not limited to user device information, user personal information, object information corresponding to device usage data, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, device usage data, etc.) involved in all embodiments of this disclosure are information and data authorized by the user or fully authorized by all parties.

[0040] The following detailed description, in conjunction with specific embodiments, illustrates the implementation process of the intelligent patient blood glucose management and monitoring method based on CGM according to the present invention. It should be noted that these embodiments are merely illustrative of the invention and not intended to limit its scope. Any conventional adjustments or substitutions made by those skilled in the art to the various steps without departing from the inventive concept should be included within the scope of protection of the present invention.

[0041] like Figure 2 As shown in the diagram, this invention discloses a schematic diagram of an intelligent patient blood glucose management and monitoring method based on CGM, including the following method steps:

[0042] S1, based on the CGM sensor, collects interstitial fluid glucose concentration data of patients after pancreatic resection;

[0043] S2, Align the interstitial fluid glucose concentration data with insulin injection events on the same patient's timeline to form a continuous time series, wherein the insulin injection events include at least an injection timestamp and an injection dose;

[0044] S3. After each insulin injection event, set an observation time interval, identify the inflection point of the decrease in interstitial fluid glucose concentration within the interval, and calculate the time difference between the inflection point and the injection time as the insulin lag time for that event.

[0045] S4, Statistically analyze all insulin action lag times within the preset sliding time window, and generate insulin action lag characteristic values ​​within the time window;

[0046] S5, The insulin hysteresis feature value is embedded as a time-series parameter into the blood glucose prediction model to predict future changes in interstitial fluid glucose concentration;

[0047] S6, at least based on the insulin action hysteresis characteristic value, perform time axis translation correction on the predicted future blood glucose curve to generate a corrected blood glucose prediction curve.

[0048] This method is suitable for patients who have undergone partial or total pancreatectomy and rely on exogenous insulin for postoperative glycemic control. Patients can wear a continuous glucose monitoring (CGM) sensor with a fixed sampling cycle, preferably 5 minutes per sampling, capable of continuously collecting interstitial fluid glucose concentration data and uploading it to a server terminal via wireless communication technologies such as Bluetooth, 4G / 5G, and Wi-Fi. Patients can use a glycemic management app on smart mobile devices such as smartphones and tablets to accurately record the time stamp, dosage, and insulin type (basal insulin, mealtime insulin) for each insulin injection. Optional auxiliary information such as diet and exercise can also be entered. The server terminal has the computational capabilities for continuous time-series data storage, analysis, and modeling, including a distributed database storage module, data preprocessing computation unit, deep learning model inference unit, and parameter update computation unit, and can be adapted to devices such as… Figure 1 The existing CGM-based intelligent postoperative blood glucose management system is particularly suitable for people with significant postoperative metabolic fluctuations and individual differences in insulin action time.

[0049] In some embodiments, for step S1, the collection of glucose concentration data in the interstitial fluid of patients after pancreatic resection is performed based on a CGM sensor. The CGM sensor is subcutaneously implanted under the skin of the patient's abdomen or lateral upper arm, with the sensor probe in direct contact with the interstitial fluid. It captures glucose concentration signals in real time through electrochemical detection. The sensor's sampling cycle is set to 5 minutes per sampling. This sampling frequency has been verified to effectively capture minute fluctuations in blood glucose levels, avoiding the omission of critical blood glucose change nodes due to excessively long sampling intervals. The sensor has a built-in wireless communication module. After each sampling, the collected glucose concentration value and corresponding timestamp (accurate to the second) are immediately packaged into a data frame and sent to the patient's smart mobile terminal via Bluetooth Low Energy technology. The smart mobile terminal then forwards the data to a server terminal for storage. The data transmission process uses AES-128 encryption to ensure data security and prevent data leakage or tampering during transmission.

[0050] In some embodiments, for step S2, the data alignment process specifically involves the server terminal receiving interstitial fluid glucose concentration data from the CGM sensor. First, the data is parsed to extract the timestamp and glucose concentration value from each data record, establishing a preliminary blood glucose time series dataset. Simultaneously, the server terminal receives insulin injection event data uploaded from a smart mobile terminal APP. This data includes at least an injection timestamp accurate to the second and an injection dose accurate to 0.1U. If the patient has entered insulin type information, this type information is extracted synchronously as auxiliary data.

[0051] According to embodiments of this disclosure, the blood glucose time series dataset and insulin injection event data are aligned using a time axis as a reference. Specifically, the system time of the server terminal is used as a unified reference to calibrate the timestamps of CGM sensor data and insulin injection events, eliminating time inconsistencies caused by time errors between different devices, such as device clock deviations. After calibration, insulin injection events are marked as key time nodes on the blood glucose time series, forming a continuous time series containing the correlation between blood glucose concentration changes and insulin injection events. Each insulin injection event is associated with corresponding subsequent blood glucose concentration data for calculating the lag time of subsequent insulin action.

[0052] Optionally, during data alignment, if CGM data is missing, such as due to a brief sensor offline causing data interruption, linear interpolation is used for completion. This involves calculating a linear fit value to fill in the missing value based on the valid data points adjacent to the missing data point. If three or more consecutive sampling points are missing, this data segment is marked as a missing segment and will not be included in the analysis interval corresponding to this segment in subsequent calculations. For insulin injection event data, if there is a missing injection dose but a clear injection timestamp, the timestamp information of the event is retained for time-series correlation analysis, and the dose information is marked as unknown. If the injection timestamp is unclear, such as a time error exceeding 30 seconds, the insulin injection event is removed and not included in subsequent calculations.

[0053] In some embodiments, for step S3, calculating the insulin lag time, firstly, an observation interval is set. Specifically, in a continuous time series, a corresponding observation time interval is set for each insulin injection event.

[0054] The starting time of the observation period is the injection timestamp of the insulin injection event. The termination time can be set to x hours after the injection timestamp. The time interval is set based on the fact that, typically, the main effects of conventional exogenous insulin, including basal insulin and prandial insulin, occur within 0-x hours after injection. This interval fully covers the core stages of insulin action, from onset to peak effect to attenuation, while avoiding interference from other irrelevant factors such as diet and exercise that could lead to excessively long intervals, thus ensuring the specificity and accuracy of subsequent analyses. It is understood that this time interval can be adjusted according to the type of insulin, and this disclosure does not impose any restrictions.

[0055] Secondly, to identify the inflection point of blood glucose decline, preferably, the interstitial fluid glucose concentration sequence within the observation time interval is subjected to first-order difference processing to obtain the rate of change sequence of blood glucose concentration. Specifically, the first-order difference is calculated as follows:

[0056] Let the blood glucose concentration sequence within the observation time interval be... The corresponding timestamp sequence is ,in , , The number of sampling points within this interval (based on a sampling frequency of 5 minutes / time). ).

[0057] blood glucose concentration sequence Performing first-order differences yields the rate of change sequence. , of which Each difference result The calculation formula is:

[0058]

[0059] The positive and negative values ​​reflect the trend of changes in blood glucose concentration. This indicates whether blood glucose levels have increased or remained unchanged. This indicates a decrease in blood glucose concentration.

[0060] Set preset threshold This threshold was determined based on the blood glucose fluctuation characteristics of patients after pancreatectomy and clinical practice data, and can effectively distinguish between the decrease in blood glucose caused by insulin action and natural blood glucose fluctuations.

[0061] The point at which the following two conditions are first met is recorded as the inflection point of blood glucose decline (denoted as ). Condition 1: Three or more consecutive difference results By non-negative ( ) turned into a continuous negative value ( That is, there exists a continuous ( ), making , , And in The most recent difference result (like If the condition is not met, then this prerequisite is not required. Condition two: the cumulative decrease of three consecutive difference results. Exceeding the preset threshold ,Right now .

[0062] By using the above dual-condition judgment, misjudgments caused by random fluctuations in blood glucose concentration can be effectively eliminated, ensuring that the identified inflection point is the starting moment of a substantial decrease in blood glucose triggered by insulin action.

[0063] According to embodiments of this disclosure, finally, the insulin lag time is calculated. Specifically, for each insulin injection event, the lag time is calculated based on the identified inflection point of decline. With injection time Calculate the insulin lag time for this event. The calculation formula is:

[0064]

[0065] in, and All calculations are in seconds. The calculation result is rounded to the nearest minute, meaning it is rounded to the nearest whole minute. It reflects the overall lag time from injection of exogenous insulin to the production of a recognizable hypoglycemic effect in CGM monitoring data under the current patient and physiological state. It covers the entire time delay of insulin subcutaneous absorption, transport to the blood, exerting biological effects, and CGM sensor detection of changes in interstitial fluid glucose concentration.

[0066] In some embodiments, for step S4, insulin hysteresis characteristic values ​​are generated. First, a preset sliding time window is set, the length of which can be set to 7 days. The basis for setting this length is that the metabolic state of patients after pancreatectomy undergoes dynamic changes during the postoperative recovery phase, but these changes have a certain continuity. The 7-day time span can cover a relatively stable cycle of the patient's metabolic state, while avoiding excessive parameter fluctuations due to a time window that is too short, or parameters that cannot adapt to changes in the patient's metabolic state in a timely manner due to a time window that is too long.

[0067] The sliding time window is set to a step size of 1 day, meaning that every 24 hours, the sliding time window moves forward by 1 day to re-include the insulin injection events corresponding to the most recent day. Data, and remove the earliest 1 day. Data is used to dynamically update parameters. The sliding time window begins on the 7th day after the patient first uses the system and completes their first insulin injection. If the patient has used the system for less than 7 days, insulin lag characteristics are not generated. In this case, the clinically default insulin lag time (e.g., 2 hours for basal insulin and 30 minutes for mealtime insulin) is used as a temporary parameter until sufficient data accumulates within the sliding time window. Data, such as at least 3 effective insulin injection events corresponding to .

[0068] Preferably, outliers are removed. Specifically, within each sliding time window, the data corresponding to all valid insulin injection events within that time window is first collected. Data, forming Dataset ,in For the effective time window Number of data ( ).

[0069] calculate Dataset mean with standard deviation The calculation formulas are as follows:

[0070]

[0071]

[0072] Set the range for outlier detection as follows: This range is adjusted based on the 3σ principle of a normal distribution, taking into account patients after pancreatectomy. The data exhibits some individual differences; using a 2σ range can effectively remove outliers while retaining reasonable individual variation data. For Dataset Beyond this range These are identified as outliers and removed.

[0073] If outliers are removed, the remaining Number of data If the remaining data is used for subsequent statistics, then after removing outliers... Then, the scope for outlier detection should be appropriately broadened to... Perform outlier removal again; if the condition still meets the requirements... Then retain all data within that time window. The data is then used to mark the reliability level of the feature values ​​within that time window as "low," prompting healthcare professionals to pay attention to the quality of the patient's blood glucose monitoring data.

[0074] After removing outliers Data, denoted as dataset The mean or median of these values ​​is calculated as the characteristic value of insulin hysteresis within the sliding time window. .

[0075] When the dataset coefficients of dispersion At that time, among them For dataset The mean, For dataset The standard deviation indicates that the data dispersion is small. The mean is used as the characteristic value of insulin action lag, and the calculation formula is:

[0076]

[0077] When the dataset coefficients of dispersion When the data shows a high degree of dispersion, the median is used as the characteristic value for the lag of insulin action. The specific calculation method is as follows: [The text abruptly ends here, likely due to an incomplete sentence or missing information.] The data in the file is sorted in ascending order. If the number is odd, then the value in the middle position after sorting is the median; if... If the number is even, then the average of the two middle numbers after sorting is the median.

[0078] Using the mean or median as the feature value selection method can adaptively select a more representative statistic based on the degree of data dispersion, ensuring that the insulin action lag feature value can accurately reflect the insulin action lag characteristics of patients within the time window.

[0079] In some embodiments, for step S5, the blood glucose prediction model employs a parallel architecture of Long Short-Term Memory (LSTM) and Fully Convolutional Network (FCN), achieving the final prediction through feature concatenation and fully connected layers. (See also...) Figure 3 , Figure 3 This is a schematic diagram of the blood glucose prediction model structure provided in an embodiment of this disclosure. The specific structure is as follows:

[0080] (1) Input layer: For example, the input feature matrix contains three types of features, namely, historical interstitial fluid glucose concentration features: CGM blood glucose data from the 24 hours prior to the current moment can be selected and arranged in chronological order to form a one-dimensional time series feature with a dimension of . That is, based on a sampling frequency of 5 minutes / sampling, a total of 288 sampling points in 24 hours; insulin injection characteristics: can include the dose and time difference between the last 3 insulin injections and the current time, forming a dimension of The feature vector; auxiliary features: may include patient demographic characteristics such as age and BMI, and health behavior characteristics such as the average dietary calorie intake and average exercise duration over the past 3 days, forming a dimension of The feature vectors are then concatenated to form the initial input feature matrix of the model, with dimensions of [missing information]. .

[0081] (2) LSTM Network Branch: The LSTM network is used to capture long-term dependencies in blood glucose time series. This branch can contain 3 layers of LSTM units, with 128 hidden neurons in each layer. The input of the first LSTM unit is the time-series related features in the initial input feature matrix, namely the historical blood glucose concentration features and the insulin injection time difference features. The subsequent two LSTM units receive the output features of the previous layer in sequence. The calculation process of the forget gate, input gate, cell state, and output gate of the LSTM unit is as follows:

[0082] Forget Gate Calculation: ,in Here is the forget gate weight matrix. This is the output of the hidden layer from the previous time step. Input features for the current time step. For the forget gate bias term, It is the sigmoid activation function.

[0083] Input gate calculation: ,in The input gate weight matrix, For input gate bias terms; ,in Update the weight matrix for cell state. For cell state update bias terms, It is the hyperbolic tangent activation function.

[0084] Cell status update: ,in This is an element-wise multiplication operation. This represents the cell state at the previous moment.

[0085] Output gate calculation: ,in This is the output gate weight matrix. This is the output gate bias term; ,in This is the output of the hidden layer at the current moment.

[0086] According to embodiments of this disclosure, the insulin action hysteresis characteristic value Writing the input gate time offset to the LSTM network, it can be understood that this writing method does not change the network weights, but is only used to adjust the time alignment of the input features.

[0087] Specifically, a time offset factor is introduced during the calculation of the input gate. ,in This refers to the default insulin lag time, such as basal insulin. Seconds, mealtime insulin Seconds, adjust the input gate calculation formula to ,in This indicates shifting the time axis of the input features forward. The feature data after each sampling interval enables the LSTM network to accurately capture the temporal correlation between insulin injection and blood glucose changes based on the patient's individualized insulin action lag characteristics.

[0088] (3) FCN Network Branch: The FCN network is used to extract local temporal features from the input features. This branch contains 3 convolutional layers and 2 pooling layers. The first convolutional layer uses 64 convolutional kernels of size 3×3 with a stride of 1 and padding of "same". It performs convolution operations on the initial input feature matrix, and the output feature map dimension is... Subsequently, downsampling is performed using a max pooling layer (2×2 kernel size, stride of 2), resulting in an output feature map with dimension [missing value]. .

[0089] The second convolutional layer uses 128 3×3 convolutional kernels with a stride of 1 and the same padding method. The output feature map dimension is... ; then downsample again using a max pooling layer (pooling kernel size 2×2, stride 2), the output feature map dimension is The third convolutional layer uses 256 3×3 kernels with a stride of 1 and the same padding method. The output feature map dimension is... Finally, a global average pooling layer is used to convert the feature map into a one-dimensional feature vector with dimension 1. .

[0090] (4) Feature splicing and fully connected layer: The final hidden layer output of the LSTM network branch has a dimension of The dimension of the global average pooling output of the FCN network branch is... Feature concatenation is performed to form a fused feature vector with dimension [missing information]. .

[0091] The fused feature vector is input into a fully connected layer, which contains two hidden layers and one output layer: the first hidden layer contains 128 neurons and uses the ReLU activation function; the second hidden layer contains 64 neurons and uses the ReLU activation function; the output layer contains 48 neurons, which correspond to the blood glucose prediction results for the next 4 hours. Based on a sampling frequency of 5 minutes / sample, there are a total of 48 sampling points in 4 hours. A linear activation function is used to output the blood glucose prediction sequence for the next 4 hours.

[0092] In one embodiment, the training process of the blood glucose prediction model includes acquiring clinical data from multiple patients after pancreatic resection, including CGM blood glucose data, insulin injection records, dietary records, exercise records, and demographic information for each patient over 30 consecutive days. It is understood that the clinical data can come from publicly available datasets or be collected through historical records, and this disclosure does not impose any limitations. The data for each patient is divided into a training set, a validation set, and a test set in chronological order, with the training set accounting for 70%, the validation set for 15%, and the test set for 15%. The feature data in the training set is standardized, i.e., each feature is categorized according to... Normalization is performed, where This is the mean of this type of feature. The standard deviation of this type of feature is used, and the validation and test sets are processed using the same standardized parameters as the training set.

[0093] The mean absolute error (MAE) is used as the loss function for the model, and the calculation formula is as follows:

[0094]

[0095] in This represents the number of samples in the training set. The number of neurons in the output layer is (48). For the first The first sample The actual blood glucose level at a given moment. For the first The first sample The predicted blood glucose value at each time point. Using MAE as the loss function can effectively reduce the impact of outliers on model training and improve the robustness of the model.

[0096] The Adam optimizer was used for model training, with an initial learning rate of 0.001. A learning rate decay strategy was employed, reducing the learning rate to 0.9 times its original value every 10 epochs. The batch size was set to 32, and the total number of training epochs was set to 50. Training was stopped when the MAE on the validation set did not decrease for 5 consecutive epochs to avoid overfitting. Additionally, a Dropout layer (dropout rate = 0.2) and L2 regularization (regularization coefficient = 0.001) were introduced during model training to further improve the model's generalization ability.

[0097] Training data is input into the model in batches. Forward propagation is used to calculate prediction results, and the prediction error is calculated based on the loss function. Then, the weight parameters and bias terms of each layer of the model are updated using the backpropagation algorithm. After each epoch of training, the model is validated using validation set data, and the MAE of the validation set is recorded. After training, the performance of the model is evaluated using test set data. The MAE of the test set should be less than or equal to a preset value, which can be set according to the measurement accuracy of CMG to ensure that the model has good prediction accuracy.

[0098] In some embodiments, when it is necessary to predict a patient's future blood glucose changes, the server terminal extracts the patient's CGM blood glucose data from the 24 hours prior to the current moment, the last three insulin injection records, demographic characteristics, and recent health behavior characteristics. These features are preprocessed according to the standardized methods used during model training to construct an input feature matrix. The insulin hysteresis feature values ​​are then used to... Write the input gate time offset into the LSTM network, start the model to perform forward propagation calculation, and output the blood glucose prediction sequence for the next 4 hours. This sequence contains the blood glucose prediction values ​​at 48 time points, with each time point spaced 5 minutes apart, forming a preliminary future blood glucose curve.

[0099] In some embodiments, for step S6, based on insulin hysteresis characteristics The preliminary future blood glucose curve is corrected by time axis shift. The core purpose of the correction is to correct the systematic bias caused by the lag in interstitial fluid monitoring, such as the lag in changes in interstitial fluid glucose concentration compared to blood glucose concentration, and the superposition of the lag in insulin action, so that the predicted blood glucose change time is consistent with the actual blood glucose change time of the patient.

[0100] Please see Figure 4 , Figure 4 This is a schematic diagram of the output correction process provided in an embodiment of this disclosure. Specifically, in S401, translation correction is performed. Let the time series corresponding to the initially predicted future blood glucose curve be... ,in , ( The corresponding blood glucose prediction value sequence is: .

[0101] Corrected time series The corresponding blood glucose prediction value sequence is still... ,Right now The predicted blood glucose value at time 1 is .

[0102] In S402, boundary processing is performed. If the predicted time after translation exceeds the preset prediction time range of the next 4 hours, the predicted values ​​of the excess part are truncated, and only the prediction results of the next 4 hours are retained. If there are fewer than 48 predicted time points in the next 4 hours after translation, the missing prediction points are supplemented by linear interpolation of adjacent prediction values ​​to ensure that the corrected blood glucose prediction curve fully covers the time range of the next 4 hours.

[0103] By using the above time axis translation correction, the predicted times of key nodes such as the inflection point of blood glucose decline and the peak blood glucose level are kept consistent with the corresponding times in the patient's actual physiological process, which effectively reduces the prediction bias caused by time mismatch and improves the clinical reference value of blood glucose prediction.

[0104] It is understandable that introducing insulin lag features into the blood glucose prediction model to shift the input features forward on the time axis aims to correct the causal alignment between insulin injection and blood glucose changes during the model learning phase; while shifting the future blood glucose curve backward on the time axis during the prediction output phase aims to restore the model prediction results to the physiological time coordinate consistent with the actual time axis. These two are different processing stages and do not constitute duplicate correction.

[0105] In some embodiments, before eating, patients take pictures of their food using the image capture function of a smart mobile terminal APP. The images must be clear, well-lit, and able to fully display the type and portion size of the food. The APP supports single-image capture or multi-image stitching, suitable for situations with a large variety of food items. After capturing the image, patients can perform simple editing such as cropping and rotating to ensure image quality meets recognition requirements. After editing, the APP compresses the image data in JPEG format and uploads it to the server terminal via wireless communication technology. During the upload process, AES-128 encryption algorithm is also used to ensure data security.

[0106] The server terminal uses a convolutional neural network (CNN)-based image recognition model to analyze food images. This model is an improved ResNet-50 model, and its specific structure is as follows:

[0107] (1) Input layer: Receives RGB image data with a size of 224×224×3, performs normalization processing on the image data, divides the pixel value by 255, and maps it to the [0,1] interval.

[0108] (2) Feature Extraction Layer: Based on the ResNet-50 residual network structure, it contains four residual block groups, each consisting of multiple residual blocks. Residual connections address the gradient vanishing problem in deep networks. The first residual block group contains three residual blocks, each using 64 3×3 convolutional kernels; the second residual block group contains eight residual blocks, each using 128 3×3 convolutional kernels; the third residual block group contains 36 residual blocks, each using 256 3×3 convolutional kernels; and the fourth residual block group contains three residual blocks, each using 512 3×3 convolutional kernels. This feature extraction layer converts image data into high-dimensional feature vectors.

[0109] (3) Classification and Regression Layer: The feature vector output from the feature extraction layer is input into the global average pooling layer to obtain a feature vector with dimensions [1, 2048]. This feature vector is divided into two paths: one path is input into the food type classification layer, which uses the softmax activation function to output the probability distribution of food types, covering 500 common foods, and selecting the top 3 foods with the highest probabilities as the recognition results; the other path is input into the nutritional component regression layer, which uses the linear activation function to output the nutritional component data such as calories (kcal), carbohydrate content (g), protein content (g), and fat content (g) for each recognized food.

[0110] (4) Model training: The image recognition model is trained on a public dataset containing 100,000 food images (such as the Food-101 dataset). The training process uses a combination of cross-entropy loss function (for food type classification) and mean squared error loss function (for nutritional component regression). The optimizer is SGD optimizer with a learning rate of 0.0001, a training batch size of 64, and a total number of training epochs of 100 to ensure that the recognition accuracy of the model is ≥90%.

[0111] The food categories obtained from the image recognition model are encoded as unique heat vectors with dimensions [1, 500]. These vectors are then fused with nutritional component data (dimensions [1, 4]) to form a dietary auxiliary feature vector (dimensions [1, 504]). This dietary auxiliary feature vector is incorporated into the input feature matrix of the blood glucose prediction model and concatenated with historical blood glucose features, insulin injection features, demographic features, and health behavior features to form a new input feature matrix with dimensions [1, 298 + 504] = [1, 802]. This new matrix is ​​then input into the blood glucose prediction model for prediction. By incorporating dietary auxiliary features, the model can fully consider the impact of dietary factors on blood glucose changes, further improving the accuracy of blood glucose prediction.

[0112] In some embodiments, preferably, the process of generating insulin hysteresis feature values ​​is re-executed every time the sliding time window is moved forward by a fixed step (1 day), thereby achieving dynamic updating of parameters.

[0113] Please see Figure 5 , Figure 5 This is a schematic diagram of the parameter update process provided in an embodiment of this disclosure. Specifically, in S501, the time window is shifted. When a set update time point is reached, such as 0:00 AM every day, the sliding time window is moved forward by one day, that is, the time range of the original time window. ( (Tian) migrated to ,in This is the start time of the original time window. This is the end time of the original time window.

[0114] In S502, the data is updated. Within the new sliding time window, all valid insulin injection events within that time window are collected. Data, including the newly added 1 day ( (1 day prior) The data was processed by removing the earliest day from the original time window. (where the day is) data.

[0115] In S503, the eigenvalues ​​are recalculated. For the new sliding time window... The data, following the aforementioned outlier removal and eigenvalue calculation methods, are used to regenerate the insulin lag eigenvalues ​​for that time window. .

[0116] In S504, parameter smoothing is performed. To avoid frequent fluctuations in eigenvalues ​​affecting the model's predictive stability, newly generated eigenvalues ​​are smoothed. Eigenvalues ​​from the previous time step Smoothing is performed, and the final updated feature values ​​are calculated using a weighted average. The calculation formula is:

[0117]

[0118] The weighting coefficients of 0.7 and 0.3 are set based on the feature values ​​within the new time window. It better reflects the patient's current metabolic state and is given higher weight; the feature value at the previous time step It ensures parameter continuity and assigns lower weights. Through smoothing, the feature value update process is made smoother, avoiding parameter abrupt changes caused by single data fluctuations.

[0119] In S505, the model parameters are updated. The updated insulin action hysteresis features are then used. The input gate time offset of the LSTM network is rewritten to update the input parameters of the blood glucose prediction model, ensuring that the model can adapt to changes in the patient's metabolic state in real time and maintain stable prediction accuracy.

[0120] Through the aforementioned sliding time window update mechanism, the insulin action lag characteristic value can dynamically track changes in the metabolic state of patients during postoperative recovery. The parameters can be adaptively adjusted without manual intervention, significantly improving the system's practicality and intelligence.

[0121] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a CGM-based intelligent patient blood glucose management and monitoring system provided in an embodiment of this application. Figure 6 As shown, system 600 includes:

[0122] Data acquisition module 601 is used to acquire interstitial fluid glucose concentration data of patients after pancreatectomy via a CGM sensor;

[0123] The data alignment module 602 is used to align interstitial fluid glucose concentration data with insulin injection events on the same patient timeline to form a continuous time series, wherein the insulin injection event includes at least an injection timestamp and an injection dose.

[0124] The lag time calculation module 603 is used to set an observation time interval after each insulin injection event, identify the inflection point of the decrease in interstitial fluid glucose concentration within the interval, calculate the time difference between the inflection point and the injection time, and use it as the lag time of insulin action for that event.

[0125] The feature value generation module 604 is used to statistically analyze all insulin action lag times within a preset sliding time window and generate insulin action lag feature values ​​within that time window.

[0126] The blood glucose prediction module 605 is used to embed the insulin action lag feature value as a time-series parameter into the input feature of the blood glucose prediction model to predict future changes in interstitial fluid glucose concentration.

[0127] The prediction correction module 606 is used to perform time axis translation correction on the predicted future blood glucose curve based at least on the insulin action hysteresis characteristic value, and generate a corrected blood glucose prediction curve.

[0128] Those skilled in the art will clearly understand that the technical solutions of the embodiments of this application can be implemented by means of software and / or hardware. In this specification, "unit" and "module" refer to software and / or hardware that can independently complete or cooperate with other components to complete a specific function, wherein the hardware may be, for example, a field-programmable gate array (FPGA), an integrated circuit (IC), etc.

[0129] Each processing unit and / or module in the embodiments of this application can be implemented by an analog circuit that implements the functions described in the embodiments of this application, or by software that executes the functions described in the embodiments of this application.

[0130] Please see Figure 7 It shows a schematic diagram of the structure of an electronic device according to an embodiment of this application, which can be used to implement... Figure 1 The method in the illustrated embodiment. (As shown) Figure 7 As shown, the electronic device 700 may include:

[0131] The system includes at least one processor 701, at least one network interface 704, a user interface 703, a memory 705, and at least one communication bus 702. The communication bus 702 is used to enable connection and communication between the components. The user interface 703 may include buttons, and optionally include a standard wired or wireless interface. The network interface 704 may include, but is not limited to, a Bluetooth module, an NFC module, a Wi-Fi module, etc.

[0132] The processor 701 may include one or more processing cores and connect to various parts within the device 700 via various interfaces and lines. It implements the various functions and data processing of the device 700 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 705, and by accessing data in the memory 705. Optionally, the processor 701 may be implemented using at least one hardware form of DSP, FPGA, or PLA. The processor 701 may also integrate one or more combinations of CPU, GPU, and modem. The CPU is mainly used to handle the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display on the screen; and the modem is used for wireless communication. It is understood that the modem may not be integrated into the processor 701, but may be implemented through a separate chip.

[0133] The memory 705 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 705 includes a non-transitory computer-readable medium for storing instructions, programs, code, code sets, or instruction sets. The memory 705 may be divided into a program storage area and a data storage area, wherein the program storage area may be used to store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, audio playback functionality, image playback functionality, etc.), and instructions for implementing the foregoing method embodiments; the data storage area may be used to store data involved in the relevant method embodiments. The memory 705 may also be at least one storage device located remotely from the processor 701. Figure 7 As shown, the memory 705, which serves as a computer storage medium, may contain an operating system, a network communication module, a user interface module, and program instructions.

[0134] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by processor 701, the functions defined in the methods of this application are performed.

[0135] Another embodiment of this application provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of this application described above.

[0136] The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.

[0137] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

Claims

1. A method for intelligent blood glucose management and monitoring based on CGM, characterized in that, include: Data on interstitial fluid glucose concentration in patients after pancreatectomy were collected using a CGM sensor. Interstitial fluid glucose concentration data and insulin injection events on the same patient's timeline are aligned to form a continuous time series, wherein the insulin injection events include at least the injection timestamp and the injection dose; After each insulin injection event, an observation time interval was set, and the inflection point of the decrease in interstitial fluid glucose concentration was identified within the interval. The time difference between the inflection point and the injection time was calculated as the insulin lag time for that event. Statistical analysis is performed on all insulin action lag times within a preset sliding time window to generate insulin action lag characteristic values ​​within that time window. The insulin hysteresis feature value is embedded as a time-series parameter into the input feature of the blood glucose prediction model to predict future changes in interstitial fluid glucose concentration. The blood glucose prediction model employs a parallel architecture of LSTM and fully convolutional networks, achieving the final prediction through feature concatenation and fully connected layers. The insulin hysteresis feature value... The input gate time offset is written into the LSTM network, and a time offset factor is introduced during the calculation of the input gate. Shift the time axis of the input features forward. Each sampling interval, of which This is the default insulin lag time; At least based on the insulin hysteresis characteristic value, the predicted future blood glucose curve is time-axis shifted and corrected to generate a corrected blood glucose prediction curve.

2. The intelligent blood glucose management and monitoring method based on CGM according to claim 1, characterized in that, The specific method for identifying the inflection point of decline is to perform first-order difference analysis on the interstitial fluid glucose concentration sequence within the observation time interval. When the continuous difference value changes from non-negative to continuously negative and the decline exceeds a preset threshold, the time point at which the condition is first met is recorded as the inflection point.

3. The intelligent blood glucose management and monitoring method based on CGM according to claim 2, characterized in that: The process of statistically analyzing all insulin action lag times within a preset sliding time window includes removing abnormal insulin action lag times within the sliding time window that deviate from the mean by more than a preset range, and then calculating the mean or median of the remaining values ​​as the insulin action lag characteristic value.

4. The intelligent blood glucose management and monitoring method based on CGM according to claim 1, characterized in that, The blood glucose prediction model is constructed by extracting features in parallel from a long short-term memory network and a fully convolutional network, then concatenating the features, and finally outputting the prediction results through a fully connected layer; the insulin action lag feature value is written into the input gate time offset of the long short-term memory network.

5. The intelligent blood glucose management and monitoring method based on CGM according to claim 1, characterized in that, The statistics are re-executed and the insulin action lag characteristic value is updated every time the sliding time window moves forward by a fixed step.

6. The intelligent blood glucose management and monitoring method based on CGM according to claim 1, characterized in that, It also includes receiving images of the patient's diet, analyzing the types and nutritional components of the food based on an image recognition model, and incorporating the analysis results as auxiliary input features into the feature matrix of the blood glucose prediction model.

7. A CGM-based intelligent blood glucose management and monitoring system, characterized in that, include: The data acquisition module is used to collect interstitial fluid glucose concentration data of patients after pancreatectomy via a CGM sensor; The data alignment module is used to align interstitial fluid glucose concentration data with insulin injection events on the same patient's timeline to form a continuous time series, wherein the insulin injection event includes at least an injection timestamp and an injection dose. The lag time calculation module is used to set an observation time interval after each insulin injection event, identify the inflection point of the decrease in interstitial fluid glucose concentration within the interval, and calculate the time difference between the inflection point and the injection time as the lag time of insulin action for that event. The feature value generation module is used to statistically analyze all insulin action lag times within a preset sliding time window and generate insulin action lag feature values ​​within that time window. The blood glucose prediction module is used to embed the insulin lag feature value as a time-series parameter into the input features of the blood glucose prediction model to predict future changes in interstitial fluid glucose concentration. The blood glucose prediction model employs a parallel architecture of LSTM and fully convolutional networks, achieving the final prediction through feature concatenation and fully connected layers. The insulin lag feature value... The input gate time offset is written into the LSTM network, and a time offset factor is introduced during the calculation of the input gate. Shift the time axis of the input features forward. Each sampling interval, of which This is the default insulin lag time; The prediction correction module is used to perform time axis translation correction on the predicted future blood glucose curve based at least on the insulin action hysteresis feature value, and generate a corrected blood glucose prediction curve.

8. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, The computer program instructions can be executed by a processor to implement the method as described in any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Insulin dose recommendation system integrating deep learning and medical knowledge

    CN115985458A

  • System and method for intelligently monitoring blood glucose of patient before and after diet based on food ingredients

    CN121393931A