Blood glucose prediction method, system and device and storage medium
Through data filling and cleaning, combined with deep learning model and Kalman filtering processing, the problems of data incompleteness and outliers in blood glucose prediction are solved, and the accuracy of prediction results and model accuracy are improved.
Patent Information
- Application Number
- CN202411086414.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-31
AI Technical Summary
Existing methods for predicting blood glucose concentrations perform poorly when dealing with missing data and outliers, resulting in inaccurate prediction results, especially when data are incomplete, insufficient sample size or low feature correlation.
By obtaining prediction data, extracting data features, filling and cleaning data, forming a complete data set, and using blood glucose prediction models of long and short memory network layer, Transformer encoder layer and multi-layer perceptron layer for prediction, combined with Kalman filtering processing Data completion.
It improves the completeness and consistency of the data, enhances the accuracy of the prediction model, improves the accuracy of blood sugar prediction results, and better captures complex patterns and long-term dependencies in blood sugar concentration changes.
Smart Images

Figure CN119226693A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a blood sugar prediction method, system, device and storage medium. Background Art
[0002] Existing methods for predicting blood glucose concentration mainly rely on traditional machine learning and data analysis techniques. In recent years, artificial intelligence technology has developed rapidly, and various models have emerged, from shallow machine learning based on statistical analysis to deep learning that relies on powerful computing power. Although deep learning models have powerful feature extraction and modeling capabilities, they are also more dependent on data, especially when dealing with missing data and outliers. These models can usually provide relatively accurate predictions under ideal conditions with complete data, sufficient sample size, and high feature correlation. However, data in real life is often full of randomness and uncertainty, resulting in inaccurate prediction results; in addition, the accuracy of the prediction model is low. Summary of the invention
[0003] In view of this, in order to solve one of the above problems, the purpose of the embodiments of the present invention is to provide a blood glucose prediction method, system, device and storage medium, which can improve the integrity and consistency of data, improve the accuracy of the prediction model, and improve the accuracy of the prediction results.
[0004] In one aspect, an embodiment of the present invention provides a blood sugar prediction method, comprising:
[0005] Acquire prediction data, extract data features of the prediction data, and obtain a first data set;
[0006] Performing data filling and data cleaning on the first data set to obtain a second data set;
[0007] The second data set is input into a blood glucose prediction model to obtain predicted blood glucose; the blood glucose prediction model includes a long short-term memory network layer, a Transformer encoder layer and a multi-layer perceptron layer.
[0008] Optionally, extracting data features of the prediction data to obtain a first data set includes:
[0009] Extracting data features that affect blood sugar changes in the predicted data; the data features include blood sugar concentration and insulin information;
[0010] The data features are converted into a preset time format at preset time intervals, and missing values are retained to form a first data set.
[0011] Optionally, the insulin information includes a rate of continuous infusion of basal insulin and a temporary basal insulin injection amount, and the filling of the first data set includes:
[0012] forward filling missing values for the rate of the basal insulin continuous infusion;
[0013] According to the time index, the temporary basal insulin injection volume is filled with the first effective injection volume.
[0014] Optionally, the data cleaning includes:
[0015] If there are multiple sets of data at the same time, the maximum value among the multiple sets of data is taken as the valid data, and the other sets of data are eliminated.
[0016] Optionally, the method comprises:
[0017] Performing a first marking on discontinuous time intervals and a second marking on connected time intervals;
[0018] The time index is converted into a preset time sequence according to the first mark and the second mark.
[0019] Optionally, the training method of the blood glucose prediction model includes:
[0020] Acquire a sample data set, extract a first data sample feature of the sample data set, and form a first sample set;
[0021] Performing data filling and data cleaning on the first sample set to obtain a second sample set;
[0022] Performing data completion on the second sample set to obtain a third sample set;
[0023] The third sample set is divided into a training set and a test set, the blood glucose prediction model is trained by the training set, and the blood glucose prediction model is tested by the test set until the preset requirements are met.
[0024] Optionally, the second sample set includes blood glucose monitoring data samples, and the data completion of the second sample set to obtain the third sample set includes:
[0025] Kalman filtering is used to complete the blood glucose monitoring data samples to obtain a third sample set.
[0026] On the other hand, an embodiment of the present invention provides a blood sugar prediction system, comprising:
[0027] The first module is used to obtain prediction data, extract data features of the prediction data, and obtain a first data set;
[0028] A second module is used to fill and clean the first data set to obtain a second data set;
[0029] The third module is used to input the second data set into the blood glucose prediction model to obtain predicted blood glucose; the blood glucose prediction model includes a long short-term memory network layer, a Transformer encoder layer and a multi-layer perceptron layer.
[0030] On the other hand, an embodiment of the present invention provides a blood sugar prediction device, comprising:
[0031] at least one processor;
[0032] at least one memory for storing at least one program;
[0033] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0034] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to perform the above method.
[0035] Implementation of the embodiments of the present invention includes the following beneficial effects: first, obtaining predicted data and extracting data features of the predicted data to obtain a first data set, extracting feature data to reduce the amount of data calculation and improve data validity; then, performing data filling and data cleaning on the first data set to obtain a second data set, filling the predicted data improves data integrity, and cleaning the predicted data improves data consistency; inputting the second data set into a blood glucose prediction model to obtain predicted blood glucose; the blood glucose prediction model includes a long short-term memory network layer, a Transformer encoder layer, and a multi-layer perceptron layer, and the blood glucose prediction model better captures complex patterns and long-term dependencies in changes in blood glucose concentration, thereby improving the accuracy of model predictions; the validity, integrity and consistency of the data, as well as the accuracy of the model, together further improve the accuracy of the prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a schematic diagram of the steps of a blood sugar prediction method provided by an embodiment of the present invention;
[0037] Figure 2 is a schematic diagram of the steps of another blood sugar prediction method provided by an embodiment of the present invention;
[0038] Figure 3 is a schematic diagram of the structure of a long short-term memory network provided by an embodiment of the present invention;
[0039] Figure 4 It is a schematic diagram of a deep learning model prediction result and an RTS smoothing result provided by an embodiment of the present invention;
[0040] Figure 5 is a schematic diagram of obtaining overall fluctuations according to a sliding window provided by an embodiment of the present invention;
[0041] Figure 6 is a schematic diagram of a Clark error network analysis provided by an embodiment of the present invention;
[0042] Figure 7 is a schematic diagram of a Parkes error network analysis provided by an embodiment of the present invention;
[0043] Figure 8 is a structural block diagram of a blood sugar prediction system provided by an embodiment of the present invention;
[0044] Fig. 9 It is a structural block diagram of a blood sugar prediction device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only provided for the convenience of explanation and description, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0046] like Figure 1 As shown, an embodiment of the present invention provides a blood sugar prediction method, comprising:
[0047] S100: Acquire prediction data, extract data features of the prediction data, and obtain a first data set.
[0048] Prediction data refers to existing data used for blood sugar prediction, which can be data collected from public data sets or users. Data features refer to indicator data that have a direct or indirect impact on blood sugar changes, such as the detected blood sugar concentration or the amount of insulin injected.
[0049] Prediction data is obtained through public channels or data collection, and data features that affect blood sugar changes in the prediction data are extracted to obtain a first data set.
[0050] S200: performing data filling and data cleaning on the first data set to obtain a second data set.
[0051] Data filling refers to filling missing data in the first data set according to a certain rule, for example, filling missing data according to a time interval. Data cleaning refers to cleaning interference data in the first data set according to a certain rule, for example, cleaning duplicate data or abnormal data in the first data set.
[0052] The data in the first data set is filled according to a certain rule, and the first data set after the data filling is cleaned of abnormal data or duplicate data to obtain a second data set.
[0053] S300, inputting the second data set into a blood glucose prediction model to obtain predicted blood glucose; the blood glucose prediction model includes a long short-term memory network layer, a Transformer encoder layer, and a multi-layer perceptron layer.
[0054] The blood sugar prediction model is used to predict the blood sugar data of the future time period based on the existing blood sugar data. The blood sugar prediction model needs to be trained before it is used for prediction. After the training meets the requirements, it can be used for prediction. Figure 2 The blood glucose prediction model includes a long short-term memory network layer, a Transformer encoder layer and a multi-layer perceptron layer. The number and number of long short-term memory network layers, Transformer encoder layers and multi-layer perceptron layers are determined according to actual applications, and this embodiment does not impose specific restrictions.
[0055] Optionally, extracting data features of the prediction data to obtain a first data set includes:
[0056] S110, extracting data features that affect blood sugar changes in the predicted data; the data features include blood sugar concentration and insulin information;
[0057] S120: Convert the data features into a preset time format at preset time intervals and retain missing values to form a first data set.
[0058] See also Figure 2 In a specific embodiment, an open source data set in the xml file format is loaded and parsed. Specifically, the data set file is loaded and data features are extracted. The data features include blood glucose concentration and insulin information. The blood glucose concentration includes the blood glucose concentration continuously detected by wearing CGM (one point every 5 minutes) and the blood glucose concentration of the patient self-detected by finger blood. The insulin information includes the rate of continuous injection of basal insulin, the temporary basal insulin injection amount and the time when the injection ends, etc. The data features also include other data, such as the amount of insulin injected before meals or during high blood sugar, carbohydrate intake, etc. These data features are generally considered to have the most direct impact on blood glucose changes. Parse the date string into a datetime object, calculate the time interval between adjacent timestamps, and convert them to a unified time format. Merge the data of all modes into a DataFrame, and retain NaN to represent missing data.
[0059] Optionally, the insulin information includes a rate of continuous infusion of basal insulin and a temporary basal insulin injection amount, and data filling is performed on the first data set, including:
[0060] S210, forward filling the missing value of the rate of basal insulin continuous infusion;
[0061] S220: According to the time index, the temporary basal insulin injection volume is filled with the first effective injection volume.
[0062] See also Figure 2 In a specific embodiment, the default value of the rate of continuous infusion of basal insulin is filled forward, that is, if NaN exists, it will be filled with the previous non-NaN value. The default value of the temporary basal insulin injection amount is marked with -1, and the time period of temporary basal insulin injection is indexed by time, and the first non-1 value is used to fill NaN until the injection time ends, ensuring that the injection amount value is continuously applied to the data column during the temporary basal insulin injection period.
[0063] Optionally, data cleaning, including:
[0064] S230: If there are multiple sets of data at the same time, the maximum value among the multiple sets of data is taken as valid data, and other sets of data are discarded.
[0065] See also Figure 2 In a specific embodiment, for samples that appear repeatedly at the same time, the maximum value among these data is retained, and other invalid data groups are deleted.
[0066] Optionally, the blood sugar prediction method comprises:
[0067] S240, performing a first mark on the discontinuous time intervals, and performing a second mark on the connected time intervals;
[0068] S250: Convert the time index into a preset time sequence according to the first mark and the second mark.
[0069] See also Figure 2 In a specific embodiment, the intervals of timestamps in the data are recorded, and then discontinuous intervals (not consistent with the expected sampling period of 5 minutes) are recorded in a new column, while continuous intervals are marked with 0. In order to conform to the format that can be read by machine learning, the time index is converted; the date is removed, the first sample of the day is used as the starting point, and the moment value is converted to a time series expressed in minutes.
[0070] Optionally, the training method of the blood glucose prediction model includes:
[0071] S010, obtaining a sample data set, extracting a first data sample feature of the sample data set, and forming a first sample set;
[0072] S020, performing data filling and data cleaning on the first sample set to obtain a second sample set;
[0073] S030, completing data on the second sample set to obtain a third sample set;
[0074] S040. Divide the third sample set into a training set and a test set, use the training set to train the blood glucose prediction model, and use the test set to test the blood glucose prediction model until the preset requirements are met.
[0075] See also Figure 2 During the training process, the methods of data feature extraction, data filling and data cleaning can adopt the methods in the prediction process. Data completion refers to completing the data of important indicators in the second sample according to the law of data change, such as completing the detected blood glucose data. During the training process, the preset requirements are determined according to the actual application, and this embodiment does not make specific restrictions; for example, the number of training times reaches the requirements, such as 10,000 times, or the training accuracy reaches the requirements, such as 95%.
[0076] Optionally, the second sample set includes blood glucose monitoring data samples, and the second sample set is supplemented with data to obtain a third sample set, including:
[0077] S031. Use Kalman filtering to complete the blood glucose monitoring data samples to obtain a third sample set.
[0078] Missing values often occur in CGM data. Kalman filtering can fill in the missing data by estimating the missing data. Kalman filtering is a linear filter based on recursive estimation, which is widely used in state estimation and correction of time series data. It updates the state estimate by combining the prior estimate (predicted value) and the current observation value to calibrate the data. The processing process consists of 4 steps. The first step is initialization, setting the initial value according to the mean and variance of the historical data, setting the initial state estimate and the initial error covariance The second step, prediction, is used to infer the current state based on the system model and the state estimate at the previous moment. The core of the prediction step is to use the system model to predict the current state and its uncertainty. Specifically, at each time step, the state estimate and error covariance at the previous moment are used to predict the state and error covariance.
[0079] First, the state prediction is performed using the state transfer equation.
[0080]
[0081] The state prediction equation (Formula 1) is used to predict the system state at the current moment. represents the predicted state at time k; F represents the state transfer matrix, which describes the change of the system state from time k-1 to time k; represents the posterior state estimate at time k-1; B represents the control input matrix, describing the control input u k Impact on status; u k represents the control input, i.e. the control signal provided externally. Then the error covariance prediction equation is used to predict the error covariance.
[0082]
[0083] The error covariance prediction equation (Formula 2) is used to calculate the estimated error of the predicted state, Represents the prediction error covariance matrix at time k; Represents the posterior error covariance matrix at time k-1; Q represents the process noise covariance matrix, which describes the uncertainty introduced by the system during the state transfer process. The third step is update. The update step is used to correct the predicted state in combination with the current observation value to obtain a more accurate state estimate. If there is an observation value at the current moment, the state and error covariance are updated. If there is no observation value at the current moment, the update step is skipped and only the prediction is performed. Specifically, the Kalman gain needs to be calculated first. The Kalman gain is an important parameter used to weigh the predicted value and the observed value.
[0084] K k =P k|k-1 H T (HP K|K-1 H T +R) -1 (3)
[0085] Kalman gain (Formula 3) is an important parameter used to weigh the predicted value and the observed value, which determines the weight distribution of the predicted value and the observed value during the update. k Represents the Kalman gain at time k. H is the observation matrix, which describes the relationship between the system state and the observation value. R is the observation noise covariance matrix, which describes the uncertainty in the observation process. The state update equation is then used to correct the predicted state.
[0086]
[0087] The state update (Equation 4) corrects the predicted state by multiplying the residual by the Kalman gain to obtain a more accurate posterior state estimate, represents the posterior state estimate at time k, Z k The observed value at time k, Represents the residual, which is the difference between the observed value and the predicted observed value. Finally, the error covariance update equation is used to correct the prediction error covariance.
[0088] P k|k =(IK k H)P k|k-1 (5)
[0089] The error covariance update (Formula 5) adjusts the forecast error covariance to reflect the updated uncertainty, P k|k Represents the posterior error covariance matrix at time k, and I is the unit matrix. The fourth step repeats the prediction and update steps until all data processing is completed. Among them, the prediction and update steps are the most critical. Specifically, the prediction step - predicts the state and error covariance at the current moment based on the state estimate at the previous moment. Then save it as a CSV file for subsequent deep learning reading or other statistical analysis.
[0090] See also Figure 3 Before the data is input into the network, a dimension needs to be added to the input tensor to adapt to the input format of the recurrent neural network. The specific network structure is as follows: first, there are two layers of unidirectional LSTM layers with 128*2 memory cells, which are used as a variant of the recurrent neural network to process time series data. An LSTM memory cell consists of four main parts: the forget gate F that determines which information in the memory cell state of the previous time step needs to be forgotten. t ; Determine which new information of the current time step needs to be saved to the input gate I of the memory cell state t ; Update the memory cell C of the memory cell state according to the results of the forget gate and the input gate t and the output gate O that determines the output of the current time step t Specifically, when x t is the input of the current time step, H t-1 is the output (hidden state) of the previous time step, C t-1 When is the memory cell state of the previous time step, the forget gate, input gate, memory cell state update and output gate are shown in formula (6-11).
[0091] F t =σ(w f ·[h t-1 ,x t ]+b f ) (6)
[0092] I t =σ(w i ·[h t-1 ,x t ]+b i ) (7)
[0093]
[0094] O t =σ(w o ·[h t-1 ,x t ]+bo ) (10)
[0095] H t =O t tanh(C t ) (11)
[0096] in, represents the candidate memory element, w f 、w i 、w c 、w o represents the weight matrix and b f , b i , b c , b o represents the bias term. σ is the sigmoid activation function (σ(x)=(1+e -x ) -1 ), tanh is the tanh activation function (tanh(x)=2σ(2x)-1). There is a dropout layer with a random inactivation rate of 50% between the two LSTMs to increase the robustness of the model. Next, a 128*2 two-headed attention mechanism and a feedforward neural network are used to form a Transformer encoder layer to learn the global dependencies and longer-range information interactions of the input sequence. The two-headed attention mechanism is a parallel operation of two self-attention mechanisms, allowing the model to simultaneously focus on different representations of different positions in the input sequence. The feedforward neural network is used to perform further nonlinear transformation and feature extraction on the representation of each position after the attention mechanism. There are residual connections and layer normalization after the feedforward network, which help stabilize the training process and accelerate convergence. Subsequently, a dropout layer is passed through, and random inactivation with a probability of 50% is performed again. Finally, the tensor added when the input data is removed, and the result is passed to the multilayer perceptron (MLP). The MLP has two hidden layers and one output layer. The number of neurons is 512 and 128 respectively. The nonlinear activation function Mish is used between the hidden layers (Mish(x) = x·tanh(ln(1+e x ))), Compared with traditional activation functions, Mish activation function can bring better model performance and generalization ability.
[0097] Read the training and test data from the CSV file and standardize all features to zero mean and unit variance. Convert the processed features and label data (CGM values) into PyTorch tensors in preparation for training and testing. Use Smooth L1Loss as the loss function and the AdamW optimizer for parameter optimization. The learning rate is set to 0.001, the weight decay is set to 0.0001, and the batch size is set to 256. Perform tens of thousands of iterations, perform RTS smoothing on the model output, and the processing result is regarded as the predicted value of blood glucose concentration. The RTS smoother is a backward smoothing algorithm based on Kalman filtering that optimizes the state estimate at the current moment by utilizing future observation data, and is particularly suitable for offline data processing. The overall process is divided into standard forward filtering using the Kalman filter and forward filtering and smoothing of state estimation using backward recursion. The forward filtering process is shown in formula (1-5). After the forward filtering is completed, backward smoothing is performed. First, calculate the smoothing gain A k , which is used to combine the posterior state estimate of the forward filter and the smoothed state estimate.
[0098]
[0099] Among them, F T is the transpose of the state transfer matrix. Next, the smoothed state estimate is obtained by estimating the posterior state based on the smoothing gain and forward filtering.
[0100]
[0101] Finally, by combining the posterior error covariance of the forward filter and the smoothed state covariance at time k+1, the smoothed state covariance P at time k after smoothing is obtained. k|N .
[0102]
[0103] Formula (12-14) is the backward smoothing process, which means starting from the last time point, the smoothed state estimate of each time point is calculated step by step. This stage uses the results of the forward filtering stage to combine the forward and backward information through the smoothing gain. k|k represents the updated state covariance matrix at time k, and P k+1|N They are the posterior state estimate at time k+1 and the smoothed error covariance matrix. Through the RTS smoother, the state estimate can be further optimized on the basis of Kalman filtering to achieve the purpose of improving the accuracy of blood glucose prediction.
[0104] In a specific embodiment, the OhioT1DM dataset is obtained, which contains 8 weeks of continuous blood glucose monitoring, insulin, physiological sensors, and self-reported life event data for each of 12 patients with type 1 diabetes. The data released in 2018 included 4 women and 2 men, while the data released in 2020 included 5 men and 1 woman. The continuous blood glucose monitoring data is recorded every 5 minutes, but due to various uncontrollable factors, there are a lot of missing or abnormal data. Using the method of the present invention, the data of one of the patients was randomly selected for training, and the mean absolute relative difference (MARD) of some days in the test data set was within 10%, and the results are as follows. Figure 4 The deep learning prediction results and RTS smoothing results are shown. By comparing the deep learning prediction results, RTS smoothing results and the test set reference values, it can be seen that the RTS smoothing results fit the reference values well at most time points, indicating that the RTS smoother can effectively reduce the prediction error and improve the prediction accuracy. Figure 5 In the experiment, a sliding window with a window size of 10 was established, and the average derivative of blood glucose concentration with respect to time in the window was calculated. The overall fluctuation was obtained by sliding the window in sequence. The results showed that the fluctuation trend of the reference value and the smoothed blood glucose value was consistent, indicating that the RTS smoothing process performed well in maintaining the trend of blood glucose changes. The sliding window average derivative analysis further verified the reliability of the smoothed blood glucose value in dynamic changes. Figure 6 shows Clarke error network analysis, Figure 7 Parkes error network analysis is presented. Error grid analysis is used to quantify the risk of blood glucose measurements or predictions to blood glucose management in diabetic patients. By comparing these estimates with the exact values, results in areas A to E are obtained, where A represents a medically accurate result, B represents a medically acceptable result, C represents unnecessary treatment, D represents failure to detect a dangerous situation, and E represents mistaking severe hypoglycemia for hyperglycemia, or vice versa. According to Clarke's error network analysis, more than 95% of the point prediction values fall within area A, and almost all samples do not exceed area B, indicating that the errors of most prediction results are within an acceptable range and the clinical practicality of the prediction model is high. At the same time, according to the results of Parkes' error network analysis, the consistency of the results of the two devices was compared, and all sample points were still in areas A and B, further illustrating the high prediction accuracy and good clinical applicability of the model.
[0105] Implementation of the embodiments of the present invention includes the following beneficial effects: first, obtaining predicted data and extracting data features of the predicted data to obtain a first data set, extracting feature data to reduce the amount of data calculation and improve data validity; then, performing data filling and data cleaning on the first data set to obtain a second data set, filling the predicted data improves data integrity, and cleaning the predicted data improves data consistency; inputting the second data set into a blood glucose prediction model to obtain predicted blood glucose; the blood glucose prediction model includes a long short-term memory network layer, a Transformer encoder layer, and a multi-layer perceptron layer, and the blood glucose prediction model better captures complex patterns and long-term dependencies in changes in blood glucose concentration, thereby improving the accuracy of model predictions; the validity, integrity and consistency of the data, as well as the accuracy of the model, together further improve the accuracy of the prediction results.
[0106] See also Figure 8 , an embodiment of the present invention provides a blood sugar prediction system, comprising:
[0107] The first module is used to obtain prediction data, extract data features of the prediction data, and obtain a first data set;
[0108] The second module is used to fill and clean the first data set to obtain a second data set;
[0109] The third module is used to input the second data set into the blood glucose prediction model to obtain predicted blood glucose; the blood glucose prediction model includes a long short-term memory network layer, a Transformer encoder layer and a multi-layer perceptron layer.
[0110] 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.
[0111] See also Fig. 9 , an embodiment of the present invention provides a blood sugar prediction device, comprising:
[0112] at least one processor;
[0113] at least one memory for storing at least one program;
[0114] When at least one program is executed by at least one processor, the at least one processor implements the above method.
[0115] Among them, the memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. The memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a remote memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0116] It can be seen that the contents of the above method embodiments are all 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.
[0117] In addition, the embodiment of the present application also discloses a computer program product or a computer program, and the computer program product or the computer program is stored in a computer-readable storage medium. The processor of the computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device performs the above method. Similarly, the contents in the above method embodiment are all applicable to the storage medium embodiment, and the functions specifically implemented by the storage medium embodiment are the same as those in the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method embodiment.
[0118] An embodiment of the present invention further provides a computer-readable storage medium, which stores a program executable by a processor. The program executable by the processor is used to implement the above method when executed by the processor.
[0119] It is understood that all or some steps and systems in the disclosed method above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0120] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may 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 this application.
Claims
1. A blood sugar prediction method, characterized in that: include: Acquire prediction data, extract data features of the prediction data, and obtain a first data set; Performing data filling and data cleaning on the first data set to obtain a second data set; The second data set is input into a blood glucose prediction model to obtain predicted blood glucose; the blood glucose prediction model includes a long short-term memory network layer, a Transformer encoder layer and a multi-layer perceptron layer.
2. The blood sugar prediction method according to claim 1, characterized in that: The step of extracting the data features of the predicted data to obtain a first data set includes: Extracting data features that affect blood sugar changes in the predicted data; the data features include blood sugar concentration and insulin information; The data features are converted into a preset time format at preset time intervals, and missing values are retained to form a first data set.
3. The blood sugar prediction method according to claim 2, characterized in that: The insulin information includes a rate of continuous infusion of basal insulin and a temporary basal insulin injection amount. The filling of the first data set includes: forward filling missing values for the rate of the basal insulin continuous infusion; According to the time index, the temporary basal insulin injection volume is filled with the first effective injection volume.
4. The blood sugar prediction method according to claim 3, characterized in that: The data cleaning includes: If there are multiple sets of data at the same time, the maximum value among the multiple sets of data is taken as the valid data, and the other sets of data are eliminated.
5. The blood sugar prediction method according to claim 4, characterized in that: The method comprises: Performing a first marking on discontinuous time intervals and a second marking on connected time intervals; The time index is converted into a preset time sequence according to the first mark and the second mark.
6. The blood sugar prediction method according to any one of claims 1 to 5, characterized in that: The training method of the blood sugar prediction model comprises: Acquire a sample data set, extract a first data sample feature of the sample data set, and form a first sample set; Performing data filling and data cleaning on the first sample set to obtain a second sample set; Performing data completion on the second sample set to obtain a third sample set; The third sample set is divided into a training set and a test set, the blood glucose prediction model is trained by the training set, and the blood glucose prediction model is tested by the test set until the preset requirements are met.
7. The blood sugar prediction method according to claim 6, characterized in that: The second sample set includes blood glucose monitoring data samples, and the data completion of the second sample set to obtain a third sample set includes: Kalman filtering is used to complete the blood glucose monitoring data samples to obtain a third sample set.
8. A blood sugar prediction system, characterized in that: include: The first module is used to obtain prediction data, extract data features of the prediction data, and obtain a first data set; A second module is used to fill and clean the first data set to obtain a second data set; The third module is used to input the second data set into the blood glucose prediction model to obtain predicted blood glucose; the blood glucose prediction model includes a long short-term memory network layer, a Transformer encoder layer and a multi-layer perceptron layer.
9. A blood sugar prediction device, 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 method according to 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 perform the method according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Patent Citations
Blood glucose prediction method and device
CN108766578A
Night blood glucose prediction model construction method based on deep multi-task learning
CN117976229A
Systems and methods for prediction of glycemia and decisions support
WO2019129857A1
