Sleep detection method and device based on commercial WiFi, equipment and storage medium

By using a commercial WiFi multi-antenna array and a bidirectional long short-term memory neural network model with an attention mechanism, the problems of traditional detection affecting sleep quality and high radar detection costs are solved, achieving more accurate non-contact sleep stage identification.

CN115778321BActive Publication Date: 2026-03-24INST OF ADVANCED TECH UNIV OF SCI & TECH OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-16
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies cannot be widely applied and the analysis of sleep stage results is inaccurate. Traditional contact detection affects sleep quality, while radar detection is costly and complex to deploy.

Method used

A multi-antenna array based on commercial WiFi is used to receive radio frequency signals. Through channel state information processing and filtering smoothing, a bidirectional long short-term memory neural network model with attention mechanism is used to determine the sleep stage.

Benefits of technology

It reduced costs, improved the accuracy of non-contact sleep staging results, expanded the detection range of WiFi radio frequency signals, and achieved more accurate sleep stage identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115778321B_ABST
    Figure CN115778321B_ABST
Patent Text Reader

Abstract

The application discloses a sleep detection method and device based on commercial WiFi, equipment and storage medium, the method comprises the following steps: receiving radio frequency signals through a multi-antenna array arranged in a user sleep scene; obtaining channel state information of a plurality of subcarriers of each antenna, and constructing new channel state information according to the obtained channel state information; filtering and smoothing the new channel state information to obtain amplitude and phase information; processing the amplitude and phase information to obtain eigenvalue characteristics and the number of eigenvalue characteristics; inputting the eigenvalue characteristics and the number of eigenvalue characteristics into a constructed sleep stage detection model to obtain a sleep stage judgment result of a user. Since the application utilizes a multi-antenna array to realize spatial diversity, utilizes channel state information of a plurality of subcarriers to realize frequency diversity, and analyzes amplitude and phase information, compared with the prior art, the application not only reduces the cost, but also improves the accuracy of non-contact sleep detection stage results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wireless communication, and more particularly to a sleep detection method, apparatus, device, and storage medium based on commercial WiFi. Background Technology

[0002] In routine health monitoring and disease prevention and treatment, sleep is an important indicator reflecting an individual's physiological and psychological state. With the continuous development of Internet of Things (IoT) technology, many related technical solutions are constantly exploring intelligent sleep stage detection. Currently, traditional sleep detection mainly relies on contact sensors to detect human sleep states. However, physical contact can easily cause discomfort to the subject, directly affecting the sleep process and exacerbating poor sleep quality or insomnia.

[0003] To address this issue, existing non-contact sleep monitoring technologies can obtain sleep stage breakdowns throughout the night without requiring the subject to wear various cumbersome devices. While radar can collect data over a period of time, providing more accurate sleep-related indicators, its high cost, complex deployment, and high level of expertise limit its coverage in intelligent human detection and hinder its widespread application. Conversely, data collected using lower-cost devices cannot provide stable and accurate sleep stage analysis results.

