System and method for assisting rehabilitation in sleep

By monitoring and analyzing EEG, heart rate, breathing, electromyography and body movement signals during sleep, combining deep learning and reinforcement learning models, determining the sleep stage and conducting precise intervention, the problem of the failure of the existing technology to fully utilize the sleep potential is solved, and the effect of accelerating neural circuit repair and shortening the recovery cycle is achieved.

CN119868753AActive Publication Date: 2025-04-25THE FIRST AFFILIATED HOSPITAL OF XIAMEN UNIV

Patent Information

Application Number
CN202510368392.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-04-25
Estimated Expiration
2045-03-27

AI Technical Summary

Technical Problem

Existing rehabilitation techniques fail to fully utilize the potential of the sleep phase, especially during deep sleep and REM phases, and are unable to effectively assist neuroplasticity and brain self-repair.

Method used

It provides a system that assists rehabilitation in sleep. Through electroencephalopathy, heart rate, breathing, electromyography and body movement monitoring, combined with deep learning models and reinforcement learning models, it analyzes the sleep stage in real time and determines intervention priorities, and activates the corresponding intervention components for stimulation.

Benefits of technology

Through precise sleep intervention, neural circuit repair can be accelerated, rehabilitation cycle can be shortened, rehabilitation effect can be improved, and intervention can not affect the patient's normal sleep.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119868753A_ABST
    Figure CN119868753A_ABST
Patent Text Reader

Abstract

The invention provides a system and method for assisting rehabilitation in sleep, and the system comprises an electroencephalogram monitoring assembly, a heart rate and breath monitoring assembly, a myoelectricity monitoring assembly and a body movement monitoring assembly which are used for obtaining physiological signals of an object; the intervention component is used for performing predetermined intervention operation when being activated; the control component is used for determining a sleep stage according to the physiological signal of the object; when the sleep stage is a deep sleep stage, determining an intervention priority score according to a day rehabilitation training target, a focus position and a stability score of the current deep sleep stage of the object; when the intervention priority score is larger than or equal to a preset threshold value, the object is in the deep sleep period at present, and the stability of the current deep sleep period meets a preset stability condition, a corresponding intervention assembly is activated. By means of the technical scheme, accurate intervention can be achieved in the sleep process, and the rehabilitation process of a patient is accelerated by effectively connecting intervention in the sleep stage with a rehabilitation training target in the daytime.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sleep intervention, and in particular to a system and method for assisting rehabilitation during sleep. Background Art

[0002] In recent years, neuroscience research has found that sleep, especially slow wave sleep (SWS) and rapid eye movement (REM), plays a vital role in neural plasticity and brain self-repair. Neuroplasticity refers to the brain's ability to readjust neural structure and function after external stimulation or internal damage. In patients with stroke and other neurological injuries, damaged neural pathways need to be stimulated through continuous rehabilitation training to stimulate the plasticity of the nervous system in order to achieve functional recovery. However, progress in neural repair in the awake state is limited because the brain takes up a lot of resources when performing cognitive and motor tasks, which inhibits the process of neural repair.

[0003] On the contrary, sleep provides a low-load environment for the brain, allowing neural repair and synaptic consolidation to proceed without external interference. Especially during deep sleep, slow oscillations are considered to be the key mechanism for synaptic regulation in the brain. Studies have shown that slow wave oscillations help optimize synaptic strength, remove unnecessary synaptic connections, and strengthen effective connections, thereby promoting the recovery of neural function. The REM period provides ideal conditions for the dynamic remodeling of synapses and the flow of neural information, and is an important opportunity for the repair and self-optimization of the nervous system. Therefore, sleep not only helps to consolidate memory and learning, but is also a critical period for neural recovery and synaptic repair.

[0004] Although research has clarified the role of sleep in neuroplasticity, existing rehabilitation techniques have not yet fully utilized the potential of sleep stages. Currently, rehabilitation treatment for stroke and neurological injury patients mainly relies on daytime physical therapy, occupational therapy, and speech rehabilitation. Although these methods can activate damaged neural pathways, they mainly focus on active training in the awake state. However, the training time during wakefulness is limited, and excessive training can lead to fatigue and decreased patient compliance, which in turn affects the rehabilitation effect.

[0005] In addition, although some studies have proposed the concept of "sleep learning" or nighttime assisted stimulation, existing programs lack comprehensive consideration of individual patient differences and rehabilitation goals, and cannot be effectively connected with daytime rehabilitation treatment. Summary of the invention

[0006] The embodiments of the present invention provide a system and method for assisting rehabilitation during sleep, which can achieve precise intervention during the sleep process and accelerate the patient's rehabilitation process by effectively connecting the intervention during the sleep stage with the daytime rehabilitation training goals.

[0007] In order to achieve the above-mentioned purpose, on the one hand, a system for assisting rehabilitation during sleep is provided, including: an electroencephalogram (EEG) monitoring component for acquiring an EEG signal of an object; a heart rate and respiration monitoring component for acquiring the heart rate and respiration signals of an object; an electromyography (EMG) monitoring component for acquiring the EMG change signals of an object; a body movement monitoring component for acquiring the body movement signals of an object; the body movement signals including: the body movement frequency and body movement amplitude of the object; an intervention component for performing a predetermined intervention operation on the object when activated; a control component for: receiving the EEG signal, the heart rate and respiration signal, the EMG change signal and the body movement signal in real time; and using a pre-trained deep learning model to perform the received EEG signal, the heart rate and respiration signal, the EMG change signal and the body movement signal. The body motion signal is subjected to signal feature extraction and timing analysis, and the current sleep stage of the subject is determined according to the results of the signal feature extraction and timing analysis; wherein the sleep stages include: deep sleep, light sleep, rapid eye movement and wakefulness; when the current sleep stage is deep sleep, an intervention priority score is determined according to the subject's daytime rehabilitation training goal, the subject's lesion location and the stability score of the current deep sleep stage, wherein different daytime rehabilitation training goals have predetermined weights; when the intervention priority score is greater than or equal to a predetermined threshold, the subject is currently in a deep sleep stage, and the stability of the current deep sleep stage meets a predetermined stability condition, an intervention component corresponding to the daytime rehabilitation training goal with the highest weight among the daytime rehabilitation training goals is activated; The stability score is calculated using the following formula: ; in, is the Markov model transition probability of the subject from deep sleep to wakefulness; is the Markov model transition probability of the subject from deep sleep to deep sleep; is the Markov model transition probability of the subject from deep sleep to REM sleep; The following formula is used to determine the intervention priority score:

[0008] in, For the The goal of day rehabilitation training is The dynamic weight of each moment, whose initial value is preset and dynamically updated using a pre-trained reinforcement learning model; M is the total number of daytime rehabilitation training targets; For the The daytime rehabilitation training goals and the pre-set repair priorities according to the lesion location of the subject; For the The feedback gain pre-set during the day rehabilitation training is used to indicate the physiological feedback after the intervention, where:

[0009] is the predetermined adjustment coefficient, After the intervention for a predetermined period of time, the EEG signal The power change of the wave, The initial value of the feedback gain is set in advance as the change in the root mean square value of the electromyography after the predetermined duration of intervention; Score the stability at time t; is the attenuation coefficient of the d state at time t, which is used to indicate the impact of the current deep sleep duration on the intervention effect, where:

[0010] in, is the state attenuation coefficient at time t, is the predetermined decay rate, is the duration of the current deep sleep period, Score the current stability, A predetermined, subject-individualized baseline stability score was given.

[0011] Preferably, in the system for assisting rehabilitation during sleep, the dynamic weights are dynamically updated using a proximal strategy optimization algorithm, wherein:

[0012] in, For the day rehabilitation training goals, Dynamic weight of the moment; is the learning rate used in reinforcement learning; To target day rehabilitation training the actual effects achieved after the intervention; The reinforcement learning model is targeted at the day rehabilitation training goal The predicted effect obtained.

[0013] Preferably, the system for assisting rehabilitation during sleep, after activating the intervention operation, further includes adjusting the intensity and / or mode of the intervention according to the subject's physiological feedback, wherein: when the acquired physiological signal indicates that the current subject is about to wake up or is already in a light sleep stage, the intervention operation is adjusted or paused, and the physiological signal includes: one or more of the EEG signal, the heart rate and breathing signal, the myoelectric change signal and the body movement signal; when the acquired physiological signal indicates that the subject's current heart rate or EEG is abnormal, the intervention parameters are adjusted; the adjustment of the intervention parameters includes: reducing the intervention intensity or changing the intervention excitation mode; when the acquired physiological signal indicates that the subject's current state meets the predetermined stability condition, the current intervention operation is maintained or the intervention intensity is increased within a predetermined range.

