Media data recommendation method and apparatus, and electronic device

By employing causal filtering and feature fusion, and leveraging user interaction behavior and media data features, the accuracy and efficiency of music recommendations are improved, addressing the problem of poor recommendation performance in existing technologies and reducing resource waste and processing load.

CN122432360APending Publication Date: 2026-07-21HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
Filing Date
2026-04-16
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies that rely solely on the similarity of content features for music recommendations cannot effectively distinguish the true motivations behind user clicks or playback behaviors, resulting in poor recommendation performance. Furthermore, these technologies are susceptible to interference from confounding factors, leading to wasted server resources and increased terminal processor load.

Method used

By acquiring user interaction behavior sequences and causal media features from media data, causal filtering and feature fusion are performed to construct user features. The recommendation model is then trained using a Transformer encoder and a cross-modal attention mechanism to improve recommendation accuracy.

Benefits of technology

It improves the accuracy of media data recommendations, reduces server resource waste and unnecessary computational load on terminal processors, and reduces redundant operations and overall power consumption by providing recommendations that meet user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432360A_ABST
    Figure CN122432360A_ABST
Patent Text Reader

Abstract

The application discloses a media data recommendation method, and relates to the technical field of computer processing, and the method comprises the following steps: acquiring a first behavior sequence; acquiring a causal media feature of first media data; wherein the causal media feature refers to a fusion feature of the media data obtained through causal screening based on an interaction scene and an interaction behavior of the media data; encoding the first behavior sequence to obtain a first behavior feature; performing feature fusion on the first behavior feature and the causal media feature of each first media data to obtain a first user feature; and inputting the first user feature into a media recommendation model to obtain a recommendation result. The cross-modal fusion driven by the causality makes the first user feature more accurate, thereby improving the recommendation effect of the media data. The recommendation of the media data based on the accurate first user feature makes the recommendation result more in line with the user demand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer processing technology, and more specifically to media data recommendation methods, apparatus, and electronic devices. Background Technology

[0002] Currently, in the field of content recommendation, such as music recommendation, related technologies often determine and automatically recommend music that users are interested in based on their historical interaction behavior.

[0003] For example, music that users have expressed interest in (such as songs that users have saved, played multiple times, or highly rated songs) can be used as the baseline music. By analyzing the content characteristics of the music (such as genre, rhythm, timbre, and emotion), the similarity between the baseline music and other music in the music library can be calculated. Other music with similarity higher than a certain threshold can be identified as recommended music and then displayed to the user.

[0004] However, in the aforementioned related technologies, determining recommended music for users solely based on the similarity between content features does not yield good recommendation results. Summary of the Invention

[0005] In view of this, this application provides a media data recommendation method, apparatus, and electronic device to solve the problem of poor recommendation performance.

[0006] Firstly, this application provides a media data recommendation method, the method comprising: Obtain a first behavior sequence; wherein the first behavior sequence is used to characterize the interactive behavior performed by a first user in response to at least one first media data; Obtain the causal media features of the first media data; wherein, the causal media features refer to the fusion features of the media data obtained after causal filtering based on the interaction scenarios and interaction behaviors of the media data; Encode the first action sequence to obtain the first action feature; The first user feature is obtained by feature fusion of the first behavioral feature and the causal media features of each of the first media data. The first user's features are input into the media recommendation model to obtain recommendation results; wherein, the recommendation results include multiple recommended media data for the first user.

[0007] Secondly, this application provides a media data recommendation device, the device comprising: A first sequence acquisition module is used to acquire a first behavior sequence; wherein the first behavior sequence is used to characterize the interactive behavior performed by a first user in response to at least one first media data; The causal feature acquisition module is used to acquire the causal media features of the first media data; wherein, the causal media features refer to the fusion features of the media data obtained after causal filtering based on the interaction scenarios and interaction behaviors of the media data; The first sequence encoding module is used to encode the first action sequence to obtain the first action feature; The first feature acquisition module is used to perform feature fusion on the first behavioral feature and the causal media features of each of the first media data to obtain the first user feature; The recommendation result acquisition module is used to input the first user's features into the media recommendation model to obtain recommendation results; wherein, the recommendation results include multiple recommended media data for the first user.

[0008] Thirdly, this application provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the media data recommendation method of the first aspect or any corresponding embodiment described above.

[0009] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the media data recommendation method described in the first aspect or any corresponding embodiment.

[0010] Fifthly, this application provides a computer program product, including computer instructions for causing a computer to execute the media data recommendation method described in the first aspect or any corresponding embodiment thereof.

[0011] The media data recommendation method provided in this application embodiment obtains a first user feature by fusing a first behavioral feature and causal media features of the first media data. The causal media feature is obtained by causal filtering through interaction scenarios and interaction behaviors. Causal-driven cross-modal fusion makes the first user feature more accurate, thereby improving the recommendation effect of media data. Moreover, the first behavioral sequence is used to characterize the interaction behavior performed by the first user on at least one piece of first media data. The first behavioral feature is obtained by encoding the first behavioral sequence. The first user feature is obtained by fusing features from the perspectives of historical interaction first media data and historical interaction behaviors, which further improves the accuracy of the first user feature. Media data recommendation based on accurate first user features makes the recommendation results more in line with user needs. It helps to avoid the waste of server resources caused by continuous and large-scale erroneous calculations and recommendations, reduces data storage pressure and data processing pressure, and the recommendation results that meet user needs help to avoid redundant operations on the client side, reduce the invalid computing load of the terminal processor and the overall power consumption. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the specific embodiments or related technologies of this application, the drawings used in the description of the specific embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this application; Figure 2 This is a schematic flowchart of a first method for recommending media data according to an embodiment of this application; Figure 3 This is a schematic diagram of a second process for a media data recommendation method according to an embodiment of this application; Figure 4 An illustrative diagram illustrating the training method of a media recommendation model is provided. Figure 5 This is a structural block diagram of a media data recommendation device according to an embodiment of this application; Figure 6 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] It should be noted that the information (including but not limited to user input information, such as information entered by the user into input boxes), data (including but not limited to data used for analysis, stored data, and displayed data, such as context code, all code of the current project, the service pressure corresponding to operations performed on all code of the current project, and the code development status of the current project), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, the context code, operations performed on all code of the current project, the corresponding service pressure, and the code development status involved in this application were all obtained with full authorization.

[0016] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0017] As one optional application scenario in the embodiments of this application, such as Figure 1 As shown, the system may include at least one terminal device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the terminal devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 through a network 110.

[0018] Specifically, the terminal device can be a smartphone, tablet, laptop, PDA, desktop computer, game console, smart TV, smart wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranet, local area network, wide area network, mobile communication network, and combinations thereof.