[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is related technology. Summary of the Invention

[0005] The main objective of this invention is to provide a sleep detection method, device, equipment, and storage medium based on commercial WiFi, aiming to solve the technical problems of existing technologies being unable to be widely applied and the inaccuracy of sleep stage result analysis.

[0006] To achieve the above objectives, the present invention provides a sleep detection method based on commercial WiFi, the method comprising the following steps:

[0007] Radio frequency signals are received by a multi-antenna array pre-set in the user's sleep scenario, wherein the multi-antenna array contains multiple antennas;

[0008] Obtain the channel state information of multiple subcarriers corresponding to each antenna, and construct new channel state information based on all the obtained channel state information;

[0009] The new channel state information is filtered and smoothed to obtain amplitude and phase information;

[0010] The amplitude and phase information is preprocessed to obtain the principal component features and the number of principal component features;

[0011] The principal component features and their number are input into a pre-built sleep stage detection model to obtain the user's sleep stage judgment result.

[0012] Optionally, the pre-built sleep staging detection model is a bidirectional long short-term memory neural network model based on attention mechanism, constructed using a spatiotemporal joint analysis method.

[0013] Optionally, the step of obtaining channel state information of multiple subcarriers corresponding to each antenna and constructing new channel state information based on all the obtained channel state information includes:

[0014] The channel state information of one of the antenna subcarriers is selected as the reference information;

[0015] The channel state information of the subcarriers of other antennas is multiplied by the reference information by conjugate to obtain new channel state information.

[0016] Optionally, before the step of filtering and smoothing the new channel state information to obtain amplitude and phase information, the method further includes:

[0017] Differentiate the new channel state information within the first preset sleep period to obtain the offset of the new channel state information over time.

[0018] Based on the offset, extract the change in channel state information of sleep data over time during the first preset sleep period;

[0019] New channel state information for the second preset sleep period is generated based on the changes in the channel state information.

[0020] Optionally, the new channel state information is the new channel state information within the second preset sleep period, and the step of filtering and smoothing the new channel state information to obtain amplitude and phase information includes:

[0021] The new channel state information is smoothed using a Savitzy-Golay filter to obtain a first filtered signal with outliers removed.

[0022] The high-frequency variations in the first filtered signal are removed by a Butterworth low-pass filter to obtain the second filtered signal;

[0023] Amplitude and phase information are extracted from the second filtered signal.

[0024] Optionally, the amplitude and phase information includes amplitude information and phase information, and the step of preprocessing the amplitude and phase information to obtain principal component features and the number of principal component features specifically includes:

[0025] The correlation between the amplitude information and the phase information is analyzed using principal component analysis.

[0026] Based on the correlation, the amplitude information and the phase information are dimensionality reduced to obtain principal component features and the number of principal component features.

[0027] Optionally, the step of smoothing the new channel state information using a Savitzy-Golay filter to obtain a first filtered signal with outliers removed specifically includes:

[0028] New channel state information is obtained by sampling data within a preset time window using the Savitzy-Golay filter;

[0029] The sampled data is smoothed to obtain a first filtered signal with outliers removed.

[0030] Furthermore, to achieve the above objectives, the present invention also proposes a sleep detection device based on commercial WiFi, the device comprising:

[0031] The receiving module is used to receive radio frequency signals through a multi-antenna array pre-set in a user's sleep scenario, wherein the multi-antenna array contains multiple antennas;

[0032] The acquisition module is used to acquire the channel state information of multiple subcarriers corresponding to each antenna, and to construct new channel state information based on all the acquired channel state information.

[0033] The filtering module is used to filter and smooth the new channel state information to obtain amplitude and phase information;

[0034] The dimensionality reduction module is used to preprocess the amplitude and phase information to obtain the principal component features and the number of principal component features;

[0035] The judgment module is used to input the principal component features and the number of principal component features into a pre-built sleep stage detection model to obtain the user's sleep stage judgment result.

[0036] Furthermore, to achieve the above objectives, the present invention also proposes a sleep detection device based on commercial WiFi, the device comprising: a memory, a processor, and a sleep detection program based on commercial WiFi stored in the memory and executable on the processor, the sleep detection program based on commercial WiFi being configured to implement the steps of the sleep detection method based on commercial WiFi as described above.

[0037] Furthermore, to achieve the above objectives, the present invention also proposes a storage medium storing a sleep detection program based on commercial WiFi, wherein when the sleep detection program based on commercial WiFi is executed by a processor, it implements the steps of the sleep detection method based on commercial WiFi as described above.

[0038] This invention discloses a sleep detection method, apparatus, device, and storage medium based on commercial WiFi. The method includes: receiving radio frequency signals through a multi-antenna array pre-set in a user's sleep scenario, wherein the multi-antenna array contains multiple antennas; acquiring channel state information of multiple subcarriers corresponding to each antenna, and constructing new channel state information based on all acquired channel state information; filtering and smoothing the new channel state information to obtain amplitude and phase information; preprocessing the amplitude and phase information to obtain principal component features and the number of principal component features; and inputting the principal component features and the number of principal component features into a pre-constructed sleep stage detection model to obtain the user's sleep stage judgment result. Because this invention utilizes a multi-antenna array to achieve spatial diversity and utilizes the channel state information of multiple subcarriers corresponding to each antenna to achieve frequency diversity, it eliminates the phase offset problem in commercial WiFi hardware, expands the detectable range of WiFi radio frequency signals, and comprehensively analyzes amplitude and phase information, demonstrating the complementarity of information during feature selection. Compared with existing technologies, this invention not only reduces costs but also improves the accuracy of non-contact sleep stage detection results. Attached Figure Description

[0039] Figure 1 This is a schematic diagram of the structure of a sleep detection device based on commercial WiFi in the hardware operating environment of the embodiment of the present invention;

[0040] Figure 2 This is a flowchart illustrating the first embodiment of the sleep detection method based on commercial WiFi of the present invention.

[0041] Figure 3 This is a flowchart illustrating the second embodiment of the sleep detection method based on commercial WiFi of the present invention;

[0042] Figure 4 This is a flowchart illustrating the third embodiment of the sleep detection method based on commercial WiFi of the present invention.

[0043] Figure 5 This is a structural block diagram of the first embodiment of the sleep detection device based on commercial WiFi of the present invention.

[0044] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0045] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0046] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a sleep detection device based on commercial WiFi, which is part of the hardware operating environment involved in the embodiments of the present invention.

