CN117796760A - Sleep quality prediction method, electronic equipment and system - Google Patents

Sleep quality prediction method, electronic equipment and system Download PDF

Info

Publication number
CN117796760A
CN117796760A CN202211178383.2A CN202211178383A CN117796760A CN 117796760 A CN117796760 A CN 117796760A CN 202211178383 A CN202211178383 A CN 202211178383A CN 117796760 A CN117796760 A CN 117796760A
Authority
CN
China
Prior art keywords
sleep
user
data
electronic device
feature
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
CN202211178383.2A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202211178383.2A priority Critical patent/CN117796760A/en
Publication of CN117796760A publication Critical patent/CN117796760A/en
Pending legal-status Critical Current

Links

Landscapes

  • Telephone Function (AREA)

Abstract

The application provides a sleep quality prediction method, electronic equipment and a system, wherein the method comprises the following steps: the electronic equipment responds to the user operation of starting sleep prediction to acquire user data; the user data includes at least one of physical energy data, and environmental data; the electronic equipment obtains a sleep-aiding suggestion of a user and first sleep quality based on user data, wherein the first sleep quality is the sleep quality when the user adopts the sleep-aiding suggestion; the electronic device displays at least one of a first sleep quality and a sleep improvement condition, the sleep improvement condition being derived based on the first sleep quality, and a sleep-aiding recommendation. By implementing the embodiment of the application, the sleep quality can be predicted based on the user data, the sleep requirement of the user is met, and the user experience is improved.

Description

