Continuous blood glucose prediction method and system considering blood glucose concentration and blood glucose trend

The blood sugar prediction model trained through the sliding time window and loss function solves the problem that traditional methods cannot take into account the blood sugar trend, and achieves high-precision prediction of blood sugar concentration and trend, improving the accuracy of blood sugar monitoring and the scientific nature of personalized treatment.

CN120473133APending Publication Date: 2025-08-12SUN YAT SEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510445807.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The existing blood sugar concentration prediction methods mainly rely on traditional machine learning and deep learning algorithms, and cannot accurately take into account the rapid and long-term fluctuations of blood sugar trends, resulting in incomplete evaluation of blood sugar value and inability to provide accurate predictions and early warnings.

Method used

The blood sugar data is processed through the sliding time window, the overall trend value of blood sugar is calculated, and the blood sugar prediction model is trained using the loss function. Combining different trend calculation methods and batch trend values, the loss function is constructed to improve the adaptability and accuracy of the model.

Benefits of technology

Improves the integrity and accuracy of blood sugar prediction, can better capture complex changes in blood sugar concentration and trends, and provide scientific basis for personalized treatment and condition monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120473133A_ABST
    Figure CN120473133A_ABST
Patent Text Reader

Abstract

The invention discloses a continuous blood glucose prediction method and system considering blood glucose concentration and blood glucose trend. The method comprises the following steps: acquiring a blood glucose data sample; processing the blood glucose data sample by sliding a time window, and calculating an overall trend value of blood glucose; inputting the blood glucose data sample into a blood glucose prediction model to obtain a predicted blood glucose concentration and a predicted blood glucose trend value; according to the predicted blood glucose trend value, the overall trend value, the predicted blood glucose concentration and the corresponding blood glucose data sample, training the blood glucose prediction model through a loss function to obtain a trained blood glucose prediction model, and continuously predicting the blood glucose concentration and the blood glucose trend through the blood glucose prediction model. According to the embodiment of the invention, the blood glucose concentration and the blood glucose trend are predicted through the blood glucose prediction model, so that the integrity and accuracy of blood glucose prediction are improved. The method can be widely applied to the technical field of noninvasive detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of non-invasive detection technology, and in particular to a method and system for continuous blood sugar prediction that takes both blood sugar concentration and blood sugar trend into consideration. Background Art

[0002] Existing blood glucose (BG) concentration prediction methods mainly rely on traditional machine learning and data analysis technologies. These methods collect blood glucose data and combine machine learning (ML) or deep learning (DL) algorithms to predict future blood glucose levels so that timely intervention can be made to prevent the occurrence of hyperglycemia or hypoglycemia events. The continuous blood glucose assessment of blood glucose concentration mainly relies on the coordinated application of continuous glucose monitoring (CGM) systems and data analysis models. The CGM system collects individual blood glucose concentration data in real time through the implantation of subcutaneous sensors, which can provide high-frequency and high-timeliness blood glucose dynamic information, laying a solid foundation for subsequent data processing and trend analysis. As non-invasive CGM mainly relies on current human physiological parameters to assess the current blood glucose value, since it cannot be accurately measured, it is particularly important to improve the accuracy of the prediction as much as possible and monitor the trend of blood glucose fluctuations.

[0003] For continuously acquired time series data, key indicators reflecting the absolute blood glucose value are extracted through steps such as preprocessing, noise filtering, and feature extraction, thereby achieving a quantitative description of the blood glucose value. In related technologies, algorithms based on traditional machine learning and deep learning, such as long short-term memory networks (LSTMs), gated recurrent units (GRUs), and transformer models, have been widely used in the study of dynamic blood glucose prediction. These models can integrate historical blood glucose data with multiple sources of information such as patient behavior, diet, and exercise to predict future blood glucose fluctuations and provide a scientific basis for personalized treatment. However, for the trend fluctuation of blood glucose, the more common method at this stage is to calculate the blood glucose standard deviation (SD) over a specified time period. However, the fluctuation trend of blood glucose has both rapid fluctuations in a short period of time and overall fluctuations over a longer period of time. The evaluation system is often limited to monitoring a single blood glucose concentration without taking into account the trend of blood glucose changes, which makes it impossible to accurately assess blood glucose values. Summary of the Invention

[0004] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.

[0005] Therefore, the object of the present invention is to provide a fast and high-precision continuous blood glucose prediction method and system that takes into account both blood glucose concentration and blood glucose trend.

