Virtual reality-based lung rehabilitation nursing psychological counseling method and system

By identifying the respiratory phase inflection point and using a digital phase-locked loop to adjust the audiovisual rendering delay, the problem of binding audiovisual rhythms with respiratory muscle movement time in virtual reality pulmonary rehabilitation training was solved, realizing neural drive synchronization and dynamic visual feedback, thus improving rehabilitation effects.

CN122440957APending Publication Date: 2026-07-24诸暨市人民医院
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
诸暨市人民医院
Filing Date
2026-05-14
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In existing virtual reality pulmonary rehabilitation training, the time difference between the fixed-cycle audiovisual guidance signals and the patient's actual breathing movements causes phase errors, which disrupts the time binding between the audiovisual rhythm and respiratory muscle movement, thus affecting the rehabilitation effect.

Method used

By collecting signals of changes in the patient's chest and abdominal circumference, calculating respiratory flow curves, identifying respiratory phase inflection points, and using a digital phase-locked loop mechanism to adjust the rendering pipeline delay of the audiovisual generation components, the phase delay of virtual audiovisual stimuli is kept constant within the neuromuscular response threshold, thus establishing a time binding between audiovisual rhythms and respiratory muscle movements.

Benefits of technology

It eliminates phase lag and phase drift between visual and auditory guidance signals and the patient's actual breathing movements, enhances neural drive synchronization, provides dynamic visual feedback coupled with physiological state, and improves the effectiveness of rehabilitation training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122440957A_ABST
    Figure CN122440957A_ABST
Patent Text Reader

Abstract

The present application relates to the field of virtual reality, in particular to a lung rehabilitation nursing psychological counseling method and system based on virtual reality. The method collects the chest and abdominal girth change signal of the patient, calculates the respiratory flow rate curve through band pass filtering and peak detection algorithm, identifies the inspiration starting point, expiration starting point and breath holding starting point on the respiratory flow rate curve as the respiratory phase turning point. The digital phase-locked loop mechanism is introduced, the respiratory phase turning point is taken as the reference clock signal, the actual presentation time of the virtual visual and auditory stimulation is taken as the output signal of the voltage-controlled oscillator, the rendering pipeline delay of the visual and auditory generation component is adjusted through closed-loop feedback, so that the phase delay of the virtual visual and auditory stimulation is constantly within the preset neuromuscular response threshold. The present application eliminates the phase lag and drift phenomenon between the audio-visual guide signal and the real breathing action of the patient, and enhances the neural drive synchronization of the diaphragm and auxiliary respiratory muscles under the rhythmic audio-visual stimulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of virtual reality, and more specifically to a method and system for psychological counseling in pulmonary rehabilitation nursing based on virtual reality. Background Technology

[0002] In virtual reality pulmonary rehabilitation training, conventional techniques employ visual and auditory guidance mechanisms with fixed time cycles. Specifically, the virtual reality engine pre-sets a fixed cycle for spherical scaling animation or plays voice countdown commands at fixed time intervals. When the patient wears a head-mounted display for training, the visual image plays magnified or reduced visual elements according to a predetermined timeline, while the audio player synchronously outputs left and right channel sounds with a fixed frequency difference. Throughout the rehabilitation training process, the cycle and trigger time of the visual and auditory rhythm signals output by the virtual reality system remain constant; the system lacks the ability to adjust the timing of the visual and auditory signal output based on the patient's actual breathing movements.

[0003] In the aforementioned conventional technical solutions, due to pathological differences in the actual respiratory cycles of patients with different lung diseases, and the dynamic changes in the respiratory rhythm of the same patient during rehabilitation, a time difference inevitably arises between the fixed-cycle audiovisual guidance signal and the patient's actual inspiratory-expiratory transition point. As training progresses, this time difference accumulates in subsequent respiratory cycles, forming a phase error that diverges over time. This accumulated phase error causes the timing of audiovisual stimulation to deviate from the patient's actual respiratory muscle contraction time, disrupting the temporal binding relationship between the audiovisual rhythm and respiratory muscle movement, and hindering the descending regulatory effect of the cerebral cortex on the rhythmic contraction of the respiratory muscles. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for psychological counseling in pulmonary rehabilitation nursing based on virtual reality, which can solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] A method for psychological counseling in pulmonary rehabilitation nursing based on virtual reality includes: collecting signals of changes in the patient's chest and abdominal circumference, and calculating the respiratory flow curve through bandpass filtering and peak detection algorithms;

[0007] The inspiratory start point, expiratory start point, and breath-holding start point on the respiratory flow curve are identified as the respiratory phase inflection points.

[0008] An audiovisual generation component is established, comprising a virtual fluid particle system and a binaural beat sound generator. When the inhalation start point is detected, the virtual fluid particle system is controlled to generate a motion trajectory converging from the periphery of the screen to the center and triggering the binaural beat sound at a first frequency. When the exhalation start point is detected, the virtual fluid particle system is controlled to generate the motion trajectory spreading from the center of the screen to the periphery and triggering the binaural beat sound at a second frequency.

[0009] A digital phase-locked loop (PLL) mechanism is introduced, using the breathing phase inflection point as the reference clock signal of the PLL and the actual presentation time of the virtual audiovisual stimulus as the output signal of the voltage-controlled oscillator. The rendering pipeline delay of the audiovisual generation component is adjusted through closed-loop feedback, so that the phase delay of the virtual audiovisual stimulus is kept constant within a preset neuromuscular response threshold.

[0010] Preferably, the step of acquiring the patient's chest and abdominal circumference change signal and calculating the respiratory flow curve through bandpass filtering and peak detection algorithm includes: synchronously acquiring the original chest and abdominal circumference voltage signal through a piezoelectric sensor attached to the patient's sternal manubrium and xiphoid process;

[0011] Differential operation is performed on the original chest and abdominal circumference voltage signal to extract the relative displacement features of the respiratory motion direction, and Butterworth bandpass filter is applied to the relative displacement features to filter out non-respiratory frequency motion artifacts caused by patient position movement;

[0012] The filtered relative displacement features are subjected to time window sliding truncation. Local extreme points are found within the time window using interpolation. The rate of change of slope between adjacent local extreme points is differentiated to generate a continuous respiratory flow curve. The length of the time window is dynamically and adaptively adjusted according to the variance of the patient's historical respiratory cycles.

[0013] Preferably, identifying the inspiratory start point, expiratory start point, and breath-holding start point on the respiratory flow curve as respiratory phase inflection points includes: performing zero-crossing detection on the respiratory flow curve, and marking the inspiratory start point when the flow value crosses the zero baseline from negative to positive and the absolute value of the slope is greater than a preset acceleration threshold.

[0014] When the flow rate value crosses the zero baseline from positive to negative and remains near the zero value for a duration exceeding the breath-holding time threshold, it is marked as the breath-holding start point.

[0015] When the flow rate value crosses the minimum point before the zero baseline from negative to positive and the flow rate change rate corresponding to the minimum point is in a preset flat range, the correction mark is set as the exhalation start point.

[0016] The inhalation start point, the exhalation start point, and the breath-holding start point are stored in a circular buffer queue according to the timestamp sequence.

[0017] Preferably, controlling the virtual fluid particle system to generate a motion trajectory converging from the periphery of the screen to the center includes: constructing a three-dimensional particle emission pool in the virtual reality space, wherein the boundary of the three-dimensional particle emission pool conforms to the edge contour distribution of the virtual reality head-mounted display's field of view.

[0018] Upon receiving the trigger signal from the inhalation initiation point, each particle in the three-dimensional particle emission pool is given a radial vector force pointing towards the three-dimensional coordinates of the field of view center, and the particle is given a transparency attenuation factor that decreases with distance.

[0019] In each rendering frame, the spatial position of the particle is updated according to the radial vector force, and the alpha channel value of the particle is updated according to the transparency attenuation factor, so that the particle presents a fluid aggregation visual effect that gradually changes from explicit to implicit as it moves toward the center of the field of view.

[0020] Preferably, the binaural beat sound that triggers the first frequency includes: playing a fundamental carrier frequency in the left channel of the virtual reality headset, and playing a modulation wave frequency of the fundamental carrier frequency superimposed on the first frequency in the right channel of the virtual reality headset.