[0014] Preferably, the system for assisting rehabilitation during sleep, after using the deep learning model to determine the current sleep stage of the subject and before calculating the stability score, further comprises triggering the deep learning model to re-determine the current sleep stage when at least one of the following conditions is met: a. The ratio of the low-frequency component to the high-frequency component of the heart rate variability (HRV) is greater than or equal to the predetermined ratio threshold; b. The body movement frequency is greater than the predetermined frequency threshold; c. The number of apnea or hypopnea events per hour (RDI) is greater than or equal to the predetermined number threshold .

[0015] Preferably, the system for assisting rehabilitation during sleep further comprises adjusting the stability score when one or more of the conditions a, b or c are met. , or ,in: When condition a is met, Adjusted , in, is the predetermined first HRV gain coefficient, is the predetermined normal value for the current object; Adjusted

[0016] in, is a predetermined second HRV gain coefficient; When the condition c is met, Adjusted

[0017] in, is the predetermined respiratory gain factor; Adjusted

[0018] in, is a predetermined first attenuation coefficient; Adjusted ; in, is a predetermined second attenuation coefficient.

[0019] Preferably, in the system for assisting rehabilitation during sleep, the intervention operation includes performing a specified type of stimulation at a specified intensity and frequency on one or more parts of the subject.

[0020] On the other hand, there is also provided a method for assisting rehabilitation in sleep implemented by using any of the above-mentioned systems for assisting rehabilitation in sleep, comprising: acquiring an EEG signal of a subject using an EEG monitoring component; Use the heart rate and respiration monitoring component to obtain the heart rate and respiration signals of the object; use the electromyography monitoring component to obtain the electromyography change signal of the object; use the body movement monitoring component to obtain the body movement signal of the object; the body movement signal includes: the body movement frequency and body movement amplitude of the object; when the intervention component is activated, use the intervention component to perform a predetermined intervention operation on the object; use the control component to perform the following steps: receive the EEG signal, the heart rate and respiration signal, the electromyography change signal and the body movement signal in real time; use a pre-trained deep learning model to extract signal features and perform time series analysis on the received EEG signal, the heart rate and respiration signal, the electromyography change signal and the body movement signal, and according to The results of signal feature extraction and timing analysis determine the current sleep stage of the subject; wherein the sleep stages include: deep sleep, light sleep, rapid eye movement and wakefulness; when the current sleep stage is deep sleep, an intervention priority score is determined according to the subject's daytime rehabilitation training goals, the subject's lesion location and the stability score of the current deep sleep stage, wherein different daytime rehabilitation training goals have predetermined weights; when the intervention priority score is greater than or equal to a predetermined threshold, the subject is currently in a deep sleep stage, and the stability of the current deep sleep stage meets a predetermined stability condition, the intervention component corresponding to the daytime rehabilitation training goal with the highest weight among the daytime rehabilitation training goals is activated; The stability score is calculated using the following formula: ; in, is the Markov model transition probability of the subject from deep sleep to wakefulness; is the Markov model transition probability of the subject from deep sleep to deep sleep; is the Markov model transition probability of the subject from deep sleep to REM sleep; The following formula is used to determine the intervention priority score:

[0021] in, For the The goal of day rehabilitation training is The dynamic weight of each moment, whose initial value is preset and dynamically updated using a pre-trained reinforcement learning model; M is the total number of daytime rehabilitation training targets; For the The daytime rehabilitation training goals and the pre-set repair priorities according to the lesion location of the subject; For the The feedback gain pre-set during the day rehabilitation training is used to indicate the physiological feedback after the intervention, where:

[0022] is the predetermined adjustment coefficient, After the intervention for a predetermined period of time, the EEG signal The power change of the wave, The initial value of the feedback gain is set in advance as the change in the root mean square value of the electromyography after the predetermined duration of intervention; for Stability score at each moment; for The state attenuation coefficient at the moment is used to indicate the impact of the current deep sleep duration on the intervention effect, where:

[0023] in, is the state attenuation coefficient at time t, is the predetermined decay rate, is the duration of the current deep sleep period, Score the current stability, A predetermined, subject-individualized baseline stability score was given.

[0024] Preferably, in the method for assisting rehabilitation during sleep, the dynamic weight is dynamically updated using the following formula:

[0025] in, For the day rehabilitation training goals, Dynamic weight of the moment; is the learning rate used in reinforcement learning; To target day rehabilitation training the actual effects achieved after the intervention; The reinforcement learning model is targeted at the day rehabilitation training goal The predicted effect obtained.

[0026] Preferably, the method for assisting rehabilitation during sleep, after activating the intervention operation, further comprises adjusting the intensity and / or mode of the intervention according to the subject's physiological feedback, wherein: when the acquired physiological signal indicates that the current subject is about to wake up or is already in a light sleep stage, the intervention operation is adjusted or paused, and the physiological signal includes: one or more of the EEG signal, the heart rate and breathing signal, the myoelectric change signal and the body movement signal; when the acquired physiological signal indicates that the subject's current heart rate or EEG is abnormal, the intervention parameters are adjusted; the adjustment of the intervention parameters includes: reducing the intervention intensity or changing the intervention excitation mode; when the acquired physiological signal indicates that the subject's current state meets a predetermined stability condition, the current intervention operation is maintained or the intervention intensity is increased within a predetermined range.

[0027] Preferably, the method for assisting rehabilitation during sleep, after using the deep learning model to determine the subject's current sleep stage and before calculating the stability score, further includes triggering the deep learning model to re-determine the current sleep stage and / or the stability score when at least one of the following conditions is met: , or : a. The ratio of the low-frequency component to the high-frequency component of the heart rate variability (HRV) is greater than or equal to a predetermined ratio threshold; b, body movement frequency is greater than the predetermined frequency threshold; c. The number of apnea or hypopnea events per hour (RDI) is greater than or equal to the predetermined number threshold ; Among them, adjust the stability score , or The steps include: When condition a is met, Adjusted , in, is the predetermined first HRV gain coefficient, is the predetermined normal value for the current object; Adjusted

[0028] in, is a predetermined second HRV gain coefficient; When the condition c is met, Adjusted

[0029] in, is the predetermined respiratory gain factor; Adjusted

[0030] in, is a predetermined first attenuation coefficient; Adjusted ; in, is a predetermined second attenuation coefficient.

[0031] The above technical solution has the following technical effects: The technical solution of the embodiment of the present invention can avoid more safely identifying the best intervention time by using stability scores and calculating intervention priority scores, ensuring that the intervention does not affect the normal sleep of the subject; moreover, by combining with daytime training goals, it can form an effective connection with daytime rehabilitation treatment, effectively utilize the peak of neuroplasticity at night, accelerate neural circuit repair, and may significantly shorten the rehabilitation cycle, thereby achieving personalized intervention for the subject; in a further embodiment, by real-time monitoring of physiological feedback during the intervention execution process, timely adjustment or cessation of stimulation, the safety and comfort of the intervention are ensured.

[0032] The technical solution of the embodiment of the present invention is particularly suitable for: (1) recovery of motor function after stroke: for patients with hemiplegia or local dysfunction, to assist them in improving motor skills and solidification at night; (2) other neurological injury scenarios: such as brain trauma, spinal cord injury, Parkinson's disease, etc. can also refer to this technical path and customize the stimulation plan according to the specific disease characteristics. Of course, it can also be applied to other rehabilitation goals that can be linked day and night. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a schematic structural diagram of a system for assisting rehabilitation during sleep according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] To further illustrate the various embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, which are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, a person of ordinary skill in the art should be able to understand other possible implementations and advantages of the present invention. The components in the figures are not drawn to scale, and similar component symbols are generally used to represent similar components.

[0035] The present invention will now be further described with reference to the accompanying drawings and specific implementation methods.