[0047] like Figure 1 As shown, the commercial WiFi-based sleep monitoring device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0048] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on commercial WiFi-based sleep detection devices and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0049] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a sleep detection program based on commercial WiFi.

[0050] exist Figure 1In the commercial WiFi-based sleep detection device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and memory 1005 in the commercial WiFi-based sleep detection device of the present invention can be set in the commercial WiFi-based sleep detection device, and the commercial WiFi-based sleep detection device calls the commercial WiFi-based sleep detection program stored in the memory 1005 through the processor 1001 and executes the commercial WiFi-based sleep detection method provided in the embodiment of the present invention.

[0051] This invention provides a sleep detection method based on commercial WiFi, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the sleep detection method based on commercial WiFi of the present invention.

[0052] In this embodiment, the sleep detection method based on commercial WiFi includes the following steps:

[0053] Step S10: Receive radio frequency signals through a multi-antenna array pre-set in the user's sleep scenario, wherein the multi-antenna array contains multiple antennas;

[0054] It should be noted that the executing entity in this embodiment can be a computing service device with signal receiving, signal processing, and program execution functions, such as a tablet computer or personal computer, or an electronic device capable of performing the same or similar functions, such as the one described above. Figure 1 The example shown is a sleep monitoring device based on commercial WiFi. The following uses a sleep monitoring device based on commercial WiFi as an example to illustrate this embodiment and the embodiments described below.

[0055] Understandably, a user's sleep scenario refers to the scene in which the subject of sleep monitoring sleeps within a certain time and space.

[0056] It should be noted that an antenna is a type of wireless device and also a converter. It transforms guided waves propagating on a transmission line into electromagnetic waves propagating in an unbounded medium (usually free space), or vice versa.

[0057] It should be understood that the aforementioned antenna array is a group of two or more antennas arranged according to certain rules or randomly. This embodiment and the following embodiments employ a four-antenna array, which combines signals to achieve higher performance than a single antenna. Antenna arrays can improve overall gain, achieve diversity reception, cancel interference, be tuned to a specific orientation, measure the source direction of the input signal, and maximize the signal-to-interference-to-noise ratio.

[0058] It should be noted that the above-mentioned radio frequency signals are WiFi data packets emitted by the same transmitting device. The transmitting device can be a commercial WiFi device or other transmitting devices. The following uses a commercial WiFi device as an example to illustrate this embodiment and the following embodiments.

[0059] In practical implementation, commercial WiFi devices emit WiFi data packets, i.e., the aforementioned radio frequency signals. A multi-antenna array records the variations experienced by these signals within the indoor environment, considering time, space, and frequency distribution. For example, the channel fading between the u-th receiving antenna and the s-th transmitting antenna in the multi-antenna array can be represented as… Where P represents the number of antenna pairs, β represents the channel attenuation coefficient, f represents the carrier frequency, d represents the propagation distance, and w represents the Doppler frequency shift in the time domain.

[0060] Step S20: Obtain the channel state information of multiple subcarriers corresponding to each antenna, and construct new channel state information based on all the obtained channel state information;

[0061] Understandably, a subcarrier is a concept from a spectral perspective. Due to the characteristics of electromagnetic waves, the frequency bands available for communication are very limited, and each system is granted a limited number of frequency bands. To serve more users, the system divides its total frequency band into several sub-bands, each of which is also called a subcarrier, and it determines the transmission rate of the modulated signal.

