Summary of the invention
Embodiment of the present invention is designed to provide a kind of quarter-bell control method, terminal device and storage medium, so that
Alarm mode more agrees with the sleep state of user, experience of preferably getting up to user.
In order to solve the above technical problems, embodiments of the present invention provide a kind of quarter-bell control method, including following step
It is rapid:
Detect the sleep state in the user of preset time, wherein the time difference of preset time and alarm time is less than default
Duration, and preset time is earlier than alarm time;According to the corresponding relationship of preset sleep state and alarm mode, obtains and detect
The corresponding alarm mode of the sleep state of the user arrived;When detecting current time is alarm time, with the quarter-bell of acquisition
Mode carries out quarter-bell.
Embodiments of the present invention additionally provide a kind of terminal device, comprising: at least one processor;And at least
The memory of one processor communication connection;Wherein, memory is stored with the instruction that can be executed by least one processor, instruction
It is executed by least one processor, so that at least one processor is able to carry out such as above-mentioned quarter-bell control method.
Embodiments of the present invention additionally provide a kind of computer readable storage medium, are stored with computer program, calculate
Machine program realizes above-mentioned quarter-bell control method when being executed by processor.
Embodiment of the present invention in terms of existing technologies, by detect preset time user sleep state,
So that the sleep state of system available user before alarm time, and due to the time difference of preset time and alarm time
User's sleep state less than preset duration, the user's sleep state and alarm time that may make preset time is essentially identical;It is logical
The corresponding relationship according to preset sleep state and alarm mode is crossed, is obtained corresponding with the sleep state of the user detected
Alarm mode so that alarm mode is no longer unalterable, but follows the sleep state of user to change and change, so that noisy
Bell mode more agrees with the sleep state of user, experience of preferably getting up to user.
In addition, detection is specifically included in the sleep state of the user of preset time: in preset time detection terminal device
State and environmental noise;The sleep state of user is determined according to the state of terminal device and environmental noise.The state of terminal device
It can reflect whether user wake up, the size of environmental noise can reflect the size for the sound that user issues, to reflect use
The Depth of sleep at family can effectively determine the sleep state of user, and this inspection according to the state of terminal device and environmental noise
Survey method is easy to implement without the change on hardware.
In addition, sleep state, includes at least deep sleep;It is determined and is used according to the state of terminal device and environmental noise
The sleep state at family, specifically: if the state of terminal device is to put out screen state and environmental noise to be greater than the first preset threshold, really
The sleep state for determining user is deep sleep.Due to when user is in deep sleep, being frequently accompanied by snoring, mill
Phenomena such as tooth, breathing weight, certain environmental noise can be generated, put out screen state when terminal device is in, showing user, there is no right
Mobile phone is operated, and is detected that the state of terminal device is to put out screen state and environmental noise to be greater than the first preset threshold, can be sentenced
Determine user and is in deep sleep.
In addition, alarm mode corresponding with above-mentioned deep sleep is shaken when being included in quarter-bell.When user is in
Relatively low to the reactivity of environmental stimuli when deep sleep, vibration is carried out in quarter-bell can preferably stimulate user to wake up
Come.
In addition, above-mentioned sleep state, includes at least awake state;It is determined and is used according to the state of terminal device and environmental noise
The sleep state at family, specifically: if the state of terminal device is bright screen state, it is determined that the sleep state of user is shape of wakeing up
State.Terminal device is in bright screen state, shows user just in operating terminal equipment, user is awake at this time, therefore, be can determine that
The state of user is awake state.
In addition, in the above correspondence relationship, the quarter-bell volume in the corresponding alarm mode of different sleep states is different.By
Under different sleep states, user is different to the reactivity of environmental stimuli, and different quarter-bell volumes, which is arranged, preferably to stimulate
User is awake.
In addition, quarter-bell is carried out with the alarm mode of acquisition, specifically: quarter-bell is started with default volume, and is stepped up sound
Amount is until reach the quarter-bell volume of alarm mode.Quarter-bell is carried out in a manner of being stepped up volume, can prevent user from being sent out suddenly
Ring of alarm clock out is waken up with a start, experience of preferably getting up to user.
In addition, in the above correspondence relationship, the melody in the corresponding alarm mode of different sleep states is different.Needle
Different melodies, which is arranged, to different sleep states can promote user experience.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention
Each embodiment be explained in detail.However, it will be understood by those skilled in the art that in each embodiment party of the present invention
In formula, in order to make the reader understand this application better, many technical details are proposed.But even if without these technical details
And various changes and modifications based on the following respective embodiments, the application technical solution claimed also may be implemented.With
Under the division of each embodiment be for convenience, any restriction should not to be constituted to specific implementation of the invention, it is each
Embodiment can be combined with each other mutual reference under the premise of reconcilable.
The first embodiment of the present invention is related to a kind of quarter-bell control methods.In present embodiment, detect in preset time
User sleep state, wherein the time difference of preset time and alarm time is less than preset duration, and preset time is earlier than quarter-bell
Time;According to the corresponding relationship of preset sleep state and alarm mode, obtain opposite with the sleep state of the user detected
The alarm mode answered;When detecting current time is alarm time, quarter-bell is carried out with the alarm mode of acquisition.By in quarter-bell
Before time point, the sleep state of user is obtained, and different alarm modes is set according to the different sleep states of user, can made
Obtaining user has experience of preferably getting up.The realization details of the quarter-bell control method of present embodiment is carried out specifically below
Bright, the following contents only for convenience of the realization details provided is understood, not implements the necessary of this programme.
Quarter-bell control method in present embodiment is as shown in Figure 1, specifically include:
Step 101: detecting the sleep state in the user of preset time.
Specifically, the time difference of preset time and alarm time is less than preset duration, and the preset time is earlier than described
Alarm time.For example, alarm time is 8:00, preset duration is 1 minute, then preset time is 7:59, and terminal device is in 7:59
When, start the sleep state for detecting user.
Step 102: according to the corresponding relationship of preset sleep state and alarm mode, the user's that obtains and detect sleeps
The corresponding alarm mode of dormancy state.
Specifically, sleep state includes multiple states such as deep sleep, hypophypnosis state, awake state, root
According to different sleep states, different alarm modes can be preset, terminal device is according to preset sleep state and quarter-bell mould
The corresponding relationship of formula obtains alarm mode corresponding with the sleep state of the user detected in step 101, quarter-bell here
Whether mode shakes etc. when including the music of quarter-bell, quarter-bell volume, quarter-bell.
In actual implementation, the quarter-bell volume in the corresponding alarm mode of different sleep states is different, and quarter-bell
Mode is to start quarter-bell with default volume, and be stepped up volume until reaching the quarter-bell volume of the alarm mode.For example,
The attainable max volume of terminal device is 100, and the quarter-bell volume in preset alarm mode is 40, quarter-bell mould in the present embodiment
Formula are as follows: in 5 seconds, quarter-bell volume is gradually risen from 10 to 40.Since under different sleep states, user is to the anti-of environmental stimuli
Answering property is different, and different quarter-bell volumes, which is arranged, can preferably stimulate user awake.Quarter-bell is carried out in a manner of being stepped up volume,
The ring of alarm clock that can prevent user from being issued suddenly is waken up with a start, experience of preferably getting up to user.
In addition, the corresponding melody of different sleep states can also be different, for example, melody can be divided into the type of releiving and
Cheerful and light-hearted type, when the sleep state for detecting user is deep sleep, sound of the terminal device from preset type music of releiving
A piece of music is randomly choosed in happy list to play out, when the sleep state for detecting user is hypophypnosis state, terminal
Equipment randomly chooses a piece of music from the music list of preset cheerful and light-hearted type music and plays out, wherein in music list
Music can be by user setting.Different melodies, which is arranged, for different sleep states can promote user experience.
Step 103: when detecting current time is alarm time, quarter-bell being carried out with the alarm mode of acquisition.
Specifically, terminal device constantly detect current time whether be user setting alarm time, if so, root again
Quarter-bell is carried out according to the alarm mode of acquisition.
Present embodiment compared with the prior art for, by detect preset time user sleep state so that being
The sleep state of system available user before alarm time, and since the time difference of preset time and alarm time is less than in advance
If duration, user's sleep state of the user's sleep state and alarm time that may make preset time is essentially identical;Pass through basis
The corresponding relationship of preset sleep state and alarm mode obtains quarter-bell mould corresponding with the sleep state of the user detected
Formula so that alarm mode is no longer unalterable, but follows the sleep state of user to change and change, so that alarm mode
The sleep state for more agreeing with user, experience of preferably getting up to user.
Second embodiment of the present invention is related to a kind of quarter-bell control method.Second embodiment is big with first embodiment
It causes identical, is in place of the main distinction: in second embodiment of the invention, providing a kind of specific detection in preset time
User dormant method.The specific flow chart of present embodiment is as shown in Fig. 2, specifically described below.
Step 201: in the state and environmental noise of preset time detection terminal device.
Specifically, terminal device acquires environmental noise by main microphon and secondary microphone, and obtains in preset time
The state of terminal device.
Step 202: the sleep state of user is determined according to the state of terminal device and environmental noise.
Specifically, the state of terminal device can reflect whether user wake up, the size of environmental noise can reflect use
The size for the sound that family issues can have to reflect the Depth of sleep of user according to the state of terminal device and environmental noise
The sleep state for determining user is imitated, and this detection method is without the change on hardware, it is easy to implement.
In specific implementation, when the state for detecting terminal device is to put out screen state and environmental noise to be greater than the first default threshold
Value, it is determined that the sleep state of user is deep sleep.It is beaten due to being frequently accompanied by when user is in deep sleep
Snore grinds one's teeth in sleep, breathes phenomena such as weight, can generate certain environmental noise, puts out screen state when terminal device is in, shows user not
Have and mobile phone is operated, detects that the state of terminal device is to put out screen state and environmental noise to be greater than the first preset threshold, i.e.,
It can determine that user is in deep sleep.
It is noted that terminal device is carrying out quarter-bell Shi Huijin when detecting that user is in deep sleep
Row vibration.Relatively low to the reactivity of environmental stimuli when user is in deep sleep, vibration is carried out in quarter-bell can
Preferably stimulation user wakes up.
In addition, if the state of terminal device is bright screen state, it is determined that the sleep state of user is awake state.Terminal is set
It is standby to be in bright screen state, show user just in operating terminal equipment, user is awake at this time, therefore, can determine that the shape of user
State is awake state.When user is in awake state, settable terminal device does not issue music reminding in alarm time, thus
Avoid the normal use for bothering user to terminal device.
Step 203: according to the corresponding relationship of preset sleep state and alarm mode, the user's that obtains and detect sleeps
The corresponding alarm mode of dormancy state.
Step 204: when detecting current time is alarm time, quarter-bell being carried out with the alarm mode of acquisition.
Step 203 is roughly the same to step 103 with step 204 with the step 102 in first embodiment, to avoid weight
It is multiple, it no longer repeats one by one here.
In one example, the alarm time of user setting is 8:00 in morning, and in 7:59, terminal device begins through wheat
Gram wind detects environmental noise, when the volume for detecting environmental noise is 8, when being greater than preset threshold 5, determines that user sleeps in depth
Dormancy state, in 8:00, terminal device randomly chooses a piece of music from the music list for type music of releiving and plays out, and is playing
It is shaken while music, in 5 seconds, quarter-bell volume is gradually risen from 10 to preset quarter-bell volume 40, works as terminal device
When receiving the stopping quarter-bell operation of user, not re-ringing.
Present embodiment compared with the prior art for, provide the sleep of user of detection in preset time a kind of specific
The method of state.The state of terminal device can reflect whether user wake up, and the size of environmental noise can reflect that user issues
The size of sound can effectively be determined to reflect the Depth of sleep of user according to the state of terminal device and environmental noise
The sleep state of user, and this detection method is without the change on hardware, it is easy to implement.
The step of various methods divide above, be intended merely to describe it is clear, when realization can be merged into a step or
Certain steps are split, multiple steps are decomposed into, as long as including identical logical relation, all in the protection scope of this patent
It is interior;To adding inessential modification in algorithm or in process or introducing inessential design, but its algorithm is not changed
Core design with process is all in the protection scope of the patent.
Third embodiment of the invention is related to a kind of terminal device, as shown in figure 3, including at least one processor 301;With
And the memory 302 with the communication connection of at least one processor 301;Wherein, be stored with can be by least one for memory 302
The instruction that device 301 executes is managed, instruction is executed by least one processor 301, so that at least one processor 301 is able to carry out
The quarter-bell control method stated.
Wherein, memory 302 is connected with processor 301 using bus mode, and bus may include any number of interconnection
Bus and bridge, bus is by one or more processors 301 together with the various circuit connections of memory 302.Bus may be used also
With by such as peripheral equipment, voltage-stablizer, together with various other circuit connections of management circuit or the like, these are all
It is known in the art, therefore, it will not be further described herein.Bus interface provides between bus and transceiver
Interface.Transceiver can be an element, be also possible to multiple element, such as multiple receivers and transmitter, provide for
The unit communicated on transmission medium with various other devices.The data handled through processor 301 pass through antenna on the radio medium
It is transmitted, further, antenna also receives data and transfers data to processor 301.
Processor 301 is responsible for management bus and common processing, can also provide various functions, including timing, periphery connects
Mouthful, voltage adjusting, power management and other control functions.And memory 302 can be used for storage processor 301 and execute
Used data when operation.
Four embodiment of the invention is related to a kind of computer readable storage medium, is stored with computer program.Computer
Above method embodiment is realized when program is executed by processor.
That is, it will be understood by those skilled in the art that implement the method for the above embodiments be can be with
Relevant hardware is instructed to complete by program, which is stored in a storage medium, including some instructions are to make
It obtains an equipment (can be single-chip microcontroller, chip etc.) or processor (processor) executes each embodiment method of the application
All or part of the steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey
The medium of sequence code.
It will be understood by those skilled in the art that the respective embodiments described above are to realize specific embodiments of the present invention,
And in practical applications, can to it, various changes can be made in the form and details, without departing from the spirit and scope of the present invention.