[0021] When the inhalation start point is detected, the basic carrier frequency is locked at the center frequency of the alpha band that can induce an assimilation effect in brain waves, and the first frequency is set to a dynamic frequency value that matches the current real-time breathing rate.

[0022] A time-domain audio stream is generated by performing an inverse fast Fourier transform on the left channel signal and the right channel signal. The time-domain audio stream is then sent to the mixer of the virtual reality audio engine. The mixer controls the fade-in and fade-out envelopes of the time-domain audio stream to align with the timestamp of the inhalation start point.

[0023] Preferably, the introduction of the digital phase-locked loop mechanism, using the respiratory phase inflection point as the reference clock signal of the digital phase-locked loop and the actual presentation time of the virtual audiovisual stimulus as the output signal of the voltage-controlled oscillator, includes: in the phase detector of the digital phase-locked loop, calculating the difference between the timestamp of the respiratory phase inflection point and the timestamp of the actual presentation time of the virtual audiovisual stimulus, and generating a phase error signal.

[0024] The phase error signal is input into a loop filter composed of a proportional-integral controller to filter out high-frequency breathing vibration noise in the phase error signal and output a smooth control voltage signal.

[0025] The control voltage signal is mapped to a clock cycle adjustment coefficient, and the clock cycle adjustment coefficient is injected into the voltage-controlled oscillator to dynamically change the rendering clock frequency of the audiovisual generation component.

[0026] Preferably, adjusting the rendering pipeline delay of the audiovisual generation component through closed-loop feedback includes: obtaining the clock cycle adjustment coefficient and separating the clock cycle adjustment coefficient into a graphics rendering pipeline adjustment factor and an audio rendering pipeline adjustment factor.

[0027] For the graphics rendering pipeline, non-critical geometry shading stages in the graphics rendering pipeline are dynamically skipped based on the graphics rendering pipeline adjustment factor, thereby shortening the fixed waiting period from vertex data processing to the rasterization stage.

[0028] For the audio rendering pipeline, the queue depth of the audio buffer is adjusted according to the audio rendering pipeline adjustment factor. When the clock cycle adjustment coefficient indicates that acceleration is needed, the data block size of the audio buffer is reduced to reduce the audio data assembly time, so that the time difference between the output of the graphics rendering pipeline and the audio rendering pipeline converges to a fixed constant.

[0029] Preferably, upon receiving the trigger signal of the exhalation initiation point, each particle in the three-dimensional particle emission pool is assigned a centrifugal vector force pointing from the three-dimensional coordinates of the field of view center to the edge contour of the field of view.

[0030] The instantaneous absolute value of the respiratory flow rate curve is obtained in real time, and the normalized instantaneous absolute value of the flow rate is used as the force scaling factor of the centrifugal vector force.

[0031] In each rendering frame, the spatial position of the particle is updated according to the product of the force scaling factor and the centrifugal vector force, so that when the patient's expiratory airflow rate increases, the diffusion radius of the particle in the virtual space increases proportionally, and when the patient's expiratory airflow rate decreases, the diffusion rate of the particle decreases accordingly, forming a dynamic divergent visual feedback coupled with the actual expiratory work intensity of the patient.

[0032] Preferably, storing the inhalation start point, the exhalation start point, and the breath-holding start point into a circular buffer queue according to a timestamp sequence includes: setting a sliding observation window in the circular buffer queue, wherein the sliding observation window continuously extracts the latest three consecutive phase transition points;

[0033] When the order of the three phase inflection points extracted within the sliding observation window violates the physiological timing logic of inhalation, breath-holding, and exhalation, a phase misidentification event is determined to have occurred.

[0034] When the phase misidentification event occurs, the latest abnormal phase inflection point stored in the sliding observation window is discarded, and the write pointer of the circular buffer queue is locked to prevent the writing of new phase inflection points until the next phase inflection point that conforms to the physiological timing logic is reached. This releases the write pointer and maintains the timing continuity of the reference clock signal input to the digital phase-locked loop.

[0035] A virtual reality-based pulmonary rehabilitation nursing psychological counseling system includes: a respiratory signal acquisition device for acquiring the patient's chest and abdominal circumference change signal, and calculating the respiratory flow curve through bandpass filtering and peak detection algorithm;

[0036] A phase inflection point identification device is used to identify the inspiratory start point, expiratory start point, and breath-holding start point on the respiratory flow curve as respiratory phase inflection points.

[0037] An audiovisual generation component includes a virtual fluid particle system and a binaural beat sound generator. When the inhalation start point is detected, the virtual fluid particle system is controlled to generate a motion trajectory converging from the periphery of the screen to the center and triggering the binaural beat sound at a first frequency. When the exhalation start point is detected, the virtual fluid particle system is controlled to generate a motion trajectory spreading from the center of the screen to the periphery and triggering the binaural beat sound at a second frequency.

[0038] A digital phase-locked loop controller is used to adjust the rendering pipeline delay of the audiovisual generation component through closed-loop feedback, using the breathing phase inflection point as a reference clock signal and the actual presentation time of the virtual audiovisual stimulus as the output signal of the voltage-controlled oscillator, so that the phase delay of the virtual audiovisual stimulus is kept constant within a preset neuromuscular response threshold.

[0039] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0040] 1. This invention introduces a digital phase-locked loop (PLL) mechanism, using the respiratory phase inflection point as a reference clock signal and the actual presentation time of the virtual audiovisual stimulus as the output signal of a voltage-controlled oscillator. Through closed-loop feedback, the rendering pipeline delay of the audiovisual generation component is dynamically adjusted, ensuring that the phase delay of the virtual audiovisual stimulus remains constant within a preset neuromuscular response threshold. This technique eliminates phase lag and phase drift between the audiovisual guidance signal and the patient's actual breathing movements, ensuring that the triggering time of the virtual fluid particle motion trajectory and the playback time of the binaural beat sound are locked at the patient's actual inhalation and exhalation initiation points. This establishes a temporal binding between the audiovisual rhythm and respiratory muscle movement, enhancing the neural drive synchronization of the diaphragm and accessory respiratory muscles under rhythmic audiovisual stimulation.

[0041] 2. This invention filters out non-respiratory frequency motion artifacts caused by patient positional changes by performing differential operations and bandpass filtering on the chest and abdominal circumference voltage signal. Furthermore, it filters out high-frequency respiratory tremor noise in the phase error signal in the digital phase-locked loop (PLL) loop filter, ensuring the smoothness of the control voltage signal input to the voltage-controlled oscillator (VCO). By using a sliding observation window within a ring buffer queue to discard abnormal phase inflection points that violate physiological timing logic and locking the write pointer, the timing continuity of the reference clock signal input to the PLL is maintained. By combining the instantaneous absolute value of the respiratory flow curve with the centrifugal vector force of the virtual fluid particles for force scaling, the spatial diffusion radius of the particles matches the actual expiratory work intensity of the patient, providing dynamic visual feedback coupled with the physiological state. Attached Figure Description

[0042] Figure 1 This is the main flowchart of a virtual reality-based pulmonary rehabilitation nursing psychological counseling method;

[0043] Figure 2 Flowchart for calculating respiratory flow rate curves and identifying phase inflection points;

[0044] Figure 3 Flowchart for generating audiovisual components;

[0045] Figure 4 Here is a flowchart of a digital phase-locked loop closed-loop feedback control system.

[0046] Figure 5 Adjust the rendering pipeline delay flowchart;

[0047] Figure 6 This is a flowchart of expiratory dynamic feedback and abnormal phase handling. Detailed Implementation