[0062] In the field of wireless communication, channel state information (CSE) refers to the channel attributes of a communication link. It describes the signal attenuation factors along each transmission path, i.e., the value of each element in the channel gain matrix, such as signal scattering, environmental attenuation, and distance attenuation. CSE enables communication systems to adapt to current channel conditions, ensuring high reliability and high speed in multi-antenna systems.

[0063] It should be noted that sleep detection devices based on commercial WiFi need to acquire the channel state information of the subcarriers of all antennas in a multi-antenna array that is pre-set in the user's sleep scenario. Based on the acquired channel state information of all subcarriers, processing is performed to eliminate phase offset and reduce the system error of the device itself to construct new channel state information.

[0064] In a practical implementation, a sleep detection device based on commercial WiFi acquires the channel state information of the subcarriers of all antennas in a pre-set antenna array with one transmitter and four receivers in a user's sleep scenario. By using conjugate multiplication between antenna pairs to eliminate phase offset, the device's own system error and signal noise are reduced. For the channel state information acquired from the radio frequency signals received by any two receiving antennas, a new channel state information for each subcarrier is constructed.

[0065] Step S30: Filter and smooth the new channel state information to obtain amplitude and phase information;

[0066] It should be noted that, in order to improve the accuracy of non-contact sleep staging results, the following step is included before step S30 in this embodiment:

[0067] Step S3001: Differentiate the new channel state information within the first preset sleep period to obtain the offset of the new channel state information over time;

[0068] It should be noted that in this embodiment and the following embodiments, the first preset time is the sleep time of the sleep monitoring subject for a whole night.

[0069] Understandably, differentiating the new channel state information within the first preset sleep period involves dividing the new channel state information of the sleep monitoring object throughout the entire night's sleep time according to a certain time window size. The device user can set the size of the aforementioned time window according to the actual situation. In this embodiment and the following embodiments, 30 seconds of data is used as the time window size for segmentation.

[0070] It should be noted that the above offset refers to the change in the new channel state information between the previous moment and the next moment.

[0071] Step S3002: Based on the offset, extract the channel state information change amount of sleep data over time during the first preset sleep period;

