Hypoglycemia early warning method and system, terminal and storage medium

The LSTM-TCN model improves the prediction performance of the hypoglycemia prediction model without the input of exogenous parameters, solves the problem of insufficient hypoglycemia prediction in the existing technology, and achieves more accurate warning of hypoglycemia events and risk reduction .

CN119296787AActive Publication Date: 2025-01-10SINOCARE
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411762591.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-01-10
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

The existing hypoglycemia prediction model has insufficient predictive performance in the case of limited characteristics and no exogenous parameter input, resulting in a high risk of hypoglycemia events.

Method used

Using the LSTM-TCN model, a model with blood glucose time series data obtained for pre-processing is constructed with blood glucose time series data as input and the predicted blood glucose prediction value of the pre-set prediction step as output, and using the adaptive Kalman filtering algorithm, z- Score standardization and sliding window method improve data quality, combining the long-term memory ability of LSTM and the temporal feature extraction ability of TCN to predict and warning hypoglycemia.

Benefits of technology

It improves the predictive performance of hypoglycemia events, optimizes the model's response time to events, increases the intervention time, reduces the risk of hypoglycemia events, and only depends on the blood sugar time series data, without the need for other characteristics and exogenous parameter input.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119296787A_ABST
    Figure CN119296787A_ABST
Patent Text Reader

Abstract

The invention provides a hypoglycemia early warning method and system, a terminal and a storage medium, and relates to the technical field of blood glucose prediction.The method comprises the steps that blood glucose time sequence sample data is obtained and preprocessed, and preprocessed data is obtained; an LSTM-TCN model with the blood glucose time sequence data as input and the blood glucose predicted value with the preset prediction step length as output is constructed; constructing a training data set according to the preprocessed data, and training an LSTM-TCN model by using the training data set to obtain a trained hypoglycemia prediction model; acquiring blood glucose time sequence monitoring data, and performing blood glucose value prediction of a preset prediction step length by using the hypoglycemia prediction model to obtain a blood glucose prediction value of the preset prediction step length; and performing hypoglycemia early warning according to the blood glucose prediction value of the preset prediction step length and a preset early warning mechanism. According to the method, the prediction performance of the hypoglycemia prediction model can be improved and the risk caused by a hypoglycemia event can be reduced under the conditions of finite features and no exogenous parameter input.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of blood sugar prediction, and in particular to a hypoglycemia early warning method, system, terminal and storage medium. Background Art

[0002] Diabetes is a metabolic disease caused by insufficient insulin production or impaired human utilization, characterized by chronic hyperglycemia. Although diabetic patients often emphasize the challenge of daily high blood sugar control, frequent iatrogenic hypoglycemia caused by drug control during treatment also needs to be taken seriously. Studies have shown that hypoglycemia caused by oral hypoglycemic drugs and insulin therapy accounts for 25% of the causes of emergency hospitalization in the elderly, and these hypoglycemia are avoidable. Acute complications of hypoglycemia not only cause discomfort such as dizziness and hand tremors, but are even life-threatening in severe cases. The continuous glucose monitoring (CGM) system is particularly important for controlling the risk of hypoglycemia. Its hypoglycemia event warning allows patients to take intervention measures before hypoglycemia occurs, such as supplementing fast carbon or stopping insulin injections, to avoid risks.

[0003] In recent years, with the advancement of dynamic blood glucose technology, researchers have developed a variety of hypoglycemia prediction models based on CGM data, which can predict future blood glucose data for a certain period of time by using machine learning and deep learning methods. Existing hypoglycemia prediction models generally adopt a single model structure and rely on many features and exogenous parameters such as age, weight, carbohydrate intake, and insulin injection amount at the model input end. Its prediction performance at the application level and for hypoglycemia events needs to be improved.

[0004] Therefore, how to improve the prediction performance of the hypoglycemia prediction model and reduce the risk of hypoglycemia events under limited features and without exogenous parameter input is a technical problem that needs to be solved urgently by technical personnel in this field. Summary of the invention

[0005] To solve the above technical problems, the present application provides a hypoglycemia early warning method, which can improve the prediction performance of the hypoglycemia prediction model and reduce the risk of hypoglycemia events under limited features and without exogenous parameter input. The present application also provides a hypoglycemia early warning system, terminal and storage medium, which have the same technical effects.

[0006] The first purpose of this application is to provide a hypoglycemia early warning method.

[0007] The above-mentioned application objective 1 of the present application is achieved through the following technical solutions: A hypoglycemia early warning method, comprising: Acquiring blood sugar time series sample data, and preprocessing the blood sugar time series sample data to obtain preprocessed data; Constructing an LSTM-TCN model with blood glucose time series data as input and blood glucose prediction value of preset prediction step as output, wherein the LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence; Constructing a training data set according to the preprocessed data, and using the training data set to train the LSTM-TCN model to obtain a trained hypoglycemia prediction model; Acquire blood glucose time series monitoring data, and use the hypoglycemia prediction model to predict blood glucose values ​​with a preset prediction step length according to the blood glucose time series monitoring data to obtain a blood glucose prediction value with a preset prediction step length; A hypoglycemia warning is performed based on the blood glucose prediction value of the preset prediction step and the preset warning mechanism.

[0008] Preferably, in the hypoglycemia early warning method, preprocessing the blood glucose time series sample data to obtain preprocessed data includes: Using the confidence interval or the n-sigma interval, performing outlier elimination or interpolation processing on the blood glucose time series sample data to obtain first processed data; Using an adaptive Kalman filter algorithm, performing noise reduction processing on the first processed data to obtain second processed data; Using a z-score standardization method, standardizing the second processed data to obtain third processed data; The third processed data is processed using a sliding window method to obtain preprocessed data.

[0009] Preferably, in the hypoglycemia early warning method, the LSTM-TCN model includes a first LSTM layer, a second LSTM layer and a TCN unit connected in sequence, wherein the TCN unit includes at least one TCN layer connected in sequence, wherein: The first LSTM layer is used to output a first temporary variable based on the preprocessed data; The second LSTM layer is used to output an LSTM activation value based on the first temporary variable; The TCN unit is used to output a blood glucose prediction value with a preset prediction step size based on the LSTM activation value and the Sigmoid activation function.