[0019] For example, the terminal device includes an application. This application can be one that requires downloading and installation, or it can be an application that is available instantly. For example, the application can be any application that provides a specific media data recommendation function. For example, the media data includes, but is not limited to, at least one of the following: audio information, text information, and image information. For example, the media data is a song, which includes audio information and text information (lyrics, etc.); another example is a video, which includes audio information (background music, actors' dialogue, etc.), text information (video description, subtitles, etc.), and image information (video frames, video cover, etc.).

[0020] For example, the server is the backend server of the application.

[0021] In related technologies, particularly in content recommendation, such as music recommendation, music is typically determined and automatically recommended based on a user's historical interaction behavior. For example, music that the user has previously expressed interest in (e.g., favorites, frequently played songs, highly rated songs) serves as a baseline. By analyzing the music's content features (e.g., genre, rhythm, timbre, emotion), the similarity between the baseline music and other music in the music library is calculated. Music with similarity scores exceeding a certain threshold is then identified as recommended music and displayed to the user. However, relying solely on the similarity between content features to determine recommended music fails to effectively distinguish the true motivations behind user clicks or playback, resulting in poor recommendation performance. For instance, a user might interact because a song is featured in a promotional section, shared by a friend, or is popular on a chart, rather than genuinely liking its musical characteristics. Attributing all such interactions to content preference introduces bias, leading to a decline in recommendation quality. On the other hand, relying solely on the superficial similarity of content features without delving into the true causal relationship between user behavior and content characteristics makes the content recommendation process susceptible to interference from confounding factors (such as content located in easily interactive promotional positions or content awaiting interaction in friend sharing scenarios). Due to the influence of confounding factors, a large number of similarity calculations and recommendation list generation based on erroneous associations are continuously performed, which not only wastes server computing resources and storage bandwidth and increases data processing pressure, but also causes redundant operations on the client (such as quickly skipping and refreshing) due to the frequent push of irrelevant content, increasing the ineffective computing load on the terminal processor and overall power consumption.

[0022] Furthermore, this application obtains a first user feature by fusing a first behavioral feature and causal media features of the first media data. The causal media features are obtained through causal filtering of interaction scenarios and interaction behaviors. Causal-driven cross-modal fusion makes the first user feature more accurate, thereby improving the recommendation effect of media data. Moreover, the first behavioral sequence is used to characterize the interaction behavior performed by the first user on at least one piece of first media data. The first behavioral feature is obtained by encoding the first behavioral sequence. The causal media features of the media data are obtained by causal filtering of the interaction scenarios and interaction behaviors of the media data. The first user feature is obtained by feature fusion from the perspectives of historical interaction first media data and historical interaction behaviors, which further improves the accuracy of the first user feature. Media data recommendation based on accurate first user features makes the recommendation results more in line with user needs. It helps to avoid the waste of server resources caused by continuous and large-scale erroneous calculations and recommendations, reduces data storage pressure and data processing pressure, and the recommendation results that meet user needs help to avoid redundant operations on the client side, reduce the invalid computing load of the terminal processor and the overall power consumption.

[0023] The media data recommendation method provided in this application will be described in detail below with reference to the embodiments of this application.

[0024] According to an embodiment of this application, a media data recommendation method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0025] This embodiment provides a media data recommendation method, which can be used in the client of the aforementioned terminal device or the aforementioned server (hereinafter collectively referred to as electronic device). Figure 2 This is a flowchart of a media data recommendation method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain the first row as a sequence.

[0026] The first action sequence is used to characterize the interactive behavior performed by the first user on at least one first media data. The first media data refers to media data on which the first user performs any interactive behavior. For example, the interactive behavior includes, but is not limited to, at least one of the following: complete playback, liking, favorite, downloading, sharing, switching media data, multiple playbacks, etc. For example, the interactive scenarios include, but are not limited to, at least one of the following: commuting, at home, exercising, morning rush hour, noon, evening, promotional media data, mobile phone playback, speaker playback, etc.

[0027] In this embodiment, when recommending media data, the electronic device acquires a first action sequence. Exemplarily, the first action sequence is pre-stored data. For example, the electronic device records and stores the interactive actions performed by a first user on at least one piece of first media data, and then, in response to a media data recommendation instruction for the first user, acquires the first action sequence from the pre-stored data. Optionally, the media data recommendation instruction may be triggered and generated when the application starts, or it may be triggered and generated based on the first user's refresh operation on the media data.

[0028] Step S202: Obtain the causal media features of the first media data.

[0029] In this embodiment of the application, when the first media data contained in the first behavior sequence is obtained, the electronic device obtains the causal media features of the first media data. Here, the causal media features refer to the fused features of the media data obtained after causal filtering based on the interaction scenarios and interaction behaviors of the media data.

[0030] In one possible implementation, in order to improve the real-time performance of causal media features, the electronic device performs causal filtering on the first media data in real time after acquiring the first media data contained in the first action sequence to obtain the causal media features of the first media data.

[0031] In another possible implementation, in order to improve the recommendation efficiency of media data, for each candidate media data in the media database, causal filtering is performed on each candidate media data in advance to obtain the causal media features of each candidate media data. After obtaining the first media data contained in the first action sequence, the causal media features of the first media data are obtained from the causal media features of the candidate media data that have been stored.

[0032] Step S203: Encode the first row sequence to obtain the first row feature.

[0033] In this embodiment of the application, after obtaining the first behavior sequence, the electronic device encodes the first behavior sequence to obtain a first behavior feature. The first behavior feature is used to characterize the historical interaction behavior features of the first user.

[0034] For example, an electronic device encodes a first behavioral feature using a Transformer encoder to obtain the first behavioral feature.

[0035] Step S204: Perform feature fusion on the first behavioral feature and the causal media features of each first media data to obtain the first user feature.

[0036] In this embodiment of the application, after obtaining the first behavioral feature and the causal media features of each of the first media data, feature fusion is performed on the first behavioral feature and the causal media features of each of the first media data to obtain the first user feature.

[0037] For example, taking songs as media data, the electronic device uses a cross-modal Transformer attention mechanism to fuse the first behavioral features and the causal media features of each first media data point. The formula is as follows: ; Among them, Q user As the first behavioral characteristic, W q W k W v For the learnable weight matrix, d k =256 is the attention head dimension, E causal As a causal media feature, K audio For the audio side, "Key", V audio The "value" on the audio side.

[0038] Step S205: Input the first user feature into the media recommendation model to obtain the recommendation result.

[0039] In this embodiment, after obtaining the first user characteristics, the electronic device inputs the first user characteristics into the media recommendation model to obtain recommendation results. The recommendation results include multiple recommended media data for the first user.

[0040] The media data recommendation method provided in this embodiment obtains a first user feature by fusing a first behavioral feature and causal media features of the first media data. The causal media feature is obtained by causal filtering through interaction scenarios and interaction behaviors. Causal-driven cross-modal fusion makes the first user feature more accurate, thereby improving the recommendation effect of media data. Moreover, the first behavioral sequence is used to characterize the interaction behavior performed by the first user on at least one piece of first media data. The first behavioral feature is obtained by encoding the first behavioral sequence. The first user feature is obtained by fusing features from the perspectives of historical interaction first media data and historical interaction behaviors, which further improves the accuracy of the first user feature. Media data recommendation based on accurate first user features makes the recommendation results more in line with user needs. It helps to avoid the waste of server resources caused by continuous and large amounts of erroneous calculations and recommendations, reduces data storage pressure and data processing pressure. The recommendation results that meet user needs help to avoid redundant operations on the client side, reduce the invalid computing load of the terminal processor and the overall power consumption.

