Sleep aiding method and device based on brainwave music and computer equipment
By monitoring and analyzing the brain wave information of the target object, personalized brain wave music is generated, which solves the problem of insufficient personalization and accuracy in the existing technology and improves the sleep aid effect.
Patent Information
- Application Number
- CN202510078195.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-23
AI Technical Summary
The existing music sleep aid technology lacks personalization and precision, and fails to effectively use the human brain wave signals during sleep to optimize music design.
By monitoring the brain wave information of the target object, identifying its sleep stages, and extracting brain wave data during the rapid eye movement period, light sleep period or deep sleep period, personalized brain wave music is generated based on these data.
It realizes the generation of matching music based on the brain wave activity of the target object, thereby improving the sleep aid effect and helping the target object quickly enter deep sleep.
Smart Images

Figure CN120022499A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of music aiding sleep, and more specifically, to a method, device and computer equipment for aiding sleep based on brainwave music. Background Art
[0002] Although existing music-aided sleep methods are widely used to improve people's sleep quality, there are still many defects and shortcomings in the specific implementation process, mainly manifested in the lack of personalization and accuracy, as well as the lack of in-depth utilization and optimization of human brain wave characteristics.
[0003] First of all, the method of assisting sleep based on white noise is a relatively common technical means, but such methods usually use highly universal audio signals as sleep-aiding media, and lack music recommendations and personalized adjustment plans for people with different physiques. For example, Chinese medicine theory believes that everyone has different physical characteristics, and different physiques may have different sensitivities to the rhythm, frequency and tone of music. However, the existing technology fails to accurately classify and recommend based on physical characteristics, resulting in a single choice of sleep-aiding music, lack of specificity, and failure to maximize the regulatory effect of music on individuals. Especially under the theory that the five internal organs of "heart, liver, spleen, lung and kidney" in traditional Chinese medicine correspond to the five tones of "gong, shang, jue, zhi and yu" in Chinese classical music, personalized music recommendations for different physiques are particularly important, and this deficiency also directly limits the efficacy of existing sleep-aiding technologies.
[0004] Secondly, existing music-aided sleep methods generally ignore the characteristics of brain wave signals in different states of the human body and their important role in optimizing sleep-aiding music programs. Studies have shown that brain wave signals during sleep (such as Delta waves and Theta waves) can reflect the depth and quality of human sleep, and there is a certain correlation between these signals and the frequency and rhythm of music. Existing technologies fail to detect and analyze brain wave signals of the human body in deep sleep in real time, and are unable to optimize the design of sleep-aiding music based on brain wave characteristics. This defect is mainly due to the limitations of existing technology designs, which do not fully consider the dynamic changes in the human body's state during sleep and the value of brain wave signals in music adjustment.
[0005] In summary, the existing music-aided sleep technology has the following significant defects: first, there is a lack of personalized music recommendations for different population groups, and the adaptability of human physique and music types is ignored; second, the brain wave signals generated during sleep are not effectively used to conduct secondary analysis and optimization of the music program. Summary of the invention
[0006] In view of the deficiencies in the prior art, the purpose of the present invention is to provide a sleep-aiding method, device, medium and computer equipment based on brainwave music, so as to overcome the shortcomings of the existing music-aiding sleep scheme that cannot utilize the brainwave signals generated during sleep to perform secondary analysis and optimization of the music scheme.
[0007] The above technical objectives of the present invention are achieved through the following technical solutions: A sleep aid method based on brainwave music, comprising: Monitoring brain wave information of a target object; and identifying the sleep stage of the target object according to the brain wave information of the target object; When the sleep stage of the target object is in the rapid eye movement stage, the light sleep stage, or the deep sleep stage, extracting the brain wave data of the target object; generating brainwave music based on the brainwave data of the target object in the rapid eye movement period; Play the brainwave music.
[0008] In one embodiment, the monitoring of the target object's brain wave data specifically includes: repeatedly detecting the target object's brain wave time domain signals within the past five minutes in steps of one minute.
[0009] In one embodiment, the generating of brainwave music based on the brainwave data of the target object in the rapid eye movement period specifically includes: in the brainwave time domain signal, when the sum of the relative powers of beta waves and theta waves is greater than the sum of the relative powers of alpha waves and delta waves, and the relative power of alpha waves is lower than a predetermined threshold, generating brainwave music based on the last brainwave time domain signal.
[0010] In one embodiment, generating brainwave music based on brainwave data of the target object in rapid eye movement stage further includes: generating brainwave music based on the last brainwave time domain signal when the target object's eyes move rapidly.
[0011] In one embodiment, the generation of brainwave music based on the final brainwave time domain signal specifically includes: identifying zero crossing points in the brainwave time domain signal, and dividing the brainwave data into a number of segment waves based on each zero crossing point; mapping the several segment waves into sub-notes one by one to generate a sub-note sequence; inputting the sub-note sequence into a segmentation point recognition model to identify whether the endpoints between any two sub-notes are segmentation points; according to the recognition result of the segmentation point recognition model, merging the sub-notes in the sub-note sequence to obtain a note sequence; and generating corresponding brainwave music based on the note sequence.
[0012] In one embodiment, mapping the plurality of segment waves into sub-notes in a one-to-one correspondence specifically includes: mapping the power of the segment wave into the sound intensity of the sub-note; mapping the frequency of the segment wave into the pitch of the sub-note; and mapping the duration of the segment wave into the duration of the sub-note.
[0013] In one embodiment, the playing of the brainwave music specifically includes: playing the brainwave music when the target object is in a rapid eye movement period.
[0014] In one embodiment, identifying the sleep stage of the target object according to the brain wave data of the target object specifically includes: Converting the brainwave time domain signal into a brainwave frequency domain signal; Calculate the corresponding power spectrum density according to the brain wave frequency domain signal; Based on the power spectrum density and the frequency bands corresponding to the waveforms, calculate the relative power corresponding to the waveforms; The sleep stage of the target subject is determined based on the relative power of each waveform.
[0015] In one embodiment, the calculating the relative power corresponding to each waveform based on the power spectrum density and the frequency band corresponding to each waveform specifically includes: Based on the frequency bands corresponding to each waveform, the brain wave frequency domain signal is divided into beta wave, alpha wave, theta wave, and delta wave; wherein the frequency of the delta wave is 0.5Hz~4Hz; the frequency of the theta wave is 4Hz~8Hz; the frequency of the alpha wave is 8Hz~13Hz; the frequency of the beta wave is 13Hz~30Hz; Based on the power spectrum density and the frequency bands corresponding to the respective waveforms, the relative powers of the beta wave, the alpha wave, the theta wave and the delta wave are calculated respectively.
[0016] In one embodiment, determining the sleep stage of the target object based on the relative power of each waveform specifically includes: When the sum of the relative powers of the beta wave and the theta wave is greater than the sum of the relative powers of the alpha wave and the delta wave, and the relative power of the alpha wave is lower than a predetermined threshold, it is determined that the sleep stage of the target object is in the rapid eye movement stage.
[0017] In one embodiment, determining the sleep stage of the target object based on the relative power of each waveform specifically includes: When the relative power of the theta wave is greater than the relative power of any other waveform and the relative power of the theta wave is greater than 40%, it is determined that the sleep stage of the target object is in the light sleep stage.
[0018] In one embodiment, determining the sleep stage of the target object based on the relative power of each waveform specifically includes: When the relative power of the delta wave is greater than 50% and the relative power of the theta wave is less than 20%, it is determined that the sleep stage of the target object is in the deep sleep stage.
[0019] A sleep aid device based on brainwave music, comprising: an identification unit, configured to monitor brain wave data of a target object; and identify the sleep stage of the target object according to the brain wave data of the target object; An extraction unit, configured to extract brain wave data of the target object when the sleep stage of the target object is in the rapid eye movement stage, the light sleep stage, or the deep sleep stage; A generating unit, configured to generate brainwave music based on brainwave data of the target object during rapid eye movement; The playing unit is used for playing the brainwave music.
[0020] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.
[0021] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0022] In summary, the present invention has the following beneficial effects: a sleep-aiding method, device and computer based on brainwave music, the sleep-aiding method comprising: monitoring brainwave information of a target object; identifying the sleep stage of the target object according to the brainwave information of the target object; extracting brainwave data of the target object when the sleep stage of the target object is in the rapid eye movement period, the light sleep period or the deep sleep period; generating brainwave music based on the brainwave data of the target object in the rapid eye movement period; adopting the method of the present invention can help the target object to quickly enter deep sleep under the action of sleep-aiding music, and can further generate sleep-aiding music according to the brainwave data of the target object, so that the sleep-aiding music matches the brainwave activity of the target object to improve the sleep-aiding effect of the music. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flow chart of a sleep-aiding method based on brainwave music of the present invention; Figure 2 is a structural diagram of a sleep aid device based on brainwave music in an embodiment of the present invention; Figure 3 is an internal structure diagram of a computer device in an embodiment of the present invention; Figure 4 Schematic diagram of brain wave data collected in an embodiment of the present invention; Figure 5 A schematic diagram of a sub-note sequence and a note sequence in an embodiment of the present invention; In the figure: 1. Recognition unit; 2. Extraction unit; 3. Generation unit; 4. Playback unit. DETAILED DESCRIPTION
[0024] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. Several embodiments of the present invention are shown in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein.
[0025] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. The terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0026] In the present invention, unless otherwise clearly specified and limited, the first feature being "above" or "below" the second feature may include the first and second features being in direct contact, or may include the first and second features being in contact not directly but through another feature between them. Moreover, the first feature being "above", "above" and "above" the second feature includes the first feature being directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. The first feature being "below", "below" and "below" the second feature includes the first feature being directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature. The terms "vertical", "horizontal", "left", "right", "above", "below" and similar expressions are for illustrative purposes only, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0027] The present invention is described in detail below in conjunction with the accompanying drawings and embodiments.
[0028] Embodiment 1 In order to solve the above problems, the present invention provides a sleep aid method based on brainwave music, such as Figure 1 As shown, including: S1. Monitoring brain wave information of a target object; and identifying the sleep stage of the target object according to the brain wave information of the target object; S2. When the sleep stage of the target object is in the rapid eye movement stage, the light sleep stage or the deep sleep stage, extracting the brain wave data of the target object; S3, generating brainwave music based on the brainwave data of the target object in the rapid eye movement period; S4. Play the brainwave music.
[0029] In actual applications, in order to play the corresponding sleep-aiding music according to the state of the target object, it is first necessary to distinguish the deficiency and excess of the target object; if the deficiency and excess judgment result of the target object is a deficiency syndrome, select Yang-type music to generate music sleep-aiding information; if the deficiency and excess judgment result of the target object is an excess syndrome, select Yin-type music to generate music sleep-aiding information; if the deficiency and excess judgment result of the target object is normal, select peaceful music to generate music sleep-aiding information; if the deficiency and excess judgment result of the target object is a mixed deficiency and excess syndrome, select Yang-type or Yin-type music to generate music sleep-aiding information. Based on the theory of deficiency and excess identification in traditional Chinese medicine, combined with the physical characteristics of the target object (such as deficiency syndrome, excess syndrome, cold and heat properties), select suitable music for playback. This method makes up for the lack of personalized adjustment in traditional music sleep-aiding programs, making music more targeted and adaptive; the music matches the physical constitution of the target object, which helps to provide a synergistic sleep-aiding effect at the psychological and physiological levels.
[0030] While playing music to help the target object fall asleep, the brain wave data of the target object is detected at the same time to determine the sleep stage of the target object. The sleep stages specifically include: light sleep, deep sleep or rapid eye movement, each of which has different EEG activity characteristics, body reactions and physiological functions. Light sleep is the transition stage from wakefulness to sleep, usually lasting for a short time, accounting for about 50% of the sleep cycle. Deep sleep is the deepest stage in the sleep cycle. This stage is the key period for restorative sleep and usually occupies 15-20% of the entire sleep cycle. The rapid eye movement period accounts for about 20-25% of the sleep cycle, usually appears in the second half of each sleep cycle, and increases with the extension of each cycle. Since the sleep cycle is repeated in three cycles of light sleep, deep sleep and rapid eye movement, brain wave signals are collected when people begin to fall asleep, that is, when they are in light sleep, which can ensure that brain wave data is collected comprehensively and completely.
[0031] By analyzing the brain wave data, it is possible to identify whether the user is in the REM period. If so, the brain wave data of the REM period is collected. Since brain wave data is also a kind of wave energy, the notes used to play music are also a kind of wave energy. Therefore, the brain wave data can be converted into music data based on the predetermined conversion rules. When the target object is in the process of sleeping, the original sleep-aiding music is replaced with the newly generated music, which can make the sleep-aiding music more matched with the brain wave activity of the target object. The REM period is the stage when the brain processes and consolidates memory. By collecting the brain wave data of the REM period and generating personalized music, the memory integration effect can be enhanced through brain wave resonance, helping the target object to improve cognitive function while improving sleep quality. Moreover, the REM period is the main stage of dreaming. Music affects the content of dreams through the rhythm of brain waves, making the target object's dreams more positive and comfortable, and indirectly improving mental health. The brain wave characteristics of each individual are different. By collecting the actual brain waves of the target object during the REM period to generate music, real personalized adjustments can be achieved and the intervention effect can be enhanced.
[0032] To sum up, this application proposes a sleep-aiding method based on brainwave music. Based on the virtual and real syndrome differentiation results of the target object, the corresponding sleep-aiding music is played to guide the target user into a sleep state, and then the brainwave data of the target user during the rapid eye movement period is collected to generate sleep-aiding music to further assist the target object in sleeping. This method can effectively improve the sleep state of the target user and enhance the sleep-aiding effect of music on the target object.
[0033] In one embodiment, the monitoring of the target object's brain wave data specifically includes: repeatedly detecting the target object's brain wave time domain signals within the past five minutes in steps of one minute.
[0034] In practical applications, since people's sleep cycles are between 60 minutes and 120 minutes, the relationship between computing resources and detection accuracy can be balanced by selecting an appropriate brain wave data detection cycle. In this application, repeated detection in steps of one minute helps to accumulate sufficient data in a shorter period of time, thereby accurately evaluating the target object's brain wave changes within a five-minute time window. This method can capture small changes in the sleep cycle more finely and avoid information loss due to sparse data collection; for the identification of sleep stages, a five-minute time window is sufficient to capture the target object's brain wave fluctuations, while avoiding the distortion that may be caused by too long time intervals. Real-time acquisition of brain wave time domain signals over the past five minutes helps to dynamically adjust music or other sleep-aiding interventions.
[0035] In this embodiment, the detection of brain wave data is continuous. Since the brain wave data needs to convert data within a period of time into frequency domain data and then calculate the energy or power, the brain wave data needs to be calculated once every one minute, and the object of calculation is the brain wave data collected in the last five minutes. By calculating the brain wave data in the last five minutes, the current sleep state of people can be determined.
[0036] In one embodiment, the generating of brainwave music based on the brainwave data of the target object in the rapid eye movement period specifically includes: in the brainwave time domain signal, when the sum of the relative powers of beta waves and theta waves is greater than the sum of the relative powers of alpha waves and delta waves, and the relative power of alpha waves is lower than a predetermined threshold, generating brainwave music based on the last brainwave time domain signal.
[0037] In actual applications, the light sleep stage is a critical stage of transition from wakefulness to deep sleep. The brain waves of the target object undergo significant changes during this stage, including: high-frequency waveforms such as beta waves and alpha waves when awake gradually disappear, and low-frequency theta waves dominate. At the same time, the target user will also experience a series of other changes in physical state, such as a slower heart rate, more even breathing, and decreased muscle tension. Among them, the dominance of theta waves means that the relative power of theta waves is greater than the relative energy of the other three waveforms, and the relative proportion of theta waves in the total brain wave energy exceeds 40%, which means that the target object is considered to be in a light sleep stage.
[0038] The main brain wave characteristics of deep sleep are that low-frequency, high-amplitude Delta waves dominate, accompanied by a significant reduction in other frequency bands. When the relative power of Delta waves is 50% or higher, the target object can be considered to be in deep sleep.
[0039] The main brain wave characteristics of the REM period are low-amplitude high-frequency waves as the dominant waves. The main characteristics are: Beta waves and Theta waves are dominant, and Alpha waves are less or not obvious; and unlike the deep sleep period, the REM stage lacks obvious Delta waves. Among them, if the sum of the relative power of Beta waves and Theta waves is significantly higher than other frequency bands (such as Delta waves and Alpha waves), they can be considered to be dominant. If the power of Alpha waves is less than 10%, it can be considered to be less or not obvious.
[0040] In one embodiment, generating brainwave music based on brainwave data of the target object in rapid eye movement stage further includes: generating brainwave music based on the last brainwave time domain signal when the target object's eyes move rapidly.
[0041] During the REM sleep stage, brain activity is extremely active, especially in areas related to visual processing, emotional regulation, and memory integration. The activity of these areas prompts the eye muscles to produce rapid, random movements, similar to the reaction of the eyes when the target object is tracking or looking at external objects while awake. Therefore, the rapid movement of the eyeballs indicates that the target object is in the REM sleep stage. Based on the movement state of the eyeballs, it is possible to accurately determine whether the target object is in the REM stage, generate brainwave music based on the collected brainwave data of the target object, and play the brainwave music to affect the target object's sleep state, which can effectively improve the sleep-inducing effect of brainwave music.
[0042] In one embodiment, the generation of brainwave music based on the final brainwave time domain signal specifically includes: identifying zero crossing points in the brainwave time domain signal, and dividing the brainwave data into a number of segment waves based on each zero crossing point; mapping the several segment waves into sub-notes one by one to generate a sub-note sequence; inputting the sub-note sequence into a segmentation point recognition model to identify whether the endpoints between any two sub-notes are segmentation points; according to the recognition result of the segmentation point recognition model, merging the sub-notes in the sub-note sequence to obtain a note sequence; and generating corresponding brainwave music based on the note sequence.
[0043] In practical applications, the brain wave time domain signal detected by the signal detection device is Figure 4 As shown, by performing zero-point detection on brain wave data and identifying the zero-point position in the brain wave data, continuous brain wave data can be divided into several segment waves; and then each segment wave is converted into a corresponding sub-note.
[0044] In one embodiment, mapping the plurality of segment waves into sub-notes in a one-to-one correspondence specifically includes: mapping the power of the segment wave into the sound intensity of the sub-note; mapping the frequency of the segment wave into the pitch of the sub-note; and mapping the duration of the segment wave into the duration of the sub-note.
[0045] Specifically, a segment wave is a wave signal with wave characteristics, including amplitude, period and average power, and the sound produced by each note is also a wave signal, which is expressed in pitch, duration and intensity.
[0046] When using MIDI music files to store audio, MIDI music files use squares to represent each note, such as Figure 5As shown in the figure, the horizontal length of the square represents the length of the note, the height of the square represents the intensity of the note, and the color of the square represents the pitch of the note. The sub-note sequence generated after the segment wave is converted into the corresponding sub-note has a low musicality and poor listening experience. Therefore, after directly converting the segment wave into the sub-note, it is necessary to merge the sub-note into the note according to the predetermined fusion rule. Figure 5 As shown, the first row of MIDI parameters represents the sub-notes generated by directly converting the fragment wave. It is necessary to determine whether the endpoints between the two sub-notes are the split points. If they are split points, it means that the two notes need to be merged with each other to generate a new note, so that the audio file can be more musical.
[0047] The specific split point judgment rules can be identified by training a deep learning model. The MIDI file is input into the pre-trained split point recognition model to identify the split point. If the endpoint between two sub-notes is a split point, the lengths of the two sub-notes are added together, and the pitch and intensity of the two sub-notes are merged according to the predetermined rules. If the endpoint between the two sub-notes is not a split point, it means that the two sub-notes cannot be merged.
[0048] The training process of the split point recognition model can be implemented by following the steps below: Obtain music data with musical sense that meets the quantity requirement, and randomly segment the original notes in the music data, wherein the segmentation rule is as follows: the length of the notes after segmentation meets the following conditions: ; Indicates The length of the original note, Indicates The original note The original note is divided into The pitch and intensity of the divided sub-notes can be allocated or adjusted according to a predetermined rule.
[0049] According to the segmentation process, the two ends of each sub-note are marked, where the two ends of the sub-note overlap with the original note and are recorded as non-segmentation points, and the two ends of the sub-note do not overlap with the original note and are recorded as segmentation points, that is, these endpoints are obtained by segmentation and do not exist in the original audio file. After marking, a training set for training the model is generated, and the segmentation point recognition model is trained using the training set to obtain the segmentation point recognition model.
[0050] After using the syncopation point recognition model to identify the syncopation points in the sub-note sequence, the sub-notes on both sides of the syncopation point can be intelligently fused to generate brainwave music with a stronger sense of musicality. The fused music is not only more coordinated in pitch, rhythm and melody, but also highly matches the brainwave signal characteristics of the target object, improving the personalized sleep-aiding effect. Especially when the target object is in the rapid eye movement period, playing music generated based on the rapid eye movement brainwave signal can not only resonate with the target's brainwave activity, but may also further affect the target object's dream content and emotional regulation, and have a profound positive effect on overall sleep quality and mental health.
[0051] In one embodiment, the playing of the brainwave music specifically includes: playing the brainwave music when the target object is in a rapid eye movement period.
[0052] Specifically, the rapid eye movement period is an important stage for emotion processing and memory consolidation. The brain will screen and process external information. Playing music during the rapid eye movement period can affect the process of information processing, and thus have a profound impact on people's sleep state. The frequency of music may resonate with the frequency band of brain waves, thereby slowing down the heart rate, lowering blood pressure, and helping to enter a deeper state of relaxation.
[0053] In one embodiment, identifying the sleep stage of the target object according to the brain wave data of the target object specifically includes: Converting the brainwave time domain signal into a brainwave frequency domain signal; Calculate the corresponding power spectrum density according to the brain wave frequency domain signal; Based on the power spectrum density and the frequency bands corresponding to the waveforms, calculate the relative power corresponding to the waveforms; The sleep stage of the target subject is determined based on the relative power of each waveform.
[0054] In practical applications, since brain wave data changes with time, the collected brain wave data is time domain data. In order to count the proportion of brain wave energy in different frequency ranges, the brain wave data must first be converted to the frequency domain. Specifically, Fourier transform (FFT) or wavelet transform can be used to convert the EEG signal to the frequency domain to obtain the power spectrum density of different frequency ranges. .
[0055] According to the frequency range, the power of different frequency bands is integrated to calculate its power:
[0056] in, Indicates the power of a certain frequency band; Indicates the lower frequency limit of the frequency band; Indicates the upper frequency limit of the frequency band; Indicates the acquisition time of the EEG data.
[0057] For example, for a Delta wave with a frequency of 0.5Hz - 4Hz, the power calculated within five minutes is:
[0058] For another example, for the Theta wave with a frequency of 4Hz - 8Hz, the power calculated within five minutes is:
[0059] Based on the proportion of the power of each waveform in the total waveform power, the sleep cycle of the current target object can be determined.
[0060] In one embodiment, the calculating the relative power corresponding to each waveform based on the power spectrum density and the frequency band corresponding to each waveform specifically includes: Based on the frequency bands corresponding to each waveform, the brain wave frequency domain signal is divided into beta wave, alpha wave, theta wave, and delta wave; wherein the frequency of the delta wave is 0.5Hz~4Hz; the frequency of the theta wave is 4Hz~8Hz; the frequency of the alpha wave is 8Hz~13Hz; the frequency of the beta wave is 13Hz~30Hz; Based on the power spectrum density and the frequency bands corresponding to the respective waveforms, the relative powers of the beta wave, the alpha wave, the theta wave and the delta wave are calculated respectively.
[0061] In one embodiment, judging the sleep stage of the target object based on the relative power of each waveform specifically includes: when the sum of the relative powers of the beta wave and the theta wave is greater than the sum of the relative powers of the alpha wave and the delta wave, and the relative power of the alpha wave is lower than a predetermined threshold, judging that the sleep stage of the target object is in the rapid eye movement stage.
[0062] In one embodiment, judging the sleep stage of the target object based on the relative power of each waveform specifically includes: when the relative power of the theta wave is greater than the relative power of any other waveform, and the relative power of the theta wave is greater than 40%, judging that the sleep stage of the target object is in light sleep.
[0063] In one embodiment, judging the sleep stage of the target object based on the relative power of each waveform specifically includes: when the relative power of the delta wave is greater than 50% and the relative power of the theta wave is less than 20%, judging that the sleep stage of the target object is in deep sleep.
[0064] In actual applications, the light sleep stage is a critical stage of transition from wakefulness to deep sleep. The brain waves of the target object undergo significant changes during this stage, including: high-frequency waveforms such as beta waves and alpha waves when awake gradually disappear, and low-frequency theta waves dominate. At the same time, the target user will also experience a series of other changes in physical state, such as a slower heart rate, more even breathing, and decreased muscle tension. Among them, the dominance of theta waves means that the relative power of theta waves is greater than the relative energy of the other three waveforms, and the relative proportion of theta waves in the total brain wave energy exceeds 40%, which means that the target object is considered to be in a light sleep stage.
[0065] The main brain wave characteristics of deep sleep are that low-frequency, high-amplitude Delta waves dominate, accompanied by a significant reduction in other frequency bands. When the relative power of Delta waves is 50% or higher, the target object can be considered to be in deep sleep.
[0066] Embodiment 2 See also Figure 2 , a sleep aid device based on brainwave music, the sleep aid device based on brainwave music comprising: Identification unit 1, used to monitor brain wave data of a target object; and identify the sleep stage of the target object according to the brain wave data of the target object; Extraction unit 2, used for extracting brain wave data of the target object when the sleep stage of the target object is in the rapid eye movement stage, the light sleep stage or the deep sleep stage; A generating unit 3, for generating brainwave music based on the brainwave data of the target object during rapid eye movement; The playing unit 4 is used for playing the brainwave music.
[0067] For the specific definition of the sleep aid device based on brainwave music, please refer to the definition of the sleep aid method based on brainwave music above, which will not be repeated here. Each module in the above-mentioned sleep aid device based on brainwave music can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0068] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the present application scheme, and does not constitute a limitation of the present application scheme. The specific sleep aid device based on brainwave music may include more or less components than those shown in the figure, or combine certain components, or have a different component arrangement. Embodiment 3 A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the sleep-aiding method based on brainwave music as described in Example 1.
[0069] Embodiment 4 In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, a sleep aid method based on brainwave music is implemented.
[0070] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0071] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: a method for aiding sleep based on brainwave music, including: Monitoring brain wave information of a target object; and identifying the sleep stage of the target object according to the brain wave information of the target object; When the sleep stage of the target object is in the rapid eye movement stage, the light sleep stage, or the deep sleep stage, extracting the brain wave data of the target object; generating brainwave music based on the brainwave data of the target object in the rapid eye movement period; Play the brainwave music.
[0072] In one embodiment, the monitoring of the target object's brain wave data specifically includes: repeatedly detecting the target object's brain wave time domain signals within the past five minutes in steps of one minute.
[0073] In one embodiment, the generating of brainwave music based on the brainwave data of the target object in the rapid eye movement period specifically includes: in the brainwave time domain signal, when the sum of the relative powers of beta waves and theta waves is greater than the sum of the relative powers of alpha waves and delta waves, and the relative power of alpha waves is lower than a predetermined threshold, generating brainwave music based on the last brainwave time domain signal.
[0074] In one embodiment, generating brainwave music based on brainwave data of the target object in rapid eye movement stage further includes: generating brainwave music based on the last brainwave time domain signal when the target object's eyes move rapidly.
[0075] In one embodiment, the generation of brainwave music based on the final brainwave time domain signal specifically includes: identifying zero crossing points in the brainwave time domain signal, and dividing the brainwave data into a number of segment waves based on each zero crossing point; mapping the several segment waves into sub-notes one by one to generate a sub-note sequence; inputting the sub-note sequence into a segmentation point recognition model to identify whether the endpoints between any two sub-notes are segmentation points; according to the recognition result of the segmentation point recognition model, merging the sub-notes in the sub-note sequence to obtain a note sequence; and generating corresponding brainwave music based on the note sequence.
[0076] In one embodiment, mapping the plurality of segment waves into sub-notes in a one-to-one correspondence specifically includes: mapping the power of the segment wave into the sound intensity of the sub-note; mapping the frequency of the segment wave into the pitch of the sub-note; and mapping the duration of the segment wave into the duration of the sub-note.
[0077] In one embodiment, the playing of the brainwave music specifically includes: playing the brainwave music when the target object is in a rapid eye movement period.
[0078] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0079] Embodiment 5 In this embodiment, a brain wave signal collection process is also provided, which specifically includes the following steps: In the brain wave signal collection process, the electrode is first accurately placed at a specific position on the scalp to ensure that the signal collection has good sensitivity and accuracy. In order to reduce the impedance between the electrode and the scalp, the electrode contact area needs to be cleaned and treated with conductive glue to ensure the signal conduction quality. Subsequently, the weak EEG signal collected by the electrode is transmitted to a high-sensitivity amplifier for signal amplification, and the original microvolt-level signal is enhanced to a level range suitable for processing.
[0080] The amplified analog signal is transmitted to the analog-to-digital converter (ADC) and converted into a digital signal for subsequent high-precision digital processing by a computer. During the analysis process, the digital signal undergoes a series of preprocessing steps to improve the data quality. First, the signal is filtered to remove noise and interference. The filtering process includes low-pass filtering (for eliminating high-frequency interference), high-pass filtering (removing low-frequency drift), and band-pass filtering (extracting signals within the target frequency range, such as the brain wave frequency band of 0.5 Hz to 50 Hz).
[0081] The pre-processed digital signal is input into the data processing module for further analysis and feature extraction. This design ensures that the collected brain wave signals are clear and reliable, providing a solid data foundation for subsequent sleep state analysis, brain wave music generation and other applications.
[0082] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0083] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A sleep aid method based on brainwave music, characterized in that: include: Monitor the target object's brain wave information; identifying the sleep stage of the target object according to the brain wave information of the target object; When the sleep stage of the target object is in the rapid eye movement stage, the light sleep stage, or the deep sleep stage, extracting the brain wave data of the target object; generating brainwave music based on the brainwave data of the target object in the rapid eye movement period; Play the brainwave music.
2. A method for aiding sleep based on brainwave music according to claim 1, characterized in that: The brain wave data of the monitoring target object specifically includes: The brain wave time domain signals of the target object in the past five minutes are repeatedly detected with a step length of one minute.
3. A sleep aid method based on brainwave music according to claim 2, characterized in that: The generating of brainwave music based on the brainwave data of the target object in the rapid eye movement period specifically includes: In the brainwave time domain signal, when the sum of the relative powers of beta wave and theta wave is greater than the sum of the relative powers of alpha wave and delta wave, and the relative power of alpha wave is lower than a predetermined threshold, brainwave music is generated based on the last brainwave time domain signal.
4. A method for aiding sleep based on brainwave music according to claim 2, characterized in that: The generating of brainwave music based on the brainwave data of the target object in the rapid eye movement period also includes: In case of rapid eye movement of the target object, brainwave music is generated based on the final brainwave time domain signal.
5. A method for aiding sleep based on brainwave music according to claim 3 or 4, characterized in that: The generating of brainwave music based on the final brainwave time domain signal specifically includes: Identifying zero crossing points in the brain wave time domain signal, and dividing the brain wave data into a plurality of segment waves based on each zero crossing point; Mapping the plurality of segment waves into sub-notes in a one-to-one correspondence to generate a sub-note sequence; Inputting the sub-note sequence into a segmentation point recognition model to identify whether the endpoints between any two sub-notes are segmentation points; According to the recognition result of the segmentation point recognition model, the sub-notes in the sub-note sequence are merged to obtain a note sequence; Generate corresponding brainwave music based on the note sequence.
6. The method for aiding sleep based on brainwave music according to claim 5, characterized in that: The one-to-one mapping of the plurality of segment waves into sub-notes specifically includes: The power of the segment wave is mapped to the sound intensity of the sub-note; the frequency of the segment wave is mapped to the pitch of the sub-note; and the duration of the segment wave is mapped to the duration of the sub-note.
7. The method for aiding sleep based on brainwave music according to claim 1, characterized in that: The playing of the brainwave music specifically includes: playing the brainwave music when the target object is in the rapid eye movement stage.
8. A sleep aid device based on brainwave music, characterized in that: The sleep aid device based on brainwave music comprises: an identification unit, configured to monitor brain wave data of a target object; and identify the sleep stage of the target object according to the brain wave data of the target object; An extraction unit, configured to extract brain wave data of the target object when the sleep stage of the target object is in the rapid eye movement stage, the light sleep stage, or the deep sleep stage; A generating unit, configured to generate brainwave music based on brainwave data of the target object during rapid eye movement; The playing unit is used for playing the brainwave music.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the sleep-aiding method based on brainwave music as described in any one of claims 1 to 7 is implemented.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the brainwave music-based sleep-aiding method as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Multi-sign data monitoring and early warning method and system
CN121867709A
A method and system for monitoring and early warning of multiple vital signs data
CN121867709B