A music recommendation method, device, equipment and storage medium
Patent Information
- Application Number
- CN202611347520.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-10-09
AI Technical Summary
当前的音乐推荐技术通常根据用户的点击播放历史、相似用户歌曲内容本身进行推荐;但上述方式仅依赖用户历史行为数据或歌曲固有属性,无法感知用户所处情境的特殊需求,导致推荐结果与用户实时期望不匹配
[0013]本申请中,获取目标用户的情境信息;所述情境信息包括时间类信息以及所述目标用户对应的物理环境信息中的至少一种;将所述情境信息与候选曲库输入人工智能模型,得到多个初步推荐音乐以及各所述初步推荐音乐对应的推荐依据;获取所述目标用户对应的短期负反馈推荐集合和长期负反馈推荐集合;所述短期负反馈推荐集合中的音乐在历史推荐过程中对应的推荐依据为时间类型依据,所述长期负反馈推荐集合中的音乐在历史推荐过程中对应的推荐依据为非时间类型依据;根据所述短期负反馈推荐集合和所述长期负反馈推荐集合对所述初步推荐音乐进行过滤,得到最终推荐音乐。可见,基于融合情境信息利用人工智能模型进行初步推荐,并基于推荐依据对负反馈进行分类和差异化有效期管理。能够利用人工智能模型的语义理解能力,将多维度情境信息融合为推荐依据,避免仅依赖历史行为进行推荐的片面性;并且,通过将负反馈按照推荐依据是否为时间类型依据进行分类,并赋予不同的有效期,能够避免因一次负反馈而永久性排除的情况,提升音乐推荐的召回率和用户使用体验感。
Smart Images

