Sleep data processing method and system based on AI intelligent algorithm

Through the sleep data processing method based on AI intelligent algorithm, combined with KD tree and weighted processing technology, the problem of sleep data recognition errors in the existing technology is solved, and higher recognition accuracy and efficiency are achieved.

CN119442056BActive Publication Date: 2025-05-23XIAN ZHONGSHENGKAIXIN TECH DEV

Patent Information

Application Number
CN202510015362.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-05-23
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify the sleep state corresponding to sleep data, especially because the amount of data varies greatly from different sleep states, resulting in errors in identifying REM sleep states and deep sleep states.

Method used

Sleep data processing method based on AI intelligent algorithm is adopted to obtain heart rate data and brain wave data, calculate the degree of local fluctuations and probability, combine the KD tree to identify the sleep state, and improve the recognition accuracy through weighted processing.

Benefits of technology

It effectively improves the accuracy and efficiency of sleep state recognition in the sleep dataset, and reduces the identification errors of REM sleep state and deep sleep state.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119442056B_ABST
    Figure CN119442056B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and in particular to a sleep data processing method and system based on an AI intelligent algorithm. The method includes the steps of: obtaining heart rate data points and brain wave data points corresponding to each acquisition time in a sleep data set; respectively calculating the probability that each acquisition time belongs to a REM sleep state and the probability that each acquisition time in the remaining acquisition times belongs to a deep sleep state; obtaining the acquisition time corresponding to the deep sleep state in the sleep data set by comparing the probability that each acquisition time belongs to a deep sleep state with a preset deep sleep threshold; determining the weight of the acquisition time corresponding to the REM sleep state; weighting by the weight of the acquisition time corresponding to the REM sleep state or the deep sleep state, and training based on the weighted REM sleep state and deep sleep state to realize the processing of sleep data, effectively improving the accuracy of sleep data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a sleep data processing method and system based on an AI intelligent algorithm. Background Art

[0002] Sleep quality is one of the indicators to measure an individual's health status. Long-term lack of sleep or poor sleep quality is associated with a variety of health problems. By monitoring sleep quality, potential sleep problems can be discovered and intervened in a timely manner, thereby preventing the occurrence of such diseases.

[0003] In order to monitor the sleep quality of the human body, the prior art provides a large number of sleep data processing methods. For example, a patent application document with publication number CN118467089A discloses a visualization processing method and system for sleep quality. The application obtains sleep-related data; divides the sleep state according to the sleep-related data to generate a sleep state data array; loads the sleep-related data and the sleep state data array into an initialization sleep interface, and performs visualization processing to generate a sleep state chart and a sleep data module to create a sleep quality interface.

[0004] The above-mentioned prior art can facilitate users to understand the difference in sleep status in a timely and rapid manner by visualizing sleep data. However, the sleep data generated during human sleep includes the relaxed awake state, light sleep state, deep sleep state and rapid eye movement (REM) sleep state. The overall data volume is large and the importance of different sleep state data is different. If the same processing method is used for all sleep data, it may lead to sleep state recognition errors for sleep data with higher importance but less data volume.

[0005] Based on this, how to accurately obtain the sleep state corresponding to the sleep data is a technical problem that needs to be solved urgently by technical personnel in this field. Summary of the invention

[0006] In order to solve the technical problem of how to accurately obtain the sleep state corresponding to the sleep data, the present invention provides a sleep data processing method and system based on an AI intelligent algorithm.

[0007] In the first aspect, the present invention provides a sleep data processing method based on an AI intelligent algorithm, which adopts the following technical solutions:

[0008] The sleep data processing method based on AI intelligent algorithm includes the following steps:

[0009] Obtain the heart rate data points and brain wave data points corresponding to each collection moment in the sleep data set; obtain the local fluctuation degree through the difference of the heart rate data on both sides of the heart rate data point; obtain the probability of each collection moment belonging to the REM sleep state through the difference between the local fluctuation degree of the heart rate data point corresponding to the collection moment and the maximum value of the local fluctuation degree in the sleep data set; obtain the collection moment corresponding to the REM sleep state in the sleep data set by comparing the probability of the collection moment belonging to the REM sleep state with the preset REM sleep threshold; obtain the probability that each collection moment in the remaining collection moments belongs to the deep sleep state through the amplitude change of the brain wave data points at the remaining collection moments except the REM sleep state in the sleep data set; obtain the collection moment corresponding to the deep sleep state in the sleep data set by comparing the probability of each collection moment belonging to the deep sleep state with the preset deep sleep threshold; ; is the weight of the acquisition time corresponding to the REM sleep state, is the ratio of the total duration of REM sleep to the total duration of sleep data collection. is the mean probability of belonging to REM sleep state at each acquisition time, is an exponential function with e as the base; the weight of the collection time corresponding to the deep sleep state is calculated; and training is performed after weighting by the weight of the collection time corresponding to the REM sleep state or the deep sleep state to realize the processing of sleep data.

