Sleep quality detection method and device based on wearable device and storage medium

By collecting and processing sleep data on wearable devices, using the sleep quality detection model of Transformer architecture, the problem of insufficient accuracy and efficiency of sleep quality detection in the prior art is solved, and high-precision sleep quality detection is achieved.

CN120021941APending Publication Date: 2025-05-23SHENZHEN HONGXIN ZHILIAN DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411993738.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The prior art cannot effectively improve the accuracy and efficiency of sleep quality detection, and cannot comprehensively measure sleep quality.

Method used

Sleep data is collected through wearable devices, feature extraction and sleep stage classification is performed, and sleep quality detection model based on Transformer architecture is used to detect sleep feature subsequences of different sleep stages to generate a sleep quality index.

Benefits of technology

It realizes more refined and fast automated sleep quality detection, provides a high-precision sleep quality index, and can comprehensively measure sleep quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120021941A_ABST
    Figure CN120021941A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a sleep quality detection method and device based on wearable equipment, equipment and a storage medium, and belongs to the technical field of artificial intelligence. The method comprises the following steps: collecting sleep data of a user through a wearable device; performing feature extraction processing on the sleep data to obtain a sleep feature sequence; performing sleep stage classification processing on the sleep feature sequence to obtain sleep feature subsequences of at least two sleep stages; and performing sleep quality detection on the sleep feature sub-sequence of each sleep stage through a sleep quality detection model based on a Transform architecture to obtain a sleep quality index of the user. According to the embodiment of the invention, the accuracy and efficiency of sleep quality detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a sleep quality detection method, apparatus, device and storage medium based on a wearable device. Background Art

[0002] Good sleep is the basis for physical recovery, emotional stability, cognitive improvement, immune enhancement and cardiovascular health. It not only helps improve work efficiency and quality of life, but also promotes physical health and prolongs life.

[0003] Currently, wearable devices can provide some simple sleep detection results, such as sleep duration, details of deep and shallow sleep, etc., but they cannot give an accurate and quantifiable sleep quality index.

[0004] In the related art, the respiratory signal data collected by wearable devices during sleep is usually analyzed to obtain the Apnea-Hypopnea Index (AHI) to measure sleep quality. However, the analysis speed is slow, and the Apnea-Hypopnea Index can only reflect respiratory events during sleep and cannot comprehensively measure sleep quality.

[0005] Therefore, how to improve the accuracy and efficiency of sleep quality detection has become a technical problem that needs to be solved urgently. Summary of the invention

[0006] The main purpose of the embodiments of the present application is to propose a sleep quality detection method, apparatus, device and storage medium based on a wearable device, aiming to improve the accuracy and efficiency of sleep quality detection.

[0007] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a sleep quality detection method based on a wearable device, the method comprising:

[0008] Collect users’ sleep data through wearable devices;

[0009] Performing feature extraction processing on the sleep data to obtain a sleep feature sequence;

[0010] Performing sleep stage classification processing on the sleep feature sequence to obtain sleep feature subsequences of at least two sleep stages;

[0011] Through the sleep quality detection model based on the Transformer architecture, the sleep quality detection is performed on the sleep feature subsequence of each sleep stage to obtain the sleep quality index of the user.

[0012] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a sleep quality detection device based on a wearable device, the device comprising:

[0013] A sleep data collection module is used to collect the user's sleep data through a wearable device;

[0014] A sleep feature extraction module, used for performing feature extraction processing on the sleep data to obtain a sleep feature sequence;

[0015] A sleep feature classification module, used for performing sleep stage classification processing on the sleep feature sequence to obtain sleep feature subsequences of at least two sleep stages;

[0016] The sleep quality detection module is used to perform sleep quality detection on the sleep feature subsequence of each sleep stage through a sleep quality detection model based on the Transformer architecture to obtain the sleep quality index of the user.

[0017] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes a computer device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.