Sleep quality prediction method, electronic equipment and system
Technical Field
The embodiment of the application relates to a terminal technology, in particular to a sleep quality prediction method, electronic equipment and a system.
Background
The demand of people in modern life for healthy life surpasses the past times, and the demand has stimulated the birth of wearing equipment and home monitoring equipment for measuring physiological characteristics such as heart rate, blood oxygen and the like by utilizing the Internet of things and artificial intelligence technology. More and more wearable devices enable real-time normalized physiological characteristic monitoring, which allows people to acquire knowledge of health status from individual fine to minute-level data changes. Taking the insomnia problem puzzling modern people as an example, the current sleep monitoring device has entered a stable commercial landing stage for the monitoring function of various stages in the sleep state of a human body.
How to meet the sleeping requirements of users and improve the user experience is a current and future research direction.
Disclosure of Invention
The application provides a sleep quality prediction method, electronic equipment and a system.
In a first aspect, an embodiment of the present application provides a sleep quality prediction method, applied to an electronic device, where the method includes:
the electronic equipment responds to the user operation of starting sleep prediction to acquire user data; the user data includes at least one of physical ability data, energy data, and environmental data of the user;
the electronic equipment obtains a sleep-aiding suggestion of a user and first sleep quality based on user data, wherein the first sleep quality is the sleep quality when the user adopts the sleep-aiding suggestion;
the electronic device displays at least one of a first sleep quality and a sleep improvement situation and a sleep-aiding suggestion, wherein the sleep improvement situation is the improvement situation of the sleep quality when the user adopts the sleep-aiding suggestion.
In the embodiment of the application, the electronic equipment can respond to the user operation to automatically acquire the user data without user input; furthermore, based on the user data, obtaining sleep-aiding suggestions of the user and sleep quality (namely first sleep quality) when the user adopts the sleep-aiding suggestions; finally, at least one of the first sleep quality and sleep improvement situation and a sleep-aiding suggestion are displayed, wherein the sleep improvement situation is the improvement situation of the sleep quality when the user adopts the sleep-aiding suggestion. According to the method, user input is not needed, at least one of the first sleep quality and the sleep improvement condition and the sleep-aiding advice can be automatically displayed, the display content is favorable for meeting the cognition of the user on the personal health state, the requirements of the user on the sleep-aiding advice and the sleep improvement condition reached by the sleep-aiding advice can be met, and the user experience is improved.
With reference to the first aspect, in one possible implementation manner, the physical energy data is related data representing physical energy consumption of the user, for example, the physical energy data may include at least one of heart rate, duration of exercise, number of steps, calories, and number of activity hours; the energy data is related data characterizing an energy situation of the user, for example, the energy data may include at least one of blood pressure, blood oxygen, pressure, caffeine intake, and alcohol intake; the environmental data is related data characterizing the environment in which the user is located, for example the environmental data may include at least one of ambient lighting and noise decibels.
With reference to the first aspect, in one possible implementation manner, the physical energy data is used for determining physical energy consumption factors, the energy data is used for determining energy consumption factors, and the environmental data is used for determining sleeping environment influence factors. For example, the user data includes data of a plurality of periods, the data of each period including at least one of physical energy data, and environmental data within the period; the physical power data of each period is used for determining the physical power consumption factor of the period, the energy data of each period is used for determining the energy consumption factor of the period, and the environmental data of each period is used for determining the sleeping environmental impact factor of the period.
With reference to the first aspect, in one possible implementation manner, the method further includes:
the electronic equipment obtains second sleep quality based on the user data, wherein the second sleep quality is the sleep quality when the user does not adopt the sleep-aiding suggestion;
the electronic device displays a second sleep quality.
In the embodiment of the application, the electronic equipment can respond to the user operation to automatically acquire the user data without user input; further, based on the user data, obtaining a second sleep quality, wherein the second sleep quality is the sleep quality when the user does not adopt the sleep-aiding suggestion; further, a second sleep quality is displayed. According to the method, user input is not needed, the second sleep quality can be automatically displayed, the display content is beneficial to meeting the cognition of the user on the personal health state, the requirement of the user on predicting the sleep quality when the user falls asleep at present can be met, and the user experience is improved.
With reference to the first aspect, in one possible implementation manner, the sleep quality includes at least one of a sleep duration and a deep sleep proportion within a preset duration, and the sleep improvement condition includes at least one of an improvement condition of the sleep duration and an improvement condition of the deep sleep proportion; the method further comprises the steps of:
the electronic equipment obtains at least one of the improvement condition of the sleep duration and the improvement condition of the depth proportion based on the first sleep quality and the second sleep quality; the second sleep quality is the sleep quality when the user does not adopt the sleep-aiding advice.
In one possible implementation, the sleep quality may include a sleep duration, a deep sleep proportion, within a preset duration. The sleep improvement condition may include at least one of an improvement of a sleep duration, an improvement of a depth ratio, an improvement of a shallow sleep ratio, and a rapid eye movement ratio.
In the embodiment of the application, the electronic device displays at least one of the improvement condition of the sleep time length, the improvement condition of the depth proportion, the improvement condition of the shallow sleep proportion and the rapid eye movement proportion, which is beneficial to the improvement effect brought by the intuitive cognitive sleep-aiding suggestion of the user and can improve the user experience.
With reference to the first aspect, in one possible implementation manner, the user data includes feature values of a plurality of features, and the electronic device obtains a sleep-aiding suggestion and a first sleep quality of the user based on the user data, including:
the electronic device determines a target feature from the plurality of features based on the feature values of the plurality of features;
the electronic equipment determines sleep-aiding suggestions aiming at target characteristics; the sleep-aiding proposal for the target feature is used for updating the feature value of the target feature.
In the embodiment of the application, the electronic device may determine the target feature based on the feature values of the plurality of features; the sleep-aiding advice is derived for the target feature. The method can provide the sleep-aiding suggestion in a targeted manner according to the characteristics required to be adjusted by the user, and can improve the effective degree of the sleep-aiding suggestion.
With reference to the first aspect, in one possible implementation manner, the determining, by the electronic device, a target feature from a plurality of features based on feature values of the plurality of features includes:
the electronic equipment compares the characteristic value of each characteristic with a preset value corresponding to each characteristic to obtain the deviation degree of each characteristic;
the electronic device determines the first N features with large deviation degrees as target features, wherein N is a positive integer.
In the embodiment of the application, the electronic device may determine the target feature based on a deviation degree of a feature value of each feature in the plurality of features and a preset value corresponding to each feature. The method can determine the characteristic with larger influence on the sleeping of the user, so that the sleeping-aiding suggestion is provided in a targeted manner.
With reference to the first aspect, in one possible implementation manner, the user data includes feature data of an mth period and feature data of other periods; m is a positive integer, and the electronic device obtains a sleep-aiding suggestion and a first sleep quality of a user based on user data, including:
the electronic equipment updates the feature data of the target feature in the feature data of the Mth period based on the sleep-aiding suggestion aiming at the target feature to obtain the updated feature data of the Mth period;
The electronic equipment obtains the sleep influence factor of the updated Mth period based on the updated characteristic data of the Mth period;
the electronic equipment takes the updated sleep influence factors of the M-th period and the sleep influence factors of other periods as input, and obtains a first sleep quality through a target model;
the sleep influence factors of other periods are obtained based on the characteristic data of other periods; the target model is obtained by taking a sample sleep influence factor as input and taking sleep quality corresponding to the sample sleep influence factor as a label for training.
In the embodiment of the application, the electronic device can predict the sleep quality after adopting the sleep-aiding suggestion based on the updated characteristic data. In the method, the sleep-aiding advice aiming at the target characteristics is adopted, and the sleep quality of the user can be effectively improved, so that the sleep quality after being greatly improved can be obtained; the method can enable the user to intuitively see the improving effect aiming at the sleep-aiding suggestion, and improve the user experience.
With reference to the first aspect, in one possible implementation manner, the user data includes feature data of an mth period and feature data of other periods, where the mth period is a current period, that is, a period in which the electronic device is in response to a user operation that starts sleep prediction; the other time periods are a plurality of time periods from the time when the user gets up to the current time period.
With reference to the first aspect, in one possible implementation manner, the user data includes feature data of a plurality of periods, and the electronic device obtains the second sleep quality based on the user data, including:
the electronic equipment obtains sleep influence factors of each time period based on the characteristic data of each time period in the time periods;
the electronic equipment obtains second sleep quality based on the sleep influence factors and the target model of each period;
the target model is obtained by taking a sample sleep influence factor as input and taking sleep quality corresponding to the sample sleep influence factor as a label for training.
In the embodiment of the application, the user data includes characteristic data of a plurality of time periods; the electronic equipment obtains sleep influence factors of each time period based on the characteristic data of each time period in the time periods; the second sleep quality may be derived based on the sleep impact factors and the target model for each time period. The method considers the activity correlation among the time periods, and can improve the accuracy of predicting the second sleep quality.
With reference to the first aspect, in one possible implementation manner, the sleep influencing factors within the preset time period include at least one of physical exertion factors, energy consumption factors and sleeping environment influencing factors;
The physical exertion factor is determined based on at least one of heart rate, length of exercise, number of steps, calories, and number of hours of activity over a preset period of time; the energy expenditure factor is determined based on at least one of blood pressure, blood oxygen, pressure, caffeine intake, and alcohol intake over a preset period of time; the falling asleep environment influence factor is determined based on at least one of ambient light and noise decibels over a preset period of time. In the embodiment of the application, the information quantity of the user data is large, and the prediction accuracy can be effectively improved.
With reference to the first aspect, in one possible implementation manner, the method further includes:
the electronic equipment acquires a pre-training model, wherein the pre-training model is obtained based on historical user data of a group in which a user is located;
the electronic device trains the pre-training model based on historical user data of the user to obtain a target model.
In the embodiment of the application, the target model is trained based on historical user data of a group where a user is located; and training based on historical user data of the user. In the method, firstly, training is performed based on historical user data of a group where a user is located, so that a prediction result is not deviated from the group; and training is carried out by taking group data as a reference through personal data, so that the target model is more personalized, and the accuracy of the output of the target model can be improved.
In one possible implementation, the pre-training model is server-trained, and the target model is trained by the electronic device based on the pre-training model. The method can effectively control the calculated amount of the server and the electronic equipment, and avoid the situation that the calculated amount is too large to influence the speed when the training is completely executed by the server or the electronic equipment; training a pre-training model on the electronic equipment based on historical user data of the user, and protecting privacy safety of the user; training the pre-training model at the server can provide the pre-training model to other users in the community, and can avoid repeated computation and waste of computing resources. The method can reduce the overall calculation amount, improve the calculation speed and protect the privacy of the user.
With reference to the first aspect, in one possible implementation manner, the electronic device, in response to a user operation to start sleep prediction, obtains user data, including:
the electronic equipment responds to the user operation for starting sleep prediction and sends an acquisition request to a server;
the electronic device receives user data sent by the server, wherein the user data comprises data acquired by the server from equipment worn by a user.
In the embodiment of the application, the server may acquire user data from at least one device worn by the user, where the at least one device may include a sports watch, smart glasses, and the like; and then the user data is sent to the electronic equipment. In the method, the electronic equipment can acquire the user data in other equipment of the user, the data size of the user data is large, and the prediction accuracy can be improved; user input is not needed, and user experience can be improved.
In a second aspect, embodiments of the present application provide an electronic device including one or more functional modules, where the one or more functional modules are configured to perform a sleep quality prediction method in any one of the above aspects or any one of the possible implementations thereof.
In a third aspect, the present application provides a computer storage medium comprising computer instructions which, when run on an electronic device, cause a communication apparatus to perform the sleep quality prediction method of any one of the above aspects or any one of the possible implementations of any one of the above aspects.
In a fourth aspect, the present application provides a computer program product which, when run on a computer, causes the computer to perform the sleep quality prediction method in any one of the above aspects or any one of the possible implementations thereof.
In a fifth aspect, the present application provides a chip comprising: a processor and an interface, the processor and the interface cooperating with each other, so that the chip performs the sleep quality prediction method in any one of the above aspects or any one of the possible implementation manners of any one of the above aspects.
It will be appreciated that the electronic device provided in the second aspect, the computer readable storage medium provided in the third aspect, the computer program product provided in the fourth aspect, and the chip provided in the fifth aspect are all configured to perform the method provided by the embodiments of the present application. Therefore, the advantages achieved by the method can be referred to as the advantages of the corresponding method, and will not be described herein.
Drawings
FIG. 1 is a block diagram of a prediction system provided in an embodiment of the present application;
fig. 2 is a schematic hardware structure of an electronic device 100 according to an embodiment of the present application;
fig. 3 is a software architecture block diagram of the electronic device 100 provided in the embodiment of the present application;
FIG. 4 is a schematic overall flow chart of a sleep quality prediction method provided in the present application;
FIG. 5 is a flow chart of a sleep quality prediction method provided by the present application;
FIG. 6 is a schematic diagram of a sleep impact factor for constructing a period of time provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a training process provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of a predictive process provided by an embodiment of the present application;
FIG. 9A is a schematic diagram of determining target features provided by an embodiment of the present application;
FIG. 9B is a schematic diagram of another determination of a target feature provided by an embodiment of the present application;
FIG. 10 is a schematic diagram of a feature and a course corresponding to the feature provided in an embodiment of the present application;
FIG. 11 is a schematic diagram of the current day characteristic data of a target user according to an embodiment of the present application;
FIG. 12A is a schematic diagram of updated current day characteristic data provided by an embodiment of the present application;
FIG. 12B is a schematic diagram of another updated current day characteristic data provided by an embodiment of the present application;
FIG. 13 is a schematic diagram of determining sleep quality after adoption advice provided by an embodiment of the present application;
FIG. 14 is a schematic diagram of updating sleep impact factors provided by embodiments of the present application;
fig. 15A-15D are user interfaces implemented on an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and thoroughly described below with reference to the accompanying drawings. Wherein, in the description of the embodiments of the present application, "/" means or is meant unless otherwise indicated, for example, a/B may represent a or B; the text "and/or" is merely an association relation describing the associated object, and indicates that three relations may exist, for example, a and/or B may indicate: the three cases where a exists alone, a and B exist together, and B exists alone, and in addition, in the description of the embodiments of the present application, "plural" means two or more than two.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying 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, and in the description of embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
The term "User Interface (UI)" in the following embodiments of the present application is a media interface for interaction and information exchange between an application program or an operating system and a user, which enables conversion between an internal form of information and an acceptable form of the user. The user interface is a source code written in a specific computer language such as java, extensible markup language (extensible markup language, XML) and the like, and the interface source code is analyzed and rendered on the electronic equipment to finally be presented as content which can be identified by a user. A commonly used presentation form of the user interface is a graphical user interface (graphic user interface, GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It may be a visual interface element of text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc., displayed in a display of the electronic device.
In order to more clearly and specifically describe the sleep quality prediction method provided by the embodiment of the present application, the prediction system provided by the embodiment of the present application is first described below.
Referring to fig. 1, fig. 1 is a frame diagram of a prediction system according to an embodiment of the present application.
As shown in fig. 1, the prediction system may include a server 10 and a terminal device 20. The server 10 may be a server deployed in the cloud; the terminal device 20 may be an electronic device such as a cell phone, a wristwatch, etc. (fig. 1 exemplarily shows that the terminal device 20 is a cell phone).
In some embodiments, terminal device 20 may send an acquisition request to server 10, the acquisition request including an identification of the target user; the server 10 may transmit sleep impact data and a pre-training model of the target user to the terminal device 20 in response to the acquisition request; terminal device 20 may predict the current sleep quality of the target user based on the pre-training model and the sleep impact data of the target user, and may also determine a sleep aid recommendation for the target user and a sleep quality after the sleep aid recommendation is adopted. The specific implementation of the terminal device 20 predicting the current sleep quality of the target user, or determining the sleep-aiding advice for the target user and the sleep quality after the sleep-aiding advice is adopted may be referred to the relevant description below, and is not developed herein. The current sleep quality is the sleep quality of the user predicted at the current moment when the sleep-aiding advice is not adopted.
The server 100 in the embodiment of the present application may be implemented by a stand-alone server or a server cluster formed by a plurality of servers.
Terminal device 20 may include, but is not limited to, a cell phone, a wearable device (e.g., a wristwatch, etc.), a tablet, a display, a television, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra mobile personal computer, a netbook, an augmented reality device, a virtual reality device, an artificial intelligence device, a vehicle-mounted device, a smart home device, etc.
In one implementation, terminal device 20 may include a plurality of electronic devices; the plurality of electronic devices may be electronic devices used by different users, and the plurality of electronic devices may respectively transmit user data of their users to the server 10, wherein the user data may include sleep influence data, personal information, and the like. Further, the server 10 may store user data of users transmitted from different electronic devices. For example, the user wears a wristwatch, which is the terminal device 20, on a daily basis; after obtaining the user's consent, the wristwatch may send the user's personal information, exercise condition, sleep quality, etc. to the server 10; the server 10 may store the user data.
It is understood that the prediction system architecture in fig. 1 is only one exemplary implementation in the embodiments of the present application, and the prediction system architecture in the embodiments of the present application includes, but is not limited to, the above prediction system architecture.
The terminal device 20 in fig. 1 is described below by way of example with respect to the electronic device 100.
Fig. 2 shows a schematic hardware configuration of the electronic device 100.
The embodiment will be specifically described below taking the electronic device 100 as an example. It should be understood that electronic device 100 may have more or fewer components than shown, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (universal serial bus, USB) interface 130, charge management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headset interface 170D, sensor module 180, keys 190, motor 191, indicator 192, camera 193, display 194, and subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The SIM card interface may be used to communicate with the SIM card interface 195 to perform functions of transferring data to or reading data from the SIM card.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and does not limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (flex), a mini, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an operating system, an application required for at least one function (such as a face recognition function, a fingerprint recognition function, a mobile payment function, etc.), and the like. The storage data area may store data created during use of the electronic device 100 (e.g., face information template data, fingerprint information templates, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, the electronic device 100 may range using the distance sensor 180F to achieve quick focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it may be determined that there is an object in the vicinity of the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there is no object in the vicinity of the electronic device 100. The electronic device 100 can detect that the user holds the electronic device 100 close to the ear by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs a reduction in the performance of a processor located in the vicinity of temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid the low temperature causing the electronic device 100 to be abnormally shut down. In other embodiments, when the temperature is below a further threshold, the electronic device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, may be used to synthesize a request, missed an incoming call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication.
In the embodiment of the present application, the electronic device 100 may execute the sleep quality prediction method through the processor 110.
Fig. 3 is a software architecture block diagram of the electronic device 100 provided in the embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 3, the application package may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, sports health, etc.
In some embodiments, the user may be communicatively coupled to other devices (e.g., server 10, above) via the athletic health of electronic device 100, such as by sending an acquisition request to the other devices or by acquiring sleep impact data sent by the other devices.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in fig. 3, the application framework layer may include a display (display) manager, a sensor (sensor) manager, a cross-device connection manager, an event manager, a task (activity) manager, a window manager, a content provider, a view system, a resource manager, a notification manager, and the like.
The display manager is used for the display management of the system and is responsible for the management of all display related transactions, including creation, destruction, direction switching, size and state change and the like. Typically, there will be only one default display module on a single device, the main display module.
The sensor manager is responsible for the state management of the sensor, manages the application to monitor the sensor event, and reports the event to the application in real time.
The cross-device connection manager is used to establish communication connections with other devices.
The event manager is used for event management service of the system, and is responsible for receiving events uploaded by the bottom layer and distributing the events to each window to complete the works of receiving and distributing the events and the like.
The task manager is used for the management of task (Activity) components, including startup management, lifecycle management, task direction management, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like. The window manager is also responsible for window display management, including management related to window display mode, display size, display coordinate position, display hierarchy, and the like.
The specific implementation of the above embodiments may be found in the following description of the man-machine interaction method.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library (which may also be referred to as a data management layer) may include a plurality of functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (e.g., openGL ES), 2D graphics engine (e.g., SGL), event data, and the like.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio video encoding formats, such as: MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
Next, the overall flow of the sleep quality prediction method is first exemplarily introduced based on the software framework of the prediction system.
Referring to fig. 4, fig. 4 is an overall flow chart of a sleep quality prediction method provided in the present application. The server in fig. 4 may be the server 10 in the predictive system shown in fig. 1; the electronic device in fig. 4 may be the terminal device 20 in the predictive system shown in fig. 1.
Wherein the target user is a user of the electronic device, the server includes a personal database of the target user and personal databases of other users, and the training parameter database in fig. 4 is a personal database of the other users.
As shown in fig. 4, the software framework may include a data access layer, an algorithm logic layer, and a presentation layer. The data access layer may include a training parameter database, a personal database of the target user, and a data acquisition module, where the training parameter database and the personal database of the target user are located in the server, and the data acquisition module is located in the electronic device; the algorithm logic layer and the presentation layer are both located in the electronic device.
The data acquisition module is used for acquiring user data of the target user from the personal database of the target user. The user data may include personal information of the user and sleep influence data of the user, wherein the personal information includes age, sex, regional sunlight duration data, and the like; the sleep influence data may include historical sleep data and current day feature data, wherein the historical sleep data may include feature data and sleep quality of a current day several days before the current day, the current day feature data is feature data of a current day target user for acquiring user data, the feature data may include data of one or more features, and the features may be heart rate, exercise duration and the like; the sleep quality may include sleep duration, deep sleep ratio, shallow sleep ratio, rapid eye movement ratio, etc.
The data acquisition module is also used for acquiring historical sleep data of the group to which the target user belongs from the training parameter database based on personal information of the target user. The information difference between the personal information of the user in the group to which the target user belongs and the personal information of the target user is within a preset range; the group to which the target user belongs may also be referred to as a target group.
The feature preprocessing module is used for obtaining training data based on the historical sleep data of the target user and the historical sleep data of the target group, wherein the training data can comprise group training data and individual training data of the target user.
The feature preprocessing module is also used for obtaining the sleeping influence factor of the target user on the same day based on the current day feature data of the target user.
The model training module is used for training an initial sleep quality prediction model based on training data to obtain a target model.
The sleep quality prediction module is used for obtaining a current prediction result based on the target model and the current sleep influence factor of the target user. The prediction result can comprise sleeping time length, deep sleep proportion, shallow sleep proportion and rapid eye movement proportion.
The display layer is used for displaying the current prediction result.
The improved service recommendation module is used for determining sleep-aiding suggestions based on weights in model parameters of the target model and the current day characteristic data of the target user; and updating the current day characteristic data of the target user based on the sleep-aiding advice.
And the sleep quality prediction module obtains a prediction result after the sleep-aiding suggestion is adopted based on the updated current day characteristic data and the target model. The display layer is used for displaying the sleep-aiding advice and the prediction result after the sleep-aiding advice is adopted.
The following describes in detail the sleep quality prediction method provided in the embodiment of the present application, taking an electronic device as an example of a mobile phone.
Referring to fig. 5, fig. 5 is a flow chart of a sleep quality prediction method provided in the present application.
S501, the electronic equipment responds to the user operation for predicting sleep quality and sends an acquisition request to a server, wherein the acquisition request comprises a user identification of a target user.
In some embodiments, the electronic device installs an application for sports health, which may include controls for predicting sleep quality; the electronic device may display the application interface, and upon detecting a user operation of the user with respect to the control, the electronic device may send an acquisition request to the server in response to the user operation. The obtaining request may include a user identifier of the target user, where the user identifier may be an account of the target user logging in sports health or be an account, etc.
For example, the electronic device may display a user interface as shown in fig. 15B; the electronic device sends an acquisition request to the server upon detecting a user operation of the user with respect to the sleep quality prediction control 620.
S502, the server responds to the acquisition request and acquires personal information of the target user and sleep influence data of the target user based on the user identification.
In one implementation, the server includes a personal database of the target user. Then, the server may obtain personal information of the target user and sleep impact data of the target user from a personal database of the target user based on the user identification.
The personal information can comprise the current month sunshine duration, the gender and the age of the city where the user is located; the sleep impact data includes historical sleep data and current day characteristic data, wherein the historical sleep data may include past daily characteristic data and sleep quality.
S503, the server determines a target group to which the target user belongs based on personal information of the user.
Wherein the target group may include at least two users; the personal information of the users in the target group accords with the preset requirement, for example, the gender of the users in the target group is preset gender, the age is in a preset age layer, and the sunshine duration of the region where the users are located is preset duration.
In some embodiments, the server may divide different groups based on the current month sunlight duration, gender, and age of the city in which the user is located, where the gender of the same group is the same; the daily time duration of the current month of the city where the users in the same group are located is of the same grade, for example, the server can count the daily time duration of the current month of different cities, and the current month is divided from the minimum value to the maximum value according to the same grade every ten hours; the users in the same group are of the same age group, e.g., the age group is differentiated every ten years, and the last zero age is the beginning of the age group.
It should be noted that there may be other methods for dividing the population, and the method for dividing the population is not limited herein.
S504, the server acquires historical sleep data of the target group.
In some embodiments, after determining the target group to which the target user belongs, the server may obtain historical sleep data for each user in the target group in the store. For example, the server includes a training parameter database, and the training parameter database includes historical sleep data of the target group, so that the server may obtain the historical sleep data of the target group from the training parameter database.
Wherein, the historical sleep data can comprise characteristic data and sleep quality of past days, namely, the historical sleep data of the target group comprises characteristic data and sleep quality of each user in the target group of past days. Wherein, the characteristic data can comprise data of one or more characteristics, and the characteristics can be heart rate, exercise duration and the like; the sleep quality may include sleep duration, deep sleep ratio, shallow sleep ratio, rapid eye movement ratio, etc.
For example, if the target group includes N users, the historical sleep data of the target group includes the historical sleep data of each of the N users, and the historical sleep data of one user is the daily feature data and the daily sleep quality of the user in the past M days, and M is a positive integer. For example, where M is 30 and user a is a user in the target group, the historical sleep data for user a may include characteristic data of user a daily for approximately 30 days before the day and daily sleep quality, e.g., day 2022, 9, 5, then the electronic device may obtain characteristic data of user a daily for 2022, 8, 6, to 2022, 9, 4, and daily sleep quality.
S505: the server trains the initial sleep quality prediction model based on the historical sleep data of the target group to obtain a pre-training model.
Wherein the historical sleep data of the target group comprises historical sleep data of each user in the target group for each day in the past; the model parameters of the initial sleep quality prediction model comprise initial weights corresponding to each feature, and the weights corresponding to each feature in the model parameters are continuously updated in the training process. The initial sleep quality prediction model may be a cyclic neural network, a Long short-term memory neural network (LSTM), or other neural networks, which is not limited herein.
In some embodiments, the server may use the historical sleep data of each user in the target group for one past day as one piece of historical sleep data, for example, the historical sleep data of the target group includes characteristic data of each user in the N users for M days and the daily sleep quality, that is, there are N×M pieces of historical sleep data; furthermore, the server can construct a sleep influence factor for each piece of history sleep data based on the feature data in the piece of history sleep data and the feature weight in the model parameters of the model after the last training; and finally, training the last trained model by taking the sleep influence factors and the sleep quality in the historical sleep data as group training data, wherein the sleep influence factors are input data, and the sleep quality is an output target. It should be noted that, the last trained model is a model trained by the previous piece of historical sleep data of the piece of historical sleep data; the feature weight adopted when the initial sleep quality prediction model is trained for the first time is the initial weight of the model parameter in the initial sleep quality prediction model.
For example, the server may generate a sleep impact factor corresponding to the first historical sleep data based on the feature data in the first historical sleep data and the initial weight corresponding to each feature, and use the sleep impact factor and the sleep quality in the historical sleep data as the first training data; training the initial sleep quality prediction model by using the first training data to obtain a model after the first training; then, based on the weight corresponding to each feature in the model parameters of the model after the first training and the feature data in the second piece of historical sleep data, generating a sleep influence factor corresponding to the second piece of historical sleep data, and taking the sleep influence factor and the sleep quality in the historical sleep data as the second piece of training data; training the initial sleep quality prediction model by using the second training data to obtain a model after the second training, and so on until the training is finished when the preset condition is met to obtain a pre-training model.
The preset condition may be that the loss is minimum, or that the iteration number reaches the preset number, or other preset conditions, which is not limited in the embodiment of the present application.
Wherein, the sleep influence factors in one piece of training data can comprise the sleep influence factors of each period of the day; the sleep influencing factors may include one or more factors, which may be physical exertion factors (Strength Consume Factor, SCF), energy expenditure factors (Energy Consume Factor, ECF), sleep-on environment influencing factors (Sleep Environment Impact Factor, SIEF), etc. Each period of a day may be divided based on a period of time taking the sleeping end time of the day of the user as a starting point and taking the sleeping end time of the day as an ending point, for example, the sleeping end time of a certain day of the user is nine am, and the sleeping end time of the day is ten pm, then the electronic device may divide nine am to ten pm into a plurality of periods of time, where the duration of the periods of time is not limited, and may be, for example, one hour.
One possible implementation method for generating the sleep influence factor is described below by taking the characteristic data of the user a in the period t as an example.
Referring to fig. 6, fig. 6 is a schematic diagram of a sleep influence factor for constructing a period according to an embodiment of the present application. Fig. 6 shows schematically 12 features of user a in period t, feature 1 being heart rate, feature 2 being exercise duration, feature 3 being number of steps, feature 4 being calories, feature 5 being number of activity hours, feature 6 being blood pressure, feature 7 being blood oxygen, feature 8 being pressure, feature 9 being caffeine intake, feature 10 being alcohol intake, feature 11 being ambient light, feature 12 being noise decibel. The feature data of the user a in the period t may be composed of feature values of 12 features, as shown in fig. 6, where the feature values of each feature are sequentially x 1 、x 2 、x 3 、x 4 、x 5 、x 6 、x 7 、x 8 、x 9 、x 10 、x 11 And x 12 . Each feature has corresponding weight in the sleep quality prediction model which is respectively w in turn 1 、w 2 、w 3 、w 4 、w 5 、w 6 、w 7 、w 8 、w 9 、w 10 、w 11 And w 12
As shown in fig. 6, the electronic device may multiply the data of the feature corresponding to the physical exertion factor and the weight of the feature, and then sum the multiplied data and the weight of the feature to obtain the physical exertion factorThe electronic device can multiply the data of the feature corresponding to the energy consumption factor and the weight of the feature, and then sum the multiplied data and the weight of the feature to obtain the energy consumption factorThe electronic equipment can multiply the data of the characteristics corresponding to the sleeping environment influence factors and the weight of the characteristics correspondingly and then sum the multiplied data, so that the sleeping environment influence factors can be obtained>Then the electronic device can finally obtain the sleep influence factor y of the user A in the period t t =[SCFt、ECFt、SIEFt]。
In one implementation, if the period t is a period after sunset, the sleep influence factor of the user a in the period t may be y t Namely physical exertion factors, energy consumption factors and sleeping environment influence factors; if the period t is a period after sunset, the sleep impact factor of the user a at the period t may include only the physical exertion factor and the energy consumption factor.
The training process is described below by taking one piece of training data of the user a as an example. Assuming that the training data is training data corresponding to the ith day of the user A, the training data comprises sleep influence factors of each of t time periods of the ith day and sleep quality O of the ith day t ' wherein, day i is one of M days, i is a positive integer; t is tThe period includes a j-th period, j being a positive integer, and t being a positive integer. Note that, the hidden vector m j For the output of the hidden layer of the object model of the jth period, the hidden vector m j Influence of characteristic data representing jth period on ith sleep of user A
Referring to fig. 7, fig. 7 is a schematic diagram of a training process according to an embodiment of the present application.
As shown in fig. 7, the electronic device may wake user a on the first period of sleep influence factor y after the ith day 1 Inputting a sleep quality prediction model LSTM trained by the last training data, and obtaining an output result of the sleep quality o 1 Also, a hidden vector m can be obtained 1 Hidden vector m 1 For the output of the hidden layer of the target model of the first period, the hidden vector m 1 The effect of the characteristic data representing period 1 on user a's day i sleep; furthermore, the electronic device inputs o1 and m1 into LSTM, and the obtained output result is sleep quality o 2 Also, a hidden vector m can be obtained 2 The method comprises the steps of carrying out a first treatment on the surface of the And so on, until the last period (i.e., the t-th period), m will be t-1 Inputting LSTM to obtain sleep quality o t . The sleeping influence factors before sunset can be composed of physical exertion factors and energy consumption factors, and the sleeping influence factors after sunset can be composed of physical exertion factors, energy consumption factors and sleeping environment influence factors.
Further, the electronic device may be based on the sleep quality o t And sleep quality on day i o t The loss is obtained, and the weight corresponding to each feature in the LSTM is adjusted based on the loss. The loss may be obtained based on a cross entropy function of the loss function, or may be obtained based on other loss functions, which is not limited herein.
It should be noted that, the electronic device may determine the model with the smallest loss as the target model; the electronic device can also obtain the target model after performing multiple rounds of iterative training, and the iteration times are not limited in the embodiment of the application.
And S506, the server sends the pre-training model and sleep influence data of the target user to the electronic equipment, wherein the sleep influence data of the target user comprise historical sleep data and current day characteristic data of the target user.
Wherein, the historical sleep data of the target user may include characteristic data of each day and sleep quality of each day of the target user over the past m days. Wherein m is a positive integer. The n and the m may be equal or unequal.
The current day characteristic data of the target user are characteristic data of the target user on the current day when the electronic equipment starts to predict sleep quality. For example, in step S501, the electronic device responds to the user operation for predicting sleep quality as 21 points on the same day, and the current day feature data of the target user is feature data of the target user from the current day stop to 21 points.
The current day may refer to a period of time when the target user wakes up to a time when the electronic device starts prediction of sleep quality. Assuming that the time period is divided into a plurality of time periods, the current day feature data of the target user may include feature data of a plurality of time periods, wherein the feature data of one time period may include feature values of a plurality of features.
S507, the electronic equipment trains the pre-training model based on the historical sleep data of the target user to obtain a target model.
In some embodiments, the server may take the historical sleep data of the target user for one day in the past as one piece of historical sleep data, for example, the historical sleep data of the target user includes characteristic data of each day and sleep quality of each day in the past M days, that is, M pieces of historical sleep data; further, for each piece of historical sleep data, a sleep influence factor is built based on the characteristic data in the historical sleep data and the characteristic weight in the model parameters of the pre-training model after the last training; and finally, training the last trained model by taking the sleep influence factors and the sleep quality in the historical sleep data as individual training data, wherein the sleep influence factors are input data, and the sleep quality is an output target. It should be noted that, the pre-training model after the last training is a model after training the previous piece of historical sleep data of the piece of historical sleep data; the feature weights used when the pre-training model is first trained are initial weights in model parameters of the pre-training model.
For specific implementation of the sleep influence factor and the training process, reference may be made to the related content in step S505, which is not described herein.
And S508, the electronic equipment determines sleep influence factors of each period of the current day of the target user based on the current day characteristic data of the target user and the characteristic weight of the target model.
In some embodiments, the electronic device may divide the plurality of time periods with the end of the current sleep time of the target user as a start point and with the start of the prediction (e.g. when the electronic device detects the user operation for predicting the sleep quality in step S101) as an end point; further, a sleep influence factor for each time period of the day of the user is constructed based on the feature data of each time period in the current day feature data of the target user and the weight of each feature in the model parameters of the target model. Wherein the characteristic data may include data of a plurality of characteristics, such as heart rate, duration of exercise, etc.; the sleep influencing factors may include at least one of physical exertion factors, energy expenditure factors, and sleep-on environment influencing factors.
In one implementation, all the time periods of the day may be divided into a time period before sunset and a time period after sunset; the electronic device can calculate SCF per hour before sunset starting from the wake-up time of the day t 、ECF t ]As a sleep affecting factor for each period before sunset; calculate the sunset per hour [ SCF ] t 、ECF t 、SIEF t ]As a sleep affecting factor for each period after sunset.
It should be noted that, the process of calculating the sleep influence factor of each period of the target day by the electronic device may refer to the calculation process corresponding to fig. 6 above, that is, the weight in fig. 6 is the weight of the target model, and the feature data of the user a is the day data of the target user, so that the sleep influence factor corresponding to the target user may be obtained, which is not described herein.
S509, the electronic equipment obtains the current sleep quality based on the sleep influence factors and the target model of each time period of the current day of the target user.
The current sleep quality is the predicted sleep quality of the current period; the current period is a period in which the electronic device detects a user operation predicting sleep quality. For example, the current period may be a period in which the electronic device responds to the user operation for the predicted sleep quality control in step S501.
In some embodiments, the electronic device inputs the sleep influence factors of each period of the current day of the target user into the target model according to the time sequence from morning to evening, the data input into the target model in other periods except the first period further comprises a hidden vector obtained after the sleep influence factors of the last period are input into the target model, and the last period is the current period; the current sleep quality can be obtained after the sleep influence factor of the current period and the hidden vector obtained in the period previous to the current period are input. The duration of each period is not limited herein, and the duration of each period may be equal or different.
Referring to fig. 8, fig. 8 is a schematic diagram of a prediction process according to an embodiment of the present application. As shown in fig. 8, assuming that the current period is the kth period, the period after the target user wakes up the day to the current period is sequentially the first period, the second period, and up to the kth period in time sequence, the sleep influencing factor before sunset is composed of the sleep influencing factors after sunset; the electronic device wakes up the target user for the sleep influence factor Y of the first period of time after the current day 1 Inputting the target model to obtain sleep quality O 1 Hidden vector M 1 The method comprises the steps of carrying out a first treatment on the surface of the Furthermore, the electronic device wakes up the sleep influence factor Y of the second period after the current day 2 Hidden vector M 1 Inputting the target model to obtain sleep quality O 2 Hidden vector M 2 The method comprises the steps of carrying out a first treatment on the surface of the Furthermore, the sleep influence factor Y of the second period after the electronic device wakes up the day 3 Hidden vector M 2 Input the target model to obtain sleep quality O 3 Hidden vector M 3 The method comprises the steps of carrying out a first treatment on the surface of the Sleep influencing factor Y up to the current period k Hidden vector M k-1 Inputting a target modelObtaining sleep quality O k Sleep quality O k I.e. the predicted current sleep quality of the target user.
And S510, the electronic equipment obtains sleep-aiding suggestions based on the current day characteristic data of the target user and the target model.
In some embodiments, the model parameters of the target model include weights for at least one feature; the electronic device may determine a target feature based on the current day feature data of the user and the weight of the at least one feature; further, the advice for the target feature is determined as a sleep aiding advice.
In one implementation, the electronic device may determine a feature with the greatest weight and the smallest value of the current day feature as the target feature. The characteristic value of the current day can be accumulated for the characteristic value of each period of the current day; or may be an average of the characteristic values for each period of the day. It should be noted that each period of the day may refer to each period in which the user wakes up to the current period.
Referring to fig. 9A, fig. 9A is a schematic diagram of determining a target feature according to an embodiment of the present application. As shown in fig. 9A, 12 features are exemplified; the weights of the 12 features in the model parameters of the target model are respectively w in turn 1 、w 2 Up to w 12 These 12 weights; the sum of the data of the current day of each feature of the target user is X 1 、X 2 Up to X 12 The sum of the 12 data, i.e. the sum of the heart rate of the target user on the day is X 1 The sum of the movement time of the target user on the same day is X 2
In another implementation, the electronic device may determine a degree of deviation for each feature based on the preset feature value and the current day feature value of the target user; the first several features with larger deviation degree are taken as target features. When the degree of deviation is the same, the electronic device may take preference of the more weighted features. The deviation degree can be obtained through normalization processing based on a preset characteristic value and a deviation value of the current characteristic value of the target user.
Referring to fig. 9B, fig. 9B is a schematic diagram illustrating another determining target feature according to an embodiment of the present application. As shown in fig. 9B, the electronic device may acquire the best feature data when the model trained by the group training data outputs the best sleep quality, the best feature data including the sum of feature values of each feature; comparing the current characteristic value of each characteristic of the target user with the sum of the characteristic values of each characteristic in the optimal characteristic data to obtain a deviation value of each characteristic; further, normalizing the deviation value of each feature to obtain a deviation ratio of each feature, wherein the deviation ratio is used for representing the deviation degree of the feature value of the feature and the feature value in the optimal feature data; finally, the first several features with larger deviation ratio are used as target features.
As shown in fig. 9A, i is an integer from 1 to 12; let w be 1 To w 12 The weight with the largest median value is w i ;X 1 To X 12 Data sum of minimum characteristic value of the same day is determined as X i The method comprises the steps of carrying out a first treatment on the surface of the The feature i is the target feature and the course corresponding to the feature i is the suggestion for the feature i.
It should be noted that, in the embodiments of the present application, course content corresponding to the target feature is not limited. The following exemplary description of the lessons corresponds to the partial features.
Referring to fig. 10, fig. 10 is a schematic diagram of a feature and a course corresponding to the feature according to an embodiment of the present application. As shown in fig. 10, the course corresponding to calories (feature 4) may be exercise course 1; the lessons corresponding to the pressure (characteristic 8) and the noise decibels (characteristic 12) can be sleep comfort music; the lessons corresponding to the pressure (feature 8) can be respiratory training and meditation; the corresponding session of heart rate (feature 1) may be workout 2. The course corresponding to the feature can have a parameter corresponding to the course, and the parameter is used for updating the data of the feature; for example, workout 1 may consume x' calories.
And S511, the electronic equipment updates the current day characteristic data of the target user based on the sleep-aiding advice to obtain updated current day characteristic data.
Wherein the current day characteristic data of the target user comprises at least one target characteristic; the updated current day characteristic data includes updated data for at least one target characteristic.
In some embodiments, the sleep-aiding advice is advice corresponding to the target feature; the electronic equipment can update the data of the target feature based on the suggestion corresponding to the target feature to obtain the updated data of the target feature; the updated current day feature data includes updated target feature data and non-updated feature data.
Two methods of updating the current day characteristic data are described below by taking the current day characteristic data shown in fig. 11 as an example.
Referring to fig. 11, fig. 11 is a schematic diagram of the current day characteristic data of a target user according to an embodiment of the present application. As shown in fig. 11, the current day characteristic data of the target user includes characteristic data of other periods before the current period and characteristic data of the current period; wherein the feature data of the time of day includes feature values of the non-updated feature and feature values of the target feature. The number of non-updated features and target features is not limited here.
In one implementation, the electronic device may update the feature data of the current period in the current day feature data based on the sleep-aiding suggestion, to obtain updated current day feature data, where the feature data of other periods of the current day except the current period is unchanged. The electronic device may update only the feature value of the target feature in the feature data of the current period (i.e., the bold-faced word part in fig. 11) based on the sleep-aiding suggestion for the target feature, to obtain the updated feature value of the target feature in fig. 12A (i.e., the bold-faced word part in fig. 12A); the feature values of other features (i.e., the non-updated features) in the current period are unchanged; the data shown in fig. 12A is the updated current day characteristic data.
For example, the feature data of the current period includes the feature value x of feature 1 1 Eigenvalue x of feature 2 2 Feature value x of feature 3 3 Wherein feature 1 is the target feature and features 2 and 3 are the non-updated features. Feature 1 is calories, the sleep-aiding suggestion corresponding to feature 1 is workout 1, which may consume x' calories, and the electronic device may update the feature value of feature 1 to x 1 ’=x 1 -x', updatedEigenvalue x of eigenvalue 1 1 The' is the data of the updated target feature, the feature values of the non-updated feature 2 and the feature 3 are the feature data of the non-updated feature, and the feature data of the updated current period comprises the feature value of the updated feature 1 and the feature values of the non-updated feature 2 and the feature 3.
In another implementation, the electronic device may predict feature data for a period next to the current period based on the sleep aiding advice; and adding the characteristic data of the next period in the current-day characteristic data of the target user to obtain updated current-day characteristic data. For example, the electronic device may predict the feature value of the target feature for the next period (i.e., the bold-faced portion in fig. 12B) based on the sleep-aiding advice for the target feature and the feature value of the target feature in fig. 11 (i.e., the bold-faced portion in fig. 11); the feature values of the other features (i.e., the non-updated features) except the target feature in the next period are the same as the feature values of the non-updated features in the current period, so that feature data (i.e., the newly added portion marked in fig. 11) of the next period can be obtained; and adding the characteristic data of the next period into the current-day characteristic data of the target user to obtain updated current-day characteristic data.
The following exemplary description describes one implementation method for updating feature data of a target feature.
In one implementation, the sleep-aiding suggestion is a course corresponding to the target feature, and parameters corresponding to the course are used for updating data of the feature; the electronic device updates feature data of the target feature based on the parameters corresponding to the course. For example, the exercise course 1 may consume x 'calories, and then the x' calories corresponding to the exercise course 1 are added to the characteristic data of the kari road in the current period to obtain updated current characteristic data, the characteristic value of the calories in the current period in the updated current characteristic data is changed, and the characteristic values of other characteristics in the updated current characteristic data are not changed.
And S512, the electronic equipment obtains the improvement effect based on the updated current day characteristic data and the target model.
Wherein the updated current day characteristic data includes new data for at least one target characteristic; the improving effect may include adopting sleep quality after sleep-aiding advice and improving the sleep quality, wherein the sleep quality may include a sleep time period, a deep sleep proportion, a shallow sleep proportion, rapid eye movement, etc., and the improving condition of the sleep quality may include an increasing value of the sleep time period, an increasing value of the deep sleep time period, etc.
In some embodiments, the updated current day characteristic data includes characteristic data of other periods that are not updated and characteristic data of the current period that are updated (as shown in fig. 12A); the electronic equipment calculates a sleep influence factor of the updated current time period based on the updated characteristic data of the current time period; based on the sleep influence factors of other periods which are not updated and the updated sleep influence factors of the current period, the proposed sleep quality is predicted to be adopted through the target model. The detailed process of predicting the sleep quality after the proposal is adopted by the target model can be seen in the related implementation of step S509.
In other embodiments, the updated current day characteristic data includes the original current day characteristic data and the predicted next period characteristic data (as shown in fig. 12B); the electronic equipment calculates sleep influence factors of the next time period based on the characteristic data of the next time period; and predicting the sleep quality after adopting the advice by a target model based on the sleep influence factors corresponding to the original current day characteristic data and the sleep influence factors of the next period. Wherein, the detailed process of predicting the sleep quality after the proposal is adopted through the target model can be seen from the related implementation of step S509.
Referring to fig. 13, fig. 13 is a schematic diagram of determining sleep quality after adopting advice according to an embodiment of the present application. As shown in fig. 13, assuming that the feature i is a target feature, the sleep-aiding suggestion is a course corresponding to the feature i, and the electronic device may update the data of the feature i based on the course corresponding to the feature i; and updating the sleep influence factors of the target users based on the updated data of the characteristic i, and inputting the updated sleep influence factors into the target model to obtain the recommended sleep quality. The process of obtaining the recommended sleep quality based on the updated sleep influence factor and the target model may refer to the process of predicting the current sleep quality, and no longer resides here.
The following exemplary description updates the implementation of the sleep impact factor.
In one implementation, where the data for all of the features in the updated current day's feature data has been updated, the electronic device may update each of the sleep impact factors based on the updated data for all of the features.
In another implementation, the updated current day feature data may include new data for the target feature and data for the non-updated feature; the updated sleep impact factors may include updated factors and non-updated factors.
For example, the plurality of factors may include physical exertion factors, energy expenditure factors, sleep-on environment impact factors, and the like; each factor corresponds to a different feature, and the electronic device can update only the factor corresponding to the target feature to obtain an updated sleep influence factor. For example, the sleep influencing factors include physical exertion factors, energy consumption factors and sleep-on environment influencing factors, the target features are features corresponding to the physical exertion factors, and then the electronic device can update the physical exertion factors based on the updated feature data, and the obtained updated sleep influencing factors include the non-updated energy consumption factors, the sleep-on environment influencing factors and the updated physical exertion factors.
Taking fig. 6 as an example, if the target feature is one or more of features 1 to 5, the electronic device updates the physical exertion factor based on the updated current day feature data; if the target feature is one or more of the features 6 to 10, the electronic device updates the energy consumption factor based on the updated current day feature data; if the target feature is one or more of features 11 to 12, the electronic device updates the sleep-on environment influence factor based on the updated current-day feature data.
Referring to fig. 14, fig. 14 is a schematic diagram of updating sleep influence factors according to an embodiment of the present application. FIG. 14 illustrates pre-update sleep impact factors, including sleep impact factors for k periods; target objectThe new data of the features is used to update the sleep impact factor (i.e., Y k ) Sleep influencing factors such as Y for other periods of time 1 And Y 2 Etc. are unchanged; assuming that the feature corresponding to the physical exertion factor is the target feature and other features are not updated, the updated factor in the updated sleep influence factors is the physical exertion factor, and the physical exertion factor before updating is SCF k The updated physical exertion factor is SCF k’ The method comprises the steps of carrying out a first treatment on the surface of the The unexplored factor is the energy expenditure factor EFC k And a sleep-environment influencing factor SIEF k . Details of the sleep influencing factors before updating can be found in the relevant description of fig. 8, and are not described here again.
S513, the electronic equipment displays the current sleep quality, the sleep-aiding advice and the improvement effect.
In some embodiments, the electronic device may perform the above steps S501 to S510 to obtain the current sleep quality and the sleep-aiding advice in response to the user operation to start sleep prediction, and further display the current sleep quality and the sleep-aiding advice; then, in response to the user operation of predicting the sleep quality after the sleep-aiding advice is adopted, the above-mentioned step S511 and step S512 are performed to obtain the improvement effect, and the above-mentioned improvement effect is displayed.
For example, in response to the user operation of the sleep quality prediction control 620 displayed on the user interface 62 shown in fig. 15B, the electronic device performs the above steps S501 to S507 to obtain the current sleep quality, and further displays the current sleep quality and the above sleep-aiding advice through the user interface 63 shown in fig. 15C, for example, the display window 630 is used to display the current sleep quality; further, in response to a user operation of the view control 634 displayed with respect to the user interface 63, the above-described step S508 and step S509 are performed to obtain an improvement effect, and the above-described improvement effect is displayed through the user interface 64 as shown in fig. 15D.
In other embodiments, the electronic device may perform the above steps S501 to S509 to obtain the current sleep quality in response to the user operation to start sleep prediction, and further display the current sleep quality; responding to the user operation for providing the sleep-aiding advice, executing the step S510 to obtain the sleep-aiding advice, and displaying the sleep-aiding advice; then, in response to the user operation of the improvement effect, the above-mentioned step S511 and step S512 are performed to obtain the improvement effect, and further, the above-mentioned improvement effect is displayed.
In still other embodiments, the electronic device may display the current sleep quality, the sleep aiding advice, and the improvement effect after performing the above steps S501 to S512 in response to a user operation to start sleep prediction.
The following illustrates possible user interfaces of the electronic device according to the embodiments of the present application, and fig. 15A to 15D are user interfaces implemented on the electronic device.
FIG. 15A illustrates an exemplary user interface 61 on an electronic device for exposing installed applications. The user interface 61 is displayed with: status bars, icons 610 of sports health applications, icons of gallery applications, icons of other applications, and the like. Wherein the status bar may include: one or more signal strength indicators of mobile communication signals (also may be referred to as cellular signals), one or more signal strength indicators of Wi-Fi signals, battery status indicators, time indicators, and the like.
As shown in fig. 15A, the user may click on an icon 610 of the sports health application, and accordingly, the electronic device may display the user interface 62 shown in fig. 15B in response to the user operation. It should be appreciated that this user interface 62 is an application interface of the sports health application shown by way of example and should not be construed as limiting the embodiments of the present application.
As shown in fig. 15B, the user interface 62 displays a sleep quality prediction control 620; the electronic device may display the user interface 63 shown in fig. 15C in response to a user operation of the sleep quality prediction control 620 displayed for the user interface 62 shown in fig. 15B.
User interface 63 includes display window 630, breath training control 631, workout control 632, sleep comfort music 633, and view control 634. Wherein the display window 630 is used for displaying predicted sleep quality, such as sleep duration, deep sleep proportion, shallow sleep proportion, rapid eye movement, etc.; breath training control 631 is used to display the corresponding lesson content of breath training; exercise course control 632 is used to display course content corresponding to an exercise course; the sleep comfort music 633 is used for displaying the course content corresponding to the sleep comfort music; view control 634 is used to display the quality of sleep after the proposal is adopted.
As shown in fig. 15C, the user may click on view control 634, and accordingly, the electronic device may display user interface 64 as shown in fig. 15D in response to a user operation with view control 634. The user interface 64 may display the quality of sleep after the proposal is adopted, such as sleep duration, deep sleep proportion, shallow sleep proportion, rapid eye movement, etc.; and an increased value of the sleep duration and an increased value of the deep sleep duration.
In other embodiments, the object model may be server-generated. For example, the electronic device sends an acquisition request to a server in response to a user operation to predict sleep quality; the server responds to the acquisition request, and trains an initial sleep quality prediction model based on the historical sleep data of the target group and the historical sleep data of the target user to obtain a target model; and then, the process is performed. The server sends the target model and the current day characteristic data of the target user to the electronic equipment; finally, the electronic apparatus may perform steps S508 to S513.
In still other embodiments, the current sleep quality, the sleep-aiding advice, and the improvement effect may all be server-generated. For example, the electronic device sends an acquisition request to a server in response to a user operation to predict sleep quality; the server responds to the acquisition request, and trains an initial sleep quality prediction model based on the historical sleep data of the target group and the historical sleep data of the target user to obtain a target model; further, the server obtains the current sleep quality, the sleep-aiding advice, and the improvement effect based on the target model and the current day characteristic data of the target user; further, the server may send the current sleep quality, the sleep aiding advice, and the improvement effect to the electronic device; finally, the electronic device may perform step S513.
The embodiment of the application also provides electronic equipment, which comprises one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, the one or more memories being operable to store computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the methods described in the above embodiments.
Embodiments of the present application also provide a computer program product comprising instructions which, when run on an electronic device, cause the electronic device to perform the method described in the above embodiments.
Embodiments of the present application also provide a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the above embodiments.
It is understood that the embodiments of the present application may be arbitrarily combined to achieve different technical effects.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk), etc.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.
In summary, the foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present application should be included in the protection scope of the present application.