[0010] Preferably, in the hypoglycemia early warning method, the TCN unit is specifically used for: Using the LSTM activation value as the input of the first TCN layer; Using at least one TCN layer, one-dimensional convolution is performed based on the input of the TCN layer and the preset dilation factor, convolution kernel, sliding step size, and padding step size to obtain the output of the one-dimensional convolution layer; Based on the preset hyperparameters, feature screening and clipping are performed on the output of the one-dimensional convolutional layer to obtain a second temporary variable; The second temporary variable is modified using a Sigmoid activation function to obtain the output of the TCN layer; Repeat the above steps, and each time the above steps are repeated, the expansion factor and the filling step are increased exponentially until the receptive field length of the one-dimensional convolutional layer of a certain TCN layer is consistent with the preset input step length, and the current output of the TCN layer is used as the blood glucose prediction value of the preset prediction step length.

[0011] Preferably, in the hypoglycemia early warning method, the maximum number of TCN layers in the TCN unit is ,in, Indicates the preset maximum number of TCN layers. Indicates the expansion factor increment multiple, Represents the preset input step size.

[0012] Preferably, in the hypoglycemia early warning method, constructing a training data set according to the preprocessed data, and using the training data set to train the LSTM-TCN model to obtain a trained hypoglycemia prediction model, includes: Dividing the preprocessed data into a training set, a validation set, and a test set; Using the Adam optimizer, setting the learning rate, training the LSTM-TCN model with the training set, adopting an early stopping mechanism, and performing parameter tuning with the validation set to obtain a trained intermediate model; Using the test set, performing performance evaluation on the intermediate model to obtain an evaluation index; It is determined whether the evaluation index meets the preset requirements. If so, the intermediate model is used as a trained hypoglycemia prediction model.

[0013] Preferably, in the hypoglycemia early warning method, the preset early warning mechanism includes one or more of the following early warning mechanisms: When a single point in the blood glucose prediction value of the preset prediction step length is less than a predetermined hypoglycemia threshold, a hypoglycemia warning is triggered; When the blood glucose prediction values ​​of the preset prediction step length are less than the predetermined hypoglycemia threshold value at consecutive k moments, a hypoglycemia warning is triggered; When the cumulative amount of blood sugar decreases for k consecutive moments within the blood sugar prediction value of the preset prediction step exceeds a predetermined decrease threshold, a hypoglycemia warning is triggered.

[0014] The second purpose of this application is to provide a hypoglycemia early warning system.

[0015] The second application objective of the present application is achieved through the following technical solutions: A hypoglycemia early warning system, comprising: A processing unit, used for acquiring blood sugar time series sample data, and preprocessing the blood sugar time series sample data to obtain preprocessed data; A construction unit, used to construct an LSTM-TCN model with blood glucose time series data as input and blood glucose prediction value of a preset prediction step as output, wherein the LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence; A training unit, configured to construct a training data set according to the preprocessed data, and train the LSTM-TCN model using the training data set to obtain a trained hypoglycemia prediction model; A prediction unit, used to obtain blood glucose time series monitoring data, and use the hypoglycemia prediction model to predict the blood glucose value of a preset prediction step length according to the blood glucose time series monitoring data to obtain a blood glucose prediction value of the preset prediction step length; The early warning unit is used to issue a low blood sugar early warning according to the blood sugar prediction value of the preset prediction step and the preset early warning mechanism.

[0016] The third objective of the present application is to provide a hypoglycemia early warning terminal.

[0017] The third application objective of this application is achieved through the following technical solutions: A hypoglycemia early warning terminal, comprising: a storage medium and a processor; The storage medium stores computer-executable instructions; The processor executes the computer-executable instructions stored in the storage medium to implement the hypoglycemia early warning method as described above.

[0018] The fourth object of this application is to provide a computer-readable storage medium.

[0019] The fourth application objective of this application is achieved through the following technical solutions: A computer-readable storage medium stores computer-executable instructions, which are used to implement the hypoglycemia early warning method as described above when executed by a processor.

[0020] The above technical scheme obtains blood glucose time series sample data and preprocesses the blood glucose time series sample data to obtain preprocessed data; constructs an LSTM-TCN model with blood glucose time series data as input and blood glucose prediction value of preset prediction step as output; constructs a training data set based on the preprocessed data, and uses the training data set to train the LSTM-TCN model to obtain a trained hypoglycemia prediction model; obtains blood glucose time series monitoring data, and uses the hypoglycemia prediction model to predict blood glucose values ​​with preset prediction step according to the blood glucose time series monitoring data, to obtain blood glucose prediction values ​​with preset prediction step; and performs hypoglycemia warning according to the blood glucose prediction value of preset prediction step and a preset warning mechanism. Among them, the hypoglycemia prediction model trained based on the LSTM-TCN model only uses blood glucose time series data to predict future preset step blood glucose values, without the need for input of other user features and exogenous parameters, and has more ideal guidance capabilities in practical applications; the LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence, so that the LSTM-TCN model combines the long-term memory and short-term processing capabilities of LSTM and the efficient time feature extraction capabilities of TCN. The LSTM-TCN model integrates the advantages of both, which not only improves the prediction performance of hypoglycemia events, but also optimizes the model's response time to events and increases the intervention duration.

[0021] In summary, the above technical solution can improve the prediction performance of the hypoglycemia prediction model and reduce the risk of hypoglycemia events under limited features and without exogenous parameter input.

[0022] In addition, the above-mentioned LSTM-TCN model includes a first LSTM layer, a second LSTM layer and a TCN unit connected in sequence, wherein the TCN unit can adaptively adjust the number of layers according to data features and input dimensions; when constructing the TCN unit, the expansion factor is increased in an exponential growth form so that the receptive field length of the one-dimensional convolutional layer is consistent with the preset input step size; for different preset input step sizes, the number of TCN unit layers can be dynamically adjusted. This construction method can gradually expand the receptive field while ensuring computational efficiency, thereby enhancing the network's ability to capture global information. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1A schematic diagram of a hypoglycemia early warning method provided in an embodiment of the present application; Figure 2 This is a schematic diagram of the structure of the LSTM model provided in the embodiments of the present application; Figure 3 A schematic diagram of the structure of the TCN model provided in the embodiments of the present application; Figure 4 This is a schematic diagram of the structure of the LSTM-TCN model provided in the embodiments of the present application; Figure 5 The Clarke error grid diagram of each model provided in the embodiment of the present application, wherein (a) Figure (a) is the Clarke error grid diagram of the LSTM-TCN model, Figure (b) is the Clarke error grid diagram of the LSTM model, Figure (c) is the Clarke error grid diagram of the RNN model, and Figure (d) is the Clarke error grid diagram of the TCN model; Figure 6 This is a schematic diagram of the structure of a hypoglycemia early warning system provided in an embodiment of the present application; Figure 7 This is a schematic diagram of the structure of a hypoglycemia warning terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0026] In the embodiments provided in the present application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described below are merely schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0027] It should be understood that the use of "system", "device", "unit" and / or "module" in this application is only a method for distinguishing different components, elements, parts, parts or assemblies at different levels. However, if other words can achieve the same purpose, the word can be replaced by other expressions.