[0010] The present invention can effectively improve the accuracy and efficiency of sleep state recognition in a sleep data set by constructing a KD tree to identify the sleep state at each collection moment in a sleep data set. In this process, the present invention takes into account that the data volume corresponding to different types of sleep states in the sleep data set is relatively different, resulting in the REM sleep state and deep sleep state with less data volume being incorrectly recognized when the sleep state is identified based on the KD tree; based on this, the present invention analyzes the heart rate data and brain wave data features at each collection moment in the sleep data set, obtains the probability of each collection moment belonging to the REM sleep state and the deep sleep state, and weights the collection moments, thereby effectively improving the accuracy of the KD tree in identifying the sleep state, and effectively improving the accuracy of sleep data processing.

[0011] According to the sleep data processing method based on AI intelligent algorithm provided by the present invention, the step of obtaining the heart rate data points and brain wave data points corresponding to each collection moment in the sleep data set also includes: collecting the heart rate data and brain wave data generated during human sleep and performing preprocessing to obtain the sleep data set.

[0012] The present invention takes into account that there may be data noise and missing values ​​in the originally collected sleep data, and therefore improves the overall quality of the data through preprocessing.

[0013] According to the sleep data processing method based on AI intelligent algorithm provided by the present invention, the method for obtaining the local fluctuation degree of the heart rate data point includes: obtaining a sliding window of the heart rate data point; recording the mean heart rate in the sliding window when the heart rate data point is at different positions in the sliding window as the sliding value of the heart rate data point at each position; obtaining the mean of the absolute values ​​of the differences between the heart rate value of the heart rate data point and its sliding value at each position, and recording the product of the mean and the mean of the absolute values ​​of the differences between the sliding values ​​of the heart rate data point at the starting position and the end position in the sliding window as the local fluctuation degree of the heart rate data point.

[0014] The present invention can accurately obtain the heart rate data fluctuations on both sides of the heart rate data point by analyzing the changes in the heart rate data when the heart rate data point is located at different positions of the sliding window, thereby accurately obtaining the local fluctuation degree of the heart rate data point.

[0015] According to the sleep data processing method based on AI intelligent algorithm provided by the present invention, the probability of each acquisition moment belonging to the REM sleep state satisfies the relationship:

[0016] ;

[0017] is the probability of belonging to REM sleep state at the i-th acquisition moment, , are the i-th collection time, The local fluctuation degree of the heart rate data point corresponding to the collection time, is the maximum value of the local fluctuation degree, , are the values ​​at the i-th collection time and the collection time corresponding to the maximum value of the local fluctuation degree, respectively. The total duration of sleep data collection. is a linear normalization function.

[0018] The present invention provides an accurate calculation formula for the probability that the acquisition moment belongs to the REM sleep state. By analyzing the change of the local fluctuation degree at the acquisition moment and the proximity between the current acquisition moment and the acquisition moment of the maximum local fluctuation degree, the probability that the current acquisition moment belongs to the REM sleep state is accurately obtained.

[0019] According to the sleep data processing method based on AI intelligent algorithm provided by the present invention, the method for obtaining the probability that each acquisition moment belongs to a deep sleep state includes: taking the amplitude average of the brain wave data points corresponding to the acquisition moments before and after a collection moment as the slope of the collection moment; selecting the nearest adjacent troughs and peaks on the left and right sides of the collection moment according to the slope, and calculating the probability that each collection moment belongs to a deep sleep state.

[0020] According to the sleep data processing method based on AI intelligent algorithm provided by the present invention, the probability of each acquisition moment belonging to the deep sleep state satisfies the relationship:

[0021] ;

[0022] For the The probability of being in deep sleep state at the time of collection, For the The amplitude difference between the nearest trough and peak on the left and right sides of the acquisition time, is the amplitude difference between the lowest trough and the highest peak of the EEG data points corresponding to the remaining acquisition moments, , Respectively The interval between the collection time and the collection time of the nearest trough and peak on the left and right sides, is the maximum value of the continuous collection duration in the remaining collection moments, For the The amplitude difference between the nearest adjacent troughs or peaks on the left and right sides of the acquisition instant.

[0023] According to the sleep data processing method based on AI intelligent algorithm provided by the present invention, the collection time corresponding to the REM sleep state in the sleep data set is obtained by comparing the probability that the collection time belongs to the REM sleep state with the preset REM sleep threshold, including: if the probability that the collection time belongs to the REM sleep state is greater than the preset REM sleep threshold, then the collection time is the REM sleep state.

[0024] According to the sleep data processing method based on AI intelligent algorithm provided by the present invention, the training is performed after weighting by the weight of the collection time corresponding to the REM sleep state or the deep sleep state to realize the processing of sleep data, including: after constructing a KD tree based on the weighted REM sleep state and deep sleep state, the latest sleep data is input into the KD tree to obtain the sleep state corresponding to the latest sleep data.

