Methods and systems for the coordinated control of musical beats and electrical stimulation

By using real-time physiological data acquisition and multimodal feature fusion algorithms, combined with adaptive PID and Kalman filtering algorithms, the electrical stimulation and music beat are dynamically adjusted, solving the problem of coordinated control between CES and music therapy, achieving efficient individualized sleep treatment, and enhancing EEG synchronization and sleep quality.

CN122461650BActive Publication Date: 2026-11-17HEFEI SHUZHIYUNJIA TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202610706579.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-21
Publication Date
2026-11-17
Estimated Expiration
2046-05-21

AI Technical Summary

Technical Problem

In existing technologies, transcranial microcurrent stimulation (CES) and music therapy lack closed-loop synergistic control with real-time physiological feedback, resulting in fixed stimulation parameters. Long-term use can easily lead to neurological adaptive tolerance, decreased efficacy, insufficient accuracy in sleep stage identification, and inability to achieve personalized long-term treatment strategy optimization.

Method used

By collecting users' physiological data in real time, the current intensity and frequency of microcurrent stimulation are dynamically adjusted using a multimodal feature fusion algorithm and an adaptive PID algorithm. The physiological state is assessed by combining the Kalman filter algorithm, and the music beat is adjusted using a weighted fusion collaborative control algorithm to achieve dynamic coupling between electrical stimulation and music. The treatment strategy is optimized using a reinforcement learning model.

Benefits of technology

It enhances the effect of EEG synchronization induction, shortens the sleep latency by 30%, increases the duration of deep sleep by 20%, avoids overstimulation or understimulation, prevents neural adaptive tolerance, improves the accuracy of sleep stage identification, and enables continuous optimization of individualized treatment plans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122461650B_ABST
    Figure CN122461650B_ABST
Patent Text Reader

Abstract

This invention provides a method and system for the coordinated control of music beats and electrical stimulation. The method includes real-time acquisition of the user's basic physiological data and setting initial adjustment parameters; real-time acquisition of the user's physiological feedback data during microcurrent stimulation and music playback; segmentation and identification of the user's sleep state; dynamic adjustment of the current intensity of microcurrent stimulation using an adaptive PID algorithm based on the sleep segmentation results, and evaluation of the user's current physiological state; adjustment of the frequency of microcurrent stimulation and music beat based on the evaluation results; determination of whether the user has entered deep sleep and whether the deep sleep duration has reached a preset duration; if so, a gradual reduction in the current intensity of the microcurrent stimulation and a decrease in the music volume. This invention achieves multimodal physiological feedback-driven adaptive coordinated therapy, which can significantly shorten the sleep latency and prolong the deep sleep time, and has the advantages of being non-invasive, safe, personalized, and having a lasting therapeutic effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of neuromodulation, specifically relating to a method and system for the coordinated control of musical beats and electrical stimulation. Background Technology

[0002] Insomnia is one of the most common sleep disorders. Long-term insomnia can lead to cognitive decline, mood disorders, and an increased risk of cardiovascular disease. Currently, clinical treatment for insomnia mainly relies on pharmacological therapy (benzodiazepines and non-benzodiazepines) and non-pharmacological therapy (cognitive behavioral therapy and physical therapy). Drug therapy is prone to side effects such as dependence, drug tolerance, and daytime sleepiness; cognitive behavioral therapy has a slow onset of action and limited patient adherence.

[0003] Cranial electrotherapy (CES) is a non-invasive neuromodulation technique that uses low-intensity microcurrents (typically 0.5–2 mA) to stimulate the cranium and regulate neurotransmitter release. Multiple clinical studies have confirmed its effectiveness in improving insomnia. Music therapy, which guides brainwave synchronization through soothing rhythms and frequencies, is also widely used to aid sleep.

[0004] In existing technologies, CES and music therapy are mostly used independently or simply in combination, lacking closed-loop collaborative control based on real-time physiological feedback, and cannot dynamically adapt to the user's current state; the stimulation parameters are fixed, and long-term use can easily lead to neurological adaptive tolerance and reduced efficacy; sleep stage recognition relies on a single EEG signal, which is not accurate enough under home dry electrode conditions, making it difficult to reliably drive closed-loop control; and there is a lack of individualized long-term treatment strategy optimization mechanisms, making it impossible to achieve adaptive evolution that "gets smarter with use". Summary of the Invention

[0005] To address the aforementioned technical problems, this invention provides a method and system for the coordinated control of musical beats and electrical stimulation, thereby overcoming the shortcomings of the prior art.

[0006] In a first aspect, the present invention provides a method for the coordinated control of musical beats and electrical stimulation, the method comprising: Collect users' basic physiological data in real time and set initial adjustment parameters; Real-time acquisition of microcurrent stimulation and physiological feedback data of the user during music playback at the initial adjustment parameters; Based on the physiological feedback data, a multimodal feature fusion algorithm is used to segment and identify the user's sleep state in order to obtain the user's sleep segmentation results. The current intensity of the microcurrent stimulation is dynamically adjusted based on the sleep stage results using an adaptive PID algorithm. The user's current physiological state is evaluated using a Kalman filter algorithm to obtain an evaluation result, and the frequency of the microcurrent stimulation and the music tempo during music playback are adjusted based on the evaluation result. If the user has entered a deep sleep period and the duration of deep sleep has reached a preset duration, the current intensity of the microcurrent stimulation is gradually reduced and the music volume is lowered until a preset maintenance level is reached or the system is completely turned off.

[0007] Compared with existing technologies, the beneficial effects of this invention are as follows: by synergistically controlling the dynamic coupling of electrical stimulation frequency with music beats and EEG target rhythms, the synchronous induction effect of EEG is enhanced, shortening the sleep latency by about 30% and increasing the deep sleep duration by about 20% compared with using CES or music therapy alone. Through adaptive PID control and multi-index weighted deviation, the stimulation intensity can be automatically adjusted according to the user's real-time HRV response to avoid overstimulation or understimulation. Dynamic synergistic adjustment effectively prevents neural adaptive tolerance by determining whether the deep sleep period has been entered and avoiding sudden interruptions to sleep disturbances through real-time adjustment. At the same time, white noise masking prevents sudden external sounds from waking the user.