[0006] In order to achieve the above technical purpose, one aspect of an embodiment of the present invention provides a continuous blood glucose prediction method that takes into account both blood glucose concentration and blood glucose trend, comprising the following steps: obtaining a blood glucose data sample; processing the blood glucose data sample through a sliding time window, and calculating the overall trend value of blood glucose; inputting the blood glucose data sample into a blood glucose prediction model to obtain a predicted blood glucose concentration and a predicted blood glucose trend value; training the blood glucose prediction model through a loss function based on the predicted blood glucose trend value and the overall trend value, the predicted blood glucose concentration and the corresponding blood glucose data sample to obtain a trained blood glucose prediction model, so as to continuously predict blood glucose concentration and blood glucose trend through the blood glucose prediction model. The embodiment of the present application predicts blood glucose concentration and blood glucose trend through the blood glucose prediction model, which is conducive to improving the integrity and accuracy of blood glucose prediction.

[0007] In some embodiments, calculating the overall trend value of blood glucose includes:

[0008] Establish a sliding time window centered on the data time point;

[0009] Determine the blood glucose trend at each data time point within the sliding time window, and then determine the overall trend value;

[0010] Alternatively, the blood glucose trend of the preceding and following data time points within the sliding time window is determined, and then the overall trend value is determined.

[0011] In some embodiments, determining the blood glucose trend at each data time point within the sliding time window, and then determining the overall trend value, includes:

[0012] Determine the blood sugar trend at each data time point based on the blood sugar value at the next moment and the blood sugar value at the previous moment;

[0013] The blood glucose trends of all data time points within the sliding time window are weighted and averaged to determine the overall trend value.

[0014] In some embodiments, determining the blood glucose trend of the preceding and following data time points within the sliding time window, and then determining the overall trend value, includes:

[0015] determining a second blood glucose trend according to the average blood glucose value in the first half and the average blood glucose value in the second half of the sliding time window;

[0016] The overall trend value is determined according to the second blood glucose trend.

[0017] In some embodiments, the loss function is constructed by the following steps:

[0018] dividing the blood glucose data samples into a plurality of batches;

[0019] determining a different batch trend value for each batch based on different trend calculation methods;

[0020] Constructing a trend function in the loss function according to the different batch trend values;

[0021] A loss function is determined according to the trend function and the concentration function.

[0022] In some embodiments, determining a different batch trend value for each batch based on different trend calculation methods includes:

[0023] determining a first and last trend value of the batch based on a first data point and a last data point in the batch;

[0024] Alternatively, determining a compromise trend value for the batch based on a first data point, a middle data point, and a last data point in the batch;

[0025] Alternatively, an average trend value of the batch is determined based on each data point in the batch.

[0026] In some embodiments, constructing a trend function in a loss function according to the different batch trend values includes:

[0027] Determine a first trend item based on the head and tail trend values by using a mean square error;

[0028] Determining a second trend term based on the compromise trend value by using a mean square error;

[0029] Determining a third trend term based on the average trend value by using a mean square error;

[0030] A trend function is determined according to the first trend item, the second trend item, and the third trend item.

[0031] On the other hand, an embodiment of the present invention provides a continuous blood glucose prediction system that takes into account both blood glucose concentration and blood glucose trend, including:

[0032] The first module is used to obtain blood glucose data samples;

[0033] The second module is used to process the blood glucose data sample through a sliding time window and calculate the overall trend value of blood glucose;

[0034] The third module is used to input the blood glucose data sample into the blood glucose prediction model to obtain the predicted blood glucose concentration and the predicted blood glucose trend value;

[0035] The fourth module is used to train the blood glucose prediction model through a loss function based on the predicted blood glucose trend value and the overall trend value, the predicted blood glucose concentration and the corresponding blood glucose data sample to obtain a trained blood glucose prediction model, so as to continuously predict the blood glucose concentration and blood glucose trend through the blood glucose prediction model.

[0036] On the other hand, an embodiment of the present invention provides a continuous blood glucose prediction device that takes into account both blood glucose concentration and blood glucose trend, comprising:

[0037] at least one processor;

[0038] at least one memory for storing at least one program;

[0039] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned continuous blood glucose prediction method that takes both blood glucose concentration and blood glucose trend into consideration.

[0040] On the other hand, an embodiment of the present invention provides a storage medium storing a program executable by a processor. When the program is executed by the processor, it is used to implement the above-mentioned continuous blood glucose prediction method that takes into account both blood glucose concentration and blood glucose trend.

[0041] The embodiments of the present application include at least the following beneficial effects: the method provided by the embodiments of the present invention includes: obtaining blood glucose data samples; processing the blood glucose data samples through a sliding time window and calculating the overall trend value of blood glucose; inputting the blood glucose data samples into a blood glucose prediction model to obtain a predicted blood glucose concentration and a predicted blood glucose trend value; training the blood glucose prediction model through a loss function based on the predicted blood glucose trend value and the overall trend value, the predicted blood glucose concentration and the corresponding blood glucose data samples to obtain a trained blood glucose prediction model, so as to continuously predict the blood glucose concentration and blood glucose trend through the blood glucose prediction model. The embodiments of the present application predict blood glucose concentration and blood glucose trend through the blood glucose prediction model, which is conducive to improving the completeness and accuracy of blood glucose prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present invention or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative work.