Figure CN122885237A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of music recommendation technology, and in particular to a music recommendation method, apparatus, device, and storage medium. Background Technology
[0002] Music recommendation refers to the technology of recommending music based on user preferences. Current music recommendation technologies typically make recommendations based on users' playback history and the content of similar users' songs; however, these methods rely solely on users' historical behavior data or the inherent attributes of songs, failing to perceive the specific needs of users in their current context, resulting in a mismatch between the recommendation results and users' real-time expectations. Summary of the Invention
[0003] In view of this, the purpose of this invention is to provide a music recommendation method, apparatus, device, and storage medium that can improve the accuracy of music recommendations and the user experience. The specific solution is as follows: Firstly, this application discloses a music recommendation method, including: Obtain contextual information of the target user; the contextual information includes at least one of time-related information and physical environment information corresponding to the target user. The contextual information and the candidate music library are input into the artificial intelligence model to obtain multiple preliminary music recommendations and the recommendation criteria for each preliminary music recommendation. Obtain the short-term negative feedback recommendation set and the long-term negative feedback recommendation set corresponding to the target user; the music in the short-term negative feedback recommendation set is recommended based on time type in the historical recommendation process, and the music in the long-term negative feedback recommendation set is recommended based on non-time type in the historical recommendation process; The initial music recommendations are filtered based on the short-term negative feedback recommendation set and the long-term negative feedback recommendation set to obtain the final music recommendations.
[0004] Optionally, the step of inputting the contextual information and the candidate music library into the artificial intelligence model to obtain multiple preliminary recommended music tracks and the recommendation criteria corresponding to each preliminary recommended music track includes: Get the preset prompt word template; The context information and the candidate music library are filled into the prompt word template to generate the target prompt word; The target prompt word is input into the large language model; the prompt word template is used to instruct the large language model to filter music from the candidate music library based on the context information, and output the corresponding recommendation criteria for each initially recommended music; Obtain the preliminary music recommendations output by the large language model.
[0005] Optionally, before inputting the context information and candidate music library into the artificial intelligence model, the method further includes: A preset number of songs that meet the criteria for song popularity are selected from the music library as the candidate music library.
[0006] Optionally, the time-related information includes the current date and corresponding holiday information; The physical environment information includes at least one of the location data collected by the target user's terminal device and the gyroscope motion status data.
[0007] Optionally, the music recommendation method further includes: The data in the short-term negative feedback recommendation set is cleared at a preset time each day; the data in the long-term negative feedback recommendation set continues to accumulate.
[0008] Optionally, the music recommendation method further includes: Acquire the target user's playback behavior data for the recommended music; the playback behavior data includes playback start time and playback stop time; The listening duration is calculated based on the playback start time and the playback stop time. If the listening time is less than the target threshold, it is determined that the target user has performed a negative feedback operation on the recommended music; Based on the recommendation criteria corresponding to the recommended music that has undergone negative feedback operation, the music is recorded in the short-term negative feedback recommendation set or the long-term negative feedback recommendation set.
[0009] Optionally, before determining that the target user has performed a negative feedback operation on the recommended music if the listening time is less than the target threshold, the method further includes: Based on the current criteria for recommending music, the corresponding criteria type is determined; the criteria type includes time-based criteria and non-time-based criteria. The preset threshold corresponding to the type of data is used as the target threshold; wherein the preset threshold corresponding to the time type is less than the preset threshold corresponding to the non-time type.
[0010] Secondly, this application discloses an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the aforementioned music recommendation method.
[0011] Thirdly, this application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned music recommendation method.
[0012] Fourthly, this application discloses a computer program product, including a computer program that, when executed by a processor, implements the aforementioned music recommendation method.
[0013] In this application, contextual information of the target user is obtained; the contextual information includes at least one of time-related information and physical environment information corresponding to the target user; the contextual information and a candidate music library are input into an artificial intelligence model to obtain multiple preliminary music recommendations and the recommendation criteria corresponding to each preliminary music recommendation; a short-term negative feedback recommendation set and a long-term negative feedback recommendation set corresponding to the target user are obtained; the music in the short-term negative feedback recommendation set is recommended based on time-related criteria in the historical recommendation process, and the music in the long-term negative feedback recommendation set is recommended based on non-time-related criteria in the historical recommendation process; the preliminary music recommendations are filtered according to the short-term negative feedback recommendation set and the long-term negative feedback recommendation set to obtain the final recommended music. It can be seen that preliminary recommendations are made using an artificial intelligence model based on fused contextual information, and negative feedback is classified and differentiated for validity periods based on recommendation criteria. It can leverage the semantic understanding capabilities of artificial intelligence models to integrate multi-dimensional contextual information into recommendation criteria, avoiding the one-sidedness of relying solely on historical behavior for recommendations. Furthermore, by classifying negative feedback according to whether the recommendation criterion is time-based and assigning different validity periods, it can prevent permanent exclusion due to a single negative feedback, thereby improving the recall rate of music recommendations and the user experience. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0015] Figure 1 A flowchart of a music recommendation method provided in this application; Figure 2 A flowchart illustrating a specific music recommendation method provided in this application; Figure 3 A flowchart illustrating a specific method for determining a set of negative feedback music provided in this application; Figure 4 A schematic diagram of a music recommendation device provided in this application; Figure 5 This application provides a structural diagram of an electronic device. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] In existing technologies, current music recommendation techniques typically make recommendations based on a user's playback history and the content of similar users' songs; however, this approach cannot achieve more accurate music recommendations in special contexts and is prone to errors or omissions. To overcome these technical problems, this application proposes a music recommendation method that can improve the accuracy of music recommendations and the user experience, avoiding permanent exclusion due to a single negative feedback.
[0018] This application discloses a music recommendation method. See also Figure 1 As shown, the method may include the following steps: Step S11: Obtain contextual information of the target user.
[0019] The contextual information includes at least one of time-related information and the physical environment information corresponding to the target user; for example, the contextual information is descriptive text generated based on the current date information and the physical environment information corresponding to the target user; that is, contextual information refers to contextual data used to describe the overall environment and state of the target user. The contextual information adopts a descriptive text format, which is convenient for subsequent input into a large language model for processing.
[0020] The time-related information may include the current date and corresponding holiday information; that is, the specific current date and the holiday information corresponding to that date, such as Valentine's Day, Mother's Day, and Spring Festival. The physical environment information includes at least one of the location data and gyroscope motion status data collected by the target user's terminal device; that is, the physical environment information can be collected by the sensors built into the target user's terminal device, such as location information and motion status; the terminal device includes, but is not limited to, mobile phones, tablets, smartwatches, etc.
[0021] In addition to the information mentioned above, the contextual information can also include weather information, which can be obtained by querying the weather based on the location information. That is, after obtaining the location data, the weather application programming interface can be called to obtain the real-time weather information for that location, such as sunny, cloudy, light rain, heavy snow, etc., using the weather information as a supplement to the physical environment information to further enrich the content of the contextual information.
[0022] By integrating current date, holiday information, and physical environment information collected from terminal devices to generate contextual information, compared to making recommendations using only a single dimension of user behavior data, it can more comprehensively understand the user's current needs, further improving the comprehensiveness of contextual information and the accuracy of music recommendations.
[0023] One possible implementation is to obtain time-related information from a cloud server via a network time protocol; physical environment information can be obtained from the terminal device's GPS (Global Positioning System) module to acquire location data, and from the gyroscope sensor to acquire movement status data, such as stationary, walking, running, or riding in a vehicle. This multi-source data is then fused to form structured descriptive text as contextual information, for example: "Current date is February 14th, Valentine's Day; the user is located in a certain city, the weather is light rain, and the current status is walking."
[0024] Step S12: Input the context information and candidate music library into the artificial intelligence model to obtain multiple preliminary recommended music tracks and the recommendation criteria corresponding to each preliminary recommended music track.
[0025] The generated contextual information description text and the constructed candidate music library are input into the artificial intelligence model. Specifically, a Large Language Model (LLM) can be used. A LLM is an AI model built on artificial neural networks, capable of understanding natural language instructions, performing complex reasoning, and generating text content. Based on the contextual information such as date, holiday, location, and motion state, the LLM filters music from the candidate music library that matches the context. The LLM outputs multiple preliminary music recommendations, resulting in a preliminary recommended music list. In addition to the identification information of the preliminary recommended music, such as song ID and song name, the model also includes a recommendation reason field for each preliminary recommended song, i.e., the basis for the recommendation. The recommendation reason field records the reasons why the LLM recommends the music, such as "Valentine's Day atmosphere is strong, suitable for romantic music" or "The current light rainy weather recommends a light and cheerful song to bring a good mood," etc.
[0026] It should be noted that the aforementioned candidate music library can be the music library of a music platform, i.e., the collection of all music copyrighted by the music platform; or it can be a pre-selected set of candidate music from the music library of a music platform. Since music libraries typically contain a massive amount of music, inputting all the music into a large language model would lead to excessive computational resource consumption and unstable output quality. Therefore, a subset of music can be pre-selected to construct the candidate music library. The candidate music library is a subset of music selected from the music library, and its size is much smaller than the music library. Specifically, a predetermined number of music tracks can be randomly selected from the music library to form the candidate music library.
[0027] In some preferred embodiments, before inputting the context information and candidate music library into the artificial intelligence model, the method further includes: selecting a preset number of songs from the music library that meet the song popularity criteria, as the candidate music library. Song popularity represents the popularity of a song over a period of time, and can be specifically calculated by comprehensively considering data such as the number of times a song is played, favorited, and shared; this embodiment does not limit this calculation. By selecting a candidate music library based on song popularity, it is ensured that the music in the candidate music library is popular and more easily accepted by users.
[0028] One approach is to sort music by popularity from highest to lowest and select a predetermined number of tracks from the top of the list, such as the top 500 most popular tracks. Another option is to use music with popularity exceeding a predetermined threshold as a candidate pool, and then randomly select a predetermined number of tracks from this pool, thus balancing popularity and diversity. In actual deployment, operators can dynamically adjust the criteria for popularity and the specific value of the predetermined number of tracks based on real-time platform data statistics to balance recommendation quality and computational cost.
[0029] It is evident that by constructing a candidate music library based on song popularity, the size of the candidate music library is much smaller than that of the complete music library, which reduces the input length and inference time of the large language model and reduces the consumption of computing resources. By filtering based on popularity, the music in the candidate music library has a high degree of user acceptance, which is conducive to improving the accuracy of recommendations.
[0030] Step S13: Obtain the short-term negative feedback recommendation set and the long-term negative feedback recommendation set corresponding to the target user.
[0031] The negative feedback recommendation set is a collection of historically recommended music for which the target user has performed a negative feedback action. It is used to filter out music that the user is not interested in during subsequent recommendations. In this embodiment, it specifically includes the union of a short-term negative feedback recommendation set and a long-term negative feedback recommendation set. The music in the short-term negative feedback recommendation set was recommended based on time-related criteria during the historical recommendation process, while the music in the long-term negative feedback recommendation set was recommended based on non-time-related criteria. In other words, the short-term negative feedback recommendation set records historically recommended music whose recommendation criteria are time-related and for which the target user has performed a negative feedback action. The long-term negative feedback recommendation set records historically recommended music whose recommendation criteria are non-time-related and for which the target user has performed a negative feedback action.
[0032] It should be noted that the acquisition of the above contextual information is real-time. The short-term negative feedback recommendation set and the long-term negative feedback recommendation set are also updated in real time according to the user's negative feedback behavior, so as to respond to the dynamic changes in user preferences in a timely manner and enable the recommendation results to be dynamically adjusted according to changes in context and user feedback, thereby achieving dynamic adaptation of recommendation results.
[0033] It should be further clarified that time-based criteria refer to reasons for recommendation related to specific dates, traditional festivals, or special anniversaries; non-time-based criteria refer to reasons for recommendation related to other contextual factors such as weather, location, or motion status. Negative feedback actions include, but are not limited to, users quickly changing or skipping songs after playing recommended music, or other behaviors that do not play the music completely; these behaviors can indicate that the user is dissatisfied with the recommended music.
[0034] The validity period of data in the aforementioned short-term negative feedback recommendation set is shorter than that of data in the long-term negative feedback recommendation set. For example, data in the short-term negative feedback recommendation set is only valid for a short period, such as only one or two days, or for the remaining days of a holiday. Data in the long-term negative feedback recommendation set, however, accumulates continuously and remains valid for a long time. It is understandable that if a user changes the music recommended based on time (e.g., love songs recommended for Valentine's Day), it only indicates that the user is not interested in that music in the current Valentine's Day context and should not affect recommendations in non-Valentine's Day contexts. Conversely, data based on user preferences rather than time typically exhibits long-term stability, therefore, negative feedback records should be retained indefinitely.
[0035] In related technologies, the recommendation adjustment method based on user negative feedback usually involves directly marking the music as uninteresting and permanently excluding it, which can easily lead to the recommendation results being incorrectly blocked for a long time. In this application, however, by assigning different validity periods to recommended music based on different reasons, differentiated lifecycle management of negative feedback is achieved; date-based negative feedback is only valid for a short period and will be cleared in the next cycle, avoiding the misjudgment of permanently blocking a user after a single negative feedback instance; non-date-based negative feedback accumulates continuously, stably remembering the user's long-term preferences for specific weather, location, and exercise states, preventing duplicate recommendations. Therefore, this approach ensures both the timeliness and adaptability of contextual recommendations and preserves the effectiveness of long-term preference learning, significantly improving recommendation accuracy and user experience.
[0036] In a preferred implementation, the data in the short-term negative feedback recommendation set is cleared at a preset time each day; the data in the long-term negative feedback recommendation set continues to accumulate. The preset time can be pre-configured by operators according to actual business needs, or, preferably, is 0:00 every day by default.
[0037] Of course, the validity period of the short-term negative feedback recommendation set can also be two days; or, it can be valid for the remaining days of the holiday. For example, if the current day is the first day of the Spring Festival, then the data in the current short-term negative feedback recommendation set will be retained until the end of the Spring Festival holiday before being cleared.
[0038] Step S14: Filter the preliminary recommended music according to the short-term negative feedback recommendation set and the long-term negative feedback recommendation set to obtain the final recommended music.
[0039] Specifically, for each initially recommended song, it is checked whether the song exists in the short-term negative feedback recommendation set or the long-term negative feedback recommendation set. If it exists, the song is removed from the initial recommended song list; if it does not exist, it is retained. After checking and filtering all the initially recommended songs, the remaining recommended songs constitute the final recommended song list, which is pushed or retrieved to the target user's client for display or playback.
[0040] As can be seen from the above, this embodiment uses a large-scale model to make recommendations by fusing contextual information, and classifies and stores negative feedback based on the reasons for recommendation, and manages its validity period differently. On the one hand, by leveraging the semantic understanding capabilities of the large-scale model, multi-dimensional contextual information is fused into the recommendation basis, avoiding the one-sidedness of relying solely on historical behavior for recommendations; on the other hand, by classifying and storing negative feedback according to the reasons for recommendation and assigning different validity periods, the situation of permanent exclusion due to a single negative feedback can be avoided, thereby improving the recall rate of music recommendations and the user experience.
[0041] Based on the above embodiments, this application also provides a specific method for obtaining a preliminary recommended music list. This process may include the following steps: S201: Obtain the preset prompt word template; A prompt template is a pre-designed, structured input template used to guide a large language model in performing tasks. The prompt template includes components such as a task description, input data padding, and output format requirements. In this embodiment, the prompt template instructs the large language model to filter music from a candidate music library based on contextual information and outputs a recommendation reason for each initially recommended piece of music.
[0042] For example, the prompt template is: You are a professional music recommendation expert. Based on the user's current environment, holiday, and activity level (found in the <Contextual Information>), select the most suitable {{N}} songs from the <Candidate Music Library>. The final output should be a JSON array object: [{song_id (music identifier): string, reason (recommendation reason): string}]. Here, reason is the recommendation explanation given in the context.
[0043] <Context Information>{{ContextInfo}}; <Candidate Music Library>{{MusicCandidates}}.
[0044] Here, {{ContextInfo}} is the context information filling field, and {{MusicCandidates}} is the candidate music library filling field. N is a positive integer representing the expected number of music recommendations. The prompt word template also specifies the output format requirements: the large language model needs to output a JSON array, where each element contains at least two fields: song_id and reason. The output format is used to ensure that subsequent steps can parse the output of the large language model; however, the specific format is not limited in this embodiment.
[0045] S202: Fill the context information and the candidate music library into the prompt word template to generate the target prompt word.
[0046] The generated context information description text is filled into the {{ContextInfo}} padding field of the prompt word template, and the music list from the candidate music library is filled into the {{MusicCandidates}} padding field to generate a complete target prompt word. The target prompt word is a complete natural language instruction text that can be directly input into a large language model for processing.
[0047] S203: Input the target prompt word into the large language model to obtain the preliminary recommended music list output by the large language model; the prompt word template is used to instruct the large language model to filter music from the candidate music library according to the context information, and output the corresponding recommendation basis for each preliminary recommended music.
[0048] The generated target prompts are used as input to invoke the inference interface of the large language model. Based on the task instructions, contextual information, and candidate music library in the target prompts, the large language model performs semantic understanding and inference, selecting a predetermined number of music tracks from the candidate music library that have the highest match to the contextual information, and outputting them according to the format required by the prompt template. Finally, the output of the large language model is parsed to obtain a structured preliminary list of recommended music, where each track carries its corresponding recommendation criteria.
[0049] For example Figure 2 As shown, the system acquires the cloud date information (DateInfo) and the client sensor information (SensorInfo) of the current specific user in real time, and merges them into a textual context description that the large model can understand: ContextInfo=Merge(DateInfo,SensorInfo); where the Merge function is: "The current user's context information is: date information {{DateInfo}} in JSON format, and location and gyroscope sensor information {{SensorInfo}} in JSON format".
[0050] The system randomly selects a batch of frequently played music tracks from the overall music library as candidate tracks, `MusicCandidates`. The generated context information `ContextInfo` and the candidate tracks `MusicCandidates` are then filled into a pre-defined prompt template for the large model, generating the final input request to the large model: `Q_Recommend = TemplateRecommend(ContextInfo, MusicCandidates)`. The concatenated `Q_Recommend` is input into the large language model, resulting in the model output `Output = LLM.Get(Q_Recommend)`, which is parsed to obtain the preliminary recommended music `RecommendList = JSON.loads(Output)`. `RecommendList` contains the preliminary recommended music tracks 1 through N generated by the large model. An LLM model can be used, but a multimodal model can be used if resources allow to improve recommendation accuracy.
[0051] Then, negative feedback music recall is performed based on the negative feedback music set. After filtering, the original list containing N songs is reduced to recommended music 1 that does not conform to user preferences, and the final recommended music 2 to the final recommended music N are retained.
[0052] As can be seen, this embodiment transforms contextual information and candidate music libraries into natural language instructions that the large language model can understand through preset prompt word templates; the settings and task descriptions in the prompt word templates can guide the reasoning of the large language model, making the recommendation results more consistent with the judgment logic of human experts; by requiring the large language model to output the recommendation reasons for each recommended music, not only is the interpretability of the recommendation results enhanced, but also preparation is made for subsequent classification and storage of negative feedback according to the recommendation reasons.
[0053] Based on the above embodiments, this application also provides a specific method for updating a negative feedback music set, namely, how to identify when a user has performed a negative feedback operation on recommended music, and how to record the negative feedback result in the corresponding storage table. Specifically, it may include the following steps: S301: Obtain the playback behavior data of the target user on the recommended music; the playback behavior data includes the playback start time and playback stop time.
[0054] The recommended music mentioned above can be either preliminary recommendations from the initial music recommendation list or music from the final music recommendation list; that is, any music with corresponding recommendation criteria is acceptable.
[0055] Specifically, a data collection function will be designed into the music app, which involves pre-embedding data collection code within the application to automatically record user interaction logs. Playback behavior data will include at least the playback start time (the moment the user clicks the play button) and the playback stop time (the moment the user stops playing the music), including when the user actively pauses / skips the playback and when the music finishes playing naturally. In one specific implementation, the playback behavior data can be:<SongID,StartTime,StopTime> In this context, SongID is the identifier of the music being played, StartTime is the start time of playback, and StopTime is the stop time of playback.
[0056] S302: Calculate the listening duration based on the playback start time and the playback stop time.
[0057] Listening duration is the time difference between the start and stop times of playback. Specifically, Listening Duration = StopTime - StartTime; where Duration represents the listening duration, StopTime represents the stop time, and StartTime represents the start time.
[0058] S303: If the listening time is less than the target threshold, it is determined that the target user has performed a negative feedback operation on the recommended music.
[0059] The target threshold is a pre-configured time threshold used to determine whether a user is dissatisfied with the recommended music. If the listening time is less than the target threshold, meaning the user stops playing after a very short time, it reflects dissatisfaction with the current recommended music and is therefore considered a negative feedback action. If the listening time is greater than or equal to the target threshold, the user is considered to have basic acceptance of the music, and it is not considered negative feedback. The specific value of the target threshold is not limited in this embodiment and can be adjusted according to actual needs or based on platform user behavior statistics.
[0060] S304: Based on the recommendation criteria corresponding to the recommended music for which negative feedback operation is performed, record the music in the short-term negative feedback recommendation set or the long-term negative feedback recommendation set.
[0061] When a user performs a negative feedback action on a recommended song, the recommendation criteria previously output by the large language model are retrieved. Based on the reason category of this recommendation criterion—whether it's time-based or non-time-based—the song is recorded in the corresponding storage table: if the recommendation reason is time-based, it's recorded in the short-term negative feedback recommendation set; if it's non-time-based, it's recorded in the long-term negative feedback recommendation set. After recording, the negative feedback recommendation set is updated in real time, and the updated set can be used in subsequent recommendation filtering.
[0062] For example Figure 3 As shown, based on the recommendation reasons, the initially recommended music is recorded in different storage tables. When a negative feedback music set is needed, the short-term negative feedback recommendation set representing the preference of the day and the long-term negative feedback recommendation set representing the long-term preference are retrieved, and the union of the two sets is taken to obtain the negative feedback music set.
[0063] This embodiment achieves automatic identification and classification of negative feedback operations by collecting playback behavior data through tracking and determining listening duration thresholds. By classifying and recording negative feedback music according to the recommendation reason into different storage tables, short-term negative feedback recommendation sets and long-term negative feedback recommendation sets are obtained, ensuring the correlation between negative feedback data and recommendation context to support subsequent differentiated validity period management.
[0064] This embodiment further defines the method for determining the target threshold, namely, selecting a corresponding preset threshold based on the type of recommended music, and the preset threshold corresponding to the time type is less than the preset threshold corresponding to the non-time type. Specifically, before step S303, the following steps are also included: S401: Based on the current recommendation criteria for the recommended music, determine the corresponding criteria type; the criteria type includes time-based criteria and non-time-based criteria; S402: Use the preset threshold corresponding to the type as the target threshold; wherein the preset threshold corresponding to the time type is less than the preset threshold corresponding to the non-time type.
[0065] This means that different judgment thresholds are pre-configured for different criteria. For music recommendations based on time, a smaller preset threshold, such as 10 seconds, is used; for music recommendations based on non-time criteria, a larger preset threshold, such as 15 seconds or 20 seconds, is used. In other words, the preset threshold for time-based criteria is smaller than the preset threshold for non-time-based criteria.
[0066] In practice, a preset threshold corresponding to the time type can be defined as Tdate, and a preset threshold corresponding to the non-time type can be defined as Tother. Tother = X × Tdate, where X is a constant greater than 1. X and Tdate can be configured by administrators according to business needs.
[0067] The rationale behind this configuration is that music recommended based on time is highly time-sensitive, and negative feedback from users regarding daily recommendations is easily influenced by unforeseen factors such as mood or temporary changes in preferences. Using a more lenient threshold would retain more negative feedback caused by these unforeseen factors. Music recommended without time constraints is more closely related to long-term user preferences, resulting in more stable negative feedback. A smaller threshold can more sensitively capture user dissatisfaction, while a larger threshold will not lead to misjudgments. Therefore, assigning different thresholds balances the reliability and sensitivity of both types of negative feedback data. This effectively avoids the repeated recommendation of songs not favored by the user, improving the accuracy of subsequent recommendations.
[0068] Accordingly, this application also discloses a music recommendation device, see [link to relevant documentation]. Figure 4 As shown, the device includes: The context information acquisition module 11 is used to acquire context information of the target user; the context information includes at least one of time-related information and physical environment information corresponding to the target user. The preliminary music recommendation generation module 12 is used to input the context information and the candidate music library into the artificial intelligence model to obtain multiple preliminary music recommendations and the recommendation criteria corresponding to each preliminary music recommendation. The negative feedback recommendation set acquisition module 13 is used to acquire the short-term negative feedback recommendation set and the long-term negative feedback recommendation set corresponding to the target user; the music in the short-term negative feedback recommendation set is recommended based on time type in the historical recommendation process, and the music in the long-term negative feedback recommendation set is recommended based on non-time type in the historical recommendation process. The final recommended music generation module 14 is used to filter the preliminary recommended music based on the short-term negative feedback recommendation set and the long-term negative feedback recommendation set to obtain the final recommended music.
[0069] In some specific embodiments, the preliminary recommended music generation module 12 may specifically include: The prompt word template acquisition unit is used to acquire preset prompt word templates; The target prompt word generation unit is used to fill the prompt word template with the context information and the candidate music library to generate the target prompt word; An input unit is used to input the target prompt word into the large language model; the prompt word template is used to instruct the large language model to filter music from the candidate music library according to the context information, and output the corresponding recommendation criteria for each initially recommended music; The preliminary music recommendation acquisition unit is used to acquire the preliminary music recommendations output by the large language model.
[0070] In some specific embodiments, the music recommendation device may further include: The candidate music library determination module is used to select a preset number of songs that meet the song playback popularity conditions from the music library before inputting the context information and the candidate music library into the artificial intelligence model, as the candidate music library.
[0071] In some specific embodiments, the time information includes the current date and the corresponding holiday information; the physical environment information includes at least one of the location data collected by the target user's terminal device and the gyroscope motion status data.
[0072] In some specific embodiments, the music recommendation device may further include: The cleaning module is used to clear the data in the short-term negative feedback recommendation set at a preset time each day; the data in the long-term negative feedback recommendation set continues to accumulate.
[0073] In some specific embodiments, the music recommendation device may further include: The negative feedback update module is used to acquire the target user's playback behavior data for recommended music; the playback behavior data includes playback start time and playback stop time; the listening duration is calculated based on the playback start time and playback stop time; if the listening duration is less than a target threshold, it is determined that the target user has performed a negative feedback operation on the recommended music; based on the recommendation criteria corresponding to the recommended music for which a negative feedback operation has been performed, the music is recorded in the short-term negative feedback recommendation set or the long-term negative feedback recommendation set.
[0074] In some specific embodiments, the negative feedback update module can also be used to determine the corresponding criteria type based on the current recommendation criteria for the recommended music; the criteria type includes time-based criteria and non-time-based criteria; and to use a preset threshold corresponding to the criteria type as the target threshold; wherein the preset threshold corresponding to the time-based criteria is less than the preset threshold corresponding to the non-time-based criteria.
[0075] Furthermore, this application also discloses an electronic device, see [link to relevant documentation]. Figure 5 As shown, the content in the figure should not be considered as any limitation on the scope of use of this application.
[0076] Figure 5This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the music recommendation method disclosed in any of the foregoing embodiments.
[0077] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0078] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon include operating system 221, computer program 222 and data 223 including context information, etc., and the storage method can be temporary storage or permanent storage.
[0079] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the music recommendation method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0080] Furthermore, this application also discloses a computer storage medium storing computer-executable instructions. When the computer-executable instructions are loaded and executed by a processor, they implement the music recommendation method steps disclosed in any of the foregoing embodiments.
[0081] Furthermore, embodiments of this application also disclose a computer program product, including a computer program that, when executed by a processor, implements the music recommendation method steps disclosed in any of the foregoing embodiments.
[0082] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0083] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0084] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0085] The above provides a detailed description of the music recommendation method, apparatus, device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A music recommendation method, characterized in that, include: Obtain contextual information about the target user; The contextual information includes at least one of time-related information and the physical environment information corresponding to the target user; The contextual information and the candidate music library are input into the artificial intelligence model to obtain multiple preliminary music recommendations and the recommendation criteria for each preliminary music recommendation. Obtain the short-term negative feedback recommendation set and the long-term negative feedback recommendation set corresponding to the target user; The music in the short-term negative feedback recommendation set is recommended based on time type in the historical recommendation process, while the music in the long-term negative feedback recommendation set is recommended based on non-time type in the historical recommendation process. The initial music recommendations are filtered based on the short-term negative feedback recommendation set and the long-term negative feedback recommendation set to obtain the final music recommendations.
2. The music recommendation method according to claim 1, characterized in that, The process of inputting the contextual information and the candidate music library into an artificial intelligence model to obtain multiple preliminary music recommendations and the recommendation criteria for each preliminary music recommendation includes: Get the preset prompt word template; The context information and the candidate music library are filled into the prompt word template to generate the target prompt word; The target prompt word is input into the large language model; the prompt word template is used to instruct the large language model to filter music from the candidate music library based on the context information, and output the corresponding recommendation criteria for each initially recommended music; Obtain the preliminary music recommendations output by the large language model.
3. The music recommendation method according to claim 1, characterized in that, Before inputting the context information and candidate music library into the artificial intelligence model, the process also includes: A preset number of songs that meet the criteria for song popularity are selected from the music library as the candidate music library.
4. The music recommendation method according to claim 1, characterized in that, The time-related information includes the current date and the corresponding holiday information; The physical environment information includes at least one of the location data collected by the target user's terminal device and the gyroscope motion status data.
5. The music recommendation method according to claim 1, characterized in that, Also includes: The data in the short-term negative feedback recommendation set is cleared at a preset time each day; the data in the long-term negative feedback recommendation set continues to accumulate.
6. The music recommendation method according to any one of claims 1 to 5, characterized in that, Also includes: Obtain the target user's playback behavior data for the recommended music; The playback behavior data includes playback start time and playback stop time; The listening duration is calculated based on the playback start time and the playback stop time. If the listening time is less than the target threshold, it is determined that the target user has performed a negative feedback operation on the recommended music; Based on the recommendation criteria corresponding to the recommended music that has undergone negative feedback operation, the music is recorded in the short-term negative feedback recommendation set or the long-term negative feedback recommendation set.
7. The music recommendation method according to claim 6, characterized in that, Before determining that the target user has performed a negative feedback operation on the recommended music if the listening duration is less than the target threshold, the method further includes: Based on the current criteria for recommending music, the corresponding criteria type is determined; the criteria type includes time-based criteria and non-time-based criteria. The preset threshold corresponding to the type of data is used as the target threshold; wherein the preset threshold corresponding to the time type is less than the preset threshold corresponding to the non-time type.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the music recommendation method as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein the computer programs, when executed by a processor, implement the music recommendation method as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the music recommendation method according to any one of claims 1 to 7.