[0048] Please refer to Figure 1 The virtual reality-based pulmonary rehabilitation nursing psychological counseling method disclosed in this specific embodiment can run on a virtual reality computing platform with real-time graphics rendering and audio processing capabilities, and is equipped with a wearable physiological signal acquisition module. It is used for respiratory training and psychological counseling scenarios during the postoperative or home rehabilitation phase for patients with respiratory diseases such as chronic obstructive pulmonary disease and interstitial lung disease. The following provides a complete and clear description of the technical solution of this invention. The described embodiments are partial, not all, implementations of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0049] Please refer to Figure 2The virtual reality-based pulmonary rehabilitation nursing and psychological counseling system includes a respiratory signal acquisition device, a phase inflection point recognition device, an audiovisual generation component, and a digital phase-locked loop (PLL) controller. The respiratory signal acquisition device establishes a wired or wireless data transmission link with a wearable sensing unit on the patient's body surface. The input of the phase inflection point recognition device is electrically connected to the output of the respiratory signal acquisition device. The output of the phase inflection point recognition device is electrically connected to the trigger input of the audiovisual generation component and the reference signal input of the PLL controller, respectively. The output of the audiovisual generation component is electrically connected to the graphics rendering pipeline and audio rendering pipeline of the virtual reality headset. The control output of the PLL controller is electrically connected to the rendering clock control of the audiovisual generation component, and the feedback input of the PLL controller is electrically connected to the rendering completion signal output of the audiovisual generation component.

[0050] The respiratory signal acquisition device collects signals of changes in the patient's chest and abdominal circumference and calculates the respiratory flow curve using bandpass filtering and peak detection algorithms. Specifically, the respiratory signal acquisition device collects electrical signals corresponding to changes in chest and abdominal circumference through a sensing unit attached to the patient's body surface. The raw voltage signal output by the sensing unit has a linear relationship with the amount of change in chest and abdominal circumference; a positive voltage change is output when the circumference expands, and a negative voltage change is output when the circumference contracts. The respiratory signal acquisition device preprocesses the raw voltage signal, including DC component removal and baseline correction. DC component removal is achieved by calculating the mean of a historical signal sequence of a preset length and subtracting this mean from the original signal sequence. Baseline correction is achieved by fitting the low-frequency baseline trend of the signal sequence and subtracting the fitted baseline trend from the original signal sequence.

[0051] The respiratory signal acquisition device performs bandpass filtering on the preprocessed signal. The bandpass filtering adopts a Butterworth filter. The passband range of the filter corresponds to the frequency range of normal human respiratory movements. The lower limit frequency of the passband is set to 0.1Hz, the upper limit frequency of the passband is set to 2.0Hz, and the filter order is set to 4th order to achieve a flat amplitude-frequency response in the passband and rapid attenuation in the stopband, thereby filtering out motion artifacts in non-respiratory frequency bands caused by patient positional movement and muscle tremors in the original signal.

[0052] The respiratory signal acquisition device performs peak detection on the filtered signal and calculates the respiratory flow rate curve. Specifically, respiratory flow rate corresponds to the rate of change of chest and abdominal circumference over time, i.e., the first derivative of circumference displacement with respect to time. The respiratory signal acquisition device samples the filtered circumference displacement signal at equal time intervals, with the sampling frequency consistent with the original signal. The displacement difference between adjacent sampling points is calculated, and the difference is divided by the time interval between adjacent sampling points to obtain the instantaneous respiratory flow rate value at the corresponding sampling time. The instantaneous respiratory flow rate values ​​at all sampling times are arranged in chronological order to generate a continuous respiratory flow rate curve. The calculation process of respiratory flow rate is achieved through the following formula:

[0053]

[0054] Where v(t) is the instantaneous respiratory flow rate at time t, and x(t) is the relative displacement of the chest and abdomen circumference at time t. This represents the sampling time interval.

[0055] The phase inflection point identification device identifies the inspiratory initiation point, expiratory initiation point, and breath-holding initiation point on the respiratory flow curve as respiratory phase inflection points. Specifically, the device performs zero-crossing detection on the respiratory flow curve to establish a zero baseline. The zero baseline corresponds to a horizontal straight line with a flow rate of 0, representing the moment when the chest and abdominal circumference remains unchanged and respiratory movement is at rest. When the value of the respiratory flow curve crosses the zero baseline from negative to positive, it is determined as the initiation moment of the inspiratory action and marked as the inspiratory initiation point; when the value of the respiratory flow curve crosses the zero baseline from positive to negative, it is determined as the initiation moment of the expiratory action and marked as the expiratory initiation point; when the value of the respiratory flow curve remains within a preset range near the zero baseline for a duration exceeding a preset time threshold, it is determined as the initiation moment of the breath-holding phase of the respiratory movement and marked as the breath-holding initiation point. The phase transition point identification device assigns a corresponding timestamp to each identified respiratory phase transition point. The accuracy of the timestamp is consistent with the sampling accuracy of the respiratory signal. All respiratory phase transition points form a time sequence according to the order of the timestamps and are output to the audiovisual generation component and the digital phase-locked loop controller.

[0056] refer to Figure 3The audiovisual generation component includes a virtual fluid particle system and a binaural beat generator. Upon detecting the start of inhalation, the virtual fluid particle system generates a motion trajectory converging from the periphery of the screen towards the center, triggering a first-frequency binaural beat. Upon detecting the start of exhalation, the virtual fluid particle system generates a motion trajectory spreading outwards from the center of the screen, triggering a second-frequency binaural beat. Specifically, the audiovisual generation component constructs a virtual fluid particle system in the three-dimensional space of the virtual reality engine. This virtual fluid particle system includes a three-dimensional particle emission pool, a particle attribute management module, and a particle motion update module. The spatial range of the three-dimensional particle emission pool perfectly matches the field of view of the virtual reality headset, and the boundary of the emission pool conforms to the edge contour of the field of view, ensuring that the particle emission range covers the entire visual area visible to the patient through the headset. The particle attribute management module assigns a unique identifier to each particle in the emission pool, and initializes the spatial position coordinates, motion vector, transparency, lifespan and rendering level attributes for each particle. The initial spatial positions of all particles are evenly distributed at the boundary of the three-dimensional particle emission pool, the initial motion vector is zero, the initial transparency is 1.0, and the initial lifespan corresponds to 1.5 times the duration of a normal human breathing cycle, ensuring that the particle movement process fully covers the entire cycle of a single inhalation or exhalation.

[0057] The particle motion update module updates the attributes of each particle in real time, using rendering frames from the virtual reality engine as units. Upon receiving a trigger signal from the inhalation start point, the module generates a radial vector force for each particle in the 3D particle emission pool, pointing towards the 3D coordinates of the field of view center. The direction of the radial vector force is from the particle's current spatial position coordinates to a fixed 3D coordinate at the field of view center. The magnitude of the radial vector force is positively correlated with the distance from the particle's current position to the field of view center, ensuring that particles farther from the center receive greater motion driving force, achieving particle convergence from the periphery of the screen towards the center. In each rendering frame, the module calculates the particle acceleration based on the radial vector force, combines it with the particle velocity from the previous rendering frame to calculate the particle velocity in the current frame, and then updates the particle's spatial position coordinates. Simultaneously, it assigns a transparency attenuation factor to the particles that decreases with distance. The value of the transparency attenuation factor is positively correlated with the distance from the particle's current position to the field of view center. As the particle moves towards the center, the distance gradually decreases, the transparency attenuation factor gradually decreases, and the particle's alpha channel value decreases accordingly, presenting a fluid convergence visual effect that gradually transitions from explicit to implicit.

[0058] Upon receiving the trigger signal from the exhalation initiation point, the particle motion update module generates a centrifugal vector force for each particle in the 3D particle emission pool. This force originates from the 3D coordinates of the field of view's center and points towards the edge of the field of view. The direction of the centrifugal vector force is from the fixed 3D coordinates of the field of view's center to the particle's current spatial position coordinates. The magnitude of the centrifugal vector force is positively correlated with the distance from the particle's current position to the center of the field of view. In each rendering frame, the particle motion update module calculates the particle's acceleration based on the centrifugal vector force, combines this with the particle velocity from the previous rendering frame to calculate the particle velocity in the current rendering frame, and then updates the particle's spatial position coordinates. Simultaneously, it assigns the particle an increasing transparency gain factor with distance. The value of the transparency gain factor is positively correlated with the distance from the particle's current position to the center of the field of view. As the particle moves towards the edge, the distance gradually increases, the transparency gain factor gradually rises, and the particle's alpha channel value increases accordingly, presenting a fluid diffusion visual effect that gradually transitions from latent to explicit.