[0028] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "multiple" and "several" mean two or more, unless otherwise clearly and specifically defined.

[0029] If a flow chart is used in the present application, the flow chart is used to illustrate the operations performed by the system according to the embodiment of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, each step can be processed in reverse order or simultaneously. At the same time, other operations can also be added to these processes, or a certain step or several steps of operations can be removed from these processes.

[0030] It should also be noted that, in this article, terms such as "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that an article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such articles or devices. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the article or device including the above elements.

[0031] The embodiments of the present application are written in a progressive manner.

[0032] like Figure 1 As shown, the embodiment of the present application provides a hypoglycemia early warning method, comprising: S101. Obtain blood glucose time series sample data, and preprocess the blood glucose time series sample data to obtain preprocessed data; In S101, specifically, the blood glucose time series sample data may be composed of blood glucose monitoring data with timestamps output by an existing invasive, non-invasive, electrochemical or optical blood glucose monitoring device at predetermined time intervals. ,in, Indicates the timestamp, Represents the continuous blood glucose monitoring value. For example, 120 confirmed diabetic patients were selected as research subjects, of which 22 were type 1 diabetes patients, 97 were type 2 diabetes patients, and 1 was a patient with other special diabetes. The patients used CGM equipment to continuously collect blood glucose data for 15 days. The CGM sampling frequency was 3 minutes, with 7,200 blood glucose values ​​per person and a total of 864,000 blood glucose values ​​as the blood glucose time series sample data required for model training.

[0033] Furthermore, in order to improve the quality of the data, the blood glucose time series sample data needs to be preprocessed to obtain preprocessed data, wherein the preprocessing process may include outlier processing, noise reduction processing, standardization processing, sliding window processing, etc., but the present application is not limited thereto.

[0034] In some embodiments, one implementation of the step of preprocessing blood glucose time series sample data to obtain preprocessed data specifically includes: S1011. Using the confidence interval or n-sigma interval, perform outlier elimination or interpolation processing on the blood glucose time series sample data to obtain first processed data; In S1011, specifically, a probability distribution of blood glucose time series data is constructed, a confidence interval (such as 80%, 85%, 90%, 95%, etc.) or an n-sigma interval (such as 2-sigma, 4-sigma, 6-sigma interval, etc.) is constructed through the probability distribution, data that does not fall into the confidence interval or the n-sigma interval is regarded as an outlier, and after the outlier is removed or interpolated, the first processed data is obtained; S1012. Using an adaptive Kalman filter algorithm, performing noise reduction processing on the first processed data to obtain second processed data; Specifically, in S1012, considering that the CGM device is easily affected by interferences when detecting blood glucose, the collected blood glucose data contains a large amount of noise, and an adaptive Kalman filter algorithm (Adaptive Extended Kalman Filter, AEKF) is used to perform noise reduction processing on the blood glucose time series sample data collected by the CGM device. The adaptive Kalman filter algorithm can better remove the high-frequency noise in the blood glucose time series sample data, and adaptively adjust the Kalman filter algorithm parameters according to the data characteristics of the first processed data such as the noise level and the distribution of outliers, so as to obtain the second processed data with more reasonable values.

[0035] S1013. Using the z-score standardization method, the second processed data is standardized to obtain third processed data; In S1013, specifically, in order to reduce the impact of different CGM value ranges on model training, the z-score standardization method is used to standardize the second processed data to scale the data to the range of [-1,1] to obtain third processed data.

[0036] S1014. Use a sliding window method to process the third processed data to obtain preprocessed data.

[0037] In S1014, specifically, the sliding window method allows for analysis of local areas of the time series data, which helps capture short-term patterns and trends in the data. By processing the third processed data through the sliding window method, short-term fluctuations and long-term information of the third processed data can be captured to obtain preprocessed data, which is conducive to the model to better understand the changes in the time series.

[0038] In the above embodiment, by adopting outlier processing, adaptive Kalman filtering algorithm, z-score normalization method and sliding window method, the blood glucose time series sample data is preprocessed to obtain preprocessed data, which can effectively improve the data quality and help improve the effect of subsequent model training.

[0039] S102. Construct an LSTM-TCN model with blood glucose time series data as input and blood glucose prediction value of preset prediction step as output; In S102, specifically, LSTM (Long Short Term Memory) stands for Long Short Term Memory Network, which was proposed by Hochreiter and Schmidhuber in 1997 and is a variant of recurrent neural network. By introducing memory unit C and gating mechanism, LSTM solves the problem of long-term memory dependency in recurrent neural network and the problem of gradient vanishing or gradient exploding that may occur during calculation. Its structure is shown in Figure 2 Among them, the memory unit C processes long-term memory, and the hidden state h processes current and short-term information. These two variables are propagated and evolved through the gating mechanism. The forget gate is based on the last time step. Short-term information and the new information at the current time step filter The old information in is calculated as follows: (1); The input gate is responsible for calculating the absorbed new information and determining the new information of the current time step. How much needs to be transferred to long-term memory cells , and its calculation formula is: (2); (3); Then, according to the output of the forget gate and the input gate, the network calculates the current unit state Update, the calculation formula is: (4); The output gate is updated from the long-term memory Filter out the most effective information for the current time step t As output, it is calculated as: (5); (6); In formulas (1) to (6), represents the activation function Sigmoid, represents the activation function tanh, , , , represents the corresponding weight matrix, , , , Indicates the corresponding bias.

[0040] Specifically, TCN (Temporal Convolutional Networks) stands for temporal convolutional network, which was introduced by Bai et al. in 2018 to process sequences. It is a variant of one-dimensional convolutional neural network (CNN) dedicated to time series prediction. The core of temporal convolutional network is to capture the temporal dependency in the sequence through a special architecture. Figure 3 As shown, this architecture includes causal convolutions, dilated convolutions, and residual links.

