CN117503051A - Sleep detection method, wearable device and readable medium - Google Patents

Sleep detection method, wearable device and readable medium Download PDF

Info

Publication number
CN117503051A
CN117503051A CN202310770637.8A CN202310770637A CN117503051A CN 117503051 A CN117503051 A CN 117503051A CN 202310770637 A CN202310770637 A CN 202310770637A CN 117503051 A CN117503051 A CN 117503051A
Authority
CN
China
Prior art keywords
value
user
time period
preset
preset time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310770637.8A
Other languages
Chinese (zh)
Inventor
何岸
丁钰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Xiaoche Technology Co ltd
Original Assignee
Shenzhen Xiaoche Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Xiaoche Technology Co ltd filed Critical Shenzhen Xiaoche Technology Co ltd
Priority to CN202310770637.8A priority Critical patent/CN117503051A/en
Publication of CN117503051A publication Critical patent/CN117503051A/en
Pending legal-status Critical Current

Links

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/48Other medical applications
    • A61B5/4806Sleep evaluation
    • A61B5/4809Sleep detection, i.e. determining whether a subject is asleep or not
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/68Arrangements of detecting, measuring or recording means, e.g. sensors, in relation to patient
    • A61B5/6801Arrangements of detecting, measuring or recording means, e.g. sensors, in relation to patient specially adapted to be attached to or worn on the body surface
    • A61B5/6802Sensor mounted on worn items
    • A61B5/681Wristwatch-type devices
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/68Arrangements of detecting, measuring or recording means, e.g. sensors, in relation to patient
    • A61B5/6801Arrangements of detecting, measuring or recording means, e.g. sensors, in relation to patient specially adapted to be attached to or worn on the body surface
    • A61B5/6813Specially adapted to be attached to a specific body part
    • A61B5/6825Hand
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention provides a sleep detection method, wearable equipment and a readable medium, wherein the method comprises the steps of acquiring triaxial acceleration data acquired by an accelerometer within a first preset duration, and converting the triaxial acceleration data into combined acceleration data; determining the total acceleration difference value of all adjacent sampling points in a first preset time period according to the total acceleration data, and summing the total acceleration difference values; starting a first inactivity counter, and adding 1 to the inactivity counter in response to the result of the summation process being less than a first preset value; and determining whether the user is in a sleep state or not according to at least the value of the first inactivity counter within a second preset time period, wherein the second preset time period is longer than the first preset time period. Therefore, whether the user is in a sleep state can be identified according to the acceleration data acquired by the accelerometer in a period of time, the detection method is simple, the calculated amount is small, and the power consumption of the wearable equipment is reduced.

Description

