Song recommendation method, computer equipment, readable storage medium and program product
By analyzing the behavior characteristics of a user's homework in a work task, determining his emotional state and mood scenarios, hence recommending matching songs, solving the problem of low accuracy of song recommendations in work scenarios, and improving the accuracy of recommendations and user experience.
Patent Information
- Application Number
- CN202411568280.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-03-25
AI Technical Summary
In the work scenario, the accuracy of existing song recommendation methods is low, resulting in users needing to search for songs again.
By detecting the user's homework behavior characteristics when performing work tasks, determining the user's emotional state and mood scene, and then obtaining the matching target song.
Improve the accuracy of song recommendations, make the recommended songs consistent with the user's current working status, and saves the user's time to search for songs in the work scenario.
Smart Images

Figure CN119691216A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of song recommendation, and in particular to a song recommendation method, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of computer technology, users can easily obtain music resources. In related technologies, in order to enable users to quickly obtain suitable songs, songs can be recommended to users based on the user's browsing, consumption and other behavior characteristics related to song listening on the music platform, or the songs listened to by the associated users that the user follows.
[0003] However, the inventors found in practice that when a user intends to play music while performing a work task, the recommended songs obtained in the above manner are often not recognized by the user, and the user will search for songs again. It can be seen that the song recommendation method of the related art has the problem of low song recommendation accuracy in the work scenario. Summary of the invention
[0004] Based on this, it is necessary to provide a song recommendation method, computer device, computer-readable storage medium and computer program product that can improve the accuracy of song recommendations in work scenarios in response to the above technical problems.
[0005] In a first aspect, the present application provides a song recommendation method, comprising:
[0006] In the case where it is detected that a user corresponding to the account performs a work task, determining the operation behavior characteristics of the user when performing the work task; the operation behavior characteristics include a first operation behavior characteristic when the user generates the task content of the work task, and / or a second operation behavior characteristic when the user modifies the task content;
[0007] Determining user state information representing the emotional state and / or mood scene of the user according to the task behavior characteristics;
[0008] According to the user status information, a target song recommended to the account of the user is obtained.
[0009] In one embodiment, obtaining a target song recommended to the account of the user according to the user status information includes:
[0010] Acquire multiple candidate songs matching the user status information;
[0011] Determine content summary information corresponding to the task content generated by the user, and obtain candidate songs related to the content summary information from the multiple candidate songs as target songs recommended to the account.
[0012] In one of the embodiments, the user status information includes user status description text;
[0013] The obtaining of a plurality of candidate songs matching the user status information comprises:
[0014] Acquire a first text feature corresponding to the user status description text;
[0015] Determine feature similarity between the first text feature and second text features of song tags corresponding to each of a plurality of songs in a preset music library;
[0016] The plurality of songs whose feature similarities satisfy the similarity condition are taken as candidate songs.
[0017] In one of the embodiments, the user status information includes user status description text;
[0018] The determining, based on the task behavior characteristics, user status information representing the user's emotional state and / or mood scene includes:
[0019] Inputting the work behavior feature into a trained state recognition model, and determining the emotional state label and / or mood scene label corresponding to the work behavior feature by the state recognition model;
[0020] A user state description text of the user is obtained according to the emotional state label and / or the mood scene label.
[0021] In one embodiment, the work task is a programming task, and determining the operation behavior characteristics of the user when performing the work task includes:
[0022] Determining the programming language used by the user when executing the programming task, and determining adjustment operation information corresponding to the code adjustment operation related to the adjustment code;
[0023] Determine, according to the programming language used, a first operation behavior feature when the user generates a programming code for the programming task, and determine, according to the adjustment operation information, a second operation behavior feature when the user modifies the programming code;
[0024] Based on the first operation behavior feature and the second operation behavior feature, the operation behavior feature of the user when performing the programming task is determined.
[0025] In one embodiment, determining the first operation behavior feature when the user generates the programming code of the programming task according to the programming language used includes:
[0026] Determining a code typing speed and a code typing strength based on a task content input operation performed by the user when inputting a programming code;
[0027] A first operation behavior feature of the account when executing the programming task is determined according to the code typing speed, the code typing strength, and the programming language.
[0028] In one embodiment, when detecting that a user corresponding to an account performs a work task, determining the operation behavior characteristics of the user when performing the work task includes:
[0029] In the case where it is detected that the user corresponding to the account starts the target application, it is determined that the user starts to perform the work task, and the operation behavior characteristics of the user when performing the work task are determined; the target application is an application used to perform the work task;
[0030] After the step of obtaining the target song recommended to the account of the user, the method further includes:
[0031] Acquiring the user's concentration level when processing the work task, and determining a playback volume that matches the concentration level; the playback volume is negatively correlated with the concentration level;
[0032] The target song is played at the playback volume.
[0033] In a second aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0034] In the case where it is detected that a user corresponding to the account performs a work task, determining the operation behavior characteristics of the user when performing the work task; the operation behavior characteristics include a first operation behavior characteristic when the user generates the task content of the work task, and / or a second operation behavior characteristic when the user modifies the task content;
[0035] Determining user state information representing the emotional state and / or mood scene of the user according to the task behavior characteristics;
[0036] According to the user status information, a target song recommended to the account of the user is obtained.
[0037] In a third aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0038] In the case where it is detected that a user corresponding to the account performs a work task, determining the operation behavior characteristics of the user when performing the work task; the operation behavior characteristics include a first operation behavior characteristic when the user generates the task content of the work task, and / or a second operation behavior characteristic when the user modifies the task content;
[0039] Determining user state information representing the emotional state and / or mood scene of the user according to the task behavior characteristics;
[0040] According to the user status information, a target song recommended to the account of the user is obtained.
[0041] In a fourth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0042] In the case where it is detected that a user corresponding to the account performs a work task, determining the work behavior characteristics of the user when performing the work task; the work behavior characteristics include a first work behavior characteristic when the user generates the task content of the work task, and / or a second work behavior characteristic when the user modifies the task content;
[0043] Determining user state information representing the emotional state and / or mood scene of the user according to the task behavior characteristics;
[0044] According to the user status information, a target song recommended to the account of the user is obtained.
[0045] The above-mentioned song recommendation method, computer device, computer-readable storage medium and computer program product can determine the user's work behavior characteristics when performing the work task when detecting that the user corresponding to the account performs the work task, and the work behavior characteristics include the first work behavior characteristics when the user generates the task content of the work task, and / or the second work behavior characteristics when the user modifies the task content; and then determine the user state information representing the user's emotional state and / or mood scene based on the work behavior characteristics, and obtain the target song recommended to the user's account based on the user state information. In this embodiment, based on the current work behavior characteristics of the user when processing the work task, the user state information can be determined and the target song related to the user state information can be matched for recommendation, so that the target song recommended to the user can be consistent with the user's current work state, saving the user's time in searching for songs in the work scene, and effectively improving the accuracy of song recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A schematic diagram of a flow chart of a song recommendation method in one embodiment;
[0048] Figure 2 A schematic flow chart of a step of determining a target song in one embodiment;
[0049] Figure 3 A schematic flow chart of another song recommendation method in one embodiment;
[0050] Figure 4 A framework diagram of a song recommendation product in one embodiment;
[0051] Figure 5 The figure is a diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, played data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0054] In one embodiment, Figure 1 As shown, a song recommendation method is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0055] S101, when it is detected that a user corresponding to an account performs a work task, determining the operation behavior characteristics of the user when performing the work task.
[0056] The account may be a user account used by a user in the process of performing a work task.
[0057] The operation behavior characteristics can be understood as the characteristics corresponding to the operation behavior that occurs when the user processes the work task. In this embodiment, the operation behavior characteristics may include the operation behavior characteristics when the user generates the task content of the work task, and may also include the operation behavior characteristics when the user modifies the task content. For the sake of distinction, the operation behavior characteristics when the user generates the task content are referred to as the first operation behavior characteristics, and the operation behavior characteristics when the user modifies the task content are referred to as the second operation behavior characteristics. In some examples, the first operation behavior characteristics may characterize one or more of the user's fluency and information input speed when generating or creating the task content; the second operation behavior characteristics may reflect one or more of the frequency, number of modifications, and magnitude of modification when the user modifies the task content.
[0058] In a specific implementation, when it is detected that the user corresponding to the account is performing a work task, the user's current work status can be analyzed to determine the user's work behavior characteristics when performing the work task.
[0059] There may be one or more forms of user's operation behavior to perform work tasks. In some exemplary embodiments, the work tasks may include one or more work tasks that require information input in the terminal. In other words, the processing of the work tasks depends on the account generating the specified task content in the terminal. In some exemplary embodiments, the work tasks may be programming tasks, and the processing of programming tasks depends on the account inputting the code content that meets the requirements in the terminal; in another embodiment, the work tasks may also be literary creation tasks, such as the writing and creation of novels and prose, copywriting, etc., and the processing of literary creation tasks may depend on the account inputting the creation content expressed in text form in the terminal; for another example, the work tasks may also be financial tasks, and the processing of financial tasks depends on the account compiling relevant data reports in the terminal; in other embodiments, the work tasks may also be drawing tasks, such as making design drawings or engineering drawings in the terminal. For the user's operation of inputting task content in the process of performing work tasks, the operation behavior characteristics of the user when performing work tasks can be determined by analyzing the operation of inputting task content. Among them, the task content input operation can be an input operation of inputting task content related to the work task in the terminal. Exemplarily, the task content input operation can be implemented in one or more of the following ways: keyboard input, mouse input, touch input, and voice input.
[0060] Of course, the work behavior characteristics of the user when performing the work task can also be determined by other methods. For example, when the work image of the user performing the work task is obtained, the work behavior characteristics can be obtained by analyzing the user's behavior in the work image.
[0061] It should be emphasized that this application analyzes the user's work behavior characteristics only after obtaining full authorization from the user. For example, when a user is involved in the task content input operation during the execution of a work task, in order to determine the account's task content input operation, an input operation identification plug-in can be installed on the terminal. This plug-in runs and identifies the task content input operation after obtaining the user's authorization.
[0062] S102: Determine user status information representing the user's emotional state and / or mood scene according to the task behavior characteristics.
[0063] In specific implementations, the work behavior characteristics of work scenes vary in different states. For example, when in a sober or excited state, the work behavior is characterized by smooth or fast input of task content and less modification of task content; when in an anxious or other negative state, the work behavior may be characterized by slow input speed and repeated modification of input content.
[0064] Based on this, after determining the work behavior characteristics, the user status can be predicted based on the work behavior characteristics to determine the user status information corresponding to the user under the current work behavior characteristics, wherein the user status information may include an emotional state that reflects the user's own psychological and emotional state, and may also include the mood scenario in which the user is in.
[0065] S103, obtaining target songs recommended to the user's account according to the user status information.
[0066] It is understandable that in different emotional states or mood scenarios, the songs that users tend to listen to will be different. For example, when they are in a low mood, they may tend to listen to songs that can cheer up their spirits, and when they are in a good mood, they may tend to listen to songs with a brisk rhythm. In this regard, after determining the user status information, the target song recommended to the user's corresponding account can be obtained based on the user status information. In some embodiments, when determining the target song based on the user status information, the target song can be a song that reflects the user status information, for example, the emotional state or mood scene reflected by the target song matches the user status information. In other embodiments, the target song can be a song that can optimize the current user status. For example, when it is determined that the user is in a negative mood based on the user status information, a song with a positive label can be used as a target song.
[0067] In the above song recommendation method, when it is detected that the user corresponding to the account performs a work task, the user's work behavior characteristics when performing the work task can be determined, and the work behavior characteristics include a first work behavior characteristic when the user generates the task content of the work task, and / or a second work behavior characteristic when the user modifies the task content; and then the user state information representing the user's emotional state and / or mood scene can be determined based on the work behavior characteristics, and the target song recommended to the user's account can be obtained based on the user state information. In this embodiment, based on the user's current work behavior characteristics when processing the work task, the user state information can be determined and the target song related to the user state information can be matched for recommendation, so that the target song recommended to the user can be consistent with the user's current work state, saving the user's time in searching for songs in the work scene, and effectively improving the accuracy of song recommendations.
[0068] In one embodiment, Figure 2 As shown, in step S103, obtaining the target song recommended to the user's account according to the user status information may include the following steps:
[0069] S201, obtaining multiple candidate songs matching the user status information.
[0070] In this step, multiple songs matching the user status information can be screened out from the preset music library as candidate songs, wherein the candidate songs matching the user status information can be understood as the emotional state expressed by the candidate songs or the mood scene of the candidate songs being similar or identical to the user status information.
[0071] S202, determining content summary information corresponding to the task content generated by the user, and obtaining candidate songs related to the content summary information from multiple candidate songs as target songs recommended to the account.
[0072] In a specific implementation, the task content created and generated by the user to complete the work task can be obtained with the account authorization. In some embodiments, for the task content input based on the task content input operation, that is, the input content, the content acquisition plug-in installed in the terminal can be used to determine the input content with the account authorization. In other embodiments, the input content obtained by identification can be protected by existing privacy protection technology before subsequent processing. For example, the currently obtained input content can be encrypted based on one or more privacy protection methods such as differential privacy and homomorphic encryption.
[0073] After obtaining the task content generated by the user, the task content generated by the user is understood, and the content summary information corresponding to the input task content is obtained. The content summary information can be information reflecting the key points of the generated task content, or it can be a summary of the generated task content. In one embodiment, the content understanding model can be pre-trained, and the corresponding content understanding models can be trained for different types of work tasks. For example, for programming tasks, the model can be supervised and trained based on training samples containing code content and paired code content summary labels. For literary creation tasks, the model can be supervised and trained based on training samples containing literary materials and paired literary material summary labels. For financial tasks, the model can be supervised and trained based on different financial statements and paired report type labels. Exemplarily, the content understanding model can be obtained based on large language model training. For example, for programming content understanding, a large language model based on programming language can be used, including but not limited to models such as codeLLaMA or Deepseek-code.
[0074] Then, candidate songs related to the content summary information are obtained from the multiple candidate songs as target songs. For example, after obtaining the content summary information, the relevance between the content summary information and each candidate song can be determined, and K (K ≥ 1) candidate songs whose relevance meets the preset conditions are used as target songs recommended to the account.
[0075] In one embodiment, a song ranking model can be pre-trained. The song ranking model can be trained based on a large language model, and then, Figure 3 As shown, multiple candidate songs and content summary information can be input into a song sorting model, and the song sorting model will sort the multiple candidate songs by relevance based on the content summary information, and take the three candidate songs with the highest relevance as target songs.
[0076] In this embodiment, by obtaining content summary information corresponding to the task content generated by the user, candidate songs related to the content summary information are obtained from multiple candidate songs as target songs, and target songs related to the user's current work status and work content can be quickly screened out, thereby improving the matching degree between the screened target songs and the current work scene, and improving the accuracy of song recommendations, so that users can quickly obtain songs that match the current work scene. At the same time, it helps to improve the efficiency of processing work tasks.
[0077] In one embodiment, the user status information includes a user status description text; in step S201, obtaining multiple candidate songs matching the user status information may include the following steps:
[0078] Obtain a first text feature corresponding to a user status description text; determine feature similarity between the first text feature and a second text feature of a song label corresponding to each of a plurality of songs in a preset music library; and select a plurality of songs whose feature similarities satisfy a similarity condition as candidate songs.
[0079] In a specific implementation, after obtaining the user state description text representing the user's emotional state or mood scene, the user state description text can be feature extracted to obtain the corresponding text features. For example, when the emotional state label and the mood scene label are obtained at the same time, the label text features corresponding to the emotional state label and the label text features corresponding to the mood scene label can be obtained. For the convenience of distinction, the text features of the user state description text are referred to as the first text features. On the other hand, multiple songs in the preset music library can have corresponding song labels. For each song label corresponding to the song, the label text features of the song label can be obtained. For the convenience of distinction, the label text features corresponding to the song label are referred to as the second text features.
[0080] Then, the first text feature currently obtained can be compared with the second text features corresponding to each of the multiple songs in the music library for similarity, to obtain the feature similarity between the first text feature and each second text feature. In some examples, the first text feature and the second text feature can be text vectors, for example, the text vectors are determined using the Glove model, and then the feature similarity can be determined based on the similarity of the text vectors.
[0081] Then, multiple songs whose feature similarities satisfy the similarity condition can be selected as candidate songs. For example, N (N is a positive integer ≥ 2) songs with the highest feature similarities can be selected as candidate songs.
[0082] In this embodiment, candidate songs related to the user's emotions and moods when handling work tasks can be quickly screened out from the music library based on the similarity between the first text feature and the second text feature.
[0083] In one embodiment, the user status information includes a user status description text; in step S102, determining the user status information representing the user's emotional state and / or mood scene according to the task behavior characteristics may include the following steps:
[0084] S1031, inputting the task behavior features into a trained state recognition model, and using the state recognition model to determine an emotional state label and / or a mood scene label corresponding to the task behavior features.
[0085] In practical applications, the user's internal psychological state will affect the user's behavior, and at the same time, the user's behavior can also reflect the user's internal psychological state. In this regard, a state recognition model can be pre-trained, and the state recognition model can also be called a mapping model between job behavior and "emotion-scene". Exemplarily, the state recognition model can adopt any generative machine learning model, for example, a large language model of Transformer (an architecture including an encoder and a decoder) can be used for training, or a MAMBA model (a state space model with linear computational complexity), CRF (Conditional Random Fields), etc. In some embodiments, it can also be obtained by training a large language model, such as LLaMA, Qwen and other large language model training. In some exemplary embodiments, due to the differences in the job behaviors involved in different work tasks, corresponding state recognition models can be trained for different types of work tasks. For example, for programming tasks, a programming behavior and "emotion-scene" mapping model can be trained based on a large language model, and for literary creation tasks, a literary creation behavior and "emotion-scene" mapping model can be trained based on a large language model.
[0086] After the state recognition model is trained, the acquired work behavior features can be input into the state recognition model, and the state recognition model determines at least one of the emotional state label and the mood scene label corresponding to the work behavior features. In some examples, the emotional state label and the mood scene label can be as shown in Table 1 below:
[0087] Table 1
[0088]
[0089] S1032: Obtain a user state description text of the user according to the emotional state tag and / or the mood scene tag.
[0090] After obtaining at least one of the emotional state label and the mood scene label, it can be used as the user state description text.
[0091] In this embodiment, by determining the emotional state label or mood scene label corresponding to the work behavior characteristics, user status information in text form can be provided to provide a basis for quickly screening out songs that match the work emotions or mood scenes, which helps to improve the matching degree of the target songs with the current work environment.
[0092] In one embodiment, the work task is a programming task; in step S101, determining the operation behavior characteristics of the account when executing the work task may include the following steps:
[0093] Determine the programming language used by the user when performing a programming task, and determine the adjustment operation information corresponding to the code adjustment operation related to the adjustment code; determine the first operation behavior feature when the user generates the programming code for the programming task based on the programming language used, and determine the second operation behavior feature when the user modifies the programming code based on the adjustment operation information; determine the operation behavior feature of the account when performing the programming task based on the first operation behavior feature and the second operation behavior feature.
[0094] In practical applications, the type of work task performed by the user can be identified. If the work task performed by the account is a programming task, the programming language used by the account when performing the programming task can be determined. For example, the input content can be determined based on the task content input operation, and the programming language used when performing the programming task can be determined based on the input content. Then the programming language can be used as the first job behavior feature.
[0095] In addition, in the process of processing work tasks, the adjustment of the input task content can reflect the work status, and the work status can also affect the quality of the task content input in the terminal, thereby affecting the modification or adjustment degree of the input task content. In this regard, the present embodiment can also be based on determining the adjustment operation information corresponding to the code adjustment operation related to the adjustment code. In one embodiment, the code adjustment operation may include version control behavior for the code version, and the adjustment operation information may be one or more of pull, push, submit, and view backtracking. Then, the adjustment operation information can be determined as the second job behavior feature.
[0096] Furthermore, based on the first operation behavior feature and the second operation behavior feature, the operation behavior feature of the user when performing the programming task is determined. In this embodiment, by determining the operation behavior feature based on the programming language and the adjustment operation information, personalized music recommendations matching the current working state can be made for the developer during the software development process, which helps to improve the programming efficiency of the developer.
[0097] In one embodiment, determining the first operation behavior feature when the user generates the task content of the work task according to the used programming language includes:
[0098] Based on the task content input operation performed by the user when inputting programming code, the code typing speed and code typing strength are determined; based on the code typing speed, code typing strength and programming language, the first operation behavior characteristics of the account when performing the programming task are determined.
[0099] In actual applications, the way of inputting task content may be different in different working states. For example, the text input speed in a happy and excited state is faster than that in a sad and anxious state. When performing coding tasks, the task content input operation is often performed with the help of keyboard tools. In this embodiment, in the process of processing programming tasks, the code typing speed and code typing strength can be determined based on the task content input operation performed by the user when entering programming codes, wherein the code typing speed represents the speed of inputting codes through the keyboard tool, and the code typing strength represents the strength of tapping the keyboard when typing codes. Furthermore, the code typing speed, code typing strength, and the programming language used by the user can be used as the first job behavior characteristics of the account when performing programming tasks.
[0100] In one embodiment, the operation behavior characteristics involved in the programming task process can be shown in the following Table 2:
[0101] Table 2
[0102]
[0103] In this embodiment, by determining the first job behavior feature based on the code typing speed, code typing strength and programming language, it can effectively characterize the user's state in the process of executing the programming task, help obtain songs that match the programming task, and improve the programming efficiency of developers.
[0104] In one embodiment, in step S101, when it is detected that a user corresponding to an account performs a work task, determining the operation behavior characteristics of the user when performing the work task may include the following steps:
[0105] When it is detected that the user corresponding to the account starts the target application, it is determined that the user starts to perform the work task, and the operation behavior characteristics of the user when performing the work task are determined.
[0106] The target application is an application used to perform work tasks.
[0107] In actual applications, work tasks can be performed through target applications. For example, for programming tasks, the target application can be a programming environment and an integrated development environment (IDE); for literary creation tasks, the target application can be a text editing application; and for financial tasks, the target application can be a data spreadsheet processing application.
[0108] In this embodiment, when a user's startup operation on a target application is detected, it can be determined that the user starts to perform a work task, and then the user's work behavior for the work task can be monitored to obtain corresponding work behavior features.
[0109] Accordingly, after step S104, the method may further include the following steps:
[0110] The user's job concentration level when processing a work task is obtained, and a playback volume that matches the job concentration level is determined; and a target song is played at the playback volume.
[0111] In specific implementations, different work tasks require different levels of job concentration. For example, for data processing or work tasks with strong logic, such as programming tasks or financial tasks, a higher level of job concentration may be required to avoid errors during task processing; for work tasks with strong divergent thinking, the required level of job concentration is relatively low.
[0112] Based on this, the job concentration level corresponding to different work tasks and the playback volume corresponding to the job concentration level can be preset, and then the target song is played according to the playback volume, wherein the playback volume is negatively correlated with the job concentration level. In some exemplary embodiments, the target song can be played through a music playback plug-in, which can be embedded in the target application or built into the system.
[0113] In this embodiment, by monitoring the startup operation of the target application through the account, the target song suitable for the current work scene can be recommended and played to the user in a timely manner. On the other hand, the playback volume can be adjusted according to the concentration level of the work task. The music can be used to optimize the user status while avoiding interfering with the user's work, effectively improving work efficiency.
[0114] In order to enable those skilled in the art to better understand the above steps, the embodiment of the present application is illustrated below by using an example, but it should be understood that the embodiment of the present application is not limited to this.
[0115] In a specific implementation, the method of the present application can be present in the form of a plug-in or an independent client product. In an example, taking the application programming task processing scenario as an example, its structural framework can be as follows: Figure 4 As shown, it includes a programming behavior acquisition plug-in, a programming content acquisition plug-in and a music playback plug-in.
[0116] The programming behavior acquisition plug-in is used to obtain the user's programming language, input speed, key strength, and the user's ongoing version control behavior, etc., under the condition of obtaining user authorization. The programming content acquisition plug-in is used to obtain the code content that the user is writing after obtaining user authorization. Then, the information obtained from programming behavior and programming content is input into the music recommendation model based on programming behavior. Figure 3As shown in the figure, after obtaining the input information, the music recommendation model can first obtain the emotion label and scene label through the programming behavior and the "emotion-scene" mapping module, and then obtain multiple candidate songs with corresponding labels through the song recall module. On the other hand, the code language model obtains a concise summary of the content currently being written, and then inputs it into the song sorting model. The song sorting model comprehensively summarizes the concise summary and sorts the recalled songs by relevance, and takes the top 3 songs and returns them to the music playback plug-in in the programming IDE to play the music.
[0117] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0118] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a song recommendation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0119] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0120] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0121] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0122] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0123] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0124] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0125] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A song recommendation method, characterized in that: The method comprises: In the case where it is detected that a user corresponding to the account performs a work task, determining the operation behavior characteristics of the user when performing the work task; the operation behavior characteristics include a first operation behavior characteristic when the user generates the task content of the work task, and / or a second operation behavior characteristic when the user modifies the task content; Determining user state information representing the emotional state and / or mood scene of the user according to the task behavior characteristics; According to the user status information, a target song recommended to the account of the user is obtained.
2. The method according to claim 1, characterized in that The step of acquiring a target song recommended to the account of the user according to the user status information includes: Acquire multiple candidate songs matching the user status information; Determine content summary information corresponding to the task content generated by the user, and obtain candidate songs related to the content summary information from the multiple candidate songs as target songs recommended to the account.
3. The method according to claim 2, characterized in that The user status information includes a user status description text; the step of obtaining a plurality of candidate songs matching the user status information includes: Acquire a first text feature corresponding to the user status description text; Determine the feature similarity between the first text feature and the second text feature of the song label corresponding to each of the plurality of songs in the preset music library; and select the plurality of songs whose feature similarity meets the similarity condition as candidate songs.
4. The method according to claim 1, characterized in that: The user status information includes a user status description text; the user status information characterizing the user's emotional state and / or mood scene is determined according to the operation behavior characteristics, including: Inputting the work behavior feature into a trained state recognition model, and determining the emotional state label and / or mood scene label corresponding to the work behavior feature by the state recognition model; A user state description text of the user is obtained according to the emotional state label and / or the mood scene label.
5. The method according to claim 1, characterized in that: The work task is a programming task, and determining the operation behavior characteristics of the user when performing the work task includes: Determining the programming language used by the user when executing the programming task, and determining adjustment operation information corresponding to the code adjustment operation related to the adjustment code; Determine, according to the programming language used, a first operation behavior feature when the user generates a programming code for the programming task, and determine, according to the adjustment operation information, a second operation behavior feature when the user modifies the programming code; Based on the first operation behavior feature and the second operation behavior feature, the operation behavior feature of the user when performing the programming task is determined.
6. The method according to claim 5, characterized in that The determining, according to the programming language used, a first operation behavior feature when the user generates a programming code for the programming task includes: Determining a code typing speed and a code typing strength based on a task content input operation performed by the user when inputting a programming code; A first operation behavior feature of the account when executing the programming task is determined according to the code typing speed, the code typing strength, and the programming language.
7. The method according to any one of claims 1 to 6, characterized in that In the case where it is detected that a user corresponding to the account performs a work task, determining the operation behavior characteristics of the user when performing the work task includes: In the case where it is detected that the user corresponding to the account starts the target application, it is determined that the user starts to perform the work task, and the operation behavior characteristics of the user when performing the work task are determined; the target application is an application used to perform the work task; After the step of obtaining the target song recommended to the account of the user, the method further includes: Acquiring the user's concentration level when processing the work task, and determining a playback volume that matches the concentration level; the playback volume is negatively correlated with the concentration level; The target song is played at the playback volume.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.