[0041] Among them, causal convolution and dilated convolution are used to extract time series features, and residual links are used to reduce the risk of gradient vanishing during model training. Causal convolution fills 0 at the head of the input sequence according to the size of the convolution kernel to ensure that the output of the model at time point t depends only on past and present inputs, rather than future information, ensuring the temporal integrity required for time series prediction. The receptive field is defined as the time step span of the input sequence that the output unit can perceive. Unlike CNN, which expands the receptive field by using larger convolution kernels or increasing the number of model layers, dilated convolution increases the number of time steps covered by the convolution kernel by introducing holes. The size of the hole depends on the dilation rate, and the increase in the dilation rate increases the receptive field. Dilated convolution enables the model to obtain more extensive historical information and learn long-term dependencies without increasing the model's computational parameters and costs. Residual links add the input of one layer of the network to the output of another layer of the network, alleviating the gradient vanishing problem and enhancing the model's learning ability. This design not only improves the training efficiency of deep networks, but also ensures the stability of the model when processing long sequences.

[0042] In this step, in order to combine the advantages of LSTM in capturing long-term dependencies and TCN in quickly extracting local features, the LSTM network and the TCN network are combined in advance to construct an LSTM-TCN model with blood glucose time series data as input and blood glucose prediction values ​​of preset prediction steps as output, wherein the LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence; the blood glucose prediction value of the preset prediction step refers to the blood glucose prediction sequence within a period of time in the future, and the preset prediction step can be 15 minutes, 30 minutes, 60 minutes or other preset steps. Based on the above model structure design, the LSTM-TCN model integrates the long-term memory ability of LSTM and the efficient time feature extraction ability of TCN. The LSTM-TCN model integrates the advantages of both. The hypoglycemia prediction model obtained by training based on the LSTM-TCN model not only improves the prediction performance of hypoglycemia events, but also optimizes the response time of the model to events, increases the intervention time, and makes it have more ideal guidance capabilities in practical applications. In addition, the LSTM-TCN model only requires the input of blood glucose data with timestamps, without the input of other features and exogenous parameters, and has more ideal guidance capabilities in practical applications.

[0043] In some embodiments, the LSTM-TCN model includes a first LSTM layer, a second LSTM layer, and a TCN unit connected in sequence, wherein: A first LSTM layer, used for outputting a first temporary variable based on the preprocessed data; A second LSTM layer is used to output an LSTM activation value based on the first temporary variable; The TCN unit is used to output a blood glucose prediction value with a preset prediction step size based on an LSTM activation value and a Sigmoid activation function.

[0044] Specifically, the first LSTM layer takes the preprocessed data as input and calculates according to the calculation process in step S102 to obtain the most effective information at the current time step t. , as the first temporary variable of the output; the second LSTM layer, taking the first temporary variable as input, calculates according to the calculation process in step S102 to obtain the most effective information at the current time step t , as the output LSTM activation value.

[0045] The TCN unit includes at least one TCN layer connected in sequence. Each TCN layer extracts time series features through multiple convolution kernels and pooling operations. It is mainly composed of an extended causal convolution layer, a residual module, a pooling layer, and a fully connected layer. The TCN unit is used to extract the features of the LSTM activation value of the data sequence, and then the Sigmoid activation function is used to obtain the blood glucose prediction value of the preset prediction step output by the TCN unit.

[0046] Among them, the TCN unit is specifically used for: Use the LSTM activation value as the input of the first TCN layer; Using at least one TCN layer, one-dimensional convolution is performed based on the input of the TCN layer and the preset dilation factor, convolution kernel, sliding step size, and padding step size to obtain the output of the one-dimensional convolution layer; Based on the pre-set hyperparameters, the output of the one-dimensional convolutional layer is feature screened and clipped to obtain a second temporary variable; The second temporary variable is corrected using the Sigmoid activation function to obtain the output of the TCN layer; Repeat the above steps. Each time the above steps are repeated, the expansion factor and the padding step are increased exponentially until the receptive field length of the one-dimensional convolutional layer of a certain TCN layer is consistent with the preset input step length. The current output of the TCN layer is used as the blood glucose prediction value of the preset prediction step length.

[0047] It should be noted that when the TCN unit includes only one TCN layer, the above process can be re-executed using the TCN layer, that is, the process of repeatedly using at least one TCN layer to process based on the input of the TCN layer and the preset expansion factor, convolution kernel, sliding step size and padding step size, and finally obtaining the output of the TCN layer. The output of the TCN layer in the previous round of calculation is used as the input of the TCN layer in the next round of calculation, until the receptive field length of the one-dimensional convolution layer of the TCN layer is consistent with the preset input step size, and the current output of the TCN layer is used as the blood glucose with the preset prediction step size. Prediction value; when the TCN unit includes multiple layers of TCN layers, the output of the previous TCN layer is used as the input of the next TCN layer, and the multiple layers of TCN layers execute the above process sequentially and cyclically, that is, repeatedly executing the process of using at least one layer of TCN layer to process based on the input of the TCN layer and the preset expansion factor, convolution kernel, sliding step size and padding step size, and finally obtaining the output of the TCN layer, until the receptive field length of the one-dimensional convolution layer of a TCN layer in the multiple layers of TCN layers is consistent with the preset input step size, then the current output of the TCN layer is used as the blood glucose prediction value of the preset prediction step size.

[0048] In this embodiment, the number of layers can be adaptively adjusted according to data features and input dimensions through the TCN unit; when constructing the TCN unit, the expansion factor is increased in an exponential growth form so that the receptive field length of the one-dimensional convolutional layer is consistent with the preset input step size; for different preset input step sizes, the number of TCN unit layers can be dynamically adjusted. Such a construction method can gradually expand the receptive field while ensuring computational efficiency, and enhance the network's ability to capture global information; specifically, the method for adaptively adjusting the number of TCN layers is as follows: For The TCN layer of the layer has a receptive field length of ,in, It is The receptive field length of the TCN layer is It is The receptive field length of the TCN layer is It is The convolution kernel size of the TCN layer of the layer, It is The expansion factor of the TCN layer of the layer; based on the above receptive field length calculation formula and the preset input step size , the maximum number of TCN layers in the TCN unit can be dynamically adjusted to be ,in, Indicates the preset maximum number of TCN layers. Indicates the expansion factor increment multiple; in some embodiments, the expansion factor increases exponentially, generally speaking, the expansion factor increases by a multiple of Select a value of 2.