[0059] The built-in binaural beat generator in the audiovisual generation component includes a carrier frequency generation module, a modulation frequency generation module, a time-domain signal conversion module, and an audio mixing module. The basic working principle of the binaural beat generator is as follows: sinusoidal wave signals with slight frequency differences are played in the left and right channels respectively. The patient's auditory system perceives the beat signal corresponding to the two frequency differences in the cerebral cortex. This beat signal can guide brainwaves to produce an assimilation effect, regulating the patient's neural excitation state. The binaural beat frequency perceived by the patient is achieved through the following formula:

[0060]

[0061] in, The beat frequency perceived by the patient in both ears. This refers to the signal frequency played in the right channel. This is the frequency of the signal played in the left channel.

[0062] Upon receiving the trigger signal at the start of inhalation, the carrier frequency generation module of the binaural beat generator outputs a fixed fundamental carrier frequency, and the modulation frequency generation module outputs a modulation wave frequency of the first frequency. The left channel plays a sine wave signal corresponding to the fundamental carrier frequency, and the right channel plays a sine wave signal resulting from the superposition of the fundamental carrier frequency and the first frequency. At this time, the binaural beat frequency perceived by the patient is the first frequency. The value of the first frequency matches the patient's current respiratory rate; specifically, the value of the first frequency is equal to the reciprocal of the patient's current respiratory cycle, ensuring that the rhythm of the binaural beat is synchronized with the rhythm of the patient's inhalation. Upon receiving the trigger signal at the start of exhalation, the modulation frequency generation module outputs a modulation wave frequency of the second frequency, and the right channel plays a sine wave signal resulting from the superposition of the fundamental carrier frequency and the second frequency. At this time, the binaural beat frequency perceived by the patient is the second frequency. The value of the second frequency is lower than the value of the first frequency, matching the parasympathetic activation state corresponding to the exhalation action.

[0063] The time-domain signal conversion module performs an inverse fast Fourier transform on the frequency domain signals of the left and right channels to generate a continuous time-domain audio stream. The sampling rate of the time-domain audio stream is consistent with the standard sampling rate of the virtual reality audio engine. The audio mixing module sends the generated time-domain audio stream to the mixer of the virtual reality audio engine. The mixer sets fade-in and fade-out envelopes for the audio stream, ensuring that the start time of the fade-in is perfectly aligned with the timestamp of the start of inspiration or expiration, and the end time of the fade-out is perfectly aligned with the timestamp of the next respiratory phase transition point, ensuring that the playback cycle of the binaural beats perfectly matches the patient's respiratory cycle.

[0064] refer to Figure 4 The digital phase-locked loop (PLL) controller introduces a PLL mechanism, using the respiratory phase inflection point as the reference clock signal for the PLL and the actual presentation time of the virtual audiovisual stimulus as the output signal of the voltage-controlled oscillator (VCO). Through closed-loop feedback, it adjusts the rendering pipeline delay of the audiovisual generation component, keeping the phase delay of the virtual audiovisual stimulus constant within a preset neuromuscular response threshold. Specifically, the PLL controller comprises three core modules: a phase detector, a loop filter, and a VCO. The PLL controller operates as a closed-loop feedback control process. The first input of the phase detector receives the respiratory phase inflection point timing sequence output by the phase inflection point identification device, which serves as the reference clock signal for the PLL. Each rising edge of the reference clock signal corresponds to a timestamp of a respiratory phase inflection point. The second input of the phase detector receives the rendering completion signal output by the audiovisual generation component. The rising edge of the rendering completion signal corresponds to the actual presentation time of the virtual audiovisual stimulus, that is, the moment when the first frame of motion of the virtual fluid particle system is rasterized and output to the head-mounted display screen, and the moment when the first frame of audio data of the binaural beat is converted from digital to analog and output to the head-mounted display headphones. The rendering completion signal serves as the output signal of the voltage-controlled oscillator of the digital phase-locked loop.

[0065] The phase detector calculates the time difference between the rising edge timestamp of the reference clock signal and the rising edge timestamp of the voltage-controlled oscillator output signal, generating a phase error signal. The phase error is calculated using the following formula:

[0066]

[0067] in, This is the phase error signal corresponding to the nth respiratory cycle. This is the timestamp of the nth breathing phase inflection point. This is the timestamp of the actual presentation time of the virtual audiovisual stimulus corresponding to the nth breathing cycle.

[0068] The loop filter employs a proportional-integral controller to filter the phase error signal output from the phase detector, removing high-frequency noise components caused by patient breathing tremors and phase recognition jitter, and outputting a smooth control voltage signal. The calculation of the control voltage signal is achieved through the following formula:

[0069]

[0070] Where u(n) is the control voltage signal corresponding to the nth respiratory cycle. This is the proportionality coefficient. The integral coefficient is... This is the sum of the phase error signals from the 1st to the nth respiratory cycle.

[0071] refer to Figure 5 The voltage-controlled oscillator (VCO) receives the control voltage signal output from the loop filter and maps it to a clock cycle adjustment coefficient. The clock cycle adjustment coefficient has a linear relationship with the value of the control voltage signal. The VCO injects the clock cycle adjustment coefficient into the rendering clock control terminal of the audiovisual generation component, dynamically adjusting the rendering clock frequency of the audiovisual generation component, thereby adjusting the total delay of the rendering pipeline. The adjustment process of the rendering clock frequency is achieved through the following formula:

[0072]

[0073] in, The rendering clock frequency for the nth breathing cycle. The rendering clock reference frequency is K(n), which is the clock cycle adjustment coefficient corresponding to the nth breathing cycle.

[0074] Specifically, when the clock cycle adjustment coefficient indicates a phase delay greater than a preset neuromuscular response threshold, the voltage-controlled oscillator (VCO) increases the rendering clock frequency, shortens the rendering pipeline's processing cycle, and reduces the rendering latency of virtual audiovisual stimuli. Conversely, when the clock cycle adjustment coefficient indicates a phase delay less than the preset neuromuscular response threshold, the VCO decreases the rendering clock frequency, lengthens the rendering pipeline's processing cycle, and increases the rendering latency of virtual audiovisual stimuli. Through this closed-loop feedback control process, the phase delay of virtual audiovisual stimuli is consistently controlled within the preset neuromuscular response threshold.

[0075] In this embodiment, the functions and input / output parameters of the core module of the digital phase-locked loop are shown in the following table:

[0076] Table 1. Correspondence between the functions and input / output parameters of the core module of the digital phase-locked loop.

[0077]

[0078] The table above clearly defines the input and output logic and core functions of each module of the digital phase-locked loop. Those skilled in the art can use this table to completely reproduce the closed-loop control process of the digital phase-locked loop and ensure the stable implementation of the phase-locking function.

[0079] In this embodiment, the entire process of respiratory signal acquisition and processing, respiratory phase inflection point identification, audiovisual stimulus generation and digital phase-locked loop closed-loop control is fully realized. The respiratory phase inflection point, as a reference clock signal, realizes phase locking between virtual audiovisual stimulation and the patient's real breathing movements, ensuring that the time binding relationship between audiovisual rhythm and respiratory muscle movement is stably maintained.

[0080] In one optional embodiment, the respiratory signal acquisition device synchronously acquires raw chest and abdominal circumference voltage signals using two piezoelectric sensors attached to the patient's sternal manubrium and xiphoid process. The piezoelectric sensor at the sternal manubrium corresponds to the respiratory movements of the patient's chest, and the piezoelectric sensor at the xiphoid process corresponds to the respiratory movements of the patient's abdomen. The sampling frequencies of the two sensors are kept consistent, and the sampling trigger signals are synchronized to ensure that the timestamps of the two raw voltage signals are perfectly aligned.

[0081] The respiratory signal acquisition device performs differential calculations on two raw chest and abdominal circumference voltage signals to extract the relative displacement features in the direction of respiratory motion. The differential calculation process involves subtracting the voltage signal from the xiphoid process sensor from the voltage signal from the sensor at the sternal manubrium, resulting in a differential signal sequence. Since motion artifacts in the chest and abdomen caused by patient positional movement exhibit unidirectional changes, while circumference changes in the chest and abdomen caused by respiratory motion exhibit inverse changes, differential calculations can effectively cancel out unidirectional positional motion artifacts while preserving inverse respiratory motion features, thus improving the signal-to-noise ratio of the respiratory signal. The calculation process for the differential relative displacement features is achieved through the following formula:

[0082]

[0083] in, The difference relative displacement characteristics at time t. Let t be the girth displacement value corresponding to the original voltage signal of the sensor at the manubrium of the sternum. Let t be the girth displacement value corresponding to the original voltage signal of the sensor at the xiphoid process.

[0084] The respiratory signal acquisition device applies a Butterworth bandpass filter to the differential relative displacement features to filter out motion artifacts in non-respiratory frequency bands caused by patient positional changes. The passband range of the Butterworth bandpass filter is adaptively adjusted based on the patient's age, disease type, and historical respiratory data. The lower passband frequency ranges from 0.05Hz to 0.2Hz, and the upper passband frequency ranges from 1.5Hz to 3.0Hz. The filter order can be configured between 2nd and 8th order to adapt to the respiratory signal characteristics of different patients. The filtering process uses a zero-phase filtering method, that is, the differential relative displacement feature sequence is first forward filtered, and then the forward-filtered sequence is reverse-filtered to eliminate the phase delay introduced by the filtering process and ensure that the phase of the filtered signal is completely aligned with the original respiratory signal.

[0085] The respiratory signal acquisition device performs time-window truncation on the filtered relative displacement features. The sliding step size of the window is consistent with the sampling step size of the signal, ensuring that each sampling point is included within the corresponding time window. Within each time window, the respiratory signal acquisition device uses cubic spline interpolation to interpolate the discrete displacement signal sequence, generating a continuous displacement fitting curve. Cubic spline interpolation ensures that the first and second derivatives of the fitting curve are continuous at each interpolation node, avoiding signal distortion introduced during the interpolation process.

[0086] In the continuous displacement fitting curve generated by interpolation, the respiratory signal acquisition device searches for local extrema, which include local maxima and local minima. Local maxima correspond to the maximum expansion of the chest and abdomen circumference, i.e., the end of inhalation, while local minima correspond to the minimum contraction of the chest and abdomen circumference, i.e., the end of exhalation. The respiratory signal acquisition device calculates the rate of change of the slope of the displacement fitting curve between adjacent local extrema. This rate of change is the first derivative of displacement with respect to time, corresponding to the respiratory flow rate. The respiratory flow rate values ​​at all time points are arranged in chronological order to generate a continuous respiratory flow rate curve.

[0087] The length of the time window is dynamically and adaptively adjusted based on the variance of the patient's historical respiratory cycles. Specifically, the respiratory signal acquisition device counts the duration of a preset number of respiratory cycles from the past and calculates the variance of the respiratory cycle duration. The larger the variance, the more unstable the patient's respiratory rhythm, and the longer the time window becomes to cover the complete respiratory cycle and ensure the accuracy of identifying local extreme points. Conversely, the smaller the variance, the more stable the patient's respiratory rhythm, and the shorter the time window becomes to improve the real-time performance of the respiratory flow curve and reduce signal processing latency. The adaptive adjustment process of the time window length is achieved through the following formula:

[0088]

[0089] in, The time window length is adaptively adjusted. The preset base time window length, k is the preset scaling factor. This represents the standard deviation of the patient's historical respiratory cycle duration.

[0090] The phase inflection point identification device detects zero-crossing points on the respiratory flow curve, establishing a zero baseline, which corresponds to a horizontal straight line with a flow rate of 0. When the flow rate crosses the zero baseline from negative to positive, and the absolute value of the slope of the flow curve at the moment of crossing is greater than a preset acceleration threshold, it is marked as the inspiratory initiation point. The preset acceleration threshold is adaptively set based on the maximum slope of the patient's historical respiratory flow curves, ensuring that the inspiratory initiation point is only marked when the acceleration at the start of the inspiratory action reaches a physiologically reasonable range, thus avoiding false markings caused by signal noise.

[0091] When the flow rate crosses the zero baseline from positive to negative and remains near the zero value for a duration exceeding the breath-holding time threshold, it is marked as the breath-holding start point. The preset range near the zero value is... ,in The preset flow rate threshold is adaptively set based on the noise level of the patient's respiratory signal. The breath-holding time threshold is configured according to the patient's rehabilitation training plan, with a value range of 0.5s to 3.0s. Breath-holding is only considered to have started when the flow rate value remains within the preset range for a duration exceeding the breath-holding time threshold, thus marking the start point of breath-holding and avoiding false markings caused by signal fluctuations near the zero point of respiratory flow.

[0092] When the flow rate crosses the minimum point before the zero baseline from negative to positive, and the rate of change of flow rate corresponding to this minimum point is within a preset flat range, the point is corrected and marked as the expiratory initiation point. Specifically, after the flow rate crosses the zero baseline from positive to negative, it enters the deceleration phase of the expiratory action, gradually decreasing to a minimum value, and then crosses the zero baseline from negative to positive, entering the initiation phase of the next inhalation action. This minimum point corresponds to the end time of the expiratory action, i.e., the corrected marking time of the expiratory initiation point. The preset flat range corresponds to the range of values ​​where the rate of change of flow rate is close to zero. Only when the rate of change of flow rate at the minimum point is within this range is the minimum point marked as the expiratory initiation point, ensuring that the identification of the expiratory initiation point is completely aligned with the patient's actual expiratory initiation time.

[0093] refer to Figure 6 The phase transition point identification device stores the identified inspiratory start point, expiratory start point, and breath-hold start point into a circular buffer queue according to a timestamp sequence. The storage depth of the circular buffer queue is set according to the patient's maximum number of respiratory cycles, and it can store a preset number of consecutive respiratory phase transition points. The queue's write and read pointers use a circular addressing method. When the write pointer reaches the maximum address of the queue, it automatically jumps to the beginning address of the queue, realizing the circular storage of data.

[0094] A sliding observation window is set in the circular buffer queue. The length of the sliding observation window is three consecutive phase inflection point storage units. The sliding observation window slides synchronously with the write operation of the queue, continuously retrieving the three most recently stored consecutive phase inflection points. The three phase inflection points stored in the sliding observation window correspond to three consecutive respiratory phase inflection points with timestamps from earliest to latest, in the order of writing.

[0095] The phase transition point identification device verifies the type of the three phase transition points within the sliding observation window. Under normal physiological conditions, the arrangement of respiratory phase transition points follows the physiological sequence logic of inspiration, breath-holding, and expiration. That is, the initiation point of inspiration is followed by the initiation point of breath-holding, the initiation point of expiration is followed by the initiation point of expiration, and so on. When the arrangement of the three phase transition points extracted within the sliding observation window violates the above physiological sequence logic, a phase misidentification event is determined to have occurred. For example, if there is no initiation point of breath-holding or expiration between two consecutive initiation points within the sliding observation window, or if the initiation point of breath-holding appears after the initiation point of expiration, both are determined to be phase misidentification events.

[0096] When a phase misidentification event occurs, the phase inflection point identification device discards the most recently stored abnormal phase inflection point within the sliding observation window and simultaneously locks the write pointer of the circular buffer queue, preventing new phase inflection points from being written to the queue. During the write pointer locking period, the phase inflection point identification device continuously performs timing logic verification on newly identified phase inflection points until the next phase inflection point conforming to physiological timing logic arrives. At this point, the write pointer is released, the write operation of the queue is resumed, and the phase inflection point conforming to timing logic is stored in the queue. This process effectively eliminates abnormal phase inflection points, prevents abnormal signals from being input to the digital phase-locked loop controller, and maintains the timing continuity of the reference clock signal input to the digital phase-locked loop.

[0097] In this embodiment, the determination rules and parameter configurations for identifying respiratory phase inflection points are shown in the table below:

[0098] Table 2. Judgment Rules and Parameter Configuration for Respiratory Phase Inflection Point Identification

[0099]

[0100] The table above clearly defines the determination logic, parameter configuration, and anomaly handling methods for the three types of respiratory phase inflection points. Those skilled in the art can fully reproduce the identification process of respiratory phase inflection points based on this table to ensure the accuracy and stability of the identification results.