[0025] The present invention can effectively improve the accuracy and efficiency of sleep state recognition in a multidimensional sleep data set by constructing a KD tree to perform sleep state recognition in a sleep data set.

[0026] In a second aspect, the present invention provides a sleep data processing system based on an AI intelligent algorithm, which adopts the following technical solutions:

[0027] The sleep data processing system based on AI intelligent algorithm includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the sleep data processing method based on AI intelligent algorithm is implemented.

[0028] By adopting the above technical solution, the above sleep data processing method based on AI intelligent algorithm is generated into a computer program and stored in the memory to be loaded and executed by the processor, so that a terminal device is made according to the memory and the processor for easy use.

[0029] The present invention has the following technical effects:

[0030] Based on the above technical solution, when processing sleep data, the present invention can effectively improve the accuracy and efficiency of sleep state recognition in the sleep data set by constructing a KD tree to identify the sleep state at each collection moment in the sleep data set. In this process, the present invention takes into account that the data volume corresponding to different types of sleep states in the sleep data set is quite different, which leads to the error in identifying the sleep state with less data volume when the sleep state is identified based on the KD tree; based on this, the present invention analyzes the heart rate data and brain wave data characteristics at each collection moment in the sleep data set, obtains the probability that each collection moment belongs to the REM sleep state and deep sleep state with less data volume in the sleep state, and weights the collection moment, thereby effectively improving the accuracy of the KD tree in identifying the sleep state, and effectively improving the accuracy of sleep data processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.

[0032] Figure 1 A flowchart of a sleep data processing method based on an AI intelligent algorithm provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0034] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.

[0035] Sleep quality is one of the indicators to measure an individual's health status. Long-term lack of sleep or poor sleep quality is associated with a variety of health problems. By monitoring sleep quality, potential sleep problems can be discovered and intervened in a timely manner, thereby preventing the occurrence of such diseases.

[0036] The human body generates multidimensional data during sleep, and the amount of sleep data is large. The KD-Tree (K-Dimensional Tree, referred to as KD-Tree) algorithm is a binary tree structure that partitions the space of K-dimensional data and is often used for neighbor search and cluster analysis of high-dimensional data.

[0037] Based on this, an embodiment of the present invention discloses a sleep data processing method based on an AI intelligent algorithm. The method uses a KD tree to perform cluster analysis on multidimensional data (for example, brain waves, heart rate and other indicators) collected during human sleep, thereby identifying different sleep stages.

[0038] For details, please refer to Figure 1 As shown, Figure 1 A flowchart of a sleep data processing method based on an AI intelligent algorithm provided in an embodiment of the present invention is provided. The method specifically includes the following steps.

[0039] S1: Obtain the heart rate data points and brain wave data points corresponding to each collection moment in the sleep data set.

[0040] It should be noted that changes in heart rate can reflect the depth and stage of sleep. For example, in the deep sleep stage, the heart rate usually decreases; while in the REM sleep stage, the heart rate may increase slightly. Brain waves are bioelectric signals generated when information is transmitted between neurons. They can accurately reflect the activity state of the brain. The characteristics of brain waves in different sleep stages are different.

[0041] Based on this, the embodiment of the present invention determines the sleep stage of the human body by monitoring the heart rate data and brain wave data of the human body.

[0042] For example, in an embodiment of the present invention, the heart rate data points and brain wave data points corresponding to each collection time in the sleep data set are obtained, and the process also includes: collecting the heart rate data and brain wave data generated during human sleep and preprocessing them to obtain the sleep data set.

[0043] Among them, the preprocessing can be data denoising, missing data interpolation, data standardization processing, etc., which can be specifically set according to actual needs, and the embodiment of the present invention does not impose too many restrictions here.

[0044] Specifically, the heart rate data and brain wave data of the human body are collected by the EEG and ECG dual-channel monitoring and analysis equipment, and a heart rate data value and a brain wave data value are obtained at each collection moment, which are recorded as heart rate data points and brain wave data points respectively.

[0045] It is understandable that all the collection moments in a sleep data set are a complete sleep process. Among them, the heart rate data collection frequency is usually once per minute, the heart rate data is the number of heartbeats per minute, and the brain wave data collection frequency is usually once per second. In order to facilitate data processing, in the embodiment of the present invention, the heart rate data collected every minute can be used as the heart rate data of each second in each minute, that is, a heart rate data value and a brain wave data value are obtained at each collection moment.

[0046] It should be further explained that based on the above steps, human heart rate data and brain wave data can be obtained.

[0047] However, the sleep data generated during human sleep include the relaxed awake state, light sleep state, deep sleep state and REM sleep state. The deep sleep state stage is mainly composed of low-frequency slow-wave EEG activity, and the frequency of EEG activity is low, so the amount of data generated is small; REM sleep state usually shows high-frequency fluctuations, but its cycle in the overall sleep process is short and only occupies a small amount of time, so its data volume is also small; the relaxed awake state and light sleep state usually occupy a large proportion of the sleep process, at this time the frequency of EEG activity is high, the fluctuation is large, and a large amount of data is generated.