[0049] In some other embodiments, the LSTM-TCN model includes an input layer, a first LSTM layer, a second LSTM layer, a first TCN layer, a second TCN layer, a third TCN layer, a Dropout layer, an MLP layer, and an output layer connected in sequence; Specifically, combined Figure 4 As shown, the input layer is used to receive blood glucose time series data as model input, where the model input is specifically dimensional matrix, is the sample size, is the feature number, is the input step length, wherein the input step length can be the sliding window length, that is, using continuous blood glucose data of length T to perform blood glucose prediction with a preset prediction step length; the first LSTM layer and the second LSTM layer are used to process sequence data and extract key long-term information. Preferably, the first LSTM layer and the second LSTM layer both use LSTM layers containing 64 neurons; then this information is transmitted to three TCN layers, namely the first TCN layer, the second TCN layer and the third TCN layer, to further extract the most important time features for short-term correlation. Preferably, the convolution kernel sizes of the first TCN layer, the second TCN layer, and the third TCN layer are all 3, the number of filters used is 10, 32, and 64, respectively, the expansion rates are 1, 2, and 4, respectively, and causal convolution is used to ensure that the output depends only on current and past inputs; the Dropout layer is a structure that applies dropout technology to a neural network, and achieves the purpose of regularization by randomly discarding a part of neurons during the training process. In addition, the Dropout layer also has the advantage of reducing the complexity of the model, which helps to accelerate the training process of the model. Preferably, in order to avoid overfitting of the model training, the Dropout layer sets the discard rate to 10%; the MLP (Multi-Layer Perceptron) layer is a specific type of artificial neural network, which consists of multiple neurons and is used to connect the convolution layer and the output layer; the output layer uses a sigmoid activation function to output the blood glucose prediction value of a preset prediction step.

[0050] S103. Construct a training data set based on the preprocessed data, and use the training data set to train the LSTM-TCN model to obtain a trained hypoglycemia prediction model; In S103, specifically, the preprocessed data is randomly sorted as a whole by humans, and a training data set including a training set, a validation set and a test set is constructed according to a set ratio for model training. For example, the first 80% is allocated as a training set, the middle 10% is allocated as a validation set, and the last 10% is allocated as a test set, which are used for subsequent model training, debugging and evaluation, respectively. In the LSTM-TCN model training process, the absolute mean error MAE (Mean Absolute Error) can be selected as the loss function, Adam as the optimizer, and the training adopts a mini-batch method. The batch size is set to 64, the number of training times is 100, and in order to prevent overfitting, an early stopping mechanism is used to obtain a trained hypoglycemia prediction model, but the present application is not limited thereto.

[0051] S104. Obtain blood glucose time series monitoring data, and use a hypoglycemia prediction model to predict blood glucose values ​​with a preset prediction step length based on the blood glucose time series monitoring data to obtain a blood glucose prediction value with a preset prediction step length.

[0052] In S104, specifically, the blood glucose time series monitoring data of the preset step length of the blood glucose monitoring personnel can be obtained through the CGM device, and the blood glucose time series monitoring data can be input into the hypoglycemia prediction model to obtain the blood glucose prediction value of the preset prediction step length; wherein, taking intervention measures 20-30 minutes before the occurrence of a hypoglycemia event can effectively avoid the risk of complications, and secondly, 30 minutes is the best balance point between prediction error and prediction effectiveness, so the prediction step length (Prediction Horizon, PH) of the hypoglycemia prediction model can be preferably set to 30 minutes. In other embodiments, the blood glucose time series monitoring data can also be preprocessed first, and then input into the hypoglycemia prediction model for prediction, wherein the preprocessing process can refer to the above S101, and this application does not make specific restrictions on this.

[0053] S105. Perform hypoglycemia warning according to the blood glucose prediction value of the preset prediction step and the preset warning mechanism.

[0054] In S105, specifically, the preset warning mechanism may include one or more of the following warning mechanisms: (1) When a single point appears within the blood glucose prediction value of the preset prediction step that is less than the predetermined hypoglycemia threshold, a hypoglycemia warning is triggered; (2) When the predicted value of the blood glucose prediction value of the preset prediction step is less than the predetermined hypoglycemia threshold for consecutive k moments, a hypoglycemia warning is triggered; (3) When the cumulative amount of blood glucose decreases for consecutive k moments within the blood glucose prediction value of the preset prediction step exceeds the predetermined decrease threshold, a hypoglycemia warning is triggered. Among them, the predetermined hypoglycemia threshold, k moment, and predetermined decrease threshold can be set based on actual application requirements. For example, when the blood glucose prediction value is lower than 70 mg / dL for 15 consecutive minutes, a hypoglycemia warning is triggered so that intervention measures can be taken to effectively avoid the risk of complications.

[0055] In recent years, with the advancement of dynamic blood glucose technology, researchers have developed a variety of hypoglycemia prediction models based on CGM data, which can predict future blood glucose data for a certain period of time by using machine learning and deep learning methods. Existing hypoglycemia prediction models generally adopt a single model structure and rely on many features and exogenous parameters such as age, weight, carbohydrate intake, and insulin injection amount at the model input end. Its prediction performance at the application level and for hypoglycemia events needs to be improved.

[0056] In the above embodiment, blood glucose time series sample data is obtained and preprocessed to obtain preprocessed data; an LSTM-TCN model is constructed with blood glucose time series data as input and blood glucose prediction value of preset prediction step as output; a training data set is constructed according to the preprocessed data, and the LSTM-TCN model is trained using the training data set to obtain a trained hypoglycemia prediction model; blood glucose time series monitoring data is obtained, and the hypoglycemia prediction model is used to predict the blood glucose value of preset prediction step according to the blood glucose time series monitoring data to obtain the blood glucose prediction value of preset prediction step; hypoglycemia is detected according to the blood glucose prediction value of preset prediction step and preset early warning mechanism. Early warning; wherein, the LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence, so that the LSTM-TCN model integrates the long-term memory ability and short-term processing ability of LSTM and the efficient time feature extraction ability of TCN. The LSTM-TCN model integrates the advantages of both. The hypoglycemia prediction model obtained by training based on the LSTM-TCN model not only improves the prediction performance of hypoglycemia events, but also optimizes the response time of the model to events and increases the intervention time; at the same time, the above embodiment only requires the input of blood glucose data with timestamps, without the input of other features and exogenous parameters, and has a more ideal guidance ability in practical applications. In summary, the above embodiment can improve the prediction performance of the hypoglycemia prediction model and reduce the risk of hypoglycemia events under the condition of limited features and no exogenous parameter input.

[0057] In other embodiments of the present application, one implementation of the steps of constructing a training data set based on preprocessed data, training the LSTM-TCN model using the training data set, and obtaining a trained hypoglycemia prediction model specifically includes: S201. Divide the preprocessed data into a training set, a validation set and a test set; In S201, specifically, the preprocessed data is randomly sorted as a whole by humans, and a training data set including a training set, a validation set and a test set is constructed according to a set ratio for model training. For example, the first 80% is allocated as a training set, the middle 10% is allocated as a validation set, and the last 10% is allocated as a test set, which are respectively used for subsequent model training, debugging and evaluation.