[0043] Figure 1 A schematic flow chart of an embodiment of a continuous blood glucose prediction method taking into account both blood glucose concentration and blood glucose trend provided by the present invention;

[0044] Figure 2 A schematic diagram of the division of a sliding time window according to an embodiment of the present invention;

[0045] Figure 3 A schematic flow chart of an embodiment of a process for determining an overall trend value provided by the present invention;

[0046] Figure 4 A schematic flow chart of another embodiment of a process for determining an overall trend value provided by the present invention;

[0047] Figure 5 A schematic diagram of a flow chart of an embodiment of a loss function determination process provided by the present invention;

[0048] Figure 6 A graph showing the changing trend of the training data set provided by the present invention in the first sliding time window;

[0049] Figure 7 A graph showing the changing trend of the training data set provided by the present invention in the second sliding time window;

[0050] Figure 8 This is a changing trend diagram of the training data set provided by the present invention in the third sliding time window. DETAILED DESCRIPTION

[0051] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and are not to be construed as limiting the present invention. The step numbers in the following embodiments are provided for ease of explanation only and do not limit the order of the steps. The order of execution of the steps in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0052] Existing blood glucose (BG) concentration prediction methods mainly rely on traditional machine learning and data analysis technologies. These methods collect blood glucose data and combine machine learning (ML) or deep learning (DL) algorithms to predict future blood glucose levels so that timely intervention can be made to prevent the occurrence of hyperglycemia or hypoglycemia events. The continuous blood glucose assessment of blood glucose concentration mainly relies on the coordinated application of continuous glucose monitoring (CGM) systems and data analysis models. The CGM system collects individual blood glucose concentration data in real time through the implantation of subcutaneous sensors, which can provide high-frequency and high-timeliness blood glucose dynamic information, laying a solid foundation for subsequent data processing and trend analysis. As non-invasive CGM mainly relies on current human physiological parameters to assess the current blood glucose value, since it cannot be accurately measured, it is particularly important to improve the accuracy of the prediction as much as possible and monitor the trend of blood glucose fluctuations.

[0053] For continuously acquired time series data, researchers use preprocessing, noise filtering, and feature extraction to extract key indicators reflecting absolute blood glucose levels, thereby achieving a quantitative description of blood glucose levels. In recent years, algorithms based on traditional machine learning and deep learning, such as long short-term memory (LSTM) networks, gated recurrent units (GRU), and Transformer models, have been widely used in the study of dynamic blood glucose prediction. These models can integrate historical blood glucose data with multiple sources of information, such as patient behavior, diet, and exercise, to predict future blood glucose fluctuations and provide a scientific basis for personalized treatment. However, to measure blood glucose trend fluctuations, the most common approach is to calculate the standard deviation (SD) of blood glucose over a specified time period. However, blood glucose fluctuations can range from rapid fluctuations over short periods of time to overall fluctuations over longer periods of time. Evaluation systems are often limited to monitoring a single blood glucose concentration and fail to consider blood glucose trends, resulting in an inability to accurately assess the accuracy of blood glucose predictions.

[0054] Current traditional AI models have significant shortcomings when tracking blood glucose trends using noninvasive CGM. First, these models often rely on fixed algorithmic architectures and static parameter settings, lacking sufficient sensitivity to the nonlinear changes, multi-scale fluctuations, and long-term dependencies in blood glucose data. Blood glucose data is influenced by multiple factors, such as individual physiological state, diet, exercise, and environmental changes. These factors combine to create complex dynamic characteristics in the data, and traditional models struggle to capture these subtle changes. Second, traditional models often react slowly to sudden fluctuations and fail to accurately predict sharp rises or falls in blood glucose. Furthermore, the inevitable noise and errors in the data collection process further weaken the model's predictive power. Existing models lack adaptive adjustment mechanisms and cannot promptly update parameters based on real-time data changes, resulting in prediction errors when trends emerge. These shortcomings significantly reduce the effectiveness of traditional AI models in noninvasive CGM blood glucose monitoring. There is an urgent need to introduce more advanced algorithms and deep learning technologies that can improve the accuracy of capturing and predicting complex trends through multi-level and multi-angle data fusion and dynamic adaptive adjustments.