[0018] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0019] The sleep quality detection method, device, equipment and storage medium based on wearable devices proposed in the present application, the sleep quality detection method based on wearable devices, collects the user's sleep data through the wearable device; performs feature extraction processing on the sleep data to obtain a sleep feature sequence; performs sleep stage classification processing on the sleep feature sequence to obtain at least two sleep stage sleep feature subsequences; through a sleep quality detection model based on the Transformer architecture, performs sleep quality detection on the sleep feature subsequence of each sleep stage to obtain the user's sleep quality index. In this way, on the one hand, the wearable device can be used to collect detailed sleep data very flexibly and conveniently, providing a more comprehensive analysis basis for sleep quality detection; on the other hand, by classifying the sleep feature sequence in the sleep data into sleep stages, the sleep quality detection model based on the Transformer architecture can more clearly and meticulously capture the long-term dependencies and complex temporal relationships in the sleep features of different sleep stages, so as to better understand the contribution of the sleep features of different sleep stages to the overall sleep quality, and realize more refined and faster automated sleep quality detection, thereby improving the accuracy and efficiency of sleep quality detection, thereby providing users with a high-precision sleep quality index that can comprehensively measure sleep quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flow chart of a sleep quality detection method based on a wearable device provided in an embodiment of the present application;

[0021] Figure 2 is another flow chart of a sleep quality detection method based on a wearable device provided in an embodiment of the present application;

[0022] Figure 3 is another flow chart of a sleep quality detection method based on a wearable device provided in an embodiment of the present application;

[0023] Figure 4 is a schematic block diagram of a sleep quality detection device based on a wearable device provided in an embodiment of the present application;

[0024] Figure 5 It is a schematic block diagram of the structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0026] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0028] First, some nouns involved in this application are analyzed:

[0029] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0030] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages ​​(such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.

[0031] Based on this, the embodiments of the present application provide a sleep quality detection method, apparatus, device and storage medium based on wearable devices, which realizes more refined automated sleep quality detection through a sleep quality detection model based on the Transformer architecture, aiming to improve the accuracy and efficiency of sleep quality detection.

[0032] The sleep quality detection method, apparatus, device and storage medium based on a wearable device provided in the embodiments of the present application are specifically illustrated by the following embodiments. First, the sleep quality detection method based on a wearable device in the embodiments of the present application is described.

[0033] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0034] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0035] The sleep quality detection method based on wearable devices provided in the embodiment of the present application relates to the field of artificial intelligence technology. The sleep quality detection method based on wearable devices provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a vehicle-mounted terminal, a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or it can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements a sleep quality detection method based on a wearable device, etc., but is not limited to the above forms.

[0036] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0037] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0038] Figure 1 is an optional flowchart of a sleep quality detection method based on a wearable device provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S104.

[0039] Step S101, collecting the user's sleep data through a wearable device.

[0040] The sleep data includes, but is not limited to, physiological signal data such as heart rate signal data, breathing signal data, brain wave signal data and / or body temperature data during sleep.

[0041] Exemplary wearable devices include smart bracelets, smart watches, eye mask sleep monitors, head mounted sleep monitors, sleep monitoring chest straps, etc. Wearable devices are usually equipped with different types of sensors such as electrocardiogram (ECG) sensors, airflow sensors, electroencephalogram (EEG) sensors, and / or temperature sensors.

[0042] In this way, when a user wears a wearable device during sleep, the ECG sensor of the wearable device can collect the user's heart rate signal data during sleep, the airflow sensor can collect the user's breathing signal data during sleep, the EEG sensor can collect the user's brain wave signal data during sleep, and / or the temperature sensor can collect the user's body temperature data during sleep.

[0043] It is understandable that sleep data is presented in the form of a time series, and each time step in the time series corresponds to a heart rate signal, a breathing signal, a brain wave signal, and a body temperature. Among them, the time series is determined by the total time range of sleep data collected by the wearable device. For example, if sleep data is continuously collected from 12:00AM to 8:00AM, then the time series is from 12:00AM to 8:00AM; the time step refers to the time window for collecting sleep data, such as a time window of one minute is a time step.

[0044] Wearable devices can flexibly and conveniently collect detailed and accurate sleep data, providing a more comprehensive analysis basis for subsequent sleep quality testing.

[0045] Step S102: performing feature extraction processing on the sleep data to obtain a sleep feature sequence.

[0046] The sleep data can be processed for feature extraction to obtain a sleep feature sequence, which is convenient for understanding and processing by the sleep quality detection model.

[0047] It can be understood that the sleep feature sequence includes a time series and a sleep feature vector, and the heart rate feature vector, breathing feature vector, brain wave feature vector and / or body temperature feature vector of each time step in the time series constitutes a sleep feature vector.

[0048] Step S103 , performing sleep stage classification processing on the sleep feature sequence to obtain sleep feature subsequences of at least two sleep stages.