[0101] In this embodiment, the signal-to-noise ratio of the respiratory signal is improved by dual-sensor differential operation and adaptive bandpass filtering. High-precision generation of the respiratory flow curve is achieved by cubic spline interpolation and adaptive time window. Accurate identification of respiratory phase inflection points is achieved by multi-condition zero-crossing detection. Abnormal phase inflection points are eliminated by the sliding observation window of the circular buffer queue, ensuring the stability and continuity of the reference clock signal input to the digital phase-locked loop.

[0102] In another alternative embodiment, the audiovisual generation component constructs a three-dimensional particle emission pool in the virtual reality space. The three-dimensional particle emission pool is a cuboid space that conforms to the edge contour of the field of view of the virtual reality head-mounted display. The near plane of the cuboid space completely coincides with the near clipping plane of the virtual camera of the head-mounted display, and the far plane of the cuboid space maintains a preset fixed distance from the far clipping plane of the virtual camera of the head-mounted display. The four boundaries of the cuboid space (top, bottom, left, and right) completely conform to the four edges of the field of view of the head-mounted display, ensuring that the spatial range of the three-dimensional particle emission pool completely covers the entire visual area visible to the patient through the head-mounted display, with no visual blind spots.

[0103] The number of particles in the 3D particle emission pool is adaptively configured based on the rendering performance of the headset. The particle rendering type adopts the bulletin board rendering method, with each particle corresponding to a 2D texture map. The texture map uses a gradient semi-transparent style to ensure that the particles present a fluid visual effect during movement, without obvious graininess. The particle attribute management module initializes the attributes of each particle, including spatial 3D coordinates, motion velocity vector, acceleration vector, transparency alpha value, particle size, and lifespan. The initial spatial 3D coordinates of all particles are evenly distributed on the four boundary planes of the 3D particle emission pool. The initial motion velocity vector and acceleration vector are both zero vectors, the initial transparency alpha value is 1.0, the initial particle size is adaptively set according to the size of the field of view, and the initial lifespan corresponds to 1.2 times the duration of a single breath cycle.

[0104] Upon receiving the trigger signal at the inhalation initiation point, the particle motion update module assigns a radial vector force to each particle in the 3D particle emission pool, pointing towards the 3D coordinates of the field of view center. The 3D coordinates of the field of view center are the 3D coordinates corresponding to the intersection of the virtual camera's optical axis and the virtual camera's near-clipping plane, and these coordinates remain fixed throughout the breathing training process. The direction of the radial vector force is from the particle's current spatial 3D coordinates to the 3D coordinates of the field of view center. The magnitude of the radial vector force is linearly positively correlated with the Euclidean distance from the particle's current spatial position to the field of view center, ensuring that particles farther from the center receive a greater driving force for motion. All particles can synchronously reach the center region of the field of view within the inhalation cycle, achieving a uniform fluid aggregation visual effect.

[0105] Simultaneously, the particle motion update module assigns each particle an opacity attenuation factor that decreases with distance. The value of the opacity attenuation factor is linearly positively correlated with the Euclidean distance from the particle's current spatial position to the center of the field of view, and the value range of the opacity attenuation factor is [0,1]. In each rendering frame, the particle motion update module calculates the particle's acceleration vector based on the radial vector force and the particle's mass. The direction of the acceleration vector is consistent with the direction of the radial vector force, and the magnitude of the acceleration vector is equal to the magnitude of the radial vector force divided by the particle's mass. The particle motion update module updates the particle's motion velocity vector based on the time interval between the acceleration vector and the rendering frame. The update process is implemented through the following formula:

[0106]

[0107] in, The particle velocity vector for the nth rendered frame. For the particle velocity vector of the (n-1)th rendered frame, The particle acceleration vector for the nth rendered frame. This represents the time interval between adjacent rendered frames.

[0108] Subsequently, the particle motion update module updates the spatial three-dimensional coordinates of the particles based on the updated motion velocity vector and the time interval between rendering frames. The update process is implemented using the following formula:

[0109]

[0110] in, Let n be the particle space 3D coordinates in the nth rendering frame. The particle space three-dimensional coordinates are for the (n-1)th rendering frame.

[0111] While updating the particle spatial coordinates, the particle motion update module updates the particle's alpha channel value according to the transparency decay factor. The update formula is that the current frame's alpha value equals the initial alpha value multiplied by the transparency decay factor. As the particle moves towards the center of the field of view, its Euclidean distance from the center gradually decreases, the transparency decay factor gradually decreases, and the particle's alpha channel value decreases accordingly. The particle gradually transitions from completely visible to completely invisible, achieving a smooth disappearance effect in the central region of the field of view, forming a continuous fluid convergence visual feedback.

[0112] Upon receiving the trigger signal from the exhalation initiation point, the particle motion update module assigns a centrifugal vector force to each particle in the three-dimensional particle emission pool, pointing from the three-dimensional coordinates of the field of view center to the edge contour of the field of view. The direction of the centrifugal vector force is from the three-dimensional coordinates of the field of view center to the particle's current spatial three-dimensional coordinates, and the initial magnitude of the centrifugal vector force is linearly positively correlated with the Euclidean distance from the particle's current spatial position to the center of the field of view.

[0113] The particle motion update module acquires the instantaneous absolute value of the respiratory flow curve in real time, normalizes the instantaneous absolute value of the flow rate, and uses the maximum expiratory flow rate absolute value within the patient's historical respiratory cycles as the benchmark for normalization. The normalized value ranges from [0,1] and is used as the scaling factor for the centrifugal vector force. In each rendering frame, the particle motion update module multiplies the initial magnitude of the centrifugal vector force by the scaling factor to obtain the actual magnitude of the centrifugal vector force in the current rendering frame. Based on this actual magnitude of the centrifugal vector force, the particle's acceleration vector is calculated, and the particle's velocity vector and spatial three-dimensional coordinates are updated accordingly.

[0114] When the patient's expiratory flow rate increases, the absolute value of the instantaneous flow velocity increases, the value of the force scaling factor increases accordingly, the actual magnitude of the eccentric vector force increases proportionally, the particle's acceleration and velocity increase accordingly, and the particle's diffusion radius in virtual space expands proportionally. When the patient's expiratory flow rate decreases, the absolute value of the instantaneous flow velocity decreases, the value of the force scaling factor decreases accordingly, the actual magnitude of the eccentric vector force decreases proportionally, the particle's acceleration and velocity decrease accordingly, and the particle's diffusion velocity decreases accordingly. This particle motion update process completely couples the particle diffusion motion state with the patient's actual expiratory work intensity, forming a dynamic divergent visual feedback that matches the patient's physiological state in real time.

[0115] The built-in binaural beat generator in the audiovisual generation component plays the fundamental carrier frequency in the left channel of the virtual reality headset, and a modulated wave frequency that superimposes the fundamental carrier frequency and a first frequency in the right channel of the virtual reality headset. The fundamental carrier frequency ranges from 200Hz to 1000Hz, which is within the sensitive hearing range of the human ear, ensuring the stable generation of the binaural beat effect.

[0116] Upon detecting the onset of inspiration, the binaural beat generator locks the fundamental carrier frequency at the carrier frequency corresponding to the center frequency of the alpha band. The alpha band's brainwave frequency range is 8Hz to 13Hz, corresponding to the human nervous state of wakefulness and relaxation. Specifically, the fundamental carrier frequency is locked at 440Hz, and the first frequency is set as a dynamic frequency value that matches the current real-time respiratory rate. The current real-time respiratory rate is the reciprocal of the patient's most recent complete respiratory cycle, and the first frequency ranges from 0.1Hz to 0.5Hz, perfectly matching the normal human respiratory rate range.