[0072] In practical implementation, the sleep detection device based on commercial WiFi extracts the change in channel state information of sleep data over time during the first preset sleep period based on the changes in new channel state information between the previous and next time moments. For example, the channel state information H(t,f) = e^(-t / t) for subcarrier f at time t. -jΦ(t) (H s +Ae -j2πd(t) / λ This function extracts the channel state information changes over time from the sleep data of a sleep monitoring subject throughout the night.

[0073] Step S3003: Generate new channel state information for the second preset sleep period based on the change in channel state information.

[0074] It should be noted that the second preset time period is a preset time window of new channel state information obtained by differentiating the new channel state information within the first preset sleep period. The size of the time window can be set by the device user according to the actual situation. The second preset time period can be 10 seconds, 30 seconds, 60 seconds, etc. In this embodiment and the following embodiments, 30 seconds is used as the second preset time period.

[0075] Understandably, filtering and smoothing refers to passing the new channel state information within the second preset sleep period through a filter to eliminate noise in the new channel state information within the second preset sleep period, remove outliers, and improve the accuracy of non-contact sleep detection staging results.

[0076] It should be noted that the channel state information of a subcarrier at a certain moment can yield amplitude and phase information, which are amplitude information and phase information.

[0077] In a specific implementation, the new channel state information within the first preset sleep period is differentiated to obtain the new channel state information within the second preset sleep period. Then, the new channel state information within the second preset sleep period is filtered and smoothed to eliminate noise and remove outliers, thereby obtaining amplitude and phase information.

[0078] Step S40: Preprocess the amplitude and phase information to obtain principal component features and the number of principal component features;

[0079] It should be noted that the above amplitude and phase information includes both amplitude and phase information.

[0080] Understandably, preprocessing amplitude and phase information is done to analyze their correlation and derive their main components.

[0081] It should be noted that the principal components mentioned above are the names of the main components of amplitude and phase information, and the number of principal components is the number of principal components corresponding to the above principal components.

[0082] To reduce the dimensionality of the channel state information dataset and better extract effective information about the state change characteristics of the sleep monitoring object, step S40 in this embodiment may specifically include:

[0083] Step S401: Analyze the correlation between the amplitude information and the phase information using principal component analysis.

[0084] Step S402: Based on the correlation, reduce the dimensionality of the amplitude information and the phase information to obtain the principal component features and the number of principal component features.

[0085] It should be noted that the channel state information of a single subcarrier at a given moment yields both amplitude and phase information. Since there are multiple subcarriers, the correlation between the amplitude information of these multiple subcarriers is analyzed to determine the principal component, and the amplitude information of the dominant subcarrier is selected. Similarly, the phase information is obtained in the same way.

[0086] Step S50: Input the principal component features and the number of principal component features into the pre-built sleep stage detection model to obtain the user's sleep stage judgment result.

[0087] It should be noted that bidirectional recurrent neural networks can link past information with future information through the current output. The bidirectional information feature can help analyze the relationship between the channel state information data at different times during the sleep state process.

[0088] Furthermore, the Long Short-Term Memory (LSTM) network model mainly includes an input gate, a forget gate, an output gate, and candidate memory units. The input gate I... t =sigmoid(x t w xt +h t-1 w ht +b i Forgotten Gate F t =sigmoid(x t w xf +h t-1 w hf +b f Output gate O t =sigmoid(x t w xo +h t-1 w ho +b o Candidate memory unit C t =tanh(x) t w xc +h t-1 w hc +b c ), where x t h represents the feature vector input in the current time window. t-1 w represents the hidden state of the window at the previous time step. xt w ht w xf w hf w xo w ho w xc whc Represents the weight parameter, b i b f b o b c This represents the bias parameter.

[0089] Furthermore, considering the temporality and complexity of the body activity data during sleep of the sleep monitoring subjects, the pre-constructed sleep staging detection model is a bidirectional long short-term memory neural network model based on the attention mechanism, constructed through spatiotemporal joint analysis.

[0090] A bidirectional long short-term memory neural network model based on an attention mechanism focuses on key actions and changes during training, such as large movements, prolonged stillness, and intermittent breathing apnea, to enhance the model's memory during dynamic change recognition. The attention mechanism autonomously identifies and allocates more weights to these key actions and changes. When the model encounters these characteristic actions again, it prioritizes them, narrowing the recognition range, and then adjusts the weight allocation based on the relationships between features for more accurate recognition. After converting initial state features to attention state features, the data is integrated through a fully connected layer and input into a Softmax classifier. This maps the outputs of multiple neurons to the (0, 1) interval, obtaining the probability of each category corresponding to the four sleep stages.

[0091] It should be noted that a user's sleep stages include: wakefulness, light sleep, deep sleep, and REM sleep. The pre-built sleep stage detection model obtains a probability sum of 1 for each of the four sleep stages, and uses the highest probability as the model's output. For example, if the probability of wakefulness is 5%, light sleep is 10%, deep sleep is 70%, and REM sleep is 15%, the final model output will be deep sleep.

[0092] This embodiment receives radio frequency signals through a multi-antenna array pre-set in a user's sleep scenario. The multi-antenna array contains multiple antennas. Channel state information of multiple subcarriers corresponding to each antenna is acquired, and new channel state information is constructed based on all acquired channel state information. The new channel state information is filtered and smoothed to obtain amplitude and phase information. The amplitude and phase information is pre-processed to obtain principal component features and the number of principal component features. The principal component features and the number of principal component features are input into a pre-constructed sleep stage detection model to obtain the user's sleep stage judgment result. Because this invention utilizes a multi-antenna array to achieve spatial diversity and utilizes the channel state information of multiple subcarriers corresponding to each antenna to achieve frequency diversity, it eliminates the phase offset problem in commercial WiFi hardware, expands the detectable range of WiFi radio frequency signals, and comprehensively analyzes amplitude and phase information, demonstrating the complementarity of information during feature selection. The sleep stage detection model proposed using a bidirectional long short-term memory neural network model based on an attention mechanism achieves more accurate sleep stage identification. Compared with existing technologies, this not only reduces costs but also improves the accuracy of non-contact sleep stage detection results.

[0093] refer to Figure 3 , Figure 3 This is a flowchart illustrating the second embodiment of the sleep detection method based on commercial WiFi of the present invention.

[0094] Based on the first embodiment described above, in this embodiment, step S20 includes:

[0095] Step S201: Select the channel state information of the subcarrier of one of the antennas as reference information;

[0096] Step S202: Multiply the channel state information of the subcarriers of other antennas by the reference information using a conjugate multiplication to obtain new channel state information.

[0097] In practical implementation, an antenna is arbitrarily selected from the antenna array as a reference antenna. The channel state information of the subcarriers of the other antennas is multiplied by the conjugate of the channel state information of the reference antenna's subcarrier to obtain new channel state information. For example, the signal state information on the signal subcarrier f at time t can be simply represented as H(t,f). For the channel state information obtained from the RF signals received by any two receiving antennas, a new channel state information H3(t,f) = H2(t,f) × H1 is constructed by multiplying the conjugates of the channel state information. * (t,f), where H1(t,f), H2(t,f), and H3(t,f) are all complex numbers, and * represents the conjugate of the complex numbers.

[0098] This embodiment receives radio frequency signals from a multi-antenna array pre-set in a user's sleep scenario. The multi-antenna array contains multiple antennas. The channel state information of a subcarrier from one antenna is selected as reference information. The channel state information of the subcarriers of other antennas is multiplied conjugately with the reference information to obtain new channel state information. This new channel state information is then filtered and smoothed to obtain amplitude and phase information. The amplitude and phase information is preprocessed to obtain principal component features and the number of principal component features. These principal component features and the number of principal component features are input into a pre-constructed sleep stage detection model to obtain the user's sleep stage judgment result. This embodiment eliminates phase shift by using conjugate multiplication between antenna pairs, reducing the device's own system errors and signal noise. Compared to existing technologies, this improves the accuracy of non-contact sleep stage detection results.

[0099] refer to Figure 4 , Figure 4 This is a flowchart illustrating the third embodiment of the sleep detection method based on commercial WiFi of the present invention.

[0100] Based on the second embodiment described above, in this embodiment, step S30 includes:

[0101] Step S301: Smooth the new channel state information using a Savitzy-Golay filter to obtain a first filtered signal with outliers removed;

[0102] Understandably, the Savitzky-Golay filter is a special type of low-pass filter, also known as a Savitzky-Golay smoother, used to smooth noisy data.

[0103] It should be noted that, because the continuous and unique movement trajectory of human activity during sleep is composed of the action characteristics of each sampling point over a period of time, and the sampling points are indivisible in terms of continuity, in order to smooth noise and remove outliers in the channel state information, step S301 in this embodiment may specifically include:

[0104] Step S3011: Obtain new channel state information within a preset time window interval using the Savitzy-Golay filter;

[0105] In the specific implementation, it is assumed that the preset time window size is W (in seconds, W=30 is selected), and the time window interval is all the sampling points within the time interval, that is, the sampling points between tW seconds and t seconds. The channel state information of all subcarriers within the time window is all the sampling data within the time interval.

[0106] Step S3012: Smooth the sampled data to obtain a first filtered signal with outliers removed.

[0107] Understandably, smoothing is to smooth out the noise in the sampled data, remove outliers from the sampled data, and obtain the first filtered signal.

[0108] Step S302: Remove the high-frequency changes in the first filtered signal using a Butterworth low-pass filter to obtain the second filtered signal;

[0109] Understandably, changes caused by movement during sleep result in low-frequency changes, typically below 3 Hz.

[0110] It should be noted that the Butterworth low-pass filter has the largest flat amplitude response characteristic, so its application in channel state information will not cause shape distortion of channel state information due to body movement.

[0111] In the specific implementation, a Butterworth low-pass filter is used to remove high-frequency changes in the channel state information signal, while retaining the low-frequency changes in the first filtered signal caused by movement during sleep, thereby separating the low-frequency changes caused by movement during sleep from the high-frequency noise of the first filtered signal.

[0112] Step S303: Extract amplitude information and phase information from the second filtered signal.

[0113] It should be noted that when using only the amplitude information or the phase information in the channel state information for respiratory sensing, there are still blind spots in the coverage area. However, the phase and amplitude of the interleaved detectable area are completely complementary. Therefore, using both phase and amplitude information simultaneously can obtain more comprehensive sensing information and improve the accuracy of sleep stage detection.

[0114] This embodiment uses a Savitzy-Golay filter to smooth the new channel state information, obtaining a first filtered signal with outliers removed. A Butterworth low-pass filter is then used to remove high-frequency variations from the first filtered signal, resulting in a second filtered signal. Amplitude and phase information are extracted from the second filtered signal. Compared to existing technologies, this embodiment uses both a Savitzy-Golay filter and a Butterworth low-pass filter for smoothing, removing outliers and high-frequency variations from the channel state information signal. Simultaneously, it utilizes phase and amplitude information to obtain more comprehensive sensory information, improving the accuracy of sleep stage detection.

[0115] Furthermore, this embodiment of the invention also proposes a storage medium storing a sleep detection program based on commercial WiFi. When the sleep detection program based on commercial WiFi is executed by a processor, it implements the steps of the sleep detection method based on commercial WiFi as described above.

[0116] refer to Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the sleep detection device based on commercial WiFi of the present invention.

[0117] like Figure 5 As shown, the sleep detection device based on commercial WiFi proposed in this embodiment of the invention includes: a receiving module 501, an acquisition module 502, a filtering module 503, a dimensionality reduction module 504, and a judgment module 505.

[0118] The receiving module 501 is used to receive radio frequency signals through a multi-antenna array pre-set in a user sleep scenario, wherein the multi-antenna array contains multiple antennas;

[0119] The acquisition module 502 is used to acquire the channel state information of multiple subcarriers corresponding to each antenna, and to construct new channel state information based on all the acquired channel state information.

[0120] Filtering module 503 is used to filter and smooth the new channel state information to obtain amplitude and phase information;

[0121] Dimensionality reduction module 504 is used to preprocess the amplitude phase information to obtain principal component features and the number of principal component features;

[0122] The judgment module 505 is used to input the principal component features and the number of principal component features into a pre-built sleep stage detection model to obtain the user's sleep stage judgment result.

[0123] This embodiment receives radio frequency signals through a multi-antenna array pre-set in a user's sleep scenario. The multi-antenna array contains multiple antennas. Channel state information of multiple subcarriers corresponding to each antenna is acquired, and new channel state information is constructed based on all acquired channel state information. The new channel state information is filtered and smoothed to obtain amplitude and phase information. The amplitude and phase information is pre-processed to obtain principal component features and the number of principal component features. The principal component features and the number of principal component features are input into a pre-constructed sleep stage detection model to obtain the user's sleep stage judgment result. Because this invention utilizes a multi-antenna array to achieve spatial diversity and utilizes the channel state information of multiple subcarriers corresponding to each antenna to achieve frequency diversity, it eliminates the phase offset problem in commercial WiFi hardware, expands the detectable range of WiFi radio frequency signals, and comprehensively analyzes amplitude and phase information, demonstrating the complementarity of information during feature selection. Compared to existing technologies, this not only reduces costs but also improves the accuracy of non-contact sleep stage detection results.

[0124] Based on the first embodiment of the sleep detection device based on commercial WiFi of the present invention, a second embodiment of the sleep detection device based on commercial WiFi of the present invention is proposed.

[0125] In this embodiment, the acquisition module 502 is further configured to select the channel state information of one of the antenna subcarriers as reference information; and perform conjugate multiplication of the channel state information of the other antenna subcarriers with the reference information to obtain new channel state information.

[0126] The filtering module 503 is further configured to differentiate the new channel state information within the first preset sleep period to obtain the offset of the new channel state information over time; extract the change in channel state information of sleep data over time within the first preset sleep period based on the offset; and generate new channel state information within the second preset sleep period based on the change in channel state information.

[0127] The filtering module 503 is further configured to smooth the new channel state information using a Savitzy-Golay filter to obtain a first filtered signal with outliers removed; remove high-frequency variations in the first filtered signal using a Butterworth low-pass filter to obtain a second filtered signal; and extract amplitude and phase information from the second filtered signal.

[0128] The filtering module 503 is further configured to acquire sampled data of new channel state information within a preset time window interval through the Savitzy-Golay filter; and to smooth the sampled data to obtain a first filtered signal with outliers removed.

[0129] Other embodiments or specific implementations of the sleep detection device based on commercial WiFi of the present invention can be referred to the above-described method embodiments, and will not be repeated here.

[0130] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0131] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0133] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A sleep detection method based on commercial WiFi, characterized by, The method comprises the following steps: Receiving radio frequency signals through a multi-antenna array preset in a user sleep scene, the multi-antenna array comprising a plurality of antennas; Obtaining channel state information of a plurality of subcarriers corresponding to each antenna, and constructing new channel state information according to all the obtained channel state information; Filtering and smoothing the new channel state information to obtain amplitude and phase information; Pretreating the amplitude and phase information to obtain eigenvalue features and the number of eigenvalue features; Inputting the eigenvalue features and the number of eigenvalue features into a pre-constructed sleep staging detection model to obtain a sleep stage judgment result of the user, the pre-constructed sleep staging detection model being a bidirectional long short-term memory neural network model based on an attention mechanism constructed through a space-time joint analysis method; Before the step of filtering and smoothing the new channel state information to obtain amplitude and phase information, the method further comprises the following steps: Differentiating the new channel state information in a first preset sleep period to obtain a shift of the new channel state information with respect to time; According to the shift, extracting a channel state information change amount of sleep data with respect to time in the first preset sleep period; Generating new channel state information in a second preset sleep period according to the channel state information change amount.

2. The method of claim 1, wherein, The step of obtaining channel state information of a plurality of subcarriers corresponding to each antenna, and constructing new channel state information according to all the obtained channel state information comprises the following steps: Selecting channel state information of subcarriers of one of the antennas as reference information; Conjugate multiplying channel state information of subcarriers of other antennas with the reference information to obtain new channel state information.

3. The method of claim 1, wherein, The new channel state information is new channel state information in a second preset sleep period, and the step of filtering and smoothing the new channel state information to obtain amplitude and phase information comprises the following steps: Smoothing the new channel state information through a Savitzy-Golay filter to obtain a first filtered signal in which abnormal values are removed; Removing high-frequency changes in the first filtered signal through a Butterworth low-pass filter to obtain a second filtered signal; Extracting amplitude information and phase information from the second filtered signal.

4. The method of claim 1, wherein, The amplitude and phase information comprises amplitude information and phase information, and the step of pretreating the amplitude and phase information to obtain eigenvalue features and the number of eigenvalue features comprises the following steps: According to a principal component analysis method, analyzing the correlation between the amplitude information and the phase information; According to the correlation, reducing the dimensionality of the amplitude information and the phase information to obtain eigenvalue features and the number of eigenvalue features.

5. The method of claim 3, wherein, The step of smoothing the new channel state information through a Savitzy-Golay filter to obtain a first filtered signal in which abnormal values are removed comprises the following steps: Obtaining sampling data of the new channel state information in a preset time window interval through a Savitzy-Golay filter; Smoothing the sampling data to obtain a first filtered signal in which abnormal values are removed. 6.A sleep detection apparatus based on commercial WiFi, characterized by, The device comprises: The receiving module is configured to receive radio frequency signals through a plurality of antenna arrays arranged in a user sleep scene, wherein the plurality of antenna arrays include a plurality of antennas; The obtaining module is configured to obtain channel state information of a plurality of subcarriers corresponding to each antenna, and construct new channel state information according to all the obtained channel state information; The filtering module is configured to perform filtering and smoothing processing on the new channel state information to obtain amplitude and phase information; The dimension reduction module is configured to preprocess the amplitude and phase information to obtain a pivot feature and a pivot feature quantity; The judging module is configured to input the pivot feature and the pivot feature quantity into a pre-constructed sleep stage detection model to obtain a sleep stage judgment result of a user, wherein the pre-constructed sleep stage detection model is a bidirectional long short-term memory neural network model based on an attention mechanism constructed through a space-time joint analysis method. The filtering module is further configured to differentiate the new channel state information in a first preset sleep period to obtain a shift of the new channel state information with respect to time, extract a channel state information change amount of sleep data with respect to time in the first preset sleep period according to the shift, and generate new channel state information in a second preset sleep period according to the channel state information change amount. 7.A sleep detection device based on commercial WiFi, characterized in that The device comprises a memory, a processor, and a commercial WiFi-based sleep detection program stored on the memory and executable on the processor, wherein the commercial WiFi-based sleep detection program is configured to implement the steps of the commercial WiFi-based sleep detection method according to any one of claims 1 to 5.

8. A storage medium, characterized by The storage medium stores a commercial WiFi-based sleep detection program, and the commercial WiFi-based sleep detection program implements the steps of the commercial WiFi-based sleep detection method according to any one of claims 1 to 5 when executed by the processor.

Citation Information

Patent Citations

  • Non-contact sleep staging device and method based on channel state information

    CN106936526A

  • A gait recognition method with independent directions based on commercial Wi-Fi

    CN109711251A

  • Long-distance non-contact respiratory rate estimation method and system and storage medium

    CN113708784A