Music knowledge graph construction method, electronic device, storage medium and air conditioner
By constructing a music knowledge graph, the target scenarios and music attributes corresponding to air conditioner types are obtained, the matching results are determined, and music is associated with air conditioner types. This solves the problem of music recommendations for smart air conditioners not matching the scenarios and achieves more accurate music recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GREE ELECTRIC APPLIANCE INC OF ZHUHAI
- Filing Date
- 2022-10-24
- Publication Date
- 2026-06-12
Smart Images

Figure CN115658914B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent air conditioning technology, and in particular to a method for constructing a music knowledge graph, an electronic device, a storage medium, and an air conditioner. Background Technology
[0002] With the development of smart homes, many smart home devices now have music playback capabilities, such as voice-controlled air conditioners. Generally, the music playback process for a voice-controlled air conditioner involves: first, recognizing the user's voice command; then, using the recognized text to request a third-party music interface. Smart home devices are designed for specific groups of people and environments within the home. Directly using general music resources for music recommendations will result in many recommendations that do not match user needs, failing to provide music recommendations tailored to different usage scenarios of the air conditioner.
[0003] There is currently no effective solution to the problem that using general music resources directly for music recommendation in related technologies cannot recommend music suitable for different usage scenarios of air conditioners. Summary of the Invention
[0004] This application provides a method for constructing a music knowledge graph, an electronic device, a storage medium, and an air conditioner, to at least solve the technical problem in related technologies that directly using general music resources for music recommendation cannot recommend music suitable for different usage scenarios of the air conditioner.
[0005] According to one aspect of the embodiments of this application, a method for constructing a music knowledge graph is provided, comprising: obtaining target music attributes of target music according to a target scene corresponding to a target air conditioner type, wherein the target music is music to be associated with an air conditioner type, and the target air conditioner type is an air conditioner type to be determined whether it matches the target music; determining a target matching result based on the target music attributes, wherein the target matching result is used to indicate whether the target air conditioner type matches the target music; and associating an air conditioner type with the target music according to the target matching result to obtain a music knowledge graph.
[0006] According to another aspect of the embodiments of this application, an air conditioner music playback method is also provided, comprising: acquiring a target voice command, wherein the target voice command is used to request a specified air conditioner to play music; performing semantic analysis on the target voice command to obtain a semantic analysis result; if the semantic analysis result does not contain a music name, determining the music to be played for the specified air conditioner from preset music in a music knowledge graph according to the specified air conditioner type to which the specified air conditioner belongs, wherein the specified air conditioner type is included among all air conditioner types associated with the preset music, and the music knowledge graph is constructed according to the above-described music knowledge graph construction method; instructing a specified music player to play the music to be played, wherein the specified music player is the music player associated with the specified air conditioner.
[0007] According to another aspect of the embodiments of this application, a music knowledge graph construction apparatus is also provided, comprising: an acquisition module, configured to acquire target music attributes of target music according to a target scene corresponding to a target air conditioner type, wherein the target music is music to be associated with an air conditioner type, and the target air conditioner type is an air conditioner type to be determined as to whether it matches the target music; a matching module, configured to determine a target matching result based on the target music attributes, wherein the target matching result is used to indicate whether the target air conditioner type matches the target music; and an association module, configured to associate an air conditioner type with the target music according to the target matching result, thereby obtaining a music knowledge graph.
[0008] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store a computer program; and the processor is used to execute the computer program to implement the method described in any of the foregoing embodiments.
[0009] According to one aspect of this application, a computer-readable storage medium is provided, the storage medium including a stored program, wherein the program, when executed, performs the method as described in any of the preceding claims.
[0010] According to another aspect of the embodiments of this application, an air conditioner is also provided, including the above-described electronic device.
[0011] In this embodiment, the target music attributes of the target music are obtained according to the target scenario corresponding to the target air conditioner type. The target music is the music to be associated with the air conditioner type, and the target air conditioner type is the type of air conditioner to be determined whether it matches the target music. Based on the target music attributes, a target matching result is determined, indicating whether the target air conditioner type matches the target music. According to the target matching result, the air conditioner type is associated with the target music to obtain a music knowledge graph. By obtaining the music attributes that need to be considered for the target scenario corresponding to the target air conditioner type, it is determined whether the music matches the target air conditioner type. Based on the matching result, the air conditioner type is associated with the music. The resulting music knowledge graph contains music associated with air conditioner types, enabling music recommendations based on the music knowledge graph to be adapted to the air conditioner's usage scenario, providing users with more accurate music recommendation services. This solves the technical problem in related technologies where directly using general music resources for music recommendations cannot recommend music suitable for different air conditioner usage scenarios. Attached Figure Description
[0012] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0013] Figure 1 This is a schematic diagram of the hardware environment for a music knowledge graph construction method according to an embodiment of this application;
[0014] Figure 2 This is a flowchart of an optional music knowledge graph construction method according to an embodiment of this application;
[0015] Figure 3 This is a flowchart of another optional method for constructing a music knowledge graph according to an embodiment of this application;
[0016] Figure 4 This is a schematic diagram of an optional music knowledge graph construction apparatus according to an embodiment of this application; and,
[0017] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0018] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0019] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0020] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:
[0021] Knowledge graphs are structured semantic knowledge bases used to describe concepts and their relationships in the physical world in symbolic form. By effectively processing, handling, and integrating complex document data, knowledge graphs transform it into simple, clear "entity-relationship-entity" triples, ultimately aggregating vast amounts of knowledge to achieve rapid knowledge response and reasoning.
[0022] Attributes: Attributes are specific markers of an entity. They can represent what the entity owns or the relationship between the entity and other entities.
[0023] According to one aspect of the embodiments of this application, a method embodiment for constructing a music knowledge graph is provided.
[0024] Optionally, in this embodiment, the above-described music knowledge graph construction method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal 101 and server 103. Figure 1As shown, server 103 is connected to terminal 101 via a network and can be used to provide music knowledge graph construction services for the terminal or clients installed on the terminal. Database 105 can be set up on the server or independently of the server to provide data storage services for server 103. The aforementioned network includes, but is not limited to, wide area networks (WANs), metropolitan area networks (MANs), or local area networks (LANs). Terminal 101 is not limited to PCs, mobile phones, tablets, etc. The music knowledge graph construction method of this application embodiment can be executed by server 103, by terminal 101, or by both server 103 and terminal 101. Specifically, the execution of the music knowledge graph construction method of this application embodiment by terminal 101 can also be executed by a client installed on it. The following description uses the execution of a music knowledge graph construction method of this application embodiment on a server as an example.
[0025] Figure 2 This is a flowchart of an optional music knowledge graph construction method according to an embodiment of this application, such as... Figure 2 As shown, the method may include the following steps:
[0026] Step S104: According to the target scene corresponding to the target air conditioner type, obtain the target music attribute of the target music, where the target music is the music of the air conditioner type to be associated, and the target air conditioner type is the air conditioner type to be determined whether it matches the target music.
[0027] Step S106: Determine the target matching result based on the target music attributes, wherein the target matching result is used to indicate whether the target air conditioner type matches the target music;
[0028] Step S108: Based on the target matching results, associate the target music with the air conditioning type to obtain the music knowledge graph.
[0029] Through steps S104 to S108, the music attributes that need to be considered for the target scenario corresponding to the target air conditioner type are obtained, determining whether the music matches the target air conditioner type. Based on the matching result, the music is associated with the air conditioner type, resulting in a music knowledge graph. Different air conditioner types have different usage scenarios. In the music knowledge graph, the music is associated with the air conditioner type, indicating the usage scenario to which the music is suitable. This allows music recommendations based on the music knowledge graph to be adapted to the air conditioner's usage scenario, providing users with more accurate music recommendation services. This solves the technical problem in related technologies where directly using general music resources for music recommendations cannot recommend music suitable for different air conditioner usage scenarios.
[0030] In the technical solution provided in step S104, the server obtains the target music attribute of the target music according to the target scene corresponding to the target air conditioner type.
[0031] Musical attributes can include emotional attributes, lyrical attributes, style attributes, playlist attributes, time attributes, artist attributes, and chart attributes. Among these, emotional attributes refer to the emotional type of the music; lyrical attributes are the lyrics; style attributes are the musical genre; playlist attributes are the playlist names; time attributes are the release dates; artist attributes are the artist names; and chart attributes are the charts on which the music appears. The number of musical attributes a piece of music can possess is not limited to the examples listed above and can be more or less.
[0032] Different music attributes need to be analyzed for different air conditioning usage scenarios to determine whether the music is suitable for those scenarios. The target scenario corresponding to the target air conditioning type is the usage scenario of that type of air conditioner.
[0033] The target air conditioning type is used to provide music playback functionality in the target scenario.
[0034] The target music can be any music of the air conditioning type to be associated in the music library.
[0035] Music attributes can include emotional attributes, lyric attributes, style attributes, playlist attributes, time attributes, artist attributes, and chart attributes. Among these, emotional attributes describe the emotional type of the music; lyric attributes describe the lyrics; style attributes describe the music's genre; playlist attributes describe the name of the playlist to which the music is located; time attributes describe the release date; artist attributes describe the artist's name; and chart attributes describe the charts on which the music appears. The types of music attributes are not limited to the examples above and can be more or less.
[0036] In different air conditioning usage scenarios, users have different music playback needs. To determine whether the music matches the air conditioning type, there are different judgment criteria for different air conditioning types. Therefore, it is necessary to explore the music playback needs of different scenarios, determine which music attributes need to be extracted as judgment criteria according to the music playback needs, and then determine the music attributes corresponding to the target scenario according to the target air conditioning type. According to the music attributes corresponding to the target scenario, the target music attributes of the target music are obtained. For example, if the target scenario is a meeting scenario, the music attributes corresponding to the target scenario are emotional attributes and style attributes. Then, the target emotional attributes and target style attributes of the target music are obtained. The target music attributes include target emotional attributes and target style attributes. The target emotional attribute is the emotional attribute of the target music, and the target style attribute is the style attribute of the target music. For example: (1) The target air conditioning type corresponds to a meeting scenario. The music playback needs of users in the meeting scenario are usually: the music should not be too noisy, and the music should not be too negative. Whether the music is noisy or the emotion is negative can be judged according to the music style attributes and emotional attributes respectively. Therefore, in the case of a meeting scenario, the target music attributes can be the target style attributes and the target emotional attributes. (2) The target air conditioner type corresponds to the rest scenario. The music playback needs of users in the rest scenario are usually: quiet, soothing, and sleep-inducing music. Whether the music meets the playback needs of users in the rest scenario can be judged by the music playlist attributes. Based on the playlist name of the music, it can be determined whether the music is in the sleep playlist. Therefore, when the target scenario is the rest scenario, the target music attribute can be the target playlist attribute. (3) The target air conditioner type corresponds to the children's usage scenario. The music playback needs of users in the children's usage scenario are usually: positive and uplifting music. Whether the music meets the playback needs of users in the children's usage scenario can be judged by the emotional attributes and lyrics attributes of the music. Therefore, when the target scenario is the children's usage scenario, the target music attributes can be the target emotional attributes and the target lyrics attributes. (4) The target air conditioner type corresponds to the elderly's usage scenario. The music playback needs of users in the elderly's usage scenario are usually: classic music that matches the era in which the elderly grew up. Whether music meets the playback needs of elderly users can be determined based on the playlist attributes and time attributes of the music. Based on the playlist name, it can be determined whether the music is from a classic playlist or a nostalgic playlist. Based on the time attribute, it can be determined whether the release time of the music is within the time range that is consistent with the era in which the elderly grew up. Therefore, when the target scenario is the elderly user scenario, the target music attributes can be the target playlist attributes and the target time attributes.
[0037] There are several ways to obtain the target music attributes, including but not limited to the following: (1) obtaining them from the music database of the music platform; (2) obtaining them from existing general knowledge graphs; and (3) obtaining them from online music resources.
[0038] As an optional embodiment, step S104, obtaining the target music attribute of the target music according to the target scene corresponding to the target air conditioner type, may include the following steps:
[0039] Step S1041: If the target air conditioning type is the first air conditioning type corresponding to the meeting scene, obtain the target emotional attribute and target style attribute of the target music, wherein the target music attribute includes the target emotional attribute and the target style attribute.
[0040] Optionally, in this embodiment, step S106, determining the target matching result based on the target music attributes, may include the following steps:
[0041] Step S1061: When the first preset requirement is met, the target matching result is determined to be that the first air conditioning type does not match the target music. The first preset requirement is that the target emotional attribute indicates that the emotional type of the target music is negative, or the target style attribute indicates that the music style of the target music is noisy.
[0042] The first type of air conditioner mentioned above is the type of air conditioner corresponding to the meeting scene. The first type of air conditioner is the air conditioner that is usually used in the meeting scene. There is no limit to the way of classifying the air conditioner type. The first type of air conditioner can also include multiple types of air conditioners. For example, (1) the air conditioner type is divided into cabinet air conditioner, wall-mounted air conditioner, etc. If the cabinet air conditioner is usually installed in the meeting room or living room and used in the meeting scene, then the first type of air conditioner can be the cabinet air conditioner type; (2) the air conditioner type can also be divided into living room air conditioner, bedroom air conditioner, meeting room air conditioner, bathroom air conditioner, etc. Among them, living room air conditioner and meeting room air conditioner are often used in the meeting scene, so the first type of air conditioner can also be the living room air conditioner type and the meeting room air conditioner type.
[0043] As an optional embodiment, step S104, obtaining the target music attribute of the target music according to the target scene corresponding to the target air conditioner type, may include the following steps:
[0044] Step S1042: When the target air conditioner type is the second air conditioner type corresponding to the rest scene, obtain the target playlist attribute of the target music, wherein the target music attribute includes the target playlist attribute, which is used to indicate the playlist name of the playlist where the target music is located.
[0045] Optionally, in this embodiment, step S106, determining the target matching result based on the target music attributes, may include the following steps:
[0046] Step S1062: When the target playlist attribute indicates that the playlist name of the playlist containing the target music contains preset keywords, the target matching result is determined to be a match between the second air conditioning type and the target music. The preset keywords include words related to the rest scene.
[0047] The second type of air conditioner mentioned above is the type of air conditioner corresponding to the resting scenario. The air conditioner of the second type of air conditioner is the type of air conditioner that is usually used in the resting scenario. There is no limit to the way the air conditioner type is classified. The second type of air conditioner can also include multiple types of air conditioners. For example, the second type of air conditioner can be a wall-mounted air conditioner or a bedroom air conditioner.
[0048] As an optional embodiment, step S104, obtaining the target music attribute of the target music according to the target scene corresponding to the target air conditioner type, may include the following steps:
[0049] Step S1043: When the target air conditioner type is the third type of air conditioner corresponding to the child's usage scenario, obtain the target emotional attribute and target lyric attribute of the target music, wherein the target music attribute includes the target emotional attribute and the target lyric attribute.
[0050] Optionally, in this embodiment, step S106, determining the target matching result based on the target music attributes, may include the following steps:
[0051] Step S1063: When the second preset requirement is met, the target matching result is determined to be that the third air conditioning type does not match the target music. The second preset requirement is: the target emotional attribute indicates that the emotional type of the target music is negative, or the target lyrics attribute indicates that the lyrics of the target music contain preset negative words.
[0052] The aforementioned third type of air conditioner is the type of air conditioner corresponding to children's usage scenarios. The third type of air conditioner is the type of air conditioner that is usually used in children's usage scenarios. The users in children's usage scenarios are usually children. There is no limit to the way the air conditioner type is classified. The third type of air conditioner can also include multiple types of air conditioners. For example, the third type of air conditioner can be a children's air conditioner type or a children's room air conditioner type.
[0053] As an optional embodiment, step S104, obtaining the target music attribute of the target music according to the target scene corresponding to the target air conditioner type, may include the following steps:
[0054] Step S1044: If the target air conditioner type is the fourth type of air conditioner corresponding to the elderly's usage scenario, obtain the target playlist attribute and target time attribute of the target music. The target music attribute includes the target playlist attribute and the target time attribute. The target playlist attribute is used to indicate the playlist name of the playlist in which the target music is located, and the target time attribute is used to indicate the release time of the target music.
[0055] Optionally, in this embodiment, step S106, determining the target matching result based on the target music attributes, may include the following steps:
[0056] Step S1064: When the third preset requirement is met, the target matching result is determined to be that the fourth air conditioning type matches the target music. The third preset requirement is: the target playlist attribute indicates that the playlist name of the playlist containing the target music contains the specified keyword, or the target time attribute indicates that the release time of the target music is within the preset time range.
[0057] The fourth type of air conditioner mentioned above is the type of air conditioner that corresponds to the usage scenario of the elderly. The air conditioner of the fourth type is the type of air conditioner that is usually used in the usage scenario of the elderly. The users in the usage scenario of the elderly are usually elderly people. There is no limit to the way the air conditioner type is classified. The fourth type of air conditioner can also include multiple air conditioner types. For example, the third type of air conditioner can be the type of air conditioner for the elderly or the type of air conditioner for the elderly's room.
[0058] As an optional embodiment, step S108, associating the target music with the air conditioner type according to the target matching result to obtain a music knowledge graph, may include the following steps:
[0059] Step S1081: According to each target matching result, associate the specified target air conditioner type among all target air conditioner types with the target music to obtain a music knowledge graph, wherein the specified target air conditioner type is the air conditioner type that matches the target music.
[0060] As an optional embodiment, after obtaining the music knowledge graph by associating the target music with the air conditioning type according to the target matching result in step S108, the method may further include the following steps:
[0061] Step S1091: Obtain the target voice command, wherein the target voice command is used to request the specified air conditioner to play music;
[0062] Step S1092: Perform semantic analysis on the target speech command to obtain the semantic analysis results;
[0063] Step S1093: If the semantic analysis result does not contain a music name, determine the music to be played for the specified air conditioner from the preset music in the music knowledge graph according to the specified air conditioner type to which the specified air conditioner belongs. The specified air conditioner type is included among all air conditioner types associated with the preset music. The music knowledge graph is constructed according to the music knowledge graph construction method in the aforementioned steps.
[0064] Step S1094 instructs the specified music player to play the music to be played, wherein the specified music player is the music player associated with the specified air conditioner.
[0065] The process of semantic analysis of target speech commands described above can be achieved using technologies such as Automatic Speech Recognition (ASR) and Natural Language Processing (NLP). The semantic analysis results are used to represent the meaning of the target speech command as understood after analysis.
[0066] Whether the semantic analysis result contains a music name refers to whether a specific music name can be obtained after semantic analysis of the voice command.
[0067] For example, if the semantic analysis result is "Request to play music", it means that the semantic analysis result does not contain the music name. On the other hand, if the semantic analysis result is "Request to play 'Ode to Joy'", it means that the semantic analysis result contains the music name "Ode to Joy".
[0068] The music knowledge graph constructed in this application can be built from scratch, or it can be further constructed based on an existing knowledge graph (such as a general knowledge graph, which includes music and music attributes). As an optional embodiment, step S104, obtaining the target music attributes of the target music according to the target scene corresponding to the target air conditioner type, may include the following steps:
[0069] Step S202: Obtain all candidate music attributes of the target music in the general knowledge graph, wherein the target music is the music of the air conditioner type to be associated in the general knowledge graph;
[0070] Step S204: According to the target scene corresponding to the target air conditioner type among all air conditioner types, extract the target music attribute from all candidate music attributes of the target music. The target air conditioner type is the air conditioner type that is to be determined whether it matches the target music. The air conditioner of the target air conditioner type is used to provide music playback function in the target scene.
[0071] Optionally, in this embodiment, step S108, associating the target music with the air conditioner type according to the target matching result to obtain a music knowledge graph, may include the following steps:
[0072] Step S208: Based on the target matching results, associate the target music with the air conditioning type in the general knowledge graph to obtain the music knowledge graph.
[0073] Through steps S202 to S204 and S208, the music is matched with each air conditioner type based on its musical attributes in the general knowledge graph and the corresponding usage scenarios. The matching results are then used to associate the music with the air conditioner type in the general knowledge graph. This allows music recommendations based on the music knowledge graph to be adapted to the air conditioner's usage scenarios, providing users with more accurate music recommendations. This solves the technical problem in related technologies where the general knowledge graph cannot provide music recommendations tailored to different air conditioner usage scenarios.
[0074] In the technical solution provided in step S202, the server obtains all candidate music attributes of the target music in the general knowledge graph. The target music is the music of the air conditioner type to be associated in the general knowledge graph, and the air conditioner type associated with the music is used to indicate the type of air conditioner to which the music is applicable.
[0075] The aforementioned general knowledge graph refers to a knowledge graph that includes music and its attributes such as music title, artist, and lyrics, and can be used for applications such as music knowledge Q&A, music search and recommendation, and music Q&A services. Music attributes in the general knowledge graph can include sentiment attributes, lyric attributes, style attributes, playlist attributes, time attributes, artist attributes, and chart attributes. Specifically, the sentiment attribute is the emotional type of the music, the lyric attribute is the text of the lyrics, the style attribute is the music's genre, the playlist attribute is the name of the playlist to which the music appears, the time attribute is the release date of the music, the artist attribute is the artist's name, and the chart attribute is the name of the chart to which the music appears. The music attributes included in the general knowledge graph are not limited to the examples above and can be more or fewer.
[0076] The aforementioned candidate music attributes are those used to construct the music knowledge graph from all the music attributes of the target music in the general knowledge graph. All candidate music attributes can be all the music attributes of the target music in the general knowledge graph, or only a portion of the music attributes of the target music in the general knowledge graph. Candidate music attributes can be attributes related to scenario requirements, such as emotion attributes, lyrics attributes, style attributes, playlist attributes, and time attributes.
[0077] The target music mentioned above can be any music of the air conditioner type to be associated in the general knowledge graph.
[0078] Optionally, in this embodiment, different air conditioner types correspond to different usage scenarios, and the air conditioner type associated with the music is used to indicate that the music can be played in the usage scenario of the air conditioner of that type.
[0079] For example, if music A is associated with air conditioner type A, it means that music A can be played in the usage scenario of air conditioner type A.
[0080] In the technical solution provided in step S204, the server extracts the target music attribute from all candidate music attributes of the target music according to the target scene corresponding to the target air conditioner type among all air conditioner types. The target air conditioner type is the air conditioner type that is to be determined whether it matches the target music. The air conditioner of the target air conditioner type is used to provide music playback function in the target scene.
[0081] Different types of air conditioners have different usage scenarios. For example, floor-standing air conditioners are usually installed in the living room, so they are suitable for entertaining guests. Wall-mounted air conditioners are usually installed in the bedroom, so they are suitable for resting. Similarly, children's air conditioners are usually installed in children's rooms, so they are suitable for children. Elderly air conditioners are usually installed in elderly people's rooms, so they are suitable for elderly people.
[0082] The target air conditioner type mentioned above can be any air conditioner type among all air conditioner types that needs to be determined to match the target music.
[0083] In different air conditioning usage scenarios, users have different music playback needs. Determining whether music matches the air conditioning type requires different criteria for different air conditioning types. Therefore, it's necessary to explore the music playback needs of different scenarios, determine which music attributes need to be extracted as the basis for judgment based on these needs, and then extract the target music attribute from all candidate music attributes for the target air conditioning type within the target scenario. The target music attribute is the music attribute among all candidate music attributes that is related to the user's music playback needs in the target scenario.
[0084] For example: (1) The target air conditioner type corresponds to the meeting scene. The music playback requirements of users in the meeting scene are usually: the music should not be too noisy and the emotion of the music should not be too negative. Whether the music is noisy or the emotion is negative can be judged according to the style attribute and emotion attribute of the music, respectively. So, when the target scene is the meeting scene, the target music attribute can be the target style attribute and the target emotion attribute. (2) The target air conditioner type corresponds to the rest scene. The music playback requirements of users in the rest scene are usually: quiet, soothing, and sleep-inducing music. Whether the music meets the playback requirements of users in the rest scene can be judged according to the playlist attribute of the music. According to the playlist name of the music, it can be determined whether the music is in the sleep playlist. So, when the target scene is the rest scene, the target music attribute can be the target playlist attribute. (3) The target air conditioner type corresponds to the children's use scene. The music playback requirements of users in the children's use scene are usually: positive and uplifting music. Whether the music meets the playback requirements of users in the children's use scene can be judged according to the emotion attribute and lyrics attribute of the music. So, when the target scene is the children's use scene, the target music attribute can be the target emotion attribute and the target lyrics attribute. (4) The target air conditioner type corresponds to the elderly user scenario. The music playback needs of users in the elderly user scenario are usually: classic music that matches the era in which the elderly grew up. Whether the music meets the playback needs of users in the elderly user scenario can be judged based on the playlist attribute and time attribute of the music. Based on the playlist name of the music, it can be determined whether the music is in the classic playlist or the memory playlist. Based on the time attribute, it can be determined whether the release time of the music is within the time range that matches the era in which the elderly grew up. Therefore, when the target scenario is the elderly user scenario, the target music attribute can be the target playlist attribute and the target time attribute.
[0085] In the technical solution provided in step S106, the server determines the target matching result based on the target music attributes, wherein the target matching result is used to indicate whether the target air conditioner type matches the target music.
[0086] Based on the target music attributes, it can be determined whether the target music meets the user's music playback needs in the target scenario, thereby determining whether the target air conditioner type matches the target music.
[0087] For example: (1) If the target air conditioner type corresponds to a meeting scene, and the target style attribute indicates that the music style of the target music is a noisy music style (noisy music styles can include: electronic music, rock music, metal music, rap music, etc., which are noisy and not suitable for playing in a meeting scene), or the target emotion attribute indicates that the emotion type of the target music is a negative emotion type (negative emotion types can include: anger, sadness, etc.), then the target matching result is that the target air conditioner type does not match the target music. (2) If the target air conditioner type corresponds to a rest scene, and the target playlist attribute indicates that at least one playlist name of the playlist containing the target music contains a preset keyword (preset keywords can be: "sleep", "rest", "quiet", "soothing", etc.), then the target matching result is that the target air conditioner type matches the target music. (3) If the target air conditioner type corresponds to a child use scene, and the target emotion attribute indicates that the emotion type of the target music is a negative emotion type (negative emotion types can include: anger, sadness, etc.), or the target lyrics attribute indicates that the lyrics of the target music contain preset negative words (preset negative words can include: "pain", "degradation", etc.), then the target matching result is that the target air conditioner type does not match the target music. (4) The target air conditioner type corresponds to the elderly usage scenario. If the target playlist attribute indicates that at least one playlist name of the playlist containing the target music contains a specified keyword (the specified keyword can be words such as "remembering classics" or "90s"), or the target time attribute indicates that the release time of the target music is within a preset time range (e.g., the preset time range is from 1980 to 2010), then the target matching result is that the target air conditioner type matches the target music.
[0088] Optionally, in addition to including information indicating whether the target air conditioner type matches the target music, the target matching result may further include the degree of matching. For example, the degree of matching may be divided into 6 levels: Level 1 indicates a fairly good match, Level 2 indicates a very good match, Level 3 indicates a moderate match, Level 4 indicates a moderate mismatch, Level 5 indicates a very poor match, and Level 6 indicates a fairly poor match.
[0089] In the technical solution provided in step S108, the server associates the target music with the air conditioning type according to the target matching result, and obtains a music knowledge graph.
[0090] There are several ways to associate air conditioning types with target music: (1) Use the air conditioning type that matches the target music as the air conditioning type of the target music, and do not use the air conditioning type that does not match the target music as the air conditioning type of the target music. (2) Use the air conditioning type that matches the target music as the first air conditioning type of the target music, and use the air conditioning type that does not match the target music as the second air conditioning type of the target music. For example, if air conditioning type 01 matches the target music and air conditioning type 02 does not match the target music, use the letter Y to identify the first air conditioning type and use the letter N to identify the second air conditioning type, then the air conditioning types of the target music include: Y air conditioning type 01 and N air conditioning type 02. (3) The matching result includes the degree of matching. Based on the degree of matching, different level labels are determined for the air conditioning type of the target music. For example, the degree of matching for air conditioning type 01 is level 1, the degree of matching for air conditioning type 02 is level 2, and the degree of matching for air conditioning type 03 is level 3. The degree of matching for air conditioning type is indicated by the letter A as level 1, by the letter B as level 2, and by the letter C as level 3. Then the air conditioning types of the target music include: A air conditioning type 01, B air conditioning type 02, and C air conditioning type 03.
[0091] After matching all air conditioner types, one or more air conditioner types can be associated with the target music, thus completing the association of the target music with air conditioner types and obtaining a complete and highly versatile music knowledge graph. Music recommendations based on this music knowledge graph can then be adapted to different air conditioner usage scenarios.
[0092] In the technical solution provided in step S208, the server associates the target music with the air conditioning type in the general knowledge graph according to the target matching result, thereby obtaining the music knowledge graph.
[0093] There are several ways to associate air conditioner types with target music in a general knowledge graph: (1) Use the air conditioner type that matches the target music as the air conditioner type of the target music, and do not use the air conditioner type that does not match the target music as the air conditioner type of the target music. (2) Use the air conditioner type that matches the target music as the first air conditioner type of the target music, and use the air conditioner type that does not match the target music as the second air conditioner type of the target music. For example, if air conditioner type 01 matches the target music and air conditioner type 02 does not match the target music, use the letter Y to identify the first air conditioner type and use the letter N to identify the second air conditioner type, then the air conditioner types of the target music include: Y air conditioner type 01 and N air conditioner type 02. (3) The matching result includes the degree of matching. Based on the degree of matching, different level labels are determined for the air conditioning type of the target music. For example, the degree of matching for air conditioning type 01 is level 1, the degree of matching for air conditioning type 02 is level 2, and the degree of matching for air conditioning type 03 is level 3. The degree of matching for air conditioning type is indicated by the letter A as level 1, by the letter B as level 2, and by the letter C as level 3. Then the air conditioning types of the target music include: A air conditioning type 01, B air conditioning type 02, and C air conditioning type 03.
[0094] After matching all air conditioning types, one or more air conditioning types associated with the target music can be obtained, thus completing the association of the target music with the air conditioning type.
[0095] After associating all music in the general knowledge graph with air conditioning types, a complete and highly versatile music knowledge graph can be obtained. Music recommendations based on this knowledge graph can then be adapted to different air conditioning usage scenarios.
[0096] As an optional embodiment, step S204, extracting the target music attribute from all candidate music attributes of the target music according to the target scene corresponding to the target air conditioner type among all air conditioner types, may further include the following steps:
[0097] Step S41: When the target air conditioning type is the first air conditioning type corresponding to the meeting scene, extract the target emotional attribute and target style attribute of the target music from all candidate music attributes. The target music attribute includes the target emotional attribute and the target style attribute.
[0098] Step S42: If the target air conditioner type is the second air conditioner type corresponding to the rest scene, extract the target playlist attribute from all candidate music attributes of the target music. The target music attribute includes the target playlist attribute, which is used to indicate the playlist name of the playlist where the target music is located.
[0099] Step S43: If the target air conditioner type is the third air conditioner type corresponding to the child's usage scenario, extract the target emotional attribute and target lyrics attribute of the target music from all candidate music attributes, wherein the target music attribute includes the target emotional attribute and the target lyrics attribute;
[0100] Step S44: If the target air conditioner type is the fourth air conditioner type corresponding to the elderly user scenario, extract the target playlist attribute and target time attribute of the target music from all candidate music attributes. The target music attribute includes the target playlist attribute and the target time attribute. The target playlist attribute is used to indicate the playlist name of the playlist in which the target music is located, and the target time attribute is used to indicate the release time of the target music.
[0101] There are many ways to classify air conditioners. For example, according to the model, they can be divided into cabinet air conditioners, wall-mounted air conditioners, etc. According to the target audience, they can be divided into children's air conditioners, elderly air conditioners, etc. According to the installation scene, they can be divided into bedroom air conditioners, living room air conditioners, etc.
[0102] The first type of air conditioner is for the purpose of entertaining guests; it can be a floor-standing unit or a living room unit. The second type of air conditioner is for the purpose of resting; it can be a wall-mounted unit or a bedroom unit. The third type of air conditioner is for the purpose of children's use; it can be a children's unit or a children's room unit. The fourth type of air conditioner is for the purpose of elderly people's use; it can be an air conditioner for seniors or an air conditioner for seniors' rooms.
[0103] Different types of air conditioners can correspond to different usage scenarios. The music playback requirements under different air conditioner usage scenarios can be determined according to the actual situation. Steps S41 to S44 of this application are only one implementation method. In practice, more complex music playback requirements can be customized for each usage scenario, so as to select a larger number of target music attributes from all candidate music attributes as the basis for judgment, to determine whether the target music matches the music playback requirements of the target scenario, and thus determine whether the target air conditioner type corresponding to the target scenario matches the target music.
[0104] Optionally, in this embodiment, step S106, determining the target matching result based on the target music attributes, may further include the following steps:
[0105] Step S61: When the target air conditioner type is the first air conditioner type, when the first preset requirement is met, the target matching result is determined to be that the first air conditioner type does not match the target music. The first preset requirement is that the target emotional attribute indicates that the emotional type of the target music is negative, or the target style attribute indicates that the music style of the target music is noisy.
[0106] Step S62: When the target air conditioner type is the second air conditioner type, when the target playlist attribute indicates that the playlist name of the playlist containing the target music contains preset keywords, the target matching result is determined to be a match between the second air conditioner type and the target music. The preset keywords include words related to the rest scene.
[0107] Step S63: When the target air conditioner type is the third air conditioner type, if the second preset requirement is met, the target matching result is determined to be that the third air conditioner type does not match the target music. The second preset requirement is: the target emotional attribute indicates that the emotional type of the target music is a negative emotional type, or the target lyrics attribute indicates that the lyrics text of the target music contains preset negative words.
[0108] Step S64: When the target air conditioner type is the fourth air conditioner type, and the third preset requirement is met, the target matching result is determined to be that the fourth air conditioner type matches the target music. The third preset requirement is: the target playlist attribute indicates that the playlist name of the playlist containing the target music contains the specified keyword, or the target time attribute indicates that the release time of the target music is within the preset time range.
[0109] If the target air conditioning type is the first type, corresponding to a meeting scenario, and the target style attribute indicates that the target music's style is a noisy style (noisy music styles can include electronic music, rock music, metal music, rap music, etc., which are usually quite noisy), or the target emotion attribute indicates that the target music's emotion type is a negative emotion type (negative emotion types can include anger, sadness, etc.), then the target matching result is that the target air conditioning type does not match the target music. If the target style attribute indicates that the target music's style is not a noisy style, and the target emotion attribute indicates that the target music's emotion type is not a negative emotion type, then the target matching result is that the target air conditioning type matches the target music.
[0110] If the target air conditioner type is the second type, which corresponds to the rest scenario, and if the target playlist attribute indicates that the playlist name of the playlist containing the target music contains preset keywords (the preset keywords can be words such as "sleep", "rest", "quiet", "soothing"), then the target matching result is that the target air conditioner type matches the target music.
[0111] Optionally, in this embodiment, the target music may be included in one or more playlists. The target playlist attribute of the target music may contain multiple playlist names. If at least one playlist name contains a preset keyword, the target matching result is determined to be a match between the target air conditioner type and the target music. If the target playlist attribute indicates that none of the playlists containing the target music have a playlist name containing the preset keyword, the target matching result is determined to be a mismatch between the target air conditioner type and the target music.
[0112] If the target air conditioner type is the third type, which corresponds to a child's usage scenario, and the target emotional attribute indicates that the target music's emotional type is negative (negative emotional types can include anger, sadness, etc.), or the target lyrics attribute indicates that the lyrics of the target music contain preset negative words (preset negative words can include "pain," "degradation," etc.), then the target matching result is that the target air conditioner type does not match the target music. If the target emotional attribute indicates that the target music's emotional type is not a negative emotional type, and the target lyrics attribute indicates that the lyrics do not contain preset negative words, then the target matching result is that the target air conditioner type matches the target music.
[0113] Optionally, in this embodiment, negative emotion types may include more emotion types than those exemplified above.
[0114] Optionally, in this embodiment, a preset negative vocabulary library can be established before step S204. The preset negative vocabulary library may include words that express negative emotions, vulgarity, violence, etc.
[0115] If the target air conditioner type is the fourth type, which corresponds to the elderly user scenario, and if the target playlist attribute indicates that the playlist name of the target music contains a specified keyword (the specified keyword can be words such as "remembering classics" or "the 90s"), or if the target time attribute indicates that the release time of the target music is within a preset time range (e.g., the preset time range is from 1980 to 2010), then the target matching result is that the target air conditioner type matches the target music.
[0116] Optionally, in this embodiment, the target music may be included in one or more playlists. The target playlist attribute of the target music may include one or more playlist names. If at least one playlist name contains a preset keyword, the target matching result is determined to be that the target air conditioner type matches the target music.
[0117] If the target playlist attribute indicates that there is no playlist whose name contains the specified keyword among all playlists containing the target music, and the release time indicated by the target time attribute is not within the preset time range, then the target matching result is that the target air conditioner type does not match the target music.
[0118] As an optional embodiment, step S208, which involves associating the target music with an air conditioner type in the general knowledge graph according to the target matching result to obtain a music knowledge graph, may further include the following steps:
[0119] Step S81: If the target air conditioner type matches the target music, the target air conditioner type is used as the air conditioner type of the target music in the general knowledge graph to obtain the music knowledge graph.
[0120] As an optional embodiment, after obtaining the music knowledge graph, the method further includes recommending music according to the steps described below:
[0121] Step S91: Obtain the target voice command, wherein the target voice command is used to request the specified air conditioner to play music;
[0122] Step S92: Perform semantic analysis on the target speech command to obtain the semantic analysis results;
[0123] Step S93: Based on the semantic analysis results, determine the music to be played for the specified air conditioner from the music knowledge graph.
[0124] The aforementioned air conditioner is a voice-activated air conditioner that can play music based on the user's voice commands.
[0125] Optionally, in this embodiment, the designated air conditioner can receive the target voice command issued by the user through its own intelligent voice module or a smart device connected to it, and transmit the target voice command to the server. After the server obtains the target voice command, it identifies the intent of the voice command issued by the user and performs subsequent operations according to the intent indicated by the voice command.
[0126] Optionally, in this embodiment, step S93, determining the music to be played for the specified air conditioner from the music knowledge graph according to the semantic analysis results, may further include the following steps:
[0127] Step S931: If the semantic analysis result does not contain a music name, determine the music to be played for the specified air conditioner from the preset music in the music knowledge graph according to the specified air conditioner type to which the specified air conditioner belongs. The specified air conditioner type is included among all air conditioner types associated with the preset music.
[0128] Step S932: If the semantic analysis result includes the specified music name, search the music knowledge graph for the specified music name and the air conditioner type of the specified music. If the air conditioner type of the specified music does not include the specified air conditioner type to which the specified air conditioner belongs, issue a preset prompt message, wherein the preset prompt message is used to indicate that the specified music is not suitable for the specified air conditioner. If the air conditioner type of the specified music includes the specified air conditioner type, use the specified music as the music to be played on the specified air conditioner.
[0129] If the user's voice command is a vague music playback instruction, such as "play music" or "play a song," semantic analysis of the voice command will not yield a specific music name. In this case, one or more suitable songs from the music knowledge graph must be identified as the music to be played on the designated air conditioner. If the user's voice command is a specific music playback instruction, such as "I want to listen to 'Good Luck,'" semantic analysis will yield a specific music name. The music knowledge graph can then be used to determine if the music corresponding to that name is suitable for the current air conditioner usage scenario. If it is suitable, the music with that name is selected as the music to be played on the designated air conditioner. If it is not suitable, a prompt is issued to the user indicating that the music is not appropriate for the current usage scenario, and the user is asked if they still wish to play it. If the user confirms the playback instruction, that music is selected as the music to be played on the designated air conditioner.
[0130] Optionally, in this embodiment, if no user confirmation playback instruction is obtained within a preset time period, one or more songs suitable for the current air conditioner usage scenario are determined from the music knowledge graph and used as the designated music to be played on the air conditioner.
[0131] Optionally, in this embodiment, after determining the music to be played for the specified air conditioner from the music knowledge graph according to the semantic analysis results in step S93, the method further includes the following steps:
[0132] Step S94: Generate a music playback command based on the music to be played on the specified air conditioner;
[0133] Step S95: Send the music playback command to the designated music player, wherein the designated music player is used to play the music to be played for the designated air conditioner.
[0134] The specified music player can be the music playback module of the specified air conditioner itself, or it can be a music playback device connected to the specified air conditioner.
[0135] When there are multiple songs to be played, the specified music player can play the songs in a preset order or play them randomly.
[0136] Through the above steps S91 to S95 and S931 to S932, decisions can be made based on different user voice commands according to the music knowledge graph, and the music to be played on the specified air conditioner can be determined so that the music playback module of the specified air conditioner or the music playback device connected to the specified air conditioner can play the music to be played, thereby meeting the user's needs, adapting to the scenario, and improving the user experience.
[0137] As an optional embodiment, the technical solution of this application is illustrated below with reference to specific embodiments:
[0138] Many smart home devices, such as voice-controlled air conditioners, currently have music playback capabilities. Typically, the music playback process involves: first, recognizing the user's voice command, and then directly using the recognized text to request a third-party music API. This presents a problem: the device is designed for specific users and environments within the home, and directly using general music resources can be incompatible. Therefore, it is necessary to construct a music knowledge graph specifically for voice-controlled air conditioners.
[0139] (I) Exploring the Music Playback Needs of Different Voice-Controlled Air Conditioners
[0140] Based on air conditioner type, voice-activated air conditioners can be divided into floor-standing and wall-mounted units; based on user group, they can be divided into general air conditioners, children's air conditioners, and air conditioners for the elderly. The music playback requirements of different devices are shown in the table below:
[0141]
[0142] (ii) Transforming equipment requirements into a music knowledge graph
[0143] The general knowledge graph mainly includes song information (song title, lyrics, release date, play count, music genre, music style, etc.), artist information, album information, playlist information, and chart information. The music knowledge graph for the voice-activated air conditioning field (i.e., the music knowledge graph in this application) can be constructed based on existing general knowledge graphs, assigning device tags to different songs based on existing content. The following describes how to tag music according to the needs of different voice-activated air conditioners. A song can have multiple tags, so the tagging process is actually a process of multiple binary classifications. The specific process is as follows: Figure 3 As shown, the specific classification method is as follows:
[0144] 1. Floor-standing air conditioner
[0145] First, we need to analyze the emotional polarity of the lyrics. We can use common text classification methods, such as LSTM (Long Short-Term Memory), TextCNN (Text Convolutional Network), or BERT model. If the lyrics are emotionally negative, they should be labeled as "air conditioner". Second, we can analyze the audio of the music. If the music is too noisy, it should not be labeled as "air conditioner". We can also judge based on the music style. For example, music styles such as rock, electronic, rap, and metal are not suitable for living room playback.
[0146] 2. Wall-mounted air conditioner
[0147] The music recommendations for wall-mounted air conditioners primarily consider the sleep period. This can be achieved by tagging music playlists based on their attributes, such as sleep music playlists shared by many people. This requires us to first identify keywords in the playlist names to determine if they are indeed sleep music playlists.
[0148] 3. Children's air conditioner
[0149] A dictionary of negative words was created, and lyrics were traversed. Songs containing negative words were filtered out. Simultaneously, sentiment polarity analysis of the text was performed to filter out music with negative sentiment. Music without negative words and with positive sentiment was labeled as "children's air conditioner."
[0150] 4. Air conditioning for the elderly
[0151] Music tags for senior-friendly air conditioners can be assigned based on the release date of the music and playlist information. For example, songs with keywords such as "classic" or "memory playlist" in their playlist titles can be tagged as "senior-friendly air conditioner."
[0152] By exploring the different music resource needs of various voice-activated air conditioners, and constructing a music knowledge graph that considers the music playback requirements of different devices, the system can translate these device needs into the music knowledge graph. This allows for more precise music recommendations when users express vague music playback intentions. If the user's expressed music request is not a specific song, such as "I want to listen to music," a suitable song can be selected and recommended. If the user specifies the name of the song they want to listen to, the system can first determine if it is suitable for the current device. If it is, the song will be played; otherwise, the user will be reminded. For example, if a user requests a song that is not suitable for children on a children's air conditioner, the system can provide a voice prompt and recommend another song, and play it again if the user confirms.
[0153] This solution refines the music playback needs of different types of voice-activated air conditioners and then stores these needs in a knowledge graph. When a user expresses a vague music playback intention, more accurate music recommendations can be made.
[0154] According to another aspect of the embodiments of this application, an air conditioner music playback method is also provided, which may include the following steps:
[0155] Step S302: Obtain the target voice command, wherein the target voice command is used to request the specified air conditioner to play music;
[0156] Step S304: Perform semantic analysis on the target speech command to obtain the semantic analysis results;
[0157] Step S306: If the semantic analysis result does not contain a music name, determine the music to be played for the specified air conditioner from the preset music in the music knowledge graph according to the specified air conditioner type to which the specified air conditioner belongs. The specified air conditioner type is included among all air conditioner types associated with the preset music. The music knowledge graph is constructed according to the above music knowledge graph construction method.
[0158] Step S308 instructs a specified music player to play the music to be played, wherein the specified music player is the music player associated with the specified air conditioner.
[0159] Through steps S302 to S308 above, by determining the music attributes of the music in the general knowledge graph and the specified air conditioner type, music that can be played is suitable for the air conditioner's usage scenario, providing users with more accurate music recommendation services. This solves the technical problem in related technologies where directly using general music resources for music recommendation cannot recommend music suitable for different air conditioner usage scenarios.
[0160] Optionally, in this embodiment, the above-described air conditioner music playback method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal 101 and server 103. The air conditioner music playback method of this embodiment can be executed by server 103, terminal 101, or both. Alternatively, the air conditioner music playback method of this embodiment can be executed by a client installed on terminal 101. The following description uses an example of executing an air conditioner music playback method of this embodiment on a server.
[0161] In the technical solution provided in step S302, the server obtains the target voice command, wherein the target voice command is used to request the specified air conditioner to play music.
[0162] The aforementioned designated air conditioner is a voice-activated air conditioner that can play music via a music player associated with the air conditioner based on the user's voice commands.
[0163] The aforementioned air conditioner can receive target voice commands issued by users through its own intelligent voice module or intelligent devices that are connected to it, and transmit the target voice commands to the server.
[0164] In the technical solution provided in step S302, the server performs semantic analysis on the target voice command and obtains the semantic analysis result.
[0165] In the technical solution provided in step S306, if the semantic analysis result does not contain a music name, the server determines the music to be played for the specified air conditioner from the preset music in the music knowledge graph according to the specified air conditioner type to which the specified air conditioner belongs. The specified air conditioner type is included among all air conditioner types associated with the preset music. The music knowledge graph is constructed according to the above-mentioned music knowledge graph construction method.
[0166] If the user's voice command is a vague music playback command, such as "I want to listen to music" or "Play a song", then after semantic analysis of the voice command, a specific music name cannot be obtained. It is necessary to determine one or more songs suitable for the current air conditioner usage scenario from the music knowledge graph as the music to be played on the specified air conditioner.
[0167] Optionally, in this embodiment, after performing semantic analysis on the target voice command in step S304 and obtaining the semantic analysis result, before playing the music to be played in step S308, the above-mentioned air conditioner music playback method may further include the following steps:
[0168] Step S307: If the semantic analysis result includes the specified music name, search the music knowledge graph for the specified music name and the air conditioner type of the specified music. If the air conditioner type of the specified music does not include the specified air conditioner type to which the specified air conditioner belongs, issue a preset prompt message, wherein the preset prompt message is used to indicate that the specified music is not suitable for the specified air conditioner. If the air conditioner type of the specified music includes the specified air conditioner type, use the specified music as the music to be played on the specified air conditioner.
[0169] If the user's voice command is a specific music playback command, such as "I want to listen to 'Good Luck'", then semantic analysis of the voice command can yield a specific music name. Based on the music knowledge graph, it can be determined whether the music corresponding to that name is suitable for the current air conditioner usage scenario. If suitable, the music corresponding to that name is selected as the designated music to play on the specified air conditioner. If unsuitable, a prompt is issued to the user indicating that the music is not suitable for the current air conditioner usage scenario, and the user is asked whether they still want to play it. If the user confirms the playback command, then that music is selected as the designated music to play on the specified air conditioner.
[0170] Optionally, in this embodiment, if no user confirmation playback instruction is obtained within a preset time period, one or more songs suitable for the current air conditioner usage scenario are determined from the music knowledge graph and used as the designated music to be played on the air conditioner.
[0171] In the technical solution provided in step S308, the server instructs a designated music player to play the music to be played, wherein the designated music player is the music player associated with the designated air conditioner.
[0172] The specified music player can be the music playback module of the specified air conditioner itself, or it can be a music playback device connected to the specified air conditioner.
[0173] By using the methods described above, music can be adapted as closely as possible to the air conditioning usage scenario, satisfying both the scenario requirements and the user's personalized music playback needs.
[0174] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0175] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0176] According to another aspect of the embodiments of this application, a music knowledge graph construction apparatus for implementing the above-described music knowledge graph construction method is also provided. Figure 4 This is a schematic diagram of an optional music knowledge graph construction apparatus according to an embodiment of this application, such as... Figure 4 As shown, the device may include:
[0177] The acquisition module 24 is used to acquire the target music attribute of the target music according to the target scene corresponding to the target air conditioner type. The target music is the music of the air conditioner type to be associated, and the target air conditioner type is the air conditioner type to be determined whether it matches the target music.
[0178] Matching module 26 is used to determine the target matching result based on the target music attributes, wherein the target matching result is used to indicate whether the target air conditioner type matches the target music;
[0179] The association module 28 is used to associate air conditioning type with target music according to the target matching results, and obtain music knowledge graph.
[0180] It should be noted that the acquisition module 24 in this embodiment can be used to execute step S104 in this application embodiment, the matching module 26 in this embodiment can be used to execute step S106 in this application embodiment, and the association module 28 in this embodiment can be used to execute step S108 in this application embodiment.
[0181] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of a device, can operate in environments such as... Figure 1 The hardware environment shown can be implemented either through software or through hardware.
[0182] The above modules can solve the technical problem that directly using general music resources for music recommendation cannot recommend music suitable for different usage scenarios of air conditioners.
[0183] As an optional embodiment, the acquisition module 24 further includes: an acquisition unit, configured to acquire all candidate music attributes of the target music in a general knowledge graph, wherein the target music is music of an air conditioner type to be associated in the general knowledge graph, and the air conditioner type associated with the music is used to represent the type of air conditioner to which the music is applicable; and an extraction unit, configured to extract the target music attribute from all candidate music attributes of the target music according to the target scene corresponding to the target air conditioner type among all air conditioner types, wherein the target air conditioner type is an air conditioner type to be determined whether it matches the target music, and the air conditioner of the target air conditioner type is used to provide music playback function in the target scene.
[0184] Optionally, the association module 28 is also used to associate the target music with the air conditioner type in the general knowledge graph according to the target matching result, so as to obtain the music knowledge graph.
[0185] As an optional embodiment, the extraction unit further includes:
[0186] The first extraction unit is used to extract the target emotional attribute and target style attribute of the target music from all candidate music attributes when the target air conditioner type is the first air conditioner type corresponding to the meeting scene. The target music attribute includes the target emotional attribute and the target style attribute.
[0187] The second extraction unit is used to extract the target playlist attribute from all candidate music attributes of the target music when the target air conditioner type is the second air conditioner type corresponding to the rest scene. The target music attribute includes the target playlist attribute, which is used to indicate the playlist name of the playlist where the target music is located.
[0188] Optionally, in this embodiment, the matching module 26 further includes:
[0189] The first matching unit is used to determine that the target matching result is that the first air conditioner type does not match the target music when the target air conditioner type is the first air conditioner type and the first preset requirement is met. The first preset requirement is that the target emotional attribute indicates that the emotional type of the target music is negative, or the target style attribute indicates that the music style of the target music is noisy.
[0190] The second matching unit is used to determine the target matching result as a match between the second air conditioner type and the target music when the target playlist attribute indicates that the playlist name of the playlist containing the target music contains preset keywords, provided that the target air conditioner type is the second air conditioner type. The preset keywords include words related to the rest scene.
[0191] As an optional embodiment, the extraction unit further includes:
[0192] The third extraction unit is used to extract the target emotional attribute and target lyric attribute of the target music from all candidate music attributes when the target air conditioner type is the third air conditioner type corresponding to the child's use scenario. The target music attribute includes the target emotional attribute and the target lyric attribute.
[0193] The fourth extraction unit is used to extract the target playlist attribute and target time attribute of the target music from all candidate music attributes when the target air conditioner type is the fourth air conditioner type corresponding to the elderly use scenario. The target music attribute includes the target playlist attribute and the target time attribute. The target playlist attribute is used to indicate the playlist name of the playlist in which the target music is located, and the target time attribute is used to indicate the release time of the target music.
[0194] Optionally, in this embodiment, the matching module 26 further includes:
[0195] The third matching unit is used to determine that the target matching result is that the third air conditioner type does not match the target music when the second preset requirement is met, provided that the target air conditioner type is the third air conditioner type. The second preset requirement is that the target emotional attribute indicates that the emotional type of the target music is negative, or the target lyrics attribute indicates that the lyrics of the target music contain preset negative words.
[0196] The fourth matching unit is used to determine the target matching result as a match between the fourth air conditioner type and the target music when the third preset requirement is met, provided that the target air conditioner type is the fourth air conditioner type. The third preset requirement is that the target playlist attribute indicates that the playlist name of the playlist containing the target music contains the specified keyword, or the target time attribute indicates that the release time of the target music is within the preset time range.
[0197] As an optional embodiment, the association module 28 is also used to: when the target air conditioner type matches the target music, use the target air conditioner type as the air conditioner type of the target music in the general knowledge graph to obtain a music knowledge graph.
[0198] As an optional embodiment, the device further includes an air conditioner music playback unit, configured to: acquire a target voice command, wherein the target voice command is used to request a specified air conditioner to play music; perform semantic analysis on the target voice command to obtain a semantic analysis result; and, if the semantic analysis result does not contain a music name, determine the music to be played for the specified air conditioner from preset music in a music knowledge graph according to the specified air conditioner type to which the specified air conditioner belongs, wherein the specified air conditioner type is included among all air conditioner types associated with the preset music.
[0199] Optionally, in this embodiment, the air conditioner music playback unit is further configured to: if the semantic analysis result includes a specified music name, search for the specified music corresponding to the specified music name and the air conditioner type of the specified music in the music knowledge graph according to the specified music name; if the air conditioner type of the specified music does not include the specified air conditioner type to which the specified air conditioner belongs, issue a preset prompt message, wherein the preset prompt message is used to indicate that the specified music is not suitable for playback on the specified air conditioner; if the air conditioner type of the specified music includes the specified air conditioner type, use the specified music as the music to be played on the specified air conditioner.
[0200] Optionally, in this embodiment, the air conditioner music playback unit is further configured to: instruct a designated music player to play the music to be played, wherein the designated music player is a music player associated with a designated air conditioner.
[0201] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of a device, can operate in environments such as... Figure 1 The hardware environment shown can be implemented through software or hardware, and the hardware environment includes the network environment.
[0202] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described music knowledge graph construction method and / or air conditioning music playback method is also provided.
[0203] This application provides a scheme for constructing a music knowledge graph and a scheme for playing music for air conditioners. By obtaining the music attributes that need to be considered for the target scenario corresponding to the target air conditioner type, it determines whether the music matches the target air conditioner type, and associates the music with the air conditioner type based on the matching result. In the resulting music knowledge graph, the music is associated with the air conditioner type, so that when recommending music based on the music knowledge graph, it can adapt to the air conditioner usage scenario, providing users with more accurate music recommendation services. This solves the technical problem in related technologies that directly using general music resources for music recommendation cannot recommend music suitable for different air conditioner usage scenarios.
[0204] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.
[0205] Specifically, the detailed process by which each module in the device of this invention implements its function can be found in the relevant description in the method embodiment, and will not be repeated here.
[0206] According to another embodiment of this application, an electronic device is also provided, such as... Figure 5 As shown, the electronic device may include: a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504, wherein the processor 1501, the communication interface 1502, and the memory 1503 communicate with each other through the communication bus 1504.
[0207] Memory 1503 is used to store computer programs;
[0208] When the processor 1501 executes the program stored in the memory 1503, it implements the steps of the above method embodiment.
[0209] The bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0210] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0211] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0212] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0213] This application also provides a computer-readable storage medium, which includes a stored program, wherein the program executes the method steps of the above method embodiments when it runs.
[0214] According to another aspect of the embodiments of this application, an air conditioner including the above-described electronic device is also provided. The above-described music knowledge graph construction method and / or air conditioner music playback method can then be implemented via the air conditioner.
[0215] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0216] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0217] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0218] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.
[0219] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0220] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0221] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for constructing a music knowledge graph, characterized in that, include: According to the target scene corresponding to the target air conditioner type, obtain the target music attribute of the target music, wherein the target music is the music of the air conditioner type to be associated, and the target air conditioner type is the air conditioner type to be determined whether it matches the target music; Based on the target music attributes, a target matching result is determined, wherein the target matching result is used to indicate whether the target air conditioner type matches the target music; Based on the target matching results, the target music is associated with an air conditioner type to obtain a music knowledge graph; The step of obtaining the target music attribute of the target music according to the target scene corresponding to the target air conditioner type includes: obtaining all candidate music attributes of the target music in the general knowledge graph, wherein the target music is the music of the air conditioner type to be associated in the general knowledge graph; extracting the target music attribute from all candidate music attributes of the target music according to the target scene corresponding to the target air conditioner type among all air conditioner types, wherein the target air conditioner type is the air conditioner type to be determined whether it matches the target music, and the air conditioner of the target air conditioner type is used to provide music playback function in the target scene; The step of associating the target music with the air conditioner type according to the target matching result and obtaining a music knowledge graph includes: associating the target music with the air conditioner type in the general knowledge graph according to the target matching result and obtaining a music knowledge graph.
2. The method according to claim 1, characterized in that, The step of obtaining the target music attributes of the target music according to the target scene corresponding to the target air conditioner type includes: When the target air conditioning type is the first air conditioning type corresponding to the meeting scene, the target emotional attribute and target style attribute of the target music are obtained, wherein the target music attribute includes the target emotional attribute and the target style attribute; Determining the target matching result based on the target music attributes includes: When the first preset requirement is met, the target matching result is determined to be that the first air conditioner type does not match the target music, wherein the first preset requirement is that the target emotional attribute indicates that the emotional type of the target music is negative, or the target style attribute indicates that the music style of the target music is noisy.
3. The method according to claim 1, characterized in that, The step of obtaining the target music attributes of the target music according to the target scene corresponding to the target air conditioner type includes: When the target air conditioner type is the second air conditioner type corresponding to the rest scene, the target playlist attribute of the target music is obtained, wherein the target music attribute includes the target playlist attribute, and the target playlist attribute is used to indicate the playlist name of the playlist where the target music is located; The step of determining the target matching result based on the target music attributes includes: When the target playlist attribute indicates that the playlist name of the playlist containing the target music contains preset keywords, the target matching result is determined to be that the second air conditioner type matches the target music, wherein the preset keywords include words associated with the resting scenario.
4. The method according to claim 1, characterized in that, The step of obtaining the target music attributes of the target music according to the target scene corresponding to the target air conditioner type includes: When the target air conditioner type is the third type of air conditioner corresponding to the child's usage scenario, the target emotional attribute and target lyric attribute of the target music are obtained, wherein the target music attribute includes the target emotional attribute and the target lyric attribute; The step of determining the target matching result based on the target music attributes includes: When the second preset requirement is met, the target matching result is determined to be that the third air conditioner type does not match the target music. The second preset requirement is that the target emotional attribute indicates that the emotional type of the target music is negative, or the target lyrics attribute indicates that the lyrics of the target music contain preset negative words.
5. The method according to claim 1, characterized in that, The step of obtaining the target music attributes of the target music according to the target scene corresponding to the target air conditioner type includes: When the target air conditioner type is the fourth type of air conditioner corresponding to the elderly's usage scenario, the target playlist attribute and target time attribute of the target music are obtained. The target music attribute includes the target playlist attribute and the target time attribute. The target playlist attribute is used to indicate the playlist name of the playlist where the target music is located, and the target time attribute is used to indicate the release time of the target music. The step of determining the target matching result based on the target music attributes includes: When the third preset requirement is met, the target matching result is determined to be that the fourth air conditioner type matches the target music. The third preset requirement is that the target playlist attribute indicates that the playlist name of the playlist containing the target music contains a specified keyword, or the target time attribute indicates that the release time of the target music is within a preset time range.
6. The method according to claim 1, characterized in that, The step of associating the target music with an air conditioner type based on the target matching result to obtain a music knowledge graph includes: Based on each target matching result, the specified target air conditioner type among all target air conditioner types is associated with the target music to obtain the music knowledge graph, wherein the specified target air conditioner type is the air conditioner type that matches the target music.
7. A method for playing music in an air conditioner, characterized in that, include: Obtain a target voice command, wherein the target voice command is used to request a specified air conditioner to play music; Perform semantic analysis on the target speech command to obtain the semantic analysis results; If the semantic analysis result does not contain a music name, the music to be played for the specified air conditioner is determined from the preset music in the music knowledge graph according to the specified air conditioner type to which the specified air conditioner belongs. The specified air conditioner type is included among all air conditioner types associated with the preset music. The music knowledge graph is constructed by the music knowledge graph construction method according to any one of claims 1 to 6. The specified music player is instructed to play the music to be played, wherein the specified music player is the music player associated with the specified air conditioner.
8. A music knowledge graph construction apparatus, used to implement the music knowledge graph construction method as described in any one of claims 1 to 6, characterized in that, include: The acquisition module is used to acquire the target music attribute of the target music according to the target scene corresponding to the target air conditioner type, wherein the target air conditioner type is the air conditioner type that is to be determined whether it matches the target music; A matching module is used to determine a target matching result based on the target music attributes, wherein the target matching result is used to indicate whether the target air conditioner type matches the target music; The association module is used to associate the target music with the air conditioning type according to the target matching result, thereby obtaining a music knowledge graph.
9. An electronic device, characterized in that, include: The processor, communication interface, memory, and communication bus are provided, wherein the processor, communication interface, and memory communicate with each other via the communication bus. The memory is used to store computer programs; The processor, when executing the computer program, implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when it is run.
11. An air conditioner, characterized in that, Including the electronic device as described in claim 9.