[0049] Since different sleep stages have unique sleep characteristics and importance physiologically, the sleep feature sequence can be classified into sleep stages to obtain sleep feature subsequences of at least two sleep stages, so that the sleep quality detection model can understand the sleep characteristics of each sleep stage and the impact of the sleep characteristics of each sleep stage on the overall sleep quality more clearly and meticulously, thereby being able to quantify the sleep quality more accurately.

[0050] Exemplarily, the sleep stages can be divided into different types such as light sleep, deep sleep and rapid eye movement (REM) sleep.

[0051] Step S104 , using a sleep quality detection model based on the Transformer architecture, a sleep quality detection is performed on the sleep feature subsequence of each sleep stage to obtain a sleep quality index of the user.

[0052] Among them, the sleep quality detection model based on the Transformer architecture is obtained by pre-training a preset large language model.

[0053] For example, the large language model can be a natural language processing (NLP) model that is good at processing complex time series data, such as a BERT model based on the Transformer architecture or a GPT series model (such as the GPT-2 model). The sleep quality detection model can automatically identify the sleep characteristics and their changing patterns of different sleep stages, and output a clear sleep quality index.

[0054] Based on this, the sleep quality detection model can be used to perform sleep quality detection on the sleep feature subsequences of each sleep stage, so that the sleep quality detection model can effectively capture the timing information and the degree of mutual influence in the sleep feature subsequences of different sleep stages through the attention mechanism, and obtain an accurate sleep quality index.

[0055] Exemplarily, a sleep quality index such as a sleep quality score (eg, 1-10 points), a sleep quality label (eg, good, moderate, poor), etc. is used to quantify sleep quality data.

[0056] In this way, through the sleep quality detection model based on the Transformer architecture, in-depth analysis of sleep feature subsequences in different sleep stages can improve the comprehensiveness and convenience of sleep quality detection.

[0057] The sleep quality detection method based on wearable devices provided in the above embodiment collects the user's sleep data through the wearable device; performs feature extraction processing on the sleep data to obtain a sleep feature sequence; performs sleep stage classification processing on the sleep feature sequence to obtain at least two sleep stage sleep feature subsequences; and performs sleep quality detection on the sleep feature subsequences of each sleep stage through a sleep quality detection model based on the Transformer architecture to obtain the user's sleep quality index. In this way, on the one hand, detailed sleep data can be collected very flexibly and conveniently using wearable devices, providing a more comprehensive analysis basis for sleep quality detection; on the other hand, by performing sleep stage classification on the sleep feature sequence in the sleep data, the sleep quality detection model based on the Transformer architecture can more clearly and meticulously capture the long-term dependencies and complex temporal relationships in the sleep features of different sleep stages, thereby better understanding the contribution of the sleep features of different sleep stages to the overall sleep quality, and realizing more refined and faster automated sleep quality detection, thereby improving the accuracy and efficiency of sleep quality detection, thereby providing users with a high-precision sleep quality index that can comprehensively measure sleep quality.

[0058] In step S102 of some embodiments, the sleep data may be cleaned to obtain clean sleep data; the clean sleep data may be subjected to time-frequency domain feature extraction to obtain a sleep feature sequence, which includes a time series and a sleep feature vector.

[0059] In order to ensure the reliability of the input of the sleep quality detection model, the sleep data may be cleaned to obtain clean sleep data.

[0060] In order to facilitate the understanding of the sleep quality detection model, the clean sleep data can be processed by time-frequency domain feature extraction, so as to accurately extract important sleep feature sequences that are more helpful for sleep quality detection.

[0061] In some embodiments, the sleep data is cleaned to obtain clean sleep data, which may be to denoise the sleep data to obtain denoised sleep data; fill missing values ​​on the denoised sleep data to obtain filled sleep data; correct outliers on the filled sleep data to obtain corrected sleep data; and standardize the corrected sleep data to obtain clean sleep data.

[0062] Exemplarily, the cleaning process mainly includes denoising, missing value filling, outlier correction and standardization.

[0063] Considering that sleep data is usually affected by noise in the user's sleeping environment, the sleep data may be denoised, for example, the sleep data may be filtered to obtain denoised sleep data.

[0064] The denoised sleep data may also be processed to fill missing values, for example, by using mean, median filling, or interpolation to fill missing values ​​to obtain filled sleep data.