[0055] Existing assessment methods often focus on a single indicator: blood glucose concentration. However, blood glucose is a physiological indicator that fluctuates continuously. The current blood glucose value is influenced not only by the current physiological state, but also by the physiological state and blood glucose indicators in previous periods. The dynamic fluctuations of blood glucose and continuous historical blood glucose data are of great significance to the predictive accuracy of non-invasive blood glucose devices and the condition monitoring of diabetic patients. Failure to fully integrate the complex nonlinear relationship between the two makes it difficult to adapt to individual physiological differences, which, to a certain extent, restricts the accurate prediction of future blood glucose changes and early warning. For existing non-invasive CGMs, accurately tracking blood glucose trends remains a major challenge. Therefore, a more intelligent and comprehensive AI model calculation and evaluation solution is needed to overcome these limitations and achieve comprehensive and accurate assessment of blood glucose concentration and dynamic trends.

[0056] To address this issue, this application proposes a continuous dynamic blood glucose monitoring method that takes into account both blood glucose concentration and blood glucose trends during the AI model building process. Blood glucose fluctuations include both small changes in a short period of time and major trends over a long period of time, so a holistic approach is needed to capture the overall dynamics of blood glucose changes.

[0057] 1. This application independently calculates the average trend of the BG value before and after each measurement using sliding time windows at different times. These trend results are then weighted and averaged across all windows to obtain the overall fluctuation trend of each BG value. This composite trend indicator combines the average fluctuations across multiple time scales, providing a reliable representation of both small and large BG fluctuations for each measurement.

[0058] 2. This application utilizes a BG trend calculation method to fully calculate the BG trend of each sliding window and obtain the overall trend value of the BG data. A sliding window of different times is created with the BG data time as the center. The average BG trend of each data point within the sliding window is then calculated and used as the overall trend value of the BG data. The algorithm for calculating the trend of each data point within the sliding window is to subtract the BG value at the previous moment from the next moment, and then divide it by the time difference between the two data points. Finally, the trend values of all data points within the sliding window are weighted and averaged to obtain the overall trend value of the BG data.

[0059] 3. This application utilizes another BG trend calculation method to fully calculate the BG trend of each sliding window and obtain the overall trend value of the BG data. When calculating the BG trend, a sliding window of different times is first created with the BG data time as the center. Then, the average BG trend of the first and second halves of the sliding window is calculated as the overall trend value of the BG data. The algorithm for calculating the trend of the first and second halves is to use the average BG value of the first half minus the BG value of the second half, and then divide it by the average time difference between the first and second halves.

[0060] 4. This application provides a method for calculating a loss function. This loss function comprehensively considers the absolute blood glucose value at the current moment and the blood glucose fluctuation trend over a period of time. By calculating the mean square error (MSE) between the predicted blood glucose value and the actual blood glucose value and the MSE between the predicted blood glucose fluctuation trend and the actual blood glucose fluctuation trend, the loss function can obtain a weighted loss value for model training, learning, and iterative optimization.

[0061] 5. This application provides methods for calculating different trends in the loss function. Loss values can be calculated for different batch sizes each time. Within each batch, three trend calculation methods are provided: head and tail trend, compromise trend, and average trend. This allows for comprehensive calculation of trend fluctuations for each batch, and the results can then be used to adjust model parameters.

[0062] The following describes in detail a continuous blood glucose prediction method and system that takes both blood glucose concentration and blood glucose trend into consideration according to an embodiment of the present invention with reference to the accompanying drawings. First, the continuous blood glucose prediction method that takes both blood glucose concentration and blood glucose trend into consideration according to an embodiment of the present invention will be described with reference to the accompanying drawings.

[0063] Reference Figure 1, an embodiment of the present invention provides a continuous blood glucose prediction method that takes into account both blood glucose concentration and blood glucose trend. The continuous blood glucose prediction method that takes into account both blood glucose concentration and blood glucose trend in the embodiment of the present invention can be applied to a terminal, can also be applied to a server, can also be software running in a terminal or a server, etc. The terminal can be a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The continuous blood glucose prediction method that takes into account both blood glucose concentration and blood glucose trend in the embodiment of the present invention mainly includes the following steps:

[0064] S100: Obtain blood glucose data samples;

[0065] S200: Processing the blood glucose data sample through a sliding time window and calculating an overall trend value of blood glucose;

[0066] S300: Inputting the blood glucose data sample into a blood glucose prediction model to obtain a predicted blood glucose concentration and a predicted blood glucose trend value;

[0067] S400: Based on the predicted blood glucose trend value and the overall trend value, the predicted blood glucose concentration and the corresponding blood glucose data sample, the blood glucose prediction model is trained through a loss function to obtain a trained blood glucose prediction model, so as to continuously predict the blood glucose concentration and blood glucose trend through the blood glucose prediction model.

