A method and system for music generation and regulation based on physiological data

By constructing music generation and simulation models, and adjusting music parameters in real time to adapt to changes in the user's physiological state, the problem of unstable sleep-aid effects in existing systems has been solved, and personalized sleep-aid music recommendations have been realized.

CN122124368APending Publication Date: 2026-06-02BEIJING GUANGJI XIANGDA MEDIA GROUP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING GUANGJI XIANGDA MEDIA GROUP CO LTD
Filing Date
2026-01-19
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing music recommendation systems based on physiological data lack real-time dynamic adjustment mechanisms and cannot provide timely feedback on changes in the user's physiological state during sleep, resulting in unstable or unsatisfactory sleep-aid effects.

Method used

A music generation model is constructed, multi-source physiological data of target users are collected, matching music is generated and real-time application evaluation values ​​are judged, music parameters and strategies to be adjusted are determined, and simulation application evaluation is carried out through simulation model to form a closed-loop adjustment mechanism to achieve dynamic and precise music adaptation.

Benefits of technology

It improves the stability and effectiveness of sleep aids, ensures personalized music adaptation at different sleep stages, and enhances users' sleep quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122124368A_ABST
    Figure CN122124368A_ABST
Patent Text Reader

Abstract

This invention relates to the field of music generation and regulation technology, and discloses a method and system for music generation and regulation based on physiological data. The method includes: constructing a music generation model; collecting multi-source physiological data of a target user and inputting it into the music generation model to obtain matching music for the target user; generating a feedback data packet for the target user and generating a real-time application evaluation value for the matching music; determining whether to adjust the matching music based on the real-time application evaluation value; if so, determining several music parameters to be adjusted; generating several regulation strategies based on the several music parameters to be adjusted; performing simulation application evaluation on each regulation strategy; determining the optimal regulation strategy based on the evaluation results; and issuing regulation instructions for the matching music, forming a closed-loop regulation mechanism of "generation-feedback-regulation-refeedback", thereby achieving dynamic and precise adaptation of music during the target user's sleep process and effectively improving the stability and ideality of the sleep aid effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of music generation and regulation technology, and in particular to a method and system for music generation and regulation based on physiological data. Background Technology

[0002] Sleep quality issues are increasingly becoming an important factor affecting people's physical and mental health. Traditional sleep aids, such as taking medication, may lead to dependence and side effects, while simply playing fixed music is difficult to meet the personalized needs of different individuals at different sleep stages.

[0003] While existing technologies include music recommendation research based on physiological data for apps, most of them remain at the level of static matching and lack a real-time dynamic adjustment mechanism for music parameters. This makes it impossible to promptly reflect changes in the user's physiological state during sleep and to make accurate adaptations, resulting in unstable or unsatisfactory sleep-aid effects. Summary of the Invention

[0004] To address the aforementioned technical issues, this application provides a method and system for music generation and adjustment based on physiological data. This method constructs a music generation model and generates matching music for the target user. It collects feedback data packets and generates real-time application evaluation values ​​for the matching music. If adjustment is required, it determines the parameters of the music to be adjusted and several adjustment strategies. A simulation model is used to evaluate the application of each adjustment strategy, determining the optimal adjustment strategy. Real-time feedback of adjustment commands is also provided, forming a closed-loop adjustment mechanism of "generation-feedback-adjustment-refeedback." This achieves dynamic and precise adaptation of music to the target user's sleep process, effectively improving the stability and ideality of the sleep-aiding effect.

[0005] In some embodiments of this application, a method for music generation and adjustment based on physiological data is provided, including: Construct a music generation model; Collect multi-source physiological data of the target user and input it into the music generation model to obtain the matching music for the target user. The matching music includes several music parameters. Generate a feedback data packet for the target user and generate a real-time application evaluation value for the matching music. Based on the real-time application evaluation value, determine whether to adjust the matching music. If so, determine several music parameters to be adjusted. Several adjustment strategies are generated based on several music parameters to be adjusted. Each adjustment strategy is evaluated through simulation application. The optimal adjustment strategy is determined based on the evaluation results, and adjustment instructions matching the music are issued.

[0006] In some embodiments of this application, the music generation model is constructed, including: Collect user parameters and environmental parameters from different users, and set several parameter indicators based on the corresponding impact on sleep. Each parameter includes several preset data ranges; Several user categories are generated based on all parameter indicators, and each user category corresponds to a preset data range set; A corresponding sleep judgment model is constructed based on the historical physiological data of each user category, and the sleep judgment model outputs several sleep stages. Set standard music for each user category at different sleep stages; The standard music includes several standard music parameters; A music generation model is constructed based on the sleep judgment model for each user category and the standard music for different sleep stages.

[0007] In some embodiments of this application, standard music is sequentially set for each user category at different sleep stages, including: Several sleep stages are preset, and each sleep stage is mapped to a preset set of physiological data intervals; Obtain several historical sleep logs for each user category, and label the historical sleep logs according to the preset physiological data set for each sleep stage to obtain several labeled sleep logs for each sleep stage; Extract the historical music, corresponding historical music parameters, and historical feedback data packets for each marked sleep log; Generate a historical application evaluation value for each historical music track based on historical feedback data packets; Based on historical application evaluation values, several historical music tracks for the same sleep stage are sorted, and the historical music track ranked first is set as the standard music track for the corresponding sleep stage. The standard music includes several standard music parameters, and each standard music parameter corresponds to an associated physiological data sequence; The associated physiological data sequence includes several associated physiological data, and each associated physiological data is mapped to a corresponding associated feature.

[0008] In some embodiments of this application, multi-source physiological data of the target user are collected and input into a music generation model to obtain matching music for the target user, including: Collect the actual user parameters and real-time environmental parameters of the target user, and match them with the preset data range set for each user category to determine the target user category to which the target user belongs; The target user's category and multi-source physiological data are input into the music generation model to obtain real-time sleep stages and corresponding matching music.

[0009] In some embodiments of this application, generating a feedback data packet for the target user includes: Generate the predicted micro-awakening risk coefficient and the predicted application risk coefficient for the target user during real-time sleep and under matching music. A predicted risk coefficient is generated based on the predicted micro-awakening risk coefficient and the predicted application risk coefficient, and a feedback time interval is set. Several feedback time nodes are generated based on the feedback time interval; Collect several real-time physiological data of the target user according to the feedback time node, and generate a feedback data packet of the target user, wherein the feedback data packet includes several real-time physiological data sequences.

[0010] In some embodiments of this application, it is determined whether to adjust the matching music based on the real-time application evaluation value. If so, several music parameters to be adjusted are determined, including: Several application evaluation indicators are pre-defined; The feedback data packets are evaluated based on several application evaluation indicators to obtain real-time application evaluation values; Pre-set the preset application evaluation value threshold; When the real-time application evaluation value is less than the preset application evaluation value threshold, it is determined to adjust the matching music, filter out the real-time physiological data that is not in the ideal data range, and determine several music parameters to be adjusted based on the filtered real-time physiological data. When the real-time application evaluation value is not less than the preset application evaluation value threshold, the matching music will not be adjusted.

[0011] In some embodiments of this application, several adjustment strategies are generated based on several music parameters to be adjusted, including: Generate a sequence of music parameters to be adjusted; Each music parameter to be adjusted is set as the target parameter to be adjusted in sequence according to the order of the sequence and the principle of the fewest adjustment parameters, and several combinations of the target parameters to be adjusted are constructed. Generate several combinations of adjustable parameters for each of the music parameters in the sequence of adjustable music parameters in turn; Repeatedly verify all combinations of parameters to be adjusted, and eliminate duplicate combinations of parameters to be adjusted; Generate the corresponding adjustment strategy based on the remaining combination of parameters to be adjusted; Several adjustment strategies are generated sequentially.

[0012] In some embodiments of this application, each regulation strategy is evaluated through simulation application, and the optimal regulation strategy is determined based on the evaluation results, including: Pre-build and adjust the simulation model; Each regulation strategy is sequentially input into the regulation simulation model to simulate the dynamic process of the target user's physiological data changing over time after the strategy is applied to the currently matched music, generating the corresponding simulated physiological data sequence. Calculate the corresponding simulation application evaluation value based on the simulated physiological data sequence; The optimal adjustment strategy is determined based on the simulation application evaluation values.

[0013] In some embodiments of this application, the method further includes: Feedback time point for generating adjustment instructions; The feedback data packets of the adjustment instructions are collected according to the feedback time nodes, and the real-time application evaluation value is calculated a second time. The calculation results are compared and analyzed with the corresponding simulation application evaluation values ​​to obtain the actual effect deviation value of the adjustment strategy. Based on the actual effect deviation value, it is determined whether to make further adjustments.

[0014] In some embodiments of this application, a music generation and modulation system based on physiological data is also included: Build modules are used to construct music generation models; The acquisition module is used to collect multi-source physiological data of the target user and input it into the music generation model to obtain the matching music for the target user. The matching music includes several music parameters. The judgment module is used to generate feedback data packets for the target user and generate real-time application evaluation values ​​for the matching music. Based on the real-time application evaluation values, it determines whether to adjust the matching music. If so, it determines several music parameters to be adjusted. The adjustment module is used to generate several adjustment strategies based on several music parameters to be adjusted, to perform simulation application evaluation on each adjustment strategy, to determine the optimal adjustment strategy based on the evaluation results, and to issue adjustment instructions that match the music.

[0015] The music generation and adjustment method and system based on physiological data according to the embodiments of this application have the following advantages compared with the prior art: By constructing a music generation model and generating matching music for the target user, collecting feedback data packets and generating real-time application evaluation values ​​for the matching music, and determining the music parameters to be adjusted and several adjustment strategies if necessary, the adjustment simulation model is used to simulate and evaluate the application of each adjustment strategy, determine the optimal adjustment strategy, and provide real-time feedback on adjustment commands, forming a closed-loop adjustment mechanism of "generation-feedback-adjustment-refeedback", thereby achieving dynamic and precise adaptation of music to the target user during sleep and effectively improving the stability and ideality of the sleep aid effect. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating a method for music generation and adjustment based on physiological data in an embodiment of this application. Detailed Implementation

[0017] The specific embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.

[0018] In the description of this application, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0019] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0020] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0021] like Figure 1 As shown in the figure, an embodiment of this application provides a method for music generation and adjustment based on physiological data, comprising: S101: Constructing a music generation model; S102: Collect multi-source physiological data of the target user and input it into the music generation model to obtain the matching music for the target user. The matching music includes several music parameters. S103: Generate a feedback data packet for the target user and generate a real-time application evaluation value for the matching music. Based on the real-time application evaluation value, determine whether to adjust the matching music. If so, determine several music parameters to be adjusted. S104: Generate several adjustment strategies based on several music parameters to be adjusted, evaluate each adjustment strategy through simulation application, determine the optimal adjustment strategy based on the evaluation results, and issue adjustment instructions to match the music.

[0022] In this embodiment, the multi-source physiological data includes wearable device data, non-contact device data, and human body pressure data such as mattresses, pillows, and smart chairs. Wearable device data specifically includes data such as electroencephalogram, heart rate, blood oxygen saturation, skin conductance, and body temperature; non-contact device data specifically includes respiratory rate, facial expression, and body movement data collected by non-contact devices.

[0023] In this embodiment, the music generation model is constructed by defining a multi-objective reward function R = w1*R_sleep + w2*R_relax + w3*R_penalty. The multi-objective reward function includes a sleep-promoting reward R_sleep (entering the next sleep stage from the current sleep stage), a deep sleep-inducing reward R_relax (transitioning from the current state to a deep sleep state), and a penalty R_penalty (preventing ineffective or counterproductive stimuli). In this embodiment, w1 is set to 0.6, w2 to 0.3, and w3 to 0.1. The multi-objective reward function guides the training process of the music generation model, enabling the matched music generated by the model to more effectively promote user sleep.

[0024] In this embodiment, the decision logic of the above method can be expressed as the following functional relationship: target matching music = (multi-source physiological data, user category, music generation model), that is: the matching music output by the system (including several music parameters, the music parameters in this application include but are not limited to music type such as binaural beat, starting difference frequency, target difference frequency, volume, tempo, melody complexity and duration, etc.) is the result of the combined effect of current multi-source physiological data, user category and continuously self-optimizing music generation model.

[0025] In some embodiments of this application, the music generation model is constructed, including: Collect user parameters and environmental parameters from different users, and set several parameter indicators based on the corresponding impact on sleep. Each parameter includes several preset data ranges; Several user categories are generated based on all parameter indicators, and each user category corresponds to a preset data range set; A corresponding sleep judgment model is constructed based on the historical physiological data of each user category, and the sleep judgment model outputs several sleep stages. Set standard music for each user category at different sleep stages; The standard music includes several standard music parameters; A music generation model is constructed based on the sleep judgment model for each user category and the standard music for different sleep stages.

[0026] In this embodiment, user parameters include age, disease, music preference, resting-state EEG characteristics (individual-specific alpha peak frequency, slow wave activity intensity), HRV baseline spectrum (typical HRV pattern of an individual during deep relaxation and sleep), and response spectrum (historical records show that when in state S...). x The system determines which music parameters the user responds to best (to fall asleep faster or to sleep more deeply), reflecting the factors that interfere with sleep based on the user's own parameters. Environmental parameters include ambient noise, light intensity, temperature, and humidity, reflecting potential factors that interfere with the user's sleep based on the external environment.

[0027] In this embodiment, the degree of sleep impact is set based on whether there is a significant difference in sleep states corresponding to different data ranges of the same parameter. For example, when the value range of the environmental noise parameter is 30-40 decibels, the user's sleep latency is extended by no more than 10 minutes, while in the 50-60 decibel range, the sleep latency is extended by more than 30 minutes, and the proportion of deep sleep decreases by more than 15%. The degree of sleep impact = sleep latency extension duration × 0.4 + deep sleep proportion decrease × 0.6. By calculating and comparing the degree of sleep impact of different value ranges of the environmental noise parameter, if the difference is greater than a preset threshold, the environmental noise parameter is set as a parameter index, and the decibel ranges with differences greater than the preset threshold are used to generate several preset data ranges of the environmental noise parameter. The preset threshold is a quantitative standard for the parameter to produce significant differences in sleep state, which is 20% in this application.

[0028] In this embodiment, a preset data range for each parameter is randomly selected and combined to obtain a user category. Multiple user categories are generated sequentially. During the selection process, all preset data ranges under each parameter must be covered, and the parameter combinations between different user categories must not overlap. In this way, the complex and diverse basic user parameters and environmental parameters can be systematically classified, laying the foundation for generating personalized music solutions for different user categories in the future.

[0029] In this embodiment, sleep stages include wakefulness, sleep onset, light sleep, deep sleep, and REM sleep. The wakefulness stage refers to the period before the user enters a sleep state; brain activity is active, and physiological indicators such as heart rate and EEG signals are basically consistent with the wakefulness state. The sleep onset stage is the transitional phase from when the user begins to feel sleepy to when they officially enter sleep; heart rate and respiratory rate begin to decrease, alpha waves gradually decrease in EEG signals, and theta waves begin to appear. The light sleep stage is the initial stage of sleep; EEG signals are mainly theta waves, with occasional delta waves. The deep sleep stage is the state of deep sleep; heart rate and blood pressure drop to lower levels, and EEG signals are mainly high-amplitude delta waves. REM sleep is a relatively special stage in the sleep process; at this time, the user's eyes move rapidly, and brain activity is similar to that of the wakefulness stage, showing low-amplitude fast waves; heart rate and respiratory rate also fluctuate irregularly. Accurate segmentation and identification of these sleep stages can provide accurate stage-based criteria for subsequent music generation and adjustment based on the physiological characteristics of different sleep stages.

[0030] In this embodiment, several sleep stages are pre-defined, and each sleep stage is mapped to several preset physiological data intervals. Based on these preset physiological data intervals, the historical physiological data in the historical sleep logs of each user category is analyzed to determine whether there are cases where all historical psychological data in the same historical period falls into the corresponding preset physiological data intervals and there are repeated occurrences. If so, the preset physiological data intervals are used as training input data, and the corresponding sleep stage is used as training output data. If not, the proportion of historical psychological data falling into the preset physiological data intervals in different historical periods is calculated, and the historical psychological data with the highest proportion and the repeated occurrences are selected to correct the preset physiological data intervals of the corresponding user category in the corresponding sleep stage. Based on the corrected preset physiological data intervals as training input data and the corresponding sleep stage as training output data, a training dataset is constructed. The neural network is trained based on the training dataset to obtain a sleep stage recognition model for identifying the user's current sleep stage. During the training process of this neural network, the backpropagation algorithm can be used to continuously adjust the network parameters and optimize the model's recognition accuracy through multiple iterations until the model's recognition error on the validation set reaches a preset threshold or the number of iterations meets the set requirements, thereby ensuring that the sleep stage recognition model can accurately determine the sleep stage based on the user's real-time collected physiological data.

[0031] In this embodiment, by constructing a sleep judgment model, a sleep stage classification standard that matches the pattern of physiological state changes for each user category can be accurately matched, ensuring that the subsequent adjustment of the music program can closely meet the actual physiological needs of users in different sleep stages.

[0032] In this embodiment, the standard music for each user category at different sleep stages refers to the historical music in the sleep log that provided the best sleep effect when entering the next sleep stage.

[0033] In this embodiment, standard music parameters refer to a series of specific parameters inherent to the standard music for each user category at different sleep stages, which can quantify its acoustic and structural characteristics. In this application, these parameters include, but are not limited to, music type (binaural beat), starting frequency difference, target frequency difference, volume, tempo, melody complexity, and duration. Specifically, the starting and target frequencies are set according to the EEG characteristics of different sleep stages. For example, during the sleep onset period, an alpha wave starting frequency of 8-10Hz can be used, gradually transitioning to a theta wave target frequency of 4-7Hz to guide the brain into a sleep state. The initial volume is set at 30-40 dB, gradually decreasing to 20-25 dB as sleep depth increases, ensuring the music's guiding effect while preventing sleep disturbance. The tempo is typically a slow rhythm of 60-80 beats per minute, similar to the heart rate at rest. The melody complexity is primarily simple and repetitive, reducing the cognitive load on the brain. The duration is set based on the average duration of each sleep stage to ensure that the music guidance for the current stage is completed before the user enters the next sleep stage. These standard music parameters together form the basic framework for matching music, providing a clear parameter basis for subsequent dynamic adjustments based on the user's real-time physiological data.

[0034] In this embodiment, the sleep stage output by the sleep judgment model is used as the training input data, and the standard music corresponding to the user category and the corresponding sleep stage is used as the training output data. The neural network is trained to obtain a music generation model, which can accurately characterize the intrinsic music mechanism by which standard music produces a good sleep effect for a specific user category at a specific sleep stage. This provides a quantifiable reference benchmark and target range for subsequent dynamic adjustment of music parameters based on real-time physiological data of users.

[0035] In some embodiments of this application, standard music is sequentially set for each user category at different sleep stages, including: Several sleep stages are preset, and each sleep stage is mapped to a preset set of physiological data intervals; Obtain several historical sleep logs for each user category, and label the historical sleep logs according to the preset physiological data set for each sleep stage to obtain several labeled sleep logs for each sleep stage; Extract the historical music, corresponding historical music parameters, and historical feedback data packets for each marked sleep log; Generate a historical application evaluation value for each historical music track based on historical feedback data packets; Based on historical application evaluation values, several historical music tracks for the same sleep stage are sorted, and the historical music track ranked first is set as the standard music track for the corresponding sleep stage. The standard music includes several standard music parameters, and each standard music parameter corresponds to an associated physiological data sequence; The associated physiological data sequence includes several associated physiological data, and each associated physiological data is mapped to a corresponding associated feature.

[0036] In this embodiment, each historical period of the marked sleep log is used as a time reference line. Collection nodes are set according to preset time intervals. Historical music parameters and historical psychological data are collected according to the collection nodes, and change curves of each historical music parameter and historical psychological data are constructed. Correlation analysis is performed on the change curves of each historical music parameter and all historical psychological data to calculate the correlation coefficient between the two in the time series. If the absolute value of the correlation coefficient is greater than a preset threshold, it is determined that there is a significant correlation between the historical music parameter and the historical psychological data. The historical psychological data is set as the associated psychological data of the corresponding historical music parameter, and the corresponding correlation features are recorded. The correlation features include the correlation coefficient, the trend magnitude of the historical psychological data as the historical music parameter changes, and the change delay time. The associated psychological data are sorted according to the size of the correlation coefficient. The larger the correlation coefficient, the higher the ranking. Specifically, the trend magnitude is determined by calculating the ratio of the difference between the mean of historical psychological data before and after the change in historical music parameters to the change in historical music parameters, in order to quantify the sensitivity of psychological data to adjustments in music parameters; the change lag time is calculated by comparing the time difference between the time point when historical music parameters changed significantly and the time point when historical psychological data showed the corresponding trend reversal, in order to reflect the timeliness of the influence of music parameters on psychological state.

[0037] In this embodiment, the historical feedback data packet includes a sequence of historical physiological data following the historical music for each historical physiological data point.

[0038] In this embodiment, the above method can accurately select standard music for different sleep stages of different user categories, the corresponding standard music parameters and their associated psychological data sequences, providing key data support for the construction of subsequent music generation models and the adjustment of subsequent music parameters.

[0039] In some embodiments of this application, multi-source physiological data of the target user are collected and input into a music generation model to obtain matching music for the target user, including: Collect the actual user parameters and real-time environmental parameters of the target user, and match them with the preset data range set for each user category to determine the target user category to which the target user belongs; The target user's category and multi-source physiological data are input into the music generation model to obtain real-time sleep stages and corresponding matching music.

[0040] In this embodiment, the number of matches between real-time user parameters and real-time environment parameters and preset data intervals of the same dimension in the preset data interval set of each user category (i.e., within the corresponding preset data interval) is determined, and the user category with the most matches is set as the target user category.

[0041] In this embodiment, by inputting the target user category and multi-source physiological data into the music generation model, real-time sleep stages and corresponding matching music are obtained to better meet the sleep needs of the target user in the current environment and help them smoothly transition to a deeper sleep stage.

[0042] In some embodiments of this application, generating a feedback data packet for the target user includes: Generate the predicted micro-awakening risk coefficient and the predicted application risk coefficient for the target user during real-time sleep and under matching music. A predicted risk coefficient is generated based on the predicted micro-awakening risk coefficient and the predicted application risk coefficient, and a feedback time interval is set. Several feedback time nodes are generated based on the feedback time interval; Collect several real-time physiological data of the target user according to the feedback time node, and generate a feedback data packet of the target user, wherein the feedback data packet includes several real-time physiological data sequences.

[0043] In this embodiment, historical sleep logs of the target user's category during real-time sleep and under matched music are filtered out. Historical physiological data sequences and historical micro-awakening events following the matched music are extracted from each filtered historical sleep log. The starting node of each historical physiological data sequence within the corresponding ideal physiological data interval (set according to the preset physiological data interval of the next sleep stage after the real-time sleep stage) is marked, and the corresponding time length is calculated. The time mean is calculated based on the time length and weight coefficient of each historical physiological data point. A predictive application risk coefficient is generated based on the time mean. The frequency of occurrence of historical micro-awakening events is calculated, and a predictive application risk coefficient is generated based on the frequency of occurrence. The predicted micro-awakening risk coefficient is calculated by comparing the time mean with a reference value. The smaller the time mean is compared with the reference value, the smaller the predicted application risk coefficient is; conversely, the larger the time mean is compared with the reference value, the larger the predicted application risk coefficient is. The occurrence frequency is compared with a preset frequency threshold (0.4 in this application). The larger the occurrence frequency is compared with the preset frequency threshold, the larger the predicted micro-awakening risk coefficient is, and vice versa. The values ​​of both the predicted application coefficient and the predicted micro-awakening risk coefficient are in the range of 0-1. In the application embodiment, the weight coefficient of the predicted application risk coefficient is 0.4, and the weight coefficient of the predicted micro-awakening risk coefficient is 0.6. The weights are calculated to obtain the predicted risk coefficient.

[0044] In this embodiment, the higher the predicted risk coefficient, the shorter the feedback time interval, so as to collect feedback data more frequently and capture changes in the user's physiological state in a timely manner; the lower the predicted risk coefficient, the longer the feedback time interval, so as to reduce interference with the user's sleep while ensuring effective feedback. By dynamically adjusting the feedback time interval, the user's sleep state can be accurately monitored while minimizing the risk of sleep interruption caused by data collection, ensuring the continuity of the music adjustment process and the comfort of the user experience.

[0045] In some embodiments of this application, it is determined whether to adjust the matching music based on the real-time application evaluation value. If so, several music parameters to be adjusted are determined, including: Several application evaluation indicators are pre-defined; The feedback data packets are evaluated based on several application evaluation indicators to obtain real-time application evaluation values; Pre-set the preset application evaluation value threshold; When the real-time application evaluation value is less than the preset application evaluation value threshold, it is determined to adjust the matching music, filter out the real-time physiological data that is not in the ideal data range, and determine several music parameters to be adjusted based on the filtered real-time physiological data. When the real-time application evaluation value is not less than the preset application evaluation value threshold, the matching music will not be adjusted.

[0046] In this embodiment, the evaluation indicators include the duration of transition to the next sleep stage, changes and fluctuations in physiological data, the number of micro-awakenings, and the increase in the proportion of deep sleep. Each indicator is mapped to a corresponding reference value. The duration of transition to the next sleep stage is calculated based on the start time of entering the current sleep stage, up to the time interval detected before entering the next sleep stage. The shorter this duration, the higher the efficiency of the currently matched music in promoting the transition to the next sleep stage. The fluctuation range of physiological data is obtained by calculating the standard deviation of the real-time physiological data sequence in the feedback data packet. The smaller the standard deviation, the more stable the physiological state. When the changes in physiological data tend to be close to the reference value (set according to the standard physiological data range of the next sleep stage), and the smaller the standard deviation, the better the stability and effect of the music on physiological regulation. The number of micro-awakenings is monitored in real time by the sleep stage recognition model, and the occurrence of micro-awakening events (such as the brief disappearance of alpha or theta waves in the EEG signal, sudden heart rate changes, etc.) is counted. The total frequency of increases exceeding 10 times / minute and lasting 3-10 seconds; the increase in the proportion of deep sleep is the difference between the proportion of deep sleep duration to total sleep duration during the feedback period and the historical average proportion of deep sleep for this user category in the same sleep stage; the reference values ​​and actual values ​​of the above application evaluation indicators are compared (the closer the actual value is to the reference value, the closer the standardized evaluation value is to 1, and vice versa), and standardized processing is performed to obtain the evaluation value of each application evaluation indicator (the evaluation value ranges from 0 to 1), and then weighted and averaged according to the corresponding weight coefficient (the weight coefficient of each application evaluation indicator is set in advance) to obtain the real-time application evaluation value. The calculation process of the historical application evaluation value is the same as above, and will not be repeated here.

[0047] In this embodiment, the selected real-time physiological data is compared with the associated physiological data sequence of each music parameter to obtain the associated physiological data that matches the selected real-time physiological data in the associated physiological data sequence of each music parameter. The number of matches is calculated, and the real-time impact value of each music parameter is calculated according to the number of matches, the data volume value, and the weight coefficient of the matched selected real-time physiological data. The real-time impact values ​​are sorted from high to low. Based on the sorting results and the requirement of covering all selected real-time physiological data, the last music parameter is determined. The last music parameter and all the music parameters ranked higher are selected as music parameters to be adjusted. This ensures that the selected music parameters to be adjusted can specifically improve the real-time physiological data that is not in the ideal data range. The real-time impact value is the sum of the data volume value and the corresponding weight coefficient of the selected real-time physiological data. The data volume value refers to the absolute value of the data difference that the real-time physiological data is not in the ideal data range. By calculating the real-time impact value of each music parameter in this way, the potential regulatory effect of different music parameters on the current abnormal physiological data can be quantitatively evaluated. Thus, music parameters with high impact values ​​are selected for adjustment first to achieve accurate and efficient music optimization.

[0048] In some embodiments of this application, several adjustment strategies are generated based on several music parameters to be adjusted, including: Generate a sequence of music parameters to be adjusted; Each music parameter to be adjusted is set as the target parameter to be adjusted in sequence according to the order of the sequence and the principle of the fewest adjustment parameters, and several combinations of the target parameters to be adjusted are constructed. Generate several combinations of adjustable parameters for each of the music parameters in the sequence of adjustable music parameters in turn; Repeatedly verify all combinations of parameters to be adjusted, and eliminate duplicate combinations of parameters to be adjusted; Generate the corresponding adjustment strategy based on the remaining combination of parameters to be adjusted; Several adjustment strategies are generated sequentially.

[0049] In this embodiment, the principle of minimum adjustment parameters means that the number of music parameters to be adjusted is minimized while covering all the selected real-time physiological data.

[0050] In this embodiment, the combination of parameters to be adjusted includes several music parameters to be adjusted and the minimum adjustment amount of each music parameter to be adjusted. Each music parameter to be adjusted is mapped to the selected real-time physiological data associated with the corresponding combination. Specifically, when constructing the combination of parameters to be adjusted for the target parameter to be adjusted, firstly, all the selected real-time physiological data that the target parameter to be adjusted can affect are determined. Then, the corresponding parameters of the physiological data not covered by the target parameter to be adjusted are selected from the remaining music parameters to be adjusted until all the selected real-time physiological data are covered, forming a complete combination of parameters to be adjusted.

[0051] In this embodiment, the minimum adjustment amount refers to the minimum adjustment range required for all the selected real-time physiological data affected by the same music parameter to be adjusted to fall within the corresponding ideal data range. Specifically, the music parameter adjustment amount required to bring the real-time physiological data into the ideal range is calculated by combining the trend amplitude and change delay time in the associated physiological data and their associated features matched with the music parameter to be adjusted and the selected real-time physiological data, along with the difference between the real-time physiological data and the ideal data range. The maximum value among the adjustment amounts corresponding to all selected real-time physiological data is taken as the minimum adjustment amount of the music parameter to be adjusted.

[0052] In this embodiment, when performing repeated verification on all combinations of parameters to be adjusted, a dual comparison method of parameter name and corresponding associated physiological data is adopted. If the music parameters to be adjusted contained in two combinations are completely identical, the adjustment amount is also identical, and the real-time physiological data associated with each parameter is also completely identical, then it is determined to be a duplicate combination, and only one of them is retained, so as to avoid repeated calculations and waste of resources in subsequent evaluation of adjustment strategies.

[0053] In this embodiment, generating a regulation strategy based on the combination of parameters to be adjusted refers to setting all music parameters to be adjusted in the combination and the selected real-time physiological data mapped to each music parameter to be adjusted. Several regulation amplitudes and timings for the same music parameter to be adjusted are determined based on the correlation characteristics between each selected real-time physiological data mapped to the same music parameter and the music parameter to be adjusted. These regulation amplitudes and timings are then comprehensively analyzed to determine the final regulation amplitude and regulation start time. Specifically, for the same music parameter to be adjusted, its correlation characteristics with each of the selected real-time physiological data are first obtained, including the correlation coefficient, trend amplitude, and change delay time. The direction of change of the physiological data with the music parameter is determined based on the trend amplitude: if the trend amplitude is positive (i.e., the physiological data increases when the music parameter increases), the music parameter needs to be decreased to cause the physiological data to decrease; if the trend amplitude is negative (i.e., the physiological data decreases when the music parameter increases), the music parameter needs to be increased. Regulation amplitude = (real-time physiological data - median of ideal data interval) × trend amplitude × correlation coefficient, where the median of the ideal data interval is used as the regulation benchmark to ensure that the physiological data after regulation can stably approach the center of the ideal interval. The adjustment start time is set based on the change delay time, with 50% of the change delay time preceding the current feedback time as the adjustment start point. This ensures that the impact of the music parameter adjustment can more accurately affect subsequent physiological data monitoring cycles. For cases where multiple real-time physiological data points are associated with the same music parameter to be adjusted, the adjustment amplitude and start time point corresponding to each associated physiological data point need to be weighted and integrated. The weighting coefficient is the proportion of the correlation coefficient of each associated physiological data point. Finally, a comprehensive adjustment amplitude and a unified adjustment start time point are determined to avoid the cancellation of adjustment effects due to conflicting parameter adjustment directions or time misalignments, ensuring the overall effectiveness of the adjustment strategy.

[0054] In this embodiment, by determining several adjustment strategies, diverse optimization directions can be provided for subsequent music parameter adjustments, so as to select the most suitable adjustment scheme according to the actual application scenario and user needs.

[0055] In some embodiments of this application, each regulation strategy is evaluated through simulation application, and the optimal regulation strategy is determined based on the evaluation results, including: Pre-build and adjust the simulation model; Each regulation strategy is sequentially input into the regulation simulation model to simulate the dynamic process of the target user's physiological data changing over time after the strategy is applied to the currently matched music, generating the corresponding simulated physiological data sequence. Calculate the corresponding simulation application evaluation value based on the simulated physiological data sequence; The optimal adjustment strategy is determined based on the simulation application evaluation values.

[0056] In this embodiment, the priority coefficient of each remaining combination of parameters to be adjusted is calculated. The priority coefficient is generated according to the number of parameters in the combination, the sum of the real-time influence values ​​of the parameters, and the adjustment range of the parameters. The specific calculation method of the priority coefficient is: priority coefficient = (sum of real-time influence values ​​ / number of parameters) × (1 - comprehensive adjustment range / maximum adjustment range threshold), where the maximum adjustment range threshold is the upper limit of the maximum adjustment range allowed for each music parameter in the preset.

[0057] In this embodiment, priority coefficients are sorted from high to low. The adjustment strategy corresponding to the combination of parameters to be adjusted with the highest priority coefficient is selected first and input into the adjustment simulation model for simulation application evaluation. If the simulation application evaluation value of the adjustment strategy reaches the preset application evaluation value threshold, it is directly determined as the optimal adjustment strategy. If it does not reach the threshold, the adjustment strategies with subsequent priority coefficients are selected sequentially for simulation until the adjustment strategy with the highest simulation application evaluation value and that meets the preset application evaluation value threshold is selected as the optimal adjustment strategy. When the simulation application evaluation values ​​of all adjustment strategies do not reach the preset optimization threshold, the adjustment strategy with the highest simulation application evaluation value is selected, and its adjustment range and timing are further corrected based on historical adjustment experience before being determined as the optimal adjustment strategy.

[0058] In this embodiment, historical music and historical adjustment data (including historical parameters to be adjusted, historical adjustment strategies, and changes in physiological data before and after adjustment) under user parameters and environmental parameters of the target user's user category are used as training samples. An LSTM (Long Short-Term Memory) network is selected as the basic network architecture. The adjustment amount, direction, and time of the historical parameters to be adjusted are set as input layer features, and the sequence of physiological data changes after adjustment is used as the output layer label. The model parameters are optimized through backpropagation to understand the nonlinear mapping relationship between music parameter adjustment and physiological data changes, forming an adjustment simulation model. During training, the model uses a sliding time window technique to divide the historical data into sequences. Each window contains parameter changes of 5 consecutive adjustment steps and corresponding physiological data sampling points at 10-second intervals to capture the continuous impact of dynamic music parameter adjustment on physiological state.

[0059] In this embodiment, during the simulation process, the adjustment simulation model first receives the basic parameters of the currently matched music (such as initial volume, rhythm, frequency, etc.) as the initial state. Then, according to the adjustment amplitude and starting time point set in the adjustment strategy, it gradually inputs the changes in each music parameter to be adjusted. Through the state update of internal neurons, it predicts the physiological data change trend of the target user at different time points frame by frame, and finally outputs a complete simulated physiological data sequence. Based on this simulated physiological data sequence, the simulated application evaluation value corresponding to each adjustment strategy is obtained according to the calculation method of real-time application evaluation value.

[0060] In this embodiment, by simulating the application of several regulation strategies, the optimal regulation strategy is determined from among the several regulation strategies to ensure that the strategy can theoretically improve the abnormal physiological data of the target user to the greatest extent and enhance the auxiliary effect of music on sleep.

[0061] In some embodiments of this application, the method further includes: Feedback time point for generating adjustment instructions; The feedback data packets of the adjustment instructions are collected according to the feedback time nodes, and the real-time application evaluation value is calculated a second time. The calculation results are compared and analyzed with the corresponding simulation application evaluation values ​​to obtain the actual effect deviation value of the adjustment strategy. Based on the actual effect deviation value, it is determined whether to make further adjustments.

[0062] In this embodiment, the feedback time node is dynamically set based on the adjustment start time point set in the adjustment strategy, combined with the magnitude of the adjustment and the average response time of physiological data changes. Specifically, when the adjustment magnitude is less than or equal to the preset small adjustment threshold (10% in this embodiment), the feedback time node is set to the average response time of physiological data changes after the adjustment start time point; when the adjustment magnitude is greater than the preset small adjustment threshold and less than or equal to the preset medium adjustment threshold (10% < absolute value of adjustment magnitude ≤ 30%), the feedback time node is set to 1.5 times the average response time of physiological data changes after the adjustment start time point; when the adjustment magnitude is greater than the preset medium adjustment threshold (absolute value of adjustment magnitude > 30%), the feedback time node is set to 2 times the average response time of physiological data changes after the adjustment start time point. The average response time of physiological data changes is obtained through statistical analysis of historical adjustment data.

[0063] In this embodiment, the real-time application evaluation value calculated in the second calculation is the same as that calculated in the first calculation. The actual effect deviation value is obtained by calculating the ratio of the absolute difference between the second real-time application evaluation value and the simulation application evaluation value to the simulation application evaluation value.

[0064] In this embodiment, when the actual effect deviation is less than or equal to a preset deviation threshold (15% in this embodiment), the current adjustment strategy is deemed to meet expectations and no further adjustment is needed. When the actual effect deviation is greater than the preset deviation threshold and the secondary real-time application evaluation value is greater than or equal to the preset application evaluation value threshold, the adjustment strategy is deemed to meet the application requirements despite some deviation, and the current adjustment result is maintained. When the actual effect deviation is greater than the preset deviation threshold and the secondary real-time application evaluation value is less than the preset application evaluation value threshold, the adjustment strategy is deemed to have failed to meet expectations, and a new round of music parameter adjustment process needs to be triggered. At this time, the real-time physiological data in the current feedback data packet is used as a new screening criterion, and the steps of determining the music parameters to be adjusted, generating the adjustment strategy, and performing simulation evaluation are re-executed until the actual effect deviation meets the requirements or the preset maximum number of adjustments is reached. If the requirements are still not met after reaching the maximum number of adjustments, the current music adjustment is stopped, and the adjustment process is restarted with another song with the highest matching degree in the backup music library.

[0065] In this embodiment, by setting feedback time points for secondary evaluation, a closed-loop optimization mechanism of "adjustment-feedback-re-adjustment" can be formed to ensure that the adjustment of music parameters can continuously adapt to the dynamic changes in the physiological state of the target user, thereby further improving the accuracy and effectiveness of music in regulating the body's physiological state.

[0066] In some embodiments of this application, a music generation and modulation system based on physiological data is also included: Build modules are used to construct music generation models; The acquisition module is used to collect multi-source physiological data of the target user and input it into the music generation model to obtain the matching music for the target user. The matching music includes several music parameters. The judgment module is used to generate feedback data packets for the target user and generate real-time application evaluation values ​​for the matching music. Based on the real-time application evaluation values, it determines whether to adjust the matching music. If so, it determines several music parameters to be adjusted. The adjustment module is used to generate several adjustment strategies based on several music parameters to be adjusted, to perform simulation application evaluation on each adjustment strategy, to determine the optimal adjustment strategy based on the evaluation results, and to issue adjustment instructions that match the music.

[0067] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and substitutions can be made without departing from the technical principles of this application, and these improvements and substitutions should also be considered within the scope of protection of this application.

Claims

1. A method for music generation and adjustment based on physiological data, characterized in that, include: Construct a music generation model; Collect multi-source physiological data of the target user and input it into the music generation model to obtain the matching music for the target user. The matching music includes several music parameters. Generate a feedback data packet for the target user and generate a real-time application evaluation value for the matching music. Based on the real-time application evaluation value, determine whether to adjust the matching music. If so, determine several music parameters to be adjusted. Several adjustment strategies are generated based on several music parameters to be adjusted. Each adjustment strategy is evaluated through simulation application. The optimal adjustment strategy is determined based on the evaluation results, and adjustment instructions matching the music are issued.

2. The music generation and adjustment method based on physiological data as described in claim 1, characterized in that, Constructing a music generation model includes: Collect user parameters and environmental parameters from different users, and set several parameter indicators based on the corresponding impact on sleep. Each parameter includes several preset data ranges; Several user categories are generated based on all parameter indicators, and each user category corresponds to a preset data range set; A corresponding sleep judgment model is constructed based on the historical physiological data of each user category, and the sleep judgment model outputs several sleep stages. Set standard music for each user category at different sleep stages; The standard music includes several standard music parameters; A music generation model is constructed based on the sleep judgment model for each user category and the standard music for different sleep stages.

3. The music generation and adjustment method based on physiological data as described in claim 2, characterized in that, Set standard music for each user category at different sleep stages, including: Several sleep stages are preset, and each sleep stage is mapped to a preset set of physiological data intervals; Obtain several historical sleep logs for each user category, and label the historical sleep logs according to the preset physiological data set for each sleep stage to obtain several labeled sleep logs for each sleep stage; Extract the historical music, corresponding historical music parameters, and historical feedback data packets for each marked sleep log; Generate a historical application evaluation value for each historical music track based on historical feedback data packets; Based on historical application evaluation values, several historical music tracks for the same sleep stage are sorted, and the historical music track ranked first is set as the standard music track for the corresponding sleep stage. The standard music includes several standard music parameters, and each standard music parameter corresponds to an associated physiological data sequence; The associated physiological data sequence includes several associated physiological data, and each associated physiological data is mapped to a corresponding associated feature.

4. The music generation and adjustment method based on physiological data as described in claim 2, characterized in that, Multi-source physiological data of the target user is collected and input into the music generation model to obtain matching music for the target user, including: Collect the actual user parameters and real-time environmental parameters of the target user, and match them with the preset data range set for each user category to determine the target user category to which the target user belongs; The target user's category and multi-source physiological data are input into the music generation model to obtain real-time sleep stages and corresponding matching music.

5. The music generation and adjustment method based on physiological data as described in claim 4, characterized in that, Generate a feedback data packet for the target user, including: Generate the predicted micro-awakening risk coefficient and the predicted application risk coefficient for the target user during real-time sleep and under matching music. A predicted risk coefficient is generated based on the predicted micro-awakening risk coefficient and the predicted application risk coefficient, and a feedback time interval is set. Several feedback time nodes are generated based on the feedback time interval; Collect several real-time physiological data of the target user according to the feedback time node, and generate a feedback data packet of the target user, wherein the feedback data packet includes several real-time physiological data sequences.

6. The music generation and adjustment method based on physiological data as described in claim 5, characterized in that, Based on the real-time application evaluation value, determine whether to adjust the matched music. If so, determine several music parameters to be adjusted, including: Several application evaluation indicators are pre-defined; The feedback data packets are evaluated based on several application evaluation indicators to obtain real-time application evaluation values; Pre-set the preset application evaluation value threshold; When the real-time application evaluation value is less than the preset application evaluation value threshold, it is determined to adjust the matching music, filter out the real-time physiological data that is not in the ideal data range, and determine several music parameters to be adjusted based on the filtered real-time physiological data. When the real-time application evaluation value is not less than the preset application evaluation value threshold, the matching music will not be adjusted.

7. The music generation and adjustment method based on physiological data as described in claim 6, characterized in that, Several adjustment strategies are generated based on several music parameters to be adjusted, including: Generate a sequence of music parameters to be adjusted; Each music parameter to be adjusted is set as the target parameter to be adjusted in sequence according to the order of the sequence and the principle of the fewest adjustment parameters, and several combinations of the target parameters to be adjusted are constructed. Generate several combinations of adjustable parameters for each of the music parameters in the sequence of adjustable music parameters in turn; Repeatedly verify all combinations of parameters to be adjusted, and eliminate duplicate combinations of parameters to be adjusted; Generate the corresponding adjustment strategy based on the remaining combination of parameters to be adjusted; Several adjustment strategies are generated sequentially.

8. The music generation and adjustment method based on physiological data as described in claim 7, characterized in that, Each regulation strategy is evaluated through simulation, and the optimal regulation strategy is determined based on the evaluation results, including: Pre-build and adjust the simulation model; Each regulation strategy is sequentially input into the regulation simulation model to simulate the dynamic process of the target user's physiological data changing over time after the strategy is applied to the currently matched music, generating the corresponding simulated physiological data sequence. Calculate the corresponding simulation application evaluation value based on the simulated physiological data sequence; The optimal adjustment strategy is determined based on the simulation application evaluation values.

9. The music generation and adjustment method based on physiological data as described in claim 8, characterized in that, Also includes: Feedback time point for generating adjustment instructions; The feedback data packets of the adjustment instructions are collected according to the feedback time nodes, and the real-time application evaluation value is calculated a second time. The calculation results are compared and analyzed with the corresponding simulation application evaluation values ​​to obtain the actual effect deviation value of the adjustment strategy. Based on the actual effect deviation value, it is determined whether to make further adjustments.

10. A music generation and regulation system based on physiological data, characterized in that, include: Build modules are used to construct music generation models; The acquisition module is used to collect multi-source physiological data of the target user and input it into the music generation model to obtain the matching music for the target user. The matching music includes several music parameters. The judgment module is used to generate feedback data packets for the target user and generate real-time application evaluation values ​​for the matching music. Based on the real-time application evaluation values, it determines whether to adjust the matching music. If so, it determines several music parameters to be adjusted. The adjustment module is used to generate several adjustment strategies based on several music parameters to be adjusted, to perform simulation application evaluation on each adjustment strategy, to determine the optimal adjustment strategy based on the evaluation results, and to issue adjustment instructions that match the music.