[0036] Embodiment 1: Figure 1 FIG. 1 is a schematic diagram of a system for assisting recovery during sleep according to an embodiment of the present invention. Figure 1 The system for assisting rehabilitation during sleep of this embodiment includes: An electroencephalogram (EEG) monitoring component is used to obtain an electroencephalogram (EEG) signal from an object. In a specific implementation, the electroencephalogram (EEG) monitoring component is an electroencephalogram (EEG) sensor. For example, it can be a head-mounted or helmet-mounted device used to collect brain activity of an object, such as a patient, at night, so as to distinguish different sleep stages of the rehabilitation object, such as light sleep, deep sleep, and rapid eye movement (REM) through the acquired EEG signals. In a further implementation, a preamplifier is also included to filter and preliminarily amplify weak EEG signals to reduce environmental noise. For example, using 8 to 16 channels of EEG can better capture typical activities in the δ, θ, α, β and other frequency bands during sleep at night. A low-noise amplifier chip is provided at the node and skin contact detection is integrated to ensure signal stability when worn for a long time. The EEG monitoring component sends data to the control component in real time through wired or wireless protocols such as Bluetooth low energy and Wi-Fi for corresponding processing or calculation. A heart rate and respiration monitoring component is used to obtain the heart rate and respiration signals of the subject; in a specific implementation, the heart rate and respiration monitoring component includes a chest strap sensor or a mattress pressure monitoring device to obtain the heart rate and respiration frequency information of the subject, which can be used to assist in determining the sleep stage of the subject in subsequent sleep staging and assist in determining the safety of intervention; in a specific implementation, the component uses a heart rate variability acquisition circuit to make accurate measurements of the RR interval and derive a heart rate variability (HRV) index; further, the heart rate and blood oxygen saturation information can also be obtained through a chest strap or finger clip sensor to assist in determining deep sleep and rapid eye movement period; the heart rate and respiration monitoring component sends the obtained relevant heart rate and respiration signals to the control component for it to determine the sleep stage and / or sleep stability, and issues a safety alarm or suspends intervention such as suspending stimulation when apnea or sudden change in heart rate occurs; The electromyographic monitoring component is used to obtain the electromyographic change signal of the subject; in a specific implementation, the electromyographic monitoring component is implemented as an electromyographic and body motion sensor, such as a surface electromyographic electrode attached to the affected side or key muscle groups to collect weak electromyographic changes; the electromyographic change signal can be used to identify whether abnormal spasm or high muscle tension occurs; A body motion monitoring component is used to obtain a body motion signal of the subject; the body motion signal includes: the body motion frequency and the body motion amplitude of the subject; in a specific implementation, a three-axis accelerometer placed on a mattress or a waist belt is used to detect the body motion of the subject, such as the turning over of the subject, such as the turning over frequency and the body motion amplitude; the body motion signal can be used by the control component to assist in determining whether the subject is awakened by the intervention or whether discomfort occurs, and when these situations occur, the intervention is suspended to avoid interrupting sleep; An intervention component is used to perform a predetermined intervention operation on the subject when activated. In a specific implementation, the intervention component is a multimodal stimulation module, including: transcranial magnetic stimulation, microcurrent stimulation, an audio playback device or a mild vibration device, etc., which is used to apply moderate external stimulation during specific periods of the night to strengthen neural pathways; for example, it includes: (1) a transcranial magnetic stimulation coil: attached to a specific position of the head, used for low-intensity regulation of the cerebral cortex; (2) a microcurrent or transcranial electrical stimulation patch: provides low-intensity electrical stimulation near the head or affected limb; (3) an audio output device: such as a bone conduction headset or a pillow speaker, to play audio associated with rehabilitation training; (4) other sensory stimulation: optional light vibration, aromatherapy, etc., used to strengthen specific memory pathways.

[0037] Control components for: Receiving the EEG signal, the heart rate and breathing signal, the myoelectric change signal and the body movement signal in real time; Using a pre-trained deep learning model, extracting signal features and performing time series analysis on the received EEG signal, the heart rate and breathing signal, the electromyographic change signal, and the body movement signal, and determining the current sleep stage of the subject according to the results of the signal feature extraction and time series analysis; wherein the sleep stage includes: deep sleep, light sleep, rapid eye movement, and wakefulness; When the current sleep stage is a deep sleep period, determining an intervention priority score according to the subject's daytime rehabilitation training goal, the subject's lesion location, and the stability score of the current deep sleep period, wherein different daytime rehabilitation training goals have predetermined weights; When the intervention priority score is greater than or equal to a predetermined threshold, the subject is currently in a deep sleep period, and the stability of the current deep sleep period meets a predetermined stability condition, activating an intervention component corresponding to the daytime rehabilitation training goal with the highest weight among the daytime rehabilitation training goals; The stability score is calculated using the following formula: ; in, is the Markov model transition probability of the subject from deep sleep to wakefulness; is the Markov model transition probability of the subject from deep sleep to deep sleep; is the Markov model transition probability of the subject from deep sleep to REM sleep; The following formula is used to determine the intervention priority score:

[0038] in, For the The goal of day rehabilitation training is The dynamic weight of each moment, whose initial value is preset and dynamically updated using a pre-trained reinforcement learning model; M is the total number of daytime rehabilitation training targets; For the The daytime rehabilitation training goals and the pre-set repair priorities according to the lesion location of the subject; For the The feedback gain pre-set during the day rehabilitation training is used to indicate the physiological feedback after the intervention, where:

[0039] is the predetermined adjustment coefficient, After the intervention for a predetermined period of time, the EEG signal The power change of the wave, The initial value of the feedback gain is set in advance as the change in the root mean square value of the electromyography after the predetermined duration of intervention; Score the stability at time t; is the attenuation coefficient of the d state at time t, which is used to indicate the impact of the current deep sleep duration on the intervention effect, where:

[0040] in, is the state attenuation coefficient at time t, is the predetermined decay rate, is the duration of the current deep sleep period, Score the current stability, A predetermined, subject-individualized baseline stability score was given.

[0041] The control component is used to receive multi-source physiological data of the subject in real time, identify the subject's sleep stage and state, and accelerate neural repair through stimulation such as multimodal stimulation intervention at the appropriate time. The control component is not only used for efficient and synchronous acquisition of corresponding sensor data, but also includes real-time feedback of intelligent analysis, intervention decision-making and execution control.

[0042] In a further implementation, the above system also includes: a human-computer interaction and data storage component, which is used to realize human-computer interaction and store related data, such as data generated by the system and initial data set and input in advance.

[0043] In a specific implementation, the human-computer interaction and data storage components include: (1) a display terminal or mobile application device: for medical staff or patients to view night intervention results and sleep staging charts; (2) storage media: local SD card or cloud database, used to save detailed physiological records and intervention logs. Medical staff can use this module to view intervention details and compare them with the next day's training evaluation with one click, and can use long-term data to fine-tune rehabilitation strategies or conduct big data research and analysis; further, medical staff can use this module to modify intervention thresholds, priority calculation rules, or pause / emergency stop commands; and automatically push alarm information to the interface when the system's safety mechanism is triggered to issue an alarm.

[0044] Embodiment 2: In a specific implementation, the control component includes a processor and a memory, and the memory stores a computer program for implementing the above-mentioned corresponding control and algorithm. In this embodiment, a specific implementation of the control component in the system of the embodiment of the present invention is described in detail from the hardware and software levels.

[0045] 1. Hardware level (1) Embedded processor or integrated MCU In one implementation, the control component includes a high-performance embedded processor or an integrated microcontroller unit (MCU) as a core processing unit; wherein the embedded processor selected must have sufficient computing power to process data streams from multiple sensors and perform real-time calculations and decisions through efficient algorithms.

[0046] Multi-channel analog-to-digital converter (ADC): The system needs to support high-precision analog signal acquisition, so the embedded processor needs to integrate a multi-channel ADC module. The function of the ADC is to convert analog signals collected from sensors such as EEG, heart rate, respiration, and electromyography into digital signals for subsequent processing. The multi-channel ADC supports multiple sensors working simultaneously and can ensure the synchronization and accuracy of data acquisition. The sampling rate of each ADC channel should be able to meet the needs of real-time monitoring, and should be at least 100Hz per second.

[0047] High-speed communication interface: To ensure high-speed and stable data transmission, the system has multiple high-speed communication interfaces, such as UART, SPI, I2C, Bluetooth, and Wi-Fi. These interfaces not only support real-time transmission of sensor data, but also exchange data with the cloud platform or other medical devices to ensure efficient collaboration of the system. For long-term running equipment, low-power mode and intelligent adjustment should also be supported to reduce energy consumption and extend the service life of the equipment.

[0048] (2) Redundant safety design Considering that the equipment needs to run for a long time at night and is crucial to the physiological data collection and intervention process of subjects such as patients, the control component adopts a redundant safety design to improve the stability and reliability of the system. Watchdog timer: The built-in watchdog timer of the control component is used to monitor the health status of the system. Once the system is deadlocked or unable to respond, the timer will automatically reset to ensure that the system can resume normal operation. The watchdog timer ensures that the system can prevent unexpected shutdowns due to software or hardware failures during nighttime operation. Circuit protection mechanism: The system is designed with multiple circuit protection mechanisms, including overvoltage protection, overcurrent protection, and overtemperature protection. These protection mechanisms can prevent system damage caused by unstable voltage, abnormal current or excessive temperature, ensuring that the equipment can work in a long-term and stable environment.