[0068] In some possible implementations, the blood glucose data samples can be divided into predicted samples and real samples, the predicted samples are used to determine the predicted values based on the blood glucose prediction model, and the real samples are used to compare with the predicted values to train the blood glucose prediction model. Specifically, the present application processes the real samples in the blood glucose data samples through a sliding time window, and calculates the overall trend value of blood glucose, and the overall trend value is used to compare with the predicted blood glucose trend value predicted by the blood glucose prediction model to train the blood glucose prediction model. The present application trains the blood glucose prediction model through a loss function based on the predicted blood glucose trend value and the overall trend value, the predicted blood glucose concentration and the real samples to obtain a trained blood glucose prediction model.

[0069] In some embodiments, calculating the overall trend value of blood glucose includes:

[0070] Establish a sliding time window centered on the data time point;

[0071] Determine the blood glucose trend at each data time point within the sliding time window, and then determine the overall trend value;

[0072] Alternatively, the blood glucose trend of the preceding and following data time points within the sliding time window is determined, and then the overall trend value is determined.

[0073] The time base of the sliding time window can be adjusted according to actual conditions.

[0074] In some embodiments, determining the blood glucose trend at each data time point within the sliding time window, and then determining the overall trend value, includes:

[0075] Determine the blood sugar trend at each data time point based on the blood sugar value at the next moment and the blood sugar value at the previous moment;

[0076] The blood glucose trends of all data time points within the sliding time window are weighted and averaged to determine the overall trend value.

[0077] In some embodiments, determining the blood glucose trend of the preceding and following data time points within the sliding time window, and then determining the overall trend value, includes:

[0078] determining a second blood glucose trend according to the average blood glucose value in the first half and the average blood glucose value in the second half of the sliding time window;

[0079] The overall trend value is determined according to the second blood glucose trend.

[0080] The first half and the second half of the sliding time window can be divided according to the data time point.

[0081] In some embodiments, the loss function is constructed by the following steps:

[0082] dividing the blood glucose data samples into a plurality of batches;

[0083] determining a different batch trend value for each batch based on different trend calculation methods;

[0084] Constructing a trend function in the loss function according to the different batch trend values;

[0085] A loss function is determined according to the trend function and the concentration function.

[0086] In some embodiments, determining a different batch trend value for each batch based on different trend calculation methods includes:

[0087] determining a first and last trend value of the batch based on a first data point and a last data point in the batch;

[0088] Alternatively, determining a compromise trend value for the batch based on a first data point, a middle data point, and a last data point in the batch;

[0089] Alternatively, an average trend value of the batch is determined based on each data point in the batch.

[0090] In some embodiments, constructing a trend function in a loss function according to the different batch trend values includes:

[0091] Determine a first trend item based on the head and tail trend values by using a mean square error;

[0092] Determining a second trend term based on the compromise trend value by using a mean square error;

[0093] Determining a third trend term based on the average trend value by using a mean square error;

[0094] A trend function is determined according to the first trend item, the second trend item, and the third trend item.

[0095] The following is a detailed description of the blood glucose prediction method provided by this application using a specific embodiment:

[0096] Blood glucose fluctuation trends over different time periods are crucial for monitoring the condition of diabetic patients. In addition to minimizing the average error in predicting absolute blood glucose values, this application also aims to accurately reflect and monitor the overall fluctuation trend of blood glucose through non-invasive sensing. Combining a sliding window, two trend calculation methods, and a loss function calculation method can better capture the complex patterns and long-term dependencies in blood glucose concentration changes, and obtain the average fluctuation of blood glucose on multiple time scales. This takes into account both the absolute blood glucose value and the blood glucose fluctuation trend.

[0097] The method of the present application is universal. For different models, the accuracy of the model in tracking blood sugar trends can be improved by changing the sliding window time, different loss function batches, and other trend calculation methods.

[0098] By analyzing trends, the system comprehensively displays subtle fluctuations and changing trends in blood glucose concentrations over different timescales, accurately identifying and effectively tracking both rapid short-term fluctuations and slow changes in long-term trends. By comprehensively processing data from each monitoring cycle, the system comprehensively displays the characteristics of blood glucose trends across different timescales, fluctuation trends, and monitoring cycles. Key features can be extracted to provide a scientific basis for clinical decision-making.

[0099] This technology has broad application prospects and will improve blood sugar monitoring, diabetes prevention, and related chronic disease management, effectively enhancing clinical diagnosis and treatment and patients' quality of life. The accurate prediction method of this invention can effectively help diabetic patients manage their blood sugar levels, reduce the occurrence of hypoglycemia and hyperglycemia, reduce medical costs, and improve patients' quality of life.