[0008] Furthermore, the basic physiological data includes heart rate variability, electroencephalogram (EEG) waves, and frontal electromyography (EMG), wherein the EEG waves are detected as theta waves and alpha waves.

[0009] Furthermore, the step of using a multimodal feature fusion algorithm based on the physiological feedback data to segment and identify the user's sleep state to obtain the user's sleep segmentation result includes: Extract multimodal fusion features, including heart rate variability features, power ratio of electroencephalograms, root mean square amplitude and zero-crossing rate of frontal electromyography; The multimodal fusion features are input into a lightweight LSTM network to output preliminary sleep staging results, which include wakefulness, light sleep, deep sleep, and REM sleep. The preliminary sleep staging results were smoothed using a Markov model to obtain the final sleep staging results.

[0010] Furthermore, the expression for the adaptive PID algorithm is: ; In the formula, Indicates the controller output value. This represents the proportionality coefficient, indicating the response to the deviation signal. Instantaneous response gain, Indicates the deviation signal. Represents the time from the initial time 0 to the current time. The deviation integral, e( is the integral variable) () indicates the historical deviation value. Indicates the current moment. Represents the differential coefficient. For the deviation signal at the current time The first derivative.

[0011] Furthermore, the step of adjusting the frequency of the microcurrent stimulation and the music beat during music playback based on the evaluation results includes: The frequency of the microcurrent stimulation is adjusted based on the ratio of theta waves to alpha waves in the electroencephalogram (EEG) and the activity level of prefrontal electromyography. Adjusting the beat frequency and volume of music tracks based on the ratio of low to high frequencies according to heart rate variability; The frequency of the microcurrent stimulation is generated using a weighted fusion collaborative control algorithm, which dynamically weights and fuses the real-time music master frequency and the target EEG rhythm.

[0012] Furthermore, the expression for the weighted fusion collaborative control algorithm is: ; In the formula, Indicates the frequency of electrical stimulation. Indicates dynamic weighting coefficients. This indicates the music's main frequency extracted in real time using a Fast Fourier Transform. Indicates the target brainwave rhythm. Indicates the current time Furthermore, after the step of gradually reducing the current intensity of the microcurrent stimulation and lowering the music volume until a preset maintenance level is reached or the stimulation is completely turned off, the method further includes: Based on a reinforcement learning model and according to the user's historical sleep parameters and feedback data, the current intensity of the microcurrent stimulation and the music volume during music playback are optimized.

[0013] Secondly, the present invention also provides a coordinated control system for music beats and electrical stimulation, the system comprising: The real-time acquisition module is used to collect the user's basic physiological data in real time and set the initial adjustment parameters; The real-time acquisition module is used to acquire in real time the user’s microcurrent stimulation and physiological feedback data during music playback at the initial adjustment parameters. The sleep stage identification module is used to identify the user's sleep stage based on the physiological feedback data using a multimodal feature fusion algorithm, so as to obtain the user's sleep stage results. The current intensity adjustment module is used to dynamically adjust the current intensity of the microcurrent stimulation based on the sleep stage results using an adaptive PID algorithm. The state estimation and frequency beat adjustment module is used to evaluate the user's current physiological state by combining the Kalman filter algorithm to obtain the evaluation result, and adjust the frequency of the microcurrent stimulation and the music beat when the music is played according to the evaluation result. The deep sleep determination and exit control module is used to determine whether the user has entered a deep sleep period and whether the deep sleep duration has reached the preset duration. If so, the current intensity of the microcurrent stimulation is gradually reduced and the music volume is lowered until the preset maintenance level is reached or the system is completely turned off.

[0014] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for coordinated control of music beats and electrical stimulation.

[0015] Fourthly, the present invention also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described method for coordinated control of musical beats and electrical stimulation. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart of the method for coordinated control of music beat and electrical stimulation in the first embodiment of the present invention; Figure 2 This is a structural block diagram of the coordinated control system of music beat and electrical stimulation in the second embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of the electronic device in the third embodiment of the present invention.

[0018] Explanation of key component symbols: 10. Real-time acquisition module; 20. Real-time acquisition module; 30. Stage identification module; 40. Current intensity adjustment module; 50. State estimation and frequency beat adjustment module; 60. Deep sleep determination and exit control module; 70. Bus; 71. Processor; 72. Memory; 73. Communication interface.

[0019] The embodiments of the present invention will be further described below with reference to the accompanying drawings. Detailed Implementation

[0020] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.

[0021] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0023] Example 1 Please see Figure 1 The figure shows a method for coordinated control of music beats and electrical stimulation in the first embodiment of the present invention, the method comprising steps S1 to S6: S1 collects the user's basic physiological data in real time and sets the initial adjustment parameters; In this embodiment, the basic physiological data include heart rate variability (HRV), electroencephalogram (EEG), and frontal electromyography (EMG), wherein the detection of EEG focuses on theta waves (4-8Hz) and alpha waves (8-13Hz). It should be noted that the physiological signal acquisition module, including EEG and EMG acquisition sub-modules, employs a dry electrode headband design, containing Fp1 (left forehead), Fp2 (right forehead), Fpz (frontal midline), Ref (reference electrode, placed at the left / right mastoid process), and a right leg drive (DRL) electrode to suppress common-mode interference. The front-end amplifier uses an 8-channel 24-bit Δ-Σ ADC with a built-in programmable gain amplifier (PGA) that can be dynamically configured: 64x or 128x for EEG acquisition to fully amplify the weak frontal EEG signal (0.5–50 μV), and 12x–24x for EMG acquisition to avoid saturation from strong EMG signals. The ADC input reference noise is less than 1 μVpp, and the typical sampling rate is uniformly 512 Hz (if hardware supports it, the EMG sub-module can independently boost it to 1024 Hz to retain more high-frequency EMG details). To avoid aliasing and fully preserve the effective EMG spectrum (up to approximately 500 Hz), the cutoff frequency of the anti-aliasing filter is set to no less than 1000 Hz. The acquired digital signals are transmitted to the main control chip via the SPI interface (clock not less than 2MHz, also compatible with I²S or UART).

