Sleep data processing method, device, electronic device and medium
By collecting and analyzing sleep characteristic information and using smart devices to determine the duration of sleep stages, the problem of low accuracy of sleep data analysis in the existing technology is solved and the accuracy of sleep quality analysis is improved.
Patent Information
- Application Number
- CN202410282943.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-03-13
AI Technical Summary
In the existing technology, the accuracy of sleep stage duration obtained through sleep data analysis is low, resulting in low accuracy of sleep quality analysis.
By collecting the sleep characteristic information of the target user, using a smart bracelet or smart mattress to obtain heart rate data, respiratory frequency data and body movement data, combined with Fourier transform and autocorrelation function analysis, the user's duration in different sleep stages is determined, including Awake, light sleep, deep sleep and eye movement stages.
The accuracy of sleep stage duration is improved, thereby improving the accuracy of sleep quality analysis and providing more accurate user sleep data.
Smart Images

Figure CN117860208B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis technology, and in particular to a sleep data processing method, device, electronic device and medium. Background Art
[0002] With the rapid development of society, people are facing increasing pressure and burden, which leads to a decline in the sleep quality of many people, thus affecting their physical and mental health. By analyzing the sleep data, the sleep duration of each sleep stage of the target user can be obtained, thereby obtaining the sleep quality of the target user.
[0003] In the process of implementing the concept of the present invention, the inventors found that in the related art, the accuracy of the sleep duration of each sleep stage of the target user obtained by processing the sleep data of the target user was low, which resulted in low accuracy of the sleep quality analysis based on the sleep duration of each sleep stage. Summary of the invention
[0004] In view of this, the present invention provides a sleep data processing method, device, electronic device and medium.
[0005] One aspect of the present invention provides a sleep data processing method, comprising: in response to a data collection request, based on the sleep characteristic information of the target user collected by the collection device in the target time period, obtaining the sleep data sequence of the target user, wherein the target time period includes multiple sampling moments. According to the sleep data sequence of the target user, determining the state information of the target user at the multiple sampling moments. According to the sleep data sequence of the target user and the state information of the target user at the multiple sampling moments, determining the target sleep stage of the target user in the multiple sleep stages at the multiple sampling moments, wherein the multiple sleep stages include: awake stage, light sleep stage, deep sleep stage and eye movement stage. According to the target sleep stage of the target user at the multiple sampling moments, determining the total time in bed, the total time awake, the total time light sleep, the total time eye movement and the total time deep sleep of the target user.
[0006] According to an embodiment of the present invention, the above-mentioned determination of the total time in bed, the total time awake, the total time of light sleep, the total time of eye movement and the total time of deep sleep of the target user according to the target sleep stage of the target user at the above-mentioned multiple sampling moments includes: determining the time when the target user goes to bed and the time when he / she leaves bed according to the sleep data sequence of the target user and the state information of the target user at the above-mentioned multiple sampling moments. Determine the total time in bed of the target user according to the time when the target user goes to bed and the time when he / she leaves bed. Determine the number of sampling moments related to each of the multiple sleep stages according to the target sleep stage of the target user at the above-mentioned multiple sampling moments. Based on the number of sampling moments related to each of the multiple sleep stages and the sampling intervals between the above-mentioned multiple sampling moments, obtain the total time of each of the multiple sleep stages. Determine the total time awake, the total time of light sleep, the total time of eye movement and the total time of deep sleep of the target user according to the total time of each of the multiple sleep stages.
[0007] According to an embodiment of the present invention, the above-mentioned state information includes the bed state and the bed leaving state; wherein, the above-mentioned determination of the bed-going time and bed leaving time of the above-mentioned target user based on the sleep data sequence of the above-mentioned target user and the state information of the above-mentioned target user at the above-mentioned multiple sampling moments includes: when the state information of the above-mentioned target user at the current sampling moment is the bed-going state and the state information of the previous moments of the current sampling moment is the bed leaving state, the current sampling moment is determined to be the bed-going time of the above-mentioned target user. When the state information of the above-mentioned target user at the current sampling moment is the bed leaving state and the current sampling sleep duration is greater than a preset threshold, the current sampling moment is determined to be the bed leaving time of the above-mentioned target user, wherein the current sleep duration indicates the duration of the target user's sleep before the current sampling moment.
[0008] According to an embodiment of the present invention, the acquisition device is a smart bracelet, and the sleep data sequence includes a heart rate data sequence, a respiratory frequency data sequence, and a body movement data sequence; wherein, the above-mentioned response to the data acquisition request, based on the sleep characteristic information of the target user acquired by the acquisition device in the target period, to obtain the sleep data sequence of the target user, includes: in response to the data acquisition request, using the smart bracelet to collect information on the target user in the target period, to obtain the photoelectric volume pulse wave signal and acceleration signal of the target user. The heart rate data sequence, respiratory frequency data sequence, and body movement data sequence of the target user are obtained according to the sampling frequency, the peak interval of the photoelectric volume pulse wave signal, and the acceleration signal, wherein the sampling frequency is the sampling speed of the acquisition device. wherein, the above-mentioned heart rate data sequence, respiratory frequency data sequence, and body movement data sequence of the target user are obtained according to the sampling frequency, the peak interval of the photoelectric volume pulse wave signal, and the acceleration signal, including: the heart rate data sequence of the target user is obtained according to the sampling frequency and the peak interval of the photoelectric volume pulse wave signal. Perform Fourier transform on the photoplethysmogram signal to obtain a target photoplethysmogram signal. According to the extreme value of the target photoplethysmogram signal, obtain the respiratory frequency data sequence of the target user. According to the average acceleration of the acceleration signal on the x-axis and y-axis of the rectangular coordinate system, obtain the body motion data sequence of the target user.
[0009] According to an embodiment of the present invention, the acquisition device is a smart mattress, and the sleep data sequence includes a heart rate data sequence, a respiratory frequency data sequence, and a body motion data sequence. Among them, the above-mentioned response to the data acquisition request, based on the sleep characteristic information of the target user acquired by the acquisition device during the target time period, to obtain the sleep data sequence of the target user, includes: in response to the data acquisition request, using the smart mattress to collect information on the target user during the target time period, to obtain the piezoelectric signal and the piezoresistive signal of the target user acting on the mattress. According to the processing of the piezoresistive signal, the autocorrelation function curve at the current sampling moment is obtained. According to the extreme value of the autocorrelation function curve, the heart rate data sequence and the respiratory frequency data sequence of the target user are obtained. According to the piezoelectric signal and the piezoresistive signal, the body motion data sequence of the target user is obtained.
[0010] According to an embodiment of the present invention, determining the state information of the target user at the multiple sampling moments based on the sleep data sequence of the target user includes: obtaining the body motion data sequence of the target user based on the sleep data sequence. Determining the state information of the target user at the multiple sampling moments based on the body motion data sequence of the target user.
[0011] According to an embodiment of the present invention, the state information of the target user at the multiple sampling moments is determined based on the sleep data sequence of the target user, further comprising: obtaining the voltage values of the target user at the multiple sampling moments based on the piezoresistive signal. The state information of the target user at the multiple sampling moments is determined based on the voltage values of the target user at the multiple sampling moments.
[0012] Another aspect of the present invention provides a sleep data processing device, including: an obtaining module, a first determining module, a second determining module and a third determining module.
[0013] The obtaining module is used to obtain the sleep data sequence of the target user in response to the data collection request based on the sleep characteristic information of the target user collected by the collection device in the target time period, wherein the target time period includes multiple sampling moments.
[0014] The first determination module is used to determine the state information of the target user at each of the plurality of sampling moments according to the sleep data sequence of the target user.
[0015] The second determination module is used to determine the target sleep stage of the target user at the above-mentioned multiple sleep stages according to the sleep data sequence of the above-mentioned target user and the state information of the above-mentioned target user at the above-mentioned multiple sampling moments, wherein the above-mentioned multiple sleep stages include: awake stage, light sleep stage, deep sleep stage and eye movement stage.
[0016] The third determination module is used to determine the total in-bed time, total awake time, total light sleep time and total deep sleep time of the target user according to the target sleep stage of the target user at each of the multiple sampling moments.
[0017] Another aspect of the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method described above.
[0018] Another aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0019] Another aspect of the present invention provides a computer program product, the computer program product comprising computer executable instructions, and the instructions are used to implement the above method when executed.
[0020] According to the sleep data processing method, device, electronic device and medium provided by the present invention, the sleep characteristic sequence of the target user at multiple sampling moments is obtained based on the collected sleep characteristic information of the target user. According to the sleep characteristic sequence of the target user at the multiple sampling moments, the state information of the target user at the multiple sampling moments can be determined, and then the target sleep stage of the target user at the multiple sampling moments can be determined. By accumulating the sleep duration of each sleep stage, the total bed time, the total awake time, the total light sleep time, the total eye movement time and the total deep sleep time of the target user are determined, thereby improving the accuracy of the total bed time of the target user and the total sleep time of each sleep stage, and then improving the accuracy of the sleep quality analysis based on the total sleep time of each sleep stage. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0022] Figure 1 An application scenario diagram of a sleep data processing method according to an embodiment of the present invention is shown;
[0023] Figure 2 A flowchart of a sleep data processing method according to an embodiment of the present invention is shown;
[0024] Figure 3 A flowchart of determining the total duration of each sleep stage of a target user according to an embodiment of the present invention is shown;
[0025] Figure 4 A flowchart of obtaining a sleep data sequence of a target user when the acquisition device is a smart bracelet according to an embodiment of the present invention is shown;
[0026] Figure 5 A schematic diagram showing a waveform of a photoplethysmography signal according to an embodiment of the present invention is shown;
[0027] Figure 6 A flowchart of obtaining a sleep data sequence of a target user when the acquisition device is a smart mattress according to an embodiment of the present invention is shown;
[0028] Figure 7 A framework diagram of sleep quality analysis according to an embodiment of the present invention is shown;
[0029] Figure 8 A flowchart of sleep quality analysis according to an embodiment of the present invention is shown;
[0030] Fig. 9 shows a structural block diagram of a sleep data processing device according to an embodiment of the present invention; and
[0031] Fig.10 A block diagram of an electronic device suitable for implementing a sleep data processing method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0032] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.
[0033] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0034] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0035] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0036] In the process of implementing the present invention, it is found that the electrocardiogram (ECG) is an easily obtained physiological signal with a large amplitude and few interference factors, and has good practical application value. In the related art, the sleep stage study using ECG signals extracts the heart rate variability signal (HRV) from the ECG signal, and divides the sleep stage according to the difference of the HRV signal in different sleep stages. Since the accuracy of the total sleep duration of each sleep stage obtained according to this method is not high, the accuracy of the sleep quality analysis of the target user according to the total sleep duration of each sleep stage is also not high.
[0037] In view of this, an embodiment of the present invention provides a sleep data processing method, comprising: in response to a data collection request, obtaining a sleep data sequence of the target user based on the sleep characteristic information of the target user collected by a collection device in a target time period, wherein the target time period includes multiple sampling moments; determining the state information of the target user at the multiple sampling moments according to the sleep data sequence of the target user; determining the target sleep stage of the target user in multiple sleep stages at the multiple sampling moments according to the sleep data sequence of the target user and the state information of the target user at the multiple sampling moments, wherein the multiple sleep stages include: awake stage, light sleep stage, deep sleep stage and eye movement stage; determining the total bed time, total awake time, total light sleep time and total deep sleep time of the target user according to the target sleep stage of the target user at the multiple sampling moments.
[0038] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0039] Figure 1 An application scenario diagram of the sleep data processing method according to an embodiment of the present invention is shown.
[0040] like Figure 1 As shown, the application scenario according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0041] The user may use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only for example).
[0042] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0043] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0044] It should be noted that the sleep data processing method provided in the embodiment of the present invention can generally be executed by the server 105. Accordingly, the sleep data processing device provided in the embodiment of the present invention can generally be set in the server 105. The sleep data processing method provided in the embodiment of the present invention can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the sleep data processing device provided in the embodiment of the present invention can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Alternatively, the sleep data processing method provided in the embodiment of the present invention can also be executed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or can also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the sleep data processing device provided in the embodiment of the present invention may also be arranged in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
[0045] For example, the image to be processed may be originally stored in any one of the first terminal device 101, the second terminal device 102, or the third terminal device 103 (for example, the first terminal device 101, but not limited thereto), or stored in an external storage device and imported into the first terminal device 101. Then, the first terminal device 101 may locally execute the image processing method provided by the embodiment of the present invention, or send the image to be processed to other terminal devices, servers, or server clusters, and the other terminal devices, servers, or server clusters that receive the image to be processed may execute the image processing method provided by the embodiment of the present invention.
[0046] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0047] The following will be based on Figure 1 The scene described by Figure 2~Figure 8 The sleep data processing method according to the embodiment of the present invention is described in detail.
[0048] Figure 2 A flowchart of a sleep data processing method according to an embodiment of the present invention is shown.
[0049] like Figure 2 As shown, the method includes operations S210 to S240.
[0050] In operation S210 , in response to a data collection request, a sleep data sequence of the target user is obtained based on sleep characteristic information of the target user collected by using a collection device in a target period of time.
[0051] In operation S220 , state information of each target user at a plurality of sampling moments is determined according to the sleep data sequence of the target user.
[0052] In operation S230 , a target sleep stage of the target user at each of the multiple sleep stages at each of the multiple sampling moments is determined according to the sleep data sequence of the target user and the state information of the target user at each of the multiple sampling moments.
[0053] In operation S240 , the total in-bed time, total awake time, total light sleep time, total eye movement time, and total deep sleep time of the target user are determined according to the target sleep stages of the target user at the plurality of sampling moments.
[0054] According to an embodiment of the present invention, the target user may represent a user who can collect sleep characteristic information using a collection device.
[0055] According to an embodiment of the present invention, the target period may be a period of time when the target user may sleep. The target period may include multiple sampling moments. The number of samples in the target period may be determined according to the sampling frequency.
[0056] According to an embodiment of the present invention, the sleep characteristic information may represent physiological information of the target user during sleep. For example, the sleep characteristic information may include electrocardiogram information, acceleration information, pressure information, etc. of the target user during sleep.
[0057] According to an embodiment of the present invention, the sleep data sequence of the target user may represent the breathing frequency information, heart rate information, body movement information, etc. of the target user within the target period.
[0058] According to an embodiment of the present invention, the state information of the target user at multiple sampling moments may represent the state of the target user at the multiple sampling moments, and the state information of the target user at the multiple sampling moments may include the in-bed state and the out-of-bed state. For example, at the first sampling moment, the state information of the target user may be the in-bed state. At the 50th sampling moment, the state information of the target user may be the out-of-bed state.
[0059] According to an embodiment of the present invention, the plurality of sleep stages may include a wakefulness stage, a light sleep stage, a deep sleep stage, and an eye movement stage. The target sleep stage may include a wakefulness stage, a light sleep stage, a deep sleep stage, and an eye movement stage.
[0060] According to an embodiment of the present invention, the sleep data sequence of the target user and the state information of the target user at multiple sampling moments can be input into a linear regression model to determine the target sleep stage of the target user at multiple sampling moments in multiple sleep stages. The linear regression model may include a naive Bayes model, a decision tree model, a logistic regression model, a support vector machine model, etc. The linear regression model needs to balance the sleep data sequence during the processing of the sleep data sequence of the target user. The data balancing method may include simple upsampling, simple downsampling, SMOTE algorithm, training a generative adversarial network to generate samples, and other methods.
[0061] According to an embodiment of the present invention, the sleep data sequence of the target user may be divided into sleep stages through a linear regression model. When the sleep stages are determined, the falling asleep time and waking time of the target user may be determined according to the sleep duration.
[0062] According to an embodiment of the present invention, when the current sampling moment is in the light sleep stage, deep sleep stage, and eye movement stage, the sleep flag is set to 1. When the current sampling moment is in the awake stage, the sleep flag is set to 0.
[0063] According to an embodiment of the present invention, when the sleep flag is set to 0 and the sleep stage is light sleep, deep sleep and eye movement stage, the current sleep duration is accumulated plus 1. When the current sleep duration is greater than 8, the current minute is the sleep time of the target user, the sleep duration is set to 0 and starts to accumulate again, and the sleep flag is set to 2.
[0064] According to an embodiment of the present invention, when the sleep flag is 2 and the wake flag is 1, the sleep stage is the wake stage, and the wake time is accumulated by 1. When the wake time exceeds 10 minutes, the wake time is the current time, the wake flag is set to 2, and the wake time is set to 0 to restart accumulation.
[0065] According to an embodiment of the present invention, the total bed time, total awake time, total light sleep time, and total deep sleep time of the target user can be determined based on the target sleep stage of the target user at multiple sampling moments by accumulating the sleep time of the same sleep stage.
[0066] According to an embodiment of the present invention, by acquiring the sleep characteristic sequence of the target user at multiple sampling moments based on the collected sleep characteristic information of the target user, the state information of the target user at the multiple sampling moments can be determined based on the sleep characteristic sequence of the target user at the multiple sampling moments, and then the target sleep stage of the target user at the multiple sampling moments at the lock sampling moment can be determined, and by accumulating the sleep duration of each sleep stage, the total bed time, the total awake time, the total light sleep time, the total eye movement time and the total deep sleep time of the target user are determined, thereby improving the accuracy of the obtained total bed time of the target user and the total sleep time of each sleep stage, and then improving the accuracy of the sleep quality analysis performed according to the sleep duration of each sleep stage.
[0067] Figure 3 A flow chart of determining the total duration of each sleep stage of a target user according to an embodiment of the present invention is shown.
[0068] like Figure 3 As shown, the process includes operations S310 to S340.
[0069] In operation S310 , the target user's bed-going time and bed-leaving time are determined according to the target user's sleep data sequence and the target user's respective state information at a plurality of sampling times.
[0070] In operation S320, the total in-bed time of the target user is determined according to the time when the target user goes to bed and the time when the target user leaves bed.
[0071] In operation S330 , the number of sampling moments associated with each of the plurality of sleep stages is determined according to the target sleep stage that the target user is in at each of the plurality of sampling moments.
[0072] In operation S340 , total durations of the plurality of sleep stages are obtained based on the number of sampling moments associated with each of the plurality of sleep stages and the sampling intervals between the plurality of sampling moments.
[0073] According to the total duration of each of the multiple sleep stages, the total duration of wakefulness, total duration of light sleep, total duration of eye movement, and total duration of deep sleep of the target user are determined.
[0074] According to an embodiment of the present invention, the target user's bed time may represent the target user's last bed time before the awake phase in the target period. The target user's bed leaving time may represent the target user's first bed leaving time after the awake phase in the target period.
[0075] According to an embodiment of the present invention, the target user's bed-going time and bed-leaving time may be determined based on the target user's sleep data sequence and the target user's respective state information at multiple sampling times.
[0076] According to an embodiment of the present invention, the total time the target user spends in bed can represent the time difference from the time the target user goes to bed to the time when the target user leaves bed. Therefore, the time the target user leaves bed can be subtracted from the time the target user goes to bed to obtain the total time the target user spends in bed.
[0077] According to an embodiment of the present invention, when the target sleep stage of each of the multiple sampling moments is determined, the number of sampling moments associated with each of the multiple sleep stages can be determined. For example, in the case of 50 sampling moments, where the target sleep stage of the 1st to 20th sampling moments is the awake stage, the target sleep stage of the 21st to 30th sampling moments is the light sleep stage, the target sleep stage of the 31st to 45th sampling moments is the deep sleep stage, and the target sleep stage of the 46th to 50th sampling moments is the eye movement stage, it can be determined that the number of sampling moments associated with the awake stage is 20, the sampling moments associated with the light sleep stage is 10, the sampling number of sleep stages associated with the deep sleep stage is 15, and the number of sampling moments associated with the eye movement stage is 5.
[0078] According to an embodiment of the present invention, the sampling interval between each of the plurality of sampling moments may represent the interval duration between each adjacent sampling moment.
[0079] According to an embodiment of the present invention, the total duration of each of the multiple sleep stages can be obtained based on the number of sampling moments associated with each of the multiple sleep stages and the sampling intervals between the multiple sampling moments. For example, if the number of sampling moments associated with the awake stage is 20, the number of sampling moments associated with the light sleep stage is 10, the number of sampling moments associated with the deep sleep stage is 15, the number of sampling moments associated with the eye movement stage is 5, and the sampling interval is 1 minute, the total awake duration of the awake stage is 20 minutes, the total light sleep duration of the light sleep stage is 10 minutes, the total deep sleep duration of the deep sleep stage is 15 minutes, and the total eye movement duration of the eye movement stage is 5 minutes.
[0080] According to an embodiment of the present invention, the number of sampling moments associated with each of the multiple sleep stages can be determined according to the target sleep stage of the target user at each of the multiple sampling moments. The total duration of each of the multiple sleep stages can be obtained based on the number of sampling moments and the sampling interval. In addition, the total time the target user spends in bed can be determined according to the time the target user goes to bed and the time he or she gets out of bed, thereby improving the accuracy of the total time the target user spends in bed and the total sleep duration of each sleep stage, thereby improving the accuracy of the sleep quality analysis.
[0081] According to an embodiment of the present invention, the target user's bedtime and bed-leaving time are determined based on the target user's sleep data sequence and the target user's respective state information at multiple sampling moments, including: when the target user's state information at the current sampling moment is in bed and the state information at the moments before the current sampling moment is out of bed, determining the current sampling moment as the target user's bedtime; when the target user's state information at the current sampling moment is out of bed and the current sampling sleep duration is greater than a preset threshold, determining the current sampling moment as the target user's bed-leaving time, wherein the current sleep duration indicates the duration of the target user's sleep before the current sampling moment.
[0082] According to an embodiment of the present invention, the status information may include an in-bed status and an out-of-bed status.
[0083] According to an embodiment of the present invention, when the target sleep stage of the target user at the current sampling time is in bed and the bed flag on_bed_flag is 0, the current time can be determined as the bed time, the bed flag on_bed_flag is set to 1, and the bed time c_s_time is accumulated. The bed flag of 0 indicates that there has been no bed state before the current time.
[0084] According to an embodiment of the present invention, the preset threshold value can be customized according to the needs. When the target sleep stage of the target user at the current sampling time is the out-of-bed state and the sleep time before leaving the bed at the current time is greater than the sleep time before leaving the bed last time, the current time can be determined as the out-of-bed time off_bed_minute, and the out-of-bed time off_bed_d can be accumulated.
[0085] According to an embodiment of the present invention, by determining the time of going to bed and the time of leaving bed, the total time in bed of the target user can be determined, thereby improving the accuracy of the total time in bed and further improving the accuracy of sleep quality analysis.
[0086] Figure 4 A flowchart of obtaining a sleep data sequence of a target user when the acquisition device is a smart bracelet according to an embodiment of the present invention is shown.
[0087] like Figure 4 As shown, the process includes operations S410 to S450.
[0088] In operation S410, in response to a data collection request, the smart bracelet is used to collect information on the target user during a target period of time to obtain a photoplethysmogram signal and an acceleration signal of the target user.
[0089] In operation S420, a heart rate data sequence of the target user is obtained according to the sampling frequency and the peak interval of the photoplethysmography signal.
[0090] In operation S430, Fourier transform is performed on the photoplethysmography signal to obtain a target photoplethysmography signal.
[0091] In operation S440, a respiratory frequency data sequence of the target user is obtained according to the extreme value of the target photoplethysmography signal.
[0092] In operation S450, a body motion data sequence of the target user is obtained according to average accelerations of the acceleration signal on the x-axis and the y-axis of the rectangular coordinate system.
[0093] According to an embodiment of the present invention, the acquisition device may be a smart bracelet. In the case where the acquisition device is a smart bracelet, the sleep data sequence may include a heart rate data sequence, a respiratory rate data sequence, and a body movement data sequence. The heart rate data sequence may include a plurality of heart rate data, the respiratory rate data sequence may include a plurality of respiratory rate data, and the body movement data sequence may include a plurality of body movement data.
[0094] According to an embodiment of the present invention, a smart bracelet is used to collect information about a target user during a target period of time, so that a photoplethysmogram signal and an acceleration signal of the target user can be obtained.
[0095] According to an embodiment of the present invention, the photoplethysmogram signal of the target user is a rhythmic pulse signal, which may be composed of a series of short photoplethysmogram peaks.
[0096] Figure 5 FIG. 4 is a schematic diagram showing a waveform of a photoplethysmography signal according to an embodiment of the present invention.
[0097] like Figure 5 As shown in FIG. 1 , a complete photoplethysmogram signal waveform may include four important characteristic points and an ascending branch and a descending branch. Figure 5As shown, the four important feature points are A, B, C and D, wherein A represents the main wave, B represents the tidal wave, C represents the dicrotic wave peak, D represents the dicrotic wave trough, A' represents the time corresponding to the main wave, B' represents the time corresponding to the tidal wave, C' represents the time corresponding to the dicrotic wave peak, D' represents the time corresponding to the dicrotic wave trough, the OA segment represents the ascending branch of the main wave, the AB segment represents the descending branch, the BD segment represents the descending branch, the DC segment represents the ascending branch of the secondary wave, the CO' segment represents the descending branch, and OO' represents a cycle of the photoelectric volume pulse wave signal. The important feature point A represents the heart contraction, and the O' point represents the heart diastole. Multiple complete photoelectric volume pulse wave signals can be included in the target sampling period. The duration between the important feature points A of each photoelectric volume pulse wave signal can be regarded as a heartbeat.
[0098] According to an embodiment of the present invention, the sampling frequency is the sampling speed of the acquisition device. The heart rate data sequence, the respiratory rate data sequence and the body movement data sequence of the target user can be obtained by combining the sampling frequency, the photoplethysmogram signal and the acceleration signal.
[0099] According to an embodiment of the present invention, when the acquisition device is a smart bracelet, the heart rate data hr1 at a certain sampling time in the heart rate data sequence of the target user is calculated as follows:
[0100] (1)
[0101] Wherein, FS represents the sampling frequency, and n_peak_interval_sum represents the duration between two adjacent important feature points A of the photoplethysmogram.
[0102] According to an embodiment of the present invention, when 6000 data are collected, the sampling frequency FS is calculated as follows:
[0103] (2)
[0104] Where T represents the sampling interval for collecting 6000 data.
[0105] According to an embodiment of the present invention, when a smart bracelet is used to collect a 1-minute photoelectric volume pulse wave signal of a target user, the 1-minute photoelectric volume pulse wave signal may include multiple important feature points A, and the duration n_peak_interval_sum between two adjacent photoelectric volume pulse wave important feature points A is calculated as follows:
[0106] (3)
[0107] Among them, P Nrepresents the data number corresponding to the last important feature point A in that minute, P1 represents the data number corresponding to the first important feature point A in that minute, and N represents the total number of important feature points A in that minute.
[0108] According to an embodiment of the present invention, a target photoplethysmogram signal can be obtained by Fourier transforming the photoplethysmogram signal. In the frequency spectrum of the target photoplethysmogram signal, the extreme value corresponding to the respiratory frequency data sequence is usually between 0.2 Hz and 0.4 Hz. Therefore, the respiratory frequency sequence can be determined by searching for the extreme value of this range in the frequency spectrum of the target photoplethysmogram signal, wherein the respiratory frequency data br1 at a certain sampling time in the respiratory frequency sequence is calculated as follows:
[0109] (4)
[0110] in, Represents the extreme values in the range of 0.2 Hz to 0.4 Hz in the frequency spectrum of the target photoplethysmography signal.
[0111] According to an embodiment of the present invention, the acceleration signal of the target user can be collected by the accelerometer of the smart bracelet. The acceleration signal may include an x-axis acceleration signal component and a y-axis acceleration signal component.
[0112] According to an embodiment of the present invention, the acceleration average value difference E may be used to determine the body motion data sequence of the target user, wherein the acceleration average value difference E is calculated as follows:
[0113] (5)
[0114] Among them, a1, a2, ..., a n represents the acceleration value collected at n sampling moments within the target period, a v Represents the arithmetic mean of the acceleration values at n sampling moments.
[0115] According to an embodiment of the present invention, the body motion data sequence of the target user can be determined by the following formula (6):
[0116] (6)
[0117] Among them, E xt It represents the average acceleration difference on the x-axis corresponding to time t, E yt represents the acceleration average value difference on the y-axis corresponding to time t, T1 represents the acceleration average value difference threshold on the x-axis, and T2 represents the acceleration average value difference threshold on the y-axis, wherein the acceleration average value difference threshold T1 on the x-axis and the acceleration average value difference threshold T2 on the y-axis can be set according to needs.
[0118] For example, when T1 is set to 0.2 m / s and T2 is set to 0.2 m / s, when it is greater than 0.2 m / s and E yt If it is greater than 0.2 m / s, it can be determined that the target user performs a body movement at time t.
[0119] According to an embodiment of the present invention, the heart rate data sequence, respiratory rate data sequence and body movement data sequence of the target user can be obtained based on the acquisition frequency, photoplethysmogram signal and acceleration signal, thereby improving the accuracy of the heart rate data sequence, respiratory rate data sequence and body movement data sequence obtained when the acquisition device is a smart bracelet.
[0120] Figure 6 A flowchart of obtaining a sleep data sequence of a target user when the acquisition device is a smart mattress according to an embodiment of the present invention is shown.
[0121] like Figure 6 As shown, the process includes S610 to operation S640.
[0122] In operation S610, in response to a data collection request, information of a target user is collected during a target period using a smart mattress to obtain a piezoelectric signal and a piezoresistive signal of the target user acting on the mattress.
[0123] In operation S620, the piezoresistive signal is processed to obtain an autocorrelation function curve at the current sampling moment.
[0124] In operation S630, a heart rate data sequence and a respiratory frequency data sequence of the target user are obtained according to the extreme value of the autocorrelation function curve.
[0125] In operation S640, a body motion data sequence of the target user is obtained according to the piezoelectric signal and the piezoresistive signal.
[0126] According to an embodiment of the present invention, the acquisition device may be a smart mattress, which may be placed under an ordinary mattress, and the smart mattress may include a piezoelectric sensor and a piezoresistive sensor. The piezoelectric sensor may convert an analog signal into a digital piezoelectric signal D[t] through an analog to digital converter (Analog to Digtial Converter, referred to as A / D). The piezoresistive sensor may convert an analog signal into a digital piezoresistive signal V[t] through a digital to analog converter. In the case where the acquisition device is a smart mattress, the sleep data sequence may include a heart rate data sequence, a respiratory rate data sequence, and a body movement data sequence. The heart rate data sequence may include multiple heart rate data, the respiratory rate data sequence may include multiple respiratory rate data, and the body movement data sequence may include multiple body movement data.
[0127] According to an embodiment of the present invention, the piezoelectric signal and the piezoresistive signal of the target user acting on the mattress can be collected through the smart mattress. By processing the piezoresistive signal, an autocorrelation function curve can be obtained.
[0128] According to an embodiment of the present invention, the autocorrelation function may be a statistic used to describe the interdependence of a signal or a time series at different time points. In time series analysis, the autocorrelation function may be used to test the intrinsic dependence and predictability of time series data. In an embodiment of the present invention, the autocorrelation function ρ[t] at time t is calculated as follows:
[0129] (7)
[0130] Where D'[t] represents the value of the normalized piezoelectric signal at time, μ represents the mean value of the heart rate data sequence from time t to time t+τ, τ represents the time delay, and E[] represents the expected value. The autocorrelation coefficient under each time delay can be obtained, and the autocorrelation coefficient is between -1 and 1.
[0131] According to an embodiment of the present invention, the value D2'[t] of the sosfilt filtered piezoelectric signal at time t can be obtained by performing sosfilt filtering on the normalized piezoelectric signal D'[t]. The filter array of the sosfilt filtering is as follows:
[0132] (8)
[0133] Among them, f 1,1 ,f 1,2 ,...,f 2,6 represents the parameters of the filter array S, g 1,1 ,g 1.2 ,…,g 2,2 Represents the parameters of the filter array Z.
[0134] According to an embodiment of the present invention, the value at the t-th moment in the normalized piezoelectric signal D'[t] is filtered by the first row D1'[t], as shown in the following formula (9):
[0135] (9)
[0136] According to an embodiment of the present invention, the parameter is updated by the difference of the piezoelectric signal before and after the first row filtering, as shown in the following formula (10):
[0137] (10)
[0138] Among them, g 1,1’ represents the first updated parameter of the first row of the filter array Z, g 1.2’Represents the second updated parameters of the first row of filter array Z.
[0139] According to an embodiment of the present invention, the value at the t-th moment in the piezoelectric signal D1'[t] after the first row of filtering is filtered through the second row of filtering D2'[t], as shown in the following formula (11):
[0140] (11)
[0141] According to an embodiment of the present invention, the parameter is updated by the difference of the piezoelectric signal before and after the second row filtering, as shown in the following formula (12):
[0142] (12)
[0143] Among them, g 2,1’ represents the first updated parameter of the second row of the filter array Z, g 2,2’ Represents the second updated parameters of the second row of filter array Z.
[0144] According to an embodiment of the present invention, D'[t] represents the value of the normalized piezoelectric signal at the tth moment, D1'[t] represents the value of the piezoelectric signal after the first row of filtering at the tth moment, and D2'[t] represents the value of the piezoelectric signal after D'[t] is filtered through two rows at the tth moment. D2'[t] may include the value of the piezoelectric signal at the tth moment related to the heart rate after the two rows of filtering Dhr2'[t] and the value of the piezoelectric signal at the tth moment related to the breathing frequency after the two rows of filtering Dbr2'[t]. Substituting the heart rate data of the target user into the above formulas (7) to (12), the piezoelectric signal Dhr2'[t] after the two rows of filtering can be obtained. Substituting the breathing frequency data of the target user into the above formulas (7) to (12), the piezoelectric signal Dbr2'[t] after the two rows of filtering can be obtained.
[0145] According to the embodiment of the present invention, the robustness of the filter can be improved by updating the parameters of the filter.
[0146] According to an embodiment of the present invention, the filter array S_hr related to the heart rate data of the target user may be:
[0147] .
[0148] According to an embodiment of the present invention, the filter array S_br related to the target user's breathing frequency data may be:
[0149] .
[0150] According to an embodiment of the present invention, the piezoelectric signal D[t] is normalized to D'[t], as shown in formula (13):
[0151] (13)
[0152] Among them, range represents the size range of the collected piezoelectric signal D[t], min D[t] Indicates the minimum value of multiple piezoelectric signals collected.
[0153] According to an embodiment of the present invention, the range of the collected piezoelectric signal D[t] is calculated as follows:
[0154] (14)
[0155] Among them, max D[t] Indicates the maximum value of multiple piezoelectric signals collected.
[0156] According to an embodiment of the present invention, when the acquisition device is a smart mattress, the heart rate data hr2 at a certain sampling time in the heart rate data sequence of the target user is calculated as follows:
[0157] (15)
[0158] Wherein, s_index1 represents the sequence number of the heart rate data in the heart rate data sequence corresponding to the extreme value of the autocorrelation function curve.
[0159] According to an embodiment of the present invention, when collecting 1000 heart rate data, the sampling frequency FS is calculated as follows:
[0160] (16)
[0161] According to an embodiment of the present invention, the minimum value of the heart rate data min_freq=40 and the maximum value of the heart rate data max_freq=150 can be set. When 1000 heart rate data are collected, the median of the heart rate data between the maximum value and the minimum value of the 1000 heart rate data can be calculated, and when the difference between the heart rate data at a certain moment and the median is less than the preset heart rate threshold th6, the average value of the heart rate data near the median is used as the final heart rate data hr at that moment. The number of nearby heart rate data can be set according to demand. For example, the number of nearby heart rate data can be set to 10.
[0162] According to an embodiment of the present invention, when the acquisition device is a smart mattress, the respiratory frequency data br2 at a certain sampling time in the respiratory frequency data sequence of the target user is calculated as follows:
[0163] (17)
[0164] Wherein, s_index2 represents the sequence number of the respiratory frequency data in the respiratory frequency data sequence corresponding to the extreme value of the autocorrelation function curve.
[0165] According to an embodiment of the present invention, the minimum value of the respiratory frequency data min_freq=10 and the maximum value of the respiratory frequency data max_freq=30 can be set. By calculating the median of the respiratory frequency data between the maximum value and the minimum value in the respiratory frequency data sequence, when the difference between the respiratory frequency data at the sampling moment and the median is less than the preset threshold value th7 of the respiratory frequency, the average value near the median is used as the final respiratory frequency data br at the sampling moment. The number of nearby respiratory frequency data can be set according to demand. For example, the number of nearby respiratory frequency data can be set to 5.
[0166] According to an embodiment of the present invention, the ratio of the heart rate data to the respiratory rate data may be determined by the ratio of the heart rate data to the respiratory rate data, as shown in the following formula (18):
[0167] (18)
[0168] Among them, hr represents heart rate data, and br represents breathing rate data.
[0169] According to an embodiment of the present invention, the heart rate data may be hr1 or hr2, and the respiratory rate data may be br1 or br2.
[0170] According to an embodiment of the present invention, at the current sampling time minute, the status information is the in-bed status, and the person has left the bed before the current sampling time, that is, the bed leaving flag off_bed_flag is 1, and in the case where the person has left the bed before midnight and went to bed before midnight or has left the bed after midnight and went to bed after midnight, the bed leaving time off_bed_d exceeds 30 minutes, the 30-minute bed leaving flag off_bed_30_flag is set to 1, the bed leaving calculation flag off_bed_c_flag is set to 1, and the sleep time c_s_time is reduced by 1; if the bed leaving time off_bed_d does not exceed 30 minutes, it is determined whether the current minute is the last data. If the data at the current sampling time is the last data, off_bed_c_flag is set to 1, and the sleep time c_s_time is reduced by 1. If the current data is not the last data, off_bed_c_flag is set to 0, and the sleep time c_s_time is equal to the current sampling time minus the bed leaving time.
[0171] According to an embodiment of the present invention, at the current sampling time minute, the state information is in bed state, and there has been a bed leaving before the current sampling time, that is, the bed leaving flag off_bed_flag is 1, and in the case of leaving the bed before midnight and going to bed after midnight, the bed leaving time off_bed_d is minute+1440-off_bed_minute. When the bed leaving time off_bed_d exceeds 30 minutes, the bed leaving 30 minutes flag off_bed_30_flag is set to 1, the bed leaving calculation flag off_bed_c_flag is set to 1, and the sleep time c_s_time is reduced by 1; when the bed leaving time off_bed_d is less than 30 minutes, it is determined whether the data at the current sampling time is the last data. If the current data is the last data, off_bed_c_flag is set to 1, and the sleep time c_s_time is reduced by 1. If the current data is not the last data, off_bed_c_flag is set to 0, and the sleep time c_s_time is equal to the current sampling time minus the bed leaving time.
[0172] According to an embodiment of the present invention, when the current sampling time is in the out-of-bed state, and the user has left the bed before the current sampling time, that is, the out-of-bed flag off_bed_flag is 1, and the user leaves the bed before midnight and goes to bed before midnight, or leaves the bed after midnight and goes to bed after midnight, and the out-of-bed time off_bed_d exceeds 30 minutes, off_bed_30_flag is set to 1. When the user leaves the bed before midnight and goes to bed after midnight, and the out-of-bed time off_bed_d exceeds 30 minutes, off_bed_30_flag is set to 1.
[0173] According to an embodiment of the present invention, the autocorrelation function of the target user at the current sampling moment can be obtained based on the piezoresistive signal and piezoelectric signal of the target user acting on the smart mattress, and then the heart rate data sequence, respiratory rate data sequence and body movement data sequence of the target user can be obtained, thereby improving the accuracy of the heart rate data sequence, respiratory rate data sequence and body movement data sequence of the target user obtained when the acquisition device is a smart mattress.
[0174] According to an embodiment of the present invention, determining the state information of the target user at multiple sampling moments according to the sleep data sequence of the target user includes:
[0175] According to the sleep data sequence, a body movement data sequence of the target user is obtained;
[0176] According to the body motion data sequence of the target user, the state information of each target user at multiple sampling moments is determined.
[0177] According to an embodiment of the present invention, when the acquisition device is a smart bracelet, the target user's body movement data sequence can be obtained based on the target user's sleep data sequence, and then the target user's respective state information at multiple sampling times can be determined based on the target user's body movement data sequence.
[0178] For example, when the amount of body motion data in the body motion data sequence of the target user within 1 minute before the current sampling moment is greater than a predetermined threshold, it can be determined that the state information of the target user at the current sampling moment is the out-of-bed state. When the amount of body motion data in the body motion data sequence of the target user within 1 minute before the current sampling moment is less than a predetermined threshold, it can be determined that the state information of the target user at the current sampling moment is the out-of-bed state. The predetermined threshold can be set to 5.
[0179] According to an embodiment of the present invention, when the sampling device is a smart bracelet, the target user's body movement data sequence is obtained through the target user's sleep data sequence, and the target user's respective status information at multiple sampling moments is determined based on the body movement data sequence, thereby improving the accuracy of the determined target user's respective status information at multiple sampling moments.
[0180] According to an embodiment of the present invention, determining the state information of the target user at multiple sampling moments according to the sleep data sequence of the target user also includes:
[0181] According to the piezoresistive signal, the voltage values of the target users at multiple sampling moments are obtained;
[0182] According to the respective voltage values of the target users at the multiple sampling moments, the respective state information of the target users at the multiple sampling moments is determined.
[0183] According to an embodiment of the present invention, when the sampling device is a smart mattress, the piezoresistive signal V[t] of the target user can be converted into a voltage value P[t] as shown in the following formula (19):
[0184] (19)
[0185] According to an embodiment of the present invention, when the voltage value at the sampling moment is greater than the bed leaving voltage threshold th1, the state information of the target user at the sampling moment is determined to be the bed leaving state. When the voltage value at the sampling moment is less than the bed leaving voltage threshold th1, the state information of the target user at the sampling moment is determined to be the bed staying state.
[0186] For example, the out-of-bed voltage threshold is set to 2000. When the voltage value at the sampling moment is greater than 2000, it can be determined that the target user's state information at the sampling moment is out of bed; when the voltage value at the sampling moment is less than 2000, it can be determined that the target user's state information at the sampling moment is in bed.
[0187] According to an embodiment of the present invention, the number of saturated values, the number of abnormal values, and the number of normal values may be counted based on the number of collected piezoelectric signals D[t].
[0188] For example, when the number DATA_length of the collected piezoelectric signals D[t] is 1000, the saturation threshold is 2400, and the normal threshold is 500, a piezoelectric signal greater than 2400 is a saturated piezoelectric signal, a piezoelectric signal greater than 500 and less than 2400 is an abnormal piezoelectric signal, and a piezoelectric signal less than 500 is a normal piezoelectric signal.
[0189] According to an embodiment of the present invention, the calculation of the proportion s_r of the saturated piezoelectric signal is as follows:
[0190] (20)
[0191] Among them, sat_count represents the number of saturated piezoelectric signals, and DATA_length represents the total number of piezoelectric signals collected.
[0192] According to an embodiment of the present invention, the calculation of the proportion n_r of the normal piezoelectric signal is as follows:
[0193] (twenty one)
[0194] Wherein, norm_count represents the number of normal voltage signals.
[0195] According to an embodiment of the present invention, the proportion of abnormal piezoelectric signals u_r is calculated as follows:
[0196] (twenty two)
[0197] Wherein, unnorm_rate represents the number of abnormal voltage signals.
[0198] According to an embodiment of the present invention, when the sampling device is a smart mattress, the voltage value of the target user is obtained through the piezoresistive signal exerted by the target user on the smart mattress, and the state information of the target user at multiple sampling moments is determined based on the voltage value of the target user, thereby improving the accuracy of the determined state information of the target user at multiple sampling moments.
[0199] According to an embodiment of the present invention, the bed state may include sitting down, turning over, and lying flat. When the voltage value is less than the sitting down voltage threshold th3, it can be determined that the target user is sitting down in the bed state. When the voltage value is greater than the turning over voltage threshold th5 and the abnormal proportion is greater than the abnormal threshold th4, it can be determined that the target user is turning over in the bed state. When the voltage value is not greater than the turning over voltage threshold th5 or the abnormal proportion is not greater than the abnormal threshold th4, the target user is lying flat in the bed state.
[0200] Figure 7 A framework diagram of sleep quality analysis according to an embodiment of the present invention is shown.
[0201] like Figure 7 As shown, the framework diagram includes a signal acquisition unit 710 , a signal extraction unit 720 , a data fault-tolerant processing unit 730 , a bed getting in and out analysis unit 740 , a sleep analysis unit 750 and a sleep quality analysis unit 760 .
[0202] According to an embodiment of the present invention, the signal acquisition unit 710 can use a signal acquisition device to collect sleep characteristic information of the target user. The signal extraction unit 720 can extract the sleep characteristic information collected by the signal acquisition unit 710 to obtain a heart rate data sequence, a respiratory rate data sequence and a body movement data sequence. The data fault tolerance unit 730 can avoid data processing interruptions caused by data errors through data fault tolerance processing. The bed-in-and-out analysis unit 740 can determine the time of leaving the bed and the time of going to bed through analysis. The sleep analysis unit 750 can divide the sleep stages according to the sleep data sequence, and then determine the time of falling asleep and the time of waking up. The sleep quality analysis unit 760 can perform sleep quality statistical analysis according to the total duration of each sleep stage.
[0203] Figure 8 A flowchart of sleep quality analysis according to an embodiment of the present invention is shown.
[0204] like Figure 8 As shown, the process includes operations S810 to S850.
[0205] Determine whether the scene is a single-player scene.
[0206] If it is determined to be a single-person scene, operation S820 is performed; if it is determined that the scene is not a single-person scene, that is, a multi-person scene, operation S810 is performed.
[0207] In operation S810, a smart bracelet is used to collect a sleep data sequence of a target user.
[0208] In operation S820, a sleep data sequence of a target user is collected using a smart mattress.
[0209] In operation S830, a bed-going time and a bed-leaving time are determined.
[0210] In operation S840, the sleep stages are divided.
[0211] In operation S850, a sleeping time and a waking time are determined.
[0212] Perform sleep quality analysis.
[0213] According to an embodiment of the present invention, by determining whether the scene is a single-person scene or a multi-person scene, a corresponding collection device can be selected to collect sleep characteristic information of a target user, and then a sleep data sequence is obtained. The target user's bedtime and bed-leaving time are determined according to the sleep data sequence, and then the sleep stage is determined. When the sleep stage is determined, the target user's sleeping time and waking time are determined, so as to count the total sleep duration of each sleep stage of the target user, perform sleep quality analysis, and improve the accuracy of the target user's sleep data. The target user's total bed time and the total sleep duration of each sleep stage are displayed through the front-end application, thereby improving the user experience of the target user.
[0214] Based on the above sleep data processing method, the present invention also provides a sleep data processing device. Fig. 9 The device is described in detail.
[0215] Fig. 9 A structural block diagram of a sleep data processing device according to an embodiment of the present invention is shown.
[0216] like Fig. 9 As shown, the sleep data processing device 900 of this embodiment includes an obtaining module 910 , a first determining module 920 , a second determining module 930 , and a third determining module 940 .
[0217] The obtaining module 910 is used to obtain the sleep data sequence of the target user in response to the data collection request based on the sleep characteristic information of the target user collected by the collection device in the target period, wherein the target period includes multiple sampling moments. In one embodiment, the obtaining module 910 can be used to perform the operation S210 described above, which will not be repeated here.
[0218] The first determination module 920 is used to determine the state information of the target user at multiple sampling moments according to the sleep data sequence of the target user. In one embodiment, the first determination module 920 can be used to perform the operation S220 described above, which will not be described in detail here.
[0219] The second determination module 930 is used to determine the target sleep stage of the target user at the multiple sleep stages at the multiple sampling moments according to the sleep data sequence of the target user and the state information of the target user at the multiple sampling moments, wherein the multiple sleep stages include: awake stage, light sleep stage, deep sleep stage and eye movement stage. In one embodiment, the second determination module 930 can be used to perform the operation S230 described above, which will not be repeated here.
[0220] The third determination module 940 is used to determine the total in-bed time, total awake time, total light sleep time, total eye movement time, and total deep sleep time of the target user according to the target sleep stage of the target user at multiple sampling times. In one embodiment, the third determination module 940 can be used to perform the operation S240 described above, which is not repeated here.
[0221] According to an embodiment of the present invention, the third determining module 940 includes:
[0222] A first determination submodule is used to determine the target user's bed-going time and bed-leaving time according to the target user's sleep data sequence and the target user's respective state information at multiple sampling times;
[0223] The second determination submodule is used to determine the total time the target user spends in bed according to the time the target user goes to bed and the time when he leaves bed;
[0224] A third determination submodule is used to determine the number of sampling moments associated with each of the multiple sleep stages according to the target sleep stage of the target user at each of the multiple sampling moments;
[0225] A fourth determination submodule, configured to obtain a total duration of each of the multiple sleep stages based on the number of sampling moments associated with each of the multiple sleep stages and the sampling intervals between each of the multiple sampling moments;
[0226] The fifth determination submodule is used to determine the total duration of wakefulness, total duration of light sleep, total duration of eye movement and total duration of deep sleep of the target user according to the total duration of each of the multiple sleep stages.
[0227] According to an embodiment of the present invention, the state information includes the bed state and the bed leaving state, and the first determination submodule includes:
[0228] a first determining unit, configured to determine the current sampling moment as the bed-going time of the target user, when the state information of the target user at the current sampling moment is the in-bed state and the state information of each time before the current sampling moment is the out-of-bed state;
[0229] The second determination unit is used to determine that the current sampling moment is the time when the target user leaves the bed when the state information of the target user at the current sampling moment is the state of leaving the bed and the current sampled sleep duration is greater than a preset threshold, wherein the current sleep duration indicates the duration of sleep of the target user before the current sampling moment.
[0230] According to an embodiment of the present invention, the collection device is a smart bracelet, the sleep data sequence includes a heart rate data sequence, a respiratory rate data sequence and a body movement data sequence, and the module 910 is obtained, including:
[0231] The first obtaining submodule is used to obtain the sleep data sequence of the target user in response to the data collection request based on the sleep characteristic information of the target user collected by the collection device in the target period, including:
[0232] The second obtaining submodule is used to respond to the data collection request, collect information of the target user in the target period by using the smart bracelet, and obtain the photoelectric volume pulse wave signal and acceleration signal of the target user;
[0233] The third obtaining submodule is used to obtain the heart rate data sequence, respiratory rate data sequence and body movement data sequence of the target user according to the sampling frequency, the peak interval of the photoelectric volume pulse wave signal and the acceleration signal, wherein the sampling frequency is the sampling speed of the acquisition device;
[0234] Among them, the third submodule includes:
[0235] A first obtaining unit is used to obtain a heart rate data sequence of a target user according to a sampling frequency and a peak interval of a photoplethysmogram signal;
[0236] a second obtaining unit, configured to perform Fourier transform on the photoplethysmogram signal to obtain a target photoplethysmogram signal;
[0237] A third obtaining unit is used to obtain a respiratory frequency data sequence of a target user according to an extreme value of a target photoplethysmogram signal;
[0238] The fourth obtaining unit is used to obtain the body motion data sequence of the target user according to the average acceleration of the acceleration signal on the x-axis and the y-axis of the rectangular coordinate system.
[0239] According to an embodiment of the present invention, the acquisition device is a smart mattress, and module 910 is obtained, including:
[0240] The fourth obtaining submodule is used to respond to the data collection request, collect information of the target user in the target period by using the smart mattress, and obtain the piezoelectric signal and the piezoresistive signal of the target user acting on the mattress;
[0241] The fifth obtaining submodule is used to obtain the autocorrelation function curve at the current sampling moment by processing the piezoresistive signal;
[0242] The sixth obtaining submodule is used to obtain the heart rate data sequence and the respiratory rate data sequence of the target user according to the extreme value of the autocorrelation function curve;
[0243] The seventh obtaining submodule is used to obtain a body motion data sequence of the target user according to the piezoelectric signal and the piezoresistive signal.
[0244] According to an embodiment of the present invention, the first determining module 920 includes:
[0245] A sixth determination submodule, configured to obtain a body movement data sequence of a target user according to the sleep data sequence;
[0246] The seventh determination submodule is used to determine the state information of the target user at multiple sampling moments according to the body motion data sequence of the target user.
[0247] According to an embodiment of the present invention, the first determining module 920 further includes:
[0248] An eighth determination submodule, used to obtain respective voltage values of the target users at multiple sampling times according to the piezoresistive signal;
[0249] The ninth determination submodule is used to determine the state information of the target users at multiple sampling moments according to the voltage values of the target users at multiple sampling moments.
[0250] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a proper combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be executed.
[0251] For example, any multiple of the obtaining module 910, the first determining module 920, the second determining module 930, and the third determining module 940 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present invention, at least one of the obtaining module 910, the first determining module 920, the second determining module 930, and the third determining module 940 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the obtaining module 910, the first determining module 920, the second determining module 930, and the third determining module 940 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be executed.
[0252] It should be noted that the sleep data processing device part in the embodiment of the present invention corresponds to the sleep data processing method part in the embodiment of the present invention. The description of the sleep data processing device part specifically refers to the sleep data processing method part, which will not be repeated here.
[0253] Fig.10 A block diagram of an electronic device suitable for implementing a sleep data processing method according to an embodiment of the present invention is shown.
[0254] like Fig.10 As shown, the computer electronic device 1000 according to an embodiment of the present invention includes a processor 1001, which can perform various appropriate actions and processes according to the program stored in ROM 1002 or the program loaded from the storage part 1008 to RAM 1003. The processor 1001 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include an onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0255] In RAM1003, various programs and data required for the operation of electronic device 1000 are stored. Processor 1001, ROM1002 and RAM1003 are connected to each other via bus 1004. Processor 1001 performs various operations of the method flow according to an embodiment of the present invention by executing the program in ROM1002 and / or RAM1003. It should be noted that the program can also be stored in one or more memories other than ROM1002 and RAM1003. Processor 1001 can also perform various operations of the method flow according to an embodiment of the present invention by executing the program stored in the one or more memories.
[0256] According to an embodiment of the present invention, the electronic device 1000 may further include an I / O interface 1005, which is also connected to the bus 1004. The electronic device 1000 may further include one or more of the following components connected to the I / O interface 1005: an input portion 1006 including a keyboard, a mouse, etc.; an output portion 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk, etc.; and a communication portion 1009 including a network interface card such as a LAN card, a modem, etc. The communication portion 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage portion 1008 as needed.
[0257] According to an embodiment of the present invention, the method flow according to an embodiment of the present invention can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the system of the embodiment of the present invention are executed. According to an embodiment of the present invention, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0258] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0259] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory RAM, a read-only memory ROM, an erasable programmable read-only memory EPROM or a flash memory, a portable compact disk read-only memory CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device.
[0260] For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 1002 and / or the RAM 1003 described above and / or one or more memories other than the ROM 1002 and the RAM 1003 .
[0261] An embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present invention. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the method provided by the embodiment of the present invention.
[0262] When the computer program is executed by the processor 1001, the above functions defined in the system / device of the embodiment of the present invention are executed. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0263] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1009, and / or installed from the removable medium 1011. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0264] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0265] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present invention can be combined and / or combined in various ways, even if such a combination or combination is not explicitly recorded in the present invention. In particular, without departing from the spirit and teaching of the present invention, the features described in the various embodiments and / or claims of the present invention may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present invention.
[0266] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination. The scope of the present invention is defined by the attached claims and their equivalents. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A sleep data processing method, characterized in that: include: In response to the data collection request, based on the sleep characteristic information of the target user collected by the collection device during the target period, a sleep data sequence of the target user is obtained, wherein the target period includes a plurality of sampling moments, and the sleep data sequence includes a heart rate data sequence, a respiratory rate data sequence, and a body movement data sequence; Determining the state information of each of the target users at the plurality of sampling moments according to the body motion data sequence of the target user includes: When the acquisition device is a smart mattress, the voltage values of the target user at the multiple sampling moments are obtained according to the piezoresistive signal using formula (1); (1) Wherein, P[t] represents the voltage value, and V[t] represents the piezoresistive signal; Determining the state information of the target user at the multiple sampling moments according to the respective voltage values of the target user at the multiple sampling moments; The state information includes a bed state and an out-of-bed state. When the voltage value is greater than the out-of-bed voltage threshold, the state information of the target user is an out-of-bed state. The in-bed state includes sitting down, turning over, and lying flat. When the voltage value is less than or equal to the sitting down voltage threshold, the state information of the target user is determined to be the sitting down state in the in-bed state. When the voltage value is greater than the turning over voltage threshold and the abnormal proportion is greater than the abnormal threshold, the state information of the target user is determined to be the turning over state in the in-bed state. When the voltage value is not greater than the turning over voltage threshold or the abnormal proportion is not greater than the abnormal threshold, the state information of the target user is determined to be the lying flat state in the in-bed state. The abnormal proportion represents the proportion of abnormal piezoelectric signals. The proportion of abnormal piezoelectric signals is calculated as follows: (2) Wherein, u_r represents the proportion of the abnormal piezoelectric signal, unnorm_rate represents the number of the abnormal piezoelectric signals, and DATA_length represents the total number of the piezoelectric signals; The determination process of the abnormal piezoelectric signal is as follows: when the saturation threshold is set to 2400 and the normal threshold is set to 500, the piezoelectric signal greater than 2400 is a saturated piezoelectric signal, the piezoelectric signal greater than 500 and less than 2400 is an abnormal piezoelectric signal, and the piezoelectric signal less than 500 is a normal piezoelectric signal; when the abnormal piezoelectric signal is determined, the number of the abnormal piezoelectric signals is counted; Determine, according to the sleep data sequence of the target user and the state information of the target user at the multiple sampling moments, the target sleep stage of the target user in the multiple sleep stages at the multiple sampling moments, wherein the multiple sleep stages include: awake stage, light sleep stage, deep sleep stage and eye movement stage; and According to the target sleep stage of the target user at each of the multiple sampling moments, the total in-bed time, the total awake time, the total light sleep time, the total eye movement time and the total deep sleep time of the target user are determined.
2. The method according to claim 1, characterized in that The determining, according to the target sleep stages of the target user at the multiple sampling moments, the total in-bed time, the total awake time, the total light sleep time, the total eye movement time, and the total deep sleep time of the target user, comprises: Determine the time when the target user goes to bed and the time when the target user leaves bed according to the sleep data sequence of the target user and the state information of the target user at the multiple sampling times; Determine the total time the target user spends in bed according to the time the target user goes to bed and the time when the target user leaves bed; Determining the number of sampling moments associated with each of the plurality of sleep stages according to the target sleep stage of the target user at each of the plurality of sampling moments; Based on the number of sampling moments associated with each of the plurality of sleep stages and the sampling intervals between each of the plurality of sampling moments, obtaining a total duration of each of the plurality of sleep stages; and The total duration of wakefulness, total duration of light sleep, total duration of eye movement and total duration of deep sleep of the target user are determined according to the total durations of each of the multiple sleep stages.
3. The method according to claim 2, characterized in that The step of determining the bed-going time and bed-leaving time of the target user according to the sleep data sequence of the target user and the state information of the target user at the multiple sampling times includes: When the target user's status information at the current sampling time is in bed and the status information at the previous time of the current sampling time is out of bed, determining the current sampling time as the target user's bedtime; and When the state information of the target user at the current sampling moment is the out-of-bed state and the current sampled sleep duration is greater than a preset threshold, the current sampling moment is determined to be the out-of-bed moment of the target user, wherein the current sleep duration indicates the duration of sleep of the target user before the current sampling moment.
4. The method according to claim 1, characterized in that: The acquisition device is a smart bracelet; wherein, The step of obtaining the sleep data sequence of the target user in response to the data collection request based on the sleep characteristic information of the target user collected by the collection device during the target period includes: In response to the data collection request, using a smart bracelet to collect information on the target user during the target time period to obtain a photoplethysmogram signal and an acceleration signal of the target user; and According to the sampling frequency, the peak interval of the photoplethysmogram signal and the acceleration signal, a heart rate data sequence, a respiratory rate data sequence and a body movement data sequence of the target user are obtained, wherein the sampling frequency is the sampling speed of the acquisition device; Wherein, the heart rate data sequence, the breathing rate data sequence and the body movement data sequence of the target user are obtained according to the sampling frequency, the peak interval of the photoplethysmogram signal and the acceleration signal, including: Obtaining a heart rate data sequence of the target user according to the sampling frequency and the peak interval of the photoplethysmogram signal; Performing Fourier transform on the photoplethysmogram signal to obtain a target photoplethysmogram signal; Obtaining a respiratory frequency data sequence of the target user according to the extreme value of the target photoplethysmogram signal; The body motion data sequence of the target user is obtained according to the average acceleration of the acceleration signal on the x-axis and the y-axis of the rectangular coordinate system.
5. The method according to claim 4, characterized in that The acquisition device is a smart mattress; wherein, The step of obtaining the sleep data sequence of the target user in response to the data collection request based on the sleep characteristic information of the target user collected by the collection device during the target period includes: In response to the data collection request, using the smart mattress to collect information about the target user during the target period, and obtaining a piezoelectric signal and a piezoresistive signal of the target user acting on the mattress; By processing the piezoresistive signal, an autocorrelation function curve at a current sampling moment is obtained; Obtaining the heart rate data sequence and the breathing frequency data sequence of the target user according to the extreme value of the autocorrelation function curve; and A body motion data sequence of the target user is obtained according to the piezoelectric signal and the piezoresistive signal.
6. A sleep data processing device, characterized in that: include: an obtaining module, configured to obtain, in response to a data collection request, a sleep data sequence of the target user based on the sleep characteristic information of the target user collected by the collection device during a target period, wherein the target period includes a plurality of sampling moments, and the sleep data sequence includes a heart rate data sequence, a respiratory frequency data sequence, and a body movement data sequence; The first determination module is used to determine the state information of each of the target users at the multiple sampling moments according to the body motion data sequence of the target user, including: When the acquisition device is a smart mattress, the voltage values of the target user at the multiple sampling moments are obtained according to the piezoresistive signal using formula (1); (1) Wherein, P[t] represents the voltage value, and V[t] represents the piezoresistive signal; According to the voltage values of the target user at the multiple sampling moments, the state information of the target user at the multiple sampling moments is determined; wherein the state information includes the bed state and the out-of-bed state. When the voltage value is greater than the out-of-bed voltage threshold, the state information of the target user is the out-of-bed state. The in-bed state includes sitting down, turning over and lying flat. When the voltage value is less than or equal to the sitting down voltage threshold, the state information of the target user is determined to be the sitting down in the in-bed state. When the voltage value is greater than the turning over voltage threshold and the abnormal proportion is greater than the abnormal threshold, the state information of the target user is determined to be the turning over in the in-bed state. When the voltage value is not greater than the turning over voltage threshold or the abnormal proportion is not greater than the abnormal threshold, the state information of the target user is determined to be the lying flat in the in-bed state. The abnormal proportion represents the proportion of abnormal piezoelectric signals. The proportion of abnormal piezoelectric signals is calculated as follows: (2) Wherein, u_r represents the proportion of the abnormal piezoelectric signal, unnorm_rate represents the number of the abnormal piezoelectric signals, and DATA_length represents the total number of the piezoelectric signals; The determination process of the abnormal piezoelectric signal is as follows: when the saturation threshold is set to 2400 and the normal threshold is set to 500, the piezoelectric signal greater than 2400 is a saturated piezoelectric signal, the piezoelectric signal greater than 500 and less than 2400 is an abnormal piezoelectric signal, and the piezoelectric signal less than 500 is a normal piezoelectric signal; when the abnormal piezoelectric signal is determined, the number of the abnormal piezoelectric signals is counted; a second determination module is used to determine the target sleep stage of the target user in the multiple sleep stages at the multiple sampling moments according to the sleep data sequence of the target user and the state information of the target user at the multiple sampling moments, wherein the multiple sleep stages include: awake stage, light sleep stage, deep sleep stage and eye movement stage; The third determination module is used to determine the total in-bed time, total awake time, total light sleep time and total deep sleep time of the target user according to the target sleep stage of the target user at each of the multiple sampling times.
7. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 5.