[0041] This embodiment provides a media data recommendation method, which can be used in the client of the aforementioned terminal device or the aforementioned server (hereinafter collectively referred to as electronic device). Figure 3 This is a flowchart of a media data recommendation method according to an embodiment of this application, such as... Figure 3 As shown, the process includes the following steps: Step S301: Obtain the first row as a sequence.

[0042] The above steps S301 and Figure 2 Step S201 in the embodiment is similar; see details below. Figure 2 Examples are not detailed here.

[0043] Step S302: Obtain the causal media features of the first media data.

[0044] Specifically, step S302 includes: Step S3021: Obtain the multidimensional features of the first media data, as well as the interaction scenarios and behaviors of the first user with respect to the first media data.

[0045] In this embodiment, after acquiring the first media data contained in the first behavior sequence, the electronic device acquires the multidimensional features of the first media data, as well as the interaction scenario and interaction behavior of the first user with respect to the first media data. Optionally, the multidimensional features of the first media data can be features acquired in real time or features acquired in advance.

[0046] For example, the multidimensional features include basic physical features, structural features, and emotional features. Taking songs as an example of media data, basic physical features include rhythm features, pitch features, loudness features, and spectrum features; structural features include melody features, timbre features, and harmonic structure features; and emotional features include 64 emotional features, covering six core emotions: joy, sadness, excitement, relaxation, anger, and calmness.

[0047] Step S3022: Using multidimensional features as independent variables, interactive scenarios as confounding variables, and interactive behaviors as dependent variables, construct a causal graph of the first media data.

[0048] In this embodiment, after acquiring the aforementioned multidimensional features, interaction scenarios, and interaction behaviors, the electronic device will construct a causal graph of the first media data, using the multidimensional features as independent variables, the interaction scenarios as confounding variables, and the interaction behaviors as dependent variables. Here, confounding variables refer to variables that are correlated with both the independent and dependent variables.

[0049] For example, the server is based on the DoWhy (end-to-end causal inference library) 0.10.1 framework and automatically constructs a causal graph of the first media data through Bayesian network structure learning.

[0050] Step S3023: Based on the backdoor path in the causal graph, perform stratified statistics on the confounding variables to obtain the conditional probabilities of the independent and dependent variables in each stratum.

[0051] In this embodiment of the application, after obtaining the causal graph of the first media data, the server performs hierarchical statistics on the confusion variables based on the backdoor path in the causal graph to obtain the conditional probabilities of the independent and dependent variables under each layer.

[0052] Step S3024: Based on the conditional probabilities of independent and dependent variables under each stratum, obtain the average causal effect of each sub-feature in the multidimensional features.

[0053] In this embodiment of the application, after obtaining the conditional probabilities of the independent and dependent variables under each of the above-mentioned layers, the average causal effect of each sub-feature in the multidimensional feature is obtained based on the conditional probabilities of the independent and dependent variables under each layer.

[0054] For example, the electronic device calculates the average causal effect of each audio feature using a backdoor criterion formula.

[0055] Step S3025: Based on the average causal effect, the multidimensional features are screened, and sub-features with an average causal effect less than the first threshold are removed to obtain the causal media features of the first media data.

[0056] In this embodiment of the application, after obtaining the average causal effect, the electronic device filters the multidimensional features based on the average causal effect, removes the sub-features whose average causal effect is less than a first threshold, and obtains the causal media features of the first media data.

[0057] For example, the first threshold can be any value, and can be flexibly set and adjusted according to time conditions. For example, the first threshold is 0.05.

[0058] Step S303: Encode the first row sequence to obtain the first row features.

[0059] Step S304: Perform feature fusion on the first behavioral feature and the causal media features of each first media data to obtain the first user feature.

[0060] Step S305: Input the first user features into the media recommendation model to obtain the recommendation results.

[0061] The above steps S303-305 and Figure 2 Steps S203-205 in the embodiment are similar; see details below. Figure 2 Examples are not detailed here.

[0062] The media data recommendation method provided in this embodiment constructs a causal graph of the first media data by using multidimensional features as independent variables, interaction scenarios as confounding variables, and interaction behaviors as dependent variables. Then, it performs hierarchical statistics on the confounding variables through backdoor paths in the causal graph, and filters the multidimensional features of the first media data by using the average causal effect to remove sub-features with an average causal effect less than a first threshold, thereby obtaining the causal media features of the first media data. That is, it removes redundant features without causal relationship. Accurate causal media features are beneficial to improving the accuracy of subsequent media data recommendations, and the removal of redundant features is beneficial to improving the recommendation efficiency of media data.

[0063] The following section will introduce this application from the perspective of model training.

[0064] This embodiment provides a training method for a media recommendation model, which can be used on the client of the aforementioned terminal device or the aforementioned server (hereinafter collectively referred to as electronic device). Figure 4 This is a flowchart illustrating the training method of the media recommendation model according to an embodiment of this application, such as... Figure 4 As shown, the process includes the following steps: Step S401: Based on the first action sequence, obtain the first media dataset corresponding to the key actions.

[0065] In this embodiment of the application, when training the media recommendation model, the electronic device obtains a first media dataset corresponding to the key actions based on the aforementioned first action sequence. The first media dataset includes multiple pieces of first media data showing that the first user has performed the key actions.

[0066] Optionally, key behaviors refer to user interactions with media data of interest. For example, key behaviors include, but are not limited to, at least one of the following: playback count exceeding a threshold, liking, favorited, downloading, sharing, etc. For example, key behaviors can be referred to as indispensable behaviors. For example, the threshold can be any value, and can be flexibly set and adjusted according to actual circumstances, such as 3, 4, 5, etc.

[0067] Step S402: Based on the first user features and the first media dataset, obtain at least one second user similar to the first user.

[0068] In this embodiment of the application, after obtaining the first media dataset, the electronic device obtains at least one second user similar to the first user based on the first user characteristics and the first media dataset.

[0069] Step S403: Based on the second action sequence and the real-time updated first action sequence, construct the dynamic reward function of the media recommendation model.

[0070] In this embodiment, after acquiring the second user, the electronic device constructs a dynamic reward function for the media recommendation model based on the second behavior sequence and the real-time updated first behavior sequence. The second behavior sequence characterizes the interactive behavior performed by the second user in response to at least one piece of second media data. For example, the second media data refers to media data in which the second user performs any interactive behavior.

[0071] Step S404: Obtain the reinforcement learning loss function of the media recommendation model based on the dynamic reward function.

[0072] In this embodiment of the application, after obtaining the dynamic reward function, the electronic device obtains the reinforcement learning loss function of the media recommendation model based on the dynamic reward function.

[0073] Step S405: Based on the first row sequence, construct a positive sample set and a negative sample set.