[0100] Figure 2 This concept of a sliding time window is explained in this application. Assuming a dataset with a data point every 5 minutes, a sliding window of 15-90 minutes is created, centered around the BG data time. The computational framework uses this sliding time window to systematically evaluate BG. Using a 15- to 90-minute scanning window, the average trend of the BG data points before and after each measurement is independently calculated, yielding corresponding trend values for BG fluctuations at different time scales. This composite trend metric combines the average fluctuations at different time scales, providing a reliable representation of both minor and major BG fluctuations for each BG measurement.

[0101] Figure 3 This is the first calculation description of blood glucose trend provided by this application. This method takes into account the overall fluctuations between all data points in the sliding time window, and takes the time window of 15 minutes to 90 minutes as an example to illustrate the calculation method. In order to calculate the BG trend, a 15-90 minute sliding window is created with the BG data time as the center for illustration. The average BG trend of each data point in the sliding window is then calculated and used as the overall trend value of the BG data. The algorithm for calculating the trend of each data point in the sliding window is to subtract the BG value of the previous moment from the latter moment, and then divide it by the time difference between the two data points. Finally, the trend values of all data points in the sliding window are weighted and averaged to obtain the overall trend value of the BG data.

[0102] Figure 4 This is a calculation description of the second blood glucose trend provided by this application. This method takes into account the average trend between the BG data points in the first half and the second half of the sliding window, ranging from 15 minutes to 90 minutes as an example. When calculating the BG trend, a 15-90 minute sliding window is first created with the BG data time as the center. The average BG trend of the first half and the second half of the sliding window is then calculated as the overall trend value of the BG data. The algorithm for calculating the trend of the first half and the second half is to use the average BG value of the first half minus the BG value of the second half, and then divide it by the average time difference between the first half and the second half. It can be understood that Figure 3 and Figure 4 The provided blood glucose trend determination method can be used to evaluate blood glucose trends during the operation of a blood glucose prediction model, and can also be used in a training process. This application is not limited to application scenarios.

[0103] Figure 5 This is an explanation of the loss function calculation method provided by this application. The loss function is designed to take into account both the current BG value and the BG change trend. During the training iteration process, the training data set will be split into multiple batch sizes, such as (a) a batch of five BG data points or (b) a batch of ten BG data points. The MSE of the BG value and the fluctuation trend are calculated at the same time, and the loss function provides a weighted value for model training and iteration. The loss value can be calculated with different batch sizes each time, and the continuity of the BG data points is retained in each batch. Three trend value calculation methods are provided in each batch, namely, calculating the head and tail trends, the compromise trend, and the average trend. The trend fluctuations of each batch can be comprehensively calculated, and then the results can be used to call back to change the model parameters.

[0104] Specifically, the derivation process of BG trend under different sliding windows provided in this application is as follows:

[0105] BG fluctuations encompass both small changes over short periods of time and major trends over longer periods, necessitating a holistic approach to capture the overall dynamics of BG changes. Therefore, during the trend calculation process for each BG data point, different sliding window sizes of 15 minutes, 30 minutes, 45 minutes, 60 minutes, 75 minutes, and 90 minutes were used as examples. During the BG monitoring period, two different BG trend calculation methods were used to comprehensively assess BG fluctuations.

[0106] (1) The first method of calculating BG trend:

[0107] The first BG trend calculation method considers the overall fluctuations among all data points within a sliding time window. This is illustrated using a 15-minute sliding window. To calculate the BG trend for BG(tn) (i.e., the nth blood glucose value at the time of the nth data point), expressed as Trand15 min(tn), a 15-minute sliding window is first created with tn as the center. The overall trend value of BG(tn) within the 15-minute window is then used to calculate the average BG trend for each data point within the sliding window. The algorithm for calculating the trend for each data point within the sliding window is to subtract the BG value at the previous moment from the next, then divide by the time difference between the two data points. Finally, the trend values for all data points within the sliding window are weighted and averaged to obtain the overall trend value for Trand15 min(tn). For example, to calculate the trend value for Trand15 min(t2), the trend values for BG(t1), BG(t2), and BG(t3) within the 15-minute sliding window at t2 are calculated separately. Trand15 minutes (t2) is expressed as:

[0108]

[0109] Similarly, for t3, t4, and tn, the overall trends of Trand15 min(t3), Trand15 min(t4), and Trand15 min(tn) are expressed as:

[0110]

[0111] Where Swin is the number of BG data points contained in the sliding window. In this illustration, Swin for a 15-minute sliding window is ~3 data points. Therefore, the overall trend of BG data points for 30-minute, 45-minute, 60-minute, 75-minute, and 90-minute sliding windows is calculated as follows:

[0112]

[0113]

[0114] (2) The second BG trend calculation method:

[0115] The second method for calculating the BG trend takes into account the average trend between the BG data points in the first and second halves of the sliding window. Take a sliding window size of 15 minutes as an example. When calculating the Trand15 min(tn) of BG(tn), first create a 15-minute sliding window with tn as the center time. Then calculate the average BG trend of the first and second halves of the 15-minute sliding window and use it as the overall trend value of BG(tn) within the 15-minute scale. The algorithm for calculating the trend of the first and second halves is to use the average BG value of the first half minus the BG value of the second half, and then divide it by the average time difference between the first and second halves. For example, Trand15 min(t2) is expressed as:

[0116]

[0117] Similarly, for t3, t4, and tn, the overall trends of Trand15 min(t3), Trand15 min(t4), and Trand15 min(tn) are expressed as

[0118]

[0119] Where Swin is the number of BG data points contained in the sliding window, tforward is the average time of the forward BG data, and tbackward is the mean of the backward BG data. The overall trend of the BG data points for the 30-minute, 45-minute, 60-minute, 75-minute, and 90-minute sliding windows is calculated as follows:

[0120]

[0121]

[0122] In summary, the average of the two calculated BG trends is used as the trend value for continuous BG monitoring. Using a 15- to 90-minute scanning window as an example, the average trend of BG data points before and after each measurement is independently calculated, thereby deriving BG fluctuation trend values corresponding to different time scales. This composite trend indicator integrates the average fluctuations across different timeframes, providing a smooth representation of both small and large BG fluctuations for each measurement. In practical applications, the different window times can be adjusted based on the monitoring time of different blood glucose data points in the dataset.

[0123] The dataset validation model method provided in this application is as follows:

[0124] This application uses 15-minute, 45-minute, and 90-minute time windows as examples to evaluate the accuracy of blood glucose trends on a dataset using the concepts of sliding windows and the blood glucose trend calculation method proposed in the application. Different time windows can provide different references for determining blood glucose trends.

[0125] Figure 6 This is a Clark plot of the BG trend for all subjects in the dataset over a 15-minute scanning window. The majority of the BG trend data in the training dataset is distributed in region A, with a small portion distributed in regions B and D.

[0126] Figure 7 This is a Clark plot of the BG trend for all subjects in the dataset over a 45-minute scanning window. The majority of BG trend data in the training dataset for all participants is distributed in region A, with a smaller number distributed in regions B and D.

[0127] Figure 8 This is a Clark plot of the BG trend for all subjects in the dataset over a 90-minute scanning window. The majority of BG trend data in the training dataset for all participants is distributed in region A, with a minority distributed in region B.

[0128] On the other hand, an embodiment of the present invention provides a continuous blood glucose prediction system that takes into account both blood glucose concentration and blood glucose trend, including:

[0129] The first module is used to obtain blood glucose data samples;

[0130] The second module is used to process the blood glucose data sample through a sliding time window and calculate the overall trend value of blood glucose;

[0131] The third module is used to input the blood glucose data sample into the blood glucose prediction model to obtain the predicted blood glucose concentration and the predicted blood glucose trend value;

[0132] The fourth module is used to train the blood glucose prediction model through a loss function based on the predicted blood glucose trend value and the overall trend value, the predicted blood glucose concentration and the corresponding blood glucose data sample to obtain a trained blood glucose prediction model, so as to continuously predict the blood glucose concentration and blood glucose trend through the blood glucose prediction model.

[0133] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0134] On the other hand, an embodiment of the present invention provides a continuous blood glucose prediction device that takes into account both blood glucose concentration and blood glucose trend, comprising:

[0135] at least one processor;

[0136] at least one memory for storing at least one program;

[0137] When the at least one program is executed by the at least one processor, the at least one processor implements the continuous blood glucose prediction method that takes both blood glucose concentration and blood glucose trend into consideration.

[0138] Similarly, the contents of the above method embodiments are applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0139] An embodiment of the present invention further provides a computer-readable storage medium storing a program executable by a processor. When the program is executed by the processor, it is used to perform the above-mentioned continuous blood glucose prediction method that takes into account both blood glucose concentration and blood glucose trend.

[0140] Similarly, the contents of the above method embodiments are applicable to the present storage medium embodiment. The functions specifically implemented by the present storage medium embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0141] In some optional embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided in an exemplary manner for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operation and logic flow presented herein. Optional embodiments are contemplated in which the order of the various operations is changed and the sub-operations described as a part of a larger operation are performed independently.

[0142] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. More specifically, given the properties, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the module will be understood within the ordinary skill of an engineer. Therefore, a person skilled in the art will be able to implement the present invention set forth in the claims using ordinary skill without undue experimentation. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0143] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several programs for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0144] The logic and / or steps represented in a flowchart or otherwise described herein, for example, may be considered as an ordered list of executable programs for implementing the logical functions, and may be embodied in any computer-readable medium for use by, or in conjunction with, a program execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can retrieve and execute a program from a program execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, a program execution system, apparatus, or device.