[0049] 2. Software level The control component realizes data fusion and sleep staging, intervention priority evaluation and closed-loop control strategy through a computer program or software set in the memory; through efficient algorithms, it can intelligently judge the intervention timing, adjust the intervention parameters in real time, and achieve the best rehabilitation effect.

[0050] (1) Real-time data fusion and sleep staging The system identifies and distinguishes the different sleep stages of patients, including light sleep, deep sleep and rapid eye movement (REM), through real-time analysis of multimodal signals such as EEG, heart rate, respiration, and electromyography. To this end, the system uses advanced deep learning models, such as convolutional neural networks (CNN) combined with long short-term memory networks (LSTM) or Transformer models, to extract signal features and perform time series analysis.

[0051] Signal feature extraction: The power changes of different bands in EEG signals, such as δ waves, θ waves, α waves, and β waves, can reflect different sleep stages; changes in heart rate and breathing frequency, myoelectric activity and other information also provide important basis for sleep status; through CNN, the system can automatically extract key features from the raw data and construct feature vectors.

[0052] Sleep staging: Based on a pre-selected deep learning model, the system can extract time series features from multiple modal signals and comprehensively analyze the time-varying characteristics of these signals; combined with the LSTM network, the system can effectively process time series data and achieve accurate staging of sleep stages; the model can not only efficiently distinguish different sleep states such as deep sleep, light sleep, rapid eye movement, etc., but also quantify the stability of sleep, providing a reliable basis for intervention decisions.

[0053] (2) Intervention priority assessment Intervention priority assessment is a key step in determining whether to activate the intervention module. Using the calculation method described in Example 1, the program module implementing this function calculates the intervention priority score according to the patient's daytime rehabilitation training goals, lesion location, and stability of the current sleep stage.

[0054] Daytime rehabilitation training label: Each patient's daytime rehabilitation plan will be personalized according to their specific condition and treatment goals, such as upper limb grasping, lower limb weight-bearing, etc.; the system will assign different intervention weights according to the patient's daytime rehabilitation goals, so that the system will give priority to the patient's weak areas or motor pathways that need to be strengthened during intervention.

[0055] Sleep stage stability: When the patient is in deep sleep, neuroplasticity is strongest and the effect of external intervention on synaptic repair is most obvious. Therefore, the system will evaluate the stability of the current sleep stage based on the sleep staging results. Only when the sleep stage is stable and meets the intervention criteria will the system activate the multimodal stimulation module.

[0056] Intervention priority determination: The system will combine the daytime rehabilitation training label and the stability of the current sleep stage to calculate the intervention priority score through an algorithm. When the score exceeds the set threshold and the patient is in a stable deep sleep stage, the system will activate the intervention module for stimulation.

[0057] (3) Closed-loop control strategy Closed-loop control is designed to ensure adaptability and safety during intervention. The system monitors the patient's physiological feedback in real time and automatically adjusts the intensity and mode of intervention based on the feedback.

[0058] Physiological feedback monitoring: The system continuously monitors physiological signals such as EEG, heart rate, and electromyography to detect the patient's signs of awakening in a timely manner. For example, when there is an increase in alpha waves in the EEG signal, or a sudden increase in heart rate, it may mean that the patient is about to wake up or is already in a light sleep stage. The system can respond to these signals and adjust or suspend intervention.

[0059] Adaptive intervention adjustment: Once the system detects that the intervention effect is poor or there is a risk of awakening, such as abnormal heart rate or EEG, the system will immediately adjust the intervention parameters, reduce the stimulation intensity or change the stimulation mode to avoid the intervention interfering with the patient's normal sleep. Conversely, if the system detects that the patient's physiological signals are stable and the intervention effect is good, the stimulation intensity can be maintained or moderately increased.

[0060] The rehabilitation system of this embodiment of the present invention improves the effect of rehabilitation treatment by selecting the best time to intervene. Specifically, the system first detects whether the subject is currently in "deep sleep" or "rapid eye movement" period, such as when, and continuously observes to confirm whether the subject remains in this state for a predetermined period of time, such as tens of seconds or minutes, to confirm the stability of the subject in deep sleep or rapid eye movement period; when the current sleep state is stable, combined with the intervention priority assessment score, trigger the corresponding intervention for a certain action or brain area with a higher repair demand; finally, through the real-time data feedback mechanism, the patient's status is continuously judged after the intervention begins to ensure that the core sleep structure is not destroyed while generating intervention gain.

[0061] In a further implementation, when the intervention component is triggered to perform intervention such as stimulation: (1) the start and end time, intensity level, and type of each stimulation are recorded in real time and transmitted back to the control component for closed-loop iteration; (2) multiple stimulations may be rotated or superimposed on the same night according to different stages to achieve maximum consolidation effect.

[0062] The following is a detailed description of the steps of the control component in one implementation of an embodiment of the present invention to implement preliminary determination of sleep stages, i.e., sleep staging, evaluation of sleep stability and calculation of intervention priority, processing of triggering intervention and closed-loop monitoring, and overnight iteration and long-term optimization.

[0063] 1. Preliminary determination of sleep stages (integrated with edge computing acceleration) 1. Step description: (1) Multimodal data acquisition: After a patient falls asleep, the system collects data in real time through electroencephalogram (EEG), heart rate, respiration, electromyography, and body movement sensors. The analysis window is shortened to a predetermined duration, such as 15 seconds, and low-latency processing can be achieved through FPGA hardware acceleration.

[0064] (2) Deep learning model optimization: The spatiotemporal convolutional network (ST-CNN) was combined with the Transformer model to simultaneously extract EEG frequency domain features (δ / θ / α wave power ratio), heart rate variability (HRV) and respiratory rhythm, and output the probability values ​​of each sleep stage, such as light sleep N1, deep sleep N3, REM stage, etc.

[0065] (3) Quickly confirm the deep sleep period: If the probability of the deep sleep period is >85% and the judgments of two consecutive windows are consistent, it is marked as a candidate intervention stage.

[0066] 2. Advantages and effects: (1) FPGA edge computing reduces data processing delay to <20ms, meeting real-time requirements. (2) The spatiotemporal convolutional network improves the ability to capture the temporal correlation of multimodal signals, and the accuracy of staging is increased by 12%.

[0067] 2. Evaluation of sleep stability based on Markov models such as Markov chain models 1. Step description: (1) State transition probability modeling: Construct a Markov chain model of sleep stages and dynamically calculate the stability of the deep sleep stage. When the predetermined full score is 100, the score range is 0-100, and the higher the value, the more stable the current deep sleep stage. For example, 0 indicates extremely unstable and 100 indicates highly stable. ; In a specific implementation, the range of the transition probability of the Markov model is: : 70%~95%, which is the baseline for healthy people; : 1%~20%, among which the rate may rise to 20% in patients with respiratory disorders; : <10%, among which, healthy people usually <5%.

[0068] (2) Multimodal verification: Verify stability by combining real-time physiological indicators. In a specific implementation, when the physiological indicators meet the following conditions, it indicates that the subject is currently in a relatively stable deep sleep period: the preset HRV LF / HF ratio threshold is 0.5. When LF / HF < 0.5, the parasympathetic nervous system is dominant, indicating that the deep sleep characteristics are met; body movement frequency: the number of body movements within 5 minutes is ≤ 1; respiratory disturbance index (RDI, Respiratory Disturbance Index): < 5 times / hour. When this indicator meets this condition, the interference of apnea is excluded.

[0069] 2. Advantages and effects: The Markov model quantifies the risk of sleep stage transitions and avoids the subjectivity of static thresholds. Multi-indicator cross-validation reduces the misjudgment rate and the stability score error is reduced to ±5%.

[0070] 3. Calculation of intervention priority 1. Step description: (1) Core formula (dynamic priority score): Intervention priority score = Σ(dynamic weight × repair priority × feedback gain) + sleep stability score × state decay coefficient; which is expressed by the following formula:

[0071] For the day rehabilitation training goals, M is the total number of day rehabilitation training goals considered in the rehabilitation system; for different day rehabilitation training goals, corresponding , is a natural number; t is the corresponding time; (2) Dynamic weight The weights assigned to different day rehabilitation training goals are preset with initial values ​​and dynamically updated using a pre-trained reinforcement learning model, such as a proximal policy optimization (PPO) algorithm;

