CN113164056A - Sleep prediction method, device, storage medium and electronic equipment - Google Patents

Sleep prediction method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113164056A
CN113164056A CN201980080279.XA CN201980080279A CN113164056A CN 113164056 A CN113164056 A CN 113164056A CN 201980080279 A CN201980080279 A CN 201980080279A CN 113164056 A CN113164056 A CN 113164056A
Authority
CN
China
Prior art keywords
state information
sleep
current
current state
sleep prediction
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
CN201980080279.XA
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN113164056A publication Critical patent/CN113164056A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons

Abstract

A sleep prediction method is applied to electronic equipment, so that the electronic equipment can acquire current state information (101) of the electronic equipment, determine a current use scene (102) of the electronic equipment according to the current state information, and further perform sleep prediction (103) on a user by using a sleep prediction model corresponding to the current use scene, and the accuracy of the sleep prediction on the user can be improved.

Description

Sleep prediction method, device, storage medium and electronic equipment Technical Field
The present application belongs to the field of computer technologies, and in particular, to a sleep prediction method, an apparatus, a storage medium, and an electronic device.
Background
At present, electronic devices such as tablet computers and mobile phones are configured, so that system updating and other operations which affect the use of users or take a long time can be performed when the users sleep, and therefore the influence on the use of the users is avoided. For this reason, the related art achieves the foregoing object by performing sleep prediction on a user, such as predicting a sleep interval of the user, and the like, but the accuracy of performing sleep prediction on the user in the related art is low.
Disclosure of Invention
The embodiment of the application provides a sleep prediction method, a sleep prediction device, a storage medium and electronic equipment, which can enable the electronic equipment to accurately predict the sleep of a user.
In a first aspect, an embodiment of the present application provides a sleep prediction method applied to an electronic device, including:
acquiring current state information of the electronic equipment;
determining the current use scene of the electronic equipment according to the current state information;
and predicting the sleep of the user according to a pre-trained sleep prediction model corresponding to the current use scene to obtain a prediction result.
In a second aspect, an embodiment of the present application provides a sleep prediction apparatus, which is applied to an electronic device, and includes:
the acquisition module is used for acquiring the current state information of the electronic equipment;
the determining module is used for determining the current use scene of the electronic equipment according to the current state information;
and the prediction module is used for predicting the sleep of the user according to the pre-trained sleep prediction model corresponding to the current use scene to obtain a prediction result.
In a third aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, where the computer program is executed on a computer, so as to make the computer execute the steps in the sleep prediction method provided by the embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a memory and a processor, where the processor is configured to execute steps in a sleep prediction method provided in an embodiment of the present application by calling a computer program stored in the memory.
In the embodiment of the application, the electronic equipment can acquire the current state information of the electronic equipment, determine the current use scene of the electronic equipment according to the current state information of the electronic equipment, and further perform sleep prediction on the user by using the sleep prediction model corresponding to the current use scene, so that the accuracy of performing sleep prediction on the user can be improved.
Drawings
The technical solution and the advantages of the present invention will be apparent from the following detailed description of the embodiments of the present invention with reference to the accompanying drawings.
Fig. 1 is a flowchart of a sleep prediction method according to an embodiment of the present application.
Fig. 2 is a schematic diagram of selecting a target sleep prediction model from a sleep prediction model set in an embodiment of the present application.
Fig. 3 is another flowchart of a sleep prediction method according to an embodiment of the present application.
Fig. 4 is a schematic diagram of an operation configuration interface provided in an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a sleep prediction apparatus according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 7 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Referring now to the drawings, in which like numerals represent like elements, the principles of the present invention are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the invention and should not be taken as limiting the invention with regard to other embodiments that are not detailed herein.
Referring to fig. 1, fig. 1 is a flow chart of a sleep prediction method according to an embodiment of the present application. The sleep prediction method can be applied to electronic equipment. The flow of the sleep prediction method may include:
in 101, current state information of an electronic device is acquired.
For example, the electronic device may periodically obtain status information of the electronic device after being powered on, where the status information includes, but is not limited to, relevant information describing a current usage status, a location status, an environment status, and the like of the electronic device.
It should be noted that, at present, it is not used to refer to a specific time, but to refer to a time when the electronic device performs the operation of acquiring the status information. Therefore, in the embodiment of the present application, at the "current time" when the electronic device acquires the state information each time, the state information acquired correspondingly is recorded as the "current state information".
In 102, the current usage scenario of the electronic device is determined according to the aforementioned current state information.
In the embodiment of the application, after the electronic device acquires the current state information of the electronic device, the current usage scenario of the electronic device is further determined according to the acquired current state information, where the usage scenario is used for describing a scenario in which a user uses the electronic device, and includes, but is not limited to, a home vacation scenario, an outgoing travel scenario, a business trip scenario, a daily work scenario, and the like.
For example, the electronic device determines that the current usage scenario is a home scenario according to the acquired current state information.
In 103, a sleep prediction is performed on the user according to a pre-trained sleep prediction model corresponding to the current usage scenario, so as to obtain a prediction result.
It should be noted that, in the embodiment of the present application, a sleep prediction model set is pre-stored in the electronic device, where the sleep prediction model set includes a plurality of sleep prediction models, and the sleep prediction models are respectively suitable for predicting sleep intervals of the user in different usage scenarios, where the sleep intervals of the user at least include a time when the user enters sleep and a time when the user wakes up.
In the embodiment of the application, after determining the current usage scenario according to the current state information of the electronic device, the electronic device further selects a sleep prediction model corresponding to the current usage scenario (or a sleep prediction model suitable for predicting a sleep interval of a user in the current usage scenario) from the sleep prediction model set as a target sleep prediction model currently used for predicting the sleep interval of the user.
For example, referring to fig. 2, the sleep prediction model set includes four sleep prediction models, which are an a sleep prediction model suitable for sleep prediction in a home vacation scene, a B sleep prediction model suitable for sleep prediction in an outbound scene, a C sleep prediction model suitable for sleep prediction in a business trip scene, and a D sleep prediction model suitable for sleep prediction in a daily work scene. If the electronic equipment determines that the current use scene is a home vacation scene, selecting an A sleep prediction model from the sleep prediction model set as a target sleep prediction model; if the electronic equipment determines that the current use scene is an out-of-travel scene, selecting a B sleep prediction model from the sleep prediction model set as a target sleep prediction model; if the electronic equipment determines that the current use scene is a work business trip scene, selecting a C sleep prediction model from the sleep prediction model set as a target sleep prediction model; and if the current use scene of the electronic equipment is determined to be a daily work scene, selecting a D sleep prediction model from the sleep prediction models as a target sleep prediction model.
It should be noted that the sleep prediction model is obtained by training a machine learning algorithm in advance, and the machine learning algorithm can implement various functions through continuous feature learning, for example, the sleep interval of the user can be predicted according to the historical work and rest behaviors of the user. Wherein the machine learning algorithm may include: decision tree models, logistic regression models, bayesian models, neural network models, clustering models, and the like.
The algorithm types of the machine learning algorithm can be divided according to various situations, for example, the machine learning algorithm can be divided into: supervised learning algorithms, unsupervised learning algorithms, semi-supervised learning algorithms, reinforcement learning algorithms, and the like.
Under supervised learning, input data is called as "training data", and each set of training data has a definite identification or result, such as "spam" and "non-spam" in a spam prevention system, and "1", "2", "3", "4" in handwritten number recognition, and the like. When the recognition model is established, a learning process is established through supervised learning, scene type information is compared with an actual result of training data, and the recognition model is continuously adjusted until the scene type information of the model reaches an expected accuracy rate. Common application scenarios for supervised learning are classification problems and regression problems. Common algorithms are Logistic Regression (Logistic Regression) and Back Propagation Neural Network (Back Propagation Neural Network).
In unsupervised learning, data is not specifically labeled and the recognition model is to infer some of the intrinsic structure of the data. Common application scenarios include learning and clustering of association rules. Common algorithms include Apriori algorithm and k-Means algorithm, among others.
Semi-supervised learning algorithms, in which input data is partially identified, can be used for type recognition, but the model first needs to learn the intrinsic structure of the data in order to reasonably organize the data for prediction. The application scenarios include classification and regression, and the algorithms include some extensions to common supervised learning algorithms that first attempt to model the unidentified data and then predict the identified data based thereon. Such as Graph theory Inference algorithm (Graph Inference) or Laplacian support vector machine (Laplacian SVM).
Reinforcement learning algorithms, in which input data is used as feedback to the model, unlike supervised models, which simply serve as a way to check for model alignment errors, are used in reinforcement learning, in which input data is fed back directly to the model, and the model must be adjusted immediately for this. Common application scenarios include dynamic systems and robot control. Common algorithms include Q-Learning and time difference Learning (Temporal difference Learning).
Further, the machine learning algorithm can also be divided into based on similarities according to the function and form of the algorithm:
regression algorithms, common ones include: least squares (ideal Least Square), Logistic Regression (Logistic Regression), Stepwise Regression (Stepwise Regression), Multivariate Adaptive Regression Splines (Multivariate Adaptive Regression Splines) and local variance Smoothing estimation (local approximated scattered Smoothing).
Example-based algorithms include k-Nearest Neighbor (KNN), Learning Vector Quantization (LVQ), and Self-Organizing Map algorithm (SOM).
A common algorithm of the regularization method includes: ridge Regression, Last Absolute Shringkgage and Selection Operator (LASSO), and Elastic networks (Elastic Net).
Decision tree algorithms, common ones include: classification And Regression Trees (CART), ID3(Iterative Dichotomiser 3), C4.5, Chi-squared automated Interaction Detection (CHAID), Decision Stump, Random Forest (Random Forest), Multivariate Adaptive Regression Spline (MARS), And Gradient Boosting Machine (GBM).
The Bayesian method algorithm comprises the following steps: naive Bayes algorithm, average single-Dependence estimation (AODE), and Bayesian Belief Network (BBN).
After the target sleep prediction model (i.e., the sleep prediction model corresponding to the current usage scenario of the electronic device) is selected from the sleep prediction model set, the electronic device may perform sleep prediction on the user according to the target sleep prediction model to obtain a prediction result. It should be noted that the sleep prediction for the user includes, but is not limited to, a time of entering sleep, a time of ending sleep, a sleep interval composed of the time of entering sleep and the time of ending sleep, and the like. For example, the sleep prediction is performed on the user according to the target sleep prediction model, and the sleep interval of the user is 23:30 in the current day to 06:60 in the next day.
As can be seen from the above, in the embodiment of the application, the electronic device may obtain the current state information of the electronic device, determine the current usage scenario of the electronic device according to the current state information of the electronic device, further select the target sleep prediction model corresponding to the current usage scenario from the sleep prediction model set, and perform sleep prediction on the user by using the target sleep prediction model, so that accuracy of performing sleep prediction on the user can be improved.
Referring to fig. 3, fig. 3 is another flowchart illustrating a sleep prediction method according to an embodiment of the present disclosure. The sleep prediction method can be applied to electronic equipment. The flow of the sleep prediction method may include:
in 201, the electronic device acquires sensor data collected by a sensor.
At 202, the electronic device generates its current state information from the sensor data.
In the embodiment of the present application, after the electronic device is powered on, the state information of the electronic device may be periodically acquired according to a preset information acquisition period (a suitable value may be obtained by a person of ordinary skill in the art based on experience, for example, the value may be set to a natural day), where the state information includes, but is not limited to, related information for describing a use state, a location state, an environment state, and the like of the electronic device.
It should be noted that, at present, the time is not used to refer to a specific time, but to refer to a time when the electronic device performs the operation of acquiring the state information. Therefore, in the embodiment of the present application, at the "current time" when the electronic device acquires the state information each time, the state information acquired correspondingly is recorded as the "current state information".
In the embodiment of the application, the electronic device may acquire the current state information by using a sensor configured by the electronic device. The electronic device is configured with sensors including, but not limited to, a gravity sensor, an acceleration sensor, a positioning sensor (such as a satellite positioning sensor, a base station positioning sensor, etc.), a sound sensor, a light sensor, and the like.
When the electronic equipment executes the operation of acquiring the state information at the current moment, firstly, the electronic equipment acquires the sensor data acquired by the configured sensor in the current information acquisition period corresponding to the current moment, and then, the electronic equipment generates the current state information according to the sensor data.
For example, the electronic device generates state information for describing its use state from the cleaned gravity sensor data and acceleration sensor data, generates state information for describing its position state from the positioning sensor data, generates state information for describing its environment state from the sound sensor and light sensor, and the like.
At 203, the electronic device determines its current usage scenario according to its current state information.
In the embodiment of the application, after the electronic device acquires the current state information of the electronic device, the current usage scenario of the electronic device is further determined according to the acquired current state information, where the usage scenario is used for describing a scenario in which a user uses the electronic device, and includes, but is not limited to, a home vacation scenario, an outgoing travel scenario, a business trip scenario, a daily work scenario, and the like.
For example, the electronic device determines that the current usage scenario is a home scenario according to the acquired current state information.
At 204, the electronic device performs sleep prediction on the user according to a pre-trained sleep prediction model corresponding to the current usage scenario, so as to obtain a sleep interval of the user.
It should be noted that, in the embodiment of the present application, a sleep prediction model set is pre-stored in the electronic device, where the sleep prediction model set includes a plurality of sleep prediction models, and the sleep prediction models are respectively suitable for predicting sleep intervals of the user in different usage scenarios, where the sleep intervals of the user at least include a time when the user enters sleep and a time when the user wakes up.
In the embodiment of the application, after determining the current usage scenario according to the current state information of the electronic device, the electronic device further selects a sleep prediction model corresponding to the current usage scenario (or a sleep prediction model suitable for predicting a sleep interval of a user in the current usage scenario) from the sleep prediction model set as a target sleep prediction model currently used for predicting the sleep interval of the user.
For example, referring to fig. 2, the sleep prediction model set includes four sleep prediction models, which are an a sleep prediction model suitable for sleep prediction in a home vacation scene, a B sleep prediction model suitable for sleep prediction in an outbound scene, a C sleep prediction model suitable for sleep prediction in a business trip scene, and a D sleep prediction model suitable for sleep prediction in a daily work scene. If the electronic equipment determines that the current use scene is a home vacation scene, selecting an A sleep prediction model from the sleep prediction model set as a target sleep prediction model; if the electronic equipment determines that the current use scene is an out-of-travel scene, selecting a B sleep prediction model from the sleep prediction model set as a target sleep prediction model; if the electronic equipment determines that the current use scene is a work business trip scene, selecting a C sleep prediction model from the sleep prediction model set as a target sleep prediction model; and if the current use scene of the electronic equipment is determined to be a daily work scene, selecting a D sleep prediction model from the sleep prediction models as a target sleep prediction model.
After the target sleep prediction model is selected from the sleep prediction model set, the electronic equipment can perform sleep prediction on the user according to the target sleep prediction model to obtain a sleep interval of the user. For example, the sleep interval of the user is predicted to be 23:30 in the current day to 06:60 in the next day.
In 205, if the predicted sleep interval is reached and the duration of the screen-off reaches the preset duration, the electronic device executes a preset operation.
In the embodiment of the application, when the electronic equipment reaches the predicted sleep interval, the duration of the screen-off of the electronic equipment is detected, so that whether the user falls asleep or not is judged according to the duration. The electronic equipment can judge that the user goes to sleep when the duration of the screen-off of the electronic equipment reaches the preset duration. When the user is judged to go to sleep, the electronic equipment executes preset operation which is configured in advance and executed in a sleep interval.
It should be noted that, in the embodiment of the present application, a value of the preset duration is not specifically limited, and a person skilled in the art can take the value according to actual needs, for example, the value may be set to 5 minutes.
In addition, the configuration of the preset operation is not limited in the embodiment of the present application, and may be configured manually by a user, or configured by the default of the electronic device, for example, the electronic device may configure the system update operation as the preset operation, so as to execute the system update operation in the predicted sleep interval and update the system to the latest version; the electronic device may also configure the application update operation as a preset operation, so as to execute the application update operation in the predicted sleep interval, update the installed application program to the latest version, and the like; the electronic device may configure the power consumption control operation as a preset operation, thereby applying a preset power consumption control policy for reducing power consumption in the predicted sleep interval, reducing power consumption of the electronic device, and the like.
For another example, referring to fig. 4, the electronic device is provided with a preset operation configuration interface, as shown in fig. 4, the preset operation configuration interface includes a prompt message "please select an operation performed during a sleep period", an operation selection box, a pull-down button, a pull-down menu, a determination button, and a cancel button, where the pull-down menu is called according to a click operation of a user on the pull-down button, the pull-down menu is provided with a plurality of operations that the electronic device can perform in a user sleep interval, such as a system update operation, an application update operation, and the like shown in fig. 4, the user can select an operation that the electronic device performs in the user sleep interval according to actual needs, and after selecting an operation that the electronic device needs to perform in the user sleep interval, click the determination button, and instruct the electronic device to use the operation selected by the user as the preset operation. Or, if the user finds that there is no operation that the electronic device needs to execute in the user sleep interval, the user may click a cancel button to instruct the electronic device to execute a preset operation of the default configuration.
In one embodiment, when determining the current usage scenario of the electronic device according to the current state information of the electronic device, the electronic device may perform:
the electronic equipment determines a use scene with state information matched with the current state information of the electronic equipment from a plurality of use scenes according to the prestored state information of the plurality of use scenes;
the electronic equipment takes the use scene of which the state information is matched with the current state information as the current use scene of the electronic equipment.
The electronic device locally pre-stores state information of a plurality of different usage scenarios (or describes a plurality of different usage scenarios using a plurality of different state information), such as state information of a home vacation scenario, state information of a trip scenario, state information of a business trip scenario, and state information of a daily work scenario.
When the electronic device determines the current usage scenario according to the current state information, the electronic device may determine, according to the pre-stored state information of the multiple usage scenarios, a usage scenario in which the state information matches the current state information from the multiple usage scenarios, and use the usage scenario in which the state information matches the current state information as the current usage scenario.
In one embodiment, the method for determining, by an electronic device, a usage scenario in which state information matches current state information of a plurality of usage scenarios from the plurality of usage scenarios according to pre-stored state information of the plurality of usage scenarios includes:
the electronic equipment acquires the similarity between the state information of each use scene and the current state information of the use scene;
the electronic equipment determines the use scene with the similarity reaching the preset similarity as the use scene with the state information matched with the current state information of the state information.
In the embodiment of the application, the electronic device may determine whether the two pieces of state information are matched according to the similarity between the two pieces of state information, so that when the electronic device determines the usage scenario in which the state information is matched with the current state information, the electronic device may respectively obtain the similarity between the state information of each usage scenario and the current state information, and determine the usage scenario in which the similarity reaches the preset similarity as the usage scenario in which the state information is matched with the current state information.
It should be noted that, in the embodiment of the present application, the value of the preset similarity is not specifically limited, and a person skilled in the art may take a suitable value according to actual needs.
For example, it is assumed that the electronic device prestores state information of a home vacation scene, state information of an outgoing travel scene, state information of a business trip scene, and state information of a daily work scene, and the preset similarity is configured to be 85%. If the similarity between the state information of the home vacation scene and the current state information of the home vacation scene acquired by the electronic equipment is 40%, the similarity between the state information of the travel scene and the current state information of the travel scene is 45%, the similarity between the state information of the work business scene and the current state information of the work business scene is 70%, and the similarity between the state information of the daily work scene and the current state information of the daily work scene is 86%, it can be seen that the similarity between the state information of the daily work scene and the current state information of the electronic equipment reaches the preset similarity (85%), and the electronic equipment determines the daily work scene as a use scene matched with the state information and the current state information of the electronic equipment.
In one embodiment, when acquiring the similarity between the state information of each usage scenario and the current state information thereof, the electronic device may perform:
the electronic equipment respectively obtains word vector sets of the state information of each use scene to obtain a plurality of first word vector sets;
the electronic equipment acquires a word vector set of current state information of the electronic equipment to obtain a second word vector set;
the electronic equipment respectively calculates the distance between each first word vector set and each second word vector set;
and the electronic equipment takes each calculated distance as the similarity between the state information of each use scene and the current state information of the use scene.
In the embodiment of the application, when the electronic device obtains the similarity between the state information of each usage scene and the current state information thereof, the electronic device performs feature extraction on any one of the pre-stored state information of a plurality of usage scenes, obtains a word vector set of the state information of each usage scene, and records the word vector set of the state information of each usage scene as a first word vector set. In addition, the electronic device also performs feature extraction on the current state information of the electronic device, and obtains a word vector set of the current state information of the electronic device, and the word vector set is recorded as a second word vector set.
After the electronic equipment acquires the first word vector set of the state information of each use scene and the second word vector set of the current state information of the electronic equipment, the distances between the first word vector sets and the second word vector sets are respectively calculated, and the calculated distances are used as the similarity between the state information of each use scene and the current state information of the use scene.
Any characteristic distance (such as euclidean distance, manhattan distance, chebyshev distance, cosine distance, and the like) can be selected by one of ordinary skill in the art according to actual needs to measure the distance between the two word vector sets.
For example, the cosine distances of the first word vector set and the second word vector set may be obtained, specifically referring to the following formula:
Figure PCTCN2019075356-APPB-000001
wherein e represents the cosine distance between the first word vector set and the second word vector set, f represents the first word vector set, N represents the dimensionality of the first word vector set and the second word vector set (the dimensionality of the two word vector sets is the same), f represents the dimensionality of the first word vector set and the second word vector set, andirepresenting the word vector of the ith dimension in the first word vector set (the state information of a usage scenario includes state information of multiple dimensions, such as usage state information, position state information, environment state information, etc., and the word vector of the ith dimension, i.e., the state information of the ith dimensionWord vector of information), giAnd representing the word vector of the ith dimension in the second word vector set.
In one embodiment, when obtaining the word vector set of the current state information of the electronic device, and obtaining the second word vector set, the electronic device may perform:
the electronic equipment inputs the current state information into a neural network of an encoder;
and the electronic equipment takes the word vector set of the current state information output by the encoder neural network as a second word vector set.
In the embodiment of the application, when the electronic device obtains the word vector set of the current state information of the electronic device and obtains the second word vector set, the electronic device may perform word segmentation operation on the current state information of the electronic device and then input the word vector set into the encoder neural network, and the encoder neural network processes the word vector set and then outputs the word vector set corresponding to the current state information.
It should be noted that, in the embodiments of the present application, specific models and topology structures of the encoder neural network are not limited, for example, a single-layer recurrent neural network may be used for training to obtain the encoder neural network, a multi-layer recurrent neural network may also be used for training to obtain the encoder neural network, and a convolutional neural network, or a variant thereof, or a neural network with other network structures may also be used for training to obtain the encoder neural network.
In an embodiment, when the electronic device obtains a word vector set of the state information of each usage scenario respectively to obtain a plurality of first word vector sets, the electronic device may perform:
the electronic equipment respectively inputs the state information of each use scene into the encoder neural network, and takes the word vector set of the state information of each use scene output by the encoder neural network as a first word vector set.
In one embodiment, when determining the current usage scenario of the electronic device according to the current state information of the electronic device, the electronic device may perform:
and the electronic equipment identifies the use scene corresponding to the current state information of the electronic equipment as the current use scene according to the current state information and the use scene identification model.
The usage scenario recognition model for usage scenario recognition may be trained in advance and configured locally in the electronic device. In this way, when the electronic device determines the current usage scenario according to the current state information of the electronic device, the current state information of the electronic device may be input to the configured usage scenario identification model, and the usage scenario identification model identifies the usage scenario corresponding to the current state information and outputs the usage scenario. Correspondingly, the electronic device takes the use scene corresponding to the current state information output by the use scene recognition model as the current use scene.
In an embodiment, when the electronic device performs sleep prediction on a user according to a pre-trained sleep prediction model corresponding to a current usage scenario to obtain a prediction result, the electronic device may perform:
acquiring work and rest behavior parameters of a user and use parameters of electronic equipment;
and inputting the acquired work and rest behavior parameters and the use parameters into the sleep prediction model to perform sleep prediction, and obtaining a prediction result output by the sleep prediction model.
The electronic equipment firstly obtains characteristic parameters required by a target sleep prediction model (namely the sleep prediction model corresponding to the current use scene) for sleep prediction, the characteristic parameters comprise work and rest behavior parameters of a user and operation parameters of the user on the electronic equipment, then the obtained characteristic parameters are input into the target sleep prediction model, the target sleep prediction model predicts the user, and a prediction result is output.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a sleep prediction apparatus according to an embodiment of the present application. The sleep prediction apparatus can be applied to an electronic device. The sleep prediction apparatus may include: an obtaining module 401, a determining module 402, a selecting module 403 and a predicting module 403.
An obtaining module 401, configured to obtain current state information of an electronic device;
a determining module 402, configured to determine a current usage scenario of the electronic device according to the current state information;
the prediction module 403 is configured to perform sleep prediction on the user according to a pre-trained sleep prediction model corresponding to the current usage scenario, so as to obtain a prediction result.
In an embodiment, when determining the current usage scenario of the electronic device according to the aforementioned current state information, the determining module 402 may be configured to:
determining a use scene with state information matched with the current state information from a plurality of use scenes according to the prestored state information of the plurality of use scenes;
and taking the use scene of which the state information is matched with the current state information as the current use scene.
In an embodiment, when determining, according to the pre-stored state information of a plurality of usage scenarios, a usage scenario of which the state information matches the current state information from the plurality of usage scenarios, the determining module 402 may be configured to:
acquiring the similarity between the state information of each use scene and the current state information;
and determining the use scene with the similarity reaching the preset similarity as the use scene with the state information matched with the current state information.
In an embodiment, when obtaining the similarity between the state information of each usage scenario and the current state information, the determining module 402 may be configured to:
respectively acquiring word vector sets of the state information of each use scene to obtain a plurality of first word vector sets;
acquiring a word vector set of the current state information to obtain a second word vector set;
respectively calculating the distance between each first word vector set and each second word vector set;
and taking each calculated distance as the similarity between the state information of each use scene and the current state information.
In an embodiment, when obtaining the word vector set of the current state information to obtain a second word vector set, the determining module 402 may be configured to:
inputting the current state information into a neural network of an encoder;
and taking the word vector set of the current state information output by the encoder neural network as a second word vector set.
In an embodiment, when obtaining a word vector set of state information of each usage scenario respectively to obtain a plurality of first word vector sets, the determining module 402 may be configured to:
and respectively inputting the state information of each use scene into the encoder neural network, and taking the word vector set of the state information of each use scene output by the encoder neural network as a first word vector set.
In an embodiment, when determining the current usage scenario of the electronic device according to the aforementioned current state information, the determining module 402 may be configured to:
and identifying the use scene corresponding to the current state information as the current use scene according to the current state information and the use scene identification model.
In an embodiment, when the sleep prediction is performed on the user according to a pre-trained sleep prediction model corresponding to the current usage scenario, and a prediction result is obtained, the prediction module 403 may be configured to:
acquiring work and rest behavior parameters of a user and use parameters of electronic equipment;
and inputting the acquired work and rest behavior parameters and the use parameters into the sleep prediction model to perform sleep prediction, and obtaining a prediction result output by the sleep prediction model.
In an embodiment, the prediction result includes a sleep interval of the user, and the sleep prediction apparatus further includes an execution module configured to:
and if the predicted sleep interval is reached and the duration of screen turning-off of the electronic equipment reaches the preset duration, executing preset operation, wherein the preset operation comprises system updating operation, application updating operation and/or power consumption control operation.
In an embodiment, when obtaining the current state information of the electronic device, the obtaining module 401 may be configured to:
acquiring sensor data acquired by a sensor of electronic equipment;
and generating the current state information according to the acquired sensor data.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when the stored computer program is executed on a computer, the computer is caused to execute the steps in the sleep prediction method provided by the embodiments of the present application.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, and the processor executes the steps in the sleep prediction method provided in the embodiment of the present application by calling the computer program stored in the memory.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device may include a memory 601 and a processor 602. Those of ordinary skill in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The memory 601 may be used to store applications and data. The memory 601 stores applications containing executable code. The application programs may constitute various functional modules. The processor 602 executes various functional applications and data processing by running application programs stored in the memory 601.
The processor 602 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 601 and calling the data stored in the memory 601, thereby performing overall monitoring of the electronic device.
In the embodiment of the present application, the processor 602 in the electronic device loads the executable code corresponding to the process of one or more audio processing programs into the memory 601 according to the following instructions, and the processor 602 runs the application program stored in the memory 601, so as to perform the following steps:
acquiring current state information of the electronic equipment;
determining the current use scene of the electronic equipment according to the current state information;
and according to a pre-trained sleep prediction model corresponding to the current use scene, performing sleep prediction on the user to obtain a prediction result.
Referring to fig. 7, fig. 7 is another schematic structural diagram of the electronic device according to the embodiment of the present disclosure, and the difference from the electronic device shown in fig. 6 is that the electronic device further includes components such as an input unit 603 and an output unit 604.
The input unit 603 may be used to receive input numbers, character information, or user characteristic information (such as a fingerprint), and generate a keyboard, a mouse, a joystick, an optical or trackball signal input, etc., related to user settings and function control, among others.
The output unit 604 may be used to output information input by the user or information provided to the user, such as a speaker or the like.
In the embodiment of the present application, the processor 602 in the electronic device loads the executable code corresponding to the process of one or more audio processing programs into the memory 601 according to the following instructions, and the processor 602 runs the application program stored in the memory 601, so as to perform the following steps:
acquiring current state information of the electronic equipment;
determining the current use scene of the electronic equipment according to the current state information;
and according to a pre-trained sleep prediction model corresponding to the current use scene, performing sleep prediction on the user to obtain a prediction result.
In an embodiment, when determining the current usage scenario of the electronic device according to the aforementioned current state information, the processor 602 may perform:
determining a use scene with state information matched with the current state information from a plurality of use scenes according to the prestored state information of the plurality of use scenes;
and taking the use scene of which the state information is matched with the current state information as the current use scene.
In an embodiment, when determining, according to the pre-stored state information of a plurality of usage scenarios, a usage scenario of which the state information matches the current state information from the plurality of usage scenarios, the processor 602 may perform:
acquiring the similarity between the state information of each use scene and the current state information;
and determining the use scene with the similarity reaching the preset similarity as the use scene with the state information matched with the current state information.
In one embodiment, in obtaining the similarity between the state information of each usage scenario and the current state information, the processor 602 may perform:
respectively acquiring word vector sets of the state information of each use scene to obtain a plurality of first word vector sets;
acquiring a word vector set of the current state information to obtain a second word vector set;
respectively calculating the distance between each first word vector set and each second word vector set;
and taking each calculated distance as the similarity between the state information of each use scene and the current state information.
In an embodiment, when obtaining the word vector set of the current state information to obtain the second word vector set, the processor 602 may perform:
inputting the current state information into a neural network of an encoder;
and taking the word vector set of the current state information output by the encoder neural network as a second word vector set.
In an embodiment, when obtaining a word vector set of the state information of each usage scenario respectively, and obtaining a plurality of first word vector sets, the processor 602 may perform:
and respectively inputting the state information of each use scene into the encoder neural network, and taking the word vector set of the state information of each use scene output by the encoder neural network as a first word vector set.
In an embodiment, when determining the current usage scenario of the electronic device according to the aforementioned current state information, the processor 602 may perform:
and identifying the use scene corresponding to the current state information as the current use scene according to the current state information and the use scene identification model.
In an embodiment, when performing sleep prediction on a user according to a pre-trained sleep prediction model corresponding to a current usage scenario to obtain a prediction result, the processor 602 may perform:
acquiring work and rest behavior parameters of a user and use parameters of electronic equipment;
and inputting the acquired work and rest behavior parameters and the use parameters into the sleep prediction model to perform sleep prediction, and obtaining a prediction result output by the sleep prediction model.
In an embodiment, the prediction result includes a sleep interval of the user, and after performing sleep prediction according to the target sleep prediction model to obtain the prediction result, the processor 602 may perform:
and if the predicted sleep interval is reached and the duration of screen turning-off of the electronic equipment reaches the preset duration, executing preset operation, wherein the preset operation comprises system updating operation, application updating operation and/or power consumption control operation.
In an embodiment, when obtaining the current state information of the electronic device, the processor 602 may perform:
acquiring sensor data acquired by a sensor of electronic equipment;
and generating the current state information according to the acquired sensor data.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the sleep prediction method, and are not described herein again.
The sleep prediction apparatus/electronic device provided in the embodiment of the present application and the sleep prediction method in the foregoing embodiments belong to the same concept, and any method provided in the sleep prediction method embodiment may be run on the sleep prediction apparatus/electronic device, and a specific implementation process thereof is described in detail in the sleep prediction method embodiment, and is not described herein again.
It should be noted that, for the sleep prediction method of the embodiment of the present application, it can be understood by those skilled in the art that all or part of the process for implementing the sleep prediction method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, the computer program can be stored in a computer readable storage medium, such as a memory, and executed by at least one processor, and during the execution process, the process of the embodiment of the sleep prediction method can be included. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the sleep prediction apparatus according to the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk or an optical disk.
The sleep prediction method, the sleep prediction device, the sleep prediction storage medium, and the electronic device provided in the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

  1. A sleep prediction method is applied to electronic equipment, and comprises the following steps:
    acquiring current state information of the electronic equipment;
    determining the current use scene of the electronic equipment according to the current state information;
    and predicting the sleep of the user according to a pre-trained sleep prediction model corresponding to the current use scene to obtain a prediction result.
  2. The sleep prediction method as claimed in claim 1, wherein the determining a current usage scenario of the electronic device according to the current state information comprises:
    according to the prestored state information of a plurality of using scenes, determining the using scene of which the state information is matched with the current state information from the plurality of using scenes;
    and taking the use scene of which the state information is matched with the current state information as the current use scene.
  3. The sleep prediction method according to claim 2, wherein the determining, according to the pre-stored state information of a plurality of usage scenarios, a usage scenario of which the state information matches the current state information from the plurality of usage scenarios comprises:
    acquiring the similarity between the state information of each use scene and the current state information;
    and determining the use scene with the similarity reaching the preset similarity as the use scene with the state information matched with the current state information.
  4. The sleep prediction method according to claim 3, wherein the obtaining of the similarity between the state information of each of the usage scenarios and the current state information includes:
    respectively obtaining word vector sets of the state information of each use scene to obtain a plurality of first word vector sets;
    acquiring a word vector set of the current state information to obtain a second word vector set;
    respectively calculating the distance between each first word vector set and the second word vector set;
    and taking each calculated distance as each similarity.
  5. The sleep prediction method according to claim 4, wherein the obtaining the word vector set of the current state information to obtain a second word vector set comprises:
    inputting the current state information into an encoder neural network;
    and combining the word vector set of the current state information output by the encoder neural network into the second word vector set.
  6. The sleep prediction method as claimed in claim 1, wherein the determining a current usage scenario of the electronic device according to the current state information comprises:
    and identifying a use scene corresponding to the current state information as the current use scene according to the current state information and the use scene identification model.
  7. The sleep prediction method according to claim 1, wherein the predicting sleep of the user according to the pre-trained sleep prediction model corresponding to the current usage scenario to obtain a prediction result includes:
    acquiring work and rest behavior parameters of the user and use parameters of the electronic equipment;
    and inputting the work and rest behavior parameters and the use parameters into the sleep prediction model to perform sleep prediction, so as to obtain a prediction result output by the sleep prediction model.
  8. The sleep prediction method according to claim 1, wherein the prediction result includes a sleep interval of the user, and after the sleep prediction is performed on the user according to the pre-trained sleep prediction model corresponding to the current usage scenario, the method further includes:
    and if the sleep interval is reached and the duration of screen turning off of the electronic equipment reaches a preset duration, executing preset operation, wherein the preset operation comprises system updating operation, application updating operation and/or power consumption control operation.
  9. The sleep prediction method as claimed in claim 1, wherein the current state information includes information describing a current usage state, a location state, and an environmental state of the electronic device.
  10. A sleep prediction device applied to an electronic device comprises:
    the acquisition module is used for acquiring the current state information of the electronic equipment;
    the determining module is used for determining the current use scene of the electronic equipment according to the current state information;
    and the prediction module is used for predicting the sleep of the user according to the pre-trained sleep prediction model corresponding to the current use scene to obtain a prediction result.
  11. A storage medium having stored thereon a computer program, wherein the computer program, when executed on a computer, causes the computer to perform a sleep prediction method as claimed in any one of claims 1 to 9.
  12. An electronic device comprising a memory, a processor, wherein the processor is configured to perform the sleep prediction method of any one of claims 1 to 9 by invoking a computer program stored in the memory.