[0048] Therefore, there are large differences in the amount of data collected for various sleep states. When the median of one dimension is selected through the KD tree to divide the data, the KD tree will become unbalanced, causing the algorithm to tend to recognize the majority categories of relaxed wakefulness and light sleep states, while the recognition ability for the minority categories of deep sleep and REM sleep states is poor.

[0049] Based on this, an embodiment of the present invention obtains the probability that the heart rate data and the brain wave data belong to the REM sleep state and the deep sleep state, and obtains the weight of each collection time through the probability that the heart rate data and the brain wave data belong to the REM sleep state and the deep sleep state. When dividing the KD tree, the accuracy of the KD tree in identifying the sleep state can be improved by weighting the collection time on the dimension, that is, continue to execute the following steps.

[0050] S2: The local fluctuation degree of the heart rate data point is obtained by the difference between the heart rate data on both sides of the heart rate data point; the probability of each collection moment belonging to the REM sleep state is obtained by the difference between the local fluctuation degree of the heart rate data point corresponding to each collection moment and the maximum local fluctuation degree in the sleep data set.

[0051] It should be noted that among the heart rate indicators, the difference between REM sleep state and other states is more obvious. Compared with other sleep states, the local fluctuation degree of REM sleep state is large and it is in the later stage of sleep.

[0052] Based on this, the embodiment of the present invention can obtain the collection time belonging to the REM sleep state by analyzing the local change characteristics of the heart rate data.

[0053] By way of example, in an embodiment of the present invention, a method for obtaining the degree of local fluctuation of a heart rate data point includes: obtaining a sliding window of the heart rate data point; recording the mean heart rate in the sliding window when the heart rate data point is at different positions in the sliding window as the sliding value of the heart rate data point at each position; obtaining the mean of the absolute values ​​of the differences between the heart rate value of the heart rate data point and its sliding values ​​at each position, and recording the product of the mean and the mean of the absolute values ​​of the differences between the sliding values ​​of the heart rate data point at the starting position and the end position in the sliding window as the degree of local fluctuation of the heart rate data point.

[0054] Among them, the size of the sliding window of heart rate data points can be set to 5; the size of the sliding window is the number of heart rate data points contained in the sliding window. The size of the sliding window can be set according to actual needs, and the embodiment of the present invention does not impose too many restrictions on this.

[0055] For example, the sliding step size of the sliding window may be set to 1; it may be specifically set according to actual needs.

[0056] For example, the local fluctuation degree of the heart rate data point is determined, and the specific relationship can be as follows:

[0057] ;

[0058] is the local fluctuation degree of the heart rate data point corresponding to the i-th acquisition moment, , are the sliding values ​​of the starting position or the end position of the heart rate data point corresponding to the i-th acquisition moment in the sliding window, is the sliding value of the heart rate data point at the jth position in the sliding window corresponding to the i-th acquisition moment, is the heart rate value of the heart rate data point corresponding to the i-th acquisition moment, is the size of the sliding window, is a linear normalization function.

[0059] In the above formula, It indicates the difference in heart rate fluctuation on both sides of the heart rate data point corresponding to the i-th collection moment. The larger the value, the greater the degree of local fluctuation of the heart rate data point corresponding to the i-th collection moment.

[0060] It indicates the overall heart rate fluctuation on both sides of the heart rate data point corresponding to the i-th collection moment. The larger the value, the greater the local fluctuation of the heart rate data point corresponding to the i-th collection moment.

[0061] It is understandable that there is not enough sliding space for the heart rate data points at some collection moments, resulting in the inability to construct a sliding window of sufficient size. For such heart rate data points, the sliding value is calculated based on the heart rate data points actually obtained in the sliding window.

[0062] Specifically, if the number of heart rate data points in the sliding window is greater than or equal to 2 and less than 5, the heart rate variance of the heart rate data point in the current sliding window can be used as the sliding value; if the number of heart rate data points in the sliding window is less than 2, the heart rate value of the heart rate data point in the current sliding window can be used as the sliding value.

[0063] Take an example to illustrate how to obtain heart rate data points at different positions in the sliding window: if the size of the sliding window is 5, the current heart rate data point can be used as the end point of the sliding window to calculate the mean heart rate in the sliding window at this time; then continue to slide the sliding window to the right to obtain the mean heart rate in the sliding window when the current heart rate data point is at the fourth, third, second and starting positions respectively.

[0064] After obtaining the local fluctuation degree of the heart rate data points corresponding to each collection moment based on the above steps, the probability that each collection moment belongs to the REM sleep state can be determined based on the local fluctuation degree of the heart rate data points corresponding to each collection moment.

[0065] For example, in the embodiment of the present invention, the probability of each acquisition moment belonging to the REM sleep state is determined, and the specific details can be referred to the following relationship:

[0066] ;