Sleep detection method, wearable device and readable medium
Technical Field
The invention belongs to the field of electronic equipment, and particularly relates to a sleep detection method, wearable equipment and a readable medium.
Background
The quality of sleep is closely related to the health of a human body, the living pressure of modern people is gradually increased, and people have more and more demands on the monitoring of sleep and the guidance of scientific sleep. In the prior art, wearable devices such as a smart watch and a bracelet are often adopted to track human sleep.
However, in the prior art, the sleep detection method for the wearable device is complex, power consumption of the wearable device will be increased, and special consideration is not given to some user scenes (such as playing a mobile phone and having a relatively slight momentum), so that the accuracy of sleep recognition is poor.
Disclosure of Invention
An object of an embodiment of the present disclosure is to provide a sleep detection method, a wearable device, and a readable medium, which can solve the problem of the detection method in the prior art, so as to reduce the power consumption of the wearable device.
In a first aspect, an embodiment of the present disclosure provides a sleep detection method, applied to a wearable device, the method including:
acquiring triaxial acceleration data acquired by an accelerometer within a first preset time period, and converting the triaxial acceleration data into combined acceleration data;
determining the total acceleration difference value of all adjacent sampling points in a first preset time period according to the total acceleration data, and summing the total acceleration difference values;
starting a first inactivity counter, and adding 1 to the value of the inactivity counter in response to the result of the summation process being less than a first preset value;
and determining whether the user is in a sleep state or not according to at least the value of the first inactivity counter within a second preset time period, wherein the second preset time period is longer than the first preset time period.
According to a first aspect of the present disclosure, determining whether a user is in a sleep state according to a sum of first preset durations for which first marks are performed within a second preset duration includes:
and identifying the user state as a sleep state according to the value of the first inactivity counter being greater than a second preset value within a second preset time period.
According to a first aspect of the present disclosure, determining whether a user is in a sleep state according to a value of a first inactivity counter for a second preset time period includes:
responsive to determining that the value of the first inactivity counter is greater than the third preset value for the second preset time period;
and determining whether the user is in a sleep state according to the Z-axis change characteristic and the mean square error characteristic of the accelerometer, wherein the Z-axis of the accelerometer is an axis perpendicular to the surface of the display screen of the wearable device.
According to a first aspect of the present disclosure, determining whether a user is in a sleep state according to a Z-axis variation characteristic and a mean square error characteristic of an accelerometer includes:
determining a Z-axis rotation angle of the accelerometer within a first preset time period;
determining the mean square error of triaxial acceleration data in a first preset duration;
starting a second inactivity counter;
in response to the Z-axis rotation angle being less than a fourth preset value and the mean square error being less than a fifth preset value, adding 1 to the value of the second inactivity counter;
and determining that the user is in the sleep state in response to the value of the second inactivity counter being greater than a sixth preset value for a second preset time period.
According to a first aspect of the present disclosure, the Z-axis rotation angle calculation formula is:
wherein θ represents the Z-axis rotation angle, α t The included angle between the Z axis of the acceleration sensor at the moment t and the Z axis of the natural coordinate system is shown, alpha t+n The Z-axis clamping angle of the acceleration sensor at the moment t+n and the Z-axis of the natural coordinate system is represented, n represents a first preset duration, and Z is represented by t Indicating the Z-axis value and x of the acceleration sensor at the moment t t The X-axis value and y of the acceleration sensor at the moment t are shown t And the Y-axis value of the acceleration sensor at the time t is shown.
According to a first aspect of the disclosure, the method further comprises:
starting an activity counter in response to the user being in a sleep state, adding 1 to the value of the activity counter according to the determined summation processing result being greater than a seventh preset value, wherein the seventh preset value is greater than the first preset value;
and determining whether the user is converted from the sleep state to the non-sleep state according to the value of the activity counter in the third preset time period, wherein the third preset time period is longer than the first preset time period.
According to a first aspect of the disclosure, a method comprises: and determining the sleep stages of the user according to the value of the first inactivity counter in the fourth preset time period, wherein the sleep stages comprise a awake period, a light sleep period, a deep sleep period and a rapid eye movement period.
According to a first aspect of the disclosure, the method further comprises:
and acquiring heart rate data of the user based on the heart rate sensor, and calibrating the sleeping time of the user according to the change condition of the heart rate data.
In a second aspect, embodiments of the present disclosure also provide a wearable device comprising a processor, a memory, and an accelerometer, the accelerometer and the memory being connected to the processor by a bus, wherein,
a memory for storing program code for execution by the processor;
and the processor is used for calling the program codes stored in the memory and executing the method.
In a third aspect, embodiments of the present disclosure also provide a readable storage medium having instructions stored thereon that, when executed on a wearable device, cause the wearable device to perform the above-described method.
In the sleep detection method provided by the embodiment of the disclosure, the method includes: acquiring triaxial acceleration data acquired by an accelerometer within a first preset time period, and converting the triaxial acceleration data into combined acceleration data; determining the total acceleration difference value of all adjacent sampling points in a first preset time period according to the total acceleration data, and summing the total acceleration difference values; starting a first inactivity counter, and adding 1 to the inactivity counter in response to the result of the summation process being less than a first preset value; and determining whether the user is in a sleep state or not according to at least the value of the first inactivity counter within a second preset time period, wherein the second preset time period is longer than the first preset time period. Based on the method, the wearable device can identify whether the user is in a sleep state according to the acceleration data acquired by the accelerometer in a period of time, the detection method is simple, the calculated amount is small, and the power consumption of the wearable device is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a block diagram of a wearable device provided by an embodiment of the present disclosure;
FIG. 2 is a three-axis schematic diagram of an accelerometer provided by embodiments of the present disclosure;
FIG. 3 is a flow chart of a sleep detection method provided by an embodiment of the present disclosure;
FIG. 4 is a flow chart of another sleep detection method provided by an embodiment of the present disclosure;
fig. 5 shows a flowchart of fig. 4 for determining whether a user is in a sleep state based on the Z-axis variation characteristic and the mean square error characteristic of the accelerometer.
Fig. 6 is a flowchart of yet another sleep detection method provided by an embodiment of the present disclosure.
Detailed Description
In order to make the technical problems, technical schemes and beneficial effects to be solved more clear, the invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present invention, the meaning of "a plurality" is two or more, unless explicitly defined otherwise. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
Fig. 1 provides an embodiment of a wearable device. The wearable device 100 provided by embodiments of the present disclosure is a portable device that is worn on a user's wrist and may include, but is not limited to, a smart watch, a smart bracelet, a smart wristband, and the like. In this embodiment, a smart watch is taken as an example for explanation.
Referring to fig. 1, wearable device 100 may include one or more processors 101, memory 102, display 103, communication module 104, sensor module 105, audio module 106, speaker 107, microphone 108, motor 109, keys 110, power management module 111, battery 112, indicator 113. The components may be connected and communicate by one or more communication buses or signal lines.
Processor 101 is the ultimate execution unit of information processing, program execution, and may execute an operating system or application programs to perform various functional applications and data processing of wearable device 100. Processor 101 may include one or more processing units, for example, processor 101 may include a central processor (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), an image signal processor (Image Signal Processing, ISP), a sensor hub processor or communication processor (Central Processor, CP) application processor (Application Processor, AP), and so forth. In some embodiments, the processor 101 may include one or more interfaces. The interface is used to couple a peripheral device to the processor 101 to transfer instructions or data between the processor 101 and the peripheral device.
Memory 102 may be used to store computer executable program code that includes instructions. The memory 102 may include a stored program area and a stored data area. The storage program area may store an operating system, an application program required for at least one function, etc., such as an application program for detecting a sleep state of a user. The stored data area may store data created during use of the wearable device 100, such as movement parameters of each movement of the user and physiological parameters of the user, such as number of steps, stride, pace, heart rate, blood oxygen, blood glucose concentration, etc. The memory 102 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash memory (universal flash storage, UFS), and the like. The operating system may include, but is not limited to, an android (android) operating system, an apple operating system (ios), or an embedded system. Applications may include contacts, phones, email clients, instant messaging, browsers, personal sports, image management, audiovisual players, calendars, add-ons (e.g., weather, stock, calculator, clock, dictionary), custom add-ons, searches, notes, maps, and so forth.
The display screen 103 is used to display a graphical user interface (Graphical User Interface, GUI) that may include graphics, text, icons, video, and any combination thereof. The display 103 may also display an interface including a list of application icons, and the display 103 may also display a dial interface including time information and other information, which is a main interface (primary interface) of the wearable device 100. The display 103 may be a liquid crystal display, an organic light emitting diode display, or the like. When the display screen 103 is a touch display screen, the display screen 103 can collect a touch signal at or above the surface of the display screen 103 and input the touch signal as a control signal to the processor 101.
The communication module 104 may support the wearable device 100 to communicate with a network and other devices through wireless communication techniques. The communication module 104 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. The communication module 104 includes an antenna, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, and so forth. The communication module 104 of the wearable device 100 may include one or more of a cellular mobile communication module, a short-range wireless communication module, a wireless internet module, a location information module. The cellular mobile communication module may transmit or receive wireless signals based on a technical standard of mobile communication, and any mobile communication standard or protocol may be used, including but not limited to global system for mobile communications (GSM), code Division Multiple Access (CDMA), code division multiple access 2000 (CDMA 2000), wideband CDMA (WCDMA), time division synchronous code division multiple access (TD-SCDMA), long Term Evolution (LTE), LTE-a (long term evolution-advanced), etc. The wireless internet module may transmit or receive wireless signals via a communication network according to a wireless internet technology, including Wireless LAN (WLAN), wireless fidelity (Wi-Fi), wi-Fi direct, digital Living Network Alliance (DLNA), wireless broadband (WiBro), etc. The short-range wireless communication module may transmit or receive wireless signals according to short-range communication technologies including bluetooth, radio Frequency Identification (RFID), infrared data communication (IrDA), ultra Wideband (UWB), zigBee, near Field Communication (NFC), wireless fidelity (Wi-Fi), wi-Fi direct, wireless USB (wireless universal serial bus), and the like. The location information module may acquire the location of the wearable device 100 based on a Global Navigation Satellite System (GNSS), which may include one or more of a Global Positioning System (GPS), a global satellite navigation system (Glonass), a beidou satellite navigation system, and a galileo satellite navigation system.
The sensor module 105 is used to measure physical quantities or to detect the operational state of the wearable smart device. The sensor module 105 may include an accelerometer 105A, a gyroscope sensor 105B, a barometric pressure sensor 105C, a magnetic sensor 105D, a bio-signal sensor 105E, a proximity sensor 105F, an ambient light sensor 105G, a touch sensor 105H, and the like. The sensor module 105 may also include control circuitry for controlling one or more sensors included in the sensor module 105.
Among other things, accelerometer 105A may detect the magnitude of acceleration of wearable device 100 in various directions. The magnitude and direction of gravity can be detected when the wearable device 100 is stationary. Accelerometer 105A may also be used to identify the pose of wearable device 100, for applications such as landscape switching, pedometer, etc. Accelerometer 105A may also be used for gesture recognition of the user, for example, to identify whether the user has raised his wrist. In some embodiments, accelerometer 105A may be used to monitor the user's walking and to count the number of steps of the user, and may also be used to detect strides, stride frequency, speed profiles, etc. during walking.
The gyro sensor 105B may be used to determine a motion pose of the wearable device 100. In some embodiments, the angular velocity of the wearable device 100 about three axes (i.e., x, y, and z axes) may be determined by the gyro sensor 105B. The accelerometer 105A and the gyroscopic sensor 105B may be used, alone or in combination, to identify movement of a user, such as to identify that the user is in a stationary state, a light movement state, a medium movement state, or a high movement state.
The air pressure sensor 105C is used to measure air pressure. In some embodiments, wearable device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 105C, aiding in positioning and navigation.
The magnetic sensor 105D includes a hall sensor, or magnetometer, or the like, may be used to determine the user's position.
The bio-signal sensor 105E is used to measure vital sign information of the user, including but not limited to a photoplethysmographic sensor, an electrocardiogram sensor, an electromyography sensor, an electroencephalogram sensor, an iris scan sensor, a fingerprint scan sensor, a temperature sensor. For example, the wearable device 100 may acquire the photo volume signal of the user through the photo volume pulse wave sensor to calculate information such as the heart rate or the blood oxygen saturation of the user. For example, the wearable device 100 may obtain changes in electrical activity produced by the user's heart via an electrocardiogram sensor. In some embodiments, wearable device 100 may determine whether the user is asleep by acquiring the sleep state of the user from vital sign information acquired by bio-signal sensor 105E and motion information acquired by accelerometer 105A, gyroscope sensor 105B.
The proximity sensor 105F is used to detect the presence of an object in the vicinity of the wearable device 100 without any physical contact. In some embodiments, the proximity sensor 105F may include a light emitting diode and a light detector. The wearable device 100 detects whether it is worn using a light detector, and when sufficient reflected light is detected, it may be determined that the wearable device 100 is worn.
The ambient light sensor 105G is used to sense ambient light level. In some embodiments, the wearable device 100 may adaptively adjust the display 103 brightness according to the perceived ambient light level to reduce power consumption. In some embodiments, ambient light sensor 105G may also cooperate with a proximity sensor to detect whether wearable device 100 is in a pocket to prevent false touches.
A touch sensor 105H, the touch sensor 105H being configured to detect a touch operation acting thereon or thereabout, also referred to as a "touch device". The touch sensor 105H may be disposed on the display 103, and the touch sensor 105H and the display 103 form a touch screen.
The audio module 106, speaker 107, and microphone 108 provide audio functions or the like between the user and the wearable device 100, such as listening to music or talking. The audio module 106 converts the received audio data into an electrical signal, sends the electrical signal to the speaker 107, and converts the electrical signal into sound by the speaker 107; or the microphone 108 converts the sound into an electrical signal and sends the electrical signal to the audio module 106, and the audio module 106 converts the audio electrical signal into audio data. Wherein the microphone 108 is also operable to detect the user's breath sounds to detect the user's breathing frequency.
The motor 109 may convert the electrical signal into mechanical vibration to produce a vibration effect. The motor 109 may be used for vibration alerting of incoming calls, messages, or for touch vibration feedback.
The keys 110 include a power-on key, a volume key, etc. The keys 110 may be mechanical keys 110 (physical buttons) or touch keys 110. The keys 110 may be rotational input buttons and the processor 101 may change the user interface on the display screen 103 based on the user's rotation of the rotational input buttons.
The battery 112 is used to provide power to the various components of the wearable device 100. The power management module 111 is used for charge and discharge management of the battery 112, and monitoring parameters such as battery capacity, battery cycle number, battery health status (whether leakage, impedance, voltage, current, and temperature). In some embodiments, the power management module 111 may charge the wearable device 100 by wired or wireless means.
The indicator 113 is used to indicate the status of the wearable device 100, for example to indicate a state of charge, a change in power, and may also be used to indicate a message, missed call, notification, etc. The indicator 113 may be a light mounted on the wearable device 100 housing.
It should be understood that in some embodiments, the wearable device 100 may be comprised of one or more of the foregoing components, and the wearable device 100 may include more or fewer components than illustrated, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Fig. 2 is a three-axis schematic diagram of an accelerometer provided by an embodiment of the present disclosure. As shown in fig. 2, the accelerometer may acquire acceleration data of the wearable device in three directions about the X, Y, Z axis. Wherein the X-axis may be an axis parallel to the user's arm when the wearable device is worn by the user's arm; the X-axis may be an axis perpendicular to the user's arm when the wearable device is worn by the user's arm; the Z-axis is an axis perpendicular to the surface of the wearable device display. The X, Y, Z axis reading of the accelerometer will change when the wearable device is moved or rotated, and at least one axis of the accelerometer may be angled from the standard coordinate system when the wearable device is rotated.
Fig. 3 is a flowchart of a sleep detection method according to an embodiment of the present disclosure. The sleep detection method is applicable to a wearable device as shown in fig. 1. The step counting method comprises the following steps:
s301, acquiring triaxial acceleration data acquired by the accelerometer within a first preset time period, and converting the triaxial acceleration data into combined acceleration data. In some embodiments, the first preset time period may be 1 second, 2 seconds, 3 seconds, or the like.
Where the tri-axis acceleration data output by the accelerometers is typically binary data, different accelerometers have different ranges, resolutions (sensitivities), and different sampling frequencies. For example, common ranges of acceleration include + -2 g, + -4 g, + -8 g, + -16 g, and so forth; the resolution of the accelerometer represents the minimum input acceleration increment which can be sensed by the accelerometer in a set range, and is generally represented by data conversion accuracy, and usually comprises 8bit,12bit,14bit,16bit and the like; the sampling frequency of the accelerometer refers to the number of samples per unit time, for example, an accelerometer with a sampling frequency of 25HZ samples 25 points per second and an accelerometer with a sampling frequency of 50HZ samples 50 points per second.
In order to be compatible with different accelerometers, the three-axis acceleration data are converted into combined acceleration data, wherein the conversion of the binary three-axis acceleration data output by the accelerometers into actual gravity acceleration data, and the combined acceleration data of each sampling point are determined.
Specifically, the following formula may be used to obtain actual gravitational acceleration data.
In equation (one), G represents the actual gravitational acceleration value, V represents the actual reading of the accelerometer for a certain axis, C represents the maximum reading of the accelerometer, and R represents the range of the accelerometer. Taking an accelerometer with a measuring range of +/-2 g and a resolution of 8bit as an example, the maximum reading of the accelerometer is 256, and if the actual reading of a certain axis of a certain sampling point is 64, the acceleration value of the axis is-1 g; if the actual reading is 192, then the acceleration value of the shaft is 1g.
After the triaxial acceleration data are converted into actual gravitational acceleration values, determining the combined acceleration value of each sampling point in the triaxial acceleration data by adopting a formula (II):
wherein A represents the combined acceleration value, and x, y and z represent the acceleration values of three axes respectively.
S302, determining the sum acceleration difference value of all adjacent sampling points in a first preset time period according to the sum acceleration data, and carrying out summation processing on the sum acceleration difference value.
Taking the accelerometer with the sampling frequency of 50HZ and the first preset time length of 1 second as an example, according to step S301, the combined acceleration data of 50 sampling points in 1 second is determined, then the combined acceleration difference values of all adjacent sampling points in 1 second are determined, and all the combined acceleration difference values obtained according to the combined acceleration data of 50 sampling points are summed.
S303, starting a first inactivity counter, and adding 1 to the value of the inactivity counter in response to the result of the summation processing being smaller than a first preset value. Specifically, the sum acceleration difference reflects the acceleration change condition between two sampling points, if the wearable device moves more severely within a first preset time period (for example, 1 second), the sum of the sum acceleration differences of all adjacent sampling points within the first preset time period (for example, 1 second) will be larger, and otherwise, smaller. Based on this, a first preset value may be set for the result of the summation processing of the integrated acceleration difference, and if the integrated acceleration difference is smaller than the first preset value, it is determined that the user is in a stationary state within a first preset period of time (for example, 1 second).
S304, determining whether the user is in a sleep state according to the value of the first inactivity counter in a second preset time period, wherein the second preset time period is longer than the first preset time period. Specifically, the wearable device may count the count result of the first inactivity counter within a second preset time period (e.g., 3 minutes, 5 minutes, 10 minutes, etc.), and analyze whether the user is in a sleep state according to the count result, where the first preset time period is, for example, 1 second, and the second preset time period is longer than the first preset time period, for example, 3 minutes, 5 minutes, 10 minutes, etc. The counting result shows the motion state of the user in the second preset time, and if the counting result is large, the user is basically in a static state and possibly in a sleep state in the second preset time; if the count result is smaller, the user is not at rest for a second preset time period, and may not be in a sleep state. Based on the method, the wearable device can identify whether the user is in a sleep state according to the acceleration data acquired by the accelerometer in a period of time, the detection method is simple, the calculated amount is small, and the power consumption of the wearable device is reduced.
In some implementations, determining whether the user is in a sleep state based on a sum of first preset durations during which the first marking is performed within the second preset duration includes: responsive to determining that the value of the first inactivity counter is greater than the third preset value for the second preset time period; and determining whether the user is in a sleep state according to the Z-axis change characteristic and the mean square error characteristic of the accelerometer, wherein the Z-axis of the accelerometer is an axis perpendicular to the surface of the display screen of the wearable device. Firstly, primarily determining whether the user is likely to be in a sleep state according to the value condition of the first inactivity counter in the second preset time period, and finally determining whether the user is in the sleep state according to the Z-axis change characteristic and the mean square error characteristic of the accelerometer if the user is likely to be in the sleep state. Wherein the third preset value may be equal to the second preset value as before.
Fig. 4 is a flowchart of another sleep detection method provided by an embodiment of the present disclosure. The sleep detection method is applicable to a wearable device as shown in fig. 1. The step counting method comprises the following steps:
s401, acquiring triaxial acceleration data acquired by the accelerometer within a first preset time period, and converting the triaxial acceleration data into combined acceleration data. In some embodiments, the first preset time period may be 1 second, 2 seconds, 3 seconds, or the like.
S402, determining the sum acceleration difference value of all adjacent sampling points in a first preset time period according to the sum acceleration data, and carrying out summation processing on the sum acceleration difference value.
S403, starting a first inactivity counter, and adding 1 to the value of the inactivity counter in response to the result of the summation processing being smaller than a first preset value.
S404, in response to determining that the value of the first inactivity counter in the second preset time period is larger than a third preset value, determining whether the user is in a sleep state according to the Z-axis change characteristic and the mean square error characteristic of the accelerometer. The second preset time period is longer than the first preset time period. Firstly, primarily determining whether the user is likely to be in a sleep state according to the value condition of the first inactivity counter in the second preset time period, and finally determining whether the user is in the sleep state according to the Z-axis change characteristic and the mean square error characteristic of the accelerometer if the user is likely to be in the sleep state. Wherein the third preset value may be equal to the second preset value as before.
FIG. 5 shows a specific flow of FIG. 4 for determining whether a user is asleep based on the Z-axis variation characteristics and the mean square error characteristics of the accelerometer, comprising:
s501, determining the Z-axis rotation angle of the accelerometer within a first preset time period. Wherein, the rotation angle calculation formula of Z axle is:
wherein θ represents the Z-axis rotation angle, α t The included angle between the Z axis of the acceleration sensor at the moment t and the Z axis of the natural coordinate system is shown, alpha t+n The Z-axis clamping angle of the acceleration sensor at the moment t+n and the Z-axis of the natural coordinate system is represented, n represents a first preset duration, and Z is represented by t Indicating the Z-axis value and x of the acceleration sensor at the moment t t The X-axis value and y of the acceleration sensor at the moment t are shown t And the Y-axis value of the acceleration sensor at the time t is shown.
Taking the sampling frequency of the accelerometer with 50HZ as 50HZ and the first preset time length as 1 second as an example, firstly calculating the included angle between the Z axis of the accelerometer at the time t (the first sampling point in 1 second) and the Z axis of the natural coordinate system, calculating the included angle between the Z axis of the accelerometer at the time t+n (the first sampling point in the next 1 second) and the Z axis of the natural coordinate system, and then subtracting the angles at the two times to obtain the rotation angle of the Z axis of the acceleration in the current 1 second.
S502, determining the mean square error of triaxial acceleration data in a first preset duration. The calculation formula of the mean square error is as follows:
wherein V is AR Mean square error of a first preset time period is represented, n represents the number of sampling points in the first preset time period, A i Indicating the combined acceleration value of the i-th sample point,and representing the average value of the combined acceleration values of all the sampling points in the first preset time period. The mean square error represents the fluctuation of the combined acceleration value.
S503, starting a second inactivity counter;
s504, in response to the Z-axis rotation angle being smaller than a fourth preset value and the mean square error being smaller than a fifth preset value, the value of the second inactivity counter is increased by 1. Namely, if the rotation angle of the Z axis in the first preset time period is smaller than a preset threshold value and the mean square error of the combined acceleration in the first preset time period is smaller than the preset threshold value, the user is considered to be in a static state in the first preset time period, and the value of the second inactivity counter is increased by 1. The rotation angle of the Z axis shows rotation information of the wearable equipment, the mean square error of the combined acceleration shows fluctuation of acceleration data, and if the two values are smaller, the user is in an inactive state within a first preset duration, so that identification (such as lying on a bed to play a mobile phone) is enhanced for slight actions of the user.
And S505, determining that the user is in a sleep state in response to the value of the second inactivity counter being greater than a sixth preset value within a second preset time period. The second preset time period is longer than the first preset time period. For example, the first preset duration may be 1 second, 2 seconds, 3 seconds; the second preset time period may be 3 minutes, 5 minutes, 10 minutes. Thus, the duration that the user remains inactive during the second preset duration is counted to determine whether the user is in a sleep state during the second preset duration.
In this embodiment, it is first determined by the value of the first inactivity counter whether the user is likely to be in a sleep state for a second preset time period, and then it is further determined by the value of the second inactivity counter whether the user is in a sleep state for the second preset time period. On the one hand, whether the user is in a sleep state or not is recognized through the value of the second inactivity counter based on the Z-axis rotation angle of the accelerometer and the mean square error of the combined acceleration, so that slight movement of the user can be recognized, and accuracy of sleep state recognition is improved; on the other hand, when the sleep state is identified, firstly, the suspected sleep state is identified through the summation processing result of the combined acceleration difference value, and if the suspected sleep is identified to be executed in the process of calculating the Z-axis rotation angle of the accelerometer and the combined acceleration mean square error, the accurate identification is carried out, so that the calculated amount is reduced, and the power consumption of the wearable equipment is reduced.
In some embodiments, the wearable device may determine sleep stages of the user including a awake period, a light sleep period, a deep sleep period, and a fast eye movement period according to the value of the first inactivity counter within a fourth preset time period. Wherein the fourth preset time period may be equal to the second preset time period. For example, a threshold range of the first inactivity counter corresponding to the awake period, the light sleep period, the deep sleep period, and the fast eye movement period may be preset, and the fourth preset duration may be identified as the corresponding sleep stage according to the threshold range in which the value of the first inactivity counter falls in the fourth preset duration. The awake period represents a stage that a user briefly changes from a sleep state to a non-sleep state in the sleep process and enters the sleep state again.
In some embodiments, the method further comprises: and acquiring heart rate data of the user based on the heart rate sensor, and calibrating the sleeping time of the user according to the change condition of the heart rate data. Specifically, after the wearable device recognizes the whole process from falling asleep to getting up (from a sleep state to a non-sleep state) of the user through the accelerometer after the sleep is finished, the falling asleep time of the user is calibrated based on heart rate data of the user. Wherein the time point of falling asleep is determined for the first time from the time at which the triaxial acceleration data is identified as the sleep state. In some embodiments, whether the time point of falling asleep is a real time point of falling asleep can be determined according to whether the heart rate is stable or whether the heart rate is slowly reduced in the preset time before and after the time point of falling asleep determined by the acceleration data, if the heart rate is stable or the heart rate is slowly reduced in the preset time before and after the time point of falling asleep, the time point of falling asleep is a real time point of falling asleep, otherwise, the time point of falling asleep is redetermined according to the heart rate condition. For example, the second preset duration is 5 minutes, the user is at 22: the time period of 30-22:35 is determined to be a sleep state according to the triaxial acceleration data for the first time, and then the time point of falling asleep is determined to be 22:30; after recognizing that the user gets up, calibrating the sleeping time point according to the heart rate condition of 10 minutes before and after the sleeping time point 22:30; if the heart rate is steady or slowly decreasing 10 minutes before and after 22:30, then 22:30 is determined as the real time point of falling asleep, and if the heart rate fluctuation is large 10 minutes before and after 22:30, the heart rate condition of the next time period determined as the sleep state can be passed, for example, 22: the period of 35-22:40 is determined as a sleep state, the time point of falling asleep is initially determined as 22:35, and if the heart rate is stable or slowly decreases 10 minutes before and after 22:35, 22:35 is determined as a real time point of falling asleep.
Fig. 6 is a flowchart of yet another sleep detection method provided by an embodiment of the present disclosure.
S601, acquiring triaxial acceleration data acquired by an accelerometer within a first preset time period, and converting the triaxial acceleration data into combined acceleration data. In some embodiments, the first preset time period may be 1 second, 2 seconds, 3 seconds, or the like.
S602, determining the combined acceleration difference value of all adjacent sampling points in a first preset time period according to the combined acceleration data, and carrying out summation processing on the combined acceleration difference value.
S603, starting a first inactivity counter, and adding 1 to the value of the inactivity counter in response to the result of the summation processing being smaller than a first preset value.
S604, determining whether the user is in a sleep state or not according to at least the value of the first inactivity counter in a second preset time period, wherein the second preset time period is longer than the first preset time period.
S605, an activity counter is started in response to the user being in a sleep state, and the activity counter is increased by 1 according to the determined summation processing result being larger than a seventh preset value. Wherein the seventh preset value is greater than the first preset value.
S606, determining whether the user is converted from the sleep state to the non-sleep state according to the value of the activity counter in the third preset time period, wherein the third preset time period is longer than the first preset time period.
In this embodiment, when the wearable device identifies that the user is in the sleep state, whether the user is in the active state in the first preset duration is determined according to whether the summation result of the sum acceleration differences of all adjacent sampling points in the first preset duration is greater than a seventh preset value, and if the user is in the active state, the activity counter is incremented by 1. Determining whether the user transitions from the sleep state to the non-sleep state according to the value of the activity counter in the third preset time period, and particularly determining whether the user transitions from the sleep state to the non-sleep state according to whether the value of the activity counter in the third preset time period is larger than an eighth preset value. For example, the first preset duration is 1 second, the third preset duration is 10 minutes, the eighth preset value is 360, and if the user state is the sleep state and the value of the activity counter exceeds 360 within 10 minutes, the user is identified to be transited from the sleep state to the non-sleep state.
In this embodiment, whether the sum result of the sum acceleration differences of all adjacent sampling points in a first preset time period in which the user is in an inactive state is determined by whether the sum result is smaller than a first preset value or not is identified; the recognition that the user is in the active state is determined by whether the summation result of the sum acceleration differences of all the adjacent sampling points in the first preset time period is smaller than a seventh preset value, and the seventh preset value is larger than the first preset value, so that the accuracy of activity recognition can be improved, and the situation that slight movement of the user is recognized as the active state is avoided. And besides, whether the user is in an active state within the third preset time period exceeds an eighth preset value or not is identified, if yes, the user is identified to be in a sleep state and is converted into a non-sleep state, and occasional movements of the user in the sleep process (such as turning over in the sleep process) are prevented from being erroneously identified as the conversion of the user state. The accuracy of the user from the sleep state to the non-sleep state is improved.
It is noted that the above-described figures are merely schematic illustrations of processes involved in a method according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
Exemplary embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon instructions capable of implementing the above-described methods of the present specification. In some possible implementations, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a wearable device to perform the steps according to the various exemplary embodiments of the disclosure described in the "exemplary methods" section of this specification, when the program product is run on a terminal device, e.g. any one or more of the steps of fig. 3 to 5 may be performed.
It should be noted that the computer readable medium shown in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium.