[0117] The binaural beat generator performs an inverse fast Fourier transform on the fundamental carrier frequency signal of the left channel and the frequency signal modulated by the superposition of the right channel, generating a continuous time-domain audio stream. The sampling rate of the time-domain audio stream is set to 48kHz, consistent with the standard sampling rate of the virtual reality audio engine, and the sampling bit depth is set to 16 bits. The generated time-domain audio stream is sent to the mixer of the virtual reality audio engine. The mixer sets linear fade-in and fade-out envelopes for the audio stream. The duration of the fade-in process is 10% of the inhalation cycle, and the timestamp of the fade-in start point is perfectly aligned with the timestamp of the inhalation start point, ensuring that the start time of the binaural beat is completely synchronized with the start time of the inhalation. The duration of the fade-out process is 10% of the inhalation cycle, and the timestamp of the fade-out end point is perfectly aligned with the timestamp of the next breathing phase transition point, avoiding auditory discomfort caused by abrupt changes in the audio signal.

[0118] Upon detecting the start of exhalation, the binaural beat generator sets the second frequency to a fixed value lower than the first frequency. The second frequency ranges from 0.05Hz to 0.3Hz, corresponding to the slow rhythm of exhalation and matching the relaxed state of parasympathetic activation. The right channel plays a modulated wave frequency that superimposes the fundamental carrier frequency onto the second frequency. The fade-in and fade-out envelopes of the mixer are perfectly aligned with the timestamp of the start of exhalation, ensuring complete synchronization between the binaural beat playback and the exhalation action.

[0119] The phase detector in the digital phase-locked loop controller continuously calculates the difference between the timestamp of the breathing phase inflection point and the timestamp of the actual presentation time of the virtual audiovisual stimulus, generating a phase error signal. The positive or negative value of the phase error signal represents the direction of the phase shift. When the phase error signal is positive, it means that the presentation time of the virtual audiovisual stimulus lags behind the breathing phase inflection point, and the rendering pipeline delay needs to be shortened; when the phase error signal is negative, it means that the presentation time of the virtual audiovisual stimulus is ahead of the breathing phase inflection point, and the rendering pipeline delay needs to be extended.

[0120] The phase error signal is input to a loop filter composed of a proportional-integral controller. The proportional and integral coefficients of the loop filter are adaptively adjusted according to the stability of the patient's respiratory rhythm. When the variance of the patient's respiratory rhythm is large, the integral coefficient is appropriately increased to improve the tracking performance of the loop; when the variance of the patient's respiratory rhythm is small, the proportional coefficient is appropriately increased to improve the response speed of the loop. The loop filter filters out high-frequency respiratory tremor noise in the phase error signal and outputs a smooth control voltage signal. The value range of the control voltage signal is [0, 5V], which perfectly matches the input voltage range of the voltage-controlled oscillator.

[0121] The control voltage signal output by the loop filter is mapped to a clock cycle adjustment coefficient in a linear relationship. The minimum value of the control voltage signal corresponds to the minimum value of the clock cycle adjustment coefficient, and the maximum value corresponds to the maximum value of the clock cycle adjustment coefficient. The clock cycle adjustment coefficient ranges from [0.5, 2.0], representing the scaling factor of the rendering clock frequency relative to the base frequency. The clock cycle adjustment coefficient is injected into the voltage-controlled oscillator (VCO), which dynamically changes the rendering clock frequency of the audiovisual generation component based on the clock cycle adjustment coefficient. The base value of the rendering clock frequency is consistent with the default rendering frame rate of the virtual reality engine, corresponding to the standard refresh rate of the headset.

[0122] The digital phase-locked loop controller acquires the clock cycle adjustment coefficient from the voltage-controlled oscillator output and separates it into a graphics rendering pipeline adjustment factor and an audio rendering pipeline adjustment factor. The allocation ratio of the graphics rendering pipeline adjustment factor and the audio rendering pipeline adjustment factor is set according to the reference delay ratio of the graphics rendering pipeline and the audio rendering pipeline, ensuring that the delay adjustment of the graphics rendering pipeline and the audio rendering pipeline is synchronized, avoiding time differences in the presentation of audiovisual stimuli.

[0123] For the graphics rendering pipeline, the digital phase-locked loop (PLL) controller dynamically skips non-critical geometry shading stages based on the graphics rendering pipeline adjustment factor. These non-critical geometry shading stages include secondary texture sampling of particles, secondary lighting calculations, and ambient occlusion calculations—rendering stages that do not affect the core particle motion trajectory and visual effects. When the graphics rendering pipeline adjustment factor indicates that accelerated rendering is needed, the number of skipped non-critical geometry shading stages increases, the fixed waiting period from vertex data processing to rasterization is shortened, and the overall latency of the graphics rendering pipeline decreases. Conversely, when the graphics rendering pipeline adjustment factor indicates that decelerated rendering is needed, the number of skipped non-critical geometry shading stages decreases, the fixed waiting period is lengthened, and the overall latency of the graphics rendering pipeline increases.

[0124] For the audio rendering pipeline, the digital phase-locked loop (PLL) controller adjusts the queue depth of the audio buffer based on the audio rendering pipeline adjustment factor. The audio buffer stores the temporal audio stream data to be played. The queue depth corresponds to the number of audio data blocks stored in the buffer, and the size of the data block corresponds to a fixed duration of audio data. When the clock cycle adjustment factor indicates that acceleration is needed, the data block size of the audio buffer is reduced, decreasing the audio data assembly time. At the same time, the queue depth is reduced, shortening the waiting time for audio data to go from being written to the buffer to being output to the digital-to-analog converter, thus reducing the overall latency of the audio rendering pipeline. Conversely, when the clock cycle adjustment factor indicates that deceleration is needed, the data block size of the audio buffer is increased, and the queue depth is increased, extending the audio data waiting time, thus increasing the overall latency of the audio rendering pipeline.

[0125] Through the synchronous adjustment of the graphics rendering pipeline and the audio rendering pipeline, the time difference between the output ends of the graphics rendering pipeline and the audio rendering pipeline converges to a fixed constant. The value of this fixed constant is less than 1ms, ensuring that the presentation time of virtual visual stimuli and auditory stimuli is completely synchronized. At the same time, the overall phase delay of virtual visual and auditory stimuli is constantly controlled within a preset neuromuscular response threshold. The value of this neuromuscular response threshold ranges from 10ms to 50ms, corresponding to the range of neural response delay of human respiratory muscles.

[0126] In this embodiment, the correspondence between the attribute parameters and update rules of the virtual fluid particle system is shown in the following table:

[0127] Table 3 Correspondence between Virtual Fluid Particle System Attribute Parameters and Update Rules

[0128]

[0129] The table above clearly defines the core attribute configuration and phased update rules of the virtual fluid particle system. Those skilled in the art can fully reproduce the rendering process of the virtual fluid particle system based on the table to ensure the synchronous coupling of visual feedback and breathing actions.

[0130] In this embodiment, by accurately constructing a three-dimensional particle emission pool and updating particle motion in real time, fluid visual feedback fully coupled with the breathing phase and the intensity of exhalation work is achieved. By adaptively adjusting the frequency of binaural beats and aligning the envelope, auditory stimulation synchronized with breathing movements is achieved. By adjusting the synchronous delay of the graphics rendering pipeline and the audio rendering pipeline, the phase delay of virtual audiovisual stimulation is precisely locked, further stabilizing the temporal binding relationship between audiovisual rhythms and respiratory muscle movements.

Claims

1. A method for psychological counseling in pulmonary rehabilitation nursing based on virtual reality, characterized in that, include: The patient's chest and abdominal circumference changes were collected, and the respiratory flow curve was calculated using bandpass filtering and peak detection algorithms. The inspiratory start point, expiratory start point, and breath-holding start point on the respiratory flow curve are identified as the respiratory phase inflection points. An audiovisual generation component is established, comprising a virtual fluid particle system and a binaural beat sound generator. When the inhalation start point is detected, the virtual fluid particle system is controlled to generate a motion trajectory converging from the periphery of the screen to the center and triggering the binaural beat sound at a first frequency. When the exhalation start point is detected, the virtual fluid particle system is controlled to generate the motion trajectory spreading from the center of the screen to the periphery and triggering the binaural beat sound at a second frequency. A digital phase-locked loop (PLL) mechanism is introduced, using the breathing phase inflection point as the reference clock signal of the PLL and the actual presentation time of the virtual audiovisual stimulus as the output signal of the voltage-controlled oscillator. The rendering pipeline delay of the audiovisual generation component is adjusted through closed-loop feedback, so that the phase delay of the virtual audiovisual stimulus is kept constant within a preset neuromuscular response threshold.