CN201980080279.XA 2019-02-18 2019-02-18 Sleep prediction method, device, storage medium and electronic equipment Pending CN113164056A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/075356 WO2020168448A1 (en) 2019-02-18 2019-02-18 Sleep prediction method and apparatus, and storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN113164056A true CN113164056A (en) 2021-07-23

Family

ID=72143913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980080279.XA Pending CN113164056A (en) 2019-02-18 2019-02-18 Sleep prediction method, device, storage medium and electronic equipment

Country Status (2)

Country Link
CN (1) CN113164056A (en)
WO (1) WO2020168448A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200302228A1 (en) * 2019-03-20 2020-09-24 Tata Consultancy Services Limited System and method for signal pre-processing based on data driven models and data dependent model transformation
CN113420740A (en) * 2021-08-24 2021-09-21 深圳小小小科技有限公司 Control method of smart home, electronic device and computer readable medium
CN114027795A (en) * 2021-11-11 2022-02-11 展讯半导体(南京)有限公司 Infant sleep state monitoring method and device, terminal device and readable storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111887830B (en) * 2020-09-10 2023-03-10 贵州省人民医院 Sleep monitoring method, device, equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105323384A (en) * 2015-11-25 2016-02-10 上海斐讯数据通信技术有限公司 Method for switching multi-scenario mode and mobile terminal
CN107567083A (en) * 2017-10-16 2018-01-09 北京小米移动软件有限公司 The method and apparatus for carrying out power saving optimization processing
CN107861605A (en) * 2017-11-06 2018-03-30 北京小米移动软件有限公司 Data processing method and device
CN108536099A (en) * 2018-02-26 2018-09-14 维沃移动通信有限公司 A kind of information processing method, device and mobile terminal
CN108937861A (en) * 2018-06-06 2018-12-07 姜涵予 A kind of dormant method and device of evaluation and test
KR20180135210A (en) * 2017-06-12 2018-12-20 을지대학교 산학협력단 Sleep education system and method for the same

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3632322A4 (en) * 2017-06-02 2020-06-03 Keio University Sleep determining device, sleep determining method, and sleep determining program
US10632278B2 (en) * 2017-07-20 2020-04-28 Bose Corporation Earphones for measuring and entraining respiration
CN107943266A (en) * 2017-11-20 2018-04-20 北京小米移动软件有限公司 power consumption control method, device and equipment
CN107995676A (en) * 2017-11-24 2018-05-04 北京小米移动软件有限公司 terminal control method and device
CN108965605A (en) * 2018-07-27 2018-12-07 南昌黑鲨科技有限公司 The control method and device of smart phone

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105323384A (en) * 2015-11-25 2016-02-10 上海斐讯数据通信技术有限公司 Method for switching multi-scenario mode and mobile terminal
KR20180135210A (en) * 2017-06-12 2018-12-20 을지대학교 산학협력단 Sleep education system and method for the same
CN107567083A (en) * 2017-10-16 2018-01-09 北京小米移动软件有限公司 The method and apparatus for carrying out power saving optimization processing
CN107861605A (en) * 2017-11-06 2018-03-30 北京小米移动软件有限公司 Data processing method and device
CN108536099A (en) * 2018-02-26 2018-09-14 维沃移动通信有限公司 A kind of information processing method, device and mobile terminal
CN108937861A (en) * 2018-06-06 2018-12-07 姜涵予 A kind of dormant method and device of evaluation and test

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200302228A1 (en) * 2019-03-20 2020-09-24 Tata Consultancy Services Limited System and method for signal pre-processing based on data driven models and data dependent model transformation
US11443136B2 (en) * 2019-03-20 2022-09-13 Tata Consultancy Services Limited System and method for signal pre-processing based on data driven models and data dependent model transformation
CN113420740A (en) * 2021-08-24 2021-09-21 深圳小小小科技有限公司 Control method of smart home, electronic device and computer readable medium
CN113420740B (en) * 2021-08-24 2021-12-03 深圳小小小科技有限公司 Control method of smart home, electronic device and computer readable medium
CN114027795A (en) * 2021-11-11 2022-02-11 展讯半导体(南京)有限公司 Infant sleep state monitoring method and device, terminal device and readable storage medium