Claims (10)

1. A sleep detection method applied to a wearable device, the method comprising:
acquiring triaxial acceleration data acquired by an accelerometer within a first preset time period, and converting the triaxial acceleration data into combined acceleration data;
determining the total acceleration difference value of all adjacent sampling points in the first preset time period according to the total acceleration data, and summing the total acceleration difference value;
starting a first inactivity counter, and adding 1 to the value of the inactivity counter in response to the result of the summation process being less than a first preset value;
and determining whether the user is in a sleep state or not according to at least the value of the first inactivity counter in a second preset time period, wherein the second preset time period is longer than the first preset time period.
2. The sleep detection method as claimed in claim 1, characterized in that, determining whether the user is in a sleep state according to a sum of first preset durations for which the first flag is executed within the second preset duration, comprises:
and identifying the user state as a sleep state according to the value of the first inactivity counter being greater than a second preset value within the second preset duration.
3. The sleep detection method as claimed in claim 1, characterized in that, determining whether the user is in a sleep state according to the value of the first inactivity counter within a second preset time period, comprises:
responsive to determining that the value of the first inactivity counter is greater than a third preset value for the second preset time period;
and determining whether the user is in a sleep state according to the Z-axis change characteristic and the mean square error characteristic of the accelerometer, wherein the Z-axis of the accelerometer is an axis vertical to the surface of the display screen of the wearable device.
4. The sleep detection method as claimed in claim 3, wherein determining whether the user is in a sleep state according to the Z-axis variation characteristic and the mean square error characteristic of the accelerometer, comprises:
determining a Z-axis rotation angle of the accelerometer within a first preset time period;
determining the mean square error of triaxial acceleration data in a first preset duration;
starting a second inactivity counter;
in response to the Z-axis rotation angle being less than a fourth preset value and the mean square error being less than a fifth preset value, adding 1 to the value of the second inactivity counter;
and determining that the user is in a sleep state in response to the value of the second inactivity counter being greater than a sixth preset value for the second preset duration.
5. The sleep detection method as claimed in claim 4, wherein the calculation formula of the Z-axis rotation angle is:
wherein θ represents the Z-axis rotation angle, α t The included angle between the Z axis of the acceleration sensor at the moment t and the Z axis of the natural coordinate system is shown, alpha t+n The included angle between the Z axis of the acceleration sensor at the moment t+n and the Z axis of the natural coordinate system is represented, n represents the first preset time length, and Z is represented t Indicating the Z-axis value and x of the acceleration sensor at the moment t t The X-axis value and y of the acceleration sensor at the moment t are shown t And the Y-axis value of the acceleration sensor at the time t is shown.
6. The sleep detection method as claimed in claim 1, characterized in that, the method further comprises:
starting an activity counter in response to a user being in a sleep state, and adding 1 to the value of the activity counter according to the determined result of the summation processing being greater than a seventh preset value, wherein the seventh preset value is greater than the first preset value;
and determining whether the user is converted from the sleep state to the non-sleep state according to the value of the activity counter in a third preset time period, wherein the third preset time period is longer than the first preset time period.
7. The sleep detection method as claimed in claim 6, characterized in that, the method comprises: and determining the sleep stage of the user according to the value of the first inactivity counter in a fourth preset time period, wherein the sleep stage comprises a waking period, a light sleep period, a deep sleep period and a rapid eye movement period.
8. The sleep detection method as claimed in claim 1, characterized in that, the method further comprises:
and acquiring heart rate data of the user based on a heart rate sensor, and calibrating the sleeping time of the user according to the change condition of the heart rate data.
9. A wearable device comprising a processor, a memory, and an accelerometer, the accelerometer and the memory being connected to the processor by a bus, wherein,
the memory is used for storing program codes executed by the processor;
the processor being adapted to invoke the program code stored in the memory and to perform the method according to any of claims 1 to 8.
10. A readable storage medium having instructions stored thereon, which when executed on a wearable device, cause the wearable device to perform the method of any of claims 1 to 8.
CN202310770637.8A 2023-06-28 2023-06-28 Sleep detection method, wearable device and readable medium Pending CN117503051A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310770637.8A CN117503051A (en) 2023-06-28 2023-06-28 Sleep detection method, wearable device and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310770637.8A CN117503051A (en) 2023-06-28 2023-06-28 Sleep detection method, wearable device and readable medium

