Music generation method and device, computer equipment and storage medium

By obtaining and analyzing the user's sleep data, adaptively adjusting the music parameters, and generating music that matches the user's sleep habits and status, the problem of poor music generation in the existing technology is solved, and personalized sleep-aided music generation and Real-time adjustments significantly improve sleep aid.

CN119185728AActive Publication Date: 2024-12-27TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411227827.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-27
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

The existing sleep-aided music customization technology cannot meet users' more refined needs, and the generated music cannot accurately fit the user's sleep habits and current sleep state, resulting in poor music generation effect.

Method used

By obtaining the target user's history and current sleep data, generating and adjusting music production parameters, such as music structure information, note density, white noise mixing ratio and music speed, adaptively generate music that matches the user's sleep habits and states, and adjusting them in real time Music playback parameters to improve sleep aid.

Benefits of technology

It realizes personalized and diverse music generation, which can accurately assist users to fall asleep and maintain sleep, and improves the generation effect of sleep-aided music.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119185728A_ABST
    Figure CN119185728A_ABST
Patent Text Reader

Abstract

The invention relates to a music generation method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring historical sleep data and original music of a target user, wherein the historical sleep data is used for reflecting sleep habits of the target user; according to the historical sleep data, generating at least one music making parameter for the target user; adjusting the original music according to the at least one music making parameter to obtain target music matched with the sleep habit of the target user; in the process that the target music is played along with the current sleep process of the target user, music playing parameters of the target music are adjusted according to the current sleep data of the target user to obtain adjusted music playing parameters, and playing of the target music is controlled through the adjusted music playing parameters. By adopting the method, the music generation effect can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of music generation, and in particular to a music generation method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] With the improvement of material living standards, sleep-aiding music has gradually become the focus of people's attention in daily life. As a functional music, sleep-aiding music is different from traditional music. It mainly appears as auxiliary music, which can help users relax and fall asleep.

[0003] Currently, users can customize the required sleep-aiding music according to their own needs in music applications. However, the existing sleep-aiding music customization methods are usually generated by superimposing music and white noise, and most sleep-aiding music customization technologies only provide interfaces for music playback time and music playback scenes. Although they can provide users with the function of customized sleep-aiding music, they cannot meet users' more sophisticated customization needs. The generated sleep-aiding music cannot provide users with accurate sleep assistance because it cannot meet users' real needs.

[0004] Therefore, there is a problem of poor music generation effect in traditional technology. Summary of the invention

[0005] Based on this, it is necessary to provide a music generation method, device, computer equipment, computer-readable storage medium and computer program product that can improve the music generation effect in response to the above technical problems.

[0006] A music generation method, the method comprising:

[0007] Obtain the target user's historical sleep data and original music, where the historical sleep data is used to reflect the target user's sleeping habits;

[0008] Generate at least one music production parameter for the target user based on the historical sleep data; wherein the music production parameter includes at least one of music structure information, note density, white noise mixing ratio, and music speed;

[0009] Adjusting the original music according to at least one music production parameter to obtain target music that matches the sleep habits of the target user;

[0010] During the process of playing the target music following the current sleep process of the target user, the music playing parameters of the target music are adjusted according to the current sleep data of the target user to obtain the adjusted music playing parameters, wherein the music playing parameters include at least one of note density, low-pass filter cutoff frequency, and music speed; and the playing of the target music is controlled using the adjusted music playing parameters.

[0011] In an exemplary embodiment, the historical sleep data includes the sleeping time, which represents the time required for the target user to enter the core sleep stage from the awake stage of the sleep cycle. At least one music production parameter for the target user is generated according to the historical sleep data, including:

[0012] Obtaining music structure information of the original music; wherein the music structure information includes the number of unit music bars of the prelude music segment, the number of unit music bars corresponding to the main music segment, and the number of unit music bars of the coda music segment;

[0013] The number of unit musical phrases of the prelude of the original music is determined as the number of unit musical phrases of the prelude of the target music, the number of unit musical phrases of the coda of the original music is determined as the number of unit musical phrases of the coda of the target music, and the number of unit musical phrases corresponding to the main music section of the original music is adjusted according to the sleep onset time to obtain the number of unit musical phrases of the main music section of the target music;

[0014] Among them, the number of unit musical phrases of the prelude music section of the target music, the number of unit musical phrases of the main music section, and the number of unit musical phrases of the outro music section of the target music are used to represent the music structure information of the target music.

[0015] In an exemplary embodiment, the number of unit music sections corresponding to the main music section of the original music is adjusted according to the sleeping time to obtain the number of unit music sections of the main music section of the target music, including:

[0016] Determine the music duration of the prelude music section in the original music and the music duration of the coda music section in the original music; and subtract the music duration of the prelude music section and the music duration of the coda music section from the sleep onset time to obtain the music duration of the main music section of the target music;

[0017] The number of unit music sections of the main music section of the target music is determined according to the music duration of the main music section of the target music and the preset unit music section duration.

[0018] In an exemplary embodiment, the historical sleep data includes the deep sleep ratio in the sleep cycle of the target user; and generating at least one music production parameter for the target user according to the historical sleep data includes:

[0019] Based on a preset mapping relationship between the deep sleep ratio and the note start density, the deep sleep ratio in the sleep cycle of the target user is mapped to the note density of the target music.

[0020] In an exemplary embodiment, the historical sleep data includes the proportion of rapid eye movement time in the sleep cycle of the target user; and generating at least one music production parameter for the target user according to the historical sleep data includes:

[0021] Based on a preset mapping relationship between the rapid eye movement time ratio and the white noise mixing ratio, the rapid eye movement time ratio in the sleep cycle of the target user is mapped to the white noise mixing ratio of the target music.

[0022] In an exemplary embodiment, the historical sleep data includes a heart rate signal and a breathing rate signal of the target user during a historical sleeping process, where the historical sleeping process is from the wakefulness stage to the core sleep stage of the sleep cycle of the target user;

[0023] At least one music production parameter for a target user is generated according to the historical sleep data, including:

[0024] Determine music speed adjustment information according to the target user's heart rate signal and breathing rate signal during the historical sleeping process, where the music speed adjustment information includes adjustment amplitude and adjustment direction;

[0025] The music speed of the original music is adjusted based on the music speed adjustment information to obtain the music speed of the target music.

[0026] In an exemplary embodiment, the current sleep data includes the current playing time of the target music; adjusting the music playing parameters of the target music according to the current sleep data of the target user to obtain the adjusted playing parameters includes:

[0027] Obtaining a curve of the relationship between the density of the musical notes and the time at which the music is played, wherein the curve of the relationship between the density of the musical notes and the time at which the music is played is a decreasing function curve;

[0028] The current playing time of the target music and the note density of the target music are substituted into the change relationship curve to obtain the adjusted note density of the target music.

[0029] In an exemplary embodiment, the current sleep data includes the current playing time of the target music; adjusting the music playing parameters of the target music according to the current sleep data of the target user to obtain the adjusted music playing parameters includes:

[0030] Obtaining a change relationship curve between the cutoff frequency of the low-pass filter and the music playing time, wherein the change relationship curve is a decreasing function curve;

[0031] The current playing time of the target music and the low-pass filter cutoff frequency of the target music are substituted into the change relationship curve to obtain the adjusted low-pass filter cutoff frequency of the target music.

[0032] In an exemplary embodiment, the current sleep data includes the current playing time of the target music, the heart rate signal and the breathing rate signal of the target user at the current playing time; adjusting the music playing parameters of the target music according to the current sleep data of the target user to obtain the adjusted playing parameters includes:

[0033] Determine music speed adjustment information according to the heart rate signal and breathing rate signal of the target user at the current playing moment, the music speed adjustment information including adjustment amplitude and adjustment direction;

[0034] The music speed of the target music is adjusted based on the music speed adjustment information to obtain the adjusted music speed of the target music.

[0035] A computer device includes 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.

[0036] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.

[0037] A computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0038] The above-mentioned music generation method, apparatus, computer device, storage medium and computer program product obtain the historical sleep data and original music of the target user, and the historical sleep data is used to reflect the sleep habits of the target user; at least one music production parameter for the target user is generated according to the historical sleep data; the original music is adjusted according to the at least one music production parameter to obtain the target music that matches the sleep habits of the target user; in the process of playing the target music following the current sleep process of the target user, the music playback parameters of the target music are adjusted according to the current sleep data of the target user to obtain the adjusted music playback parameters; in this way, each music production parameter can be controlled in combination with the historical sleep data of the target user, and a large amount of diversified and personalized music can be created compared to the limited types of music created artificially, so that before the music is played, the target music with a music playback effect that matches the sleep habits of the target user is adaptively generated. Furthermore, after the target music is adaptively generated according to the historical sleep data of the user, the music playback parameters of the target music can be adjusted in real time based on the current sleep data of the target user in the current sleep process, so that after the music is played, the target music is adaptively adjusted to music with a music playback effect that matches the current sleep state of the target user, and the music generation effect of the sleep-aiding music can be accurately and efficiently improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] FIG1 is a diagram of an application environment of a music generation method in one embodiment;

[0041] Figure 2 A schematic diagram of a process of a music generation method in an embodiment;

[0042] Figure 3 A schematic diagram of a data interaction control technology framework for a music production parameter in a generation process in one embodiment;

[0043] Figure 4 A schematic diagram of an overall framework for music generation in one embodiment;

[0044] Figure 5 A schematic diagram of the processing logic of a sleeping time control module in one embodiment;

[0045] Figure 6 A schematic diagram of a sleep time control music structure generated in one embodiment;

[0046] Figure 7 A schematic diagram of a sleeping structure in one embodiment;

[0047] Figure 8 A schematic diagram of processing logic of a sleep structure processing module in one embodiment;

[0048] Fig. 9 is a processing logic diagram of a human rhythm processing module in one embodiment;

[0049] Fig.10 A schematic diagram of processing logic of an automation control module in one embodiment;

[0050] Fig.11 is a schematic flow chart of a music generation method in another embodiment;

[0051] Fig.12 is a structural block diagram of a music generating device in one embodiment;

[0052] FIG. 13 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] The music generation method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1. The terminal 102 obtains the historical sleep data and original music of the target user, and the historical sleep data is used to reflect the sleep habits of the target user; the terminal 102 generates at least one music production parameter for the target user according to the historical sleep data, wherein the music production parameter includes at least one of music structure information, note density, white noise mixing ratio, and music speed; the terminal 102 adjusts the original music according to at least one music production parameter to obtain the target music that matches the sleep habits of the target user; in the process of playing the target music following the current sleep process of the target user, the terminal 102 adjusts the music playback parameters of the target music according to the current sleep data of the target user to obtain the adjusted music playback parameters, wherein the music playback parameters include at least one of note density, low-pass filter cutoff frequency, and music speed; and uses the adjusted music playback parameters to control the playback of the target music. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc.

[0055] In an exemplary embodiment, Figure 2 As shown, a music generation method is provided, which is described by taking the method applied to the terminal 102 in FIG. 1 as an example, and includes the following steps 202 to 206. Among them:

[0056] Step 202: Acquire historical sleep data and original music of the target user, where the historical sleep data is used to reflect the sleep habits of the target user.

[0057] Among them, the target user may be a user who has a demand for customized music generation. Among them, the historical sleep data is used to reflect the user's historical sleep habits. Therefore, the historical sleep data is obtained by collecting various data of the target user during multiple historical sleep processes and performing a comprehensive analysis of the various data. One way for the terminal to obtain historical sleep data may be to collect various data of the target user during multiple historical sleep processes and obtain the data through a comprehensive analysis; or another way to obtain the data is to obtain it from the target user's wearable device, or another way to obtain the data is to obtain the historical sleep data input by the user. Among them, the original music may be sleep-aid music whose music production parameters have not been adjusted.

[0058] Step 204: Generate at least one music production parameter for the target user based on the historical sleep data.

[0059] The music production parameters can be used to generate target music with a music playback effect that matches the sleep habits of the target user. The music production parameters refer to parameters used to control music generation. For example, the music production parameters may include music structure information, music duration, sound effects, playback speed, white noise mixing ratio, note density, and other parameters.

[0060] Step 206: adjust the original music according to at least one music production parameter to obtain target music that matches the sleep habits of the target user.

[0061] The target music may be played when the target user is falling asleep, and the target music refers to the music that is customized by the target user according to his / her own music customization needs.

[0062] Step 208, while the target music is being played following the current sleep process of the target user, the music playing parameters of the target music are adjusted according to the current sleep data of the target user to obtain adjusted music playing parameters; and the playing of the target music is controlled using the adjusted music playing parameters.

[0063] The current sleep data is used to reflect the current sleep state of the user, so the current sleep data is real-time collection of various data of the target user during the current sleep process. The music playback parameters refer to parameters used to control music playback, for example, the music playback parameters may include note density, low-pass filter cutoff frequency, music speed and other parameters.

[0064] In the above-mentioned music generation method, by obtaining the historical sleep data and original music of the target user, the historical sleep data is used to reflect the sleep habits of the target user; at least one music production parameter for the target user is generated according to the historical sleep data; the original music is adjusted according to the at least one music production parameter to obtain the target music that matches the sleep habits of the target user; in the process of playing the target music following the current sleep process of the target user, the music playback parameters of the target music are adjusted according to the current sleep data of the target user to obtain the adjusted music playback parameters; in this way, the historical sleep data of the target user can be combined to control each music production parameter, and a large amount of diversified and personalized music can be created compared to the limited types of music created artificially, so that before the music is played, the target music with a music playback effect that matches the sleep habits of the target user is adaptively generated. Furthermore, after the target music is adaptively generated according to the historical sleep data of the user, the music playback parameters of the target music can be adjusted in real time based on the current sleep data of the target user in the current sleep process, so that after the music is played, the target music is adaptively adjusted to music with a music playback effect that matches the current sleep state of the target user, and the music generation effect of the sleep-aiding music can be accurately and efficiently improved.

[0065] Figure 3 An exemplary data interactive control technology framework for sleep-aiding music is provided, wherein the historical sleep data (e.g., including the time of falling asleep, the proportion of deep sleep, the proportion of rapid eye movement time, the historical heart rate, the historical breathing frequency) and the current sleep data (e.g., including the current heart rate, the current breathing frequency, and the music playing time) of the target user are input into the sleep-aiding music generation model (e.g., including four modules: the sleep-on time control module, the human body rhythm control module, the sleep structure control module, and the automation control module), respectively, and the music production parameters for the target user can be generated according to the historical sleep data to generate the sleep-aiding music (target music) for the target user, and the music playing parameters of the sleep-aiding music can be adjusted during the playing process of the sleep-aiding music according to the current sleep data. This solution can adaptively generate sleep-aiding music according to the sleep structure information, human body rhythm information, etc. of the target user, not only ensuring the diversity of the generated sleep-aiding music, but also combining the principles of sleep science in the music generation logic, so that the generated sleep-aiding music is more in line with the user's sleep habits, thereby better assisting sleep, and the generation of music production parameters of multiple modules ensures that the generated target music can be adjusted in real time according to user needs, thereby improving the user experience. The generation logic of the music production parameters in each module of the sleep-aiding music generation model will be described in detail in the following embodiments.

[0066] In an exemplary embodiment, the historical sleep data includes the time of falling asleep, which represents the time required for the target user to go from the awake stage to the core sleep stage of the sleep cycle; based on the historical sleep data, at least one music production parameter for the target user is generated, including: obtaining the music structure information of the original music; wherein the music structure information includes the number of unit bars of the prelude segment, the number of unit bars corresponding to the main segment, and the number of unit bars of the outro; determining the number of unit bars of the prelude segment of the original music as the number of unit bars of the prelude segment of the target music, determining the number of unit bars of the outro segment of the original music as the number of unit bars of the outro segment of the target music, and adjusting the number of unit bars corresponding to the main segment of the original music according to the time of falling asleep to obtain the number of unit bars of the main segment of the target music; wherein the number of unit bars of the prelude segment of the target music, the number of unit bars of the main segment of the target music, and the number of unit bars of the outro segment of the target music are used to represent the music structure information of the target music.

[0067] Among them, the music structure information may refer to the composition structure of the music. In practical applications, the music structure information may refer to the length of the intro (Intro), main body (Main bodies) and outro (Outro) that make up the music, as well as the number of unit sections corresponding to the intro, main body and outro. The music segment can be expressed as a phase, the unit section can be expressed as a section, and the number of unit sections may refer to the number of unit sections that make up a music segment phase. The duration of each unit section is the same (can be a preset duration), so the duration of each music segment is determined by the number of unit sections contained.

[0068] In practical applications, the number of unit music sections of different music sections can be adjusted to adjust the music duration of different music sections, thereby adjusting the music duration of the entire music. In one embodiment, since the music duration of the prelude music section of the target music is the same as that of the original music, and the music duration of the coda music section of the target music is the same as that of the original music, the number of unit music sections of the main music section of the target music can be used to control the duration of the target music.

[0069] In this embodiment, by obtaining the music structure information of the original music, the number of unit music bars of the prelude section, the number of unit music bars corresponding to the main section, and the number of unit music bars of the coda section of the original music are determined, and then the number of unit music bars corresponding to the prelude section and the coda section of the original music are kept unchanged, and the number of unit music bars of the main section of the original music is only adjusted according to the sleep time to obtain the number of unit music bars of the main section of the target music, and the adjusted number of unit music bars of the main section is used to adjust the music duration of the main section of the target music, and the music structure information of the number of unit music bars of the main section of the target music is used as a music production parameter to control the music duration of the generated target music. It can be seen that this embodiment can combine the target user's sleep process and the music structure information of the original music to adaptively generate the music structure of the target music, and assist in the subsequent generation of the target music.

[0070] In an exemplary embodiment, the number of unit music sections corresponding to the main music section of the original music is adjusted according to the time of falling asleep to obtain the number of unit music sections of the main music section of the target music, including: determining the music duration of the prelude section in the original music and the music duration of the outro section in the original music; and subtracting the music duration of the prelude section and the music duration of the outro section from the time of falling asleep to obtain the music duration of the main music section of the target music; and determining the number of unit music sections of the main music section of the target music according to the music duration of the main music section of the target music and a preset unit music section duration.

[0071] In actual applications, the number of unit phrases of the prelude is multiplied by the preset unit phrase duration of the prelude to obtain the music duration of the prelude in the original music; the number of unit phrases of the coda is multiplied by the preset unit phrase duration of the coda to obtain the music duration of the coda in the original music; the music duration of the prelude and the music duration of the coda in the original music are subtracted from the sleep time, and the remaining duration is determined as the music duration of the main segment in the target music; the music duration of the main segment of the target music is divided by the preset unit phrase duration of the main segment to obtain the music production parameter of the number of unit phrases of the main segment of the target music.

[0072] In order to facilitate the understanding of those skilled in the art, Figure 4 A schematic diagram of the overall framework of music generation is provided, wherein the entire piece of music includes an intro (Intro), a main body (Main body) and an outro (Outro), wherein each segment includes several phases, and each phase includes several sections.

[0073] In practical applications, a mapping relationship can be established between the sleep-aiding music cycle and the sleep time, so the music loop processing logic can be established (such as Figure 5 ), that is, through the music loop processing logic (corresponding to the sleeping time control module), based on the sleeping time and the structure information of the original music, the structure information of the sleep-aiding music is adaptively generated, thereby assisting in the generation of sleep-aiding music, Figure 6 A schematic diagram of generating a sleep time control music structure is provided as an example. Figure 6 It shows two target musics generated when the target user sets the music playing time to be 20 minutes in total. The music durations of the two target musics are 15 minutes and 5 minutes respectively. The intro sections in the two target musics are both one section and the outro sections are both two sections. By comparing the two target musics, it can be seen that the intro sections and outro sections in the target musics are both fixed lengths, and the music duration of the target musics is only related to the number of unit sections of the main section. Since the intro section Intro and the outro section Outro have strong functionality, and the intro section Intro and the outro section Outro have only one section Phase (a section Phase may include multiple sections), in the target music, the intro section Intro and the outro section Outro are usually set to fixed length by default. In other words, for different sleep durations, only the length of the main body section Main body will change. Assuming that the duration of a section (the duration of a unit section) is Section_duration, and the falling asleep time is LoopTime, the number of sections in the main body of the Main body is calculated as follows: main_body.section_num= (LoopTime-(Intro.section_num+Outros.section_num)*Section_duration) / Section_duration; where main_body.section_num is the number of sections in the Mainbody part of the main body, LoopTime is the falling asleep time (falling asleep time), Intro.section_num is the number of sections in the Intro part of the prelude, and Outros.section_num is the number of sections in the Outro part of the outro.

[0074] In this embodiment, the music duration of the prelude and outro in the original music is used as the music duration of the prelude and outro in the target music, and the music duration of the prelude and outro is subtracted from the sleep time to obtain the music duration of the main section of the target music, and then the music duration of the main section of the target music is divided by the number of unit music sections. The number of unit music sections of the main section in the target music can be accurately determined and used as a music production parameter, which is conducive to accurately controlling the music duration of the target music.

[0075] To facilitate the understanding of those skilled in the art, Figure 7 A sleep cycle diagram is exemplarily provided, wherein the sleep cycle includes four stages: wakefulness, deep sleep, core sleep (i.e., light sleep), and rapid eye movement (REM) sleep. In the embodiment of the present application, the deep sleep ratio and the REM time ratio are selected to generate music production parameters. The deep sleep ratio is the ratio of deep sleep time to total sleep time, and the REM time ratio is the ratio of REM time to total sleep time. In actual applications, the wakefulness ratio and the core sleep ratio can also be used as the basis for generating music production parameters. The wakefulness ratio is the ratio of wakefulness time to total sleep time in the sleep cycle, and the core sleep ratio is the ratio of light sleep time to total sleep time in the sleep cycle. Figure 8 As shown, the embodiment of the present application determines the note density and the white noise ratio based on the deep sleep ratio (DSleepRatio) and the rapid eye movement time ratio (DreamRatio) respectively through the sleep structure processing module. The embodiment of the present application selects two sleep data information, namely the deep sleep ratio (DSleepRatio) and the rapid eye movement time ratio (DreamRatio). When the deep sleep ratio is too low or the rapid eye movement time ratio is too high, it can be said that the user's sleep quality is poor, so some parameters related to the generation of music will be adjusted accordingly. Regarding the process of generating music production parameters based on the deep sleep ratio (DSleepRatio) and the rapid eye movement time ratio (DreamRatio), please refer to the following two embodiments.

[0076] In an exemplary embodiment, the historical sleep data includes the deep sleep ratio in the sleep cycle of the target user; based on the historical sleep data, at least one music production parameter for the target user is generated, including: based on a preset mapping relationship between the deep sleep ratio and the note density, the deep sleep ratio in the sleep cycle of the target user is mapped to the note density of the target music. The note density is used to characterize the density of the notes of the target music. The note density in the embodiment of the present application can be called the note starting density, that is, the note density used to generate the target music, and can also be understood as the note density included in the music production parameters.

[0077] Among them, the preset mapping relationship between the deep sleep ratio and the note density can represent the mapping relationship of the numerical association between the deep sleep ratio and the note density, and the deep sleep ratio can be the ratio of deep sleep to sleep duration.

[0078] In one embodiment, the preset mapping relationship between the deep sleep ratio and the note density can be expressed as: DensityStart = k1* DSleepRatio+b; where k1> 0, serving as a proportional coefficient to control the preset mapping relationship between the deep sleep ratio and the note density, DensityStart is the note density, and DSleepRatio is the deep sleep ratio.

[0079] In actual applications, if the proportion of deep sleep is too low, then the "density" of the music needs to be reduced, that is, the generated music notes are not so dense and the sound field is not too full. Therefore, the performance of the target music is controlled by controlling the note density (DensityStart). For example, the calculation formula for the note density of the target music is: DensityStart = k1*DSleepRatio+b; where k1 > 0, as a proportional coefficient to control the mapping relationship, the calculation formula represents a positive relationship between the deep sleep ratio and the note density. The specific calculation formula depends on the actual situation. When the deep sleep ratio is lower, the note density is lower. If DensityStart exceeds the standard range, the indicator is considered invalid and adjusted to the default value.

[0080] This embodiment obtains the note density corresponding to the target user based on the preset mapping relationship between the deep sleep ratio and the note density, and then generates the target music for the target user using the note density. The preset mapping relationship is a positive relationship. It can be understood that if the deep sleep ratio of the target user is too low, music with less dense music notes can be generated, so that the generated target music sound field is not too full, thereby generating target music with a music playback effect that is more compatible with the sleep quality of the target user.

[0081] In order to provide a better sleep-aiding effect, in the process of playing the target music following the current sleeping process of the target user, the note density of the target music can be adaptively adjusted as the playing time changes. The specific method can be found in the next embodiment.

[0082] In an exemplary embodiment, the current sleep data includes the current playback time of the target music; adjusting the music playback parameters of the target music according to the current sleep data of the target user to obtain the adjusted playback parameters, including: obtaining a change relationship curve between the note density and the music playback time, wherein the change relationship curve is a decreasing function curve; substituting the current playback time of the target music and the note density of the target music into the change relationship curve to obtain the adjusted note density of the target music.

[0083] The current playing time may refer to any time when the target music is being played.

[0084] In practical applications, the note density of the target music should gradually decrease as sleep deepens. Therefore, one way to adjust the note density of the target music may be to use a decreasing function (corresponding to the changing relationship curve between the note density and the music playing time) to adjust the note density of the target music. In a specific implementation, the corresponding relationship between the adjusted note density and the note density before adjustment is: Density = DensityStart * e^(-k4t); wherein Density is the adjusted note density, DensityStart is the music density of the target music (obtained from the deep sleep ratio), k4 is the control parameter of the curve, and t is the music playing time. It can be understood that Density = DensityStart * e^(-k4t) is a decreasing function, and as the music playing time increases, the adjusted note density Density is lower.

[0085] In this embodiment, as the playing time increases, the note density will become lower and lower to adapt to the user's sleeping process.

[0086] In an exemplary embodiment, the historical sleep data includes the proportion of rapid eye movement time in the sleep cycle of the target user; based on the historical sleep data, at least one music production parameter is generated for the target user, including: based on a preset mapping relationship between the rapid eye movement time and the white noise mixing ratio, mapping the rapid eye movement time ratio in the sleep cycle of the target user to the white noise mixing ratio of the target music.

[0087] The preset mapping relationship between the rapid eye movement time ratio and the white noise mixing ratio represents the mapping relationship of the numerical correlation between the rapid eye movement time ratio and the white noise mixing ratio.

[0088] The white noise mixing ratio may be the ratio of white noise (natural soundscape) in the target music.

[0089] In one embodiment, the preset mapping relationship between the rapid eye movement time ratio and the white noise mixing ratio can be expressed as: NoiseRatio = DreamRatio * k2 + b; wherein k2> 0, serving as a proportional coefficient to control the second mapping relationship, NoiseRatio is the white noise mixing ratio, DreamRatio is the rapid eye movement time ratio, and the calculation formula represents a positive relationship between the rapid eye movement time ratio and the white noise mixing ratio. The specific calculation formula depends on the actual situation. When the rapid eye movement time ratio is higher, the white noise mixing ratio is higher.

[0090] In actual applications, if the rapid eye movement ratio is high, it means that the user dreams a lot, which will affect the sleep quality to a certain extent. Therefore, the ratio of the target music and white noise will be controlled at the final mixing end. The parameter for controlling the white noise mixing ratio is NoiseRatio, which corresponds to the mixing ratio of white noise (natural soundscape). For example, the calculation method of the white noise mixing ratio of the target music is: NoiseRatio = DreamRatio * k2+ b, where k2> 0, which is used as the proportional coefficient to control the mapping relationship. If NoiseRatio exceeds the standard range, the indicator is considered invalid and adjusted to the default value.

[0091] This embodiment obtains the white noise mixing ratio corresponding to the target user based on the preset mapping relationship between the rapid eye movement time and the white noise mixing ratio, and then generates the target music for the target user using the white noise mixing ratio. The preset mapping relationship is a positive relationship. It can be understood that if the target user has a high proportion of rapid eye movement time and dreams more, the proportion of white noise in the target music can be increased, so that the generated target music sound stream is more stable and peaceful, thereby generating target music with a music playback effect that is more compatible with the target user's sleep quality.

[0092] In an exemplary embodiment, the historical sleep data includes the heart rate signal and breathing rate signal of the target user during the historical sleeping process, and the historical sleeping process is the target user's sleep cycle from the awake stage to the core sleep stage; based on the historical sleep data, at least one music production parameter for the target user is generated, including: determining music speed adjustment information based on the heart rate signal and breathing rate signal of the target user during the historical sleeping process, the music speed adjustment information including the adjustment amplitude and adjustment direction; adjusting the music speed of the original music based on the music speed adjustment information to obtain the music speed of the target music.

[0093] The heart rate signal may be the heart rate curve data of the user during the historical falling asleep process. The respiratory rate signal may be the respiratory rate curve data of the user during the historical falling asleep process. The falling asleep process refers to the period from the beginning of sleep to the entering of the core sleep period (light sleep period). The music speed adjustment information may refer to the adjustment amplitude and adjustment direction of the original music speed.

[0094] like Fig. 9 As shown, a new playing speed can be generated based on the heart rate, breathing frequency and playing speed by the human body rhythm processing module. The processing logic of this module can be applied to two situations, namely, it is applicable to generating the music speed in the music production parameters (i.e., generating the music speed of the target music) and it is also applicable to adjusting the music speed of the target music.

[0095] In the first case, that is, in the process of generating the music speed in the music production parameters, the heart rate and breathing rate are the heart rate and breathing rate in the historical sleeping process, and the playback speed is the playback speed of the original music, then the new playback speed obtained is the playback speed included in the music production parameters. Specifically, human body rhythms include heart rate (HeartRate) and breathing rate (BreathFreq). In the control logic of the rhythm processing module, both heart rate and breathing rate can control the music speed of the generated target music. In layman's terms, when the heart rate and breathing rate decrease, people also need more soothing music to assist sleep, so the bpm of the music should decrease accordingly. The playback speed is calculated as follows: relative_bpm = BreathFreq - DefaultBreathFreq + HeartRate - DefaultHeartRate, new_bpm = bpm + relative_bpm; relative_bpm is the music speed adjustment information, BreathFreq is the breathing frequency, DefaultBreathFreq is the default breathing frequency, HeartRate is the heart rate, DefaultHeartRate is the default heart rate, new_bpm is the music speed of the target music, and bpm is the music speed of the original music.

[0096] In the second case, that is, during the process of adjusting the music speed of the target music, the heart rate and breathing frequency are the heart rate and breathing frequency during the current falling asleep process, and the playing speed is the playing speed of the target music, then the new playing speed obtained is the adjusted playing speed of the target music. See the next embodiment for details.

[0097] In an exemplary embodiment, the current sleep data includes the current playback time of the target music, the heart rate signal and the breathing rate signal of the target user at the current playback time; the music playback parameters of the target music are adjusted according to the current sleep data of the target user to obtain the adjusted playback parameters, including: determining the music speed adjustment information according to the heart rate signal and the breathing rate signal of the target user at the current playback time, the music speed adjustment information including the adjustment amplitude and the adjustment direction; adjusting the music speed of the target music based on the music speed adjustment information to obtain the adjusted music speed of the target music.

[0098] In the previous embodiment, the music speed adjustment information is determined based on the heart rate signal and breathing rate signal of the target user during the historical sleeping process, and the music speed of the original music is adjusted using the music speed adjustment information to obtain the music production parameter of the target music, thereby realizing the adaptive determination of the music speed of the target music to be generated according to the body rhythm of the target user, which is conducive to obtaining more soothing target music and helping the target user to sleep more accurately.

[0099] Based on the previous embodiment, this embodiment determines the music speed adjustment information at the current playing moment according to the heart rate signal and breathing rate signal of the target user during the current sleeping process, and uses the music speed adjustment information at the current playing moment to adjust the music speed of the target music, and uses the adjusted music speed as the music speed of the target music at the current playing moment, thereby being able to adaptively adjust the music speed of the target music at the current playing moment according to the current body rhythm of the target user in real time, and being able to accurately assist the target user's sleep in real time.

[0100] In an exemplary embodiment, the current sleep data includes the current playback time of the target music; the music playback parameters of the target music are adjusted according to the current sleep data of the target user to obtain the adjusted music playback parameters, including: obtaining a change relationship curve between the low-pass filter cutoff frequency and the music playback time, wherein the change relationship curve is a decreasing function curve; substituting the current playback time of the target music and the low-pass filter cutoff frequency of the target music into the change relationship curve to obtain the adjusted low-pass filter cutoff frequency of the target music.

[0101] The music playing time may be any time when the music is playing. The low-pass filter cutoff frequency may refer to a cutoff frequency preset for the low-pass filter. By setting the cutoff frequency, high-frequency signals exceeding the cutoff frequency may be filtered out, thereby generating relatively low-pitched music.

[0102] In practical applications, for music creation, music automation control (AutomationControl) can be used, which usually refers to the automatic adjustment and control of various parameters (such as volume, sound balance, effects, etc.) in the music production process in a digital audio workstation (DAW). Automation control enables music producers to accurately adjust these parameters on the entire track or a specific part, thereby achieving more complex and sophisticated music production. For the music generation system of this scheme, the two more effective control parameters are the cutoff frequency (CutFreq) and note density (Density) of the low-pass filter in the mixing part, such as Fig.10 As shown, the cutoff frequency (CutFreq) and note density (Density) of the low-pass filter of the mixing part can be processed by the automation control module to generate the sound effect and note density of the target music. It should be noted that the automation control module is used to determine the note density that changes over time. Among them:

[0103] As for the cutoff frequency, it should be gradually reduced as sleep deepens. The lower the cutoff frequency of the low-pass filter (the low-pass filter belongs to the sound effector), the less high-frequency audio is output. The corresponding relationship of the cutoff frequency is: CutFreq = startCutFreq * e^(-k3t); where startCutFreq and k3 are the control parameters of the curve, and t is the time when the music is played. CutFreq = startCutFreq * e^(-k3t) is a decreasing function. As time goes by, the cutoff frequency CutFreq becomes lower.

[0104] This embodiment can gradually reduce the cutoff frequency of the low-pass filter according to the target user's deepening sleep time, thereby achieving precise automatic control of the sound effects of the target music, thereby making the target music more suitable for the target user's sleep-aiding scenario.

[0105] In an exemplary embodiment, the method also includes: in response to a selection operation of a target user on a music category, obtaining candidate music that matches the music category selected by the selection operation; and, in response to a selection operation on the candidate music, obtaining the candidate music selected by the selection operation as the original music.

[0106] The music category may refer to a subdivided music category under the sleep-aiding music, for example, a category with high density, a category with low density, a category with more natural sounds, a category with less natural sounds, etc. The candidate music may refer to a pre-configured default music that matches the music category.

[0107] In actual applications, the target user selects a music type, and the terminal can match candidate music according to the music type selected by the target user and display it to the target user. The target user then selects one piece from multiple candidate music, and the terminal uses the music selected by the target user as the original music.

[0108] This embodiment can accurately determine the type of music that meets the user's preferences through the interactive information when the user selects the type of music, which is conducive to the subsequent optimization of the original music using various music production parameters to generate target music that meets the user's preferences.

[0109] In another embodiment, Fig.11 As shown, a music generation method is provided, which is described by taking the method applied to the terminal 102 in FIG. 1 as an example, and includes the following steps:

[0110] Step S1102, obtaining historical sleep data and original music of the target user, where the historical sleep data is used to reflect the sleep habits of the target user.

[0111] Step S1104, generating at least one music production parameter for the target user based on the historical sleep data; wherein the music production parameter includes at least one of music structure information, note density, white noise mixing ratio, and music speed.

[0112] Step S1106, adjusting the original music according to at least one music production parameter to obtain target music that matches the sleep habits of the target user.

[0113] Step S1108, while the target music is being played along with the target user's current sleep process, music speed adjustment information is determined according to the target user's heart rate signal and breathing rate signal at the current playing moment, and the music speed adjustment information includes an adjustment amplitude and an adjustment direction.

[0114] Step S1110, adjusting the music speed of the target music based on the music speed adjustment information to obtain the adjusted music speed of the target music; and controlling the playing of the target music using the adjusted music speed.

[0115] It should be noted that the specific limitations of the above steps can refer to the specific limitations of a music generation method above.

[0116] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0117] Based on the same inventive concept, the embodiment of the present application also provides a music generation device for implementing the music generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more music generation device embodiments provided below can refer to the limitations on the music generation method above, and will not be repeated here.

[0118] In an exemplary embodiment, Fig.12 As shown, a music generation device is provided, including: an acquisition module 1202, a generation module 1204, an adjustment module 1206 and a control module 1208, wherein:

[0119] An acquisition module 1202 is used to acquire historical sleep data and original music of a target user, where the historical sleep data is used to reflect the sleep habits of the target user;

[0120] A generating module 1204 generates at least one music production parameter for a target user according to the historical sleep data; wherein the music production parameter includes at least one of music structure information, note density, white noise mixing ratio, and music speed;

[0121] An adjustment module 1206 adjusts the original music according to at least one music production parameter to obtain target music that matches the sleep habits of the target user;

[0122] The control module 1208 adjusts the music playback parameters of the target music according to the current sleep data of the target user to obtain adjusted music playback parameters during the process of playing the target music following the current sleep process of the target user, wherein the music playback parameters include at least one of note density, low-pass filter cutoff frequency, and music speed; and uses the adjusted music playback parameters to control the playback of the target music.

[0123] In an exemplary embodiment, the historical sleep data includes the time of falling asleep, and the time of falling asleep represents the time required for the target user to go from the awake stage to the core sleep stage of the sleep cycle. The generation module 1204 is specifically used to obtain the music structure information of the original music; wherein the music structure information includes the number of unit bars of the prelude segment, the number of unit bars corresponding to the main segment, and the number of unit bars of the coda segment; the number of unit bars of the prelude segment of the original music is determined as the number of unit bars of the prelude segment of the target music, the number of unit bars of the coda segment of the original music is determined as the number of unit bars of the coda segment of the target music, and the number of unit bars corresponding to the main segment of the original music is adjusted according to the time of falling asleep to obtain the number of unit bars of the main segment of the target music; wherein the number of unit bars of the prelude segment of the target music, the number of unit bars of the main segment, and the number of unit bars of the coda segment of the target music are used to represent the music structure information of the target music.

[0124] In an exemplary embodiment, the generation module 1204 is specifically used to determine the music duration of the prelude segment in the original music and the music duration of the coda segment in the original music; and subtract the music duration of the prelude segment and the music duration of the coda segment from the sleep time to obtain the music duration of the main segment of the target music; and determine the number of unit music sections of the main segment of the target music according to the music duration of the main segment of the target music and a preset unit music section duration.

[0125] In an exemplary embodiment, the historical sleep data includes the deep sleep ratio in the target user's sleep cycle, and the generation module 1204 is specifically used to map the deep sleep ratio in the target user's sleep cycle to the note density of the target music based on a preset mapping relationship between the deep sleep ratio and the note density.

[0126] In an exemplary embodiment, the historical sleep data includes the rapid eye movement time ratio in the target user's sleep cycle, and the generation module 1204 is specifically used to map the rapid eye movement time ratio in the target user's sleep cycle to the white noise mixing ratio of the target music based on a preset mapping relationship between the rapid eye movement time ratio and the white noise mixing ratio.

[0127] In an exemplary embodiment, the historical sleep data includes the heart rate signal and breathing rate signal of the target user during the historical sleeping process. The historical sleeping process is the target user's sleep cycle from the awake stage to the core sleep stage. The generation module 1204 is specifically used to determine the music speed adjustment information according to the heart rate signal and breathing rate signal of the target user during the historical sleeping process. The music speed adjustment information includes the adjustment amplitude and adjustment direction; the music speed of the original music is adjusted based on the music speed adjustment information to obtain the music speed of the target music.

[0128] In an exemplary embodiment, the current sleep data includes the current playing time of the target music, and the control module 1208 is specifically used to obtain a changing relationship curve between the note density and the music playing time, wherein the changing relationship curve is a decreasing function curve; the current playing time of the target music and the note density of the target music are substituted into the changing relationship curve to obtain the adjusted note density of the target music.

[0129] In an exemplary embodiment, the current sleep data includes a current playback time control module 1208 of the target music, which is specifically used to obtain a change relationship curve between the low-pass filter cutoff frequency and the music playback time, wherein the change relationship curve is a decreasing function curve; the current playback time of the target music and the low-pass filter cutoff frequency of the target music are substituted into the change relationship curve to obtain the adjusted low-pass filter cutoff frequency of the target music.

[0130] In an exemplary embodiment, the current sleep data includes the current playback time of the target music, the heart rate signal and the breathing rate signal of the target user at the current playback time, and the control module 1208 is specifically used to determine the music speed adjustment information according to the heart rate signal and the breathing rate signal of the target user at the current playback time, and the music speed adjustment information includes the adjustment amplitude and the adjustment direction; the music speed of the target music is adjusted based on the music speed adjustment information to obtain the adjusted music speed of the target music.

[0131] Each module in the above-mentioned music generation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0132] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG13. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. 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. The database of the computer device is used to store music generation data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a music generation method is implemented.

[0133] Those skilled in the art will understand that the structure shown in FIG. 13 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0134] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned music generation method. The steps of the music generation method here may be the steps of the music generation method in each of the above-mentioned embodiments.

[0135] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned music generation method. The steps of the music generation method here can be the steps of the music generation method in each of the above-mentioned embodiments.

[0136] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, causes the processor to execute the steps of the above-mentioned music generation method. The steps of the music generation method here may be the steps of the music generation method in the above-mentioned various embodiments.

[0137] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0138] 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 the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0139] 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.

[0140] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A music generation method, characterized in that: The method comprises: Acquire historical sleep data of a target user, where the historical sleep data is used to reflect the sleep habits of the target user; generating at least one music production parameter for the target user according to the historical sleep data; wherein the music production parameter includes at least one of music structure information, note density, white noise mixing ratio, and music speed; Acquire original music, and adjust the original music according to the at least one music production parameter to obtain target music that matches the sleep habits of the target user; During the process of playing the target music following the current sleep process of the target user, the music playback parameters of the target music are adjusted according to the current sleep data of the target user to obtain adjusted music playback parameters, wherein the music playback parameters include at least one of note density, low-pass filter cutoff frequency, and music speed; and the playback of the target music is controlled using the adjusted music playback parameters.

2. The method according to claim 1, characterized in that The historical sleep data includes the sleeping time, and the sleeping time represents the time required for the target user to go from the awake stage to the core sleep stage of the sleep cycle; Generating at least one music production parameter for the target user according to the historical sleep data includes: Acquire the music structure information of the original music; wherein the music structure information includes the number of unit music bars of the prelude music segment, the number of unit music bars corresponding to the main music segment, and the number of unit music bars of the coda music segment; The number of unit musical bars of the prelude of the original music is determined as the number of unit musical bars of the prelude of the target music, the number of unit musical bars of the coda of the original music is determined as the number of unit musical bars of the coda of the target music, and the number of unit musical bars corresponding to the main music section of the original music is adjusted according to the sleep time to obtain the number of unit musical bars of the main music section of the target music; Among them, the number of unit music bars of the prelude music section of the target music, the number of unit music bars of the main music section and the number of unit music bars of the outro music section of the target music are used to represent the music structure information of the target music.

3. The method according to claim 2, characterized in that The step of adjusting the number of unit music sections corresponding to the main music section of the original music according to the sleeping time to obtain the number of unit music sections of the main music section of the target music includes: Determine the music duration of the prelude music segment in the original music and the music duration of the outro music segment in the original music; and subtract the music duration of the prelude music segment and the music duration of the outro music segment from the sleep onset time to obtain the music duration of the main music segment of the target music; The number of unit music sections of the main music section of the target music is determined according to the music duration of the main music section of the target music and the preset unit music section duration.

4. The method according to claim 1, characterized in that: The historical sleep data includes the deep sleep ratio in the sleep cycle of the target user; and generating at least one music production parameter for the target user according to the historical sleep data includes: Based on a preset mapping relationship between the deep sleep ratio and the note density, the deep sleep ratio in the sleep cycle of the target user is mapped to the note density of the target music.

5. The method according to claim 1, characterized in that: The historical sleep data includes the rapid eye movement time ratio in the sleep cycle of the target user; and generating at least one music production parameter for the target user according to the historical sleep data includes: Based on a preset mapping relationship between the rapid eye movement time ratio and the white noise mixing ratio, the rapid eye movement time ratio in the sleep cycle of the target user is mapped to the white noise mixing ratio of the target music.

6. The method according to claim 1, characterized in that The historical sleep data includes a heart rate signal and a breathing rate signal of the target user during a historical sleeping process, wherein the historical sleeping process is from the awake stage to the core sleep stage of the sleep cycle of the target user; Generating at least one music production parameter for the target user according to the historical sleep data includes: Determining music speed adjustment information according to the heart rate signal and the breathing frequency signal of the target user during the historical sleeping process, wherein the music speed adjustment information includes an adjustment amplitude and an adjustment direction; The music speed of the original music is adjusted based on the music speed adjustment information to obtain the music speed of the target music.

7. The method according to claim 1, characterized in that The current sleep data includes the current playing time of the target music; and adjusting the music playing parameters of the target music according to the current sleep data of the target user to obtain the adjusted playing parameters includes: Obtaining a curve of the relationship between the density of musical notes and the time of music playing, wherein the curve of the relationship between musical notes and the time of music playing is a decreasing function curve; The current playing time of the target music and the note density of the target music are substituted into the change relationship curve to obtain the adjusted note density of the target music.

8. The method according to claim 1, characterized in that: The current sleep data includes the current playing time of the target music; and adjusting the music playing parameters of the target music according to the current sleep data of the target user to obtain the adjusted music playing parameters includes: Obtaining a change relationship curve between the cutoff frequency of the low-pass filter and the music playing time, wherein the change relationship curve is a decreasing function curve; The current playing time of the target music and the low-pass filter cutoff frequency of the target music are substituted into the change relationship curve to obtain the adjusted low-pass filter cutoff frequency of the target music.

9. The method according to claim 1, characterized in that: The current sleep data includes the current playing time of the target music, the heart rate signal and the breathing rate signal of the target user at the current playing time; the adjusting the music playing parameters of the target music according to the current sleep data of the target user to obtain the adjusted playing parameters includes: Determine music speed adjustment information according to the heart rate signal and the breathing rate signal of the target user at the current playing time, wherein the music speed adjustment information includes an adjustment amplitude and an adjustment direction; The music speed of the target music is adjusted based on the music speed adjustment information to obtain the adjusted music speed of the target music.

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 steps of the method according to any one of claims 1 to 9 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Sleep-assisting music control system

    CN110585554A

  • Music-assisted sleep method and device, and computer device and storage medium

    CN111790038A

  • Sleep-aiding music generation method and device, computer equipment and storage medium

    CN115721830A

  • Sound source providing system and method for improving sleep quality based on artificial intelligence

    KR102260010B1