[0065] The filled sleep data may also be corrected for outliers, for example, by detecting outliers through box plots, standard deviations, etc., and adjusting the outliers to a normal range, or deleting the outliers to obtain corrected sleep data.

[0066] The corrected sleep data may also be standardized, for example, the corrected sleep data may be normalized to obtain clean sleep data.

[0067] In this way, by carefully cleaning the sleep data, higher quality clean sleep data can be provided.

[0068] See also Figure 2 In some embodiments, step S104 may include but is not limited to steps S201 to S204.

[0069] Step S201, inputting the sleep feature subsequence of each sleep stage into a sleep quality detection model;

[0070] Step S202, encoding the sleep feature subsequence of each sleep stage to obtain a coding vector of each sleep stage;

[0071] Step S203, using the attention mechanism, the encoding vector of each sleep stage is processed to capture the temporal relationship to obtain a global temporal feature;

[0072] Step S204: performing sleep quality prediction processing on the global time series features to obtain a sleep quality index.

[0073] First, the sleep feature subsequence of each sleep stage is used as the input of the sleep quality detection model; then, in the sleep quality detection model, the sleep feature subsequence of each sleep stage is encoded to obtain the encoding vector of each sleep stage, so as to help the sleep quality detection model understand the temporal relationship of the sleep feature subsequences of each sleep stage; then, through the attention mechanism, the encoding vector of each sleep stage is processed to capture the temporal relationship, so that the sleep quality detection model can pay attention to the sleep features of other sleep stages while processing the sleep features of each sleep stage, thereby capturing the importance of the sleep features of different sleep stages, and dynamically adjusting the weights of different sleep stages according to the importance of the sleep features of different sleep stages, so as to obtain comprehensive global temporal features in different sleep stage dimensions; finally, the global temporal features are processed for sleep quality prediction to obtain a more accurate sleep quality index.

[0074] In step S202 of some embodiments, the sleep feature subsequence of each sleep stage may be embedded to obtain an embedded vector of each sleep stage; and the embedded vector of each sleep stage may be position encoded to obtain an encoded vector of each sleep stage.

[0075] The sleep feature subsequence of each sleep stage is encoded. Specifically, the sleep feature subsequence of each sleep stage can be embedded through the embedding layer of the sleep quality detection model, so as to map the sleep feature subsequence of a sleep stage to a high-dimensional space and obtain the embedding vector of each sleep stage; then, the embedding vector of each sleep stage is position-encoded to obtain the encoding vector of each sleep stage, so as to ensure that the sleep quality detection model can identify the temporal relationship between the sleep feature subsequences of each sleep stage.

[0076] In step S204 of some embodiments, the global timing features may be transformed to obtain deep-level global timing features; the deep-level global timing features may be pooled to obtain high-level global timing features; and the high-level global timing features may be fully connected to obtain a sleep quality index.

[0077] The global time series features are processed for sleep quality prediction. Specifically, the global time series features can be first transformed nonlinearly through the feed-forward neural network (FFN) of the sleep quality detection model to obtain more complex deep-level global time series features; the deep-level global time series features are then pooled through the pooling layer of the sleep quality detection model to obtain high-level global time series features that can represent the overall sleep process; finally, the high-level global time series features are fully connected through the fully connected layer of the sleep quality detection model to obtain the sleep quality index for output, thereby ensuring the validity and accuracy of the sleep quality index.

[0078] Before step S104 in some embodiments, the large language model may be pre-trained. Taking BERT as an example, the training process of the large language model includes: obtaining sleep data samples and actual sleep quality indexes of the sleep data samples; performing feature extraction processing on the sleep data samples to obtain sleep feature sequence samples; performing sleep stage classification processing on the sleep feature sequence samples to obtain sleep feature subsequence samples of at least two sleep stages; inputting the sleep feature subsequence samples of at least two sleep stages into the BERT model for iterative training to effectively learn the predicted sleep quality index of the sleep data samples; calculating the loss between the actual sleep quality index and the predicted sleep quality index, thereby calculating the loss function of the BERT model based on the loss, and then updating the parameters of the BERT model based on the loss function, until the number of iterations is greater than the preset number threshold, stopping the training of the BERT model, and obtaining a trained sleep quality detection model, the sleep quality detection model has strong robustness, adaptability, generalization ability and stability, and is used for more refined and faster automated sleep quality detection.

[0079] See also Figure 3 In some embodiments, after step S104, it may include but is not limited to steps S301 to S302.