[0067] is the probability of belonging to REM sleep state at the i-th acquisition moment, , are the i-th collection time, The local fluctuation degree of the heart rate data point corresponding to the collection time, is the maximum value of the local fluctuation degree, , are the values ​​at the i-th collection time and the collection time corresponding to the maximum value of the local fluctuation degree, respectively. The total duration of sleep data collection. is a linear normalization function.

[0068] It represents the difference between the local fluctuation degree at the i-th acquisition moment and the maximum local fluctuation degree. The smaller the value, the closer the local fluctuation degree at the current acquisition moment is to the maximum local fluctuation degree. During REM sleep, the heart rate data is close to the maximum heart rate during the entire sleep process. Therefore, the closer the local fluctuation degree at the current acquisition moment is to the maximum local fluctuation degree, the greater the probability that the current acquisition moment belongs to REM sleep.

[0069] Indicates the local fluctuation degree at the i-th acquisition time and the The difference between the local fluctuations at the time of collection. The larger the value, the more intense the change in heart rate data. The heart rate data during REM sleep has the largest fluctuation during the entire sleep process. Therefore, the more intense the change in heart rate data, the greater the probability that the current collection time belongs to REM sleep state.

[0070] It is understandable that due to differences in individual sleep states, the maximum local fluctuation degree among all acquisition moments may not be unique. In this case, a local fluctuation degree threshold can be preset, and the acquisition moment greater than the local fluctuation degree threshold can be used as the target moment, and the local fluctuation degree of the median of the heart rate data point corresponding to the target moment can be used as the maximum local fluctuation degree.

[0071] The third quartile of the heart rate data points corresponding to all acquisition moments may be set as the local fluctuation degree threshold, which may be specifically set according to actual needs.

[0072] After analyzing the heart rate data based on the above steps to obtain the probability of each collection moment being in the REM sleep state, the collection moment corresponding to the REM sleep state in the sleep data set can be obtained by comparing the probability of each collection moment being in the REM sleep state with the preset threshold.

[0073] By way of example, in an embodiment of the present invention, the collection moment corresponding to the REM sleep state in the sleep data set is obtained by comparing the probability of each collection moment belonging to the REM sleep state with a preset threshold, including: if the probability of the collection moment belonging to the REM sleep state is greater than the preset REM sleep threshold, then the collection moment is the REM sleep state.

[0074] The REM sleep threshold may be set to 0.7; it may be set specifically according to actual needs, and the embodiment of the present invention does not impose too many limitations on this.

[0075] After filtering out the collection time corresponding to the REM sleep state in the sleep data set based on the above steps, continue to perform the following steps.

[0076] S3: The probability that each of the remaining acquisition moments belongs to the deep sleep state is obtained by the amplitude change of the brain wave data points at the remaining acquisition moments except the REM sleep state in the sleep data set.

[0077] It should be noted that after the collection time corresponding to the REM sleep state in the sleep data set is screened out based on the above steps, the sleep states corresponding to the remaining collection time in the sleep data set may be three types, namely, deep sleep state, relaxed awake state and light sleep state. The deep sleep state is quite different from the relaxed awake state and light sleep state in the EEG signal data.

[0078] Based on this, the embodiment of the present invention can obtain the collection time belonging to the deep sleep state from the remaining collection time in the sleep data set except the REM sleep state by analyzing the waveform amplitude distribution of the brain wave index during sleep.

[0079] By way of example, in an embodiment of the present invention, the method for obtaining the probability that each acquisition moment belongs to a deep sleep state includes: taking the amplitude average of the EEG data points corresponding to the acquisition moments before and after a collection moment as the slope of the collection moment; selecting the nearest adjacent troughs and peaks on the left and right sides of the collection moment according to the slope, and calculating the probability that each collection moment belongs to a deep sleep state.

[0080] It is understandable that the slope at the time of collection may be positive or negative. When the slope is 0, it means that the EEG data point at the current time of collection is at a peak or a trough. For such EEG data points, the embodiment of the present invention does not process them.

[0081] Specifically, when the When the slope at the acquisition time is greater than 0, the first The nearest trough to the left at the time of collection, and The nearest peak on the right at the time of acquisition. The interval between the collection time and the collection time of the nearest trough on the left is , No. The interval between the collection time and the collection time of the nearest adjacent peak on the right is , No. The amplitude difference between the nearest adjacent trough on the left and the nearest adjacent peak on the right at the time of acquisition is .

[0082] In this case, you can get the The amplitude difference between the nearest adjacent troughs on the left and right sides at the time of acquisition is recorded as .

[0083] When When the slope at the time of acquisition is less than 0, the first The nearest peak on the left at the time of acquisition, and the The nearest trough on the right at the time of collection. The interval between the acquisition time and the acquisition time of the nearest peak on the left is , No. The interval between the collection time and the collection time of the nearest trough on the right is , No. The amplitude difference between the nearest adjacent peak on the left and the nearest adjacent trough on the right at the time of acquisition is .

[0084] In this case, you can get the The amplitude difference between the nearest adjacent peaks on the left and right sides at the time of acquisition is recorded as .