[0074] In this embodiment of the application, when training the media recommendation model, the electronic device constructs a positive sample set and a negative sample set based on the first action sequence described above.

[0075] Step S406: Based on the positive sample set and the negative sample set, obtain the contrastive learning loss function of the media recommendation model.

[0076] In this embodiment of the application, after obtaining the positive sample set and the negative sample set, the electronic device obtains the contrastive learning loss function of the media recommendation model based on the positive sample set and the negative sample set.

[0077] Step S407: Train the media recommendation model based on the reinforcement learning loss function and the contrastive learning loss function.

[0078] In this embodiment of the application, after obtaining the reinforcement learning loss function and the contrastive learning loss function, the electronic device trains the media recommendation model based on the reinforcement learning loss function and the contrastive learning loss function.

[0079] For example, for reinforcement learning training, the electronic device constructs a state space based on the first user's features, the first action sequence, and the one-hot encoding of the interaction scenario, and then constructs [first state space - media data recommendation action - first reward calculated by the dynamic reward function - next first state space] as the reinforcement learning training sample for the first user; similarly, a state space is constructed based on the second user's features, the second action sequence, and the one-hot encoding of the interaction scenario, and then constructs [second state space - media data recommendation action - second reward calculated by the dynamic reward function - next second state space] as the reinforcement learning training sample for the second user; then, the media recommendation model is trained using the reinforcement learning training samples of the first user and the second user, as well as the reinforcement learning loss function.

[0080] For example, for contrastive learning training, the electronic device performs contrastive learning training on the media recommendation model based on a set of positive samples, a set of negative samples, and a contrastive learning loss function.

[0081] It should be noted that the above descriptions are from the perspectives of reinforcement learning training and contrastive learning training respectively. In actual training, reinforcement learning training and contrastive learning training are carried out simultaneously. For example, the electronic device uses the reinforcement learning loss function Loss... ppo and contrastive learning loss function Loss cf We perform weighted fusion to obtain the total loss function Loss of the media recommendation model. total = 0.7 × Loss ppo + 0.3×Loss cf Furthermore, the media recommendation model is trained based on the total loss function until the total loss function converges, thus confirming that the media recommendation model training is complete.

[0082] It should also be noted that the above 0.7 and 0.3 are preset parameters, which can be flexibly set and adjusted according to the actual situation.

[0083] It should also be noted that, as can be seen from the real-time updated first-line sequence, the above describes the online derivation process of the media recommendation model. In actual training, the media recommendation model also has an offline training process and an incremental learning process. For example, in the offline training process, the first-line sequence cannot be updated in real time. Therefore, the electronic device constructs a dynamic reward function based on the second-line sequence and the first-line sequence. The remaining steps are the same as in the online derivation process to achieve offline training of the media recommendation model. For example, in the incremental learning process, the electronic device performs incremental learning training on the media recommendation model based on the feedback results from the first user regarding the aforementioned recommended media data.

[0084] For example, the structure in a media recommendation model can be summarized as a selector agent and a recommender agent. For example, the selector agent is used to acquire the aforementioned second user, and the recommender agent is used to acquire the aforementioned recommended media data.

[0085] The media recommendation model training method provided in this embodiment expands the first user's features to include similar second users. That is, the media recommendation model is trained based on the first and second users. When the first user is a new user, resulting in sparse training data, the similar second users can effectively solve the problem of sparse training data, thereby improving the accuracy of model training by increasing the amount of training data. Moreover, a reinforcement learning loss function is constructed through a dynamic reward function, which improves the accuracy of model training from the perspective of reinforcement learning. Furthermore, the dynamic reward function is constructed through a real-time updated first action sequence, enabling online real-time training of the model. As time goes by, the trained media recommendation model can still adapt to the first user.

[0086] In an exemplary embodiment, step S402 includes: Step S4021: Obtain the first similarity between the first user feature and each candidate user feature.

[0087] In this embodiment of the application, when acquiring a second user, the electronic device acquires a first similarity between the features of the first user and the features of each candidate user. The first similarity is used to measure the similarity between users from the perspective of user features.

[0088] For example, the acquisition method of candidate user features is similar to that of the first user features mentioned above, as described above, and will not be repeated here.

[0089] Step S4022: Based on the candidate behavior sequence, obtain the second media dataset corresponding to the key behavior.

[0090] In this embodiment of the application, when acquiring a second user, the electronic device acquires a second media dataset corresponding to key behaviors based on candidate behavior sequences. The candidate behavior sequence characterizes the interactive behaviors performed by the candidate user in response to at least one candidate media data set. Candidate media data refers to media data in which the candidate user performs any interactive behavior. The second media dataset includes multiple candidate media data sets in which the candidate user has performed key behaviors.

[0091] Step S4023: Obtain the second similarity between the first media dataset and each of the second media datasets.

[0092] In this embodiment, after acquiring the first media dataset and the second media dataset, the electronic device acquires a second similarity between the first media dataset and each of the second media datasets. This second similarity is used to measure the similarity between users from a behavioral overlap dimension. For example, behavioral overlap refers to having performed key behaviors on similar media data.

[0093] For example, the electronic device obtains a second similarity between the first media dataset and each of the second media datasets based on the causal media features of each first media data in the first media dataset and the causal media features of each candidate media data in the second media dataset.

[0094] Step S4024: Perform a weighted fusion of the first similarity and the second similarity to obtain the total similarity between the first user and each candidate user.

[0095] In this embodiment of the application, after obtaining the first similarity and the second similarity, the electronic device performs a weighted fusion of the first similarity and the second similarity to obtain the total similarity between the first user and each candidate user.