[0024] It is worth noting that the EEG signal is extracted from the Fp1-Fp2 differential channel (with Ref as the common-mode reference and DRL suppressing common-mode), focusing on the theta wave (4-8 Hz) and alpha wave (8-13 Hz) frequency bands. The EMG signal is extracted from the Fp1-Fpz or Fp2-Fpz differential channel (also with Ref as the reference), with a bandwidth of 20-200Hz, used to monitor the tension of the frontal muscles. The HRV acquisition submodule uses a dual-wavelength PPG sensor with red light (660nm) and infrared light (880nm), a sampling rate of 250Hz, and a resolution of 16 bits, attached to the inside of the wrist. Signal processing instructions: Since the EEG and EMG share the same ADC front end (sampling rate 512 Hz, anti-aliasing 200 Hz), additional digital low-pass filtering (50 Hz or 30 Hz) is required for EEG analysis to remove high-frequency electromyographic interference; digital high-pass filtering (20 Hz) is required for EMG analysis to remove baseline drift. The two signals can be processed independently in the main control chip without affecting each other.

[0025] In practice, the microcurrent is increased from 0.2mA in 0.05mA increments, each increment lasting 30 seconds, until the user reports a slight tingling sensation or reaches 1.5mA. The tolerance threshold I_tolerance is recorded, and the maximum treatment current is limited to min(I_tolerance, 1.5mA). Three types of music samples (natural sound, binaural beats, and piano music) are played for 30 seconds each, and the user selects the most comfortable category. Initial parameter settings: target LF / HF_target = resting LF / HF × 1.2 (upper limit 2.0), initial PID parameter: K p0=0.5, K i0 =0.1, K d0 =0.2, initial current intensity = 30% of withstand threshold; EEG / EMG preprocessing process: Data frames (5120 sampling points) are processed every 10 seconds. EEG channels (Fp1-Fp2): DC offset removal: The mean is subtracted from the frame (5120 points) every 10 seconds to eliminate the DC component.

[0026] Bandpass filter: 4th order Butterworth, 0.5Hz~45Hz.

[0027] Notch filter: 50Hz (or 60Hz) notch filter, quality factor Q=30.

[0028] Artifact removal: Wavelet thresholding denoising (sym4 wavelet, 7-level decomposition, soft thresholding of detail coefficients) is used to remove electrooculogram artifacts.

[0029] Power spectrum estimation: Welch method with Hanning window, window length 1024 points (2 seconds), overlap 512 points, FFT points 1024. Calculate the absolute and relative power of the theta wave (4-8Hz) and alpha wave (8-13Hz) frequency bands.

[0030] The θ / α ratio: relative power of θ / relative power of α, reflects the degree of drowsiness (the θ / α ratio increases before falling asleep).

[0031] Spectral entropy calculation: Calculating Shannon entropy from the power spectral probability density distribution This reflects the orderliness of brainwaves.

[0032] Alpha wave decay index: the percentage decrease in alpha power at the resting baseline with eyes closed; the greater the decay, the closer to sleep.

[0033] EMG channel (Fp1-Fpz or Fp2-Fpz) processing flow: 1. Bandpass filter: 4th order Butterworth, passband 20Hz ~ 200Hz, filters out low-frequency drift and high-frequency noise, and retains the main electromyographic spectrum.

[0034] 2. Branch processing (parallel): Branch A: Zero-crossing rate A ±5μV threshold was set, and the number of times the signal crossed the threshold in each frame was counted to reflect the frequency of electromyographic activity.

[0035] Branch B: RMS Amplitude Calculate the root mean square of the filtered signal directly within a window (5120 points / 10-second frames):

[0036] In the formula, This indicates that the EMG signal after bandpass filtering is at the [number]th [number]. The voltage values ​​(in μV) at each sampling point. A total of [number] sampling points are present in one frame. One sampling point. This represents the total number of sampling points within a frame, i.e., the window length. Each frame is set to 10 seconds, the sampling rate to 256 Hz, and N=5120. This represents the sum of the instantaneous power of all sampling points within the window. This represents the average power within the window. The square root operation converts the average power to a root mean square amplitude in the same units as the original signal, characterizing the effective discharge intensity (muscle tension) of the muscle within that frame. The RMS amplitude equals the effective value of the signal; it directly reflects the envelope amplitude level of the electromyographic signal, eliminating the need for pre-rectification and smoothing, thus avoiding redundancy caused by recalculating the RMS after rectification. It reflects muscle tension.

[0037] 3. Median Frequency (MDF) The power spectrum was estimated using the Welch method (Hanning window, 1024 points, 512 overlap points), and the power was accumulated to the frequency corresponding to 50% of the total power to assess the degree of muscle fatigue.

[0038] HRV preprocessing workflow: 1. Sliding window The HRV index is calculated sequentially every 5 minutes with a step size of 30 seconds.

[0039] 2. Peak detection Adaptive threshold: Take 1.2 times the average value of the PPG signal in the previous 10 seconds as the dynamic threshold.

[0040] Additional constraint: minimum peak spacing of 300ms (corresponding to heart rate <200bpm), which can be combined with the zero point of the second derivative to improve the detection rate.

[0041] 3. RR interval sequence Physiological abnormalities were excluded: RR < 300ms or > 2000ms.

[0042] Missing points: Linear interpolation filling (natural cubic splines can also be selected) to avoid NaN (non-numerical contamination) interfering with subsequent calculations.

[0043] 4. Detrend Smoothness Priors (λ=100) removes low-frequency drift components.

[0044] 5. Time-domain indicators SDNN: RR interval standard deviation.

[0045] RMSSD: Root mean square difference between adjacent RR values.

[0046] pNN50: The proportion of adjacent RR differences > 50ms.

[0047] 6. Frequency Domain Indicators Use the Lomb-Scargle periodogram (suitable for non-uniformly sampled RR sequences), with a recommended frequency range of 0.04–0.4 Hz.