2. The method for psychological counseling in pulmonary rehabilitation nursing based on virtual reality according to claim 1, characterized in that, The process of collecting the patient's chest and abdominal circumference change signal and calculating the respiratory flow curve through bandpass filtering and peak detection algorithm includes: synchronously acquiring the original chest and abdominal circumference voltage signal through piezoelectric sensors attached to the patient's sternal manubrium and xiphoid process. Differential operation is performed on the original chest and abdominal circumference voltage signal to extract the relative displacement features of the respiratory motion direction, and Butterworth bandpass filter is applied to the relative displacement features to filter out non-respiratory frequency motion artifacts caused by patient position movement; The filtered relative displacement features are subjected to time window sliding truncation. Local extreme points are found within the time window using interpolation. The rate of change of slope between adjacent local extreme points is differentiated to generate a continuous respiratory flow curve. The length of the time window is dynamically and adaptively adjusted according to the variance of the patient's historical respiratory cycles.

3. The method for psychological counseling in pulmonary rehabilitation nursing based on virtual reality according to claim 2, characterized in that, The step of identifying the inspiratory start point, expiratory start point, and breath-holding start point on the respiratory flow curve as respiratory phase inflection points includes: performing zero-crossing detection on the respiratory flow curve, and marking the inspiratory start point when the flow value crosses the zero baseline from negative to positive and the absolute value of the slope is greater than a preset acceleration threshold. When the flow rate value crosses the zero baseline from positive to negative and remains near the zero value for a duration exceeding the breath-holding time threshold, it is marked as the breath-holding start point. When the flow rate value crosses the minimum point before the zero baseline from negative to positive and the flow rate change rate corresponding to the minimum point is in a preset flat range, the correction mark is set as the exhalation start point. The inhalation start point, the exhalation start point, and the breath-holding start point are stored in a circular buffer queue according to the timestamp sequence.

4. The method for psychological counseling in pulmonary rehabilitation nursing based on virtual reality according to claim 1, characterized in that, The method of controlling the virtual fluid particle system to generate a motion trajectory that converges from the periphery of the screen to the center includes: constructing a three-dimensional particle emission pool in the virtual reality space, wherein the boundary of the three-dimensional particle emission pool conforms to the edge contour distribution of the virtual reality head-mounted display's field of view. Upon receiving the trigger signal from the inhalation initiation point, each particle in the three-dimensional particle emission pool is given a radial vector force pointing towards the three-dimensional coordinates of the field of view center, and the particle is given a transparency attenuation factor that decreases with distance. In each rendering frame, the spatial position of the particle is updated according to the radial vector force, and the alpha channel value of the particle is updated according to the transparency attenuation factor, so that the particle presents a fluid aggregation visual effect that gradually changes from explicit to implicit as it moves toward the center of the field of view.

5. The method for psychological counseling in pulmonary rehabilitation nursing based on virtual reality according to claim 1, characterized in that, The triggering of the first frequency in the binaural beat sound includes: playing a fundamental carrier frequency in the left channel of the virtual reality headset, and playing a modulation wave frequency of the fundamental carrier frequency superimposed on the first frequency in the right channel of the virtual reality headset. When the inhalation start point is detected, the basic carrier frequency is locked at the center frequency of the alpha band that can induce an assimilation effect in brain waves, and the first frequency is set to a dynamic frequency value that matches the current real-time breathing rate. A time-domain audio stream is generated by performing an inverse fast Fourier transform on the left channel signal and the right channel signal. The time-domain audio stream is then sent to the mixer of the virtual reality audio engine. The mixer controls the fade-in and fade-out envelopes of the time-domain audio stream to align with the timestamp of the inhalation start point.

6. The method for psychological counseling in pulmonary rehabilitation nursing based on virtual reality according to claim 1, characterized in that, The introduction of a digital phase-locked loop mechanism, using the breathing phase inflection point as the reference clock signal of the digital phase-locked loop and the actual presentation time of the virtual audiovisual stimulus as the output signal of the voltage-controlled oscillator, includes: in the phase detector of the digital phase-locked loop, calculating the difference between the timestamp of the breathing phase inflection point and the timestamp of the actual presentation time of the virtual audiovisual stimulus, and generating a phase error signal. The phase error signal is input into a loop filter composed of a proportional-integral controller to filter out high-frequency breathing vibration noise in the phase error signal and output a smooth control voltage signal. The control voltage signal is mapped to a clock cycle adjustment coefficient, and the clock cycle adjustment coefficient is injected into the voltage-controlled oscillator to dynamically change the rendering clock frequency of the audiovisual generation component.

7. The method for psychological counseling in pulmonary rehabilitation nursing based on virtual reality according to claim 6, characterized in that, The method of adjusting the rendering pipeline delay of the audiovisual generation component through closed-loop feedback includes: obtaining the clock cycle adjustment coefficient and separating the clock cycle adjustment coefficient into a graphics rendering pipeline adjustment factor and an audio rendering pipeline adjustment factor. For the graphics rendering pipeline, non-critical geometry shading stages in the graphics rendering pipeline are dynamically skipped based on the graphics rendering pipeline adjustment factor. For the audio rendering pipeline, the queue depth of the audio buffer is adjusted according to the audio rendering pipeline adjustment factor.

8. The method for psychological counseling in pulmonary rehabilitation nursing based on virtual reality according to claim 4, characterized in that, Upon receiving the trigger signal from the exhalation initiation point, each particle in the three-dimensional particle emission pool is assigned a centrifugal vector force pointing from the three-dimensional coordinates of the field of view center to the edge contour of the field of view. The instantaneous absolute value of the respiratory flow rate curve is obtained in real time, and the normalized instantaneous absolute value of the flow rate is used as the force scaling factor of the centrifugal vector force. In each rendering frame, the spatial position of the particle is updated according to the product of the force scaling factor and the centrifugal vector force, so that when the patient's expiratory airflow rate increases, the diffusion radius of the particle in the virtual space increases proportionally, and when the patient's expiratory airflow rate decreases, the diffusion rate of the particle decreases accordingly, forming a dynamic divergent visual feedback coupled with the actual expiratory work intensity of the patient.

9. The method for psychological counseling in pulmonary rehabilitation nursing based on virtual reality according to claim 3, characterized in that, The inhalation start point, the exhalation start point, and the breath-holding start point are stored in a circular buffer queue according to a timestamp sequence, including: setting a sliding observation window in the circular buffer queue, wherein the sliding observation window continuously extracts the latest three consecutive phase transition points. When the order of the three phase inflection points extracted within the sliding observation window violates the physiological timing logic of inhalation, breath-holding, and exhalation, a phase misidentification event is determined to have occurred. When the phase misidentification event occurs, the latest abnormal phase inflection point stored in the sliding observation window is discarded, and the write pointer of the circular buffer queue is locked to prevent the writing of new phase inflection points until the next phase inflection point that conforms to the physiological timing logic is reached. This releases the write pointer and maintains the timing continuity of the reference clock signal input to the digital phase-locked loop.

10. A pulmonary rehabilitation nursing psychological counseling system based on virtual reality, characterized in that, include: A respiratory signal acquisition device is used to acquire the patient's chest and abdominal circumference change signals and calculate the respiratory flow curve through bandpass filtering and peak detection algorithm; A phase inflection point identification device is used to identify the inspiratory start point, expiratory start point, and breath-holding start point on the respiratory flow curve as respiratory phase inflection points. An audiovisual generation component includes a virtual fluid particle system and a binaural beat sound generator. When the inhalation start point is detected, the virtual fluid particle system is controlled to generate a motion trajectory converging from the periphery of the screen to the center and triggering the binaural beat sound at a first frequency. When the exhalation start point is detected, the virtual fluid particle system is controlled to generate a motion trajectory spreading from the center of the screen to the periphery and triggering the binaural beat sound at a second frequency. A digital phase-locked loop controller is used to adjust the rendering pipeline delay of the audiovisual generation component through closed-loop feedback, using the breathing phase inflection point as a reference clock signal and the actual presentation time of the virtual audiovisual stimulus as the output signal of the voltage-controlled oscillator.