[0080] Step S301: Generate a sleep report for the user, where the sleep report includes a sleep quality index, sleep evaluation information, and sleep management strategy information;

[0081] Step S302: Visually display the sleep report.

[0082] After the user's sleep quality index is detected by the sleep quality detection model, a sleep report for the user can be generated, wherein the sleep report includes the sleep quality index, and sleep evaluation information and sleep management strategy information generated based on the sleep quality index and combined with sleep data.

[0083] For example, if the user's sleep quality index is 7 points, the sleep evaluation information may be such as "Your sleep state is great, but the sleep time is a bit short", and the sleep management strategy information may be such as "Try to go to bed early and give yourself more rest time".

[0084] The sleep report can be displayed visually and prominently, allowing users to intuitively view their sleep quality index, helping to enhance users' awareness of sleep health management, and providing users with personalized and adaptive sleep health management references.

[0085] See also Figure 4 , Figure 4 It is a schematic block diagram of a sleep quality detection apparatus based on a wearable device provided in an embodiment of the present application. The sleep quality detection apparatus based on a wearable device can be configured in a computer device to execute the aforementioned sleep quality detection method based on a wearable device.

[0086] like Figure 4 As shown, the sleep quality detection device 400 based on a wearable device includes: a sleep data acquisition module 401, a sleep feature extraction module 402, a sleep feature classification module 403 and a sleep quality detection module 404.

[0087] The sleep data collection module 401 is used to collect the user's sleep data through the wearable device;

[0088] A sleep feature extraction module 402 is used to perform feature extraction processing on the sleep data to obtain a sleep feature sequence;

[0089] A sleep feature classification module 403 is used to perform sleep stage classification processing on the sleep feature sequence to obtain sleep feature subsequences of at least two sleep stages;

[0090] The sleep quality detection module 404 is used to perform sleep quality detection on the sleep feature subsequence of each sleep stage through a sleep quality detection model based on the Transformer architecture to obtain a sleep quality index of the user.

[0091] In one embodiment, the sleep quality detection module 404 is further configured to:

[0092] Inputting the sleep feature subsequence of each sleep stage into the sleep quality detection model;

[0093] Performing encoding processing on the sleep feature subsequence of each sleep stage to obtain an encoding vector of each sleep stage;

[0094] Through the attention mechanism, the encoding vector of each sleep stage is processed to capture the temporal relationship to obtain a global temporal feature;

[0095] The global time series feature is subjected to sleep quality prediction processing to obtain the sleep quality index.

[0096] In one embodiment, the sleep quality detection module 404 is further configured to:

[0097] Performing embedding processing on the sleep feature subsequence of each sleep stage to obtain an embedding vector of each sleep stage;

[0098] Position encoding processing is performed on the embedded vector of each sleep stage to obtain an encoding vector of each sleep stage.

[0099] In one embodiment, the sleep quality detection module 404 is further configured to:

[0100] Transforming the global time series features to obtain deep-level global time series features;

[0101] Performing pooling processing on the deep-level global temporal features to obtain high-level global temporal features;

[0102] The high-level global time series features are subjected to full connection operation processing to obtain the sleep quality index.

[0103] In one embodiment, the sleep feature extraction module 402 is further used for:

[0104] Cleaning the sleep data to obtain clean sleep data;

[0105] The cleaning sleep data is subjected to time-frequency domain feature extraction processing to obtain a sleep feature sequence, wherein the sleep feature sequence includes a time series and a sleep feature vector.

[0106] In one embodiment, the sleep feature extraction module 402 is further used for:

[0107] Performing denoising processing on the sleep data to obtain denoised sleep data;

[0108] Performing missing value filling processing on the denoised sleep data to obtain filled sleep data;

[0109] performing outlier correction processing on the filled sleep data to obtain corrected sleep data;

[0110] The corrected sleep data is standardized to obtain the cleansing sleep data.

[0111] In one embodiment, the sleep quality detection apparatus 400 based on a wearable device further includes a sleep report generating module and a sleep report displaying module.

[0112] The sleep report generating module is used to generate a sleep report of the user, wherein the sleep report includes a sleep quality index, sleep evaluation information and sleep management strategy information;

[0113] The sleep report display module is used to visually display the sleep report.

[0114] Among them, each module in the above-mentioned sleep quality detection device 400 based on a wearable device corresponds to each step in the above-mentioned sleep quality detection method embodiment based on a wearable device, and its functions and implementation processes are no longer repeated here one by one.