[0072] in: in, To target day rehabilitation training , the weight at time t; To target day rehabilitation training , the weight at time t-1; In a specific implementation of the learning rate used in reinforcement learning, the initial value is 0.1, and its value is optimized through cross-validation; To target day rehabilitation training The actual effect obtained after the intervention, in a specific implementation, the day rehabilitation training goals include: the rate of improvement of grip strength; Targeting day rehabilitation training objectives for reinforcement learning models The prediction results obtained; (3) Repair priority The parameter indicating the urgency of neural repair is pre-set according to the lesion location of the subject. In one implementation, for example, the lesion of motor cortex damage , targeting lesions in the hippocampus ; (4) Feedback gain Used to indicate physiological feedback after intervention, where:

[0073] To target day rehabilitation training The feedback gain, is the predetermined adjustment coefficient, After the intervention for a predetermined period of time, the EEG signal The power change of the wave, The change in the root mean square value of the electromyography after the predetermined time of intervention, the initial value of the feedback gain is preset; in a specific implementation, the EEG delta wave power ↑ (increase) and the electromyography root mean square (RMS) value ↑ (increase) within the predetermined time after the intervention, such as 10 seconds, are normalized to 0.8-1.2; (5) State decay coefficient is also called stability decay coefficient ): Dynamically reflects the potential impact of the current deep sleep duration on the intervention effect:

[0074] in, is the state attenuation coefficient at time t, is the predetermined decay rate, is the duration of the current deep sleep period, Score the current stability, is a predetermined, individualized baseline stability score for the subject; in one specific implementation, The unit is minutes; The default value is 0.05, and its value can be optimized by fitting historical data; For example, the average value of the stability scores over the past 7 days can be taken. In one specific implementation, The value range of normal attenuation is 0 to 1, for example, 0.9 means 10% attenuation every 10 minutes; Example: Normal attenuation coefficient = 0.95, frequent awakening coefficient = 0.8.

[0075] (6) Calculation example: Assume that the current deep sleep period has lasted for 6 minutes (Δt = 6), the baseline stability score is 80, the current score is 85, and λ = 0.05:

[0076] Effect: As the deep sleep period increases, the attenuation coefficient gradually decreases, avoiding excessive intervention at the end of the sleep stage because the risk of awakening increases at this time.

[0077] (7) Total score determination logic: Decision threshold: If the priority score > the predetermined priority score threshold, intervention is triggered; wherein the threshold is configurable according to individual circumstances, and illustratively, the threshold is 6500.

[0078] Multi-goal competition: When multiple rehabilitation goals, such as upper limb grasping and memory training, meet the threshold at the same time, the goal with the highest score is selected for priority intervention.

[0079] (iv) Trigger intervention and closed-loop monitoring; When the acquired physiological signal indicates that the current subject is about to wake up or is already in a light sleep stage, adjusting or suspending the intervention operation, the physiological signal includes: one or more of the EEG signal, the heart rate and breathing signal, the EMG change signal, and the body movement signal; When the acquired physiological signal indicates that the subject's current heart rate or electroencephalogram is abnormal, adjusting the intervention parameter; the adjusting the intervention parameter includes: reducing the intervention intensity or changing the intervention excitation mode; When the acquired physiological signal indicates that the current state of the subject satisfies a predetermined stability condition, the current intervention operation is maintained or the intervention intensity is increased within a predetermined range.

[0080] In one implementation, closed-loop monitoring is achieved by integrating a real-time feedback gain; 1. Step description: (1) Dynamic stimulation intensity adjustment:

[0081] The base intensity is preset according to the patient's tolerance; It is the average of the feedback gain within a predetermined time range obtained recently, which can be used to smooth abnormal fluctuations.

[0082] (2) Termination conditions, where the intervention can be suspended if any of the predetermined termination conditions is met; the termination conditions include: The alpha wave power ratio of EEG>predetermined percentage, when it is greater than the predetermined percentage, it indicates that the subject has signs of awakening, preferably, the predetermined percentage is 30%; the value of the predetermined percentage can be adjusted according to individual conditions; The heart rate variability (LF / HF) ratio is > 1.0. When this condition is met, it indicates that the subject's sympathetic nerves are activated. The above 1.0 is a predetermined ratio threshold, which can be adjusted according to individual conditions. The body movement frequency is ≥ 3 times within 1 minute, and 3 times is the predetermined frequency threshold. The frequency threshold can be adjusted according to individual circumstances.

[0083] 2. Advantages and effects: Dynamically adjust the stimulation intensity through feedback gain to avoid overstimulation caused by fixed parameters; By integrating multimodal termination conditions, the safety of intervention can be improved, for example, by 37% based on clinical simulation data.

[0084] (V) Overnight iteration and long-term optimization 1. Step description: (1) Nighttime data closure: After each intervention, key parameters (score, decay coefficient, feedback gain) are recorded, and the reinforcement learning model parameters (α, λ) are updated through Bayesian optimization.

[0085] (2) Integration of daytime rehabilitation feedback: linking the next day’s training effect with nighttime intervention and dynamically adjusting the target weight ( ) and fix priority ( ).

[0086] (3) Example: If the upper limb grasping daytime improvement rate is less than 5% after three consecutive night interventions, the system automatically reduces its weight ( ↓) and increase the priority of lower extremity targets.

[0087] 2. Advantages and effects: This cycle mechanism enables the present invention to flexibly respond to the patient's sleep changes, ensuring that the peak of neural repair during deep sleep and REM phases is fully utilized throughout the night's sleep. Through multiple iterations and optimizations, the system can continuously improve intervention strategies throughout the entire rehabilitation cycle to maximize rehabilitation effects.

[0088] In a specific implementation, after using the deep learning model to determine the current sleep stage of the subject and before calculating the stability score, the method further includes triggering the deep learning model to re-determine the current sleep stage and / or the stability score when at least one of the following conditions is met: , or : a. The ratio of the low-frequency component to the high-frequency component of the heart rate variability (HRV) is greater than or equal to a predetermined ratio threshold; b, body movement frequency is greater than the predetermined frequency threshold; c. The number of apnea or hypopnea events per hour (RDI) is greater than or equal to the predetermined number threshold ; Among them, adjust the stability score , or The steps include: When condition a is met, Adjusted , in, is the predetermined first HRV gain coefficient, is the predetermined normal value for the current object; Adjusted

[0089] in, is a predetermined second HRV gain coefficient; When condition c is met, Adjusted

[0090] in, is the predetermined respiratory gain factor; Adjusted

[0091] in, is a predetermined first attenuation coefficient; Adjusted ; in, is a predetermined second attenuation coefficient.

[0092] Among them, when conditions a and c are met at the same time, the adjusted .

[0093] Embodiment three: Taking patients with cerebral infarction as an example, the specific process of priority scoring during rehabilitation using the system or method of the embodiment of the present invention is described in detail below.

[0094] 1. Patient background and parameter initialization 1. Age and gender: 60-year-old male 2. Medical history: Right middle cerebral artery (MCA) stroke, resulting in left-sided hemiplegia, currently in recovery period.

[0095] 3. Lesion location: right motor cortex (upper limb / lower limb control area) and hippocampus (memory-related area).

[0096] 4. Daytime training goal 1: left upper limb grip training, 60% weight 5. Daytime training goal 2: Lower limb weight training, 30% weight 6. Daytime training goal 3: Add cognitive function goal, short-term memory training, 10% weight; The priority score of each training target is calculated using the priority score calculation formula described in the above-mentioned embodiment 1 or 2, which will not be described here. Among them, based on historical rehabilitation effects such as grip strength improvement rate, memory task accuracy and real-time feedback such as EEG synchronization and electromyographic activation after intervention, reinforcement learning (PPO algorithm) is used to dynamically update the target weight.

[0097] 2. Step-by-step calculation example (I) Step 1: Initial parameter loading 1. Daily target dynamic weights (reinforcement learning initialization), as shown in Table 1: Table 1:

[0098] 2. Other parameters Decay rate λ: 0.05 (historical data fitting value) Baseline stability : 80 (taking the average of the deep sleep stability scores of the past 7 days) (II) Step 2: Real-time data collection and processing 1. Hardware Acceleration FPGA is used to process multimodal signals in parallel, including EEG, electromyography, and body movement, with a total delay of <35ms (after optimization).