[0096] For example, the first similarity is The second similarity is The overall similarity is: ; Where u represents the first user, u' represents the second user, and E fusion (u) represents the first user characteristic, E fusion (u') represents the second user feature, B(u) represents the first media dataset, and B(u') represents the second media dataset.

[0097] It should be noted that the above 0.6 and 0.4 are preset parameters, and these preset parameters can be flexibly set and adjusted according to the actual situation.

[0098] Step S4025: The candidate users whose total similarity is greater than the second threshold are identified as the third users.

[0099] In this embodiment of the application, after obtaining the total similarity, the electronic device determines the candidate user whose total similarity is greater than the second threshold as the third user.

[0100] For example, the second threshold can be any value, and can be flexibly set and adjusted according to the actual situation.

[0101] Step S4026: Filter the third user based on the third action sequence to obtain the second user.

[0102] In this embodiment, after obtaining the aforementioned third user, the electronic device filters the third user based on a third behavior sequence to obtain a second user. The third behavior sequence characterizes the interactive behavior performed by the third user in response to at least one third media data, where the third media data refers to media data in which the third user performs any interactive behavior.

[0103] Specifically, step S4026 includes: Step S4026a: Based on the third action sequence, obtain the third media dataset corresponding to the key actions.

[0104] In this embodiment, after acquiring the aforementioned third user, the electronic device obtains a third media dataset corresponding to the key actions based on the third action sequence. The third media dataset includes multiple third media data points showing that the third user has performed the key actions.

[0105] Step S4026b: Cluster the third media dataset to obtain the distribution probability of the third user in each interest cluster.

[0106] In this embodiment of the application, after obtaining the aforementioned third media dataset, the electronic device clusters the third media dataset to obtain the distribution probability of the third user in each interest cluster.

[0107] For example, an interest cluster can be used to represent a media type. Taking music and dance as an example, interest clusters could include rock, hip-hop, traditional Chinese music, folk music, etc.

[0108] Step S4026c: Based on the distribution probability of the third user in each interest cluster, obtain the cluster entropy of the third user.

[0109] In this embodiment of the application, after obtaining the distribution probability of the third user in each interest cluster, the electronic device obtains the cluster entropy of the third user based on the distribution probability of the third user in each interest cluster.

[0110] For example, the clustering entropy (Diversity) of the third user is: ; Where U'' refers to the third user set, p(c) is the probability distribution of the third user set in the K interest clusters, and c refers to the interest cluster in the K interest clusters.

[0111] Step S4026d: The total similarity and clustering entropy of the third user are weighted and fused to obtain the target parameters of the third user.

[0112] In this embodiment of the application, after obtaining the total similarity and clustering entropy of the third user, the electronic device performs a weighted fusion of the total similarity and clustering entropy of the third user to obtain the target parameters of the third user.

[0113] For example, the target parameter Score(u, u'') is: ; Where α = 0.7 is the balance coefficient. For example, this balance coefficient can be flexibly set and adjusted according to the actual situation.

[0114] Step S4026e: The third user whose target parameter is greater than the third threshold is identified as the second user.

[0115] In this embodiment of the application, after obtaining the target parameters, the electronic device determines the third user whose target parameters are greater than the third threshold as the second user.

[0116] For example, the third threshold can be any value, and can be flexibly set and adjusted according to the actual situation. Of course, in other possible implementations, the electronic device may designate the n third users with the largest values ​​of the target parameter as second users. Here, n is a positive integer, and can be flexibly set and adjusted according to the actual situation.

[0117] The training method of the media recommendation model provided in this embodiment determines the total similarity by combining the first similarity between the first user's features and the features of each candidate user with the second similarity between the first media dataset and the second media dataset. Based on the total similarity, a third user similar to the first user is identified, and then a second user is selected from the third user. By performing similarity selection from both feature and media dataset perspectives, the selected second user has better similarity characteristics with the first user, thus making the subsequently trained media recommendation model more suitable for the first user. Moreover, both the first and second media datasets are media datasets corresponding to key behaviors. The limitation of key behaviors further improves the similarity between the second user and the first user, and reasonable media data selection helps to improve the model training efficiency.

[0118] Furthermore, by using the third behavior sequence, the third media dataset corresponding to the key behavior is obtained. Then, the third media dataset is clustered to obtain the distribution probability of the third user in each interest cluster, thus obtaining the clustering entropy of the third user. The total similarity and clustering entropy of the third user are weighted and fused to obtain the target parameter of the third user. The third user whose target parameter is greater than the third threshold is identified as the second user. When further selecting the second user from the third user, the similarity with the first user is considered based on the total similarity, and the diversity among the second users is considered based on the clustering entropy. The diverse and similar second users improve the accuracy of subsequent model training while retaining a certain degree of diversity in the personalization of the first user, which helps to avoid recommending homogeneous media data to the first user in the long term.

[0119] In an exemplary embodiment, step S403 includes: Step S4031: Obtain the reward coefficient for each interactive behavior.

[0120] In this embodiment of the application, when constructing the dynamic reward function, the electronic device obtains the reward coefficients of each interactive behavior.

[0121] For example, the reward coefficient for interactive behavior is a preset value, which can be flexibly set and adjusted according to the actual situation. For example, the reward coefficient for adding to favorites is +1.0, the reward coefficient for completing a play is +0.8, the reward coefficient for replaying is +0.6, the reward coefficient for clicking is +0.3, the reward coefficient for quickly switching within 10 seconds is -0.5, and the reward coefficient for switching within 10-30 seconds is -0.2.

[0122] Step S4032: Based on the interactive behaviors contained in each second behavior sequence and the reward coefficient of each interactive behavior, obtain the aggregate reward of the second user set.

[0123] In this embodiment of the application, after obtaining the above-mentioned reward coefficient, the electronic device obtains the aggregate reward of the second user set based on the interactive behaviors contained in each second behavior sequence and the reward coefficient of each interactive behavior.

[0124] For example, the aggregated reward of the second user set for: ; Where r(u', a) is the historical interaction reward of the second user u' for action a (recommended media data), obtained based on the reward coefficient of each interaction behavior.

[0125] Step S4033: Based on the real-time updated sequence of first actions and the reward coefficients of each interactive action, obtain the aggregated reward for the first user.

[0126] In this embodiment of the application, after obtaining the above-mentioned reward coefficients, the electronic device obtains the aggregate reward of the first user based on the real-time updated first behavior sequence and the reward coefficients of each interactive behavior.

[0127] For example, the aggregate reward r of the first user real The method for obtaining aggregated rewards is similar to that for the second user set mentioned above.

[0128] Step S4034: Based on dynamic weights, the aggregated rewards of the second user set and the aggregated rewards of the first user set are weighted and fused to construct a dynamic reward function.

[0129] In this embodiment, after obtaining the aggregated reward, the aggregated rewards of the second user set and the aggregated rewards of the first user are weighted and fused based on dynamic weights to construct a dynamic reward function. The dynamic weights of the second user set are negatively correlated with the data sparsity represented by the real-time updated first action sequence, and the sum of the dynamic weights of the second user set and the first user set is 1.

[0130] For example, the sparser the data represented by the real-time updated first row sequence, the more sparse the data indicates that the first user is a new user, the greater the dynamic weight of the second user set, and the smaller the dynamic weight of the first user set; the more abundant the data represented by the real-time updated first row sequence, the more abundant the data indicates that the first user is an old user, the smaller the dynamic weight of the second user set, and the greater the dynamic weight of the first user set.

[0131] Specifically, step S4034 includes: Step S4034a: Based on dynamic weights, the aggregated reward of the second user set and the aggregated reward of the first user set are weighted and merged to obtain the total aggregated reward.

[0132] In this embodiment of the application, after obtaining the above-mentioned aggregated reward, the electronic device performs a weighted fusion of the aggregated reward of the second user set and the aggregated reward of the first user based on the above-mentioned dynamic weight to obtain the total aggregated reward.

[0133] Step S4034b: Based on the aggregated reward of the second user set and the reward coefficient of each interactive behavior, obtain the first penalty item.

[0134] In this embodiment, after obtaining the aggregated reward of the second user set, the electronic device obtains a first penalty term based on the aggregated reward of the second user set and the reward coefficient of each interactive behavior. The first penalty term characterizes the consistency of feedback from each second user in the second user set regarding the second media data when recommending the second media data.

[0135] For example, the first penalty term P is: .

[0136] Step S4034c: Obtain the second penalty term based on the dynamic parameters and the first penalty term.

[0137] In this embodiment of the application, when obtaining the first penalty term, the electronic device obtains a second penalty term based on the dynamic parameters and the first penalty term. The dynamic parameters are negatively correlated with the model training period; that is, in the early stages of model training, the dynamic parameters are large because the training data of the first user is sparse; in the later stages of model training, the dynamic parameters are small because the training data of the first user is sufficient.

[0138] For example, dynamic parameters for: ; Where σ is the S-shaped time decay function.

[0139] Step S4034d: Construct a dynamic reward function based on the total aggregate reward and the second penalty term.

[0140] In this embodiment of the application, after obtaining the total aggregate reward and the second penalty term, the electronic device constructs a dynamic reward function based on the total aggregate reward and the second penalty term.

[0141] For example, the dynamic reward function R total for: ; in, The above refers to the dynamic weights.

[0142] The training method of the media recommendation model provided in this embodiment obtains the aggregated reward of the first user and the aggregated reward of the second user set by combining the reward coefficients of each interaction behavior with the first behavior sequence and the second behavior sequence. Based on dynamic weights, the aggregated reward of the second user set and the aggregated reward of the first user are weighted and fused to construct a dynamic reward function. The dynamic weight of the second user set is negatively correlated with the data sparsity represented by the real-time updated first behavior sequence. That is, when the training data of the first user is sparse (new user), the second user corresponds to a high dynamic weight to make up for the lack of training data. When the training data of the first user is sufficient (old user), the second user corresponds to a low dynamic weight to reduce the influence of non-"the first user" on the model training, so that the trained media recommendation model is accurate and can better adapt to the first user.

[0143] Furthermore, based on the total aggregated reward, a first penalty term is obtained based on the aggregated reward of the second user set and the reward coefficients of each interaction behavior. This first penalty term is used to characterize the consistency of feedback from each second user in the second user set to the second media data when recommending the second media data. A dynamic reward function is constructed based on the first penalty term, which improves the accuracy of the dynamic reward function and thus improves the accuracy of subsequent model training. Moreover, a second penalty term is obtained by combining the first penalty term with dynamic parameters, and the dynamic parameters are negatively correlated with the model training period. That is, in the early stage of model training, due to the sparse training data of the first user (new user), the high dynamic parameters make the second penalty term constructed based on the aggregated reward of the second user set play an important role in the dynamic reward function. In the later stage of model training, due to the sufficient training data of the first user (old user), the low dynamic parameters make the second penalty term play a less important role in the dynamic reward function. The importance of the first user and the second user is flexibly changed with the change of the training period, which further makes the trained media recommendation model more accurate and better adapted to the first user.

[0144] In an exemplary embodiment, step S405 includes: Step S4051: Based on the first behavior sequence and the reward coefficient of each interactive behavior, obtain the behavior weight of each first media data.

[0145] In this embodiment of the application, when acquiring positive and negative samples, the electronic device acquires the behavioral weight of each first media data based on the aforementioned first behavior sequence and the reward coefficient of each interactive behavior.

[0146] For example, the behavior weight Score(s) is: ; Wherein, B(s) is the set of interactive behaviors of the first user on media data s (i.e. the aforementioned first media data), and w(b) is the reward coefficient of interactive behavior b.

[0147] Step S4052: First media data with a behavior weight greater than the first target value are identified as positive samples. And, first media data with a behavior weight less than the second target value are identified as negative samples.

[0148] In this embodiment of the application, after obtaining the above-mentioned behavior weights, the electronic device determines the first media data with a behavior weight greater than the first target value as a positive sample; and determines the first media data with a behavior weight less than the second target value as a negative sample.

[0149] For example, the first target value and the second target value can be any numerical value, and can be flexibly set and adjusted according to the actual situation. For example, the first target value is 0.8 and the second target value is 0.3.

[0150] For example, when acquiring positive samples, the electronic device determines the first media data with a behavior weight greater than a first target value and an interaction number greater than a third target value as the first candidate positive sample; performs interest clustering on the causal media features of the first media data contained in the first behavior sequence to obtain the intensity of each interest cluster; determines the first media dataset contained in the interest cluster with an intensity greater than a fourth target value as the second candidate positive sample; and takes the intersection of the first candidate positive sample set and the second candidate positive sample set to obtain the positive sample.

[0151] For example, the third and fourth target values ​​can be any values, and can be flexibly set and adjusted according to the actual situation. For example, the third target value is 2, and the fourth target value is 0.6.

[0152] For example, when acquiring negative samples, the electronic device will identify the first media data with a behavior weight less than the second target value and an interaction duration less than the fifth target value as the first candidate negative sample; perform interest clustering on the causal media features of the first media data contained in the first behavior sequence to obtain the strength of each interest cluster (i.e., the above interest clustering); identify the first media dataset contained in the interest cluster with a strength less than the sixth target value as the second candidate negative sample; and take the intersection of the first candidate negative sample set and the second candidate negative sample set to obtain the negative sample.

[0153] For example, the fifth and sixth target values ​​can be any values, and can be flexibly set and adjusted according to the actual situation. For example, the fifth target value is 10 seconds, and the fourth target value is 0.4 seconds.

[0154] For example, the cluster interest strength (c) is: ; Where C(c) is the set of media data in interest cluster c.

[0155] Step S4053: Based on the causal media features of the positive samples and the causal media features of each candidate media data, obtain the first similarity between the positive samples and each candidate media data; and based on the causal media features of the negative samples and the causal media features of each candidate media data, obtain the second similarity between the negative samples and each candidate media data.

[0156] In this embodiment of the application, after obtaining the positive sample and the negative sample, the electronic device obtains a first similarity between the positive sample and each candidate media data based on the causal media features of the positive sample and the causal media features of each candidate media data; and obtains a second similarity between the negative sample and each candidate media data based on the causal media features of the negative sample and the causal media features of each candidate media data.

[0157] Step S4054: Determine the candidate media data with a first similarity greater than the first target value as extended positive samples, the positive sample set including positive samples and extended positive samples; determine the candidate media data with a second similarity greater than the second target value as extended negative samples, the negative sample set including negative samples and extended negative samples.

[0158] In this embodiment of the application, after obtaining the first similarity and the second similarity, the electronic device determines the candidate media data with the first similarity greater than the first target value as extended positive samples, and the positive sample set includes positive samples and extended positive samples; and determines the candidate media data with the second similarity greater than the second target value as extended negative samples, and the negative sample set includes negative samples and extended negative samples.

[0159] For example, the first target value and the second target value can be any values, and the first target value and the second target value can be flexibly set and adjusted according to the actual situation.

[0160] For example, the contrastive learning loss function is: ; Where F(.) is the sequence feature extraction function (obtained by processing the sequence through a Transformer encoder), Sim(.) is the cosine similarity, τ=0.07 is the temperature parameter, CF+ is the set of positive samples, CF- is the set of negative samples, and O is the original sample set consisting of the first media dataset contained in the first row of the sequence. For example, one O corresponds to three CF-, that is, the above cf- includes three CF-.

[0161] The training method of the media recommendation model provided in this embodiment evaluates the behavioral weight of each first media data by the reward coefficient of the interaction behavior. Based on the behavioral weight, it can more accurately distinguish between positive and negative samples, which improves the accuracy of model training from the perspective of contrastive learning. Furthermore, it expands the positive and negative samples based on causal media features, and the causal media features can more accurately represent the media features of causal relationships, which improves the accuracy of the expanded positive and negative samples. While solving the problem of sparse training data, it can effectively ensure the accuracy of model training.

[0162] This embodiment also provides a media data recommendation device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0163] This embodiment provides a media data recommendation device, such as... Figure 5 As shown, it includes: The first sequence acquisition module 501 is used to acquire a first behavior sequence; wherein the first behavior sequence is used to characterize the interactive behavior performed by the first user in response to at least one first media data; The causal feature acquisition module 502 is used to acquire the causal media features of the first media data; wherein, the causal media features refer to the fusion features of the media data obtained after causal filtering based on the interaction scenarios and interaction behaviors of the media data; The first sequence encoding module 503 is used to encode the first action sequence to obtain the first action feature; The first feature acquisition module 504 is used to perform feature fusion on the first behavioral feature and the causal media features of each of the first media data to obtain the first user feature; The recommendation result acquisition module 505 is used to input the first user features into the media recommendation model to obtain recommendation results; wherein, the recommendation results include multiple recommended media data for the first user.

[0164] In some optional implementations, the causal feature acquisition module 502 is used for: Obtain the multidimensional features of the first media data, as well as the interaction scenarios and behaviors of the first user with respect to the first media data; Using the multidimensional features as independent variables, the interaction scenario as a confounding variable, and the interaction behavior as a dependent variable, a causal graph of the first media data is constructed. Based on the backdoor path in the causal graph, the confounding variables are statistically analyzed in layers to obtain the conditional probabilities of the independent and dependent variables in each layer. Based on the conditional probabilities of the independent and dependent variables at each level, the average causal effect of each sub-feature in the multidimensional feature is obtained. Based on the average causal effect, the multidimensional features are filtered, and sub-features with an average causal effect less than a first threshold are removed to obtain the causal media features of the first media data.

[0165] In some alternative embodiments, the apparatus further includes: The first key acquisition module is used to acquire the first media dataset corresponding to the key behavior based on the first behavior sequence; The similar user acquisition module is used to acquire at least one second user similar to the first user based on the first user's features and the first media dataset. A reward function construction module is used to construct a dynamic reward function for the media recommendation model based on a second behavior sequence and a first behavior sequence that is updated in real time; wherein, the second behavior sequence is used to characterize the interaction behavior performed by the second user in response to at least one piece of second media data; The first loss acquisition module is used to acquire the reinforcement learning loss function of the media recommendation model based on the dynamic reward function; A sample construction module is used to construct a positive sample set and a negative sample set based on the first behavior sequence; The second loss acquisition module is used to acquire the contrastive learning loss function of the media recommendation model based on the positive sample set and the negative sample set. The model training module is used to train the media recommendation model based on the reinforcement learning loss function and the contrastive learning loss function.

[0166] In some alternative implementations, the similar user acquisition module includes: The first acquisition unit is used to acquire the first similarity between the first user feature and each candidate user feature; The second key acquisition unit is used to acquire a second media dataset corresponding to a key behavior based on a candidate behavior sequence; wherein the candidate behavior sequence is used to characterize the interactive behavior performed by a candidate user on at least one candidate media dataset; The second acquisition unit is used to acquire the second similarity between the first media dataset and each of the second media datasets; The similarity fusion unit is used to perform weighted fusion of the first similarity and the second similarity to obtain the total similarity between the first user and each candidate user; The third user acquisition unit is used to identify candidate users whose total similarity is greater than the second threshold as third users. The third user filtering unit is used to filter the third user based on a third behavior sequence to obtain the second user; wherein the third behavior sequence is used to characterize the interaction behavior performed by the third user in response to at least one third media data.

[0167] In some alternative implementations, the third user filtering unit is used for: Based on the third action sequence, obtain the third media dataset corresponding to the key action; Cluster the third media dataset to obtain the distribution probability of the third user in each interest cluster; Based on the distribution probability of the third user in each interest cluster, the clustering entropy of the third user is obtained; The target parameters of the third user are obtained by weighted fusion of the total similarity and clustering entropy of the third user. The third user whose target parameter is greater than the third threshold is identified as the second user.

[0168] In some optional implementations, the reward function construction module is used for: A reward coefficient acquisition unit is used to acquire the reward coefficient for each of the interactive behaviors. The second reward acquisition unit is used to acquire the aggregate reward of the second user set based on the interactive behaviors contained in each of the second behavior sequences and the reward coefficient of each of the interactive behaviors. The first reward acquisition unit is used to acquire the aggregate reward of the first user based on the real-time updated first behavior sequence and the reward coefficient of each of the interactive behaviors. The reward function construction unit is used to construct the dynamic reward function by weighting and fusing the aggregated reward of the second user set and the aggregated reward of the first user based on dynamic weights. The dynamic weights of the second user set are negatively correlated with the data sparsity represented by the real-time updated first behavior sequence.

[0169] In some optional implementations, the reward function construction unit is used for: The aggregated reward of the second user set and the aggregated reward of the first user set are weighted and fused based on the dynamic weights to obtain the total aggregated reward; Based on the aggregated reward of the second user set and the reward coefficient of each of the interactive behaviors, a first penalty term is obtained; wherein, the first penalty term is used to characterize the consistency of feedback of each second user in the second user set to the second media data when recommending the second media data; A second penalty term is obtained based on the dynamic parameters and the first penalty term; wherein, the dynamic parameters are negatively correlated with the model training period; The dynamic reward function is constructed based on the total aggregate reward and the second penalty term.

[0170] In some alternative implementations, the sample construction module is used for: Based on the first behavior sequence and the reward coefficient of each of the interactive behaviors, obtain the behavior weight of each of the first media data. The first media data with a behavior weight greater than the first target value is identified as a positive sample; and the first media data with a behavior weight less than the second target value is identified as a negative sample. Based on the causal media features of the positive samples and the causal media features of each candidate media data, a first similarity degree between the positive samples and each candidate media data is obtained; and based on the causal media features of the negative samples and the causal media features of each candidate media data, a second similarity degree between the negative samples and each candidate media data is obtained. Candidate media data with a first similarity greater than a first target value are identified as extended positive samples, and the positive sample set includes the positive samples and the extended positive samples; candidate media data with a second similarity greater than a second target value are identified as extended negative samples, and the negative sample set includes the negative samples and the extended negative samples.

[0171] The media data recommendation apparatus provided in this application can execute the media data recommendation method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0172] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0173] The following is a detailed reference. Figure 6 This diagram illustrates a suitable structural schematic for implementing the electronic device described in the embodiments of this application. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from memory 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the electronic device. The processor 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0174] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0175] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a memory 608, or installed from a ROM 602. When the computer program is executed by the processor 601, it performs the functions defined in the media data recommendation method of embodiments of this application.

