Method and device for detecting sleep state
By generating a pre-sleep state curve and score, combined with the query and setting operations input by the user, the problem of the inability to monitor the pre-sleep state in the existing technology is solved, and the user's sleep quality is improved.
Patent Information
- Application Number
- CN202110115638.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-28
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2041-01-28
AI Technical Summary
Existing technologies are unable to accurately monitor the user's sleep state, resulting in an inability to effectively improve sleep quality.
By receiving the query and setting operations input by the user, a pre-sleep state curve is generated, and a pre-sleep state score is generated using acceleration signals, heart rate signals, and EEG signals. Combined with the pre-sleep state evaluation model, pre-sleep state monitoring and reminder functions are provided.
Accurately monitor the user's state before going to bed, improve the user's awareness of the state before and after sleep, and thus improve sleep quality.
Smart Images

Figure CN114795159B_ABST
Abstract
Description
Technical field
[0001] The present invention relates to the field of sports health technology, and in particular to a method and device for detecting a pre-sleep state. [Background Technology]
[0002] The rapid development of modern society and the increasingly intense pace of work and life have led to sleep disorders in an increasing number of people living under high pressure. Related technologies can detect a user's sleep onset and sleep stages, and calculate a sleep score based on these times. However, they cannot monitor the user's pre-sleep state, resulting in users being unable to fully understand their sleep state before and after sleep, and thus unable to further improve their sleep quality. [Summary of the invention]
[0003] In view of this, the present invention provides a method and device for detecting the state before sleep, which can accurately monitor the state of the user before sleep, so that the user can grasp the complete state before and after sleep, thereby further improving their sleep quality.
[0004] In one aspect, an embodiment of the present invention provides a method for detecting a sleep state, comprising:
[0005] receiving a first query operation input by a user, where the first query operation includes querying a pre-sleep state curve;
[0006] In response to the first query operation, a pre-sleep state curve is displayed.
[0007] In the embodiment of the present invention, the user inputs the first query operation to query the pre-sleep state curve, which is convenient for the user to check the pre-sleep state curve at any time and to understand the state before falling asleep.
[0008] In a possible implementation, the method further includes:
[0009] receiving a first setting operation input by a user, where the first setting operation includes an operation of setting a detection time;
[0010] In response to the first setting operation, a detection time is set.
[0011] In the embodiment of the present invention, the user inputs a first setting operation to set the detection time, so that the electronic device can perform detection according to the detection time desired by the user, so that the generated pre-sleep state curve better meets the user's expectations.
[0012] In a possible implementation, the method further includes:
[0013] receiving a second setting operation input by a user, where the second setting operation includes an operation of setting a working mode;
[0014] In response to the second setting operation, the operating mode is set.
[0015] In the embodiment of the present invention, the user inputs the second setting operation to set the working mode, so that the electronic device can work according to the working mode desired by the user, thereby improving the user experience.
[0016] In one possible implementation, the method further includes:
[0017] Acquire a first signal from a user at a first time interval;
[0018] extracting a first characteristic parameter from the first signal;
[0019] generating a pre-sleep state score according to the pre-sleep state assessment model and the first characteristic parameter;
[0020] A pre-sleep state curve is generated according to the pre-sleep state score.
[0021] In an embodiment of the present invention, a pre-sleep state curve is generated based on the user's first signal. The generated pre-sleep state curve can accurately monitor the user's pre-sleep state within a period of time before going to bed, so that the user can grasp the complete state before going to sleep, thereby further improving their own sleep quality.
[0022] In a possible implementation, the first signal includes one of an acceleration signal, a heart rate signal, and an electroencephalogram signal, or any combination thereof.
[0023] In the embodiment of the present invention, using multiple signals as the first signal can further improve the accuracy of the generated pre-sleep state score.
[0024] In a possible implementation, before acquiring a first signal of a user at a first time interval, the method includes:
[0025] Get the current time;
[0026] If the current time is less than the set detection time, the current time will be retrieved after a period of time;
[0027] If the current time is greater than or equal to the set detection time, the first signal of the user is obtained according to the first time interval.
[0028] In an embodiment of the present invention, the electronic device compares the current time with the detection time expected by the user, and obtains the user's first signal according to the user's expected detection time, so that the generated pre-sleep state curve better meets the user's expectations.
[0029] In a possible implementation manner, after extracting the first characteristic parameter from the first signal, the method further includes:
[0030] determining a first sleep state of the user according to the first characteristic parameter;
[0031] If the judgment result is that the first sleep state is a suspected falling asleep state or waking up state, generating a pre-sleep state score according to the pre-sleep state evaluation model and the first characteristic parameter, and generating a pre-sleep state curve according to the pre-sleep state score;
[0032] If the judgment result is that the first sleeping state is a falling asleep state, the falling asleep time is recorded, and the first signal of the user is obtained according to the second time interval.
[0033] In an embodiment of the present invention, if the user has not entered the sleep state, the pre-sleep state score will continue to be generated and a pre-sleep state curve will be generated based on the pre-sleep state score to ensure the integrity of the user's pre-sleep state score during a period of time before going to bed, so that the user can grasp the complete state before sleep.
[0034] In one possible implementation, the method further includes:
[0035] Get the user's second sleep state;
[0036] If the second sleep state is a suspected sleeping state, obtaining a first signal from the user at a first time interval;
[0037] If the second sleep state is the waking state, determining whether the pre-sleep state curve meets the reminder condition; wherein the reminder condition includes a gradual increase in the pre-sleep state scores corresponding to a first specified number of consecutive time points;
[0038] If the judgment result is that the pre-sleep state curve meets the reminder condition, the user is reminded in a first reminder manner; the first reminder manner includes displaying a breathing light and / or a reminder message.
[0039] In an embodiment of the present invention, if the user is in a suspected sleeping state, the first signal will continue to be obtained to ensure the integrity of the user's sleep state score during the period before going to bed; if the user is in a waking state and the user's sleepiness gradually increases over time, the user will be reminded to go to bed in a gentler way by displaying a breathing light and / or a reminder message, thereby improving the user's own sleep quality.
[0040] In one possible implementation, the method further includes:
[0041] Get the user's second sleep state;
[0042] If the second sleep state is a suspected sleeping state, obtaining a first signal from the user at a first time interval;
[0043] If the second sleep state is the waking state, determining whether the pre-sleep state curve meets the reminder condition; wherein the reminder condition includes that the pre-sleep state scores corresponding to a first specified number of consecutive time points are all greater than the score threshold;
[0044] If the judgment result is that the pre-sleep state curve meets the reminder condition, the user is reminded in a first reminder manner; the first reminder manner includes displaying a breathing light and / or a reminder message.
[0045] In an embodiment of the present invention, if the user is in a suspected sleeping state, the first signal will continue to be obtained to ensure the integrity of the user's sleep state score during the period before going to bed; if the user is in a waking state and the user's sleepiness gradually increases over time, the user will be reminded to go to bed in a gentler way by displaying a breathing light and / or a reminder message, thereby improving the user's own sleep quality.
[0046] In one possible implementation, the method further includes:
[0047] determining, based on the first signal, whether the user is in a driving state;
[0048] If the result of the judgment is that the user is in a driving state, the second reminder method is used to remind the user; the second reminder method includes playing the first type of music;
[0049] If the judgment result is that the user is in a non-driving state, the user is reminded in a third reminder manner; the third reminder manner includes playing the second type of music.
[0050] In an embodiment of the present invention, if the user is driving, a first type of music that is relatively intense is played to refresh the user and improve the user's safety during driving; if the user is not driving, a second type of music that is relatively soft is played to enhance the user's sleepiness and encourage the user to fall asleep as soon as possible, thereby improving the user's own sleep quality.
[0051] In a possible implementation, the method further includes:
[0052] receiving a second query operation input by a user, where the second query operation includes an operation of querying a sleep quality score;
[0053] In response to the second query operation, the sleep quality score is displayed.
[0054] In the embodiment of the present invention, the user inputs the second query operation to query the sleep quality score, which helps the user to understand the sleep quality during sleep.
[0055] In one possible implementation, the method further includes:
[0056] Record the time you fall asleep;
[0057] obtaining a first signal from the user at a second time interval;
[0058] generating a third sleep state of the user according to the first signal;
[0059] If the third sleep state is a waking state, a sleep quality score is generated.
[0060] In an embodiment of the present invention, whether the user wakes up from sleep is monitored during the user's sleep. If the user wakes up from sleep, a sleep quality score is generated in time for the user to view the sleep quality score.
[0061] In a second aspect, an embodiment of the present invention provides an electronic device, the device including:
[0062] A display screen; one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by a device, cause the device to execute the method in the first aspect or any possible implementation of the first aspect.
[0063] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, which is a program code for execution by a device, wherein the program code includes instructions for executing the method in the first aspect or any possible implementation of the first aspect.
[0064] In a fourth aspect, an embodiment of the present invention provides a computer program product comprising instructions, which, when the computer program product is run on a computer or any at least one processor, enables the computer to execute the instructions of the method in the first aspect or any possible implementation of the first aspect.
[0065] In the technical solution provided by the embodiment of the present invention, the first signal of the user is obtained according to the set first time interval, and the first characteristic parameter is extracted from the first signal; through the generated pre-sleep state evaluation model, a pre-sleep state score is generated according to the first characteristic parameter, which can accurately monitor the user's pre-sleep state, allowing the user to grasp the complete state before and after sleep, thereby further improving their own sleep quality.
Brief Description of the Drawings
[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0067] Figure 1 A schematic diagram of the ranking of factors affecting sleep in the "2019 Chinese Sleep White Paper" provided in an embodiment of the present invention;
[0068] Figure 2A schematic diagram of the distribution of age groups for staying up late every day in the "2019 Chinese Sleep White Paper" provided in an embodiment of the present invention;
[0069] Figure 3a A schematic diagram of a sleepiness change curve provided by an embodiment of the present invention;
[0070] Figure 3b A schematic diagram of another sleepiness change curve provided by an embodiment of the present invention;
[0071] Figure 4 A schematic diagram of a sleep state detection system provided by an embodiment of the present invention;
[0072] Figure 5 A schematic diagram of the external structure of a wearable device provided by an embodiment of the present invention;
[0073] Figure 6 A schematic diagram of the internal structure of a wearable device provided by an embodiment of the present invention;
[0074] Figure 7 A schematic diagram of a homepage of a terminal device provided by an embodiment of the present invention;
[0075] Figure 8 A schematic diagram of a sports health interface provided by an embodiment of the present invention;
[0076] Figure 9 A schematic diagram of a sleep function module interface provided by an embodiment of the present invention;
[0077] Figure 10 A schematic diagram of a sleep detection function interface provided by an embodiment of the present invention;
[0078] Figure 11 A schematic diagram of another sleep detection function interface provided by an embodiment of the present invention;
[0079] Figure 12 A schematic diagram of a function setting interface provided by an embodiment of the present invention;
[0080] Figure 13a A schematic diagram of a user selection reminder mode interface provided by an embodiment of the present invention;
[0081] Figure 13b A schematic diagram of another pre-sleep state curve provided by an embodiment of the present invention;
[0082] Figure 13c A schematic diagram of a reminder user interface provided by an embodiment of the present invention;
[0083] Figure 14a A schematic diagram of a user selection reminder mode interface provided by an embodiment of the present invention;
[0084] Figure 14b A schematic diagram of another pre-sleep state curve provided by an embodiment of the present invention;
[0085] Figure 14c A schematic diagram of another reminder user interface provided by an embodiment of the present invention;
[0086] Figure 15a A schematic diagram of a user selection promotion mode interface provided by an embodiment of the present invention;
[0087] Figure 15b A schematic diagram of another reminder user interface provided by an embodiment of the present invention;
[0088] Figure 15c A schematic diagram of another reminder user interface provided by an embodiment of the present invention;
[0089] Figure 16a A schematic diagram of a sleep function module interface provided by an embodiment of the present invention;
[0090] Figure 16b A schematic diagram of a sleep scoring interface provided by an embodiment of the present invention;
[0091] Figure 17 A schematic diagram of a homepage of a wearable device provided by an embodiment of the present invention;
[0092] Figure 18 A schematic structural diagram of a processor of an electronic device provided by an embodiment of the present invention;
[0093] Figure 19 An algorithm flow chart of a method for detecting a sleep state provided by an embodiment of the present invention;
[0094] Figure 20 A flowchart of a method for detecting a sleep state provided by an embodiment of the present invention;
[0095] Figure 21 A flowchart of a model for constructing a sleep state assessment model provided by an embodiment of the present invention;
[0096] Figures 22a to 22e A schematic diagram of a generated state curve provided by an embodiment of the present invention;
[0097] Figure 23 A flowchart of updating and training a pre-sleep state assessment model provided by an embodiment of the present invention;
[0098] Figure 24 A schematic diagram of a multi-user recording mode provided by an embodiment of the present invention. [Specific implementation method]
[0099] For a better understanding of the technical solution of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0100] It should be clear that the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative work fall within the scope of protection of the present invention.
[0101] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms of "a", "the" and "said" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0102] It should be understood that the term "and / or" used herein is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0103] With the continuous improvement of the material living standards in modern society, people's attention to their own health is increasing. Sleep is the simplest and most important way for the human body to recover and maintain health. Good sleep is the basis of mental and physical health, while sleep disorders or insufficient sleep will have a negative impact on people's physical health, such as: cardiovascular diseases, too fast or too slow metabolism, mental diseases, and immune function disorders.
[0104] The key link of sleep lies in falling asleep, and difficulty in falling asleep will directly lead to low sleep quality. There are many reasons for difficulty in falling asleep, such as: psychological factors such as too fast pace of life, high pressure and anxiety; unhealthy bedtime habits such as strenuous exercise before going to bed, too long overtime, drinking tea, drinking coffee, overeating and using electronic products for too long. Figure 1 This is a schematic diagram of the ranking of the reasons affecting sleep in the "2019 Chinese Sleep White Paper" provided for the embodiments of the present invention. As Figure 1 shown, the reason with the largest proportion among the reasons affecting sleep is high psychological pressure, accounting for 26%; the reason ranking second among the reasons affecting sleep is heavy work and study tasks, accounting for 21%; the reason ranking third among the reasons affecting sleep is personal sleep habits, accounting for 19%. Figure 2 This is a schematic diagram of the age distribution of staying up late every day in the "2019 Chinese Sleep White Paper" provided for the embodiments of the present invention. As Figure 2As shown, the horizontal axis of the distribution is people of different age groups, and the vertical axis is the proportion. Pre-70s refers to people born before 1970, and the proportion of those born before 1970 who stay up late is 2%; Post-70s refers to people born after 1970 and before 1980, and the proportion of those born after 1970 who stay up late is 7%; Post-80s refers to people born after 1980 and before 1990, and the proportion of those born after 1980 who stay up late is 19%; Post-90s refers to people born after 1990 and before 2000, and the proportion of those born after 1990 who stay up late is 43%; Post-00s refers to people born after 2000, and the proportion of those born after 2000 who stay up late is 27%. Figure 1 and Figure 2 It can be seen that psychological pressure is the primary reason affecting the sleep of Chinese people. Among those who stay up late every day, those born after 1990 account for the highest proportion.
[0105] Users who have difficulty falling asleep usually cannot understand their own state before going to bed. For example: the user feels tired, but because they have just finished other work, the user's brain is still in an excited state. Therefore, even though the user feels tired, they still have difficulty falling asleep; or the user feels tired, but has unfinished tasks and does not go to bed. When it is time to go to bed, the brain is in an excited state and cannot fall asleep; or the user has the habit of staying up late, and even if they feel tired, they still stay up late unconsciously, which makes it difficult for the user to fall asleep. Figure 3a A schematic diagram of a sleepiness change curve provided by an embodiment of the present invention is shown in FIG. Figure 3a As shown, the horizontal axis of the curve diagram is time, and the vertical axis is sleepiness. The curve diagram includes two curves: a "fake" sleepiness curve and a real sleepiness curve. In the "fake" sleepiness curve, the user's sleepiness increases over time. In the real sleepiness curve, the user's sleepiness increases over time, but the increase in sleepiness before the user lies down in bed is greater than the increase in sleepiness after the user lies down in bed. In other words, the user's sleepiness after lying down in bed is lower than before the user lies down in bed, indicating that the user has difficulty falling asleep. As shown by the dotted line in the real sleepiness curve, if the user is not lying down in bed at this time, the user's sleepiness will increase over time. In other words, if the user tries to fall asleep too early, they will have difficulty falling asleep. Combining the "fake" sleepiness curve and the real sleepiness curve, at each moment, the user's sleepiness in the "fake" sleepiness curve is higher than that in the real sleepiness curve. In other words, the user feels tired or sleepy, but their real sleepiness is lower, so falling asleep is difficult. Figure 3b A schematic diagram of another sleepiness change curve provided by an embodiment of the present invention is shown as follows: Figure 3bAs shown in the graph, the horizontal axis represents time, and the vertical axis represents sleepiness. The curve shows that the user reaches their peak sleepiness before lying down in bed, at which point their sleepiness is highest. However, they have unfinished tasks and thus delay going to bed. Once they lie down in bed, their brain is in an aroused state, and their sleepiness has significantly decreased compared to their peak sleepiness. This makes it difficult for them to fall asleep.
[0106] The related technology can identify the user's sleepiness depth and play corresponding sleep-aiding content for the user based on the sleepiness depth. Specifically, the user wears a wearable device, the wearable device collects the user's bioelectric signals, and extracts sleepiness identification information based on the bioelectric signals; the wearable device inputs the sleepiness identification information into a pre-trained sleepiness depth detection model for identification, generates the user's current sleepiness depth and sends the current sleepiness depth to the server; the server matches the sleep-aiding content based on the current sleepiness depth, and sends the sleep-aiding content to the wearable device, so that the wearable device plays the sleep-aiding content to assist the user in sleeping. The related technology can match and play corresponding sleep-aiding content based on the user's sleepiness depth, which improves the scientific nature of the played sleep-aiding content and enhances the sleep-aiding effect. However, this technology is used to monitor and improve the user's sleep quality after the user enters the sleep state, and lacks tracking and management of the user's pre-sleep state.
[0107] Related technologies can also detect the user's sleep stages and calculate a sleep quality score. Specifically, the user wears a wearable device, which collects the user's heart rate variability signal and three-axis acceleration data; the wearable device divides the heart rate variability signal and three-axis acceleration data according to a specified time length, and extracts multiple characteristic parameters of the heart rate variability signal and three-axis acceleration data for each time length; the wearable device inputs multiple characteristic parameters within a time length into a pre-trained sleep stage prediction model to generate a sleep stage within a time length; multiple sleep stages within the entire sleep time are counted, and a sleep quality score is calculated based on the sleep time and multiple sleep stages. Related technologies can generate a sleep quality score based on the user's heart rate variability signal and three-axis acceleration data, providing an effective reference for users to manage their own sleep. However, this technology is used to monitor and improve the user's sleep quality after the user enters the sleep state, and lacks tracking and management of the user's pre-sleep state.
[0108] In response to the above problems, the present invention provides a method for detecting the state before sleep, which can accurately monitor the state of the user before sleep, so that the user can grasp the complete state before and after sleep, thereby further improving their sleep quality.
[0109] Figure 4 A schematic diagram of a sleep state detection system provided by an embodiment of the present invention is shown in FIG. Figure 4As shown, the system includes at least one terminal device 201 and at least one wearable device 203, and the terminal device 201 and the wearable device 203 are both electronic devices. The terminal device 201 includes but is not limited to a mobile phone, a tablet computer, a speaker, and a personal computer; the wearable device 203 includes but is not limited to a smart watch, a smart bracelet, a head-mounted display, an augmented reality (AR), and a virtual reality (VR) device. A method for detecting a sleep state provided in an embodiment of the present invention can be applied to a sleep state detection system. The terminal device 201 can communicate wirelessly with the wearable device 203 through wireless communication technology, wherein the wireless communication technology includes: wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.
[0110] Figure 5 This is a schematic diagram of the external structure of a wearable device provided by an embodiment of the present invention. Figure 5 As shown, the wearable device 203 includes a main microphone 150 , a secondary microphone 160 , a power button 210 , a receiver 140 and a display screen 170 .
[0111] The secondary microphone 160 is located at the top of the wearable device 203, and the primary microphone 150 is located at the bottom. To enhance the aesthetics of the wearable device 203, the secondary microphone 160 and the primary microphone 150 are symmetrically positioned at the top and bottom of the wearable device 203, forming small circular holes. The wearable device 203 is equipped with two microphones, utilizing the dual-microphone noise reduction principle to maintain stable calls. The primary microphone 150 collects the call audio, while the secondary microphone 160 collects the surrounding noise. The call audio and surrounding noise are processed in opposite directions, achieving the purpose of noise reduction.
[0112] like Figure 5As shown, the power button 210 is located on the side of the wearable device 203. As an optional solution, the power button 210 is set on the side of the wearable device 203 in the form of a raised button, which is convenient for the user to operate when holding it, and does not need to occupy the front area of the display screen 170, which can further increase the screen-to-body ratio. The power button 210 can be used to control the wearable device 203, including screen off, screen on, on or off functions. The specific functions can be set according to user needs. For example, when the wearable device 203 is in the on state, the user long presses the power button 210 to put the wearable device 203 into the off state; when the wearable device 203 is in the screen off state, the user short presses the power button 210 to turn the wearable device 203 on.
[0113] The receiver 140, also known as the "earpiece," is located above the wearable device 203 and is used to convert audio electrical signals into sound signals. When the wearable device 203 receives a call or voice message, the user can hear the sound by placing the receiver 140 close to their ear.
[0114] Display screen 170 is located on the front of wearable device 203 and is used to display images or videos and receive touch indications from the user. Touch indications include single-click, double-click, press, or slide. Display screen 170 can be a curved screen with curved sides or a flat screen without curved sides. Display screen 170 includes a display panel, which can include a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini LED (Mini LED), a micro LED (Micro LED), a micro-OLED (Micro-OLED), or a quantum dot light-emitting diode (QLED). As an option, display screen 170 includes a touch screen. The display screen 170 is also used to display a pre-sleep state curve for the user to view; the display screen 170 is also used to display a sleep quality score and provide a feedback result button for the user.
[0115] In this embodiment of the present invention, from an external structural perspective, the only difference between terminal device 201 and wearable device 203 is the size of the display area of the display screen, i.e., the display screen of terminal device 201 is larger than that of wearable device 203. The other structures included in terminal device 201 are the same as those included in wearable device 203 and will not be repeated here.
[0116] Figure 6 A schematic diagram of the internal structure of a wearable device provided by an embodiment of the present invention is shown in FIG. Figure 6 As shown, the wearable device 203 includes a memory 100, a processor 110, a communication module, a receiver 140, a main microphone 150, a secondary microphone 160, a display screen 170, a sensor module 180, and an interaction module 190. The sensor module 180 includes one or any combination of an acceleration (ACC) sensor 180a, a photoplethysmography sensor 180b, a brainwave sensor 180c, and a humidity sensor 180d, and the communication module includes a mobile communication module 120a and / or a wireless communication module 120b. The memory 100, the processor 110, and the interaction module 190 can communicate with each other through internal connection paths to transmit control and / or data signals. The memory 100 is used to store computer programs, and the processor 110 is used to call and execute the computer programs from the memory 100.
[0117] The memory 100 may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer.
[0118] The processor 110 may include one or more processing units. For example, the processor 110 may include one or any combination of an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0119] In the embodiment of the present invention, the processor 110 and the memory 100 may be combined into a single processing device, or more commonly, they may be independent components. The processor 110 is configured to execute program code stored in the memory 100 to implement the aforementioned functions. In a specific implementation, the memory 100 may also be integrated into the processor 110 or independent of the processor 110.
[0120] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include one or any combination of an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and a universal serial bus (USB) interface.
[0121] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present invention is merely a schematic illustration and does not constitute a structural limitation on the system architecture of the wearable device. In other embodiments, the wearable device may also adopt a different interface connection method from the above embodiments, or a combination of multiple interface connection methods.
[0122] The mobile communication module 120a can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the wearable device 203. The mobile communication module 120a can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. Furthermore, the wearable device 203 can also include a first antenna 130. The mobile communication module 120a can receive electromagnetic waves through the first antenna 130, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 120a can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the first antenna 130. In some embodiments, at least some of the functional modules of the mobile communication module 120a can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 120a can be set in the same device as at least some of the modules of the processor 110.
[0123] The wireless communication module 120b can provide wireless communication solutions for the wearable device 203, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSS), frequency modulation (FM), near-field communication (NFC), infrared (IR), and other wireless communication solutions. The wireless communication module 120b can be one or more devices that integrate at least one communication processing module. Furthermore, the wearable device 203 can also include a second antenna 131. The wireless communication module 120b receives electromagnetic waves via the second antenna 131, frequency modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 120b can also receive signals to be transmitted from the processor 110, frequency modulate them, amplify them, and convert them into electromagnetic waves for radiation via the second antenna 131.
[0124] In the embodiment of the present invention, the first antenna 130 is coupled to the mobile communication module 120a, and the second antenna 131 is coupled to the wireless communication module 120b, so that the wearable device 203 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TDSCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a BeiDou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite-based augmentation system (SBAS).
[0125] The receiver 140 is connected to the processor 110 and is used to convert the audio electrical signal into a sound signal.
[0126] The main microphone 150 is connected to the processor 110 and is used to collect voice signals during calls and convert them into electrical signals. When a user needs to make a call, send a voice signal, or trigger the wearable device 203 to perform a certain function through a voice assistant, the user can approach the main microphone and make a sound, which is then collected by the main microphone 150.
[0127] The secondary microphone 160 is connected to the processor 110 and is used to collect noise around the call environment. The wearable device 203 includes two microphones, the main microphone 150 and the secondary microphone 160, which can not only collect sound signals but also achieve noise reduction. In other embodiments, the wearable device can also be equipped with three or four microphones to achieve sound signal collection, noise reduction, sound source identification, and directional recording functions.
[0128] The display screen 170 is connected to the processor 110. The display screen 170 is used to receive touch commands input by the user and send the touch commands to the processor 110, so that the processor 110 can call up the relevant interface according to the touch commands and send the relevant interface to the display screen 170, and the display screen 170 displays the relevant interface; the display screen 170 is also used to display the pre-sleep state curve for the user to view; the display screen 170 is also used to display the sleep quality score and provide the user with a feedback result button.
[0129] The sensor module 180 is connected to the processor 110 and is used to collect status information from each sensor for processing by the processor 110. The sensor module 180 includes an accelerometer (ACC) sensor 180a, a photoplethysmograph (PPG) sensor 180b, an EEG sensor 180c, and a humidity sensor 180d. The accelerometer 180a is used to detect a first acceleration around the x-axis, a second acceleration around the y-axis, and a third acceleration around the z-axis of the wearable device 203 in three-dimensional space. The PPG sensor 180b is used to detect the user's heart rate signal and send it to the processor 110. The EEG sensor 180c is used to detect the user's EEG signal and send it to the processor 110. The humidity sensor 180d is used to detect the humidity of the environment surrounding the wearable device 203 and send it to the processor 110.
[0130] The interaction module 190 is connected to the processor 110 and is used to receive a long press operation or a short press operation of the power button by the user; the interaction module 190 is also used to receive feedback results input by the user.
[0131] It is understandable that Figure 6 The illustrated structure diagram does not constitute a specific limitation on the structure of the wearable device 203. In other embodiments, the structure of the wearable device 203 may include more or fewer components than shown, or some components may be combined or separated, or arranged differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0132] In the embodiment of the present invention, from the perspective of internal system architecture, the difference between terminal device 201 and wearable device 203 lies in the size of the display area of the display screen, the type of sensor, and the computing power of the processor. Specifically, the display area of terminal device 201 is larger than that of wearable device 203; the type of sensor of terminal device 201 can be different from that of wearable device 203. For example, wearable device 203 has PPG sensor 108b, while terminal device 201 does not; and the computing power of the processor of terminal device 201 is greater than that of the processor of wearable device 203. The other internal structures included in terminal device 201 are the same as those included in wearable device 203 and will not be repeated here.
[0133] Taking the user's operation on the terminal device 201 as an example, the user can turn on his terminal device 201 by turning on the power button, so that the display screen of the terminal device 201 displays the homepage of the terminal device 201. Figure 7 A schematic diagram of a homepage of a terminal device 201 provided in an embodiment of the present invention is shown as follows: Figure 7 As shown, the homepage includes a status bar 300, a menu bar 400 and a function bar 500. The status bar 300 includes the operator, current time, current geographical location and local weather, network status, signal status and power level. Figure 7 As shown, the operator is China Mobile; the current time is 08:08 on Monday, December 21; the current geographical location is Beijing, the weather in Beijing is cloudy and the temperature is 6 degrees Celsius; the network status is a wifi network; the signal status is a full signal, indicating that the current signal is strong; the black part of the power level can represent the remaining power of the terminal device 201. Applications can be installed in the terminal device. In the process of using the terminal device 201, the user will use a variety of applications based on their different needs. For example, the terminal device 201 is installed with an application with a bedtime status detection function, namely: a sports health application. As shown in FIG. Figure 7 As shown, the menu bar 400 includes an icon of at least one application, and each application icon has the name of the corresponding application below it, such as: Gallery, Task Card Store, Weibo, Sports Health, WeChat, Card Bag, Settings, Camera, Phone, SMS and Address Book. Among them, the position of the application icon and the name of the corresponding application can be adjusted according to the user's preferences, which is not limited in the embodiment of the present invention. The function bar 500 includes a return key, a home key and a menu key. The return key is used to return to the previous level, the home key is used to return to the home page, and the menu key is used to display multiple background applications.
[0134] It should be noted that Figure 7The schematic diagram of the homepage of the terminal device 201 shown is an exemplary display of the embodiment of the present invention. The schematic diagram of the homepage of the terminal device 201 may also be in other styles, which is not limited in the embodiment of the present invention.
[0135] like Figure 7 As shown, the user can click the icon of the sports health application in the menu bar 400, so that the display screen of the user's terminal device 201 displays the sports health interface. Figure 8 A schematic diagram of a sports health interface provided by an embodiment of the present invention is shown as follows: Figure 8 As shown, the interface includes a category bar 410 and multiple function modules 420. The category bar 410 includes health, sports, equipment and mine. For example, when the user clicks on health, Figure 8 As shown, the display screen of terminal device 201 displays a sports and health interface. When the user clicks "Sports," the display screen of terminal device 201 displays the user's detailed exercise record. When the user clicks "Device," the display screen of terminal device 201 displays devices paired with terminal device 201, allowing the user to pair or remove devices. When the user clicks "My," the display screen of terminal device 201 displays personal information about the user, allowing the user to update the personal information. Functional module 420 includes a sleep function module 421, a step count function module 422, and a weight function module 423. Sleep function module 421 is used to record and display the most recent sleep date and sleep duration, for example, the sleep duration on December 21st was 7.5 hours. Step count function module 422 is used to record and display the current date and current step count, for example, the current date is December 21st and the current step count is 1053 steps. Weight function module 423 is used to record and display the most recent weight record date and weight, for example, the most recent weight record date is December 20th and the weight is 49.5 kg.
[0136] like Figure 8 As shown, the user can click on the sleep function module 421, so that the display screen of the user's terminal device 201 displays the interface of the sleep function module. Figure 9 A schematic diagram of a sleep function module interface provided by an embodiment of the present invention, such as Figure 9 As shown, the interface includes a sleep detection module 431 and a sleep scoring module 432. The sleep detection module 431 is used to activate the sleep detection function; the sleep scoring module 432 is used to score the user's sleep quality and display the score on the display screen. The user can click on the sleep detection module 431 to display the sleep detection function interface on the display screen of the user's terminal device 201. Figure 10 This is a schematic diagram of a sleep detection function interface provided by an embodiment of the present invention, such as Figure 10As shown, the interface includes a sleep state curve. The horizontal axis of the sleep state curve is the time point, which starts from 22:00, indicating that the terminal device 201 starts to perform sleep detection and generate a sleep state score from 22:00; the vertical axis is the sleep state score; the current time is 08:08, so the current time is not yet 22:00, and the sleep detection and generation of the sleep state score have not yet started. Figure 11 A schematic diagram of another sleep detection function interface provided by an embodiment of the present invention is shown as follows: Figure 11 As shown, the interface includes a sleep state curve. The horizontal axis of the sleep state curve represents the time point, and the vertical axis represents the sleep state score. The current time is 23:08, indicating that the terminal device 201 has started to perform sleep detection and generate a sleep state score. Each time point corresponds to a sleep state score. The sleep state scores corresponding to each time point are connected to generate a sleep state curve. The sleep state score indicates the user's current sleep suitability. The higher the sleep state score, the more suitable the user is for falling asleep.
[0137] like Figure 11 As shown, the sleep detection function interface also includes a function setting button 433, and the user can click the function setting button 433 to set the working mode and detection time of the sleep detection. Figure 12 A schematic diagram of a function setting interface provided by an embodiment of the present invention, such as Figure 12 As shown, the user can input the desired detection time through the first setting operation, for example: the user inputs the desired detection time as 22:00, then the terminal device 201 will start the pre-sleep detection at 22:00 every day. Optionally, the terminal device 201 can also perform pre-sleep detection according to a specified time interval to achieve real-time pre-sleep detection of the user; optionally, the terminal device 201 can also perform pre-sleep detection in response to the user's activation operation of the pre-sleep detection module, for example: before going to bed, the user clicks on the icon of the sports health application, the sleep function module 421 and the pre-sleep detection module 431 on the terminal device 201 in sequence to activate the pre-sleep detection function, and the user responds to the activation operation to start the pre-sleep detection. It should be noted that the above is only an exemplary operation for causing the terminal device 201 to start the pre-sleep detection. The terminal device can also be caused to start the pre-sleep detection in other ways, and the embodiment of the present invention is not limited to this.
[0138] The user can also select a desired operating mode through the second setting operation. The operating modes include Do Not Disturb mode, Reminder mode, and Promotion mode. The user can choose one of these three modes. If the user selects Do Not Disturb mode, the processor only generates a pre-sleep state curve and does not remind the user to avoid disturbing them. If the user selects Reminder mode, the processor determines that the user is waking up from sleep and the current user state meets the reminder conditions, and then reminds the user using the set first reminder method to remind the user to go to bed. The current user state includes a pre-sleep state curve, which includes time points and the pre-sleep state score corresponding to each time point. The reminder condition can be set to require the pre-sleep state score to gradually increase for a first specified number of consecutive time points. The first specified number can be set according to actual conditions, and as an optional option, it is 3. Alternatively, the reminder condition can be set to require the pre-sleep state score for a second specified number of consecutive time points to be greater than a set score threshold. The second specified number can be set according to actual conditions, and as an optional option, it is 3. The score threshold can be set according to actual conditions, and as an optional option, it is 80 points. The first reminder method includes displaying a breathing light and / or generating and displaying a reminder message.
[0139] The following uses a specific example to illustrate the reminder mode:
[0140] Figure 13a A schematic diagram of a user selection reminder mode interface provided by an embodiment of the present invention, such as Figure 13a As shown, the user selects the reminder mode in the pre-sleep detection function interface and the desired detection time is 22:00. The terminal device 201 starts the pre-sleep detection at 22:00. The reminder condition is set to gradually increase the pre-sleep state score corresponding to three consecutive time points, and the first reminder mode is set to display the breathing light. Figure 13b A schematic diagram of another pre-sleep state curve provided by an embodiment of the present invention is shown as follows: Figure 13b As shown, the score of the pre-sleep state at 22:25 is 57 points; the score of the pre-sleep state at 22:30 is 75 points; the score of the pre-sleep state at 22:35 is 80 points; the score of the pre-sleep state at 22:40 is 85 points, that is, the pre-sleep state scores corresponding to the three consecutive time points of 22:30, 22:35 and 22:40 gradually increase, indicating that the pre-sleep state curve meets the reminder conditions. Figure 13c This is a schematic diagram of a reminder user interface provided by an embodiment of the present invention. When the bedtime state curve meets the reminder condition, the terminal device 201 displays a breathing light 434 to remind the user to go to bed.
[0141] The following is another specific example to illustrate the reminder mode:
[0142] Figure 14aA schematic diagram of a user selection reminder mode interface provided by an embodiment of the present invention, such as Figure 14a As shown, the user selects the reminder mode in the pre-sleep detection function interface and the desired detection time is 22:00. The terminal device 201 starts the pre-sleep detection at 22:00. The reminder condition is set to that the pre-sleep state scores corresponding to three consecutive time points are all greater than the set score threshold, the score threshold is set to 80 points, and the first reminder method is set to generate and display a reminder message. Figure 14b A schematic diagram of another pre-sleep state curve provided by an embodiment of the present invention is shown as follows: Figure 14b As shown in FIG, the horizontal axis of the pre-sleep state curve is the time point, and the vertical axis is the pre-sleep state score. Figure 14b It can be seen that the score of the pre-sleep state at 22:35 is 82 points; the score of the pre-sleep state at 22:40 is 85 points; the score of the pre-sleep state at 22:45 is 90 points, that is, the pre-sleep state scores corresponding to three consecutive time points are all greater than the set score threshold, indicating that the pre-sleep state curve meets the reminder conditions. Figure 14c This is a schematic diagram of another reminder user interface provided by an embodiment of the present invention. When the bedtime state curve meets the reminder condition, the terminal device 201 generates and displays a reminder message to remind the user to go to bed. For example, the reminder message is: Sports and health reminds you that it is time to go to bed.
[0143] It should be noted that the reminder condition may also be set to other conditions, and the first reminder mode may also be set to other forms. The embodiment of the present invention is only used for illustrative purposes and is not limiting.
[0144] Figure 15a A schematic diagram of a user selection promotion mode interface provided by an embodiment of the present invention, such as Figure 15a As shown, if the user selects the boost mode, they need to enter a third setting operation: enter the desired boost time, for example, 11:00 PM. If the user is driving and the current time is greater than the boost time, the user is reminded using the second set reminder method. If the user is not driving and the current time is greater than the boost time, the user is reminded using the third set reminder method. For example, the second reminder method may include playing a first type of music, which is stimulating music to prevent the user from becoming overly sleepy while driving and potentially becoming dangerously sleepy. The third reminder method may include playing a second type of music, which is white noise music, to enhance the user's sleepiness.
[0145] The following is a specific example to illustrate the promotion model:
[0146] Taking the terminal device 201 as an example, Figure 15aAs shown, the user selects the promotion mode and the desired promotion time is 23:00. The current time is 23:08, which is greater than the promotion time. If the user is driving, the terminal device 201 can play rock music and the wearable device vibrates at the same time to prevent the user from being too sleepy while driving and causing danger. Figure 15b This is a schematic diagram of another reminder user interface provided by an embodiment of the present invention. The interface includes a music player that is playing rock music. To save power consumption of the terminal device 201, the display screen of the terminal device 201 turns off after the music player is displayed for a time period greater than or equal to a specified time period. If the user is not driving, the terminal device 201 can play white noise to enhance the user's sleepiness. Figure 15c A schematic diagram of another reminder user interface provided by an embodiment of the present invention is shown as follows: Figure 15c As shown, the interface includes a music player, and the music player is playing white noise. In order to save power consumption of the wearable device, the display screen of the terminal device 201 keeps displaying the music player for a time period greater than or equal to a specified time period, and then turns off the display screen. The specified time period can be set according to user needs, for example, the specified time period is 30 seconds. It is worth noting that the promotion mode can be selected on the terminal device to play the first type of music or the second type of music on the wearable device and / or the terminal device; the promotion mode can also be selected on the wearable device to play the first type of music or the second type of music on the wearable device and / or the terminal device.
[0147] It is worth noting that the second reminder mode and the third reminder mode may also be set to other forms. The embodiment of the present invention is only used for illustrative purposes and does not limit the specific forms of the reminder modes.
[0148] Users can also enter a second query to view their own sleep quality score. Figure 16a A schematic diagram of a sleep function module interface provided by an embodiment of the present invention, such as Figure 16a As shown, the interface includes a sleep detection module 431 and a sleep scoring module 432 . The user can click the sleep scoring module 432 to cause the display screen of the terminal device 201 to display a sleep scoring interface. Figure 16b A schematic diagram of a sleep scoring interface provided by an embodiment of the present invention is shown in FIG. Figure 16b As shown, the interface includes the date, sleep duration, and sleep quality score. For example, the sleep quality score on December 21 was 77 points and the sleep duration was 7.5 hours. Users can also click the double triangle symbol to the left of the date to view the sleep quality score and sleep duration of the previous day.
[0149] As an optional solution, the user can also query the sleep state curve through the wearable device 203 Figure 17A schematic diagram of a homepage of a wearable device provided by an embodiment of the present invention, such as Figure 17 As shown, the homepage includes the current time, current geographic location, local weather and icons of multiple applications, such as Figure 17 As shown, the current time is 08:08 on Monday, December 21; the current geographical location is Beijing, the weather in Beijing is cloudy and the temperature is 6 degrees Celsius, and the icons of multiple applications include: Gallery, Weibo, Sports Health, WeChat, SMS and Contacts. Figure 17 As shown, the user can click on the icon of the sports health application, so that the display screen of the user's wearable device 203 displays the sports health interface.
[0150] In the embodiment of the present invention, the schematic diagram of the sports health interface of the wearable device 203 is the same as the schematic diagram of the sports interface of the terminal device 201, the only difference being the size of the display area of the display screen, i.e., the display area of the terminal device 201 is larger, while the display area of the wearable device 203 is smaller. Detailed description is omitted here.
[0151] It is worth noting that the user can also use the wearable device 203 to open the sleep function module to view the sleep date and sleep duration, open the step function module to view the current step count, and open the weight function module to view the weight; the user can also use the sleep function module to open the pre-sleep detection module to view the pre-sleep state curve, set the detection time, and select the working mode of the pre-sleep detection; and can also open the sleep score module to view the sleep quality score. For the specific interface and operation process, please refer to Figures 7 to 16b , I will not go into details here.
[0152] Figure 18 A schematic diagram of the structure of a processor of an electronic device provided by an embodiment of the present invention is shown in FIG. Figure 18 As shown, the processor 110 of the electronic device includes a sleep-falling and falling asleep module 111, a pre-sleep assessment module 113, and a sleep staging and assessment module 115. Among them, the sleep-falling and falling asleep module 111 is connected to the pre-sleep assessment module 113 and the sleep staging and assessment module 115 respectively. The sleep-falling and falling asleep module 111 can receive the first signal sent by the sensor module 180; extract the first characteristic parameter from the first signal; and generate the user's first sleep state according to the first characteristic parameter. The first sleep state includes a falling asleep state, a falling asleep state, and a suspected falling asleep state. Among them, the falling asleep state is a state in which the user is sleeping, the falling asleep state is a state in which the user is awake, and the suspected falling asleep state is a state in which the user may be sleeping. If the user's first sleep state is a suspected falling asleep state, it means that it is not currently certain whether the user is sleeping or awake, and more first signals need to be collected for further judgment.
[0153] If the first sleep state is falling asleep, the first sleep state is sent to the sleep staging and assessment module 115. The sleep staging and assessment module 115 can receive the user's third sleep state from the sleep-entry module 111. The third sleep state includes falling asleep, waking up, and suspected falling asleep. If the third sleep state is falling asleep or suspected falling asleep, the step of receiving the user's third sleep state from the sleep-entry module 111 is continued. If the third sleep state is waking up, the sleep staging and assessment module 115 generates a sleep quality score.
[0154] If the first sleep state is the waking up state, the sleep assessment module 113 can receive the first signal sent by the sensor module 180; extract the first characteristic parameter from the first signal, and generate a sleep state score according to the first characteristic parameter through the sleep state assessment model; generate a sleep state curve according to the sleep state score, and send the generated sleep state curve to the display screen 170 so that the display screen 170 can display the sleep state curve; continue to receive the second sleep state sent by the sleep and falling asleep module 111, the second sleep state includes the falling asleep state, the waking up state and the suspected falling asleep state, and if the second sleep state includes the falling asleep state, the sleep state is turned off. The pre-evaluation module 113 starts the sleep staging and evaluation module 115; if the second sleep state includes a suspected falling asleep state, it indicates that it is currently not possible to determine whether the user is in a sleeping or awake state, and more first signals need to be collected for further judgment, then the falling asleep and waking up module 111 continues to receive the first signal sent by the sensor module 180; extracts the first characteristic parameter from the first signal; generates the user's second sleep state according to the first characteristic parameter; if the second sleep state includes a waking up state, continues to execute the steps of generating a pre-sleep state score and a pre-sleep state curve through the pre-sleep state evaluation model according to the first characteristic parameter.
[0155] If the first sleeping state is a suspected sleeping state, it indicates that it cannot be determined whether the user is in a sleeping or awake state at present, and more first signals need to be collected for further judgment. Then the sleeping module 111 continues to receive the first signal sent by the sensor module 180; extracts the first characteristic parameter from the first signal; and generates the user's second sleeping state based on the first characteristic parameter.
[0156] The following uses a specific embodiment, taking a wearable device as an example, to illustrate the workflow of sleep state detection. In the embodiment of the present invention, each step is executed by the wearable device. Figure 19 An algorithm flow chart of a method for detecting a sleep state provided by an embodiment of the present invention is shown in FIG. Figure 19As shown, the wearable device obtains the current time. If the current time is less than the set detection time, the current time is obtained again after a period of time. If the current time is greater than or equal to the set detection time, the user's first signal is obtained according to the first time interval (step 11). The processor's sleep and exit module 111 is started to detect the first sleep state (step 12). If the sleep and exit module 111 detects that the user's first sleep state is the falling asleep state, the sleep staging and evaluation module 115 is turned on (step 13). The sleep staging and evaluation module 115 receives the third sleep state sent by the sleep and exit module 111 and determines whether the third sleep state is the waking state (step 14). If not, continue to execute step 14; if so, turn off the sleep staging and evaluation module 115 (step 15), and save the first signal and the sleep quality score generated by the sleep staging evaluation module 115 (step 16). If it is detected that the user's first sleep state is a suspected falling asleep state or a waking up state, the pre-sleep assessment module 113 is started (step 17). The pre-sleep assessment module 113 outputs a pre-sleep state score at a specified time interval and dynamically generates a pre-sleep state curve based on multiple pre-sleep state scores (step 18); the pre-sleep assessment module 113 obtains the second sleep state sent by the falling asleep module 111, and determines whether the second sleep state is a falling asleep state (step 19). If so, execute step 13; if not, determine whether the second sleep state is a suspected falling asleep state (step 20). If so, execute step 18; if not, identify the working mode (step 21). If the working mode If the working mode is the Do Not Disturb mode, continue to step 18; if the working mode is the Reminder mode, determine whether the pre-sleep state curve meets the set reminder condition (22), if so, remind the user (step 23), and continue to step 18; if not, continue to step 18; if the working mode is the Promotion mode, determine whether the Promotion time is not empty and whether the current time is greater than the Promotion time (step 24), if so, determine whether the user is in the driving state (step 25), if so, play the first type of music to refresh the user (step 26), and continue to step 18; if not, play the second type of music to enhance the user's sleepiness (step 27), and continue to step 18.
[0157] The above steps 11 to 22 can also be executed by the terminal device, and the execution process is the same as that of the wearable device, so they will not be repeated here. It can be understood that according to the differences in the display area, computing power, etc. between the wearable device and the terminal device, some steps in the above steps 11 to 22 can be executed by the wearable device, and some steps can be executed by the terminal device. The execution order of the above steps can also change according to the device operation status and user settings. For example, step 21 to identify the working mode can be executed before step 19 or step 20. If it is a reminder mode, there is no need to obtain the second sleep state, and it is directly judged whether the pre-sleep state curve meets the set reminder conditions.
[0158] Figure 20 A flowchart of a method for detecting a sleep state according to an embodiment of the present invention is provided. Figure 20 As shown, the method includes:
[0159] Step 102: Get the current time.
[0160] For example, Figure 9 As shown, the user clicks on the sleep detection module 431, and the electronic device executes step 102 to obtain the current time of the electronic device, for example: Figure 10 The current time shown is 8:08. Figure 11 The current time shown is 23:08.
[0161] Step 104 , determine whether the current time is greater than or equal to the set detection time. If so, execute step 106 ; if not, execute step 102 .
[0162] In the embodiment of the present invention, the detection time is set to the time when the first signal is tracked, and the user can set it according to his actual needs. Figure 12 As shown, the detection time input by the user through the first setting operation is 22:00. Specifically, the interaction module of the electronic device receives the first setting operation input by the user, and the first setting operation includes an operation of setting the detection time; the processor of the electronic device sets the detection time in response to the first setting operation.
[0163] In the embodiment of the present invention, the first setting operation corresponds to Figures 7 to 12 One or any combination of the operations shown.
[0164] In this embodiment of the present invention, if the processor of the wearable device determines that the current time is greater than or equal to the detection time, it indicates that it is time to start acquiring the user's first signal, and the process continues with step 106. If the processor of the wearable device determines that the current time is less than the detection time, it indicates that it is not time to acquire the user's first signal, and after a period of time, the process continues with step 102. For example, if the current time is 22:30 and the detection time is 22:00, the processor of the wearable device determines that the current time 22:30 is greater than the detection time 22:00, indicating that it is time to start acquiring the user's first signal, and the process continues with step 106. For example, if the current time is 21:00 and the detection time is 22:00, the processor of the wearable device determines that the current time 21:00 is less than the detection time 22:00, indicating that it is not time to acquire the user's first signal, and after 10 minutes, the processor re-acquires the current time, i.e., the process continues with step 102.
[0165] Step 106: Acquire the user's first signal according to the set first time interval.
[0166] In the embodiment of the present invention, the first time interval can be set according to actual conditions. As an optional solution, the first time interval is 500 milliseconds (ms). As another optional solution, the first time interval is 1 second (s).
[0167] In an embodiment of the present invention, the first signal includes one or any combination of an acceleration signal, a heart rate signal, and an electroencephalogram signal. Optionally, the first signal may also include a humidity signal and / or a noise signal. The humidity signal and / or the noise signal serve as auxiliary signals to further improve the accuracy of a subsequently generated pre-sleep state score.
[0168] In an embodiment of the present invention, a user wears a wearable device, and the acceleration sensor of the wearable device detects the acceleration signal of the wearable device and sends the acceleration signal to the processor so that the processor obtains the acceleration signal. The acceleration signal includes a first acceleration of the electronic device around the x-axis, a second acceleration around the y-axis, and a third acceleration around the z-axis in three-dimensional space.
[0169] In an embodiment of the present invention, the PPG sensor can detect the user's heart rate signal. Specifically, the PPG sensor includes a light emitting diode (LED). The LED sends a light signal to the skin tissue. The skin tissue reflects the light signal and reflects the reflected light signal back to the PPG sensor. The PPG sensor converts the reflected light signal into an electrical signal, and then converts the electrical signal into a digital signal through analog-to-digital (A / D) conversion. The digital signal is the heart rate signal. The PPG sensor sends the heart rate signal to the processor so that the processor obtains the heart rate signal.
[0170] In embodiments of the present invention, the EEG sensor can detect a user's EEG signals and send them to a processor, which then processes and extracts the EEG signals to obtain their amplitude and frequency. EEG frequency can reflect a user's brain activity; higher frequencies indicate more active brain activity, while lower frequencies indicate quieter brain activity.
[0171] In an embodiment of the present invention, a humidity sensor can detect a humidity signal and transmit it to a processor, which then receives and converts the humidity signal into a humidity value. The humidity signal includes the humidity of the wearable device's surrounding environment. Specifically, the humidity sensor comprises a humidity-sensitive element, whose substrate is covered with a film made of a humidity-sensitive material. When water vapor in the air adsorbs on the humidity-sensitive film, the resistance of the humidity-sensitive element changes, and the humidity signal includes the resistance of the humidity-sensitive element.
[0172] In an embodiment of the present invention, the secondary microphone can collect a noise signal and send the noise signal to the processor. First, the processor obtains the noise signal, and the noise signal includes the noise of the environment surrounding the wearable device.
[0173] Step 108: Extract a first characteristic parameter from the first signal.
[0174] In an embodiment of the present invention, a processor of an electronic device extracts a first characteristic parameter from a first signal. The electronic device is a wearable device or a terminal device.
[0175] In an embodiment of the present invention, when the first signal includes an acceleration signal, the first characteristic parameter includes a first acceleration of the electronic device about the x-axis, a second acceleration about the y-axis, and a third acceleration about the z-axis in three-dimensional space. Specifically, the processor extracts the first acceleration, the second acceleration, and the third acceleration from the acceleration signal.
[0176] Furthermore, when the first signal includes an acceleration signal, the first characteristic parameter also includes a motion time interval. Specifically, a plurality of historical acceleration signals and the time corresponding to each historical acceleration signal are stored in the memory; the processor queries from the memory at least one motion acceleration signal that meets the motion quantity condition and the time corresponding to each motion acceleration signal, the motion quantity condition including the first acceleration being greater than a set first acceleration threshold and / or the second acceleration being greater than a set second acceleration threshold and / or the third acceleration being greater than a set third acceleration threshold, wherein the first acceleration threshold, the second acceleration threshold, and the third acceleration threshold can be set according to actual conditions; the processor queries from the time corresponding to each motion acceleration signal the motion time closest to the current time; the processor calculates the motion time interval based on the motion time and the current time.
[0177] In an embodiment of the present invention, when the first signal includes a heart rate signal, the first characteristic parameter includes heart rate variability. Specifically, the processor extracts heart rate variability from the heart rate signal using a specified analysis method. The specified analysis method includes a time domain analysis method, a frequency domain analysis method, or a nonlinear analysis method.
[0178] In an embodiment of the present invention, when the first signal includes an EEG signal, the first characteristic parameter includes an EEG waveform. Specifically, the EEG signal includes an EEG frequency, and the processor extracts the EEG frequency from the EEG signal and generates the EEG waveform based on the EEG frequency. EEG waveforms include delta waves, theta waves, alpha waves, and beta waves. The frequency of delta waves is 1-3 Hz, with an amplitude of 20-200 μV. This wave band can be recorded in the temporal and parietal lobes of infants or those with immature intellectual development, and in adults who are extremely tired, drowsy, or anesthetized. The frequency of theta waves is 4-7 Hz, with an amplitude of 5-20 μV. Theta waves are more likely to appear in adults who are frustrated or depressed, and in patients with mental illness. The frequency of alpha waves is 8-13 Hz, with an amplitude of 20-100 μV. Alpha waves are most likely to appear when a person's brain activity is quiet and their eyes are closed. The frequency of beta waves is 14-30 Hz, with an amplitude of 100-150 μV. Beta waves are more likely to appear when a person is nervous, emotionally excited, or excited.
[0179] In an embodiment of the present invention, when the first signal includes a humidity signal, the first characteristic parameter includes humidity. Specifically, the humidity signal includes the resistance value of the humidity-sensitive element, and the processor generates humidity corresponding to the resistance value based on the resistance value, where the humidity is the humidity of the environment surrounding the electronic device.
[0180] In the embodiment of the present invention, when the first signal includes a noise signal, the first characteristic parameter includes noise. Specifically, the processor extracts noise from the noise signal, where the noise is noise in the surrounding environment of the electronic device.
[0181] Step 110 : Determine the first sleep state of the user based on the first characteristic parameter. If the first sleep state is a falling asleep state, execute step 116 ; if the first sleep state is a suspected falling asleep state or a waking up state, execute step 112 .
[0182] As an optional solution, the processor inputs the first feature parameter into a support vector machine (SVM) model and outputs the user's first sleep state. The user's first sleep state includes a falling asleep state, a suspected falling asleep state, or a waking up state. The falling asleep state is a state in which the user is asleep, the waking up state is a state in which the user is awake, and the suspected falling asleep state is a state in which the user may be asleep. For example, the first feature parameter includes an exercise time interval, heart rate variability, and an electroencephalogram (EEG) pattern. If the exercise time interval is less than a first threshold, the heart rate variability is less than a second threshold, and the EEG waveform is a beta wave, the user's first sleep state can be determined to be a waking up state. If the exercise time interval is greater than or equal to the first threshold and less than a third threshold, the heart rate variability is greater than or equal to the second threshold and less than a fourth threshold, and the EEG waveform is an alpha wave, the user's first sleep state can be determined to be a suspected falling asleep state. If the exercise time interval is greater than or equal to the third threshold, the heart rate variability is greater than or equal to the fourth threshold, and the EEG waveform is a delta wave, the user's first sleep state can be determined to be a falling asleep state.
[0183] It is worth noting that the user's sleep state may also be generated in other ways. This is only an exemplary description, and the embodiment of the present invention does not limit the way of generating the user's sleep state.
[0184] Step 112: Generate a pre-sleep state score based on the first characteristic parameter using the pre-sleep state assessment model.
[0185] In an embodiment of the present invention, the processor inputs the first characteristic parameter into a pre-sleep state assessment model to generate a pre-sleep state score, wherein the pre-sleep state score indicates the user's current suitability for sleep, with a higher pre-sleep state score indicating a more suitable sleep state for the user.
[0186] In the embodiment of the present invention, in order to reduce the power consumption of the device, a sleep state score is output according to a specified time interval, which can better reflect the user's sleep state. As an optional solution, the specified time interval is 5 minutes.
[0187] The following describes the construction process of the pre-sleep state assessment model. Figure 21 A flowchart of a sleep state assessment model provided by an embodiment of the present invention is shown in FIG. Figure 21 As shown, the construction process includes:
[0188] Step 202: Acquire an initial first signal.
[0189] In an embodiment of the present invention, multiple subjects may be recruited, and a first signal from each subject may be collected, and the collected first signal may be determined as an initial first signal. The recruited subjects may be diverse in terms of gender, age, and occupation, which may improve the accuracy of the pre-sleep state assessment model.
[0190] In an embodiment of the present invention, the initial first signal includes one or any combination of an acceleration signal, a heart rate signal, and an electroencephalogram signal. Optionally, the initial first signal may also include a humidity signal and / or a noise signal. The humidity signal and / or the noise signal serve as auxiliary signals to further improve the accuracy of the constructed pre-sleep state assessment model.
[0191] Step 204: extract an initial first characteristic parameter from the initial first signal.
[0192] In an embodiment of the present invention, when the first signal includes an acceleration signal, the first characteristic parameter includes a first acceleration of the electronic device around the x-axis, a second acceleration around the y-axis, and a third acceleration around the z-axis in three-dimensional space. For the specific extraction process, please refer to step 108 and will not be repeated here.
[0193] In the embodiment of the present invention, when the initial first signal includes a heart rate signal, the initial first characteristic parameter includes heart rate variability. For the specific extraction process, please refer to step 108 and will not be repeated here.
[0194] In the embodiment of the present invention, when the first signal includes an electroencephalogram signal, the first characteristic parameter includes an electroencephalogram waveform. For the specific extraction process, please refer to step 108 and will not be described in detail here.
[0195] In the embodiment of the present invention, when the first signal includes a humidity signal, the first characteristic parameter includes humidity. For a specific extraction process, please refer to step 108 and will not be described in detail here.
[0196] In the embodiment of the present invention, when the first signal includes a noise signal, the first characteristic parameter includes noise. For a specific extraction process, please refer to step 108 and will not be described in detail here.
[0197] Step 206: Obtain an initial sleep quality score.
[0198] In an embodiment of the present invention, the initial first feature parameter is divided into a training set and a test set. The training set is input into a random forest classification generator for training to generate a sleep quality assessment model; the test set is input into the sleep quality assessment model to output an initial sleep quality score.
[0199] Step 208: Generate a pre-sleep label value based on the initial sleep quality score.
[0200] In an embodiment of the present invention, the initial sleep quality score is corrected to generate a pre-sleep label value. For example, the initial sleep quality score is displayed to the user via a display screen, and the user receives feedback by clicking a set feedback result button. The feedback result may be high, accurate, or low. If the feedback result entered by the user is high, the initial sleep quality score is subtracted from a set first threshold to generate a pre-sleep label value. As an optional solution, the first threshold is 10. If the feedback result entered by the user is accurate, and the initial sleep quality score can accurately represent the user's sleep quality, the initial sleep quality score is determined as the pre-sleep label value. If the feedback result entered by the user is low, the initial sleep quality score is subtracted from a set second threshold to generate a pre-sleep label value. As an optional solution, the second threshold is 10. Optionally, the sleep quality score can be based on a percentage system.
[0201] It should be noted that other methods may be used to correct the initial sleep quality score. The embodiments of the present invention provide an exemplary description and do not limit the correction method of the initial sleep quality score.
[0202] In the embodiment of the present invention, there is no limitation on the execution order between steps 202 to 204 and steps 206 to 208, that is, steps 202 to 204 may be executed first, and then steps 206 to 208; or steps 206 to 208 may be executed first, and then steps 202 to 204.
[0203] Step 210: Input the initial first feature parameter and the pre-sleep label value into a machine learning algorithm for training to generate a pre-sleep state assessment model.
[0204] In an embodiment of the present invention, the machine learning algorithm includes a decision tree algorithm, a least squares algorithm or a linear regression algorithm.
[0205] Step 114: Generate a pre-sleep state curve based on the pre-sleep state score.
[0206] In the embodiment of the present invention, the processor outputs a sleep state score at each specified time interval, connects the generated sleep state score with the sleep state score output at the previous time interval to generate a sleep state curve, and sends the sleep state curve to the display screen; the display screen displays the sleep state curve so that the user can view it at any time. For example, if the specified time interval is 10 minutes, Figures 22a to 22e A schematic diagram of a generated state curve provided by an embodiment of the present invention, such as Figure 22a As shown, at 22:00, the processor outputs a pre-sleep state score of 70 points, which is recorded; at 22:10, the processor outputs a pre-sleep state score of 65 points, which is recorded and connected with the pre-sleep state score of 70 points corresponding to 22:00. The pre-sleep state curve after connection is as follows Figure 22b As shown; at 22:20, the processor outputs a pre-sleep state score of 73 points, records the pre-sleep state score, and connects it with the pre-sleep state score of 65 points corresponding to 22:10. The pre-sleep state curve after connection is as follows Figure 22c As shown; at 22:30, the processor outputs a pre-sleep state score of 75 points, records the pre-sleep state score, and connects it with the pre-sleep state score of 73 points corresponding to 22:20. The pre-sleep state curve after connection is as follows Figure 22d As shown; at 22:40, the processor outputs a pre-sleep state score of 80 points, records the pre-sleep state score, and connects it with the pre-sleep state score of 75 points corresponding to 22:30. The pre-sleep state curve after connection is as follows Figure 22e The processor dynamically generates a sleep state curve based on the output sleep state score, which can not only reduce device power consumption but also better reflect the user's sleep state.
[0207] It is worth noting that the specified time interval can be set according to the power consumption of the device and the effect of reflecting the user's pre-sleep state. The processor can obtain the first signal at a smaller first time interval and generate a pre-sleep state score based on the first signal. If a pre-sleep state score is output each time a pre-sleep state score is generated, the pre-sleep state scores corresponding to the time points of the generated pre-sleep state curve will be relatively dense. Although it can accurately reflect the user's pre-sleep state, it will also cause higher power consumption of the device. If the pre-sleep state score is output at a specified time interval, that is, the corresponding pre-sleep state score is output at the time points of the specified time interval, the generated pre-sleep state curve can not only better reflect the user's pre-sleep state, but also reduce device power consumption in the process of generating the pre-sleep state curve. As an optional solution, the specified time interval is 5 minutes or 10 minutes.
[0208] As an optional solution, an interaction module of an electronic device receives a first query operation input by a user, the first query operation including an operation of querying a pre-sleep state curve; a processor of the electronic device, in response to the first query operation, sends the pre-sleep state curve to a display screen, and the display screen displays the pre-sleep state curve. The electronic device includes a wearable device or a terminal device.
[0209] In this embodiment of the present invention, the first query operation may correspond to Figures 7 to 10 One or any combination of the operations shown.
[0210] In the embodiment of the present invention, the pre-sleep state curve includes time points and a pre-sleep state score corresponding to each time point. Figure 13b A schematic diagram of a pre-sleep state curve provided by an embodiment of the present invention is shown in FIG. Figure 13b As shown in FIG, the horizontal axis of the pre-sleep state curve is the time point, and the vertical axis is the pre-sleep state score. Figure 13bIt can be seen that the pre-sleep state score corresponding to 22:00 is 65 points; the pre-sleep state score corresponding to 22:05 is 50 points; the pre-sleep state score corresponding to 22:10 is 55 points; the pre-sleep state score corresponding to 22:15 is 69 points; the pre-sleep state score corresponding to 22:20 is 60 points; the pre-sleep state score corresponding to 22:25 is 57 points; the pre-sleep state score corresponding to 22:30 is 75 points; the pre-sleep state score corresponding to 22:35 is 80 points; and the pre-sleep state score corresponding to 22:40 is 85 points.
[0211] In an embodiment of the present invention, a user can view a pre-sleep state curve on the display of an electronic device, providing a personalized reference for managing their sleep schedule. The user can use the pre-sleep state curve to decide when to go to sleep, or review the previous night's pre-sleep state upon waking up the next day to adjust their sleep schedule and improve their sleep quality.
[0212] Step 116 , obtaining the user's second sleep state. If the sleep state includes a falling asleep state, executing step 118 ; if the sleep state includes a suspected falling asleep state, executing step 106 ; if the sleep state includes a waking up state, executing step 128 .
[0213] As an optional solution, the processor's sleep-in and sleep-out module inputs the first feature parameter into a support vector machine (SVM) model and outputs the user's second sleep state, so that the processor's pre-sleep assessment module or sleep staging and assessment module can obtain the user's second sleep state. The second sleep state includes a falling asleep state, a waking up state, or a suspected falling asleep state. The falling asleep state is a state in which the user is asleep, the waking up state is a state in which the user is awake, and the suspected falling asleep state is a state in which the user may be asleep.
[0214] It is worth noting that the user's sleep state may also be generated in other ways. This is only an exemplary description, and the embodiment of the present invention does not limit the way of generating the user's sleep state.
[0215] Step 118: Record the time you fall asleep.
[0216] If the user's sleep state generated in step 110 or step 116 is a falling asleep state, the current time of the electronic device is recorded as the falling asleep time, and step 120 is further executed to obtain the user's first signal at a second time interval.
[0217] Step 120: Acquire the user's first signal at a second time interval.
[0218] In the embodiment of the present invention, the second time interval can be set according to actual conditions. For example, if the accuracy of the current sleep state generated in the subsequent steps needs to be further improved, the second time interval can be set to 1 minute as an optional solution; if the power consumption of the electronic device needs to be reduced, the second time interval can be set to 5 minutes as an optional solution.
[0219] As an optional solution, the first signal includes one or any combination of an acceleration signal, a heart rate signal, and an EEG signal. Optionally, the first signal may also include a humidity signal and / or a noise signal. The humidity signal and / or the noise signal serve as auxiliary signals to further improve the accuracy of the current sleep state generated in subsequent steps.
[0220] Step 122: Generate a third sleep state of the user according to the first signal.
[0221] In this embodiment of the present invention, the processor extracts a first characteristic parameter from the first signal. Specifically, when the first signal includes a heart rate signal, the first characteristic parameter includes heart rate variability; when the first signal includes an electroencephalogram signal, the first characteristic parameter includes an electroencephalogram waveform. For the specific extraction process, see step 108; when the first signal includes a humidity signal, the first characteristic parameter includes humidity; when the first signal includes a noise signal, the first characteristic parameter includes noise. The specific extraction process is described in step 108 and is not further described here.
[0222] As an optional solution, the processor inputs the first feature parameter into a support vector machine (SVM) model to output a third sleep state of the user. The third sleep state includes a falling asleep state, a suspected falling asleep state, or a waking up state.
[0223] It is worth noting that the user's third sleep state may be generated in other ways. This is only an exemplary description, and the embodiment of the present invention does not limit the way to generate the user's third sleep state.
[0224] Step 124 , determine whether the third sleep state includes the waking state. If so, execute step 126 ; if not, execute step 120 .
[0225] In this embodiment of the present invention, if it is determined that the third sleep state includes the waking up state, it indicates that the user has woken up, and step 126 is continued; if it is determined that the third sleep state does not include the waking up state, it indicates that the user is still sleeping, and step 120 is continued.
[0226] Step 126: Generate a sleep quality score, and the process ends.
[0227] In the embodiment of the present invention, step 126 specifically includes:
[0228] Step 1262: Record the time you woke up from bed and calculate the duration of your sleep.
[0229] In the embodiment of the present invention, the sleep duration is calculated by subtracting the sleep onset time from the sleep wake-up time.
[0230] Step 1264: Divide the first signal of the entire sleep duration according to the specified time length, and generate each time length and the corresponding first signal.
[0231] Step 1266: Extract the first characteristic parameter from the first signal of each time length.
[0232] Step 1268: Input the first characteristic parameter into the trained sleep stage prediction model to generate the sleep stage within each time length.
[0233] Step 1270: Calculate a sleep quality score based on the sleep stages and sleep duration within each time period.
[0234] As an optional option, a sleep quality formula is used to calculate the sleep stages and sleep duration for each time period to generate a sleep quality score. Sleep stages are divided into stages 1, 2, 3, and 4. In stage 1, brain waves are primarily theta waves, without spindles or K complexes. This is the transitional stage between full wakefulness and sleep, with decreased response to external stimuli, mental activity entering a state of levitation, and a disconnect between thoughts and reality. In stage 2, brain waves are primarily spindles and K complexes, with delta waves accounting for less than 20%. In stage 3, delta waves account for 20% to 50% of the brainwaves. In stage 4, delta waves account for more than 50%. For example: based on the sleep stages within each time length, calculate the fourth stage proportion, that is, the proportion of the fourth stage duration to the entire sleep stage duration; set a first weight for the fourth stage proportion, and set a second weight for the sleep duration; multiply the first weight by the fourth stage proportion to generate a first multiplication result; multiply the second weight by the sleep duration to generate a second multiplication result; add the first multiplication result and the second multiplication result to generate a sleep quality score.
[0235] It is worth noting that the sleep quality score may be generated by other methods. This is only an exemplary description, and the embodiment of the present invention does not limit the method for generating the sleep quality score.
[0236] In an embodiment of the present invention, an interactive module of an electronic device receives a second query operation input by a user, where the second query operation includes an operation of querying a sleep quality score; the processor of the electronic device responds to the second query operation by sending the sleep quality score to a display screen, and the display screen displays the sleep quality score.
[0237] In this embodiment of the present invention, the second query operation corresponds to Figures 16a to 16b One or any combination of the operations shown.
[0238] In the embodiment of the present invention, the sleep quality score indicates the sleep quality of the user. A higher sleep quality score indicates better sleep quality of the user.
[0239] It is worth noting that the sleep quality score can also be calculated by other methods. This is only an exemplary description, and the embodiment of the present invention does not limit the method for calculating the sleep quality score.
[0240] Furthermore, the sleep quality score is stored in a memory.
[0241] Furthermore, since different users have different personal characteristics, daily habits and physiological laws, the sleep state assessment model is updated and trained to improve the reliability of the sleep state assessment model. As an optional solution, Figure 23 A flowchart of updating and training a sleep state assessment model provided by an embodiment of the present invention is shown in FIG. Figure 23 As shown, the training process includes: the processor sends the sleep quality score to the display screen; the display screen displays the sleep quality score and provides the user with a feedback result button; the interactive unit receives the feedback result input by the user and sends the feedback result to the processor; the processor corrects the pre-sleep label value according to the feedback result, and updates the pre-sleep state evaluation model online through the online learning algorithm.
[0242] As an option, the feedback results include high, accurate or low.
[0243] In an embodiment of the present invention, updating and training the pre-sleep state assessment model while the user is using the electronic device can enable the pre-sleep state assessment model to learn the user's personalized physiological laws and provide the user with an increasingly accurate pre-sleep state score.
[0244] Step 128 , determine whether the current user status meets the set reminder condition. If so, execute step 130 ; if not, execute step 106 .
[0245] In the embodiment of the present invention, the current user state includes a pre-sleep state curve, which includes time points and pre-sleep state scores corresponding to each time point. The reminder condition includes a first specified number of consecutive time points corresponding to gradually increasing pre-sleep state scores. The first specified number can be set according to actual conditions. As an optional solution, the first specified number is 3. Figure 13bAs shown, the pre-sleep state score corresponding to 22:25 is 57 points; the pre-sleep state score corresponding to 22:30 is 75 points; the pre-sleep state score corresponding to 22:35 is 80 points; and the pre-sleep state score corresponding to 22:40 is 85 points, that is: 22:30, 22:35 and 22:40, the pre-sleep state scores corresponding to the three consecutive time points gradually increase, indicating that the pre-sleep state curve meets the reminder condition, and step 128 is continued.
[0246] As an optional solution, the current user state includes a pre-sleep state curve, which includes time points and the pre-sleep state score corresponding to each time point. The reminder condition includes that the pre-sleep state scores corresponding to the second specified number of consecutive time points are all greater than the set score threshold. The second specified number can be set according to actual conditions. As an optional solution, the second specified number is 3. The score threshold can be set according to actual conditions. As an optional solution, the score threshold is 80 points. For example: Figure 14b As shown in FIG, the horizontal axis of the pre-sleep state curve is the time point, and the vertical axis is the pre-sleep state score. Figure 14b It can be seen that the pre-sleep state score corresponding to 22:35 is 82 points; the pre-sleep state score corresponding to 22:40 is 85 points; and the pre-sleep state score corresponding to 22:45 is 90 points, that is, the pre-sleep state scores corresponding to three consecutive time points are all greater than the set score threshold, indicating that the pre-sleep state curve meets the reminder condition, and step 128 is continued.
[0247] Optionally, the current user state includes the user's driving state, and the reminder condition includes the user being in the driving state and the current time being greater than the set promotion time. If the user is in the driving state and the current time is greater than the promotion time, the current user state satisfies the reminder condition, and the process continues with step 130. If the user is not driving and the current time is greater than the promotion time, the current user state satisfies the reminder condition, and the process continues with step 130. If the current time is less than or equal to the promotion time, the current user state does not satisfy the reminder condition, and the process continues with step 106.
[0248] In this embodiment of the present invention, the promotion time is a time for determining the driving status and can be set by the user based on actual circumstances. As an optional solution, the promotion time is set to 23:00. Specifically, the interaction module of the electronic device receives a third setting operation input by the user, the third setting operation including an operation to set the promotion time; and the processor of the electronic device sets the promotion time in response to the third setting operation.
[0249] In this embodiment of the present invention, the third setting operation corresponds to Figure 15a .
[0250] In an embodiment of the present invention, determining whether a user is in a driving state specifically includes a processor determining whether a connection channel exists between the wireless communication module and the onboard device or whether the motion trajectory of the electronic device is an arc-shaped structure. If it is determined that a connection channel exists between the wireless communication module and the onboard device or the motion trajectory of the electronic device is an arc-shaped structure, it indicates that the user is in a driving state. If it is determined that no connection channel exists between the wireless communication module and the onboard device and the motion trajectory of the electronic device is not an arc-shaped structure, it indicates that the user is not in a driving state. The acceleration sensor in the electronic device can determine whether the motion trajectory of the electronic device is an arc-shaped structure based on the variation pattern of the electronic device's first acceleration around the x-axis, the second acceleration around the y-axis, and the third acceleration around the z-axis in three-dimensional space. If it is determined that one of the first acceleration, the second acceleration, and the third acceleration, or any combination thereof, is non-zero within a first time period, it indicates that the motion trajectory of the electronic device is an arc-shaped structure. As an optional solution, whether a connection channel exists between the wireless communication module and the vehicle-mounted device can be determined by determining whether the device name of the device to which the wireless communication module is connected includes the device name of the vehicle-mounted device. If the device name of the device to which the wireless communication module is connected includes the device name of the vehicle-mounted device, it indicates that a connection channel exists between the wireless communication module and the vehicle-mounted device; if the device name of the device to which the wireless communication module is connected does not include the device name of the vehicle-mounted device, it indicates that no connection channel exists between the wireless communication module and the vehicle-mounted device. For example, if the device name of the vehicle-mounted device is "car kit," if the device name of the device to which the wireless communication module is connected includes "car kit," it indicates that a connection channel exists between the wireless communication module and the vehicle-mounted device; if the device name of the device to which the wireless communication module is connected does not include "car kit," it indicates that no connection channel exists between the wireless communication module and the vehicle-mounted device.
[0251] In order to further improve the accuracy of identifying the user's driving status, as an optional solution, determining whether the user is in a driving state specifically includes the processor determining whether there is a connection channel between the wireless communication module and the vehicle-mounted device and whether the motion trajectory of the electronic device is an arc-shaped structure. If it is determined that there is a connection channel between the wireless communication module and the vehicle-mounted device and the motion trajectory of the electronic device is an arc-shaped structure, it indicates that the user is in a driving state; if it is determined that there is no connection channel between the wireless communication module and the vehicle-mounted device or the motion trajectory of the electronic device is not an arc-shaped structure, it indicates that the user is in a non-driving state.
[0252] In this embodiment of the present invention, if the processor determines that the current user status meets the set reminder conditions, it indicates that the user can be reminded, and step 130 is continued; if it is determined that the current user status does not meet the set reminder conditions, it indicates that the user cannot be reminded, and step 106 is continued.
[0253] It is worth noting that the reminder condition may also be set to other contents, which are only exemplified here, and the embodiment of the present invention does not limit the specific contents of the reminder condition.
[0254] Step 130: Remind the user and proceed to step 106.
[0255] In an embodiment of the present invention, the working mode of the electronic device includes a reminder mode, and the electronic device reminds the user through a set first reminder method to remind the user to go to bed. For example, the first reminder method includes displaying a breathing light and / or generating and displaying a reminder message. Specifically, if the user's sleep state includes a waking up state and the pre-sleep state scores corresponding to a first specified number of consecutive time points in the pre-sleep state curve gradually increase, the user is reminded through the first reminder method; or, if the user's sleep state includes a waking up state and the pre-sleep state scores corresponding to a first specified number of consecutive time points in the pre-sleep state curve are all greater than a set score threshold, the user is reminded through the first reminder method.
[0256] Optionally, the working mode of the electronic device also includes a do not disturb mode, that is, the processor only generates a bedtime state curve according to the bedtime state, and does not remind the user to avoid disturbing the user.
[0257] Optionally, the operating mode of the wearable device includes a promotion mode, and the user can set the promotion mode to be on or off according to their needs. The promotion mode is off by default. When the user sets the promotion mode to be on, if the processor determines that the user is driving and the current time is greater than the promotion time, the user is reminded using the set second reminder method; if the processor determines that the user is not driving and the current time is greater than the promotion time, the user is reminded using the set third reminder method.
[0258] In the embodiment of the present invention, the electronic device receives a second setting operation input by a user, where the second setting operation includes an operation of setting an operating mode. The electronic device sets the operating mode in response to the second setting operation.
[0259] In this embodiment of the present invention, the second setting operation corresponds to Figure 7 to Figure 1 5 or any combination of the operations shown in FIG.
[0260] In this embodiment of the present invention, both the second and third reminder modes can be configured based on actual circumstances. For example, the second reminder mode includes playing a first type of music, while the third reminder mode includes playing a second type of music. Specifically, if the processor determines that the user is driving, it retrieves and plays pre-stored first type of music from memory. The first type of music is refreshing music to prevent the user from becoming overly sleepy and becoming dangerous while driving. If the processor determines that the user is not driving, it retrieves and plays pre-stored second type of music from memory. The second type of music is white noise music to enhance the user's sleepiness.
[0261] It is worth noting that the first reminder mode, the second reminder mode and the third reminder mode may also be set to other forms. The embodiment of the present invention is only used for illustrative purposes and does not limit the specific forms of the reminder modes.
[0262] Furthermore, the electronic device of the embodiment of the present invention supports a multi-user recording mode, that is, different users use the electronic device, and a corresponding pre-sleep state assessment model can be saved for each user package. Figure 24 Schematic diagram of a multi-user recording mode provided by an embodiment of the present invention. Figure 24 As shown, first construct a pre-sleep state assessment model. The construction steps refer to steps 202 to 210 and will not be repeated here. When user 1 uses the electronic device for the first time, the pre-sleep state assessment model is initialized, that is: the factory-built pre-sleep state assessment model is used as the pre-sleep state assessment model of user 1. Through the pre-sleep state assessment model, the pre-sleep state curve and sleep quality score of user 1 are generated according to the first signal of user 1. The pre-sleep label value is corrected according to the feedback result of user 1, and the pre-sleep state assessment model is updated online through the online learning algorithm. The pre-sleep state assessment model is constructed based on the physiological laws of user 1 and can accurately assess the pre-sleep state of user 1. Figure 24 As shown, the process of user 2 and user 3 using electronic devices is the same as that of user 1, which will not be repeated here. The pre-sleep state evaluation model generated by user 2 is constructed based on the physiological laws of user 2 and can accurately evaluate the pre-sleep state of user 2; the pre-sleep state evaluation model generated by user 3 is constructed based on the physiological laws of user 3 and can accurately evaluate the pre-sleep state of user 3.
[0263] In the solution of the embodiment of the present invention, the first signal of the user is obtained according to the set first time interval, and the first characteristic parameter is extracted from the first signal; through the generated pre-sleep state evaluation model, a pre-sleep state score is generated according to the first characteristic parameter, which can accurately monitor the user's pre-sleep state, allowing the user to grasp the complete state before and after sleep, thereby further improving their own sleep quality.
[0264] An embodiment of the present invention further provides an electronic device, which may be a terminal device or a circuit device built into the terminal device. The device may be used to execute the functions / steps of the above method embodiment.
[0265] The present invention also provides a computer-readable storage medium having instructions stored therein. When the instructions are executed on a computer, the computer is caused to execute the above-mentioned Figure 19 and Figure 20 The various steps in the sleep state detection method shown.
[0266] The present invention also provides a computer program product comprising instructions, which, when executed on a computer or any at least one processor, enables the computer to execute the above-mentioned Figure 19 and Figure 20 The various steps in the sleep state detection method shown.
[0267] In each of the above embodiments, the processor 110 involved may include, for example, a central processing unit (CPU), a microprocessor, a microcontroller, or a digital signal processor, and may also include a GPU, an NPU, and an ISP. The processor may also include necessary hardware accelerators or logic processing hardware circuits, such as application-specific integrated circuits (ASICs), or one or more integrated circuits for controlling the execution of the program of the technical solution of the present invention. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in a memory.
[0268] The memory may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer.
[0269] In the embodiment of the present invention, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0270] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented using a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0271] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0272] In the several embodiments provided by the present invention, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media that can store program code.
[0273] The above description is merely a specific embodiment of the present invention. Any modifications or substitutions that may be readily conceived by a person skilled in the art within the technical scope disclosed herein are intended to be encompassed within the scope of protection of the present invention. The scope of protection of the present invention shall be determined by the scope of protection of the claims.
Claims
1. A method for detecting a sleep state, applied to an electronic device, wherein the electronic device includes a display screen, characterized in that: include: receiving a first query operation input by a user, wherein the first query operation includes an operation of querying a pre-sleep state curve; In response to the first query operation, displaying the pre-sleep state curve; The method further comprises: Acquire a first signal from a user at a first time interval; extracting a first characteristic parameter from the first signal; generating a pre-sleep state score according to the pre-sleep state assessment model and the first characteristic parameter; generating a pre-sleep state curve according to the pre-sleep state score; The method further comprises: Acquire a second sleep state of the user; If the second sleep state is a suspected sleeping state, obtaining a first signal from the user at a first time interval; If the second sleep state is a waking state, determining whether the pre-sleep state curve meets a reminder condition; wherein the reminder condition includes a gradual increase in the pre-sleep state score corresponding to a first specified number of consecutive time points; If the judgment result is that the pre-sleep state curve meets the reminder condition, the user is reminded in a first reminder manner; wherein, the first reminder manner includes displaying a breathing light and / or a reminder message.
2. The method according to claim 1, characterized in that Also includes: receiving a first setting operation input by a user, wherein the first setting operation includes an operation of setting a detection time; In response to the first setting operation, the detection time is set.
3. The method according to claim 1, characterized in that Also includes: receiving a second setting operation input by a user, wherein the second setting operation includes an operation of setting a working mode; In response to the second setting operation, the operating mode is set.
4. The method according to claim 1, wherein The first signal includes one of an acceleration signal, a heart rate signal, and an electroencephalogram signal, or any combination thereof.
5. The method according to claim 1, wherein Before acquiring the first signal of the user at the first time interval, the method includes: Get the current time; If the current time is less than the set detection time, the current time is retrieved after a period of time; If the current time is greater than or equal to the set detection time, the first signal of the user is obtained according to the first time interval.
6. The method according to claim 5, characterized in that After extracting the first characteristic parameter from the first signal, the method further includes: determining a first sleep state of the user according to the first characteristic parameter; If the judgment result is that the first sleep state is a suspected falling asleep state or waking up state, generating a pre-sleep state score according to the pre-sleep state evaluation model and the first characteristic parameter, and generating a pre-sleep state curve according to the pre-sleep state score; If the judgment result is that the first sleeping state is a falling asleep state, the falling asleep time is recorded, and the first signal of the user is obtained at a second time interval.
7. The method according to claim 1, characterized in that The method further comprises: Acquire a second sleep state of the user; If the second sleep state is a suspected sleeping state, obtaining a first signal from the user at a first time interval; If the second sleep state is a wake-up state, determining whether the pre-sleep state curve meets a reminder condition; wherein the reminder condition includes that the pre-sleep state scores corresponding to a first specified number of consecutive time points are all greater than a score threshold; If the judgment result is that the pre-sleep state curve meets the reminder condition, the user is reminded in a first reminder manner; wherein, the first reminder manner includes displaying a breathing light and / or a reminder message.
8. The method according to claim 1, characterized in that The method further comprises: determining, according to the first signal, whether the user is in a driving state; If the judgment result is that the user is in a driving state, reminding the user in a second reminder manner; wherein the second reminder manner includes playing a first type of music; If the judgment result is that the user is in a non-driving state, the user is reminded in a third reminder manner; wherein, the third reminder manner includes playing the second type of music.
9. The method according to claim 1, characterized in that Also includes: receiving a second query operation input by a user, where the second query operation includes an operation of querying a sleep quality score; In response to the second query operation, the sleep quality score is displayed.
10. The method according to claim 1, characterized in that The method further comprises: Record the time you fall asleep; obtaining a first signal from the user at a second time interval; generating a third sleep state of the user according to the first signal; If the third sleep state is a wake-up state, a sleep quality score is generated.
11. An electronic device, characterized in that: include: Display screen; one or more processors; Memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the device, cause the device to perform the sleep state detection method as described in any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the sleep state detection method according to any one of claims 1 to 10.
13. A computer program product comprising instructions, characterized in that When the computer program product is run on a computer or any at least one processor, the computer is enabled to execute the method for detecting a sleep state according to any one of claims 1 to 10.
Citation Information
Patent Citations
Sign data display method and sign data display device
CN105468894A
Drowsiness detection
US20190223773A1