Claims (12)

1. A sleep quality prediction method, applied to an electronic device, the method comprising:
the electronic equipment responds to user operation for starting sleep prediction to acquire user data; the user data includes at least one of physical energy data, and environmental data;
the electronic equipment obtains a sleep-aiding suggestion of a user and first sleep quality based on the user data, wherein the first sleep quality is the sleep quality of the user when the user adopts the sleep-aiding suggestion;
The electronic equipment displays at least one of the first sleep quality and the sleep improvement situation and the sleep-aiding advice, wherein the sleep improvement situation is the improvement situation of the sleep quality when the user adopts the sleep-aiding advice.
2. The method according to claim 1, wherein the method further comprises:
the electronic equipment obtains second sleep quality based on the user data, wherein the second sleep quality is the sleep quality when the user does not adopt the sleep-aiding suggestion;
the electronic device displays the second sleep quality.
3. The method according to claim 1 or 2, wherein the sleep quality comprises at least one of a sleep duration and a deep sleep proportion within a preset duration, and the sleep improvement condition comprises at least one of an improvement condition of a sleep duration and an improvement condition of a deep sleep proportion; the method further comprises the steps of:
the electronic equipment obtains at least one of the improvement condition of the sleep duration and the improvement condition of the depth proportion based on the first sleep quality and the second sleep quality; the second sleep quality is the sleep quality when the user does not adopt the sleep aiding advice.
4. A method according to any of claims 1-3, wherein the user data comprises feature values for a plurality of features, the electronic device deriving a user's sleep-aid advice and a first sleep quality based on the user data, comprising:
the electronic device determining a target feature from the plurality of features based on feature values of the plurality of features;
the electronic equipment determines sleep-aiding suggestions aiming at the target characteristics; the sleep-aiding proposal for the target feature is used for updating the feature value of the target feature.
5. The method of claim 4, wherein the electronic device determining a target feature from the plurality of features based on feature values of the plurality of features comprises:
the electronic equipment compares the characteristic value of each characteristic with a preset value corresponding to each characteristic to obtain the deviation degree of each characteristic;
the electronic device determines the first N features with large deviation degrees as the target features, wherein N is a positive integer.
6. The method according to claim 4 or 5, wherein the user data includes feature data of an mth period and feature data of other periods, the feature data including feature values of a plurality of features, the M being a positive integer; the electronic device obtains a sleep-aiding suggestion and a first sleep quality of a user based on the user data, including:
The electronic equipment updates the characteristic value of the target characteristic in the characteristic data of the Mth period based on the sleep-aiding suggestion aiming at the target characteristic to obtain the updated characteristic data of the Mth period;
the electronic equipment obtains the sleep influence factor of the updated Mth period based on the characteristic data of the updated Mth period;
the electronic equipment takes the updated sleep influence factors of the Mth period and the sleep influence factors of other periods as input, and obtains the first sleep quality through a target model;
the sleep influence factors of the other time periods are obtained based on the characteristic data of the other time periods; the target model is obtained by training by taking a sample sleep influence factor as input and taking sleep quality corresponding to the sample sleep influence factor as a label.
7. The method of any of claims 2-6, wherein the user data includes characteristic data for a plurality of time periods, the electronic device deriving a second sleep quality based on the user data, comprising:
the electronic equipment obtains sleep influence factors of each time period based on the characteristic data of each time period in the plurality of time periods;
The electronic equipment obtains the second sleep quality based on the sleep influence factors and the target model of each period;
the target model is obtained by training by taking a sample sleep influence factor as input and taking sleep quality corresponding to the sample sleep influence factor as a label.
8. The method of claim 6 or 7, wherein the sleep influencing factors for a preset period of time include at least one of physical exertion factors, energy expenditure factors, and sleep-on environment influencing factors;
the physical exertion factor is determined based on at least one of heart rate, exercise duration, number of steps, calories, and number of activity hours within the preset period of time; the energy expenditure factor is determined based on at least one of blood pressure, blood oxygen, pressure, caffeine intake, and alcohol intake during the preset period; the falling asleep ambient influence factor is determined based on at least one of ambient light and noise decibels over the preset period of time.
9. The method according to any one of claims 6-8, further comprising:
the electronic equipment acquires a pre-training model, wherein the pre-training model is obtained based on historical user data of a group where the user is located;
And the electronic equipment trains the pre-training model based on the historical user data of the user to obtain the target model.
10. The method of any of claims 1-8, wherein the electronic device, in response to a user operation to initiate sleep prediction, obtaining user data comprises:
the electronic equipment responds to user operation for starting sleep prediction and sends an acquisition request to a server;
the electronic equipment receives the user data sent by the server, wherein the user data comprises data acquired by the server from equipment worn by the user.
11. An electronic device comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, the one or more memories for storing computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any of claims 1-10.
12. A computer readable storage medium comprising instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-10.
CN202211178383.2A 2022-09-26 2022-09-26 Sleep quality prediction method, electronic equipment and system Pending CN117796760A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211178383.2A CN117796760A (en) 2022-09-26 2022-09-26 Sleep quality prediction method, electronic equipment and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211178383.2A CN117796760A (en) 2022-09-26 2022-09-26 Sleep quality prediction method, electronic equipment and system