[0099] 2. Sleep stability calculation In this example, the current deep sleep duration Δt is set to 4 minutes. In this example, assume that the Markov model outputs: - Deep Sleep → Deep Sleep Probability : 88% - Deep sleep → awakening probability :5% - Deep sleep → REM probability : 7% Stability score : Round to 95; Note: The actual calculation includes HRV and respiratory compensation. The core logic is simplified here. RDI is a quantitative indicator for evaluating sleep breathing disorders. Respiratory compensation is the compensatory response of the human body to maintain ventilation through physiological mechanisms when breathing is obstructed. When considering HRV and respiratory compensation, the corrections to the corresponding probabilities include: Adjusted ; Adjusted ; Adjusted ;in, That is ; For the relationship between the adjusted probability and the original probability before adjustment, see the previous calculation formula.

[0100] The following example illustrates the calculation of stability scores before and after the correction: 1. Original parameters (no correction): , ,

[0101]

[0102] 2. After adding HRV and RDI correction: (1) HRV decrease (HRV real-time = baseline × 80%, = 0.5) makes ; (2) RDI = 6 times / hour ( = 0.5) makes ; (3) RDI inhibits REM transitions (ε=0.2): ; (4) For , when HRV decreases, where HRV real-time = baseline × 80%, =0.3, RDI=6 times / hour, =0.1, threshold =5: Among them, HRV and RDI both affect , multiplying its impact factor to obtain the adjusted

[0103] 1. Corrected rating:

[0104] The score dropped from 95 to 92.2, reflecting the negative impact of HRV and respiratory disturbances.

[0105] Specifically: When HRV↓ or RDI↑, ↑; when HRV↓ or RDI↑, ↓; when RDI↑, ; The above ↑ indicates an increase, indicating Decrease; Clinical significance: HRV↓: Warning of sleep fragmentation risk, triggering a low stability alarm, for example, suspending intervention when the score is <60; RDI↑: Prompts respiratory disorder, inhibits REM intervention to avoid aggravating oxygen saturation desaturation. The formula for calculating the stability score using the adjusted Markov probability is as follows:

[0106] This correction mechanism enables the system of the embodiment of the present invention to respond to changes in physiological state in real time, further ensuring the safety and effectiveness of the intervention.

[0107] The specifics of the calculation involving HRV and breathing compensation will be explained in more detail below.

[0108] (III) Step 3: Dynamic Weight Update (Reinforcement Learning) 1. Historical feedback data Upper limb grasping: EEG motor area synchronization after intervention ↑ 12% → actual effect

[0109] Memory training: After intervention, the memory test score ↑ was only

[0110] 2. Weight update formula:

[0111] Learning rate α: 0.1 (default) Prediction effect (Based on the model): Upper limb grip = 10%, memory training = 8% 3. Update results: Upper body grip weight: ; Rounded to 65; In addition, the maximum increase of the constraint preset by the system is +5 / cycle; Memory training weights: ; Rounded to 5, the system preset minimum weight lower limit is 5.

[0112] 4. System Constraints (1) System constraints: Maximum increment limit for a single cycle. To prevent sudden changes in weights from affecting system stability, the single update amplitude is set to ≤5.

[0113] Calculation logic:

[0114] : Weight upper limit, the default value is 100; In the example: 60 + 5 = 65, which does not reach the upper limit, so 65 is taken; (2) Clinical significance of system constraints: If the weight is allowed to grow freely (e.g. 60.2→60), multiple intervention cycles are required to achieve the desired effect, which will delay the rehabilitation process. By setting a minimum effective increase (+5), we can ensure that resources are allocated quickly to the target with significant effects.

[0115] 5. Memory training weight update instructions (1) Calculation formula output value:

[0116] The theoretical calculation result is 9.4, but the final weight is forced to 5.

[0117] (2) Explanation of system constraints. Minimum weight lower limit: To avoid invalid targets occupying resources, the weight lower limit is set to 5.

[0118] Calculation logic:

[0119] explain: Indicates at a point in time The weight value of .

[0120] Indicates that at a previous point in time The weight value of .

[0121] In the formula The function is used to find the larger of two values.

[0122] In the example: 10 - 5 = 5. When the weight decreases from 10 to 5, the weight will not decrease further because it has reached the minimum weight limit of 5. (3) Clinical significance: The actual effect of memory training (2%) is far lower than expected (8%), and resource allocation needs to be reduced quickly. However, in order to prevent the complete abandonment of potential needs (such as mild atrophy of the hippocampus), the lowest weight of 5 is retained as an observation window.

[0123] 6. The necessity of system constraints is shown in Table 2 below: Table 2

[0124] (IV) Step 4: Feedback gain calculation 1. Physiological response after intervention: EEG delta wave power increase: Δδ = +8% → normalized value = 0.08 / 0.15 = 0.53, where 0.15 is the maximum expected value based on clinical consensus and clinical data; Improvement of EMG RMS value: ΔEMG = +15% → normalized value = 0.15 / 0.20 = 0.75, where 0.20 is the maximum expected value based on clinical consensus and clinical data; Feedback gain formula:

[0125] The adjustable sensitivity parameter (β) allows clinicians to adjust the gain intensity according to the patient type (acute / chronic), and the default value is 0.15. That is, β = 0.15 (default value).

[0126] calculate:

[0127] Note: In this example, there is no recent intervention for lower limb and memory training, and the default feedback gain for lower limb and memory training is ; (V) Step 5: Calculation of comprehensive score 1. Stability attenuation coefficient :

[0128] 2. Priority score formula:

[0129] 3. The score for upper limb grasping is calculated as: (1) Parameter value:

[0130]

[0131]

[0132] (2) Calculation formula: Upper limb score = 65 × 70 × 1.10 = 5005 (3) Clinical significance: The high weight (65) and high priority (70) indicate that the system allocates major resources to the recovery of upper limb function, which meets the clinical needs of the patient with right motor cortex injury.

[0133] 4. Priority score calculation for memory training (1) Parameter value:

[0134]

[0135]

[0136] (2) Calculation formula: Memory score = 5 × 40 × 1.0 = 200 (3) Clinical significance: Low weight (5) reflects the system's reduction of intervention in memory training, for example, setting a low weight for memory training due to poor historical effects, but still retaining minimum resources to monitor potential needs.

[0137] 5. Calculation of lower limb weight-bearing score (1) Parameter value: weight ;Repair priority ; Feedback gain =1.0 (default value) (2) Calculation formula: Lower limb score = 30 × 50 × 1.0 = 1,500 6. Sleep stability gain calculation (1) Parameter value: Current Stability Rating

[0138] Attenuation coefficient = 0.972 (2) Calculation formula: Stability gain = 95 × 0.972 = 92.34 7. Total score integration Total score = 5005 (upper limbs) + 1,500 (lower limbs) + 200 (memory) + 92.34 (stability) = 6797.34 8. Itemized calculation, see Table 3 below: Table 3

[0139] 9. Decision: Threshold = 6,500 → 6797.34>6,500, triggering upper limb grasp intervention.

[0140] 4. The direct impact of weight on the total score 1. High weight of upper limb grasping (65): After weight multiplied by priority (70), the contribution to the total score is 73.6% (i.e. 5005 / 6797.34); it reflects the system's resource inclination towards the core rehabilitation goal. 2. Low weight of memory training (5): only 2.9% of the total score (i.e. 200 / 6797.34), reflecting the system's suppression strategy for inefficient goals. 3. Medium weight of lower limb weight bearing (30): a secondary goal of balance, accounting for 22.1% of the total score (i.e. 1500 / 6797.34).

[0141] 5. Visualization and Clinical Interpretation 1. SHAP value analysis: Generate a feature contribution graph to show the quantitative impact of each factor on the score (see Table 4 below): Table 4

[0142] (II) SHAP (Shapley Additive Explanations) is a model explanation method based on game theory. Its core is to decompose the model prediction value into the marginal contribution of each feature. The calculation formula is:

[0143] 1. Symbol definition: :feature The SHAP value indicates the contribution of this feature to the model prediction. : A collection of all features (such as dynamic weights, repair priorities, etc.). : Does not contain features Any subset of , represented by , the above summation formula represents all the features that do not contain Sum the subset S of . : Based on feature subset Model output values ​​such as intervention priority scores. : Subset Factorial of size. : Factorial of the total number of features. : is the factorial of the number of remaining features minus 1, where 1 is subtracted because the feature . is the weight coefficient used to fairly distribute features contribution. : is a feature Subset The marginal contribution of : Add features The model output value after ; Difference: represents the feature For the current subset The incremental contribution of Example: If a subset When , add features After Score , then the feature Subset The contribution of The SHAP formula fairly decomposes the prediction results of the black box model into the contribution value of each feature by weighted averaging the marginal contributions of all subsets; it provides an intuitive and mathematically rigorous explanation for medical decision-making.

[0144] 2. Model input feature definition, as shown in Table 5: Table 5

[0145] 3. Model output formula:

[0146] Note: Only upper limb grasping items are shown below. Other rehabilitation training goals, such as calculation types of lower limb and memory training, are not described here.

[0147] 4. SHAP value calculation method, in this example For example: (1) Step 1: Generate all possible feature subsets S, a total of 2 in this example 5 =32 combinations.

[0148] Total number of features: This example includes 5 features, namely , , , and .

[0149] Number of subsets: 2 5 -1=31 (excluding all combinations after the current feature W upper limbs).

[0150] (2) Step 2: Calculate feature contribution difference Example 1: Subset .

[0151] Include Output:

[0152] Not included Output:

[0153] Difference:

[0154] Example 2: .

[0155] Include Output:

[0156] Not included Output:

[0157] Difference:

[0158] for Here we assume that

[0159] for Here we assume that

[0160] is the expected value (historical mean) of the sleep stability score, assuming Calculation method:

[0161] in: N : The size of the historical data window, whose value is preset, for example, the data of the past 7 days, N =7.

[0162] : sleep stability score on day k; is the expected value of the attenuation coefficient, i.e., the historical mean. In this example, it is assumed that =0.95, where the calculation method is:

[0163] N : The predetermined historical data window size, such as the data for the past 7 days, N =7.

[0164] For the The attenuation coefficient of the intervention.

[0165] (3) Weighted summation subset weight calculation: For the subset The size is , and its weight formula is:

[0166] Formula Description: For subset The size of (i.e., the number of features included in the subset). It is the collection of all features (Feature Set).

[0167] when =2 (as in Example 1), the weight is: 2!×(5-2-1)! / 5! =2!×2! / 5!=0.0333 when =1 (as in Example 2), the weight is: 1!×(5-1-1)! / 5!= 1!×3! / 5!=0.05 SHAP value calculation:

[0168] (4) Average SHAP value and contribution Generate simulation data: Create 100 sets of data, covering the reasonable range of each parameter (such as ).

[0169] The average contribution is calculated as shown in Table 6: Table 6

[0170] Mean absolute value:

[0171] Total absolute value of contribution:

[0172] Contribution ratio: Contribution

[0173] Clinical interpretability: Dynamic weight dominates: accounting for 48.3%, indicating that the system prioritizes responding to real-time rehabilitation needs. Repair priority is second: accounting for 31.7%, reflecting the clinical diagnostic value of lesion localization. Feedback gain assistance: accounting for 12.1%, verifying the auxiliary decision-making role of physiological signals.

[0174] (IV) Doctor operation interface: supports dragging and dropping to adjust thresholds, such as lowering the weight of memory training, and the system automatically generates new decision tree branches. The advantages of the system and method of this embodiment of the present invention compared with existing traditional systems and methods include: 1. Dynamic adaptability: weights and feedback gains are updated in real time to avoid the "outdated strategy" problem of static models. 2. Clinical interpretability: SHAP values ​​and decision tree visualization help doctors understand the intervention logic, such as "why upper limb grasping is prioritized." 3. Scalability verification: After adding cognitive rehabilitation labels, the system automatically allocates resources to effective goals, such as reducing ineffective memory stimulation.

[0175] Embodiment 4: The present invention also provides a method for assisting rehabilitation during sleep implemented using the above system embodiment, including: using an EEG monitoring component to obtain an EEG signal of an object; using a heart rate and respiration monitoring component to obtain a heart rate and respiration signal of an object; using an EMG monitoring component to obtain an EMG change signal of an object; using a body movement monitoring component to obtain a body movement signal of an object; the body movement signal includes: the body movement frequency and body movement amplitude of the object; when the intervention component is activated, using the intervention component to perform a predetermined intervention operation on the object; using a control component to perform the following steps: receiving EEG signals, heart rate and respiration signals, EMG change signals and body movement signals in real time; using a pre-trained deep learning model to analyze the received EEG signals, heart rate and respiration signals, EMG change signals and body movement signals; The signal feature extraction and timing analysis are performed on the rate and breathing signals, the electromyographic change signals and the body movement signals, and the current sleep stage of the subject is determined according to the results of the signal feature extraction and timing analysis; wherein the sleep stages include: deep sleep, light sleep, rapid eye movement and wakefulness; when the current sleep stage is deep sleep, the intervention priority score is determined according to the subject's daytime rehabilitation training goals, the subject's lesion location and the stability score of the current deep sleep stage; when the intervention priority score is greater than or equal to a predetermined threshold, the subject is currently in the deep sleep stage, and the stability of the current deep sleep stage meets the predetermined stability condition, the intervention component is activated; wherein the stability score is calculated using the following formula: ; in, is the Markov model transition probability of the subject from deep sleep to wakefulness; is the Markov model transition probability of the subject from deep sleep to deep sleep; is the Markov model transition probability of the subject from deep sleep to REM sleep; The following formula is used to determine the intervention priority score: Intervention priority score = Σ(dynamic weight × repair priority × feedback gain) + sleep stability score × state decay coefficient;

[0176] Among them, the dynamic weight is the weight assigned to different daytime rehabilitation training goals, whose initial value is preset and dynamically updated using a pre-trained reinforcement learning model; the repair priority is a parameter pre-set according to the lesion location of the subject, indicating the urgency of nerve repair; Feedback gain is used to indicate the physiological feedback after intervention, where:

[0177] To target day rehabilitation training The feedback gain, is the predetermined adjustment coefficient, After the intervention for a predetermined period of time, the EEG signal The power change of the wave, The initial value of the feedback gain is set in advance as the change in the root mean square value of the electromyography after the predetermined duration of intervention; The state decay coefficient is used to indicate the impact of the current deep sleep duration on the intervention effect, where:

[0178] in, is the state attenuation coefficient at time t, is the predetermined decay rate, is the duration of the current deep sleep period, Score the current stability, A predetermined, subject-individualized baseline stability score was given.

[0179] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, it should be understood by those skilled in the art that various changes may be made to the present invention in form and details without departing from the spirit and scope of the present invention as defined by the appended claims, all of which are within the scope of protection of the present invention.

Claims

1. A system for assisting recovery during sleep, characterized in that: include: An EEG monitoring component, used to obtain EEG signals of a subject; A heart rate and respiration monitoring component, used to obtain the heart rate and respiration signals of the subject; An electromyographic monitoring component, used to obtain an electromyographic change signal of a subject; A body motion monitoring component is used to obtain a body motion signal of the subject; the body motion signal includes: the body motion frequency and body motion amplitude of the subject; An intervention component, used to perform a predetermined intervention operation on the object when activated; Control components for: Receiving the EEG signal, the heart rate and breathing signal, the myoelectric change signal and the body movement signal in real time; Using a pre-trained deep learning model, extracting signal features and performing time series analysis on the received EEG signal, the heart rate and breathing signal, the electromyographic change signal, and the body movement signal, and determining the current sleep stage of the subject according to the results of the signal feature extraction and time series analysis; wherein the sleep stage includes: deep sleep, light sleep, rapid eye movement, and wakefulness; When the current sleep stage is a deep sleep period, determining an intervention priority score according to the subject's daytime rehabilitation training goal, the subject's lesion location, and the stability score of the current deep sleep period, wherein different daytime rehabilitation training goals have predetermined weights; When the intervention priority score is greater than or equal to a predetermined threshold, the subject is currently in a deep sleep period, and the stability of the current deep sleep period meets a predetermined stability condition, activating an intervention component corresponding to the daytime rehabilitation training goal with the highest weight among the daytime rehabilitation training goals; The stability score is calculated using the following formula: ; in, is the Markov model transition probability of the subject from deep sleep to wakefulness; is the Markov model transition probability of the subject from deep sleep to deep sleep; is the Markov model transition probability of the subject from deep sleep to REM sleep; The following formula is used to determine the intervention priority score: in, For the The goal of day rehabilitation training is The dynamic weight of each moment, whose initial value is preset and dynamically updated using a pre-trained reinforcement learning model; M is the total number of daytime rehabilitation training targets; For the The daytime rehabilitation training goals and the pre-set repair priorities according to the lesion location of the subject; For the The feedback gain pre-set during the day rehabilitation training is used to indicate the physiological feedback after the intervention, where: is the predetermined adjustment coefficient, After the intervention for a predetermined period of time, the EEG signal The power change of the wave, The initial value of the feedback gain is set in advance as the change in the root mean square value of the electromyography after the predetermined duration of intervention; for Stability score at each moment; for The state attenuation coefficient at the moment is used to indicate the impact of the current deep sleep duration on the intervention effect, where: in, for The state attenuation coefficient at time , is the predetermined decay rate, is the duration of the current deep sleep period, Score the current stability, A predetermined, subject-individualized baseline stability score was given.