[0115] The sleep quality detection device 400 based on a wearable device can execute the sleep quality detection method based on a wearable device provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved by the sleep quality detection method based on a wearable device provided in the embodiment of the present application can be achieved. Please refer to the previous embodiment for details and will not be repeated here.

[0116] The method and apparatus of the present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0117] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in the form of a computer program. Figure 5 Runs on the computer device shown.

[0118] See also Figure 5 , Figure 5 It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application.

[0119] See also Figure 5 The computer device includes a processor and a memory connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0120] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0121] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any sleep quality detection method based on the wearable device.

[0122] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0123] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0124] Collect users’ sleep data through wearable devices;

[0125] Performing feature extraction processing on the sleep data to obtain a sleep feature sequence;

[0126] Performing sleep stage classification processing on the sleep feature sequence to obtain sleep feature subsequences of at least two sleep stages;

[0127] Through the sleep quality detection model based on the Transformer architecture, the sleep quality detection is performed on the sleep feature subsequence of each sleep stage to obtain the sleep quality index of the user.

[0128] In one embodiment, when the processor implements the sleep quality detection model based on the Transformer architecture to perform sleep quality detection on the sleep feature subsequence of each sleep stage to obtain the sleep quality index of the user, it is configured to implement:

[0129] Inputting the sleep feature subsequence of each sleep stage into the sleep quality detection model;

[0130] Performing encoding processing on the sleep feature subsequence of each sleep stage to obtain an encoding vector of each sleep stage;

[0131] Through the attention mechanism, the encoding vector of each sleep stage is processed to capture the temporal relationship to obtain a global temporal feature;

[0132] The global time series feature is subjected to sleep quality prediction processing to obtain the sleep quality index.

[0133] In one embodiment, when the processor implements encoding processing of the sleep characteristic subsequence of each sleep stage to obtain the encoding vector of each sleep stage, it is used to implement:

[0134] Performing embedding processing on the sleep feature subsequence of each sleep stage to obtain an embedding vector of each sleep stage;

[0135] Position encoding processing is performed on the embedded vector of each sleep stage to obtain an encoding vector of each sleep stage.

[0136] In one embodiment, when the processor performs sleep quality prediction processing on the global time series feature to obtain the sleep quality index, it is configured to implement:

[0137] Transforming the global time series features to obtain deep-level global time series features;

[0138] Performing pooling processing on the deep-level global temporal features to obtain high-level global temporal features;

[0139] The high-level global time series features are subjected to full connection operation processing to obtain the sleep quality index.

[0140] In one embodiment, when the processor performs feature extraction processing on the sleep data to obtain a sleep feature sequence, the processor is used to implement:

[0141] Cleaning the sleep data to obtain clean sleep data;

[0142] The cleaning sleep data is subjected to time-frequency domain feature extraction processing to obtain a sleep feature sequence, wherein the sleep feature sequence includes a time series and a sleep feature vector.

[0143] In one embodiment, when the processor implements the cleaning process on the sleep data to obtain clean sleep data, it is used to implement:

[0144] Performing denoising processing on the sleep data to obtain denoised sleep data;

[0145] Performing missing value filling processing on the denoised sleep data to obtain filled sleep data;

[0146] performing outlier correction processing on the filled sleep data to obtain corrected sleep data;

[0147] The corrected sleep data is standardized to obtain the cleansing sleep data.

[0148] In one embodiment, after implementing the sleep quality detection model based on the Transformer architecture to perform sleep quality detection on the sleep feature subsequence to obtain the sleep quality index of the user, the processor is further configured to implement:

[0149] generating a sleep report for the user, the sleep report comprising a sleep quality index, sleep evaluation information, and sleep management strategy information;

[0150] The sleep report is visually displayed.

[0151] The computer device can execute the sleep quality detection method based on the wearable device provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved by the sleep quality detection method based on the wearable device provided in the embodiment of the present application can be achieved. Please refer to the previous embodiment for details and will not be repeated here.

[0152] An embodiment of the present application also provides a computer-readable storage medium.

[0153] A computer program is stored on a computer-readable storage medium of the present application, and when the computer program is executed by a processor, the steps of the sleep quality detection method based on a wearable device as described above are implemented.