[0176] Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0177] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the media data recommendation method shown in the above embodiments is implemented.

[0178] For example, the electronic device is the target terminal device.

[0179] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0180] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.

Claims

1. A media data recommendation method, characterized in that, The method includes: Obtain a first behavior sequence; wherein the first behavior sequence is used to characterize the interactive behavior performed by a first user in response to at least one first media data; Obtain the causal media features of the first media data; wherein, the causal media features refer to the fusion features of the media data obtained after causal filtering based on the interaction scenarios and interaction behaviors of the media data; Encode the first action sequence to obtain the first action feature; The first user feature is obtained by feature fusion of the first behavioral feature and the causal media features of each of the first media data. The first user's features are input into the media recommendation model to obtain recommendation results; wherein, the recommendation results include multiple recommended media data for the first user.

2. The method according to claim 1, characterized in that, The acquisition of the causal media features of the first media data includes: Obtain the multidimensional features of the first media data, as well as the interaction scenarios and behaviors of the first user with respect to the first media data; Using the multidimensional features as independent variables, the interaction scenario as a confounding variable, and the interaction behavior as a dependent variable, a causal graph of the first media data is constructed. Based on the backdoor path in the causal graph, the confounding variables are statistically analyzed in layers to obtain the conditional probabilities of the independent and dependent variables in each layer. Based on the conditional probabilities of the independent and dependent variables under each layer, the average causal effect of each sub-feature in the multidimensional feature is obtained; Based on the average causal effect, the multidimensional features are filtered, and sub-features whose average causal effect is less than a first threshold are removed to obtain the causal media features of the first media data.