[0058] S202. Use the Adam optimizer, set the learning rate, train the LSTM-TCN model using the training set, adopt the early stopping mechanism, and tune the parameters using the validation set to obtain a trained intermediate model; In S202, specifically, the absolute mean error MAE is selected as the loss function, the Adam optimizer is used, the learning rate is set, the learning rate is dynamically adjusted, the training adopts the mini-batch method, the batch size is set to 64, the number of training times is 100, and the early stopping mechanism is adopted. The training set is used to train the LSTM-TCN model based on the above mechanism, and the model performance of the trained LSTM-TCN model is verified through the verification set, and the hyperparameters of the model, such as learning efficiency and batch size, are adjusted. If the total verification loss value does not change or increase for several consecutive rounds, the training is stopped to obtain a trained intermediate model.

[0059] Among them, the early stopping mechanism can stop training after the loss function does not decrease after 15 epochs when there is no substantial reduction in the verification loss. The early stopping mechanism can speed up the training and retain the best weights in the training process. The update rule of the Adam optimizer is: Calculating the loss function About Model Parameters Gradient : (7); in, represents the current time step; Based on the current model parameters Gradient , calculate the gradients The first moment estimate of and the second moment estimate , the calculation formula is: (8); (9); in, represents the first-order momentum decay rate, represents the second-order momentum decay rate, Indicates the current time step The previous time step of ; First-order moment estimate and the second moment estimate Perform bias correction to obtain the corrected first-order moment estimate and the corrected second moment estimate , the calculation formula is: (10); (11); Based on the corrected first-order moment estimation and the corrected second moment estimate , update the model parameters , specifically: (12); in, and Represents the current time step The next time step and the current time step The model parameters, represents the learning rate, Represents a parameter that is protected against division by zero.

[0060] With bias correction, the Adam optimizer can adjust the size of its parameter updates more quickly, speeding up the initial learning process and improving the overall optimization efficiency.

[0061] S203. Using the test set, the performance of the intermediate model is evaluated to obtain an evaluation index; In S203, specifically, the test set is used to finally test the model performance, and the evaluation indicators of the intermediate model can be calculated based on the model prediction results of the test set, where the evaluation indicators include one or more of recall rate (Recall), precision rate (Precision), F1 score (F1-score), time gain (Time Gain, TG), average daily false alarm rate and Clarke Error Grid Analysis (Clarke Error Grid Analysis, CEG).

[0062] In a specific embodiment, when the CGM reading is lower than 70 mg / dL for 15 consecutive minutes, it is considered a hypoglycemic event, and when the CGM reading is higher than 70 mg / dL for 15 consecutive minutes, it is considered the end of the hypoglycemic event. Therefore, the 15th minute after the occurrence of the hypoglycemic event is the identification point (h). Each time the model predicts a hypoglycemic event (p), the warning is triggered only once. In order to effectively evaluate the warning algorithm, all warning points are taken as (p), and the corresponding warning classification method is as follows: True Positive (TP): If the warning point p is triggered half an hour to three minutes before the identification point h, it is considered as a successful early warning.

[0063] Late Alarm (LA): If the warning point p coincides with the time period of the hypoglycemia event, it is considered a late alarm.

[0064] False Positive (FP): If there is no hypoglycemia event within half an hour after the warning point p is triggered, it is considered a false positive and an erroneous warning.

[0065] False Negative (FN): If a hypoglycemia event is not classified as a true positive TP and a late alarm LA, it is considered a false negative and a warning is missed.

[0066] To avoid repeated classification, each warning point is classified only once and classified in the above classification order. According to the warning mechanism, if the CGM reading is already below the threshold, the warning will not be triggered. Therefore, in practical applications, the alarm judged as a late alarm LA will not be issued and should not be regarded as a false positive FP, but should be counted as a false negative FN. Since hypoglycemia events are low-probability events and belong to unbalanced data, preferably, recall rate, precision rate and F1 score are selected as evaluation indicators of the hypoglycemia prediction model.

[0067] Based on the model prediction results of the test set, the recall rate, precision rate, and F1 score can be calculated according to formulas (13) to (15), which are: (13); (14); (15); Recall measures the probability of a successful warning among all hypoglycemia events. Precision measures the probability of a correct warning among all warnings issued. The F1 score is the harmonic mean of the first two metrics and can provide a more comprehensive perspective when both recall and precision are important.

[0068] In some embodiments, in order to evaluate the practicality of the warning, time gain and average daily false alarm rate can also be introduced as evaluation indicators. Time gain is used to measure the time interval between the warning and the hypoglycemia event, reflecting the response time provided to the patient by the warning. In order to evaluate the credibility of the warning and the patient's experience of use, the average daily false alarm rate is introduced to measure the average probability of the patient receiving a false alarm every day during the use of CGM.

[0069] In other embodiments, the Clark error grid evaluation model can also be used to predict the blood sugar effect. Specifically, the predicted blood sugar value is paired with the true blood sugar value, and divided into five areas according to the error, marked as A to E, where the harmfulness gradually increases. Area A is a clinically accurate estimate that can correctly guide clinical treatment, and area B is a clinically acceptable estimate with a deviation of more than 20%. Area C is where the result may lead to potentially dangerous overtreatment, such as excessive injection of insulin. Area D is where severe hypoglycemia or hyperglycemia attacks are not identified, while Area E represents a completely wrong and opposite judgment, such as discriminating hypoglycemia as hyperglycemia. The more values ​​appear in Area A and Area B, the higher the proportion, that is, the higher the clinical practicality of the prediction.

[0070] S204. Determine whether the evaluation index meets the preset requirements. If so, use the intermediate model as the trained hypoglycemia prediction model.

[0071] In S204, specifically, the value of each evaluation indicator can be compared with a preset threshold range. If the value of each evaluation indicator is within the preset threshold range, it can be considered that the evaluation indicator meets the preset requirements, and the intermediate model is then used as a trained hypoglycemia prediction model.

[0072] In this embodiment, the LSTM-TCN model is trained, verified and tested using a training set, a validation set and a test set, which can effectively ensure the training effect of the hypoglycemia prediction model and improve the prediction performance of the hypoglycemia prediction model.