[0048] LF: 0.04–0.15Hz power; HF: 0.15–0.4Hz power; calculate the LF / HF ratio.

[0049] S2, real-time acquisition of the user's microcurrent stimulation and physiological feedback data during music playback at the initial adjustment parameters; It should be noted that the microcurrent output uses a transcranial microcurrent stimulation (CES) module; waveform generation: using the processor's built-in DA module, it can generate sine waves, square waves, and triangle waves; constant current source circuit: adopts a voltage-controlled constant current structure, with an output current range of 0~2.5mA and a step of 0.01mA; electrodes: ear clip electrodes, clipped to both earlobes; safety protection: series resistor current limiting, and hardware overcurrent detection, which immediately cuts off the output in case of abnormality; The output current of the CES module is modulated using a combination of random frequency and amplitude, expressed as follows: ; Instantaneous frequency Defined as: ; Instantaneous amplitude Gaussian noise is added to the reference amplitude: ; In the formula, This indicates the instantaneous current value output by CES. Indicates the current amplitude (after fine modulation). Indicates instantaneous frequency. Indicates the initial phase (constant). Indicates the current moment. The fundamental frequency is determined by the cooperative control algorithm, with a frequency hopping range of ±1.5Hz. The hopping interval follows a Poisson distribution (on average once every 2 seconds). In the formula, This indicates the set current amplitude (reference amplitude). This represents a standard normally distributed random process (Gaussian white noise with a mean of 0 and a standard deviation of 1).

[0050] The music playback module is controlled by an I2S DAC and a Class D amplifier. The sound source is a bone conduction headphone to avoid blocking the ear canal while maintaining awareness of ambient sounds (for safety). Storage: Onboard MicroSD card with pre-stored sleep-aid music (natural sounds, binaural beats, alpha wave induced music, etc.). Volume control: Digital attenuation range 0~-60dB, in 1dB steps.

[0051] S3, Based on the physiological feedback data, a multimodal feature fusion algorithm is used to identify the user's sleep state in stages, so as to obtain the user's sleep stage results; Specifically, step S3 includes steps S31 to S33: S31, Extract multimodal fusion features, including heart rate variability features, power ratio of electroencephalogram, root mean square amplitude and zero-crossing rate of frontal electromyography; S32, input the multimodal fusion features into a lightweight LSTM network and output preliminary sleep staging results, which include wakefulness, light sleep, deep sleep and REM sleep. S33, The preliminary sleep staging results are smoothed using a Markov model to obtain the final sleep staging results. It should be noted that the multimodal feature fusion algorithm integrates features from three modalities: HRV, EEG (θ / α wave), and EMG. Specific features include: HRV: SDNN, RMSSD, LF / HF (5-minute sliding window); EEG: The relative power of theta waves (4-8Hz), the relative power of alpha waves (8-13Hz), and the theta / alpha power ratio (reflecting the degree of drowsiness). EMG: Root Mean Square (RMS) amplitude, zero-crossing rate (reflects muscle tension).

[0052] A lightweight LSTM network (TinyLSTM) is used for sleep stage recognition, outputting four states: wakefulness, light sleep, deep sleep, and REM sleep. The network structure consists of a 24-dimensional input layer (3 frames × 8 features), a 32-unit LSTM layer, a 16-neuron fully connected layer, and a 4-neuron Softmax output layer. The output probability vector is smoothed using a Hidden Markov Model (HMM) to constrain the state transition probabilities. In practical implementation, feature extraction is performed, with each frame lasting ten seconds. The feature descriptions are shown in Table 1. Table 1

[0053] Take 3 consecutive frames (30 seconds) with a total of 24 dimensions of features as network input; Network structure: LSTM(32) → Dense(16) → Dense(4, softmax), input shape (3, 8); Training data: Sleep-EDF Expanded dataset, extract the above 8 features, and label them into four categories: awake, light sleep, deep sleep, and REM sleep; Training configuration: Adam optimizer (learning rate 0.001), cross-entropy loss, batch size 64, early stopping (stop if the verification loss does not decrease after 10 rounds). Performance: Test set accuracy 86.5%, F1-score 0.84, meeting the needs of home real-time monitoring. Deployment: Converted to TensorFlow Lite for Microcontrollers format and integrated into the CES stimulus module processor, with a single inference time of <10ms; HMM post-processing: A Hidden Markov Model is used to smooth the probability sequence output by the LSTM. The state transition probability matrix is ​​set based on the prior statistics of the sleep stage. Limit physiologically impossible transitions (such as the extremely low probability of a direct transition from deep sleep to REM sleep). The Viterbi algorithm decodes the optimal state sequence and outputs the final staged result every 10 seconds. HMM post-processing can effectively suppress jitter caused by single-frame misjudgment and improve the stability of the segmentation.

[0054] S4. The current intensity of the microcurrent stimulation is dynamically adjusted using an adaptive PID algorithm based on the sleep stage results. 1. Control target and deviation signal Control objective: To guide the user's autonomic nervous system state towards a state conducive to sleep. Target values ​​are set based on the resting-state baseline: SDNN target ( () represents the resting mean; Target( The value was 1.2 times the resting mean (appropriately reducing sympathetic nerve activity).

[0055] Core bias e(t): Employs a multi-index weighted relative bias, combining SDNN and... Two dimensions of off-target effect: ; In the formula, This represents the bias weight coefficient of the SDNN. This represents the resting-state SDNN mean. This represents the actual SDNN value (in milliseconds) measured within the current 30 seconds, and how it changes over time. express The target value for the ratio is set to 1.2 times the resting state. Mean, to induce relative parasympathetic dominance (make reduce), This indicates the actual measurement within the current 30 seconds. ratio, express The target value for the ratio is set to 1.2 times the resting state. Mean, to induce relative parasympathetic dominance (make (Lower); usually take =0.4, =0.6. e(t)>0 indicates that the actual physiological state deviates from the target (insufficient parasympathetic response), and stimulation needs to be increased; e(t)<0 indicates that stimulation needs to be decreased. The expression for the rate of change of deviation is: ; 2. Kalman filter noise reduction To reduce HRV measurement noise, a Kalman filter is applied to the LF / HF ratio. The state vector is set as [LF / HF, rate of change]^T, where T represents the matrix / vector transpose. The state transition matrix A = [1 Δt; 0 1], where Δt represents the control period / Kalman filter step size of 30 seconds. The observation matrix H = [1 0]. The process noise covariance Q = diag(0.01, 0.001), and the observation noise covariance R = 0.1. The smoothed LF / HF value and its rate of change are output every 30 seconds for bias calculation and fuzzy rules.

[0056] 3. Adaptive PID controller Control output Used to adjust the stimulation current: ; In the formula, Indicates the controller output value. This represents the proportionality coefficient, indicating the response to the deviation signal. Instantaneous response gain, Indicates the deviation signal. Represents the time from the initial time 0 to the current time. The deviation integral, e( is the integral variable) () indicates the historical deviation value. Indicates the current moment. Represents the differential coefficient. For the deviation signal at the current time The first derivative reflects the rate and direction of the deviation change; and the proportionality coefficient Integral coefficient and differential coefficients All of these are adaptive parameters that are adjusted in real time based on the characteristics of the music beat and / or error signals.

[0057] Parameter adaptation: using deviation signal and its rate of change As input, the gain is dynamically tuned using fuzzy rules. and Mapped to [ 1,1][ [1,1], the fuzzy subset is {NB, NS, ZO, PS, PB}, and the correction coefficients are obtained after defuzzification. , , .

[0058] Parameter update: The expression is: ; ; ; In the formula, , , The reference gain (initial setpoint) represents the proportional, integral, and derivative functions; recommended values ​​are 0.5, 0.1, and 0.2, respectively. This is a limiting function that restricts the calculation results within a safe range, preventing control failure or oscillation caused by excessively small or large gains.

[0059] Integral separation: When |e(t)|>0.2, the integral accumulation is paused, and only PD control is used to prevent saturation; 4. Current Mapping and Final Output Will Normalized output, Output range [-1, 1], mapped to actual output current : Change in current: , Current range: =0.2mA, , This indicates the maximum current that an individual can withstand.

[0060] New current: , Smooth output: for A first-order low-pass filter (α=0.3) is performed to obtain the final applied current: .

[0061] In the formula, This indicates the current value finally applied to the electrode in the previous control cycle (i.e., the current value of the previous cycle). ), Indicates the maximum allowable output current. Indicates the minimum output current. Indicates the maximum withstand current of an individual. This indicates that the stimulation current (mA) ultimately output to the ear clip electrode during the current control cycle is the actual physical quantity applied to the human body. 5. Control cycle A complete cycle of "Kalman filter estimation → deviation calculation → PID adjustment → current update" is executed every 30 seconds. S5, combine the Kalman filter algorithm to evaluate the user's current physiological state to obtain the evaluation result, and adjust the frequency of the microcurrent stimulation and the music beat when the music is played according to the evaluation result; Specifically, step S5 includes steps S51 to S53: S51, the frequency of the microcurrent stimulation is adjusted based on the ratio of theta waves to alpha waves in the electroencephalogram and the activity level of prefrontal electromyography. S52 adjusts the beat frequency and volume of music tracks based on the ratio of low to high frequencies according to heart rate variability. It should be noted that, based on the sleep stage results, an adaptive PID algorithm is used to dynamically adjust the micro-current intensity, and combined with the physiological state variables estimated by Kalman filtering, the micro-frequency and music beat are adjusted to form a closed-loop control. S53, the frequency of the microcurrent stimulation is generated by a weighted fusion collaborative control algorithm, which dynamically weights and fuses the real-time music main frequency and the target EEG rhythm. In practice, the weighted fusion collaborative control is executed once every second; Extracting the main frequency of music: Take 512 samples from the currently playing music buffer, apply a Hanning window and FFT, and find the frequency corresponding to the maximum power. (Limited to 0.5~20Hz); Frequency smoothing: ; Anomaly detection: If | - If |>5Hz, then keep the previous value and set flag=1; in, Indicates the candidate music main frequency. This represents the smoothed music frequency (at the current moment). This indicates the main frequency of the music after smoothing from the previous control cycle (1 second ago); Determine the target frequency of the EEG: The goal is to induce a theta wave (4-8Hz), with a center frequency of 6Hz as the target. , Indicates the target EEG rhythm frequency; If the current sleep stage is deep sleep, maintain the current peak frequency of EEG theta waves; Calculate the phase-locked value (PLV): Take the past 2 seconds of EEG data from channels Fp1-Fp2 and compare it with... Perform phase-locked loop (PLL) value calculations, where Fp1 and Fp2 represent the left and right front electrode electrodes of the international 10-20 system. This indicates the actual CES stimulation frequency output in the previous control cycle (1 second ago); Calculate normalized EMG activity: The range is limited to [0,1], where, This represents the normalized electromyographic activity level, limited to the range [0,1]. This represents the root mean square value of the current EMG signal, and indicates the instantaneous electrical activity intensity of the frontal muscles. This represents the resting-state EMG baseline value; Calculate dynamic weights The expression is: The basic weights are mapped from PLV via Sigmoid:

[0062] The inhibition term introduces EMG activity, reducing the music weight when stressed: ; In the formula, This indicates the base weight determined by PLV; if the music is abnormal, Further reduction.

[0063] In this embodiment, the expression for the weighted fusion collaborative control algorithm is: ; In the formula, Indicates the frequency of electrical stimulation. Indicates dynamic weighting coefficients. This indicates the music's main frequency extracted in real time using a Fast Fourier Transform. Indicates the target brainwave rhythm. This represents the current time (in seconds); the dynamic weighting coefficient is calculated based on the user's current EEG phase-locked value (PLV) and EMG activity level, and the expression is: ; In the formula, This represents the dynamic weight at the current moment. The exponent, e, is the natural base, which causes the weights to vary with PLV in an S-shaped curve. Represents the sigmoid steepness coefficient. This indicates the current EEG phase-locked value. This represents the normalized level of prefrontal electromyographic activity. This represents the electromyographic inhibition coefficient. When EMG activity increases, α decreases, reducing the influence of music and prioritizing theta wave induction. The final frequency is limited to 0.5~10Hz (sleep-inducing band); frequencies exceeding this range are saturated. It is worth noting that the random frequency conversion modulation waveform is generated by updating the frequency jump every 1 second (following a Poisson distribution with an average interval of 2 seconds); the fundamental frequency... (From the output of the cooperative control algorithm); generated during the transition. ~Uniform(-1.5, 1.5) Hz, new frequency = + ;limit Within the range of [0.5, 10]; simultaneously, amplitude micro-modulation is performed with a change rate <0.05 mA / s, where, The fundamental frequency of the output of the cooperative control algorithm is represented by Uniform, which indicates a uniform distribution. In the interval [ The probability of taking any value within the range [1.5, 1.5] is the same. This indicates the frequency jump offset.

[0064] It should be noted that once the user is determined to have entered a deep sleep period and this period has lasted for a preset time (five consecutive deep sleep episodes, EEG θ / α ratio > 2.0, EMG RMS amplitude below the deep sleep baseline threshold), a gradual reduction method is used: the music volume decreases linearly, the current intensity decreases exponentially, and extremely low-volume white noise is played as a masking effect. If signs of awakening are detected during the gradual reduction process (alpha wave resurgence, sudden increase in EMG activity, heart rate increase > 15%), the system is immediately shut down, the parameters are restored, and the system is maintained for 5 minutes before attempting to restart. It is worth noting that the results of five consecutive sleep stages were all in deep sleep; the EEG theta / alpha ratio was >2.0 (theta wave dominant, alpha wave suppressed); the EMG RMS amplitude was less than 1.2 times the deep sleep baseline threshold (muscles completely relaxed); and the LF / HF ratio was <0.8 for 10 minutes. When these conditions were met, the shutdown countdown was started. Gradual decay phase (30 seconds): The music volume decreases linearly; the current intensity decreases exponentially.

[0065] Wake-up protection monitoring (full process): EEG alpha wave relative power recovery >50%; EMG RMS amplitude sudden increase >100%; heart rate instantaneous increase >15%; body motion signal (accelerometer detection); any of these triggers will stop the shutdown, restore parameters, observe for 5 minutes, and then retry.

[0066] S6. Determine whether the user has entered a deep sleep period and whether the deep sleep duration has reached the preset duration. If so, gradually reduce the current intensity of the microcurrent stimulation and lower the music volume until the preset maintenance level is reached or the music is completely turned off. Specifically, step S6 includes step S61: S61, Based on the reinforcement learning model and according to the user's historical sleep parameters and feedback data, optimize the current intensity of the microcurrent stimulation and the music volume during music playback; It should be noted that the PPO reinforcement learning model is deployed with a state space that includes user static attributes (age, gender, ISI score) and recent treatment statistics (sleep latency, deep sleep duration, average stimulus intensity, etc., totaling 11 dimensions). The action space is a mixed action space: discrete selection of treatment modes (pure CES / pure music / synergy), with continuous parameters including initial current, initial PID value, and music type. The reward function comprehensively considers improvements in sleep efficiency, extension of total sleep time, and shortening of sleep latency, while penalizing excessively high stimulus intensity and drastic parameter fluctuations. A federated learning framework is used to aggregate user-side gradient updates weekly, and the optimized strategy is distributed to the terminal to achieve continuous evolution of personalized treatment plans.

[0067] In summary, the synergistic control method of music beat and electrical stimulation in the above embodiments of the present invention has the following advantages: synergistic effect: through weighted fusion synergistic control, the electrical stimulation frequency is dynamically coupled with the music beat and the target EEG rhythm, enhancing the synchronous induction effect of EEG. Compared with using CES or music therapy alone, the sleep latency is shortened by about 30%, and the deep sleep duration is increased by about 20%; adaptive and personalized: by adopting fuzzy adaptive PID control and multi-index weighted deviation, the stimulation intensity can be automatically adjusted according to the user's real-time HRV response to avoid overstimulation or understimulation; anti-adaptive: random frequency modulation waveform and dynamic synergistic weight coefficient effectively prevent neural adaptive tolerance, and the efficacy remains stable with long-term use (>4 weeks); high-precision sleep staging: by integrating HRV, EEG (θ / α wave) and prefrontal EMG three-modal features and using LSTM+HMM post-processing, the accuracy reaches 86% under home dry electrode conditions, providing a reliable basis for closed-loop control. Adding EMG detection can effectively distinguish between wakefulness and sleep, reducing misjudgments; continuous cloud optimization: based on PPO reinforcement learning model combined with federated learning, the treatment strategy is continuously optimized using group data while protecting privacy, realizing the iterative upgrade of individualized treatment plans; safe and comfortable: automatically weakens and shuts down after deep sleep and adds wake-up protection to avoid sudden interruption of sleep disturbance, while white noise masking prevents sudden external noise from waking you up.

[0068] Example 2 Please see Figure 2 The figure shows a coordinated control system for music beats and electrical stimulation according to a second embodiment of the present invention. The system includes: The real-time acquisition module 10 is used to acquire the user's basic physiological data in real time and set initial adjustment parameters. The basic physiological data includes heart rate variability, electroencephalogram (EEG) and frontal electromyography (EMG). The EEG is detected as theta waves and alpha waves. The real-time acquisition module 20 is used to acquire in real time the user's microcurrent stimulation and physiological feedback data during music playback at the initial adjustment parameters. The stage identification module 30 is used to identify the user's sleep state based on the physiological feedback data using a multimodal feature fusion algorithm, so as to obtain the user's sleep stage results. The current intensity adjustment module 40 is used to dynamically adjust the current intensity of the microcurrent stimulation according to the sleep stage results using an adaptive PID algorithm. The expression of the adaptive PID algorithm is: ; In the formula, Indicates the controller output value. This represents the proportionality coefficient, indicating the response to the deviation signal. Instantaneous response gain, Indicates the deviation signal. Represents the time from the initial time 0 to the current time. The deviation integral, e( is the integral variable) () indicates the historical deviation value. Indicates the current moment. Represents the differential coefficient. For the deviation signal at the current time The first derivative; The state estimation and frequency beat adjustment module 50 is used to evaluate the user's current physiological state by combining the Kalman filter algorithm to obtain the evaluation result, and adjust the frequency of the microcurrent stimulation and the music beat when the music is played according to the evaluation result. The deep sleep determination and exit control module 60 is used to determine whether the user has entered a deep sleep period and whether the deep sleep duration has reached a preset duration. If so, the current intensity of the microcurrent stimulation is gradually reduced and the music volume is lowered until a preset maintenance level is reached or the system is completely turned off.

[0069] In some alternative embodiments, the phased identification module 30 includes: The identification unit is used to extract multimodal fusion features, which include heart rate variability features, power ratio of electroencephalograms, root mean square amplitude and zero-crossing rate of frontal electromyography. The output unit is used to input the multimodal fusion features into a lightweight LSTM network and output preliminary sleep staging results, which include wakefulness, light sleep, deep sleep and REM sleep. The processing unit is used to smooth the awake state, the light sleep state, the deep sleep state, and the REM sleep state based on a Markov model.

[0070] In some alternative embodiments, the state estimation and frequency beat adjustment module 50 includes: An adjustment unit is used to adjust the frequency of the microcurrent stimulation based on the ratio of theta waves to alpha waves in the electroencephalogram (EEG) and the activity level of prefrontal electromyography. The adjustment unit is used to adjust the beat frequency and volume of music tracks based on the ratio of low to high frequencies according to heart rate variability. A control unit is used to generate the frequency of the microcurrent stimulation using a weighted fusion collaborative control algorithm. The weighted fusion collaborative control algorithm dynamically weights and fuses the real-time dominant frequency of the music playback with the target EEG rhythm. The expression for the weighted fusion collaborative control algorithm is: ; In the formula, Indicates the frequency of electrical stimulation. Indicates dynamic weighting coefficients. This indicates the music's main frequency extracted in real time using a Fast Fourier Transform. Indicates the target brainwave rhythm. Indicates the current moment.

[0071] In some alternative embodiments, the state estimation and frequency beat adjustment module 50 includes: The optimization unit is used to optimize the current intensity of the microcurrent stimulation and the music volume during music playback based on a reinforcement learning model and according to the user's historical sleep parameters and feedback data.

[0072] The functions or operation steps implemented by the above modules and units are largely the same as those in the above method embodiments, and will not be repeated here.

[0073] The music beat and electrical stimulation coordinated control system provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0074] Example 3 The third embodiment of the present invention also proposes an electronic device, please refer to [link / reference]. Figure 3 The image shows an electronic device according to a third embodiment of the present invention.

[0075] The electronic device may include a processor 71 and a memory 72 storing computer program instructions.

[0076] Specifically, the processor 71 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement this application.

[0077] The memory 72 may include a mass storage device for data or instructions. For example, and not limitingly, the memory 72 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 72 may include removable or non-removable (or fixed) media. Where appropriate, the memory 72 may be internal or external to a data processing device. In a particular embodiment, the memory 72 is non-volatile memory. In a particular embodiment, the memory 72 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.

[0078] The memory 72 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 71.

[0079] The processor 71 reads and executes the computer program instructions stored in the memory 72 to implement the coordinated control method of music beat and electrical stimulation described in Embodiment 1 above.

[0080] In some embodiments, the electronic device may further include a communication interface 73 and a bus 70. For example, Figure 3 As shown, the processor 71, memory 72, and communication interface 73 are connected through bus 70 and complete communication with each other.

[0081] The communication interface 73 is used to enable communication between the various modules, devices, units, and / or equipment in this application. The communication interface 73 can also enable data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.

[0082] Bus 70 includes hardware, software, or both, that couples the components of a device together. Bus 70 includes, but is not limited to, at least one of the following: data bus, address bus, control bus, expansion bus, and local bus. For example, and not as a limitation, bus 70 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 70 may include one or more buses. Although this application describes and illustrates a specific bus, this application considers any suitable bus or interconnection.

[0083] The electronic device can acquire a coordinated control system for music beats and electrical stimulation, and execute the coordinated control method for music beats and electrical stimulation in this embodiment.

[0084] Furthermore, in conjunction with the coordinated control method of music beat and electrical stimulation in Embodiment 1 above, this application can provide a storage medium for implementation. This storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement the coordinated control method of music beat and electrical stimulation described in Embodiment 1 above.

[0085] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0086] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A coordinated control system for musical beats and electrical stimulation, characterized in that, The system includes: The real-time acquisition module is used to collect the user's basic physiological data in real time and set the initial adjustment parameters; The real-time acquisition module is used to acquire in real time the user’s microcurrent stimulation and physiological feedback data during music playback at the initial adjustment parameters. The sleep stage identification module is used to identify the user's sleep stage based on the physiological feedback data using a multimodal feature fusion algorithm, so as to obtain the user's sleep stage results. The current intensity adjustment module is used to dynamically adjust the current intensity of the microcurrent stimulation according to the sleep stage results using an adaptive PID algorithm. The current intensity adjustment module is specifically used for: The control objective is to guide the user's autonomic nervous system state towards a sleep-friendly direction. The target values ​​are set based on a resting-state baseline and include SDNN targets and... Target; Core bias is determined by employing a multi-indicator weighted relative bias, which integrates the SDNN objective and... The degree of miss in both dimensions of the target is expressed as: ; In the formula, This represents the bias weight coefficient of the SDNN. This represents the resting-state SDNN mean. This represents the actual SDNN value (in milliseconds) measured within the current 30 seconds, and how it changes over time. express The target value for the ratio is set to 1.2 times the resting state. Mean, to induce relative parasympathetic dominance (make reduce), This indicates the actual measurement within the current 30 seconds. ratio, express The target for the ratio is set at 1.2 times the resting state. Mean; Control output to adjust the stimulation current by means of controller output value, and adjust the stimulation current by means of parameter adaptation and parameter update; Current mapping and final output, to achieve this by... Normalize the output and The output range is mapped to the actual current to obtain the final output current; The control objective, the core deviation, the control output, and the current mapping and final output are executed cyclically. The state estimation and frequency beat adjustment module is used to evaluate the user's current physiological state by combining the Kalman filter algorithm to obtain the evaluation result, and adjust the frequency of the microcurrent stimulation and the music beat when the music is played according to the evaluation result. The deep sleep determination and exit control module is used to determine whether the user has entered a deep sleep period and whether the deep sleep duration has reached the preset duration. If so, the current intensity of the microcurrent stimulation is gradually reduced and the music volume is lowered until the preset maintenance level is reached or the system is completely turned off.

2. A method for the coordinated control of musical beats and electrical stimulation, applied to the coordinated control system of musical beats and electrical stimulation as described in claim 1, characterized in that, The method includes: Collect users' basic physiological data in real time and set initial adjustment parameters; Real-time acquisition of microcurrent stimulation and physiological feedback data of the user during music playback at the initial adjustment parameters; Based on the physiological feedback data, a multimodal feature fusion algorithm is used to segment and identify the user's sleep state in order to obtain the user's sleep segmentation results. Based on the sleep staging results, an adaptive PID algorithm is used to dynamically adjust the current intensity of the microcurrent stimulation. This step specifically includes: The control objective is to guide the user's autonomic nervous system state towards a sleep-friendly direction. The target values ​​are set based on a resting-state baseline and include SDNN targets and... Target; Core bias is determined by employing a multi-indicator weighted relative bias, which integrates the SDNN objective and... The degree of miss in both dimensions of the target is expressed as: ; In the formula, This represents the bias weight coefficient of the SDNN. This represents the resting-state SDNN mean. This represents the actual SDNN value (in milliseconds) measured within the current 30 seconds, and how it changes over time. express The target value for the ratio is set to 1.2 times the resting state. Mean, to induce relative parasympathetic dominance (make reduce), This indicates the actual measurement within the current 30 seconds. ratio, express The target for the ratio is set at 1.2 times the resting state. Mean; Control output to adjust the stimulation current by means of controller output value, and adjust the stimulation current by means of parameter adaptation and parameter update; Current mapping and final output, to achieve this by... Normalize the output and The output range is mapped to the actual current to obtain the final output current; The control objective, the core deviation, the control output, and the current mapping and final output are executed cyclically. The user's current physiological state is evaluated using a Kalman filter algorithm to obtain an evaluation result, and the frequency of the microcurrent stimulation and the music tempo during music playback are adjusted based on the evaluation result. If the user has entered a deep sleep period and the duration of deep sleep has reached a preset duration, the current intensity of the microcurrent stimulation is gradually reduced and the music volume is lowered until a preset maintenance level is reached or the system is completely turned off.

3. The method for coordinated control of musical beats and electrical stimulation according to claim 2, characterized in that, The basic physiological data include heart rate variability, electroencephalogram (EEG) and prefrontal electromyography (EMG), wherein the EEG is detected as theta waves and alpha waves.

4. The method for coordinated control of musical beats and electrical stimulation according to claim 2, characterized in that, The step of using a multimodal feature fusion algorithm based on the physiological feedback data to segment and identify the user's sleep state in order to obtain the user's sleep segmentation result includes: Extract multimodal fusion features, including heart rate variability features, power ratio of electroencephalograms, root mean square amplitude and zero-crossing rate of frontal electromyography; The multimodal fusion features are input into a lightweight LSTM network to output preliminary sleep staging results, which include wakefulness, light sleep, deep sleep, and REM sleep. The preliminary sleep staging results were smoothed using a Markov model to obtain the final sleep staging results.

5. The method for coordinated control of musical beats and electrical stimulation according to claim 2, characterized in that, The expression for the adaptive PID algorithm is: ; In the formula, Indicates the controller output value. This represents the proportionality coefficient, indicating the response to the deviation signal. Instantaneous response gain, Indicates the deviation signal. Represents the time from the initial time 0 to the current time. The deviation integral, e( is the integral variable) () indicates the historical deviation value. Indicates the current moment. Denotes the differential coefficient. For the deviation signal at the current time The first derivative.

6. The method for coordinated control of musical beats and electrical stimulation according to claim 2, characterized in that, The steps of adjusting the frequency of the microcurrent stimulation and the tempo of the music playback based on the evaluation results include: The frequency of the microcurrent stimulation is adjusted based on the ratio of theta waves to alpha waves in the electroencephalogram (EEG) and the activity level of prefrontal electromyography (PEM). Adjusting the beat frequency and volume of music tracks based on the ratio of low to high frequencies according to heart rate variability; The frequency of the microcurrent stimulation is generated using a weighted fusion collaborative control algorithm, which dynamically weights and fuses the real-time music master frequency and the target EEG rhythm.

7. The method for coordinated control of musical beats and electrical stimulation according to claim 6, characterized in that, The expression for the weighted fusion collaborative control algorithm is: ; In the formula, Indicates the frequency of electrical stimulation. Indicates dynamic weighting coefficients. This indicates the music's main frequency extracted in real time using a Fast Fourier Transform. Indicates the target brainwave rhythm. Indicates the current moment.

8. The method for coordinated control of musical beats and electrical stimulation according to claim 2, characterized in that, After the step of gradually reducing the current intensity of the microcurrent stimulation and lowering the music volume until a preset maintenance level is reached or the stimulation is completely turned off, the method further includes: Based on a reinforcement learning model and according to the user's historical sleep parameters and feedback data, the current intensity of the microcurrent stimulation and the music volume during music playback are optimized.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for coordinated control of musical beats and electrical stimulation as described in any one of claims 2 to 8.

10. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method for coordinated control of musical beats and electrical stimulation as described in any one of claims 2 to 8.

Citation Information

Patent Citations

  • Feedback type nervous electrical stimulation system and feedback control method thereof

    CN102343123A

  • Music bioelectricity physiotherapy instrument based on nursing data

    CN120860467A

  • Sleep stage self-adaptive multi-mode closed-loop regulation and control system

    CN121695388A