[0085] Based on the above steps, the slope of the EEG data points corresponding to each acquisition time can be obtained, and the EEG amplitude fluctuation in the deep sleep state is large, the fluctuation changes slowly, and the waveform is irregular. Based on this, the embodiment of the present invention can accurately obtain the probability of each acquisition time belonging to the deep sleep state by analyzing the amplitude fluctuation of the EEG data points corresponding to each acquisition time in the remaining acquisition times in the sleep data set except the REM sleep state.

[0086] For example, in the embodiment of the present invention, the probability of each acquisition moment belonging to the deep sleep state is determined, and the specific details can be referred to the following relationship:

[0087] ;

[0088] For the The probability of being in deep sleep state at the time of collection, For the The amplitude difference between the nearest trough and peak on the left and right sides of the acquisition time, is the amplitude difference between the lowest trough and the highest peak of the EEG data points corresponding to the remaining acquisition moments, , Respectively The interval between the collection time and the collection time of the nearest trough and peak on the left and right sides, is the maximum value of the continuous collection duration in the remaining collection moments, For the The amplitude difference between the nearest adjacent troughs or peaks on the left and right sides of the acquisition instant.

[0089] In the above formula, Indicates The amplitude fluctuation of the EEG data point corresponding to the collection moment. The larger the value, the greater the amplitude fluctuation of the EEG data point, and the greater the probability that the collection moment belongs to the deep sleep state.

[0090] Indicates The amplitude fluctuation speed of the EEG data point corresponding to the acquisition time is large, indicating that the The slower the amplitude fluctuation of the EEG data point corresponding to the collection moment, the smaller the probability that the collection moment belongs to the deep sleep state.

[0091] Indicates The regularity of the waveform of the EEG data point corresponding to the acquisition time, that is, The smaller the difference in amplitude between the nearest adjacent troughs or peaks on the left and right sides of the acquisition moment, the more regular the waveform is, and the greater the probability that the current acquisition moment is in a deep sleep state.

[0092] After obtaining the probability that the remaining collection moments in the sleep data set except the REM sleep state belong to the deep sleep state based on the above steps, continue to perform the following steps.

[0093] S4: Obtaining the collection time corresponding to the deep sleep state in the sleep data set by comparing the probability of each collection time belonging to the deep sleep state with the preset deep sleep threshold.

[0094] By way of example, in an embodiment of the present invention, the collection moment corresponding to the deep sleep state in the sleep data set is obtained by comparing the probability of each collection moment belonging to the deep sleep state with the preset deep sleep threshold, including: if the probability of the collection moment belonging to the deep sleep state is greater than the preset deep sleep threshold, then the collection moment is the deep sleep state.

[0095] The preset deep sleep threshold may be set to 0.6; the preset deep sleep threshold may be set according to actual needs, and the embodiment of the present invention does not impose too many restrictions on this.

[0096] After respectively screening out the collection moments corresponding to the REM sleep state and the deep sleep state in the sleep data set based on the above steps, a corresponding weight may be assigned to each collection moment.

[0097] S5: Calculate the weight of the collection time corresponding to the REM sleep state or the deep sleep state, and use the weight of the collection time corresponding to the REM sleep state or the deep sleep state to weight the heart rate data point or the brain wave data point.

[0098] For example, in the embodiment of the present invention, the weight of the collection time corresponding to the REM sleep state is calculated, and the specific details can be referred to the following relationship:

[0099] ;

[0100] is the weight of the acquisition time corresponding to the REM sleep state, is the ratio of the total duration of REM sleep to the total duration of sleep data collection. is the mean probability of belonging to REM sleep state at each acquisition time, is an exponential function with base e.

[0101] Similarly, the weight of the collection time corresponding to the deep sleep state can be obtained based on the calculation formula of the weight of the collection time corresponding to the REM sleep state, which is not elaborated in detail in the embodiment of the present invention.

[0102] It is understandable that, for other collection moments in the sleep data set except REM sleep state and deep sleep state, their weights can be set to 1, or no additional processing can be performed. The specific setting can be based on actual needs, and the embodiment of the present invention does not impose too many restrictions on this.

[0103] When weighting the weights of each collection moment obtained based on the above steps, the value of the heart rate data point or the value of the brain wave data point corresponding to the collection moment can be multiplied by the weight of the collection moment to achieve weighting of each collection moment, and continue to execute the following steps.

[0104] S6: Perform training based on the weighted REM sleep state and deep sleep state to achieve sleep data processing.

[0105] By way of example, in an embodiment of the present invention, training is performed based on weighted REM sleep states and deep sleep states to realize sleep data processing, including: after constructing a KD tree based on the weighted REM sleep states and deep sleep states, the latest sleep data is input into the KD tree to obtain the sleep state corresponding to the latest sleep data.

