The invention relates to a control system and a control method based on sleep perception, which are applied for patent application number 202110701370.8, applied for day 2021, month 06 and 25, and applied for patent application type.
Detailed Description
The following detailed description refers to the accompanying drawings.
The invention provides a control system and a control method based on sleep perception, and also provides a self-defined control system based on respiratory rate and portable intelligent terminal equipment. The sleep perception-based control system provided by the invention can remove one or more types of noise and vibration information while keeping the respiratory information, so that the accurate information of the respiratory frequency is extracted.
The intelligent terminal equipment in the invention is a using equipment which has wireless access to the Internet, can process partial data, display and execute corresponding data function. The smart terminal device is, for example, a smart product such as a smart phone, an Ipad, a player, a computer, etc. capable of operating based on data instructions. The intelligent terminal equipment can be provided with a sound collecting device by itself or can be connected with the sound collecting device to collect breathing sounds of a user. The sound collection device is for example a microphone.
Preferably, a microphone of the intelligent terminal device is coupled with a loudspeaker device, so that breathing information of a user can be further clearly acquired.
The processor of the present invention represents one or more general-purpose devices such as microprocessors, central Processing Units (CPUs), application specific integrated chips, and the like.
The breathing information of the present invention is breathing sound information such as breathing sounds, snoring sounds, etc. The respiratory rate information refers to the rate at which a user completes a breath, and the period refers to the time it takes for the user to complete a breath.
The control system based on sleep perception can be installed and operated in intelligent terminal equipment or establish data connection with the intelligent terminal equipment.
The breathing of a user differs from other noise in that the sound of breathing is periodic, regular, and the breathing frequency is in a specific range. For example, the breathing rate varies between 0.15 and 0.4 times per second.
The acquisition module comprises a sound acquisition module and an acceleration sensor. The acquisition module is a part of intelligent terminal equipment. The acquisition module is capable of acquiring corresponding information based on instructions of the processor.
Preferably, the control system of the present invention further comprises a database. The database is used to store acquired respiratory information as well as time, store instructions associated with the neural network, and extract process data of respiratory rate from the respiratory information. The processor reads data from the database, or the processor sends the data in the processing process to the database for storage.
The database is preferably a memory. Memory represents any type or form of volatile or non-volatile storage device or medium capable of storing data and/or other computer-readable instructions. The memory includes, but is not limited to, RAM, ROM, flash memory, or any other suitable storage device. The memory can be coupled to the processor or can be arranged in signal connection with the processor.
Preferably, the processor may further comprise a memory control module, an input/output (I/O) controller, and a communication interface, each of which may be interconnected via a communication infrastructure.
Examples of communication infrastructure include, but are not limited to, communication buses (e.g., industry Standard Architecture (ISA), peripheral Component Interconnect (PCI), PCI Express (PCIe), or similar buses) and networks.
I/O controllers represent any type or form of module capable of coordinating and/or controlling the input and output functions of a computing device. The I/O controller may control or facilitate the transfer of data between one or more elements of the processor.
A communication interface represents any type or form of communication device or adapter capable of facilitating communication between a processor and one or more additional devices.
Fig. 1 is a schematic diagram of an embodiment of a control system according to the present invention. As shown in fig. 1, the sleep perception based control system includes at least a processor 20. The processor 20 is connected to the acquisition modules 10, the database 21, and the functional module 30, respectively, to enable transmission of data information and instructions. The database 21 may drive and store data information by a storage drive such as a floppy disk drive, a magnetic tape drive, an optical disk drive, a flash memory drive, or the like.
Preferably, the intelligent terminal device is provided with a terminal display module. The terminal display module is connected with the processor in a wired or wireless mode, and the terminal display module is connected with the acquisition module in a data mode. And the terminal display module sends the control instruction to the functional module. The terminal display module can display the acquired information such as movement information, respiratory frequency information, sleep time, first time, second time, stimulation information micro-change mode, closing or pause time and the like. The terminal display module can display information in various modes such as charts or curves.
The functional module of the invention is a module which is arranged in the intelligent terminal equipment and can be used for adjusting and opening and closing various execution functions based on instructions of a processor. The functional modules are, for example, several modules such as an audio player, a video player, a power on/off module, a lamp adjusting and on/off module, and on/off and adjusting of each application module.
As shown in fig. 1, the sleep perception based control system of the present invention includes at least a processor configured to:
receiving sound information acquired by at least one audio acquisition module;
at least one breathing frequency information is extracted from the sound information,
Identifying a sleep state based on the extraction model and the respiratory frequency information;
And sending preset instruction information to at least one associated functional module in the appointed sleep state.
The respiratory frequency information extraction model can be simply called as an extraction model, is established based on a deep learning model and is used for extracting respiratory frequency information. The deep learning model is, for example, a convolutional neural network model.
Preferably, an analog filter is further arranged in the processor and is used for amplifying the received breathing information, so that the missing breathing sound with smaller sound is avoided.
Preferably, an acceleration sensor in the intelligent terminal device is connected to the processor and collects movement signals of the intelligent terminal device. The movement signal includes a movement speed of the audio-video in the three-dimensional space.
The processor extracts respiratory rate information from the amplified sound information. The processor eliminates noise and audio/video sounds without periodicity from the sound information to obtain respiration information with periodicity.
Preferably, the processor is further provided with an analog gain module, which is used for covering the breathing range by an analog gain of 10-100 times. Preferably, the processor is also capable of interfacing hardware that implements a gain, such as a filter, to limit the frequency response of the signal to a respiratory frequency range.
Preferably, the analog gain module sends the filtered breathing information to the extraction module.
The mode of the analog filter in the processor for linearly filtering the sound information is as follows:
The signal quality for linear filtering, y [ n ], is determined by the error sequence, e [ n ] = d [ n ] -y [ n ]. Where n represents the frequency of the mixed sound and m represents the sound exceeding the specified frequency range. Omega m denotes the weight and x denotes the acquired data value.
Preferably, the weights are selected to obtain a minimum mean square error in the following manner:
E{e2[n]}=E{d[n]-y[n]2}
The way to calculate the selection weights for the linear filtering is:
according to the orthogonality principle, when the error e [ n ] and the data value are zero, the following is obtained:
E{x[n-k](d[n]-y[n])}=0,k=0,1,...,M-1
the effect of the linear filtering is optimal at this time.
Preferably, the weight module in the processor can also obtain the correct weight through training based on a training algorithm.
After the processor filters the acquired original sound information to eliminate noise caused by audio/video or other sounds, the respiratory information formed after the filtering is extracted in respiratory frequency. The respiratory information at this time is not completely noiseless and contains a small portion of noise, so the extraction module is required to perform further extraction based on a deep learning algorithm.
Preferably, the manner in which the processor extracts the respiratory rate information includes:
a respiratory frequency information extraction model is established,
Comparing the first respiration rate extracted by the respiration rate information extraction model with the verifiable respiration rate of the first test object to calculate an error;
Front-end parameters of one or more layers of the extraction model are reversely adjusted based on the calculation errors to improve prediction accuracy of the extraction model.
After acquiring the respiratory rate information, the processor determines whether the user enters a sleep state or not, and even determines which stage of the sleep stage the user enters, based on the respiratory rate information.
Preferably, the respiratory information signal has the following relation:
The respiratory information signal, after being brought in by the transmission delay information, is expressed as:
Finally, the relationship of the mixed acquired respiratory information received by the acquisition module is as follows:
Wherein the frequency f b is directly related to the distance between the object and the acquisition module and the distance b is related to the speed of the object. The frequency f b and the distance b are calculated by a fourier transform algorithm.
For the vital signs of the user, the frequency f b can be used to determine the distance interval of the user, and the distance b can reflect the displacement change of the user's sound source.
Preferably, the processor is capable of de-manizing the data of the respiratory information prior to extracting the respiratory rate. For example, normalization is performed by the equation f (x) = (x- μ)/σ, where μ represents the average value of the waveform and σ represents the standard deviation.
Other components in the sound information signal and unwanted frequencies can also be removed by de-noising the received respiratory information. For example, the breathing rate varies between 0.15 and 0.4 per second. Other frequencies not in the respiratory frequency range can be eliminated.
In the extraction model, the convolutional neural network model can be a two-layer convolutional model and can be expanded to more than two layers.
Each convolution layer includes a one-dimensional convolution layer and a pooling layer. The one-dimensional convolution layer effectively derives notable features from shorter segments of the entire dataset, and the locations of the features in the segments are not highly correlated. The one-dimensional convolution layer can export any type of signal data within a fixed length period, and thus can improve the efficiency of data screening and export. Thus, convolutional neural networks are trained using one-or two-dimensional convolutional layers at each layer. Pooling processing by the pooling layer after convolutional layer data processing can reduce the complexity of the output and prevent data overfitting.
Preferably, the size of the pooling layer is set to 3 to indicate that the size of the output matrix is only one third of the input matrix. The pooling layer is to reduce the input size by mapping the size of the defined window to a single result by taking the maximum of the elements in the window.
The processor is configured to:
And discretizing the waveform information of the input three-dimensional training extraction model, thereby improving the signal-to-noise ratio.
The data fitting of the respiration information can reduce the influence of small fluctuations in the data on the extraction model, and the small fluctuations are noise in general.
Preferably, the processor is further configured to:
the data output by the convolutional layer is directed to an average pooling layer. The average pooling layer is another pooling layer for avoiding overfitting. The averaging pooling layer transforms the matrix of convolutional network outputs into a single vector.
In the invention, the processor adjusts and controls the functional module according to the preset instruction after determining that the user enters the sleep state.
Preferably, the extraction model in the processor compares the extracted respiratory rate information with the respiratory rate samples, and on the basis that the respiratory rate samples are correspondingly associated with the sleep states, the processor obtains the corresponding sleep states according to the respiratory rate information.
The breath frequency samples in the present invention include an initial frequency sample and a personalized frequency sample. The initial frequency samples are set based on sample set data associated with sleep states for respiratory frequency characteristics of the population.
The personalized frequency sample is formed by personalized adjustment of the initial frequency sample based on the personalized breathing characteristics of the user, so that information related to the personalized frequency sample and the sleep state is formed.
Preferably, the initial frequency sample and sleep state related information in the extraction model are preset, and can be provided by a third-party data platform, or can be learned and obtained based on a deep learning model in advance according to sleep experiments of a plurality of sample groups.
The initial frequency samples are associated with sleep states as follows:
In the different sleep stages, there is a significant difference in the respiratory rate of the sleep state of the user, in the rapid eye movement sleep stage (REM), the brain wave changes rapidly, and the sleeper often has rapid eye jump phenomenon and dreams in the stage, so the respiratory rate of the sleeper is often unstable in the stage. During the light sleep stage (LIGHT SLEEP), the eye jump stops and the sleeper's breathing rate stabilizes. During the deep sleep stage (DEEP SLEEP), the sleeper's breathing rate is further slowed. Therefore, the magnitude of the breathing rate varies with the stage of sleep in which the sleeper is positioned.
The sound collection module collects breathing sound data according to the sampling frequency of 8KHz, and the breathing sound data is divided into N groups of data according to every 400 sample points. N represents the number of groups of sample points sampled, the sampling frequency being 8kHz. The time interval of 400 sample points is 0.05s.
After the voice of the audio and the video is filtered through linear filtering and respiratory information is formed, the respiratory frequency information is extracted according to the extraction model.
The invention does not need to monitor the sleep state of the user in the whole process, and can close the appointed functional module only by determining that the user enters the sleep state initial stage. However, how to accurately determine that the user enters the sleep state only through analysis of the breathing sounds, and to turn off the functional module that plays in a manner that does not affect the user's sleep feel, is important and difficult in the prior art.
When the user enters a sleep state and closes the function module, particularly when the audio and video which the user is watching or listening to are closed, if the user enters the sleep state only quickly if the user closes too early, the user can wake up due to environmental change due to the closing of the function module, and the reaction effect is achieved. If the switch-off is too late, the function of the sleep perception control function module is lost.
Based on this deficiency, the processor tests the user's perception level in a sleep state in a test mode. And controlling the functional module when the perception level of the user is reduced to a preset level. The invention tests the perception level of the user through the test mode so as to regulate and control the functional module in a mode of not influencing the sleeping feeling of the user, and even close the functional module.
The test mode in the invention tests the perception level of the user in a mode of micro-variation of the stimulus information. The stimulus in the invention refers to the stimulus of the modes of sound stimulus, visual stimulus, playing progress stimulus, playing content change and the like which are presented by the intelligent terminal equipment when the user uses the function module. Whereas the user of the present invention is in a sleep state or near sleep state, the micro-variation of the stimulus information in the present invention means a sensory stimulus that does not stimulate the user to be awake. The micro-change of the stimulus information is to finely adjust and change the stimulus applied by the functional module, and new stimulus is not added to avoid waking up the user.
Preferably, the implementation of the micro-variation of the stimulation information of the processor includes at least the following.
After judging that the user enters a sleep state based on the respiratory frequency information, the processor reduces the playing volume of the current functional module for the first time according to the limiting volume difference value, and under the condition that the intelligent terminal equipment does not detect any input instruction information within the first limiting time after the playing volume is reduced, the processor gradually reduces the playing volume in a step volume mode, and directly closes the functional module when the playing volume is reduced to be within a closing threshold range. The stepwise decrease of the playing volume will not bring new stimulation information to the user.
When the user does not enter the sleep state completely, the perception capability of the user is strong, the experience is necessarily deteriorated due to the reduction of the playing volume, and the user can move the intelligent terminal equipment or input related instructions or action signals to check. When the processor detects a moving signal acquired by an acceleration sensor in the intelligent terminal device, or an action signal of related input equipment, or an input instruction, the processor controls the functional module to resume playing volume.
After the user enters a sleep state, the perception capability of the user is weakened, the processor reduces the playing volume of the current functional module for the first time by limiting the volume difference, the intelligent terminal device cannot be moved under the condition that the user does not perceive, or an input device cannot be used for inputting an action signal to check the change of the functional module, and an instruction cannot be input, so that the processor cannot receive a moving signal acquired by an acceleration sensor, or an action signal of a related input device, or an input instruction, at the moment, the processor can reduce the playing volume for the second time, and the processor can close or pause the currently-appointed functional module under the condition that no interference information is still received within the second limiting time.
In the present invention, the operation signal of the input device is, for example, a touch screen operation signal, a mouse movement signal, a keyboard operation signal, or the like. Input instruction refers to any input instruction information.
After determining that the user enters a sleep state based on the respiratory rate information, the processor detects a perception of the user in a manner in which the functional module is suspended. For example, the playing contents of the audio module and the video module are temporarily played, and the processor sends a preset control instruction to at least one functional module when no input instruction information is detected within a third limited time. The control instructions comprise instructions preset by a user for closing a specified functional module, suspending, shutting down and the like.
And if the movement information of the intelligent terminal equipment, any input instruction information and the action signal of the input equipment are detected within the third limiting time, the processor sends an instruction for recovering operation to the regulated functional module.
Preferably, the processor detects the perception of the user by at least once pausing the function module. Preferably, the processor detects the perception of the user by means of a two or three-time pause of the functional module.
After detecting the perception and detecting the user feedback by once pausing the function module, the processor again judges whether the user enters a sleep state based on the current respiratory frequency information. And repeating the sensing detection after the user enters the sleep state.
Preferably, the processor is further capable of detecting a perception of the user by altering the way the content is played after determining that the user enters a sleep state based on the respiratory rate information. Preferably, the processor alters the play content in accordance with a trend that aids sleep. For example, changing the playing music content to light music without lyric content which is helpful for sleeping, changing the playing video content to atmosphere-relaxing video content which is helpful for sleeping, such as news video, access video, and the like, which is not easy to cause sensory stimulation.
After changing the playing content, the processor sends a preset control instruction to at least one functional module under the condition that any input instruction information or moving signal is not detected within the fourth limiting time. The control instructions comprise instructions preset by a user for closing a specified functional module, suspending, shutting down and the like.
And if the movement information of the intelligent terminal equipment, any input instruction information and the action signal of the input equipment are detected within the fourth limiting time, the processor sends an instruction for recovering operation to the regulated functional module.
Preferably, in the case where the processor controls the function module to be suspended, the processor can control the function module to display a still picture or a problem. For example, the text content of the display screen is that the play function is about to be turned off, or the display screen is covered by using a certain screen. And under the condition that the user does not feed back any signal in the fifth limiting time, the processor judges that the user perception is weak and enters a sleep state, so that a preset control instruction is executed.
The stimulation information micro-variation according to the present invention is not limited to the above-described modes, and can be implemented to achieve the same effect.
The test mode of the invention can also be used for adaptively adjusting the initial frequency sample of the breathing frequency to form a personalized frequency sample.
The processor can take the breathing frequency when the user feedback signal is not received as a personalized frequency sample of the user after the functional module is subjected to the control of the stimulation information micro-variation in the time period when the control system is used for the first time.
Along with the extension of the use time of the user and the increase of the detection times, the processor can extract and update the breathing frequency information which enters the sleep state when the user uses the functional modules of various types into personalized frequency samples, and store the personalized frequency samples at the same time, so that the personalized frequency samples in the database are more and more abundant. When the processor compares the extracted respiratory frequency information with the personalized frequency sample, the accuracy of judging whether to enter a sleep state is higher and higher, and forward circulation is formed.
After the control system is turned on, the processor sends instructions to the sound collection module to collect sound information and to the acceleration sensor to collect movement information. The processor receives the collected sound information and the mobile information of the intelligent terminal equipment.
The processor of the invention can also be a cloud server connected with the intelligent terminal equipment through a network. The control system is connected with the intelligent terminal equipment, the sound information and the movement information are collected by utilizing the components of the intelligent terminal equipment on the basis of not adding new hardware, and the perception of a user is detected based on the micro-change of the stimulus information of the functional module, so that the functional module can be controlled in a preset mode at proper time to save energy consumption and improve the sleeping quality of the user.
In the present invention, the breathing information includes an expiration sound, an inspiration sound and a snore sound. Snoring and breathing sounds share some common characteristics, and breathing sounds and snoring sounds share a similarity in waveform, both have periodicity, except that snoring sounds are larger than the average amplitude of the breathing sounds, since snoring sounds are generally larger than breathing sounds. The spectrograms show that the frequency distribution of the snore and the breathing sound are obviously different, the frequency distribution of the snore is concentrated in the low frequency range from 0Hz to 1000Hz, and the breathing sound is more distributed in the low frequency range and the high frequency range, so that whether the collected sound sample contains the snore or not can be judged according to the ratio of the low frequency range to the high frequency range.
Judging the existence of snore by utilizing the frequency range of the dominant position of the current respiratory sound, wherein f is used for representing a sound frame to be detected containing n sample points, s i is used for representing the ith data value after f is subjected to Fourier change, and then the ratio of a low frequency band to a high frequency band is expressed as follows:
when the user turns to snore from the normal breathing state, the sound frequency band gradually inclines to a low frequency, and the A (f) value gradually increases. By analyzing more than 100 different users' snoring data, it is defined that when the ratio of low frequency to high frequency becomes larger gradually and A (f) >1.5, the current user is in a snoring state, and otherwise, the current user is in a normal breathing state. I.e. when a (f) >1.5, it is determined that the user is snoring.
Preferably, since the processor of the present invention is able to distinguish snoring based on the above distinction. The processor of the present invention can also be configured to:
Under the condition that the processor determines that the user enters a sleep state and detects snore, the processor directly controls the functional module according to a preset instruction, and sleep perception detection is not carried out on the user. For example, some users will snore when they enter a sleep state, and at this time, sensory detection is not required for the users, and the processor can control the functional module to be directly turned off or paused, so as to avoid the functional module from continuously releasing the stimulation information to disturb the sleep of the users.
And under the condition that the processor determines that the user enters a sleep state and snore is not detected, the processor detects the micro change of the stimulus information of the user to detect the perception of the user, and under the condition that the perception of the user is weaker, the processor controls the functional module.
Preferably, the level of sleep perception of the present invention can be divided based on feedback of the user on the small changes in the stimulus information.
For example, the processor determines that the user is to enter a sleep state based on the respiratory frequency information. When the stimulus information is sound change, if the intensity of the sound is reduced by a first step range, the user does not have any feedback information or feedback action, and the sensory level of the user is first-order. When the user is detected to enter the sleep state for the second time, if the user does not have any feedback information or feedback action when the intensity of the sound is reduced by a second step range, the sensory level of the user is secondary, namely the sense is further weakened. The second step range is greater than the first step range. The first step range is 0-5 degrees, and the second step range is 5-10 degrees.
By the above way, the perception level of the user can be divided into a plurality of levels, and the specific division range and the level setting can be flexibly adjusted as required.
Preferably, the processor uses the mixed micro-variations of the stimulus information to determine the user's perception level. For example, for a video module that is played, the processor detects the perception of the user for the first time by masking the playing frame and not changing the sound. If the user does not have any feedback on the micro-variation of the first stimulus information, the sensory level is of the first order.
After the first stimulus micro-variation, the processor detects the perception level of the user a second time by controlling the sound of the video module, e.g. changing the intensity of the sound. If the user does not have any feedback on the micro-variation of the second stimulus information, the sensory level is of the second order.
After the second stimulus is slightly varied, the processor detects the perception level of the user for the third time by changing the sound content of the play content. Sound content such as volume video is replaced with song content. If the user does not have any feedback on the micro-change of the third stimulus information, the sensory level is three-level.
Obviously, in terms of sensory intensity, the primary sensory intensity corresponding to the primary sensory level is greater than the secondary sensory intensity, and the secondary sensory intensity is greater than the tertiary sensory intensity. When the sleep sensory level of the user enters the secondary or tertiary sensory intensity, the processor sends a pause or shut-off instruction to the video module.
As shown by way of example, the present invention is also capable of controlling the micro-variation of stimulus information from multiple aspects to form a detection of user perception. The invention aims to detect the perception of the micro-change of the stimulus information without disturbing the sleeping of a user.
Preferably, the processor determines at which level of sensory level to shut down or suspend operation of the functional module based on the sensory level of the user and corresponding feedback information.
For example, for a perception level, the user always has feedback on the detection of the primary sense during a first time period and no feedback on the detection of the secondary sense during a second time period. The processor adjusts based on the user's usage personalization. Starting timing after entering sleep state, and performing primary sensory detection when the first time is satisfied. And if the feedback is not performed in the preset feedback time, the processor performs secondary sensory detection when the second time is met. If the user has no feedback after the preset feedback time, the processor confirms that the sleep perception of the user is enough, and sends a closing or suspending instruction to the functional module. Wherein the second time period is longer than the first time period.
If the user has no feedback after the first time is met for a long time and the execution times exceed the preset times threshold, the processor can send a closing or suspending instruction to the functional module after the first-level sensory detection is completed and the feedback time is not preset.
If the user closes the functional module after the second time is met for a long time and the ratio of the execution times of the first-level sensory closing exceeds the preset ratio, the processor can skip the first-level sensory detection, directly perform the second-level sensory detection and control the functional module to be closed.
Therefore, the invention can reduce the influence on the sleep of the user under the condition of reducing the sensory stimulus, and simultaneously determines the perception attenuation degree of the user through the judgment of the respiratory frequency information and the sleep perception of the user, so that the pause or the closing of the functional module has no influence on the sleep of the user.
Preferably, when the respiratory rate information is completely strange respiratory rate information, the processor may store the new respiratory rate information and the determination result of the sleep state into the new account by establishing the new account, so as to facilitate the user to distinguish, and execute the control function of the preset function module.
It should be noted that the above-described embodiments are exemplary, and that a person skilled in the art, in light of the present disclosure, may devise various solutions that fall within the scope of the present disclosure and fall within the scope of the present disclosure. It should be understood by those skilled in the art that the present description and drawings are illustrative and not limiting to the claims. The scope of the invention is defined by the claims and their equivalents.
The present specification contains several inventive concepts, and applicant reserves the right to issue a divisional application according to each of the inventive concepts. The description of the invention encompasses multiple inventive concepts, such as "preferably," "according to a preferred embodiment," or "optionally," all means that the corresponding paragraph discloses a separate concept, and that the applicant reserves the right to filed a divisional application according to each inventive concept.