3. The method according to claim 1, characterized in that, The training methods for the media recommendation model include: Based on the first behavior sequence, obtain the first media dataset corresponding to the key behaviors; Based on the first user characteristics and the first media dataset, at least one second user similar to the first user is obtained; Based on the second behavior sequence and the first behavior sequence updated in real time, a dynamic reward function for the media recommendation model is constructed; wherein, the second behavior sequence is used to characterize the interaction behavior performed by the second user in response to at least one piece of second media data; Based on the dynamic reward function, obtain the reinforcement learning loss function of the media recommendation model; Based on the first behavior sequence, construct a positive sample set and a negative sample set; Based on the positive sample set and the negative sample set, obtain the contrastive learning loss function of the media recommendation model; The media recommendation model is trained based on the reinforcement learning loss function and the contrastive learning loss function.

4. The method according to claim 3, characterized in that, The step of obtaining at least one second user similar to the first user based on the first user characteristics and the first media dataset includes: Obtain the first similarity between the first user feature and each candidate user feature; Based on the candidate behavior sequence, a second media dataset corresponding to the key behavior is obtained; wherein, the candidate behavior sequence is used to characterize the interactive behavior performed by the candidate user on at least one candidate media dataset; Obtain the second similarity between the first media dataset and each of the second media datasets; The first similarity and the second similarity are weighted and fused to obtain the total similarity between the first user and each candidate user; Candidate users whose total similarity is greater than the second threshold are identified as third users; The second user is obtained by filtering the third user based on the third behavior sequence; wherein the third behavior sequence is used to characterize the interaction behavior performed by the third user in response to at least one third media data.