Publications (1)

Publication Number Publication Date
CN117796760A true CN117796760A (en) 2024-04-02

Family

ID=90418870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211178383.2A Pending CN117796760A (en) 2022-09-26 2022-09-26 Sleep quality prediction method, electronic equipment and system

Country Status (1)

Country Link
CN (1) CN117796760A (en)

Similar Documents

Publication Publication Date Title
WO2020151387A1 (en) Recommendation method based on user exercise state, and electronic device
CN111738122B (en) Image processing method and related device
CN111202955A (en) Motion data processing method and electronic equipment
CN111819533A (en) Method for triggering electronic equipment to execute function and electronic equipment
WO2021052139A1 (en) Gesture input method and electronic device
WO2021169370A1 (en) Method for cross-device allocation of service elements, terminal device, and storage medium
CN114242037A (en) Virtual character generation method and device
CN116070035B (en) Data processing method and electronic equipment
WO2021238460A1 (en) Risk pre-warning method, risk behavior information acquisition method, and electronic device
CN115525372B (en) Method and device for displaying interface
CN114424927A (en) Sleep monitoring method and device, electronic equipment and computer readable storage medium
CN115333941A (en) Method for acquiring application running condition and related equipment
CN114003827A (en) Weather information display method and device and electronic equipment
CN116861066A (en) Application recommendation method and electronic equipment
CN111339513B (en) Data sharing method and device
CN117796760A (en) Sleep quality prediction method, electronic equipment and system
CN115083401A (en) Voice control method and device
CN114006976B (en) Interface display method and terminal equipment
CN113630501B (en) Ringing method and terminal equipment
CN118155837A (en) Arrhythmia risk prediction method and related electronic equipment
CN118072723A (en) Collaborative wake-up method and device and electronic equipment
CN114420160A (en) Method and apparatus for processing audio signal
CN116030787A (en) Age-based sound generation method and device
CN117694892A (en) Emotion health state analysis method and electronic equipment
CN117711565A (en) Motion recovery time determining method and electronic equipment

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