[0073] In practical applications, in order to compare the prediction performance of the LSTM-TCN model and the single model, the LSTM model, TCN model, RNN (Recurrent Neural Network) model and LSTM-TCN model were used to retrospectively predict hypoglycemia events in 12 diabetic patients. Preferably, the LSTM-TCN model includes an input layer, two LSTM layers, three TCN layers, a Dropout layer, an MLP layer and an output layer connected in sequence. According to the results in Table 1, the LSTM-TCN model is superior to the single LSTM model or TCN model in terms of evaluation indicators. The LSTM-TCN model achieved a recall rate of 76.20%, which is better than the LSTM model's 74.00% and the TCN model's 72.04%, and the precision rate is 78.43% better than other models, which shows that compared with other single models, the LSTM-TCN model can more correctly warn of hypoglycemia events, reduce missed reports, and reduce unknown hypoglycemia risks. At the same time, the F1 score of the LSTM-TCN model reached 74.64%, which is higher than the LSTM model and the TCN model, reflecting the balanced performance of the model.

[0074] Table 1 Statistics of hypoglycemia event prediction performance

[0075] In terms of time gain, the LSTM-TCN model leads with an average of 11.56 minutes, the largest time gain among all models, which provides patients with longer intervention time. At the same time, the LSTM-TCN model retains the advantage of the TCN model's low daily average false alarm rate, and patients may receive only two unnecessary warnings in 15 days.

[0076] Table 2 The proportion of each CEG region in each model under 30-minute prediction time

[0077] Figure 5Table 2 shows the CEG of blood glucose in the next 30 minutes for 14 patients predicted by the above method. The A area of ​​the LSTM-TCN model accounts for 92.12%, which is higher than the 91.2% of the LSTM model, the 91.33% of the TCN model, and the 91.14% of the RNN model. At the same time, the A+B area accounts for the highest proportion among all models, reaching 99.56%, which shows that the LSTM-TCN model is superior to other models in clinical accuracy.

[0078] like Figure 6 As shown, in another embodiment of the present application, a hypoglycemia early warning system is also provided, comprising: The processing unit 10 is used to obtain blood sugar time series sample data and preprocess the blood sugar time series sample data to obtain preprocessed data; A construction unit 11 is used to construct an LSTM-TCN model with blood glucose time series data as input and blood glucose prediction values ​​of a preset prediction step as output, wherein the LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence; A training unit 12 is used to construct a training data set according to the preprocessed data, and use the training data set to train the LSTM-TCN model to obtain a trained hypoglycemia prediction model; The prediction unit 13 is used to obtain blood sugar time series monitoring data, and use the hypoglycemia prediction model to predict the blood sugar value of a preset prediction step length according to the blood sugar time series monitoring data to obtain the blood sugar prediction value of the preset prediction step length; The warning unit 14 is used to issue a hypoglycemia warning according to a blood glucose prediction value of a preset prediction step and a preset warning mechanism.

[0079] In other embodiments of the present application, the processing unit 10, when performing preprocessing on the blood glucose time series sample data to obtain preprocessed data, is specifically used to: Using the confidence interval or n-sigma interval, outlier elimination or interpolation processing is performed on the blood glucose time series sample data to obtain first processed data; Using an adaptive Kalman filter algorithm, performing noise reduction processing on the first processed data to obtain second processed data; Using a z-score standardization method, the second processed data is standardized to obtain third processed data; The third processed data is processed using a sliding window method to obtain preprocessed data.

[0080] In other embodiments of the present application, the LSTM-TCN model includes a first LSTM layer, a second LSTM layer, and a TCN unit connected in sequence, wherein the TCN unit includes at least one TCN layer connected in sequence, wherein: A first LSTM layer, used for outputting a first temporary variable based on the preprocessed data; A second LSTM layer is used to output an LSTM activation value based on the first temporary variable; The TCN unit is used to output a blood glucose prediction value with a preset prediction step size based on an LSTM activation value and a Sigmoid activation function.

[0081] In other embodiments of the present application, the TCN unit is specifically used for: Use the LSTM activation value as the input of the first TCN layer; Using at least one TCN layer, one-dimensional convolution is performed based on the input of the TCN layer and the preset dilation factor, convolution kernel, sliding step size, and padding step size to obtain the output of the one-dimensional convolution layer; Based on the pre-set hyperparameters, the output of the one-dimensional convolutional layer is feature screened and clipped to obtain a second temporary variable; The second temporary variable is corrected using the Sigmoid activation function to obtain the output of the TCN layer; Repeat the above steps. Each time the above steps are repeated, the expansion factor and the padding step are increased exponentially until the receptive field length of the one-dimensional convolutional layer of a certain TCN layer is consistent with the preset input step length. The current output of the TCN layer is used as the blood glucose prediction value of the preset prediction step length.

[0082] In other embodiments of the present application, the maximum number of TCN layers in a TCN unit is ,in, Indicates the preset maximum number of TCN layers. Indicates the expansion factor increment multiple, Indicates the preset input step size.

[0083] In other embodiments of the present application, the training unit 12, when executing the steps of constructing a training data set according to the preprocessed data and training the LSTM-TCN model using the training data set to obtain a trained hypoglycemia prediction model, is specifically used for: Divide the preprocessed data into training set, validation set and test set; Use the Adam optimizer, set the learning rate, train the LSTM-TCN model with the training set, adopt the early stopping mechanism, and tune the parameters with the validation set to obtain a trained intermediate model; Use the test set to evaluate the performance of the intermediate model and obtain the evaluation index; Determine whether the evaluation index meets the preset requirements. If so, use the intermediate model as the trained hypoglycemia prediction model.

[0084] In other embodiments of the present application, the preset warning mechanism includes one or more of the following warning mechanisms: When a single point in the blood sugar prediction value of the preset prediction step length is less than the preset hypoglycemia threshold, a hypoglycemia warning is triggered; When the blood glucose prediction values ​​within the preset prediction step length are less than the preset hypoglycemia threshold value for consecutive k moments, a hypoglycemia warning is triggered; When the cumulative amount of blood sugar decreases for k consecutive moments within the blood sugar prediction value with a preset prediction step length exceeds a predetermined decrease threshold, a hypoglycemia warning is triggered.

[0085] like Figure 7 As shown, in another embodiment of the present application, a hypoglycemia warning terminal is also provided, including: a storage medium 20 and a processor 21; The storage medium 20 stores computer-executable instructions; The processor 21 executes the computer-executable instructions stored in the storage medium 20 to implement the hypoglycemia early warning method as described above.