Also Published As

Publication number Publication date
WO2020168448A1 (en) 2020-08-27

Similar Documents

Publication Publication Date Title
CN108764304B (en) Scene recognition method and device, storage medium and electronic equipment
CN113164056A (en) Sleep prediction method, device, storage medium and electronic equipment
CN109863721B (en) Digital assistant extended automatic ranking and selection
US20190354809A1 (en) Computational model management
US10673707B2 (en) Systems and methods for managing lifecycle and reducing power consumption by learning an IoT device
AU2016256764B2 (en) Semantic natural language vector space for image captioning
EP3467723A1 (en) Machine learning based network model construction method and apparatus
CN107943582B (en) Feature processing method, feature processing device, storage medium and electronic equipment
KR20200052448A (en) System and method for integrating databases based on knowledge graph
US11966831B2 (en) Feedback mechanisms in sequence learning systems with temporal processing capability
US11551093B2 (en) Resource-aware training for neural networks
CN109784133B (en) Action evaluation model generation device and action evaluation model generation method thereof
CN111512299A (en) Method for content search and electronic device thereof
CN108806699B (en) Voice feedback method and device, storage medium and electronic equipment
CN112997148A (en) Sleep prediction method, device, storage medium and electronic equipment
CN113170018A (en) Sleep prediction method, device, storage medium and electronic equipment
CN108595013B (en) Holding recognition method and device, storage medium and electronic equipment
US11733666B2 (en) Smart home bubble creation
CN111159481B (en) Edge prediction method and device for graph data and terminal equipment
CN107861769B (en) Application cleaning method and device, storage medium and electronic equipment
Mojarad et al. Context-aware adaptive recommendation system for personal well-being services
Jeon et al. Ontology-based user intention recognition for proactive planning of intelligent robot behavior
CN116415624A (en) Model training method and device, and content recommendation method and device
CN107766105B (en) Application cleaning method and device, storage medium and electronic equipment
Za’in et al. Scalable teacher-forcing networks under spark environments for large-scale streaming problems

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