Publications (1)

Publication Number Publication Date
CN117503051A true CN117503051A (en) 2024-02-06

Family

ID=89748336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310770637.8A Pending CN117503051A (en) 2023-06-28 2023-06-28 Sleep detection method, wearable device and readable medium

Country Status (1)

Country Link
CN (1) CN117503051A (en)

Similar Documents

Publication Publication Date Title
US11557395B2 (en) Portable exercise-related data apparatus
US10001386B2 (en) Automatic track selection for calibration of pedometer devices
US8751194B2 (en) Power consumption management of display in portable device based on prediction of user input
CN107260178B (en) Portable monitoring device and method of operating the same
US8768648B2 (en) Selection of display power mode based on sensor data
US9641991B2 (en) Systems and methods for determining a user context by correlating acceleration data from multiple devices
US8781791B2 (en) Touchscreen with dynamically-defined areas having different scanning modes
US20170124837A1 (en) Communication method, apparatus, system and computer-readable medium for wearable device
KR20180047654A (en) Method for recognizing user activity and electronic device for the same
US9620000B2 (en) Wearable system and method for balancing recognition accuracy and power consumption
US11331003B2 (en) Context-aware respiration rate determination using an electronic device
US20170227375A1 (en) Calibration of a primary pedometer device using a secondary pedometer device
CN117037657A (en) Display control method, intelligent watch and readable medium
WO2022113838A1 (en) Program, method, and information processing device
US10725064B2 (en) Methods of motion processing and related electronic devices and motion modules
CN114532992B (en) Method, device and system for detecting nap state and computer readable storage medium
CN117503051A (en) Sleep detection method, wearable device and readable medium
CN117462081A (en) Sleep detection method, wearable device and readable medium
CN114912065A (en) Method and device for calculating movement distance, wearable device and medium
KR20110064237A (en) Watch
CN114209298A (en) PPG sensor control method and device and electronic equipment
CN117451074A (en) Step counting method, wearable device and readable storage medium
CN112911363A (en) Track video generation method, terminal device and computer-readable storage medium
CN116483304A (en) Display control method, wrist wearing equipment and readable medium
JPWO2016063661A1 (en) Information processing apparatus, information processing method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination