Method and device for generating sleep aid music, computer device and storage medium
By acquiring the spectrum of sleep-aid music and generating a spectrum chain of sleep-aid music using a genetic algorithm, combined with user sleep status feedback, the problem of limited effectiveness of existing sleep-aid music generation methods has been solved, and personalized and reliable sleep-aid music generation has been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ANHUI HUAMI HEALTH TECH CO LTD
- Filing Date
- 2021-08-25
- Publication Date
- 2026-05-05
AI Technical Summary
Existing methods for generating sleep-aid music have limited effectiveness and applicability. Artificially created music carries the subjective color of musicians, making it difficult to scientifically and effectively generate sleep-aid music suitable for individual needs.
By acquiring multiple sleep-aid music spectra, processing them using a genetic algorithm, and generating a sleep-aid music spectrum chain, and combining this with user sleep status feedback, the sleep-aid music generation process is optimized to achieve personalized customization.
It improves the generation effect and reliability of sleep-aid music, reduces costs, and can generate personalized sleep-aid music according to user needs.
Smart Images

Figure CN115721830B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, specifically to a method, apparatus, computer device, and storage medium for generating sleep-aid music. Background Technology
[0002] Besides eliminating fatigue and generating new energy, sleep is also closely related to improving immunity and disease resistance; good immunity stems from quality sleep. Music, as a multimedia medium, is readily available and easily accepted, and has become a mainstream method for aiding sleep. Music-based sleep aids fall under the category of psychological intervention, aiming to reduce stress and achieve physical and mental relaxation to promote sleep.
[0003] Most sleep-aid music used in related technologies is artificially created. However, artificially created sleep-aid music expresses emotions with the musician's subjective bias, limiting its effectiveness and applicability. Therefore, how to scientifically and effectively generate sleep-aid music is a problem that urgently needs to be solved. Summary of the Invention
[0004] This disclosure provides a method, apparatus, device, and storage medium for generating sleep-aid music.
[0005] According to a first aspect of this disclosure, a method for generating sleep-inducing music is provided, comprising:
[0006] Obtain multiple sleep-inducing music spectrums;
[0007] A genetic algorithm is used to process the multiple sleep-aid music spectra to obtain a sleep-aid music spectrum chain;
[0008] Sleep-inducing music is generated based on the aforementioned sleep-inducing music spectrum chain.
[0009] Optionally, acquiring multiple sleep-aid music spectra includes:
[0010] Obtain m reference music spectra;
[0011] Using the trained recognition model, each of the reference music spectra is identified to determine the sleep-aid value corresponding to each of the reference music spectra;
[0012] The n reference music spectra whose corresponding sleep-aid values are greater than the first threshold among the m reference music spectra are determined as sleep-aid music spectra, where m is greater than n and n is a natural number greater than 1.
[0013] Optionally, the step of using a genetic algorithm to process the multiple sleep-aid music spectra to obtain a sleep-aid music spectrum chain includes:
[0014] Based on the sleep-aid value corresponding to each sleep-aid music spectrum, a genetic algorithm is used to process the multiple sleep-aid music spectra to obtain a sleep-aid music spectrum chain.
[0015] Optionally, based on the sleep-aid value corresponding to each sleep-aid music spectrum, a genetic algorithm is used to process the multiple sleep-aid music spectra to obtain a sleep-aid music spectrum chain, including:
[0016] Based on the sleep-aid value corresponding to each sleep-aid music spectrum, select the target sleep-aid music spectrum to be processed from the plurality of sleep-aid music spectra;
[0017] The target sleep-aid music spectrum is subjected to cross-operation and / or mutation operation to generate multiple first-level sub-sleep-aid music spectra;
[0018] Based on the sleep-aid value corresponding to the first-level sub-sleep-aid audio spectrum, a target first-level sub-sleep-aid music spectrum is selected from the plurality of first-level sub-sleep-aid audio spectra;
[0019] Based on the target first-level sub-sleep-aid music spectrum, the crossover operation and / or mutation operation are repeatedly executed until the number of operations reaches a preset value. The sleep-aid music spectrum chain is determined according to the target sleep-aid music spectrum and the generated target sub-sleep-aid music spectra at each level.
[0020] Optionally, after generating the sleep-inducing music, the method further includes:
[0021] During the playback of the sleep-aiding music, the user's sleep status is obtained;
[0022] Based on the sleep state, determine the sleep-aid value of the sleep-aid music spectrum that generates the sleep-aid music;
[0023] If the sleep-aid value of any sleep-aid music is less than the second threshold, the sleep-aid music spectrum that generated the sleep-aid music will be removed from the plurality of sleep-aid music spectra to obtain updated plurality of sleep-aid music spectra.
[0024] Optionally, obtaining the user's sleep state includes:
[0025] Wearable devices are used to collect multiple physiological parameters of the user, wherein the physiological parameters include at least one of the following: number of rolls, heart rate, blood pressure, respiratory rate, and head movement frequency;
[0026] The user's sleep state is determined based on the aforementioned physiological parameters.
[0027] According to a second aspect of this disclosure, a device for generating sleep-aid music is provided, comprising:
[0028] The first acquisition module is used to acquire the spectrum of multiple sleep-aid music tracks;
[0029] The second acquisition module is used to process the multiple sleep-aid music spectra using a genetic algorithm to obtain a sleep-aid music spectrum chain.
[0030] The first generation module is used to generate sleep-aid music based on the sleep-aid music spectrum chain.
[0031] Optionally, the first acquisition module is specifically used for:
[0032] Obtain m reference music spectra;
[0033] Using the trained recognition model, each of the reference music spectra is identified to determine the sleep-aid value corresponding to each of the reference music spectra;
[0034] The n reference music spectra whose corresponding sleep-aid values are greater than the first threshold among the m reference music spectra are determined as sleep-aid music spectra, where m is greater than n and n is a natural number greater than 1.
[0035] Optionally, the second acquisition module includes:
[0036] The processing unit is used to process the multiple sleep-aid music spectra based on the sleep-aid value corresponding to each sleep-aid music spectrum using a genetic algorithm to obtain a sleep-aid audio spectrum chain.
[0037] Optionally, the processing unit is specifically used for:
[0038] Based on the sleep-aid value corresponding to each sleep-aid music spectrum, select the target sleep-aid music spectrum to be processed from the plurality of sleep-aid music spectra;
[0039] The target sleep-aid music spectrum is subjected to cross-operation and / or mutation operation to generate multiple first-level sub-sleep-aid music spectra;
[0040] Based on the sleep-aid value corresponding to the first-level sub-sleep-aid audio spectrum, a target first-level sub-sleep-aid music spectrum is selected from the plurality of first-level sub-sleep-aid audio spectra;
[0041] Based on the target first-level sub-sleep-aid music spectrum, the crossover operation and / or mutation operation are repeatedly executed until the number of operations reaches a preset value. The sleep-aid music spectrum chain is determined according to the target sleep-aid music spectrum and the generated target sub-sleep-aid music spectra at each level.
[0042] Optionally, the first generation module includes:
[0043] The first acquisition unit is used to acquire the user's sleep state during the playback of the sleep-aid music;
[0044] The first generation unit is used to determine the sleep-aid value of the sleep-aid music spectrum for generating the sleep-aid music based on the sleep state.
[0045] The second generation unit is used to remove the sleep-aid music spectrum of the generated sleep-aid music from the plurality of sleep-aid music spectra when the sleep-aid value of any sleep-aid music is less than a second threshold, so as to obtain an updated plurality of sleep-aid music spectra.
[0046] Optionally, the first acquisition unit is specifically used for:
[0047] Wearable devices are used to collect multiple physiological parameters of the user, wherein the physiological parameters include at least one of the following: number of rolls, heart rate, blood pressure, respiratory rate, and head movement frequency;
[0048] The user's sleep state is determined based on the aforementioned physiological parameters.
[0049] According to a third aspect of this disclosure, an electronic device is provided, comprising:
[0050] At least one processor; and
[0051] A memory communicatively connected to the at least one processor; wherein,
[0052] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in one aspect of the above embodiments.
[0053] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions thereon, wherein the computer instructions are configured to cause the computer to perform the method described in one aspect of the above-described embodiments.
[0054] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in one aspect of the embodiments above.
[0055] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description.
[0056] In this embodiment, multiple sleep-aid music spectra are first obtained. Then, a genetic algorithm is used to process these spectra to obtain a sleep-aid music spectrum chain. Finally, sleep-aid music is generated based on this spectrum chain. Therefore, the sleep-aid music spectrum can be used as genetic material to generate sleep-aid music using a genetic algorithm, thus ensuring both the effectiveness and reliability of the sleep-aid music while reducing its cost.
[0057] Furthermore, in this embodiment, multiple reference music spectra are first obtained. A trained recognition model is then used to identify each reference music spectrum to determine its corresponding sleep-aid value. Next, reference music spectra with sleep-aid values greater than a first threshold are identified as sleep-aid music spectra. Then, based on the sleep-aid value corresponding to each sleep-aid music spectrum, a genetic algorithm is used to process the multiple sleep-aid music spectra to obtain a sleep-aid audio spectrum chain. Finally, sleep-aid music is generated based on the sleep-aid music spectrum chain. Thus, by using music spectra with higher sleep-aid values as genetic material and employing a genetic algorithm to generate sleep-aid music, the effectiveness and reliability of the generated sleep-aid music are further improved.
[0058] Furthermore, in this embodiment, multiple sleep-aid music spectra are first obtained. Then, a genetic algorithm is used to process these spectra to obtain a sleep-aid music spectrum chain. Sleep-aid music is then generated based on this spectrum chain. During the playback of the sleep-aid music, the user's sleep state parameters are acquired. Based on these parameters, the sleep-aid value of the generated sleep-aid music spectrum is determined. If the sleep-aid value of any sleep-aid music is less than a second threshold, the spectrum used to generate that particular music is removed from the multiple sleep-aid music spectra to obtain updated spectra. Finally, based on the updated spectrum set, the above sleep-aid music generation process is repeated to generate sleep-aid music corresponding to the user. Therefore, by incorporating user sleep feedback, the reliability and effectiveness of sleep-aid music generation can be improved, enabling personalized customization and the scientific and reliable generation of sleep-aid music with good sleep-aid effects.
[0059] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0060] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0061] Figure 1 This is a flowchart illustrating a method for generating sleep-aid music according to the present disclosure;
[0062] Figure 2 This is a flowchart illustrating another method for generating sleep-aid music provided in this disclosure;
[0063] Figure 3 This is a flowchart illustrating yet another method for generating sleep-aid music provided in this disclosure;
[0064] Figure 4 This is a structural block diagram of a sleep-aid music generation device provided in this disclosure;
[0065] Figure 5 A structural block diagram of the electronic device provided in this disclosure. Detailed Implementation
[0066] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0067] The method for generating sleep-aid music proposed in this disclosure can be executed by the sleep-aid music generating device provided in this disclosure, or by the electronic device provided in this disclosure. The electronic device may include, but is not limited to, terminal devices such as desktop computers and tablet computers, or servers. The following describes the method for generating sleep-aid music provided in this disclosure as being executed by the sleep-aid music generating device provided in this disclosure, without limiting this disclosure. It is hereinafter referred to as "device".
[0068] The method, apparatus, computer equipment, and storage medium for generating sleep-aid music provided in this disclosure will be described in detail below with reference to the accompanying drawings.
[0069] Figure 1 This is a schematic flowchart of a method for generating sleep-aid music according to an embodiment of the present disclosure.
[0070] like Figure 1 As shown, the method for generating this sleep-aid music may include the following steps:
[0071] Step 101: Obtain multiple sleep-aid music spectra.
[0072] Sleep-aid music can help people reduce stress and achieve physical and mental relaxation by combining soothing melodies and musical elements, thereby achieving the effect of sleep aid. It can be brainwave music, binaural music, music played repeatedly at a fixed frequency, white noise, etc., without any limitation.
[0073] Among them, the sleep-aid music spectrum refers to any type of music spectrum that has a sleep-aiding effect and can be processed through combination, variation, etc., to generate music. This disclosure does not limit it.
[0074] Step 102: Use a genetic algorithm to process multiple sleep-aid music spectra to obtain a sleep-aid music spectrum chain.
[0075] Specifically, after acquiring the sleep-aid music spectrum set, the device can use each sleep-aid music spectrum contained in the sleep-aid music spectrum set as the parent spectrum. Then, the spectrum of each parent can be processed by a genetic algorithm, such as cross-crossing the spectrum of multiple parents, or mutating the spectrum of any parent and then cross-crossing it with the spectrum of other parents, thereby generating a spectrum chain of offspring with sleep-aiding effects.
[0076] It should be noted that there are many ways to cross over and mutate. Crossing can be single-point crossover, multi-point crossover, uniform crossover, arithmetic crossover, etc., and mutation can be uniform mutation, boundary mutation, Gaussian approximation mutation, etc. This disclosure does not limit these methods.
[0077] Step 103: Generate sleep-inducing music based on the sleep-inducing music spectrum chain.
[0078] Specifically, the sleep-aid music spectrum chain can be decoded by performing an inverse Fourier transform to obtain the sleep-aid music, without any limitations on this process.
[0079] It should be noted that the device can also remove noise signals from sleep-aid music according to the user's preset frequency, but this is not limited here.
[0080] In this embodiment, the device first acquires multiple sleep-aid music spectra, then uses a genetic algorithm to process these spectra to obtain a sleep-aid music spectrum chain, and finally generates sleep-aid music based on this spectrum chain. Thus, the sleep-aid music spectrum can be used as genetic material to generate sleep-aid music using a genetic algorithm, thereby ensuring both the effectiveness and reliability of the sleep-aid music while reducing its cost.
[0081] Figure 2 This is a flowchart illustrating a method for generating sleep-aid music according to yet another embodiment of the present disclosure.
[0082] like Figure 2 As shown, the method for generating this sleep-aid music may include the following steps:
[0083] Step 201: Obtain m reference music spectra.
[0084] Where m is a natural number greater than 1.
[0085] Specifically, the reference music spectrum can be obtained by the device through certain processing of the original audio data of the reference music. For example, for the original audio data of the reference music, the device can first divide the original audio data into music segments of fixed length, and then obtain the reference music spectrum corresponding to the music segments by performing Fourier transform on these segments, without any limitation on this process.
[0086] It should be noted that, since sleep-aid music may contain music segments with only moderate sleep-aid effects, and non-sleep-aid music may contain music segments with relatively good sleep-aid effects, in order to better create sleep-aid music for users to help them achieve quality sleep, this disclosure allows the device to pre-select various types of reference music from a massive amount of audio data. These can be any type of music, and there are no limitations on this.
[0087] The reference music spectrum can be a music spectrum that includes both sleep-inducing and non-sleep-inducing music. For example, the music spectrum of non-sleep-inducing music such as heavy metal, rock, and hip-hop, and the music spectrum of sleep-inducing music such as brainwave music, binaural music, music played repeatedly at a fixed frequency, and white noise. This disclosure does not limit the scope of the music spectrum.
[0088] Step 202: Using the recognition model generated by training, identify each reference music spectrum to determine the sleep aid value corresponding to each reference music spectrum.
[0089] The recognition model can be trained using labeled spectra of sleep-aid music and non-sleep-aid music. Through the trained recognition model, the device can identify each reference music spectrum. It can employ a convolutional neural network structure or a recurrent neural network architecture; this disclosure does not limit its application.
[0090] Specifically, after inputting various reference music spectra into the recognition model, the sleep-aiding efficacy of each reference music spectrum can be determined through the model's recognition. The output of the last layer of neurons in the recognition model can be used as a sleep-aiding value, which is then used to characterize the sleep-aiding effect of the music spectrum.
[0091] Step 203: Select the n reference music spectra from the m reference music spectra whose corresponding sleep-aid values are greater than the first threshold as sleep-aid music spectra, where m is greater than n and n is a natural number greater than 1.
[0092] The first threshold can be a pre-set sleep-aid threshold. If the sleep-aid value corresponding to any reference music spectrum is greater than the first threshold, it indicates that the sleep-aid effect of the reference music spectrum is relatively good, and therefore, the device can identify it as a sleep-aid music spectrum.
[0093] For example, if there are four reference music spectra, i.e., n is 4, namely a, b, c, and d, where the sleep-aiding values corresponding to a, b, c, and d are 16, 36, 84, and 77 respectively, and if the preset first threshold is 75, then c and d in the reference music spectra can be determined as sleep-aiding music spectra without any restrictions.
[0094] Step 204: Based on the sleep-aid value corresponding to each sleep-aid music spectrum, use a genetic algorithm to process multiple sleep-aid music spectra to obtain a sleep-aid audio spectrum chain.
[0095] As one possible approach, the target sleep-aid music spectrum to be processed can be selected from multiple sleep-aid music spectra based on the sleep-aid value corresponding to each sleep-aid music spectrum. Then, the target sleep-aid music spectrum can be subjected to cross-operation and / or mutation operation to generate multiple first-level sub-sleep-aid music spectra.
[0096] The target sleep-aid music spectrum can be selected from various sleep-aid music spectra, choosing those with higher sleep-aid values. By performing crossover and / or mutation operations on the target music spectrum, a genetic and exploratory process can be simulated to obtain first-level sub-sleep-aid music spectra that better meet the sleep-aid conditions. It should be noted that there are many methods of crossover and mutation, including single-point crossover, multi-point crossover, uniform crossover, arithmetic crossover, etc., and uniform mutation, boundary mutation, Gaussian approximation mutation, etc., which are not limited herein.
[0097] Furthermore, based on the sleep-aid value corresponding to the first-level sub-sleep-aid audio spectrum, a target first-level sub-sleep-aid music spectrum can be selected from multiple first-level sub-sleep-aid audio spectra. Then, based on the target first-level sub-sleep-aid music spectrum, the crossover operation and / or mutation operation can be repeatedly performed until the number of operations reaches a preset value. Finally, based on the target sleep-aid music spectrum and the generated target sub-sleep-aid music spectra at each level, the sleep-aid music spectrum chain is determined.
[0098] Understandably, crossover and mutation operations can be used to selectively retain offspring with high fitness and good sleep-inducing effects, i.e., first-level sub-sleep-inducing music spectra. The target first-level sub-sleep-inducing music spectra can be those that better meet sleep-inducing requirements. By repeatedly performing the crossover and / or mutation operations based on the target first-level sub-sleep-inducing music spectra, iterative optimization can be performed to obtain the target sub-sleep-inducing music spectra, thereby obtaining a sleep-inducing music spectrum chain.
[0099] It should be noted that when processing the spectrum of sleep-aid music using a genetic algorithm, this device can use the sleep-aid value corresponding to each music spectrum as the fitness of that music spectrum. This allows the genetic algorithm to process sleep-aid music spectra with sleep-aid values higher than a preset sleep-aid threshold. As a result, the generated sleep-aid music can have more sleep-inducing properties.
[0100] Step 205: Generate sleep-inducing music based on the sleep-inducing music spectrum chain.
[0101] It should be noted that the specific implementation process of step 205 can refer to the specific implementation process of the above embodiments, and will not be repeated here.
[0102] In this embodiment, the device first acquires m reference music spectra, and uses a trained recognition model to identify each reference music spectrum to determine its corresponding sleep-aid value. Then, it identifies n reference music spectra whose sleep-aid values are greater than a first threshold as sleep-aid music spectra. Next, based on the sleep-aid value corresponding to each sleep-aid music spectrum, it uses a genetic algorithm to process multiple sleep-aid music spectra to obtain a sleep-aid audio spectrum chain. Finally, it generates sleep-aid music based on the sleep-aid music spectrum chain. Therefore, by using music spectra with high sleep-aid values as genetic material and employing a genetic algorithm to generate sleep-aid music, the effectiveness and reliability of the generated sleep-aid music are further improved.
[0103] Figure 3 This is a flowchart illustrating a method for generating sleep-aid music according to another embodiment of the present disclosure.
[0104] like Figure 3 As shown, the method for generating this sleep-aid music may include the following steps:
[0105] Step 301: Obtain multiple sleep-aid music spectra.
[0106] Step 302: Use a genetic algorithm to process multiple sleep-aid music spectra to obtain a sleep-aid music spectrum chain.
[0107] Step 303: Generate sleep-inducing music based on the sleep-inducing music spectrum chain.
[0108] It should be noted that the specific implementation process of steps 301, 302, and 303 can refer to the specific implementation process of the above embodiments, and will not be repeated here.
[0109] Step 304: During the playback of sleep-aiding music, obtain the user's sleep state parameters.
[0110] It should be noted that there are many ways to obtain a user's sleep state parameters. For example, the device can use wearable devices to collect multiple physiological parameters of the user, including at least one of the following: number of tossing and turning, heart rate, blood pressure, respiratory rate, head movement frequency, and then determine the user's sleep state parameters based on multiple physiological parameters.
[0111] The device can collect multiple physiological parameters of the user through wearable devices such as watches and wristbands. Specifically, the physiological parameters can include the number of turns, heart rate, blood pressure, respiratory rate, head movement frequency, etc., without limitation.
[0112] Among them, sleep state parameters can be used to characterize the user's sleep state, such as deep sleep, sound sleep, light sleep, falling asleep, etc., and this disclosure does not limit them.
[0113] Specifically, the device can preset thresholds for physiological parameters such as the number of tossing and turning, heart rate, blood pressure, respiratory rate, and head movement frequency. It then infers the user's sleep state by comparing these physiological parameters to these thresholds. For example, if a user's tossing and turning, head movement frequency, and heart rate are all below the preset physiological parameter thresholds while listening to a certain sleep-aiding music A, it indicates that the user is likely in a deep sleep state, and no further restrictions are imposed.
[0114] The device can pre-set the mapping relationship between physiological parameters and sleep state parameters, and then determine the sleep state parameters of the current user when playing a specific sleep aid music based on the collected physiological parameters, without imposing any restrictions on this.
[0115] Alternatively, wearable devices can be used to monitor the spatial changes in a user's position and posture while playing sleep-aiding music, thereby determining the user's sleep parameters, without any limitations.
[0116] It should be noted that when the device plays multiple sleep-aid music tracks in sequence, it can obtain the sleep state parameters of the user corresponding to each track.
[0117] Step 305: Determine the sleep-aid value of the sleep-aid music spectrum for generating sleep-aid music based on sleep state parameters.
[0118] By using sleep state parameters, the device can determine the degree of influence of each sleep-aid music on the user's sleep, that is, the sleep-aid effect.
[0119] Specifically, the device can determine the sleep aid value corresponding to the sleep state parameters of each sleep aid music by inputting sleep state parameters into a pre-trained sleep aid recognition network. The sleep aid recognition network can be implemented using various deep neural networks (DNNs), and this disclosure does not limit its implementation.
[0120] Step 306: If the sleep-aid value of any sleep-aid music is less than the second threshold, the sleep-aid music spectrum of the generated sleep-aid music is removed from the multiple sleep-aid music spectra to obtain updated multiple sleep-aid music spectra.
[0121] Understandably, by comparing the sleep-inducing value of any sleep-inducing music's spectrum with a second threshold, the device can determine the effectiveness of the sleep-inducing music. For example, if the sleep-inducing value of any sleep-inducing music is higher than the second threshold, it indicates that the current sleep-inducing music has high adaptability and strong sleep-inducing ability. By removing the sleep-inducing music spectrum that generated the sleep-inducing music, the sleep-inducing music spectrum set can be updated to produce an updated sleep-inducing music spectrum set that is more suitable for the user.
[0122] Step 307: Based on the updated sleep music spectrum set, repeat the above sleep music generation process to generate sleep music corresponding to the user.
[0123] Specifically, by continuously repeating the process of generating sleep-aid music, the spectrum of sleep-aid music can be constantly adapted to the user's sleep characteristics, so as to quickly adapt to and meet the user's sleep-aid needs.
[0124] This embodiment first obtains multiple sleep-aid music spectra, then uses a genetic algorithm to process these spectra to obtain a sleep-aid music spectrum chain. Next, sleep-aid music is generated based on this spectrum chain. During the playback of the sleep-aid music, the user's sleep state parameters are acquired. Based on these parameters, the sleep-aid value of the generated sleep-aid music spectrum is determined. If the sleep-aid value of any sleep-aid music is less than a second threshold, the spectrum used to generate that particular music is removed from the multiple sleep-aid music spectra, resulting in updated spectra. Finally, based on the updated spectrum set, the above sleep-aid music generation process is repeated to generate sleep-aid music corresponding to the user. Therefore, by incorporating user sleep feedback, the reliability and effectiveness of sleep-aid music generation can be improved, enabling personalized customization and the scientific and reliable generation of sleep-aid music with good sleep-aid effects.
[0125] To achieve the above embodiments, this disclosure also proposes a bed condition monitoring device based on wearable devices. Figure 4This is a structural block diagram of a bedside status monitoring device based on a wearable device, provided in an embodiment of this disclosure.
[0126] like Figure 4 As shown, the bed status monitoring device based on wearable devices includes: a first acquisition module 410, a second acquisition module 420, and a first generation module 430.
[0127] The first acquisition module 410 is used to acquire multiple sleep-aid music spectra;
[0128] The second acquisition module 420 is used to process the multiple sleep-aid music spectra using a genetic algorithm to obtain a sleep-aid music spectrum chain.
[0129] The first generation module 430 is used to generate sleep-aid music based on the sleep-aid music spectrum chain.
[0130] Optionally, the first acquisition module 410 is specifically used for:
[0131] Obtain m reference music spectra;
[0132] Using the trained recognition model, each of the reference music spectra is identified to determine the sleep-aid value corresponding to each of the reference music spectra;
[0133] The n reference music spectra whose corresponding sleep-aid values are greater than the first threshold among the m reference music spectra are determined as sleep-aid music spectra, where m is greater than n and n is a natural number greater than 1.
[0134] Optionally, the second acquisition module includes:
[0135] The processing unit is used to process the multiple sleep-aid music spectra based on the sleep-aid value corresponding to each sleep-aid music spectrum using a genetic algorithm to obtain a sleep-aid audio spectrum chain.
[0136] Optionally, the processing unit is specifically used for:
[0137] Based on the sleep-aid value corresponding to each sleep-aid music spectrum, select the target sleep-aid music spectrum to be processed from the plurality of sleep-aid music spectra;
[0138] The target sleep-aid music spectrum is subjected to cross-operation and / or mutation operation to generate multiple first-level sub-sleep-aid music spectra;
[0139] Based on the sleep-aid value corresponding to the first-level sub-sleep-aid audio spectrum, a target first-level sub-sleep-aid music spectrum is selected from the plurality of first-level sub-sleep-aid audio spectra;
[0140] Based on the target first-level sub-sleep-aid music spectrum, the crossover operation and / or mutation operation are repeatedly executed until the number of operations reaches a preset value. The sleep-aid music spectrum chain is determined according to the target sleep-aid music spectrum and the generated target sub-sleep-aid music spectra at each level.
[0141] Optionally, the first generation module includes:
[0142] The first acquisition unit is used to acquire the user's sleep state during the playback of the sleep-aid music;
[0143] The first generation unit is used to determine the sleep-aid value of the sleep-aid music spectrum for generating the sleep-aid music based on the sleep state.
[0144] The second generation unit is used to remove the sleep-aid music spectrum of the generated sleep-aid music from the plurality of sleep-aid music spectra when the sleep-aid value of any sleep-aid music is less than a second threshold, so as to obtain an updated plurality of sleep-aid music spectra.
[0145] Optionally, the first acquisition unit is specifically used for:
[0146] Wearable devices are used to collect multiple physiological parameters of the user, wherein the physiological parameters include at least one of the following: number of rolls, heart rate, blood pressure, respiratory rate, and head movement frequency;
[0147] The user's sleep state is determined based on the aforementioned physiological parameters.
[0148] In this embodiment, the device first acquires multiple sleep-aid music spectra, then uses a genetic algorithm to process these spectra to obtain a sleep-aid music spectrum chain, and finally generates sleep-aid music based on this spectrum chain. Thus, the sleep-aid music spectrum can be used as genetic material to generate sleep-aid music using a genetic algorithm, thereby ensuring both the effectiveness and reliability of the sleep-aid music while reducing its cost.
[0149] According to embodiments of this disclosure, this disclosure also provides a wearable device, a readable storage medium, and a computer program product.
[0150] Figure 5A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0151] like Figure 5 As shown, device 500 includes a computing unit 501, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 502 or a computer program loaded from storage unit 508 into random access memory (RAM) 503. RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.
[0152] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0153] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the method for generating sleep-aid music. For example, in some embodiments, the method for generating sleep-aid music may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the method for generating sleep-aid music described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the method for generating sleep-aid music by any other suitable means (e.g., by means of firmware).
[0154] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0155] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0156] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0157] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0158] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0159] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0160] In this embodiment, the device first acquires multiple sleep-aid music spectra, then uses a genetic algorithm to process these spectra to obtain a sleep-aid music spectrum chain, and finally generates sleep-aid music based on this spectrum chain. Thus, the sleep-aid music spectrum can be used as genetic material to generate sleep-aid music using a genetic algorithm, thereby ensuring both the effectiveness and reliability of the sleep-aid music while reducing its cost.
[0161] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0162] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for generating sleep-aid music, characterized in that, include: Obtain multiple sleep-inducing music spectrums; A genetic algorithm is used to process the multiple sleep-aid music spectra to obtain a sleep-aid music spectrum chain; Based on the aforementioned sleep-aid music spectrum chain, sleep-aid music is generated; The process of using a genetic algorithm to process the multiple sleep-aid music spectra to obtain a sleep-aid music spectrum chain includes: Based on the sleep-aid value corresponding to each sleep-aid music spectrum, a target sleep-aid music spectrum to be processed is selected from the plurality of sleep-aid music spectra, and a genetic algorithm is used to generate target sub-sleep-aid music spectra at each level based on the target sleep-aid music spectrum; The sleep-aid music spectrum chain is determined based on the target sleep-aid music spectrum and the generated target sub-sleep-aid music spectra at each level; The sleep-aid value is used to characterize the sleep-aiding effect of the sleep-aid music spectrum.
2. The method as described in claim 1, characterized in that, The acquisition of multiple sleep-aid music spectra includes: Obtain m reference music spectra; Using the trained recognition model, each of the reference music spectra is identified to determine the sleep-aid value corresponding to each of the reference music spectra; The n reference music spectra whose corresponding sleep-aid values are greater than the first threshold among the m reference music spectra are determined as sleep-aid music spectra, where m is greater than n and n is a natural number greater than 1.
3. The method as described in claim 1, characterized in that, The process of generating target sub-sleep-aid music spectra at various levels using a genetic algorithm based on the target sleep-aid music spectrum includes: The target sleep-aid music spectrum is subjected to cross-operation and / or mutation operation to generate multiple first-level sub-sleep-aid music spectra; Based on the sleep-aid value corresponding to the first-level sub-sleep-aid music spectrum, a target first-level sub-sleep-aid music spectrum is selected from the plurality of first-level sub-sleep-aid music spectra; Based on the target first-level sub-sleep-aid music spectrum, the crossover operation and / or mutation operation are repeatedly executed until the number of operations reaches a preset value. The sleep-aid music spectrum chain is determined according to the target sleep-aid music spectrum and the generated target sub-sleep-aid music spectra at each level.
4. The method according to any one of claims 1-3, characterized in that, Following the generation of sleep-inducing music, the following is also included: During the playback of the sleep-aiding music, the user's sleep status is obtained; Based on the sleep state, determine the sleep-aid value of the sleep-aid music spectrum that generates the sleep-aid music; If the sleep-aid value of any sleep-aid music is less than the second threshold, the sleep-aid music spectrum that generated the sleep-aid music will be removed from the plurality of sleep-aid music spectra to obtain updated plurality of sleep-aid music spectra.
5. The method as described in claim 4, characterized in that, The process of obtaining the user's sleep state includes: Wearable devices are used to collect multiple physiological parameters of the user, wherein the physiological parameters include at least one of the following: number of rolls, heart rate, blood pressure, respiratory rate, and head movement frequency; The user's sleep state is determined based on the aforementioned physiological parameters.
6. A device for generating sleep-aid music, characterized in that, include: The first acquisition module is used to acquire the spectrum of multiple sleep-aid music tracks; The second acquisition module is used to process the multiple sleep-aid music spectra using a genetic algorithm to obtain a sleep-aid music spectrum chain. The first generation module is used to generate sleep-aid music based on the sleep-aid music spectrum chain; The second acquisition module includes: The processing unit is used to select a target sleep-aid music spectrum to be processed from the plurality of sleep-aid music spectra according to the sleep-aid value corresponding to each sleep-aid music spectrum, and to generate target sub-sleep-aid music spectra at all levels according to the target sleep-aid music spectrum using a genetic algorithm. The sleep-aid music spectrum chain is determined based on the target sleep-aid music spectrum and the generated target sub-sleep-aid music spectra at each level; The sleep-aid value is used to characterize the sleep-aiding effect of the sleep-aid music spectrum.
7. The apparatus as claimed in claim 6, characterized in that, The first acquisition module is specifically used for: Obtain m reference music spectra; Using the trained recognition model, each of the reference music spectra is identified to determine the sleep-aid value corresponding to each of the reference music spectra; The n reference music spectra whose corresponding sleep-aid values are greater than the first threshold among the m reference music spectra are determined as sleep-aid music spectra, where m is greater than n and n is a natural number greater than 1.
8. The apparatus as claimed in claim 6, characterized in that, The processing unit is specifically used for: The target sleep-aid music spectrum is subjected to cross-operation and / or mutation operation to generate multiple first-level sub-sleep-aid music spectra; Based on the sleep-aid value corresponding to the first-level sub-sleep-aid music spectrum, a target first-level sub-sleep-aid music spectrum is selected from the plurality of first-level sub-sleep-aid music spectra; Based on the target first-level sub-sleep-aid music spectrum, the crossover operation and / or mutation operation are repeatedly executed until the number of operations reaches a preset value. The sleep-aid music spectrum chain is determined according to the target sleep-aid music spectrum and the generated target sub-sleep-aid music spectra at each level.
9. The apparatus according to any one of claims 6-8, characterized in that, The first generation module includes: The first acquisition unit is used to acquire the user's sleep state during the playback of the sleep-aid music; The first generation unit is used to determine the sleep-aid value of the sleep-aid music spectrum for generating the sleep-aid music based on the sleep state. The second generation unit is used to remove the sleep-aid music spectrum of the generated sleep-aid music from the plurality of sleep-aid music spectra when the sleep-aid value of any sleep-aid music is less than a second threshold, so as to obtain an updated plurality of sleep-aid music spectra.
10. The apparatus as claimed in claim 9, characterized in that, The first acquisition unit is specifically used for: Wearable devices are used to collect multiple physiological parameters of the user, wherein the physiological parameters include at least one of the following: number of rolls, heart rate, blood pressure, respiratory rate, and head movement frequency; The user's sleep state is determined based on the aforementioned physiological parameters.
11. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-5.
Citation Information
Patent Citations
A system and method for delivering an audio output
EP3669922A1
Generating a sound synthesis model for use in a virtual environment
GB2475096A
System and method for generating audio data
US20190007542A1