Breathing detection method and device, electronic equipment, storage medium and product
By analyzing the channel state information of WiFi signals, subcarriers related to breathing are selected. The breathing status is determined by the local energy ratio and the average spectral energy. This solves the problem of false detection caused by environmental interference of WiFi signals and improves the accuracy and stability of breathing detection.
Patent Information
- Application Number
- CN202511243366.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2025-11-28
AI Technical Summary
In existing technologies, WiFi signals are easily interfered with by the surrounding environment, which leads to a decrease in the accuracy and reliability of breath detection and frequent false breath detection results.
By acquiring the window time-domain data of subcarriers in the channel state information of WiFi signals, the spectrum data is determined, the local energy ratio is calculated, the target subcarrier range is selected, and the respiratory detection status is judged based on the average spectrum energy.
It improves the accuracy of breath detection, reduces false breath alarms, and can work stably in complex environments.
Smart Images

Figure CN121037795A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a respiratory detection method, device, electronic device, storage medium, and product. Background Technology
[0002] With the rapid development of wireless communication technology, WiFi Channel State Information (CSI), as a fine-grained channel state information, is widely used in the field of non-contact monitoring because it contains rich physical layer information.
[0003] However, in practical applications, WiFi signals are susceptible to complex interference from the surrounding environment, such as noise from electronic devices and people walking around. These interfering signals often have frequencies similar to breathing signals, leading to false breathing detection results. Therefore, how to effectively suppress interference and improve the accuracy and reliability of WiFi CSI breathing detection has become an urgent problem to be solved. Summary of the Invention
[0004] This invention provides a respiratory detection method, device, electronic device, storage medium, and product to solve the problem that false respiratory signals cannot be suppressed in the prior art.
[0005] According to one aspect of the present invention, a method for detecting respiration is provided, wherein the method includes:
[0006] Obtain window time-domain data of at least two subcarriers from the channel state information of the WiFi signal, and determine the spectrum data corresponding to the window time-domain data;
[0007] The full spectrum energy and local spectrum energy within a preset frequency range of each subcarrier are determined based on the spectrum data, and the proportion of local energy is determined according to the local spectrum energy and the full spectrum energy.
[0008] The target subcarrier in the subcarrier is determined based on the local energy ratio, and the subcarrier range is determined based on the preset number of the target subcarrier;
[0009] The average spectral energy of all subcarriers in the subcarrier range at each preset frequency position is determined. The target frequency position in the preset frequency position is determined based on the average spectral energy, and the breathing detection status is determined according to the target frequency position.
[0010] According to another aspect of the present invention, a respiratory detection device is provided, wherein the device comprises:
[0011] The data acquisition module is used to acquire window time-domain data of at least two subcarriers in the channel state information of the WiFi signal, and determine the spectrum data corresponding to the window time-domain data;
[0012] The proportion determination module is used to determine the full spectrum energy and local spectrum energy within a preset frequency range of each subcarrier based on the spectrum data, and to determine the proportion of local energy according to the local spectrum energy and the full spectrum energy;
[0013] The range determination module is used to determine the target subcarrier in the subcarrier based on the local energy ratio, and to determine the subcarrier range based on the preset number of the target subcarrier;
[0014] The breathing detection module is used to determine the average spectral energy of all subcarriers in the subcarrier range at each preset frequency position, determine the target frequency position in the preset frequency position based on the average spectral energy, and determine the breathing detection status according to the target frequency position.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] At least one processor; and
[0017] A memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a respiratory detection method according to any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement a respiratory detection method according to any embodiment of the present invention.
[0020] According to another aspect of the present invention, embodiments of the present invention also provide a computer program product, the computer program product including a computer program, which, when executed by a processor, implements a respiratory detection method according to any embodiment of the present invention.
[0021] The technical solution of this invention obtains window time-domain data of at least two subcarriers from the channel state information of a WiFi signal, determines the spectrum data corresponding to the window time-domain data, determines the full spectrum energy of each subcarrier and the local spectrum energy within a preset frequency range based on the spectrum data, determines the local energy ratio according to the local and full spectrum energy, determines the target subcarriers among the subcarriers based on the local energy ratio, and determines the subcarrier range according to the preset number of the target subcarrier. This can accurately identify subcarriers related to breathing, effectively improving the accuracy of breathing detection. Furthermore, it determines the average spectrum energy of all subcarriers within the subcarrier range at each preset frequency position, determines the target frequency position within the preset frequency position based on the average spectrum energy, and determines the breathing detection status according to the target frequency position. This achieves stable operation in complex environments, improves the accuracy of breathing detection, and effectively reduces false breathing alarms caused by interference.
[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart of a respiratory detection method provided according to Embodiment 1 of the present invention;
[0025] Figure 2 This is a flowchart of a respiratory detection method provided according to Embodiment 2 of the present invention;
[0026] Figure 3 This is a flowchart of a respiratory detection method provided according to Embodiment 3 of the present invention;
[0027] Figure 4 This is an example diagram of a local energy percentage provided in Embodiment 3 of the present invention;
[0028] Figure 5 This is an example diagram of a subcarrier range provided according to Embodiment 3 of the present invention;
[0029] Figure 6 This is an example diagram of another subcarrier range provided according to Embodiment 3 of the present invention;
[0030] Figure 7This is a schematic diagram of a respiratory detection device according to Embodiment 4 of the present invention;
[0031] Figure 8 This is a schematic diagram of the structure of an electronic device that implements a respiratory detection method according to an embodiment of the present invention. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0034] Example 1
[0035] Figure 1 This is a flowchart of a respiration detection method according to Embodiment 1 of the present invention. This embodiment is applicable to the respiration detection of organisms in vehicles. The method can be executed by a respiration detection device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0036] S110. Obtain window time-domain data of at least two subcarriers from the channel state information of the WiFi signal, and determine the spectrum data corresponding to the window time-domain data.
[0037] Channel state information (CSO) is a set of parameters describing the characteristics of a communication channel, reflecting the characteristics of a WiFi signal during transmission within the channel. For example, CSO may include, but is not limited to, information such as channel amplitude, phase, and delay. In this embodiment, the WiFi signal can propagate within a preset space, such as a closed vehicle. A subcarrier refers to the carrier corresponding to each subchannel; multiple subcarriers can exist for a WiFi signal. Window time-domain data can be understood as time-domain data within a window range. For example, the window range can be a preset frequency detection window divided according to the detection frequency. Spectrum data refers to a set of data exhibiting characteristics at different frequencies. For example, a Fourier transform operation can be performed on the window time-domain data to obtain the corresponding spectrum data, such as a Fast Fourier Transform (FFT).
[0038] In this embodiment, multiple subcarriers can be determined from the channel state information. Time-domain data can be collected from the multiple subcarriers according to a preset frequency detection window. The collected time-domain data can be combined into a data matrix as window time-domain data. The window time-domain data can be Fourier transformed to obtain the spectrum data corresponding to the window time-domain data.
[0039] S120. Determine the full spectrum energy of each subcarrier and the local spectrum energy within the preset frequency range based on the spectrum data, and determine the proportion of local energy according to the local spectrum energy and the full spectrum energy.
[0040] Here, full-spectrum energy refers to the total energy contained in each subcarrier across the entire frequency range; local-spectrum energy refers to the energy contained in each subcarrier within a preset frequency range, i.e., the energy contained within a preset frequency detection window. Local energy percentage refers to the ratio of local-spectrum energy to full-spectrum energy, used to represent the proportion of local-spectrum energy to the overall frequency range. Preset frequency range refers to the frequency range set in advance according to requirements; for example, the preset frequency range can be set according to the human breathing rate.
[0041] In this embodiment, the power spectral density of each subcarrier can be determined based on the spectral data. The spectral energy of the subcarriers across the entire frequency range can be determined as the full spectral energy based on the power spectral density, and the spectral energy of the subcarriers within a preset frequency range can be determined as the local spectral energy. The ratio of the local spectral energy to the full spectral energy is then determined and used as the local energy percentage.
[0042] S130. Determine the target subcarrier in the subcarriers according to the local energy ratio, and determine the subcarrier range according to the preset number of the target subcarrier.
[0043] Here, "target subcarrier" refers to subcarriers selected based on their local energy proportion. "Preset number" refers to a number pre-assigned to each target subcarrier; for example, each subcarrier has a pre-assigned number, and these numbers can be consecutive natural numbers. "Subcarrier range" refers to the range determined by the preset numbers of the target subcarriers; for example, the subcarrier range can include subcarriers corresponding to consecutive preset numbers when the number of consecutive preset numbers exceeds a preset threshold; or, the subcarrier range can be defined as all preset numbers included in the maximum and minimum values of the preset numbers.
[0044] In this embodiment, a preset threshold for determining the proportion of a target subcarrier can be pre-set. When the local energy proportion is greater than the preset threshold, the subcarrier corresponding to the local energy proportion is determined as the target subcarrier. The number of target subcarriers can be one or more. When there is only one target subcarrier, that target subcarrier is considered as a subcarrier range. When there are multiple target subcarriers, a preset number for each target subcarrier can be extracted. It can be determined whether consecutive numbers exist within the preset numbers. If the number of consecutive numbers is greater than a preset threshold, the target subcarriers corresponding to the consecutive numbers can be considered as a subcarrier range. If the number of consecutive numbers is less than or equal to the preset threshold, all preset numbers included in the maximum and minimum values of the preset numbers can be considered as the subcarrier range.
[0045] S140. Determine the average spectral energy of all subcarriers in the subcarrier range at each preset frequency position, determine the target frequency position in the preset frequency position based on the average spectral energy, and determine the breathing detection status according to the target frequency position.
[0046] Here, "preset frequency position" refers to a pre-defined frequency detection position, and there can be multiple preset frequency positions. For example, a preset frequency position can be a frequency position determined within a preset frequency detection window at the same frequency interval. "Average spectral energy" refers to the average spectral energy of all subcarriers within the subcarrier range corresponding to the same preset frequency position. "Target frequency position" refers to a target frequency position; for example, the target frequency position can be the preset frequency position corresponding to the maximum value among the average spectral energy values. "Respiratory detection status" can refer to the current breathing status; for example, the breathing detection status can include normal breathing and spurious breathing.
[0047] In this embodiment, the spectral energy of all subcarriers within the subcarrier range at each preset frequency position can be determined, and the average spectral energy at the same preset frequency position can be used as the average spectral energy. The maximum value among the average spectral energy values is determined as the target average spectral energy, and the preset frequency position corresponding to the target average spectral energy is used as the target frequency position. A preset breathing frequency range is extracted, and it is determined whether the target frequency position is within the preset breathing frequency range. If the target frequency position is within the preset breathing frequency range, the breathing detection can be determined to be normal breathing; if the target frequency position is not within the preset breathing frequency range, the breathing detection can be determined to be false breathing.
[0048] This invention, through obtaining window time-domain data of at least two subcarriers from the channel state information of a WiFi signal and determining the corresponding spectrum data, determines the full spectrum energy of each subcarrier and the local spectrum energy within a preset frequency range based on the spectrum data. It then determines the local energy ratio based on the local and full spectrum energy, identifies the target subcarrier within the subcarriers based on the local energy ratio, and determines the subcarrier range based on the preset number of the target subcarrier. This allows for accurate identification of breathing-related subcarriers, effectively improving the accuracy of breathing detection. Furthermore, it determines the average spectrum energy of all subcarriers within the subcarrier range at each preset frequency position, determines the target frequency position within the preset frequency position based on the average spectrum energy, and determines the breathing detection status based on the target frequency position. This enables stable operation in complex environments, improves the accuracy of breathing detection, and effectively reduces false breathing alarms caused by interference.
[0049] Example 2
[0050] Figure 2 This is a flowchart of a respiratory detection method according to Embodiment 2 of the present invention. This embodiment is a further optimization and extension based on the above embodiments, and can be combined with various optional technical solutions in the above embodiments. Figure 2 As shown, the method includes:
[0051] S201. Collect channel status information of WiFi signal.
[0052] In this embodiment, channel state information of WiFi signals can be collected using WiFi devices that support CSI acquisition. In actual operation, WiFi devices can be installed anywhere inside the vehicle, and there can be multiple WiFi devices. One WiFi device transmits the WiFi signal, while the remaining WiFi devices collect the channel state information of the WiFi signal.
[0053] S202. Collect time-domain data in at least two subcarriers of the channel state information according to the preset frequency detection window as target time-domain data, and form a data matrix from each time-domain data as window time-domain data.
[0054] The preset frequency detection window refers to a pre-set detection window, which can be set according to the frequency range of human activity during actual operation. There can be multiple subcarriers. The target time-domain data refers to the time-domain data located within the preset frequency detection window. Generally, the target time-domain data can include frequency waveforms, voltage, current, and other data.
[0055] In one embodiment, multiple subcarriers are determined from the channel state information, and time-domain data of these subcarriers within a preset frequency detection window are collected as target time-domain data. The collected target time-domain data are then combined to form a data matrix, which is used as the window time-domain data. In one embodiment, when the number of target subcarriers is N and the preset frequency detection window is M, the window time-domain data can be an N*M data matrix.
[0056] S203. Perform a Fourier transform operation on the window time-domain data to obtain the spectrum data corresponding to the window time-domain data.
[0057] In one embodiment, a Fourier transform operation can be performed on the window of time-domain data to determine the corresponding spectral data. In one embodiment, the Fourier transform operation may include, but is not limited to, the Fast Fourier Transform.
[0058] S204. Determine the spectrum data of each subcarrier within the preset frequency range as the first spectrum data.
[0059] The preset frequency range can be a pre-set frequency range. In one embodiment, the preset frequency range can be set according to the human breathing frequency.
[0060] In this embodiment, for each subcarrier, spectrum data within a preset frequency range can be determined, and the spectrum data within the preset frequency range is used as the first spectrum data.
[0061] S205. Determine the local spectral energy of the subcarrier according to the first spectral data, and determine the full spectral energy of the subcarrier according to the spectral data corresponding to the window time-domain data.
[0062] In this embodiment, the spectral data corresponding to the window time-domain data can be determined. The power spectral density of each subcarrier can be determined according to the spectral data corresponding to the window time-domain data. The spectral energy corresponding to the first spectral data can be determined according to the power spectral density as the local spectral energy of the subcarrier. The spectral energy corresponding to all the additional spectral data can be determined according to the power spectral density as the full spectral energy.
[0063] S206. Determine the ratio of the local spectral energy to the full spectral energy corresponding to each subcarrier, and use the ratio as the local energy percentage.
[0064] S207. Extract the preset percentage threshold and determine the target subcarrier according to the preset percentage threshold and the local energy percentage.
[0065] The preset percentage threshold refers to the threshold that is set in advance to determine the target subcarrier.
[0066] In this embodiment, the target subcarrier can be determined by a preset percentage threshold and a local energy percentage.
[0067] In one embodiment, determining the target subcarrier according to a preset percentage threshold and a local energy percentage includes:
[0068] When the local energy percentage is determined to be greater than the preset percentage threshold, the subcarrier corresponding to the local energy percentage is determined as the target subcarrier.
[0069] During implementation, if the local energy percentage exceeds the preset percentage threshold, the subcarrier corresponding to the local energy percentage can be designated as the target subcarrier.
[0070] S208. Extract the preset number of the target subcarrier, determine the number of consecutive numbers in the preset number, and determine the subcarrier range according to the number of consecutive numbers.
[0071] Among them, the consecutive quantity refers to the number of consecutive numbers in the preset numbering.
[0072] In the embodiments, a preset number for each target subcarrier can be determined, the number of consecutive numbers in the preset number can be determined, and the subcarrier range can be determined by the number of consecutive numbers.
[0073] In one embodiment, determining the subcarrier range according to a consecutive number includes:
[0074] When the number of consecutive numbers is determined to be greater than the preset number threshold, the subcarrier group corresponding to the consecutive number is determined, and the subcarrier group is spliced together to form a subcarrier range.
[0075] When the number of consecutive numbers is less than or equal to a preset number threshold, the maximum and minimum values in the preset number are determined, and the subcarriers corresponding to all preset numbers included in the minimum and maximum values are combined to form a subcarrier range.
[0076] The preset number threshold refers to a threshold set in advance to determine the range of subcarriers. For example, the preset number threshold may include, but is not limited to, 3, 5, or 10.
[0077] In this embodiment, the relationship between the number of consecutive numbers and a preset threshold number can be compared. When the number of consecutive numbers is greater than the preset threshold number, the subcarriers corresponding to the consecutive numbers can be determined to form a subcarrier range. For example, when there are two subcarrier groups, the first group has consecutive numbers 7-17, and the second group has consecutive numbers 35-54. The subcarriers corresponding to numbers 7-54 are then combined to form a subcarrier range. When the number of consecutive numbers is less than or equal to the preset threshold number, the maximum and minimum values among the preset numbers can be determined. The subcarriers corresponding to all preset numbers included in the minimum and maximum values are then combined to form a subcarrier range. In one embodiment, when there are multiple subcarriers corresponding to consecutive numbers, the library concatenates the subcarriers corresponding to multiple consecutive numbers to form a subcarrier range.
[0078] S209. Determine the spectral energy of each subcarrier at each preset frequency position within the subcarrier range, and determine the average spectral energy of all subcarriers at the same preset frequency position as the average spectral energy.
[0079] In the embodiments, the spectral energy of each subcarrier in the subcarrier range corresponding to each preset frequency position can be determined, the spectral energy corresponding to all subcarriers at the same preset frequency position can be determined, and the average value of the spectral energy can be used as the average value of the spectral energy.
[0080] S210. Determine the preset frequency position corresponding to the maximum value in the mean of the spectral energy as the target frequency position.
[0081] In this embodiment, the maximum value among the average spectral energy values can be determined, and the preset frequency position corresponding to the maximum value among the average spectral energy values can be used as the target frequency position.
[0082] S211. Extract the preset respiratory rate range and determine the respiratory detection status according to the preset respiratory rate range and the target frequency position.
[0083] The preset breathing rate range refers to the range of human breathing rates that are set in advance.
[0084] In one embodiment, determining the respiratory detection status according to a preset respiratory rate range and a target frequency position includes:
[0085] When the target frequency location is determined to be within the preset respiratory frequency range, the respiratory detection status is determined to be normal breathing;
[0086] If the target frequency location is not within the preset breathing frequency range, the breathing detection is determined to be a false breathing.
[0087] In this embodiment, when the target frequency position is within the preset breathing frequency range, the breathing detection status can be determined to be normal breathing; when the target frequency position is not within the preset breathing frequency range, the breathing detection status can be determined to be false breathing.
[0088] In this embodiment of the invention, channel state information of WiFi signals is collected. Time-domain data is collected from at least two subcarriers of the channel state information according to a preset frequency detection window as target time-domain data. The time-domain data are combined into a data matrix as window time-domain data. A Fourier transform operation is performed on the window time-domain data to obtain the corresponding spectrum data. The spectrum data of each subcarrier within a preset frequency range is determined as the first spectrum data. The local spectrum energy of the subcarrier is determined according to the first spectrum data. The full spectrum energy of the subcarrier is determined according to the spectrum data corresponding to the window time-domain data. The ratio of the local spectrum energy to the full spectrum energy of each subcarrier is determined and used as the local energy percentage. A preset percentage threshold is extracted. The target subcarrier is determined according to the preset percentage threshold and the local energy percentage. The target subcarrier is then used to... The screening method can accurately identify subcarriers related to breathing, effectively improving the accuracy of breathing detection. By extracting the preset number of the target subcarrier, determining the consecutive number of consecutive numbers in the preset number, determining the subcarrier range according to the consecutive number, and determining the spectral energy of each subcarrier in the subcarrier range at each preset frequency position, and by setting reasonable thresholds and a consecutive number identification mechanism, false breathing signals caused by interference can be effectively eliminated, significantly reducing the false alarm rate. The average spectral energy of all subcarriers at the same preset frequency position is determined as the average spectral energy, and the preset frequency position corresponding to the maximum value of the average spectral energy is determined as the target frequency position. The preset breathing frequency range is extracted, and the breathing detection status is determined according to the preset breathing frequency range and the target frequency position, effectively improving the accuracy of breathing detection.
[0089] Example 3
[0090] Figure 3 This is a flowchart of a respiratory detection method according to Embodiment 3 of the present invention. This embodiment is based on the above embodiments, using N*M data as the window time-domain data, window M as the preset frequency detection window, and the preset frequency range being [-f1, f1]. Using the sequence number as an example, further explanation of respiratory detection is provided. Figure 3 As shown, the method includes:
[0091] S310. Data Acquisition: Acquire time-domain data of N subcarriers within window M to form N*M data.
[0092] The frequency domain range of window M is [-F1, F1].
[0093] S320, Frequency Domain Transformation: Perform Fast Fourier Transform (FFT) on the acquired N*M data to obtain the spectrum data of N subcarriers in the frequency domain range [-F1, F1].
[0094] S330, Energy Proportion Calculation: Calculate the local energy proportion of each subcarrier within the preset frequency range [-f1,f1] to the total spectral energy within the overall frequency range [-F1,F1].
[0095] In one embodiment, Figure 4 This is an example diagram of a local energy percentage provided in Embodiment 3 of the present invention, such as... Figure 4 The figure shows the spectrum data of N subcarriers in the frequency domain range [-F1, F1], where the serial number is the preset number of the subcarrier and the gray area is the preset frequency range [-f1, f1].
[0096] S340, Subcarrier Filtering: Set a preset percentage threshold, filter out subcarriers whose local energy percentage is greater than the preset percentage threshold, and record their serial numbers in the data index.
[0097] S350, Continuous sequence number identification: For the selected subcarrier sequence number (preset number), identify and record the starting preset number and the ending preset number when the number of consecutive sequence numbers is greater than the preset number threshold.
[0098] In this embodiment, if there are multiple data indices with a consecutive number of subcarrier sequence numbers greater than a preset threshold, they are distributed and stored in the begin and ends arrays.
[0099] S360, Subcarrier range determined.
[0100] In one embodiment, Figure 5 This is an example diagram of a subcarrier range provided in Embodiment 3 of the present invention, where indices_ss represents the subcarrier range. Based on the identification result of consecutive numbers, if consecutive numbers exist, the consecutive subcarrier number ranges are concatenated to form the final subcarrier number range (indices_ss = [min(begins), max(ends)]). Figure 5 As shown, 7-47 are consecutive subcarriers, and 35-54 are consecutive subcarriers. Therefore, the subcarriers corresponding to 7-54 are taken as the subcarrier range.
[0101] In one embodiment, Figure 6This is an example diagram of another subcarrier range provided in Embodiment 3 of the present invention, where indices_ss is the subcarrier range. If there are no consecutive indices, the minimum and maximum values of all selected subcarrier indices are used as the final range indices_ss = [min(indices), max(indices)]. Figure 6 As shown, the minimum value of the subcarrier index is 1 and the maximum value is 95. Therefore, the subcarriers corresponding to 1-95 are taken as the subcarrier range.
[0102] S370. Frequency position determination: Calculate the average spectral energy within the final subcarrier number range (indices_ss), and determine the frequency position corresponding to the maximum value based on the average spectral energy.
[0103] S380. Respiratory Target Identification: If the frequency position corresponding to the average spectral energy of the maximum value is within the range of human breathing frequency, it is considered to be the breathing signal of an infant or child; otherwise, it is considered to be a false breathing frequency target, i.e., an interference signal.
[0104] In this embodiment of the invention, a subcarrier screening algorithm can accurately identify subcarriers related to breathing, effectively improving the accuracy of breathing detection. By setting reasonable thresholds and a continuous sequence number recognition mechanism, false breathing signals caused by interference can be effectively eliminated, significantly reducing the false alarm rate. This method has good robustness to different types of interference and can work stably in complex environments, providing reliable technical support for the health monitoring of infants or children.
[0105] Example 4
[0106] Figure 7 This is a schematic diagram of a respiratory detection device according to Embodiment 4 of the present invention. Figure 7 As shown, the device includes: a data acquisition module 71, a proportion determination module 72, a range determination module 73, and a respiratory detection module 74.
[0107] The data acquisition module 71 is used to acquire window time-domain data of at least two subcarriers in the channel state information of the WiFi signal, and to determine the spectrum data corresponding to the window time-domain data.
[0108] The proportion determination module 72 is used to determine the full spectrum energy of each subcarrier and the local spectrum energy within a preset frequency range based on the spectrum data, and to determine the proportion of local energy according to the local spectrum energy and the full spectrum energy.
[0109] The range determination module 73 is used to determine the target subcarrier in the subcarrier according to the local energy ratio, and to determine the subcarrier range according to the preset number of the target subcarrier;
[0110] The breathing detection module 74 is used to determine the average spectral energy of all subcarriers in the subcarrier range at each preset frequency position, determine the target frequency position in the preset frequency position based on the average spectral energy, and determine the breathing detection status according to the target frequency position.
[0111] In this embodiment of the invention, a data acquisition module acquires window time-domain data of at least two subcarriers from the channel state information of a WiFi signal and determines the spectrum data corresponding to the window time-domain data. A proportion determination module determines the full spectrum energy of each subcarrier and the local spectrum energy within a preset frequency range based on the spectrum data, and determines the local energy proportion according to the local spectrum energy and the full spectrum energy. A range determination module determines the target subcarrier among the subcarriers based on the local energy proportion and determines the subcarrier range according to the preset number of the target subcarrier. This can accurately identify subcarriers related to breathing, effectively improving the accuracy of breathing detection. The breathing detection module determines the average spectrum energy of all subcarriers within the subcarrier range at each preset frequency position, determines the target frequency position within the preset frequency position based on the average spectrum energy, and determines the breathing detection status according to the target frequency position. This enables stable operation in complex environments, improves the accuracy of breathing detection, and effectively reduces false breathing alarms caused by interference.
[0112] In one embodiment, the data acquisition module 71 includes:
[0113] The information acquisition unit is used to collect channel status information of WiFi signals;
[0114] The time-domain data determination unit is used to collect time-domain data in at least two subcarriers of the channel state information according to a preset frequency detection window as target time-domain data, and to form a data matrix of each time-domain data as window time-domain data.
[0115] The frequency domain data determination unit is used to perform a Fourier transform operation on the window time domain data to obtain the spectrum data corresponding to the window time domain data.
[0116] In one embodiment, the proportion determination module 72 includes:
[0117] The first data determination unit is used to determine the spectrum data of each subcarrier within a preset frequency range as the first spectrum data;
[0118] The spectrum energy determination unit is used to determine the local spectrum energy of the subcarrier according to the first spectrum data, and to determine the full spectrum energy of the subcarrier according to the spectrum data corresponding to the window time domain data.
[0119] The proportion determination unit is used to determine the ratio of the local spectral energy to the full spectral energy corresponding to each subcarrier, and uses the ratio as the local energy proportion.
[0120] In one embodiment, the range determination module 73 includes:
[0121] The subcarrier determination unit is used to extract a preset proportion threshold and determine the target subcarrier according to the preset proportion threshold and the local energy proportion.
[0122] The range determination unit is used to extract the preset number of the target subcarrier, determine the number of consecutive numbers in the preset number, and determine the subcarrier range according to the number of consecutive numbers.
[0123] In one embodiment, the subcarrier determination unit is specifically used for:
[0124] When the local energy percentage is determined to be greater than the preset percentage threshold, the subcarrier corresponding to the local energy percentage is determined as the target subcarrier.
[0125] In one embodiment, the range determination unit is specifically used for:
[0126] When the number of consecutive numbers is determined to be greater than a preset threshold, the subcarrier range corresponding to the consecutive numbers is determined.
[0127] When the number of consecutive numbers is less than or equal to a preset number threshold, the maximum and minimum values in the preset number are determined, and the subcarriers corresponding to all preset numbers included in the minimum and maximum values are combined to form a subcarrier range.
[0128] In one embodiment, the respiratory detection module 74 includes:
[0129] The mean value determination unit is used to determine the spectral energy of each subcarrier in the subcarrier range at each preset frequency position, and to determine the mean of the spectral energy of all subcarriers at the same preset frequency position as the mean of the spectral energy.
[0130] The location determination unit is used to determine the preset frequency location corresponding to the maximum value in the average spectral energy as the target frequency location;
[0131] The breathing detection unit is used to extract a preset breathing frequency range and determine the breathing detection status according to the preset breathing frequency range and the target frequency position.
[0132] In one embodiment, the respiratory detection unit is specifically used for:
[0133] When the target frequency location is determined to be within the preset respiratory frequency range, the respiratory detection status is determined to be normal breathing;
[0134] If the target frequency location is not within the preset breathing frequency range, the breathing detection is determined to be a false breathing.
[0135] The respiratory detection device provided in the embodiments of the present invention can execute the respiratory detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0136] Example 5
[0137] Figure 8 This is a schematic diagram of an electronic device implementing a respiratory detection method according to an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0138] like Figure 8 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0139] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0140] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a respiratory detection method.
[0141] In some embodiments, a respiration detection method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of a respiration detection method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform a respiration detection method by any other suitable means (e.g., by means of firmware).
[0142] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0143] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0144] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0145] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0146] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0147] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0148] In one embodiment, the present invention further includes a computer program product, which includes a computer program that, when executed by a processor, implements a respiratory detection method according to any embodiment of the present invention.
[0149] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0150] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0151] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for detecting respiration, characterized in that, include: Obtain window time-domain data of at least two subcarriers from the channel state information of the WiFi signal, and determine the spectrum data corresponding to the window time-domain data; The full spectrum energy and local spectrum energy within a preset frequency range of each subcarrier are determined based on the spectrum data, and the proportion of local energy is determined according to the local spectrum energy and the full spectrum energy. The target subcarrier in the subcarrier is determined based on the local energy ratio, and the subcarrier range is determined based on the preset number of the target subcarrier; The average spectral energy of all subcarriers in the subcarrier range at each preset frequency position is determined. The target frequency position in the preset frequency position is determined based on the average spectral energy, and the breathing detection status is determined according to the target frequency position.
2. The method according to claim 1, characterized in that, The step of acquiring window time-domain data of at least two subcarriers in the channel state information of the WiFi signal and determining the spectrum data corresponding to the window time-domain data includes: Collect channel status information of WiFi signals; According to a preset frequency detection window, time-domain data is collected in at least two subcarriers of the channel state information as target time-domain data, and the time-domain data are combined into a data matrix as window time-domain data. Perform a Fourier transform operation on the window time-domain data to obtain the spectrum data corresponding to the window time-domain data.
3. The method according to claim 1, characterized in that, The step of determining the full-spectrum energy and local-spectrum energy within a preset frequency range of each subcarrier based on the spectrum data, and determining the local energy percentage according to the local-spectrum energy and the full-spectrum energy, includes: The spectrum data of each subcarrier within a preset frequency range is determined as the first spectrum data; The local spectral energy of the subcarrier is determined according to the first spectral data, and the full spectral energy of the subcarrier is determined according to the spectral data corresponding to the window time-domain data. Determine the ratio of the local spectral energy to the full spectral energy corresponding to each subcarrier, and use the ratio as the local energy percentage.
4. The method according to claim 1, characterized in that, The step of determining the target subcarrier among the subcarriers based on the local energy ratio, and determining the subcarrier range based on the preset number of the target subcarrier, includes: Extract a preset percentage threshold, and determine the target subcarrier according to the preset percentage threshold and the local energy percentage; Extract the preset number of the target subcarrier, determine the consecutive number of consecutive numbers in the preset number, and determine the subcarrier range according to the consecutive number.
5. The method according to claim 4, characterized in that, The step of determining the target subcarrier according to the preset proportion threshold and the local energy proportion includes: When the local energy percentage is determined to be greater than a preset percentage threshold, the subcarrier corresponding to the local energy percentage is determined to be the target subcarrier.
6. The method according to claim 4, characterized in that, Determining the subcarrier range according to the number of consecutive carriers includes: When it is determined that the consecutive number is greater than a preset number threshold, the subcarrier group corresponding to the consecutive number is determined, and the subcarrier group is spliced together to form a subcarrier range; When it is determined that the consecutive number is less than or equal to the preset number threshold, the maximum and minimum values in the preset number are determined, and the subcarriers corresponding to all preset numbers included in the minimum and maximum values are combined to form a subcarrier range.
7. The method according to claim 1, characterized in that, The process of determining the average spectral energy of all subcarriers within the subcarrier range at each preset frequency position, determining the target frequency position within the preset frequency position based on the average spectral energy, and determining the respiratory detection status according to the target frequency position includes: Determine the spectral energy of each subcarrier at each preset frequency position within the subcarrier range, and determine the average spectral energy of all the subcarriers at the same preset frequency position as the average spectral energy. The preset frequency position corresponding to the maximum value in the mean spectral energy is determined as the target frequency position; Extract a preset breathing frequency range, and determine the breathing detection status according to the preset breathing frequency range and the target frequency position.
8. The method according to claim 7, characterized in that, Determining the respiratory detection status according to the preset respiratory rate range and the target frequency position includes: When the target frequency position is determined to be within the preset breathing frequency range, the breathing detection status is determined to be normal breathing; When it is determined that the target frequency position is not within the preset breathing frequency range, the breathing detection is determined to be a false breathing.
9. A respiratory detection device, characterized in that, include: The data acquisition module is used to acquire window time-domain data of at least two subcarriers in the channel state information of the WiFi signal, and determine the spectrum data corresponding to the window time-domain data; The proportion determination module is used to determine the full spectrum energy and local spectrum energy within a preset frequency range of each subcarrier based on the spectrum data, and to determine the proportion of local energy according to the local spectrum energy and the full spectrum energy; The range determination module is used to determine the target subcarrier in the subcarrier based on the local energy ratio, and to determine the subcarrier range based on the preset number of the target subcarrier; The breathing detection module is used to determine the average spectral energy of all subcarriers in the subcarrier range at each preset frequency position, determine the target frequency position in the preset frequency position based on the average spectral energy, and determine the breathing detection status according to the target frequency position.
10. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a respiratory detection method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute and implement a respiratory detection method according to any one of claims 1-8.
12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements a respiratory detection method according to any one of claims 1-8.