[0145] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.

[0146] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable program execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0147] In the above description of this specification, reference to the terms "one embodiment / example," "another embodiment / example," or "certain embodiments / examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0148] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the claims and their equivalents.

[0149] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A continuous blood glucose prediction method that takes into account both blood glucose concentration and blood glucose trend, characterized in that: The following steps are involved: Get blood glucose data samples; Processing the blood glucose data samples through a sliding time window and calculating an overall trend value of blood glucose; Inputting the blood glucose data sample into a blood glucose prediction model to obtain a predicted blood glucose concentration and a predicted blood glucose trend value; According to the predicted blood glucose trend value and the overall trend value, the predicted blood glucose concentration and the corresponding blood glucose data sample, the blood glucose prediction model is trained through a loss function to obtain a trained blood glucose prediction model, so as to continuously predict the blood glucose concentration and blood glucose trend through the blood glucose prediction model.

2. The continuous blood glucose prediction method taking into account both blood glucose concentration and blood glucose trend according to claim 1, characterized in that: The calculation of the overall trend value of blood sugar includes: Establish a sliding time window centered on the data time point; Determine the blood glucose trend at each data time point within the sliding time window, and then determine the overall trend value; Alternatively, the blood glucose trend of the preceding and following data time points within the sliding time window is determined, and then the overall trend value is determined.

3. The continuous blood glucose prediction method taking into account both blood glucose concentration and blood glucose trend according to claim 2, characterized in that: Determining the blood glucose trend at each data time point within the sliding time window, and then determining the overall trend value, includes: Determine the blood sugar trend at each data time point based on the blood sugar value at the next moment and the blood sugar value at the previous moment; The blood glucose trends of all data time points within the sliding time window are weighted and averaged to determine the overall trend value.

4. The continuous blood glucose prediction method taking into account both blood glucose concentration and blood glucose trend according to claim 2, characterized in that: Determining the blood glucose trend of the preceding and following data time points within the sliding time window, and then determining the overall trend value, includes: determining a second blood glucose trend according to the average blood glucose value in the first half and the average blood glucose value in the second half of the sliding time window; The overall trend value is determined according to the second blood glucose trend.

5. The continuous blood glucose prediction method taking into account both blood glucose concentration and blood glucose trend according to claim 1, characterized in that: The loss function is constructed by the following steps: dividing the blood glucose data samples into a plurality of batches; determining a different batch trend value for each batch based on different trend calculation methods; Constructing a trend function in the loss function according to the different batch trend values; A loss function is determined according to the trend function and the concentration function.

6. The continuous blood glucose prediction method taking into account both blood glucose concentration and blood glucose trend according to claim 5, characterized in that: Determining different batch trend values for each batch based on different trend calculation methods includes: determining a first and last trend value of the batch based on a first data point and a last data point in the batch; Alternatively, determining a compromise trend value for the batch based on a first data point, a middle data point, and a last data point in the batch; Alternatively, an average trend value of the batch is determined based on each data point in the batch.

7. The continuous blood glucose prediction method taking into account both blood glucose concentration and blood glucose trend according to claim 6, characterized in that: The step of constructing a trend function in a loss function according to the different batch trend values includes: Determine a first trend item based on the head and tail trend values by using a mean square error; Determining a second trend term based on the compromise trend value by using a mean square error; Determining a third trend term based on the average trend value by using a mean square error; A trend function is determined according to the first trend item, the second trend item, and the third trend item.

8. A continuous blood glucose prediction system that takes into account both blood glucose concentration and blood glucose trend, characterized in that: include: The first module is used to obtain blood glucose data samples; The second module is used to process the blood glucose data sample through a sliding time window and calculate the overall trend value of blood glucose; The third module is used to input the blood glucose data sample into the blood glucose prediction model to obtain the predicted blood glucose concentration and the predicted blood glucose trend value; The fourth module is used to train the blood glucose prediction model through a loss function based on the predicted blood glucose trend value and the overall trend value, the predicted blood glucose concentration and the corresponding blood glucose data sample to obtain a trained blood glucose prediction model, so as to continuously predict the blood glucose concentration and blood glucose trend through the blood glucose prediction model.

9. A continuous blood glucose prediction device that takes into account both blood glucose concentration and blood glucose trend, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the continuous blood glucose prediction method taking into account both blood glucose concentration and blood glucose trend as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement the continuous blood glucose prediction method taking into account both blood glucose concentration and blood glucose trend as claimed in any one of claims 1 to 7 when executed by the processor.