2. The system for assisting rehabilitation during sleep according to claim 1, characterized in that: The dynamic weights are dynamically updated using a proximal policy optimization algorithm, where: in, For the day rehabilitation training goals, Dynamic weight of the moment; is the learning rate used in reinforcement learning; To target day rehabilitation training the actual effects achieved after the intervention; The reinforcement learning model is targeted at the day rehabilitation training goal The predicted effect obtained.

3. The system for assisting rehabilitation during sleep according to claim 1, characterized in that: After the intervention operation is activated, the intensity and / or mode of the intervention is adjusted according to the subject's physiological feedback, wherein: When the acquired physiological signal indicates that the current subject is about to wake up or is already in a light sleep stage, adjusting or suspending the intervention operation, the physiological signal includes: one or more of the EEG signal, the heart rate and breathing signal, the EMG change signal, and the body movement signal; When the acquired physiological signal indicates that the subject's current heart rate or electroencephalogram is abnormal, adjusting the intervention parameter; the adjusting the intervention parameter includes: reducing the intervention intensity or changing the intervention excitation mode; When the acquired physiological signal indicates that the current state of the subject satisfies a predetermined stability condition, the current intervention operation is maintained or the intervention intensity is increased within a predetermined range.

4. The system for assisting rehabilitation during sleep according to claim 1, characterized in that: After using the deep learning model to determine the current sleep stage of the subject and before calculating the stability score, the method further includes triggering the deep learning model to re-determine the current sleep stage when at least one of the following conditions is met: a. The ratio of the low-frequency component to the high-frequency component of the heart rate variability (HRV) is greater than or equal to a predetermined ratio threshold; b, body movement frequency is greater than the predetermined frequency threshold; c. The number of apnea or hypopnea events per hour (RDI) is greater than or equal to the predetermined number threshold .

5. The system for assisting rehabilitation during sleep according to claim 4, characterized in that: The stability score is adjusted when one or more of the conditions a, b or c are met. , or ,in: When condition a is met, Adjusted , in, is the predetermined first HRV gain coefficient, is the predetermined normal value for the current object; Adjusted in, is a predetermined second HRV gain coefficient; When the condition c is met, Adjusted in, is the predetermined respiratory gain factor; Adjusted in, is a predetermined first attenuation coefficient; Adjusted ; in, is a predetermined second attenuation coefficient.

6. The system for assisting rehabilitation during sleep according to claim 1, characterized in that: The intervention operation includes performing a specified type of stimulation at a specified intensity and frequency on one or more parts of the subject.

7. A method for assisting rehabilitation during sleep, which is implemented using the system for assisting rehabilitation during sleep as claimed in any one of claims 1 to 6, characterized in that: include: Acquiring an EEG signal of a subject using an EEG monitoring component; Using a heart rate and respiration monitoring component to obtain a heart rate and respiration signal of the subject; Using an electromyography monitoring component to obtain an electromyography change signal of the subject; Using a body motion monitoring component to obtain a body motion signal of the subject; the body motion signal includes: the body motion frequency and body motion amplitude of the subject; When the intervention component is activated, using the intervention component to perform a predetermined intervention operation on the object; Use the control component to perform the following steps: Receiving the EEG signal, the heart rate and breathing signal, the myoelectric change signal and the body movement signal in real time; Using a pre-trained deep learning model, extracting signal features and performing time series analysis on the received EEG signal, the heart rate and breathing signal, the electromyographic change signal, and the body movement signal, and determining the current sleep stage of the subject according to the results of the signal feature extraction and time series analysis; wherein the sleep stage includes: deep sleep, light sleep, rapid eye movement, and wakefulness; When the current sleep stage is a deep sleep period, determining an intervention priority score according to the subject's daytime rehabilitation training goal, the subject's lesion location, and the stability score of the current deep sleep period, wherein different daytime rehabilitation training goals have predetermined weights; When the intervention priority score is greater than or equal to a predetermined threshold, the subject is currently in a deep sleep period, and the stability of the current deep sleep period meets a predetermined stability condition, activating an intervention component corresponding to the daytime rehabilitation training goal with the highest weight among the daytime rehabilitation training goals; The stability score is calculated using the following formula: ; in, is the Markov model transition probability of the subject from deep sleep to wakefulness; is the Markov model transition probability of the subject from deep sleep to deep sleep; is the Markov model transition probability of the subject from deep sleep to REM sleep; The following formula is used to determine the intervention priority score: in, For the The goal of day rehabilitation training is The dynamic weight of each moment, whose initial value is preset and dynamically updated using a pre-trained reinforcement learning model; M is the total number of daytime rehabilitation training targets; For the The daytime rehabilitation training goals and the pre-set repair priorities according to the lesion location of the subject; For the The feedback gain pre-set during the day rehabilitation training is used to indicate the physiological feedback after the intervention, where: is the predetermined adjustment coefficient, After the intervention for a predetermined period of time, the EEG signal The power change of the wave, The initial value of the feedback gain is set in advance as the change in the root mean square value of the electromyography after the predetermined duration of intervention; for Stability score at each moment; for The state attenuation coefficient at the moment is used to indicate the impact of the current deep sleep duration on the intervention effect, where: in, is the state attenuation coefficient at time t, is the predetermined decay rate, is the duration of the current deep sleep period, Score the current stability, A predetermined, subject-individualized baseline stability score was given.

8. The method for assisting rehabilitation during sleep according to claim 7, characterized in that: Dynamic weights are dynamically updated using the following formula: in, For the day rehabilitation training goals, Dynamic weight of the moment; is the learning rate used in reinforcement learning; To target day rehabilitation training the actual effects achieved after the intervention; The reinforcement learning model is targeted at the day rehabilitation training goal The predicted effect obtained.

9. The method for assisting rehabilitation during sleep according to claim 7, characterized in that: After the intervention operation is activated, the intensity and / or mode of the intervention is adjusted according to the subject's physiological feedback, wherein: When the acquired physiological signal indicates that the current subject is about to wake up or is already in a light sleep stage, adjusting or suspending the intervention operation, the physiological signal includes: one or more of the EEG signal, the heart rate and breathing signal, the EMG change signal, and the body movement signal; When the acquired physiological signal indicates that the subject's current heart rate or electroencephalogram is abnormal, adjusting the intervention parameter; the adjusting the intervention parameter includes: reducing the intervention intensity or changing the intervention excitation mode; When the acquired physiological signal indicates that the current state of the subject satisfies a predetermined stability condition, the current intervention operation is maintained or the intervention intensity is increased within a predetermined range.

10. The method for assisting rehabilitation during sleep according to claim 7, characterized in that: After using the deep learning model to determine the current sleep stage of the subject and before calculating the stability score, the method further includes triggering the deep learning model to re-determine the current sleep stage and / or the stability score when at least one of the following conditions is met: , or : a. The ratio of the low-frequency component to the high-frequency component of the heart rate variability (HRV) is greater than or equal to a predetermined ratio threshold; b, body movement frequency is greater than the predetermined frequency threshold; c. The number of apnea or hypopnea events per hour (RDI) is greater than or equal to the predetermined number threshold ; Among them, adjust the stability score , or The steps include: When condition a is met, Adjusted , in, is the predetermined first HRV gain coefficient, is the predetermined normal value for the current object; Adjusted in, is a predetermined second HRV gain coefficient; When the condition c is met, Adjusted in, is the predetermined respiratory gain factor; Adjusted in, is a predetermined first attenuation coefficient; Adjusted ; in, is a predetermined second attenuation coefficient.

Citation Information

Patent Citations

  • Child lower limb movement auxiliary rehabilitation system based on power exoskeleton

    CN113101134A

  • Sleep improvement environment sound control auxiliary method and system

    CN119185732A

  • Sleep electroencephalogram analysis method and device

    CN119587044A

  • Rehabilitation training evaluation method based on combination of dream guidance and myoelectricity monitoring

    CN119655716A

  • Auxiliary gait rehabilitation training device

    CN217186904U

Cited By

  • Sleep-awakening circadian rhythm disorder adjusting method and device based on ultrasonic stimulation

    CN120094067A

  • Portable electroencephalogram sleep detection and analysis system and method

    CN121533688A

  • Intelligent pillow sleep monitoring and personalized improvement method based on digital twinning

    CN121667652A

  • Electromagnetic field positioning device and fracture healing rehabilitation action evaluation system

    CN121754165A

  • Sleep intervention method and system based on joint features, terminal equipment and storage medium

    CN122297869A