[0154] The computer-readable storage medium may be an internal storage unit of the sleep quality detection device based on a wearable device or a computer device described in the aforementioned embodiment, such as a hard disk or memory of the sleep quality detection device based on a wearable device or a computer device. The computer-readable storage medium may also be an external storage device of the sleep quality detection device based on a wearable device or a computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital card (Secure Digital Card, SD Card), a flash card (Flash Card), etc., equipped on the sleep quality detection device based on a wearable device or a computer device.

[0155] Since the computer program stored in the computer-readable storage medium can execute any one of the sleep quality detection methods based on a wearable device provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the sleep quality detection methods based on a wearable device provided in the embodiments of the present application can be achieved. For details, please refer to the previous embodiments and will not be repeated here.

[0156] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0157] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0158] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0159] The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and these modifications or substitutions should be included in the protection scope of the present application.

Claims

1. A sleep quality detection method based on a wearable device, characterized in that: The method comprises: Collect users' sleep data through wearable devices; Performing feature extraction processing on the sleep data to obtain a sleep feature sequence; Performing sleep stage classification processing on the sleep feature sequence to obtain sleep feature subsequences of at least two sleep stages; Through the sleep quality detection model based on the Transformer architecture, the sleep quality detection is performed on the sleep feature subsequence of each sleep stage to obtain the sleep quality index of the user.

2. The method according to claim 1, characterized in that The sleep quality detection model based on the Transformer architecture is used to perform sleep quality detection on the sleep feature subsequence of each sleep stage to obtain the sleep quality index of the user, including: Inputting the sleep feature subsequence of each sleep stage into the sleep quality detection model; Performing encoding processing on the sleep feature subsequence of each sleep stage to obtain an encoding vector of each sleep stage; Through the attention mechanism, the encoding vector of each sleep stage is processed to capture the temporal relationship to obtain a global temporal feature; The global time series feature is subjected to sleep quality prediction processing to obtain the sleep quality index.

3. The method according to claim 2, characterized in that The encoding process is performed on the sleep feature subsequence of each sleep stage to obtain the encoding vector of each sleep stage, including: Performing embedding processing on the sleep feature subsequence of each sleep stage to obtain an embedding vector of each sleep stage; Perform position encoding processing on the embedded vector of each sleep stage to obtain the encoding vector of each sleep stage.

4. The method according to claim 2, characterized in that: The performing sleep quality prediction processing on the global time series feature to obtain the sleep quality index includes: Transforming the global time series features to obtain deep-level global time series features; Performing pooling processing on the deep-level global temporal features to obtain high-level global temporal features; The high-level global time series features are subjected to full connection operation processing to obtain the sleep quality index.

5. The method according to claim 1, characterized in that The step of performing feature extraction processing on the sleep data to obtain a sleep feature sequence includes: Cleaning the sleep data to obtain clean sleep data; The cleaning sleep data is subjected to time-frequency domain feature extraction processing to obtain a sleep feature sequence, wherein the sleep feature sequence includes a time series and a sleep feature vector.

6. The method according to claim 5, characterized in that The step of cleaning the sleep data to obtain clean sleep data includes: Performing denoising processing on the sleep data to obtain denoised sleep data; Performing missing value filling processing on the denoised sleep data to obtain filled sleep data; performing outlier correction processing on the filled sleep data to obtain corrected sleep data; The corrected sleep data is standardized to obtain the cleansing sleep data.

7. The method according to any one of claims 1 to 6, characterized in that: After performing sleep quality detection on the sleep feature subsequence by using a sleep quality detection model based on a Transformer architecture to obtain the sleep quality index of the user, the method further includes: generating a sleep report for the user, wherein the sleep report includes a sleep quality index, sleep evaluation information, and sleep management strategy information; The sleep report is visually displayed.

8. A sleep quality detection device based on a wearable device, characterized in that: The device comprises: A sleep data collection module is used to collect the user's sleep data through a wearable device; A sleep feature extraction module, used for performing feature extraction processing on the sleep data to obtain a sleep feature sequence; A sleep feature classification module, used for performing sleep stage classification processing on the sleep feature sequence to obtain sleep feature subsequences of at least two sleep stages; The sleep quality detection module is used to perform sleep quality detection on the sleep feature subsequence of each sleep stage through a sleep quality detection model based on the Transformer architecture to obtain the sleep quality index of the user.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the sleep quality detection method based on a wearable device as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the sleep quality detection method based on a wearable device according to any one of claims 1 to 7 is implemented.