[0106] Specifically, when constructing a KD tree based on the weighted REM sleep state and deep sleep state, the sleep data set can be weighted by the weight of the collection time corresponding to each sleep state to obtain a weighted sleep data set; a weighted labeled sleep data set is obtained by manually marking each collection time in the weighted sleep data set with a corresponding sleep state label; the weighted labeled sleep data set is trained with a KD tree to obtain a KD tree that can be used for sleep state recognition.

[0107] The latest sleep data set is input into the constructed KD tree to obtain the sleep state corresponding to each collection moment in the latest sleep data set.

[0108] For example, when the weighted label sleep dataset is trained with a KD tree, the KD tree algorithm randomly selects the weighted median of one of the dimension data of the weighted label sleep dataset as a split point, divides the weighted label sleep dataset into a left subtree and a right subtree, and then selects split points in the left subtree and the right subtree for repeated division until all the data corresponding to all the collection moments in the weighted label sleep dataset are divided, thereby obtaining a KD tree that can be used for sleep state recognition.

[0109] The specific steps of performing KD tree training on the weighted label sleep dataset can be obtained through the existing technology, and will not be described in detail in the embodiment of the present invention.

[0110] It can be seen that in the embodiment of the present invention, when the sleep data is processed, the heart rate data points and brain wave data points corresponding to each collection moment in the sleep data set can be obtained; the local fluctuation degree is obtained by the difference between the heart rate data on both sides of the heart rate data point; the probability of each collection moment belonging to the REM sleep state is obtained by the difference between the local fluctuation degree of the heart rate data point corresponding to the collection moment and the maximum value of the local fluctuation degree in the sleep data set; the collection moment corresponding to the REM sleep state in the sleep data set is obtained by comparing the probability of the collection moment belonging to the REM sleep state with the preset REM sleep threshold; the probability of each collection moment in the remaining collection moments belonging to the deep sleep state is obtained by the amplitude change of the brain wave data points at the remaining collection moments except the REM sleep state in the sleep data set; the collection moment corresponding to the deep sleep state in the sleep data set is obtained by comparing the probability of each collection moment belonging to the deep sleep state with the preset deep sleep threshold; ; is the weight of the acquisition time corresponding to the REM sleep state, is the ratio of the total duration of REM sleep to the total duration of sleep data collection. is the mean probability of belonging to REM sleep state at each acquisition time, is an exponential function with e as the base; the weight of the collection time corresponding to the deep sleep state is calculated; and training is performed after weighting by the weight of the collection time corresponding to the REM sleep state or the deep sleep state to realize the processing of sleep data.

[0111] In this way, the embodiment of the present invention can effectively improve the accuracy and efficiency of sleep state recognition in the sleep data set by constructing a KD tree to identify the sleep state at each collection moment in the sleep data set. In this process, the embodiment of the present invention takes into account that the data volume corresponding to different types of sleep states in the sleep data set is quite different, which leads to the incorrect recognition of the sleep state with less data volume when the sleep state is identified based on the KD tree; based on this, the embodiment of the present invention analyzes the heart rate data and brain wave data features at each collection moment in the sleep data set, obtains the probability that each collection moment belongs to the REM sleep state and deep sleep state with less data volume in the sleep state, and weights the collection moment, thereby effectively improving the accuracy of the KD tree in identifying the sleep state, and effectively improving the accuracy of the sleep data processing.

[0112] An embodiment of the present invention also discloses a sleep data processing system based on an AI intelligent algorithm, including a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, a sleep data processing method based on an AI intelligent algorithm provided by the present invention is implemented.

[0113] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0114] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM, a dynamic random access memory DRAM, a static random access memory SRAM, an enhanced dynamic random access memory EDRAM, a high bandwidth memory HBM, a hybrid memory cube HMC, etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device.

[0115] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

[0116] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A sleep data processing method based on AI intelligent algorithm, characterized in that: include: Obtain the heart rate data points and brain wave data points corresponding to each collection time in the sleep data set; obtain the local fluctuation degree through the difference of the heart rate data on both sides of the heart rate data point; The probability of belonging to the REM sleep state at each collection moment is obtained by the difference between the local fluctuation degree of the heart rate data point corresponding to the collection moment and the maximum local fluctuation degree in the sleep data set; By comparing the probability of the acquisition time being in the REM sleep state with the preset REM sleep threshold, the acquisition time corresponding to the REM sleep state in the sleep data set is obtained; The probability that each of the remaining acquisition moments belongs to the deep sleep state is obtained by the amplitude change of the brain wave data points at the remaining acquisition moments except the REM sleep state in the sleep data set; the acquisition moment corresponding to the deep sleep state in the sleep data set is obtained by comparing the probability that each acquisition moment belongs to the deep sleep state with the preset deep sleep threshold; ; is the weight of the acquisition time corresponding to the REM sleep state, is the ratio of the total duration of REM sleep to the total duration of sleep data collection. is the mean probability of belonging to REM sleep state at each acquisition time, is an exponential function with base e; calculate the weight of the acquisition time corresponding to the deep sleep state; The training is performed by weighting the acquisition time corresponding to the REM sleep state and the deep sleep state to realize the processing of sleep data, including: After constructing a KD tree based on the weighted REM sleep state and deep sleep state, the latest sleep data is input into the KD tree to obtain the sleep state corresponding to the latest sleep data.

