Personalized blood glucose prediction method, device and equipment based on directional representation learning
Through the neural network model based on direction characterization learning, the problems of inaccurate blood glucose prediction and poor generalization ability in the prior art are solved, and more accurate and personalized blood glucose prediction are achieved.
Patent Information
- Application Number
- CN202510299210.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-07-01
AI Technical Summary
Existing blood glucose prediction technologies are difficult to capture personalized dynamics and deal with complex nonlinear dynamics and temporal relationships, resulting in inaccurate predictions and poor generalization capabilities.
A neural network model based on direction characterization learning is adopted. By obtaining the target user's blood sugar timing data and variable timing data that affects blood sugar, the pre-trained personalized blood sugar prediction model is input to generate blood sugar prediction values in the future time period.
It achieves more accurate blood sugar prediction, can better adapt to individual differences, has strong ability to promote across data sets and dynamic adaptability, significantly improving the accuracy of prediction.
Smart Images

Figure CN120236757A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of machine learning, and particularly to a personalized blood glucose prediction method, device, and equipment based on directional representation learning. Background Art
[0002] Diabetes is a chronic disease characterized by chronically elevated blood glucose levels above the normal range. Against the backdrop of the increasing global prevalence of diabetes, blood glucose management has become increasingly crucial for preventing complications and improving patients' quality of life.
[0003] However, the inherent variability and unpredictability of blood glucose levels, influenced by complex factors such as diet, exercise, medications, and stress, pose significant challenges to diabetes management. With the advancement of medical technology and the availability of continuous glucose monitoring (CGM) data, these challenges have become even more prominent. Therefore, accurate and reliable blood glucose prediction is essential for optimizing treatment regimens and reducing the risk of blood glucose fluctuations.
[0004] Previous blood glucose prediction techniques have the following drawbacks: 1. Traditional methods (such as ARIMA, linear regression, etc.) rely on simple statistical models or classical machine learning algorithms. Although easy to implement, they ignore the physiological differences among individuals, often fail to capture personalized dynamics, and are difficult to handle complex non-linear dynamics and temporal relationships, resulting in inaccurate predictions and poor generalization ability. 2. Machine learning and deep learning techniques mostly rely on large-scale general datasets. However, in clinical practice, patient data is usually sparse, and the contradiction between the need for large-scale data and the actual availability of data is difficult to reconcile, and it is difficult to optimize for individual differences, resulting in insufficient sensitivity in predicting sensitive events such as rapid blood glucose fluctuations and the inability to effectively capture extreme situations. 3. Encoder-Only architecture models have limited utilization of physiological factors and lifestyle data, and cannot fully capture changes in key variables such as diet, exercise, and medication dosage, making it difficult to generate accurate prediction results. Summary of the Invention
[0005] The objective of this application is to provide a personalized blood glucose prediction method, device, electronic equipment, and storage medium based on directional representation learning, which can perform personalized blood glucose prediction with high accuracy.
[0006] In a first aspect, an embodiment of this application provides a personalized blood glucose prediction method based on directional representation learning, including:
[0007] Obtain the blood glucose time series data of a target user within a historical time period and the variable time series data affecting the blood glucose of the target user;
[0008] After preprocessing the blood glucose time series data and the variable time series data, input them into a pre-trained personalized blood glucose prediction model to obtain the blood glucose prediction values of the target user within a set future time period;
[0009] Among them, the personalized blood glucose prediction model is obtained by training a neural network based on directional representation learning with historical diabetes case time series data, and the historical diabetes case time series data includes blood glucose time series data samples of each historical diabetes case and variable time series data samples that affect the blood glucose of the historical diabetes case.
[0010] In some embodiments of the present application, the personalized blood glucose prediction model is pre-trained in the following manner:
[0011] Obtain the blood glucose monitoring data of each historical diabetes case and the variable data that affect the blood glucose of the historical diabetes case, and count them as time series with the same time interval. Combine the blood glucose monitoring data and variable data within all time intervals to obtain historical diabetes case time series data;
[0012] Perform sliding window segmentation on the historical diabetes case time series data, divide the historical diabetes case time series data into multiple supervised learning samples, and use the input and output of each time window as the input and target output of the model respectively;
[0013] Sample the multiple supervised learning samples using variance-aware stratified sampling to obtain training samples;
[0014] Input the training samples into the neural network based on directional representation learning for training, and obtain the personalized blood glucose prediction model after reaching the preset training cut-off condition.
[0015] In some embodiments of the present application, the step of sampling the multiple supervised learning samples using variance-aware stratified sampling to obtain training samples includes:
[0016] For each input time window of each historical diabetes case, calculate the variance of its blood glucose value, and the variance reflects the severity of blood glucose changes within the input time window;
[0017] Divide all time windows into multiple layers according to the variance. In each training iteration, sample a fixed number of time windows from each layer to ensure that the training batch contains blood glucose patterns with different variance levels.
[0018] In some embodiments of the present application, the preprocessing includes at least one of maximum value processing, minimum value processing, data averaging, and normalization processing.
[0019] In some embodiments of the present application, the personalized blood glucose prediction model includes a direction representation module, an encoder, a decoder, a projection layer, and a residual connection layer connected in sequence;
[0020] The direction representation module includes a sample representation unit, a time representation unit, and a splicing unit; the sample representation unit is used to extract the representation data of the time series data in the sample dimension, the time representation unit is used to extract the representation data of the time series data in the time dimension, and the splicing unit is used to perform residual addition on the time series data and its representation data in the sample dimension and time dimension to obtain combined data;
[0021] The encoder is used to convert the combined data into a high-dimensional vector representation;
[0022] The decoder is used to convert the high-dimensional vector representation into a potential high-dimensional vector representation;
[0023] The projection layer is used to convert the high-dimensional output of the decoder into a first predicted value of a one-dimensional time series;
[0024] The residual connection layer is used to directly generate a second predicted value from historical observations, perform a residual operation on the first predicted value and the second predicted value, and generate a final blood glucose predicted value.
[0025] In a second aspect, an embodiment of the present application provides a personalized blood glucose prediction device based on direction representation learning, including:
[0026] An acquisition module, configured to acquire the blood glucose time series data of a target user within a historical time period and the variable time series data affecting the blood glucose of the target user;
[0027] A prediction module, configured to preprocess the blood glucose time series data and the variable time series data, and then input them into a pre-trained personalized blood glucose prediction model to obtain the blood glucose predicted value of the target user within a set future time period;
[0028] Wherein, the personalized blood glucose prediction model is obtained by training a neural network based on direction representation learning with historical diabetes case time series data, and the historical diabetes case time series data includes the blood glucose time series data samples of each historical diabetes case and the variable time series data samples affecting the blood glucose of the historical diabetes case.
[0029] In some embodiments of the present application, the device further includes a training module, configured to pre-train the personalized blood glucose prediction model in the following manner:
[0030] Obtain the blood glucose monitoring data of each historical diabetes case and the variable data that affect the blood glucose of the historical diabetes case, and count them as time series with the same time interval. Combine the blood glucose monitoring data and variable data within all time intervals to obtain the time series data of historical diabetes cases;
[0031] Perform sliding window segmentation on the time series data of the historical diabetes cases, divide the time series data of the historical diabetes cases into multiple supervised learning samples, and use the input and output of each time window as the input and target output of the model respectively;
[0032] Sample the multiple supervised learning samples using the variance-aware stratified sampling method to obtain training samples;
[0033] Input the training samples into the neural network based on directional representation learning for training, and obtain the personalized blood glucose prediction model after reaching the preset training cut-off condition.
[0034] In some embodiments of the present application, the training module is specifically configured to:
[0035] For each input time window of each historical diabetes case, calculate the variance of its blood glucose value, and the variance reflects the severity of blood glucose changes within the input time window;
[0036] Divide all time windows into multiple layers according to the variance. In each training iteration, sample a fixed number of time windows from each layer to ensure that the training batch contains blood glucose patterns with different variance levels.
[0037] In a third aspect, the present application provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor runs the computer program, it is configured to implement the method as described in the first aspect.
[0038] In a fourth aspect, the present application provides a computer-readable storage medium, on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement the method as described in the first aspect.
[0039] Compared with the prior art, the personalized blood glucose prediction method based on direction representation learning provided by the present application obtains the blood glucose time series data of a target user within a historical time period and the variable time series data affecting the blood glucose of the target user; after preprocessing the blood glucose time series data and the variable time series data, it is input into a pre-trained personalized blood glucose prediction model to obtain the blood glucose prediction value of the target user within a set future time period. The personalized blood glucose prediction model of the present application is trained by historical diabetes case time series data for a neural network based on direction representation learning, and can accurately predict, better adapt to individual differences, generalize across data sets and dynamically adapt to changing data conditions. The historical diabetes case time series data includes blood glucose time series data samples of each historical diabetes case and variable time series data samples affecting the blood glucose of the historical diabetes case. It can be seen that the present application predicts based on the user's blood glucose data and variable data of factors affecting blood glucose, and can generate accurate personalized blood glucose predictions. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of illustrating the preferred embodiments and are not considered to be a limitation of the present application. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0041] Figure 1 shows a flowchart of a personalized blood glucose prediction method based on direction representation learning provided by an embodiment of the present application;
[0042] Figure 2 shows a flowchart of a method for training a personalized blood glucose prediction model provided by an embodiment of the present application;
[0043] Figure 3 shows a schematic diagram of the prediction process of a personalized blood glucose prediction model provided by an embodiment of the present application;
[0044] Figure 4 shows a schematic diagram of the prediction process of another personalized blood glucose prediction model provided by an embodiment of the present application;
[0045] Figure 5 shows a schematic diagram of the structure of a personalized blood glucose prediction device based on direction representation learning provided by an embodiment of the present application;
[0046] Figure 6 shows a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.
[0048] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the ordinary meanings understood by those skilled in the art to which this application belongs.
[0049] In addition, terms such as "first" and "second" are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.
[0050] Please refer to Figure 1 , Figure 1 which is a flowchart of a personalized blood glucose prediction method based on direction representation learning provided by an embodiment of this application, including the following steps S101 to S102:
[0051] S101. Obtain the blood glucose time series data of the target user within a historical time period and the variable time series data of the factors affecting the blood glucose of the target user.
[0052] Among them, the blood glucose time series data is time series data formed by diabetes blood glucose data within a historical time period at a set time interval. The time interval can be set to specific time intervals such as minutes, hours, days, weeks or months.
[0053] The variable time series data of the factors affecting the blood glucose of the target user is the time series data of the influencing factors corresponding to the blood glucose time series data of the target user, and the influencing factors include variables such as diet, exercise, and drug dosage.
[0054] S102. After preprocessing the blood glucose time series data and the variable time series data, input them into a pre-trained personalized blood glucose prediction model to obtain the blood glucose prediction value of the target user within a future set time period.
[0055] Among them, the personalized blood glucose prediction model is obtained by training a neural network based on direction representation learning with historical diabetes case time series data, and the historical diabetes case time series data includes blood glucose time series data samples of each historical diabetes case and variable time series data samples of the factors affecting the blood glucose of the historical diabetes case.
[0056] Exemplarily, the operations for data preprocessing described above include at least one of the following: data cleaning such as maximum value processing, minimum value processing, data averaging, and normalization processing.
[0057] Accurate and reliable blood glucose prediction is crucial for optimizing treatment plans and reducing the risk of blood glucose fluctuations. Capturing the complex spatio-temporal dependence relationships between historical blood glucose data and physiological and lifestyle factors is the key to improving the prediction accuracy. After preprocessing the user's blood glucose time series data and the time series data of variables affecting blood glucose, this application inputs them into a pre-trained personalized blood glucose prediction model to obtain the predicted blood glucose within a set future time period. For example, based on the blood glucose monitoring data and influencing factor variables of the previous week, the possible blood glucose values for this week can be predicted.
[0058] The following introduces how to pre-train a personalized blood glucose prediction model. Specifically, the personalized blood glucose prediction model can be pre-trained in the following manner, as Figure 2 shown, including steps S201 to S204:
[0059] S201. Obtain the blood glucose monitoring data of each historical diabetes case and the variable data affecting the blood glucose of this historical diabetes case, and count them as time series with the same time interval. Combine the blood glucose monitoring data and variable data within all time intervals to obtain the historical diabetes case time series data.
[0060] Historical diabetes case data refers to the historical blood glucose monitoring data of diabetes cases and influencing factor variable data. Collect the continuous blood glucose detection data of different cases and other data of influencing factors for blood glucose (such as diet, exercise). Set the time interval, such as minutes or hours, and count the blood glucose value output and other influencing factor values within each time interval. Combine all the data to obtain a continuous blood glucose monitoring time series, that is, the historical diabetes case time series data.
[0061] S202. Perform sliding window segmentation on the historical diabetes case time series data, divide the historical diabetes case time series data into multiple supervised learning samples, and use the input and output of each time window as the input and target output of the model respectively.
[0062] First, perform time window division. T represents the input time window length, and H represents the output time window length. By selecting appropriate input and output time window lengths, ensure that the model can capture sufficient historical information and predict future blood glucose changes.
[0063] Then use the sliding window sampling method to divide the time series data into multiple supervised learning samples, and use the input and output of each time window as the input and target output of the model respectively. That is, the specific formula is as follows:
[0064] X b,t = X b,[1+(t-1)s:1+(t-1)s+T] ;
[0065] Y b,t = X b,[1+(t-1)s+T+h:1+(t-1)s+T+h+H] ;
[0066] where X b is the time series data of the b-th case, and X b,t and Y b,t correspond to the t-th input sample and output sample of the case respectively, T is the input time window size, H is the output time window size, h is the prediction time interval, and s is the step size (set to 1 in this method).
[0067] S203. Sample the multiple supervised learning samples by using a variance-aware stratified sampling method to obtain training samples.
[0068] Specifically, for each input time window (with a length of T) of each historical diabetes case, calculate the variance of its blood glucose value, which reflects the severity of blood glucose changes within the input time window; divide all time windows into k layers according to the variance (the number of layers k is a hyperparameter), and in each training iteration, sample a fixed number of time windows n from each layer to ensure that the training batch contains blood glucose patterns with different variance levels.
[0069] S204. Input the training samples into the neural network based on direction representation learning for training, and obtain the personalized blood glucose prediction model after reaching the preset training cut-off condition.
[0070] Set the objective function as the mean squared error (MSE) function, train the model according to the training samples, and adjust the model parameters according to the prediction results output by the model to obtain the optimal model. The preset training cut-off condition can be the number of iterations or other conditions, and this application does not limit this.
[0071] Specifically, the personalized blood glucose prediction model includes a direction representation module, an encoder, a decoder, a projection layer, and a residual connection layer connected in sequence;
[0072] The direction representation module includes a sample representation unit, a time representation unit, and a splicing unit; the sample representation unit is used to extract the representation data of the time series data in the sample dimension, the time representation unit is used to extract the representation data of the time series data in the time dimension, and the splicing unit is used to perform residual addition on the time series data and its representation data in the sample dimension and time dimension to obtain combined data;
[0073] The encoder is used to convert the combined data into a high-dimensional vector representation;
[0074] The decoder is used to convert the high-dimensional vector representation into a potential high-dimensional vector representation;
[0075] The projection layer is used to convert the high-dimensional output of the decoder into the first predicted value of a one-dimensional time series;
[0076] The residual connection layer is used to directly generate a second predicted value from historical observations, perform a residual operation on the first predicted value and the second predicted value, and generate the final blood glucose predicted value.
[0077] Please refer to Figure 3 , and the personalized blood glucose prediction model will be introduced in detail below.
[0078] Direction representation module: Extract the representations of time series data in different direction dimensions to enhance the model's ability to capture blood glucose change trends. The specific implementation is as follows:
[0079] The input data X is multiplied by the learnable weight matrix W c and processed through the activation function σ:
[0080] H n = σ(X) ⊙ W c ;
[0081] Among them, represents the input data, B represents that there are B consecutive data inputs, T is the observation window length, represents using the symbol X to represent a real number matrix with a dimension size of B×T×1, is the learnable weight matrix, is the output result of the calculation. σ(·) is the activation function.
[0082] Next, the data is subjected to specific dimensional softmax normalization along the sample axis and the time axis, and these softmax operations are defined as:
[0083]
[0084] Among them, the symbol U (0) , respectively represent the representation data in the sample and time dimensions, b is the index of all samples; t is the index of all time series; k is the index of all observed variables. Subsequently, residual addition is performed on all processed representations and the original input data to merge their features, thereby facilitating subsequent encoder-decoder operations:
[0085] I = X + U (0) + U (1) ;
[0086] Among them, the symbol Indicates the merged result.
[0087] Encoder: Converts the enhanced input time series I into a high-dimensional vector representation. A recurrent neural network (RNN) is used to implement the encoder in this method. At each time step t, the hidden state h of the encoder t is updated to:
[0088]
[0089] where, is the t-th time period of the input variable I, where t = 1, 2, …, T, is the hidden state at time step t, and L and D represent the number of layers and the size of the hidden layer in the RNN model respectively. f e (·) is the computational function of the encoder, and the final state h of the encoder T is labeled as C.
[0090] Decoder: Also uses the RNN structure. It takes the enhanced past historical observations and converts the high-dimensional vector representation into a potential high-dimensional vector representation for prediction. This process can be described as:
[0091] h t = f d (h t-1 , I (t) , C);
[0092] where, represents the RNN hidden state vector at time step t during the decoding process, t = T + 1, T + 2, …, T + H, and f d (·) is the computational function of the decoder.
[0093] Subsequently, using the hidden state h generated at the t-th step t to further generate the output of the decoder
[0094] M (t) = f m (h t );
[0095] where, f m (·) is the function to perform this operation.
[0096] Projection Layer: Converts the high-dimensional output M of the decoder into a one-dimensional time series prediction value, that is, projects M into a one-dimensional space using a linear network:
[0097] O = W o M + bo ;
[0098] Among them, is the vector representation projected onto a one-dimensional space, are the learnable weight matrix and bias respectively.
[0099] However, since the direction representation operation and the processing in the encoder and decoder do not change the length of the time series data, a global autoregressive operation can be applied to convert the data time length to the prediction length:
[0100]
[0101] Among them, is the blood glucose prediction value at the t-th future step, is the i-th vector of the input data O in the time dimension, while represents the autoregressive coefficient, which respectively represents the influence of the i-th past time step on the current value and the error term or noise term. Combining the single-step predictions generated in H steps forms a prediction with a prediction range of H, denoted as
[0102]
[0103] Residual Connection layer: To combine the simplicity and efficiency of the global autoregressive model, this application introduces a residual connection, directly generating the predicted value Q from the historical observation X h That is, performing a residual operation on the output data and the projected decoder output, and the formula is as follows:
[0104]
[0105] Among them, is the i-th historical observation value from the input data I, are the weights and biases similar to those in the (t) calculation formula respectively. is the predicted value at the t-th future time step, and the H predicted values together constitute the global autoregressive prediction data
[0106] Finally, a residual operation is performed on the two groups of predicted values P and Q to generate the final predicted value
[0107]
[0108] To accurately predict, better adapt to individual differences, generalize across datasets, and dynamically adapt to changing data conditions, this application provides a personalized blood glucose prediction method based on directional representation learning. This method collects continuous blood glucose measurement data of different patients and data of other variables affecting blood glucose, preprocesses the statistical time series and converts it into a supervised learning format, trains a prediction model, and finally uses the trained model to generate accurate personalized blood glucose predictions. The personalized blood glucose prediction process based on directional representation learning can be seen in Figure 3 as shown below.
[0109] As Figure 4 shown below, historical diabetes case data can be collected in real time, the data can be processed, and then model training and real-time prediction can be carried out, and the prediction results can be applied clinically.
[0110] The beneficial effects of the personalized blood glucose prediction method based on directional representation learning provided by this application are as follows:
[0111] a) Personalized prediction
[0112] This method can capture the unique blood glucose change trends and physiological characteristics of each patient. The directional representation module can extract the representations of time series data in different direction dimensions, enhancing the model's ability to capture blood glucose change trends, thus realizing personalized prediction in the true sense.
[0113] b) High efficiency
[0114] This method adopts sliding window sampling and variance-aware stratified sampling techniques, which can efficiently convert time series data into supervised learning samples. At the same time, through the directional representation module and the encoder-decoder architecture, it can quickly capture the key features in the data, significantly improving the model's training efficiency and prediction speed.
[0115] c) General applicability
[0116] During the sampling process, this method samples the data of each patient separately, ensuring that the unique features and recent trends of each patient's data are retained. It can better adapt to the differences in the feature distributions of different datasets and has strong generalization ability.
[0117] d) Accuracy
[0118] The directional representation module enhances the model's ability to capture blood glucose change trends, and the encoder-decoder architecture can effectively handle the complex dynamic relationships in time series data. In addition, the global autoregressive operation and the residual connection module further improve the prediction accuracy of the model. This method is superior to existing methods in multiple performance indicators (such as mean absolute error MAE and root mean square error RMSE), significantly improving the prediction accuracy.
[0119] In the above embodiments, a personalized blood glucose prediction method based on direction representation learning is provided. Correspondingly, the present application also provides a personalized blood glucose prediction device based on direction representation learning. The personalized blood glucose prediction device provided by the embodiments of the present application can implement the above-mentioned personalized blood glucose prediction method based on direction representation learning, and the personalized blood glucose prediction device based on direction representation learning can be implemented by software, hardware, or a combination of software and hardware. For example, the personalized blood glucose prediction device based on direction representation learning can include integrated or separate functional modules or units to execute the corresponding steps in the above methods. Please refer to Figure 5 As shown in
[0120] a personalized blood glucose prediction device 10 based on direction representation learning provided by the present application, including:
[0121] an acquisition module 101, configured to acquire the blood glucose time series data of a target user within a historical time period and the variable time series data affecting the blood glucose of the target user;
[0122] a prediction module 102, configured to preprocess the blood glucose time series data and the variable time series data, and then input them into a pre-trained personalized blood glucose prediction model to obtain the blood glucose prediction value of the target user within a set future time period;
[0123] wherein, the personalized blood glucose prediction model is obtained by training a neural network based on direction representation learning with historical diabetes case time series data, and the historical diabetes case time series data includes blood glucose time series data samples of each historical diabetes case and variable time series data samples affecting the blood glucose of the historical diabetes case.
[0124] In some embodiments of the present application, the device further includes: a training module, configured to pre-train the personalized blood glucose prediction model in the following manner:
[0125] acquire the blood glucose monitoring data of each historical diabetes case and the variable data affecting the blood glucose of the historical diabetes case, and count them as time series with the same time interval, and merge the blood glucose monitoring data and variable data within all time intervals to obtain historical diabetes case time series data;
[0126] perform sliding window segmentation on the historical diabetes case time series data, divide the historical diabetes case time series data into multiple supervised learning samples, and use the input and output of each time window as the input and target output of the model respectively;
[0127] Input the training samples into the neural network based on directional representation learning for training, and obtain the personalized blood glucose prediction model after reaching the preset training cut-off condition.
[0128] In some embodiments of the present application, the training module is specifically configured to:
[0129] For each input time window of each historical diabetes case, calculate the variance of its blood glucose value, and the variance reflects the severity of blood glucose changes within the input time window;
[0130] Divide all time windows into multiple layers according to the variance. In each training iteration, sample a fixed number of time windows from each layer to ensure that the training batch contains blood glucose patterns with different variance levels.
[0131] In some embodiments of the present application, the preprocessing includes at least one of maximum value processing, minimum value processing, data averaging, and normalization processing.
[0132] In some embodiments of the present application, the personalized blood glucose prediction model includes a direction representation module, an encoder, a decoder, a projection layer, and a residual connection layer connected in sequence;
[0133] The direction representation module includes a sample representation unit, a time representation unit, and a splicing unit; the sample representation unit is used to extract the representation data of the time series data in the sample dimension, the time representation unit is used to extract the representation data of the time series data in the time dimension, and the splicing unit is used to perform residual addition on the time series data and its representation data in the sample dimension and time dimension to obtain combined data;
[0134] The encoder is used to convert the combined data into a high-dimensional vector representation;
[0135] The decoder is used to convert the high-dimensional vector representation into a potential high-dimensional vector representation;
[0136] The projection layer is used to convert the high-dimensional output of the decoder into a first predicted value of a one-dimensional time series;
[0137] The residual connection layer is used to directly generate a second predicted value from historical observations, perform a residual operation on the first predicted value and the second predicted value, and generate a final blood glucose predicted value.
[0138] The personalized blood glucose prediction device based on directional representation learning provided by the embodiments of the present application and the personalized blood glucose prediction method based on directional representation learning provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by them.
[0139] The embodiments of the present application also provide an electronic device corresponding to the method provided in the foregoing embodiments. The electronic device may be an electronic device for a client, such as a mobile phone, a laptop computer, a tablet computer, a desktop computer, etc., to execute the above-mentioned personalized blood glucose prediction method based on direction representation learning.
[0140] Please refer to Figure 6 , which shows a schematic diagram of an electronic device provided in some embodiments of the present application. As Figure 6 shown, the electronic device 20 includes: a processor 200, a memory 201, a bus 202, and a communication interface 203. The processor 200, the communication interface 203, and the memory 201 are connected through the bus 202; a computer program that can run on the processor 200 is stored in the memory 201, and when the processor 200 runs the computer program, it executes the personalized blood glucose prediction method based on direction representation learning provided in any of the foregoing embodiments of the present application.
[0141] Among them, the memory 201 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 203 (which may be wired or wireless), a communication connection is established between this system network element and at least one other network element, and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used.
[0142] The bus 202 may be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 201 is used to store a program. After receiving an execution instruction, the processor 200 executes the program. The personalized blood glucose prediction method based on direction representation learning disclosed in any of the foregoing embodiments of the present application can be applied to the processor 200 or implemented by the processor 200.
[0143] The processor 200 may be an integrated circuit chip with the ability to process signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 200 or the instructions in the form of software. The above-mentioned processor 200 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 201, and the processor 200 reads the information in the memory 201 and combines its hardware to complete the steps of the above method.
[0144] The electronic device provided by the embodiments of the present application and the personalized blood glucose prediction method based on direction representation learning provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by them.
[0145] The embodiments of the present application also provide a computer-readable storage medium corresponding to the personalized blood glucose prediction method based on direction representation learning provided by the foregoing embodiments, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will execute the personalized blood glucose prediction method provided by any of the foregoing embodiments.
[0146] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here one by one.
[0147] The computer-readable storage medium provided by the above embodiments of the present application and the personalized blood glucose prediction method based on direction representation learning provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application, and they should all be covered within the scope of the claims and the description of the present application.
Claims
1. A personalized blood glucose prediction method based on directional representation learning, characterized in that: include: Obtaining the target user's blood sugar time series data in a historical time period and the variable time series data that affects the target user's blood sugar; After preprocessing the blood sugar time series data and the variable time series data, the pre-trained personalized blood sugar prediction model is input to obtain the blood sugar prediction value of the target user in a future set time period; Among them, the personalized blood sugar prediction model is obtained by training a neural network based on directional representation learning through historical diabetes case time series data, and the historical diabetes case time series data includes blood sugar time series data samples of each historical diabetes case and variable time series data samples that affect the blood sugar of the historical diabetes case.
2. The method according to claim 1, characterized in that The personalized blood glucose prediction model is pre-trained in the following manner: Obtain the blood sugar monitoring data of each historical diabetes case and the variable data that affects the blood sugar of the historical diabetes case, and count them into time series with the same time interval, merge the blood sugar monitoring data and variable data within all time intervals, and obtain the time series data of the historical diabetes case; Perform sliding window segmentation on the historical diabetes case time series data, divide the historical diabetes case time series data into multiple supervised learning samples, and use the input and output of each time window as the input and target output of the model respectively; Sampling the plurality of supervised learning samples by using a variance-aware stratified sampling method to obtain training samples; The training samples are input into the neural network based on directional representation learning for training, and the personalized blood glucose prediction model is obtained after reaching a preset training cutoff condition.
3. The method according to claim 2, characterized in that The method of sampling the plurality of supervised learning samples by using a variance-aware stratified sampling method to obtain training samples includes: For each input time window of each historical diabetes case, the variance of its blood glucose value is calculated, and the variance reflects the severity of blood glucose changes within the input time window; All time windows are divided into multiple strata according to variance, and in each training iteration, a fixed number of time windows are sampled from each stratum to ensure that the training batch contains blood glucose patterns with different variance levels.
4. The method according to claim 1, characterized in that The preprocessing includes at least one of maximum value processing, minimum value processing, data averaging and normalization processing.
5. The method according to claim 1, characterized in that The personalized blood sugar prediction model includes a sequentially connected direction representation module, an encoder and a decoder, a projection layer, and a residual connection layer; The direction representation module includes a sample representation unit, a time representation unit and a splicing unit; the sample representation unit is used to extract the representation data of the time series data in the sample dimension, the time representation unit is used to extract the representation data of the time series data in the time dimension, and the splicing unit is used to perform residual addition on the time series data and its representation data in the sample dimension and the time dimension to obtain merged data; The encoder is used to convert the combined data into a high-dimensional vector representation; The decoder is used to convert the high-dimensional vector representation into a potential high-dimensional vector representation; The projection layer is used to convert the high-dimensional output of the decoder into a first prediction value of a one-dimensional time series; The residual connection layer is used to generate a second prediction value directly from the historical observation value, perform residual operation on the first prediction value and the second prediction value, and generate a final blood glucose prediction value.
6. A personalized blood sugar prediction device based on directional representation learning, characterized in that: include: An acquisition module, used to acquire the target user's blood sugar time series data in a historical time period and the variable time series data affecting the target user's blood sugar; A prediction module, used to pre-process the blood glucose time series data and the variable time series data, input a pre-trained personalized blood glucose prediction model, and obtain a blood glucose prediction value of the target user within a future set time period; Among them, the personalized blood sugar prediction model is obtained by training a neural network based on directional representation learning through historical diabetes case time series data, and the historical diabetes case time series data includes blood sugar time series data samples of each historical diabetes case and variable time series data samples that affect the blood sugar of the historical diabetes case.
7. The device according to claim 6, characterized in that Also includes: The training module is used to pre-train the personalized blood glucose prediction model in the following manner: Obtain the blood sugar monitoring data of each historical diabetes case and the variable data that affects the blood sugar of the historical diabetes case, and count them into time series with the same time interval, merge the blood sugar monitoring data and variable data within all time intervals, and obtain the time series data of the historical diabetes case; Perform sliding window segmentation on the historical diabetes case time series data, divide the historical diabetes case time series data into multiple supervised learning samples, and use the input and output of each time window as the input and target output of the model respectively; Sampling the plurality of supervised learning samples by using a variance-aware stratified sampling method to obtain training samples; The training samples are input into the neural network based on directional representation learning for training, and the personalized blood glucose prediction model is obtained after reaching a preset training cutoff condition.
8. The device according to claim 7, characterized in that The training module is specifically used for: For each input time window of each historical diabetes case, the variance of its blood glucose value is calculated, and the variance reflects the severity of blood glucose changes within the input time window; All time windows are divided into multiple strata according to variance, and in each training iteration, a fixed number of time windows are sampled from each stratum to ensure that the training batch contains blood glucose patterns with different variance levels.
9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and the computer-readable instructions can be executed by a processor to implement the method according to any one of claims 1 to 5.