5. The method according to claim 4, characterized in that, The step of filtering the third user based on the third behavior sequence to obtain the second user includes: Based on the third action sequence, obtain the third media dataset corresponding to the key action; Cluster the third media dataset to obtain the distribution probability of the third user in each interest cluster; Based on the distribution probability of the third user in each interest cluster, the clustering entropy of the third user is obtained; The target parameters of the third user are obtained by weighted fusion of the total similarity and clustering entropy of the third user. The third user whose target parameter is greater than the third threshold is identified as the second user.

6. The method according to claim 3, characterized in that, The dynamic reward function for constructing the media recommendation model based on the second action sequence and the real-time updated first action sequence includes: Obtain the reward coefficient for each of the aforementioned interactive behaviors; Based on the interactive behaviors contained in each of the second behavioral sequences and the reward coefficient of each of the interactive behaviors, the aggregate reward of the second user set is obtained; Based on the real-time updated sequence of the first behavior and the reward coefficient of each of the interactive behaviors, the aggregate reward of the first user is obtained. The dynamic reward function is constructed by weighting and fusing the aggregated reward of the second user set and the aggregated reward of the first user set based on dynamic weights. The dynamic weights of the second user set are negatively correlated with the data sparsity represented by the real-time updated first behavior sequence.

7. The method according to claim 6, characterized in that, The step of weighting and fusing the aggregated reward of the second user set and the aggregated reward of the first user set based on dynamic weights to construct the dynamic reward function includes: The aggregated reward of the second user set and the aggregated reward of the first user set are weighted and fused based on the dynamic weights to obtain the total aggregated reward; Based on the aggregated reward of the second user set and the reward coefficient of each of the interactive behaviors, a first penalty term is obtained; wherein, the first penalty term is used to characterize the consistency of feedback of each second user in the second user set to the second media data when recommending the second media data; A second penalty term is obtained based on the dynamic parameters and the first penalty term; wherein, the dynamic parameters are negatively correlated with the model training period; The dynamic reward function is constructed based on the total aggregate reward and the second penalty term.

8. The method according to claim 3, characterized in that, The step of constructing a positive sample set and a negative sample set based on the first behavioral sequence includes: Based on the first behavior sequence and the reward coefficient of each of the interactive behaviors, obtain the behavior weight of each of the first media data. The first media data with a behavior weight greater than the first target value is identified as a positive sample; and the first media data with a behavior weight less than the second target value is identified as a negative sample. Based on the causal media features of the positive samples and the causal media features of each candidate media data, a first similarity degree between the positive samples and each candidate media data is obtained; and based on the causal media features of the negative samples and the causal media features of each candidate media data, a second similarity degree between the negative samples and each candidate media data is obtained. The candidate media data with the first similarity greater than the first target value are determined as extended positive samples, and the positive sample set includes the positive samples and the extended positive samples; the candidate media data with the second similarity greater than the second target value are determined as extended negative samples, and the negative sample set includes the negative samples and the extended negative samples.

9. A media data recommendation device, characterized in that, The device includes: A first sequence acquisition module is used to acquire a first behavior sequence; wherein the first behavior sequence is used to characterize the interactive behavior performed by a first user in response to at least one first media data; The causal feature acquisition module is used to acquire the causal media features of the first media data; wherein, the causal media features refer to the fusion features of the media data obtained after causal filtering based on the interaction scenarios and interaction behaviors of the media data; The first sequence encoding module is used to encode the first action sequence to obtain the first action feature; The first feature acquisition module is used to perform feature fusion on the first behavioral feature and the causal media features of each of the first media data to obtain the first user feature; The recommendation result acquisition module is used to input the first user's features into the media recommendation model to obtain recommendation results; wherein, the recommendation results include multiple recommended media data for the first user.

10. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the media data recommendation method according to any one of claims 1 to 8.