[0086] Among them, the processor 21 may include one or more processing cores. The processor 21 executes various functions and processes data of the present application by running or executing instructions, programs, code sets or instruction sets stored in the storage medium 20, calling data stored in the storage medium 20. The processor 21 can be at least one of a special application integrated circuit, a digital signal processor, a digital signal processing device, a programmable logic device, a field programmable gate array, a central processing unit, a controller, a microcontroller and a microprocessor. It can be understood that for different devices, the electronic device used to implement the functions of the above-mentioned processor 21 can also be other.

[0087] The storage medium 20 may be used to store instructions, programs, codes, code sets or instruction sets. The storage medium 20 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the above-mentioned hypoglycemia early warning method, etc.; the data storage area may store data involved in the above-mentioned hypoglycemia early warning method, etc.

[0088] In another embodiment of the present application, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the hypoglycemia warning method as described above.

[0089] The computer-readable storage medium may be a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, or a CD, etc., which may store program codes.

[0090] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A hypoglycemia early warning method, characterized in that: include: Acquiring blood sugar time series sample data, and preprocessing the blood sugar time series sample data to obtain preprocessed data; Constructing an LSTM-TCN model with blood glucose time series data as input and blood glucose prediction value with a preset prediction step as output, wherein the LSTM-TCN includes at least two LSTM layers and one TCN layer connected in sequence; Constructing a training data set according to the preprocessed data, and using the training data set to train the LSTM-TCN model to obtain a trained hypoglycemia prediction model; Acquire blood glucose time series monitoring data, and use the hypoglycemia prediction model to predict blood glucose values ​​with a preset prediction step length according to the blood glucose time series monitoring data to obtain a blood glucose prediction value with a preset prediction step length; A hypoglycemia warning is performed based on the blood glucose prediction value of the preset prediction step and the preset warning mechanism.

2. The method according to claim 1, characterized in that The preprocessing of the blood glucose time series sample data to obtain preprocessed data includes: Using the confidence interval or the n-sigma interval, performing outlier elimination or interpolation processing on the blood glucose time series sample data to obtain first processed data; Using an adaptive Kalman filter algorithm, performing noise reduction processing on the first processed data to obtain second processed data; Using a z-score standardization method, standardizing the second processed data to obtain third processed data; The third processed data is processed using a sliding window method to obtain preprocessed data.

3. The method according to claim 1, characterized in that The LSTM-TCN model includes a first LSTM layer, a second LSTM layer and a TCN unit connected in sequence, wherein the TCN unit includes at least one TCN layer connected in sequence, wherein: The first LSTM layer is used to output a first temporary variable based on the preprocessed data; The second LSTM layer is used to output an LSTM activation value based on the first temporary variable; The TCN unit is used to output a blood glucose prediction value with a preset prediction step size based on the LSTM activation value and the Sigmoid activation function.

4. The method according to claim 3, characterized in that The TCN unit is specifically used for: Using the LSTM activation value as the input of the first TCN layer; Using at least one TCN layer, one-dimensional convolution is performed based on the input of the TCN layer and the preset dilation factor, convolution kernel, sliding step size, and padding step size to obtain the output of the one-dimensional convolution layer; Based on the preset hyperparameters, feature screening and clipping are performed on the output of the one-dimensional convolutional layer to obtain a second temporary variable; The second temporary variable is modified using a Sigmoid activation function to obtain the output of the TCN layer; Repeat the above steps, and each time the above steps are repeated, the expansion factor and the filling step are increased exponentially until the receptive field length of the one-dimensional convolutional layer of a certain TCN layer is consistent with the preset input step length, and the current output of the TCN layer is used as the blood glucose prediction value of the preset prediction step length.

5. The method according to claim 4, characterized in that The maximum number of TCN layers in the TCN unit is ,in, Indicates the preset maximum number of TCN layers. Indicates the expansion factor increment multiple, Represents the preset input step size.

6. The method according to claim 1, characterized in that The step of constructing a training data set according to the preprocessed data, and using the training data set to train the LSTM-TCN model to obtain a trained hypoglycemia prediction model includes: Dividing the preprocessed data into a training set, a validation set, and a test set; Using the Adam optimizer, setting the learning rate, training the LSTM-TCN model with the training set, adopting an early stopping mechanism, and performing parameter tuning with the validation set to obtain a trained intermediate model; Using the test set, performing performance evaluation on the intermediate model to obtain an evaluation index; It is determined whether the evaluation index meets the preset requirements. If so, the intermediate model is used as a trained hypoglycemia prediction model.

7. The method according to claim 1, characterized in that The preset warning mechanism includes one or more of the following warning mechanisms: When a single point in the blood glucose prediction value of the preset prediction step length is less than a predetermined hypoglycemia threshold, a hypoglycemia warning is triggered; When the blood glucose prediction values ​​of the preset prediction step length are less than the predetermined hypoglycemia threshold value at consecutive k moments, a hypoglycemia warning is triggered; When the cumulative amount of blood sugar decreases for k consecutive moments within the blood sugar prediction value of the preset prediction step exceeds a predetermined decrease threshold, a hypoglycemia warning is triggered.

8. A hypoglycemia early warning system, characterized in that: include: A processing unit, used for acquiring blood sugar time series sample data, and preprocessing the blood sugar time series sample data to obtain preprocessed data; A construction unit, used to construct an LSTM-TCN model with blood glucose time series data as input and blood glucose prediction value of a preset prediction step as output, wherein the LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence; A training unit, configured to construct a training data set according to the preprocessed data, and train the LSTM-TCN model using the training data set to obtain a trained hypoglycemia prediction model; A prediction unit, used to obtain blood glucose time series monitoring data, and use the hypoglycemia prediction model to predict the blood glucose value of a preset prediction step length according to the blood glucose time series monitoring data to obtain a blood glucose prediction value of the preset prediction step length; The early warning unit is used to issue a low blood sugar early warning according to the blood sugar prediction value of the preset prediction step and the preset early warning mechanism.

9. A hypoglycemia warning terminal, characterized in that: include: Storage media and processors; The storage medium stores computer-executable instructions; The processor executes the computer-executable instructions stored in the storage medium to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

Citation Information

Patent Citations

  • Personalized diabetes health management system, equipment and storage medium

    CN112102953A

  • Blood glucose data processing method for hypoglycemia early warning

    CN113948207A

  • Surface ocean current prediction method based on attention mechanism TCN-LSTM model

    CN117195958A

  • Predicting ventricular fibrillation

    US20210330238A1

  • Nonparametric glucose predictors

    US20220202323A1