2. The sleep data processing method based on AI intelligent algorithm according to claim 1, characterized in that: The step of obtaining the heart rate data points and brain wave data points corresponding to each collection time in the sleep data set also includes: The heart rate data and brain wave data generated during human sleep are collected and preprocessed to obtain a sleep data set.

3. The sleep data processing method based on AI intelligent algorithm according to claim 1, characterized in that: The method for obtaining the local fluctuation degree of the heart rate data point includes: Get a sliding window of heart rate data points; The mean heart rate value in the sliding window when the heart rate data point is at different positions in the sliding window is recorded as the sliding value of the heart rate data point at each position; the mean of the absolute values ​​of the differences between the heart rate value of the heart rate data point and its sliding value at each position is obtained, and the product of the mean and the mean of the absolute values ​​of the differences between the sliding values ​​of the heart rate data point at the starting position and the end position in the sliding window is recorded as the local fluctuation degree of the heart rate data point.

4. The sleep data processing method based on AI intelligent algorithm according to claim 1, characterized in that: The probability of each acquisition moment belonging to the REM sleep state satisfies the relationship: ; is the probability of belonging to REM sleep state at the i-th acquisition moment, , are the i-th collection time, the The local fluctuation degree of the heart rate data point corresponding to the collection time, is the maximum value of the local fluctuation degree, , are the values ​​at the i-th collection time and the collection time corresponding to the maximum value of the local fluctuation degree, respectively. The total duration of sleep data collection. is a linear normalization function.

5. The sleep data processing method based on AI intelligent algorithm according to claim 1, characterized in that: The method for obtaining the probability of each acquisition moment belonging to the deep sleep state includes: The mean amplitude of the EEG data points corresponding to the previous and next acquisition moments is taken as the slope of the acquisition moment; The nearest trough and peak on the left and right sides of the acquisition time are selected according to the slope, and the probability of each acquisition time belonging to the deep sleep state is calculated.

6. The sleep data processing method based on AI intelligent algorithm according to claim 5 is characterized in that: The probability of each acquisition moment belonging to the deep sleep state satisfies the relationship: ; For the The probability of being in deep sleep state at the time of collection, is the amplitude difference between the lowest trough and the highest peak of the EEG data points corresponding to the remaining acquisition moments, is the maximum value of the continuous collection duration in the remaining collection moments, is a linear normalization function; When When the slope at the acquisition time is greater than 0, obtain the The nearest trough on the left at the time of acquisition and the The nearest peak on the right at the time of acquisition, The interval between the collection time and the collection time of the nearest trough on the left is , No. The interval between the collection time and the collection time of the nearest adjacent peak on the right is , No. The amplitude difference between the nearest adjacent trough on the left and the nearest adjacent peak on the right at the time of acquisition is , No. The amplitude difference between the nearest adjacent troughs on the left and right sides at the time of acquisition is .

7. The sleep data processing method based on AI intelligent algorithm according to claim 5, characterized in that: The probability of each acquisition moment belonging to the deep sleep state satisfies the relationship: ; For the The probability of being in deep sleep state at the time of collection, is the amplitude difference between the lowest trough and the highest peak of the EEG data points corresponding to the remaining acquisition moments, is the maximum value of the continuous collection duration in the remaining collection moments, is a linear normalization function; When When the slope at the acquisition time is less than 0, obtain the The nearest peak on the left at the time of acquisition and the The nearest trough on the right at the time of collection, The interval between the acquisition time and the acquisition time of the nearest peak on the left is , No. The interval between the collection time and the collection time of the nearest trough on the right is , No. The amplitude difference between the nearest adjacent peak on the left and the nearest adjacent trough on the right at the time of acquisition is , No. The amplitude difference between the nearest adjacent peaks on the left and right sides at the time of acquisition is .

8. The sleep data processing method based on AI intelligent algorithm according to claim 1, characterized in that: The method of obtaining the collection time corresponding to the REM sleep state in the sleep data set by comparing the probability that the collection time belongs to the REM sleep state with the preset REM sleep threshold value comprises: If the probability that the collection moment belongs to the REM sleep state is greater than a preset REM sleep threshold, the collection moment is the REM sleep state.

9. The sleep data processing system based on AI intelligent algorithm is characterized by: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the sleep data processing method based on the AI ​​intelligent algorithm according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Visual processing method and system about sleep quality

    CN118467089A

  • Sleep monitoring method, device and system and storage medium

    CN113679339A

  • Sleep monitoring method, device and equipment

    CN114587288A

Cited By

  • Heart rate data intelligent processing method and system based on feature domain dynamic decoupling

    CN121754146A

  • Feature domain dynamic decoupling-based intelligent processing method and system for heart rate data

    CN121754146B