Method, device, storage medium and program product for ranking virtual gifts
By combining a deep learning ranking model with time decay and attention mechanisms, gift recommendations are optimized, solving the problems of accuracy and personalization in live gift recommendations, and improving the efficiency of users sending gifts and the real-time nature of gift ranking.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU SHIYINLIAN SOFTWARE TECH CO LTD
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-14
Smart Images

Figure CN122390833A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer and internet technology, and in particular to a method, device, storage medium, and program product for sorting virtual gifts. Background Technology
[0002] With the rapid development of the internet live streaming industry, live streaming has become a mainstream scenario for digital content consumption and social interaction. In live streaming rooms, features such as interactive bullet comments and virtual gift-giving are constantly being updated to enrich the live streaming experience.
[0003] In related technologies, the sorting of gifts on the gift panel in the live streaming room uses a live streaming gift recommendation method based on collaborative filtering. By analyzing users' gift-giving behavior, gift co-occurrence relationships, and live streaming room similarities, the associations between users and between items are explored, thereby recommending the most likely gifts to users in real time.
[0004] However, the feature data considered in the above recommendation methods is rather one-sided, resulting in inaccurate recommendation results that are difficult to meet the personalized and real-time gift recommendation needs in live streaming scenarios. Summary of the Invention
[0005] This application provides a method, device, storage medium, and program product for sorting virtual gifts. The technical solution provided by this application includes the following aspects.
[0006] According to one aspect of the embodiments of this application, a method for sorting virtual gifts is provided, the method comprising: Obtain the user feature vector of the target user, the user feature vector including historical gift-giving sequence features aggregated based on a time decay mechanism; Obtain gift feature vectors for multiple virtual gifts in the gift panel. The gift feature vectors include consumption frequency distribution features and consumption amount distribution features based on user consumption level and other statistical methods. The user feature vector and the gift feature vector of each virtual gift are input into a pre-trained deep learning ranking model to obtain the target user's gift preference score for each virtual gift. Based on the gift-giving preference scores of each virtual gift, the virtual gifts are sorted to determine their arrangement order in the gift panel.
[0007] According to one aspect of the embodiments of this application, a sorting device for virtual gifts is provided, the device comprising: The processing module is used to obtain the user feature vector of the target user, wherein the user feature vector includes historical gift-giving sequence features aggregated based on a time decay mechanism; The processing module is also used to obtain gift feature vectors of multiple virtual gifts in the gift panel. The gift feature vectors include consumption frequency distribution features and consumption amount distribution features based on user consumption level and other statistical methods. The input module is used to input the user feature vector and the gift feature vector of each virtual gift into a pre-trained deep learning ranking model to obtain the target user's gift preference score for each virtual gift; The sorting module is used to sort the multiple virtual gifts according to the gift-giving preference scores of each virtual gift, and determine the arrangement order of the multiple virtual gifts in the gift panel.
[0008] According to one aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-described method for sorting virtual gifts.
[0009] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, the computer program being loaded and executed by a processor to implement the above-described method for sorting virtual gifts.
[0010] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program executed by a processor to implement the above-described virtual gift sorting method.
[0011] The technical solution provided in this application can bring the following beneficial effects: By acquiring the user feature vector of the target user and the gift feature vectors of multiple virtual gifts in the gift panel, and inputting them into a pre-trained deep learning ranking model, the model obtains the target user's gift-giving preference score for each virtual gift. Based on these scores, the model ranks the virtual gifts and determines their order in the gift panel. On one hand, this effectively captures the temporal patterns of user gift-giving behavior, meeting real-time recommendation needs, mitigating data overload, and improving gift-giving efficiency. On the other hand, by introducing multi-dimensional input vectors and optimizing weight allocation through a deep learning network, the model generates personalized gift ranking results for users, satisfying their individual needs. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of a computer system provided in one embodiment of this application; Figure 2 This is a flowchart of a method for sorting virtual gifts according to an embodiment of this application; Figure 3 This is a flowchart of a method for sorting virtual gifts according to an embodiment of this application; Figure 4 This is a flowchart of a method for sorting virtual gifts according to an embodiment of this application; Figure 5 This is a flowchart of a method for sorting virtual gifts according to an embodiment of this application; Figure 6 This is a flowchart of a method for sorting virtual gifts according to an embodiment of this application; Figure 7 This is a schematic diagram of the overall flowchart of a virtual gift sorting method provided in one embodiment of this application; Figure 8 This is a schematic diagram of the product-side performance of a virtual gift sorting method provided in one embodiment of this application; Figure 9 This is a block diagram of a virtual gift sorting device provided in one embodiment of this application; Figure 10 This is a structural block diagram of a computer device provided in one embodiment of this application. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0014] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0015] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this application provide method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on conventional or non-inventive effort. For steps that do not logically have a necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application. In actual processing or when the control device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.
[0016] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.
[0017] Please refer to Figure 1 This illustration shows a schematic diagram of a computer system provided in one embodiment of this application. The computer system may include: a terminal device 10 and a server 20.
[0018] Terminal device 10 includes, but is not limited to, electronic devices such as laptops, mobile phones, tablets, smart voice interaction devices, game consoles, wearable devices, multimedia playback devices, PCs (Personal Computers), in-vehicle terminals, smart home appliances, AR (Augmented Reality) devices, and VR (Virtual Reality) devices. Terminal device 10 is a client running the target application. Optionally, the target application can be an application that needs to be downloaded and installed, or it can be a webpage or a mini-program; this embodiment does not limit this.
[0019] In this embodiment, terminal device 10 may include a broadcaster terminal device and a viewer terminal device. The broadcaster terminal device runs the broadcaster user's client and can be referred to as a broadcaster client. The viewer terminal device runs the viewer user's client and can be referred to as a viewer client. A broadcaster user refers to a user who interacts with a viewer user through a real-time video stream on the target application. A viewer user refers to a user who watches the live broadcast and interacts with the broadcaster user on the target application.
[0020] Both the broadcaster's and viewer's terminals run the target application, which is used to implement the functions involved in this application, such as starting a live stream, watching a live stream, and participating in live stream interactions. Additionally, the broadcaster's terminal is equipped with a camera to capture the live stream feed.
[0021] In this embodiment, the target application can be a live streaming application or a short video application, or any application with live streaming and / or short video playback capabilities. For example, the target application can also be at least one of the following: a music player application, a video player application, a radio player application, an audiobook application, a screen reader application, etc., or other types of applications. This embodiment does not limit the types of applications.
[0022] Server 20 is used to provide backend services for the client of the target application in terminal device 10. For example, server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but it is not limited to these.
[0023] In this embodiment, the live streaming client and the viewer client can be two clients with different functions. The broadcaster client has the function of collecting and publishing live streaming data, while the viewer client has the function of downloading and playing live streaming data. Alternatively, the broadcaster client and the viewer client can also be two clients with the same function, both having the function of collecting, publishing, downloading, and playing live streaming data. When the client is used to implement the functions of the live streaming terminal device in the system / method example of this application, the client is used as the live streaming client; when the client is used to implement the functions of the viewer terminal device in the system / method example of this application, the client is used as the viewer client.
[0024] Accordingly, both the broadcaster terminal device and the viewer terminal device are terminal devices. When the client running on the terminal device is used to implement the functions of the broadcaster client side in the system / method example of this application, the terminal device is considered a live broadcast terminal device; when the client running on the terminal device is used to implement the functions of the viewer client side in the system / method example of this application, the terminal device is considered a viewer terminal device.
[0025] For example, a viewer's client can not only watch live video streams, but also start live video streams. Similarly, a broadcaster's client can not only start live video streams, but also watch live video streams from other broadcasters. This application does not limit this.
[0026] Optionally, when a streamer is broadcasting live through a streamer's client, viewers can watch the streamer's live content through the streamer's live room displayed in the viewer's client. Viewers can interact with the streamer by commenting, sending bullet comments, connecting via voice chat, video chat, and sending virtual gifts.
[0027] Optionally, the streamer user can also be referred to as the streamer, the viewer user can be referred to as the user, and the virtual gift can be referred to as the gift. This application does not limit this.
[0028] In this embodiment, a regular gift refers to a gift that does not have user interaction attributes. Specifically, sending a gift means the gift is given to the streamer, such as a virtual gift like a rose. An interactive gift refers to a gift with interactive attributes. The interaction is reflected in the user's sense of participation. Specifically, after consuming the gift, the user can participate in a card draw, and the virtual gift drawn can be given to the current streamer.
[0029] Terminal device 10 and server 20 can communicate with each other via a network. This network can be a wired network or a wireless network.
[0030] In related technologies, collaborative filtering-based live-streaming gift recommendation methods only utilize users' historical consumption statistics and do not fully leverage user payment data. This includes user payment attributes, paid gift sequence information, gift types, and the target audience for gifts at different price points. Consequently, the recommendation results are not accurate enough and fail to meet the personalized, real-time, and tiered payment requirements of live-streaming scenarios.
[0031] Furthermore, some existing business strategies, such as comprehensive weighted ranking, combine multiple factors, such as popularity, price, and gift release time, and assign corresponding weights to each factor, calculating a comprehensive score before ranking. This method relies on manually set rules and weights, making the overall process complex and parameter adjustment costly. At the same time, there may be conflicting objectives between different influencing factors; for example, it's difficult to simultaneously consider high-priced gifts and highly popular gifts, making it difficult to uniformly optimize the strategy and effectively guarantee the stability and reasonableness of the recommendation results.
[0032] Therefore, the current gift ranking model on live streaming platforms has the following core problems: 1. The rules are logically rigid: Gifts are arranged from low to high or high to low price. Usually, low-priced gifts (such as traffic-driving gifts) are placed at the front to increase the interaction rate, while high-priced gifts (such as profit-generating gifts) are placed at the back to attract deeper consumption.
[0033] 2. Data overwhelming effect: Interactive gifts account for over 60% of the transaction volume, which is represented by a single feature of virtual gift identifiers (such as gift_id). This leads to insufficient long-tail learning of ordinary gifts (e.g., a certain ordinary gift has a high unit price but a low frequency of gifting).
[0034] 3. Ignoring interactive attributes: The traditional model fails to distinguish the differences in interaction modes between ordinary gifts (one-way gifting) and interactive gifts (card-drawing participation), and thus cannot capture users' deep preferences for interactive attributes.
[0035] In summary, the collaborative filtering-based live streaming gift recommendation method only uses users' historical consumption statistics and does not use user-side or gift-side attribute information; moreover, the weighted ranking based on factors such as popularity, price, and gift listing time may lead to conflicts between different factors, making it difficult to manually adjust the weights.
[0036] Based on this, this application proposes a personalized gift panel ranking method combining deep learning networks and attention mechanisms. The core of this method is to address the technical problem of low ranking efficiency caused by uneven distribution of user gift-giving data, particularly the data bias issue of interactive gift revenue overwhelming ordinary gift revenue. On one hand, the deep learning ranking model integrates exposure, user behavior data, and gift attributes to capture users' personalized gift-giving preferences, improving the efficiency of gift-giving within the live stream. For example, although interactive gifts generate more revenue, some users may prefer ordinary gifts; the algorithm model can distinguish different consumption behavior patterns (identifying price sensitivity, capturing gift type preferences, interactive gift preferences, etc.), enhancing personalized differentiation. On the other hand, training samples are generated based on differentiated labels for interactive and non-interactive gifts; a multi-dimensional input vector containing users' historical payment characteristics and dynamic gift consumption characteristics is constructed; and the sample weight allocation is optimized through a deep learning network to generate personalized gift ranking results for users, meeting their personalized needs.
[0037] Please refer to Figure 2 The diagram illustrates a flowchart of a method for sorting virtual gifts according to an embodiment of this application. The execution entity for each step of this method can be a computer device; for example, the computer device could be... Figure 1 The terminal device 10 or server 20 in the computer system shown. The method may include at least one of the following steps (210-240).
[0038] Step 210: Obtain the user feature vector of the target user. The user feature vector includes historical gift-giving sequence features aggregated based on a time decay mechanism.
[0039] Optionally, the server obtains the user feature vector of the target user, which includes historical gift-giving sequence features aggregated based on a time decay mechanism.
[0040] In some embodiments, the time decay mechanism refers to the process of weighting and correcting historical gift-giving behavior sequences by introducing a weight function that monotonically decreases as the time interval between the occurrence of the behavior and the current time (e.g., a gift given 2 days ago has a much higher weight than one given 30 days ago). Through the time decay mechanism, the influence of outdated behaviors on the model can be weakened, while the expression of recent gift-giving preferences, spending power, and impulsive intentions can be strengthened, thereby dynamically characterizing users' time-varying gift-giving preferences and real-time consumption intentions.
[0041] For example, the historical gift-giving identifier (gift_id) sequence of a user over the past 30 days, 15 days, 7 days, and 2 days, that is, the user's gift-giving records divided by time windows, is a sequence of gift_id corresponding to each time window. For example, the 2-day sequence is: [roses, hearts], and the 7-day sequence is: [roses, hearts, rockets].
[0042] In some embodiments, aggregation refers to combining the gift_id sequences from different time windows with time decay weights to form a historical gift-giving sequence feature that reflects a user's recent and long-term gift-giving preferences.
[0043] In some embodiments, aggregation based on time decay mechanism means that instead of simply counting all historical gift-giving records of users, the gift_id sequence is split into different time windows (such as the most recent 30 days, 15 days, 7 days, and 2 days), and higher weights are assigned to windows with more recent time (time decay). Finally, these weighted sequences are integrated (aggregation), which preserves the user's recent gift-giving preferences (such as interactive gifts given within 2 days) and also takes into account long-term habits (such as ordinary gifts given occasionally within 30 days).
[0044] For example, consider the following gift_id sequences for a user: 30 days ago: [heart, rose, bear, rocket], 15 days ago: [heart, rose, bear], 7 days ago: [heart, rose], and 2 days ago: [heart, rose]. Weights are assigned to the gift_id sequences within each time window, for example: 2 days: 0.5, 7 days: 0.3, 15 days: 0.15, 30 days: 0.05. These weights are then aggregated to obtain the historical gift-giving sequence features. For example, heart: 0.5 + 0.3 + 0.15 + 0.05 = 1.0 (interactive gift, high weight), rose: 0.5 + 0.3 + 0.15 + 0.05 = 1.0 (interactive gift), bear: 0.15 + 0.05 = 0.2 (ordinary gift, low weight but retained), rocket: 0.05 (high-end gift).
[0045] In some embodiments, historical gift-giving sequence features refer to a type of temporal feature extracted from a sequence of gifts given by a user in chronological order over a period of time. This feature is used to characterize the user's gift-giving preferences, consumption habits, activity changes, and intent trends, and serves as one of the core inputs in live-streaming gift recommendation or ranking models.
[0046] Step 220: Obtain the gift feature vectors of multiple virtual gifts in the gift panel. The gift feature vectors include the consumption frequency distribution features and consumption amount distribution features based on the user's consumption level and other statistical methods.
[0047] Optionally, the server obtains gift feature vectors for multiple virtual gifts in the gift panel. The gift feature vectors include consumption frequency distribution features and consumption amount distribution features based on user consumption level and other statistical methods.
[0048] For a detailed explanation of the distribution characteristics of consumption frequency and consumption amount based on user consumption level statistics, please refer to steps 420-450 in the following embodiments.
[0049] In some embodiments, the gift panel includes a standalone gift panel and a carrier gift panel. A standalone gift panel refers to a gift panel belonging to a single, independent live streaming app (Application), bound to the independent live streaming application, and independently handling gift display and gifting functions. A carrier gift panel refers to a gift panel belonging to a specific live streaming channel (or carrier channel) within the host app, existing as a component of a sub-live streaming scenario within the application, serving the live streaming interaction within that channel.
[0050] Step 230: Input the user feature vector and the gift feature vector of each virtual gift into the pre-trained deep learning ranking model to obtain the target user's gift preference score for each virtual gift.
[0051] Optionally, the server inputs the user feature vector and the gift feature vector of each virtual gift into a pre-trained deep learning ranking model to obtain the target user's gift-giving preference score for each virtual gift.
[0052] For a detailed explanation of the pre-trained deep learning ranking model, please refer to steps 530-540 in the embodiments below.
[0053] In some embodiments, the target user's gift-giving preference score for each virtual gift refers to a numerical indicator calculated by a model for each virtual gift currently to be sorted or recommended, used to quantify the degree to which the target user is inclined to give that virtual gift. This score comprehensively reflects the user's historical gift-giving behavior, gift attribute matching degree, temporal preference, consumption habits, and real-time intent. The higher the score, the more likely the user is to choose to give that virtual gift, and the higher it should be ranked in the gift panel.
[0054] Step 240: Sort the virtual gifts according to their gift-giving preference scores and determine their order in the gift panel.
[0055] Optionally, the server sorts multiple virtual gifts based on their gift-giving preference scores to determine the order in which they are arranged in the gift panel.
[0056] Correspondingly, the user terminal device interface displays a gift panel after sorting multiple virtual gifts, making it easier for users to select and send personalized gifts that suit their own habits.
[0057] The technical solution provided in this application obtains the user feature vector of the target user and the gift feature vectors of multiple virtual gifts in the gift panel, and inputs them into a pre-trained deep learning ranking model to obtain the target user's gift-giving preference score for each virtual gift. Then, based on the gift-giving preference scores of each virtual gift, the multiple virtual gifts are ranked to determine the arrangement order of the multiple virtual gifts in the gift panel. On the one hand, it can effectively capture the temporal pattern of user gift-giving behavior, meet the needs of real-time recommendation, alleviate the data overload effect, and improve the user's gift-giving efficiency. On the other hand, it introduces multi-dimensional input vectors and optimizes the weight allocation through a deep learning network to generate personalized gift ranking results for users, thus meeting the user's personalized needs.
[0058] Please refer to Figure 3 The diagram illustrates a flowchart of a method for sorting virtual gifts according to an embodiment of this application. The execution entity for each step of this method can be a computer device; for example, the computer device could be... Figure 1 The terminal device 10 or server 20 in the computer system shown. The method may include at least one of the following steps (310-370).
[0059] Step 310: Obtain the historical gift-giving identifier sequence of the target user within multiple preset time periods.
[0060] For example, the preset multiple different time periods can be the most recent 30 days, 15 days, 7 days, and 2 days.
[0061] For example, the historical gift-giving identifier sequence within multiple different time periods can be a 2-day sequence: [roses, hearts], or a 7-day sequence: [roses, hearts, rockets].
[0062] Step 320: For the historical gift-giving identifier sequence within each time period, apply a time decay function to assign a weight to each gift identifier in the historical gift-giving identifier sequence; wherein, the weight corresponding to the gift identifier is negatively correlated with the time interval between the historical gift given to the gift identifier and the current time.
[0063] For example, the time decay function can be an exponential decay function, with the form: weight = exp(-λ Δt), where weight is the weight assigned to each gift identifier, Δt is the time difference between the time the gifting action occurred and the current time, and λ is the decay coefficient.
[0064] For example, for the historical gift identifier sequence within each time period, a weight is assigned to the gift_id sequence within each time period, such as 2 days: 0.5, 7 days: 0.3, 15 days: 0.15, 30 days: 0.05.
[0065] In some embodiments, the weight corresponding to a gift identifier is negatively correlated with the time interval between the historical gift given and the current time. This means that there is an inverse trend between the two features: when the value of one feature increases, the value of the other feature decreases, and vice versa. For example, the longer the time interval between the historical gift given and the current time, the smaller the weight of the gift identifier.
[0066] Step 330: Based on the weight corresponding to each gift identifier in the historical gift identifier sequence within the time period, aggregate the historical gift identifier sequence within the time period into a periodic interest dense vector.
[0067] In some embodiments, step 330 includes steps 331 to 332.
[0068] Step 331: Map each gift identifier in the historical gift identifier sequence within the time period to an embedding vector.
[0069] In some embodiments, an embedding vector refers to a low-dimensional dense vector obtained by transforming sparse class ID (Identifier) features through embedding mapping. It is used to represent the semantic information of entities in the vector space and to express the user's interest in giving virtual gifts as a model feature.
[0070] For example, the user's input behavior features are first discretized using logarithmic methods: the user's original continuous behavior features (such as historical gift-giving sequences, gift-giving frequency, time intervals, etc.) are compressed in numerical range using a logarithmic function and binned according to preset intervals, transforming them into sparse class ID features with finite discrete values. This transforms continuous behavior features into categorical identifier features that the model can process. Then, for each sparse class ID feature obtained above, embedding mapping is performed using a preset embedding layer matrix: each class ID feature is converted into a corresponding low-dimensional dense embedding vector, and all embedding vectors are combined to represent the user's gift-giving interest in the current gift panel.
[0071] Step 332: Based on the weight of each gift identifier in the historical gift identifier sequence within the time period, fuse the embedding vectors corresponding to each gift identifier in the historical gift identifier sequence within the time period to obtain the periodic interest dense vector corresponding to the time period.
[0072] For example, based on the weight corresponding to each gift identifier in the historical gift-giving identifier sequence within the time period, the methods for fusing the embedding vectors corresponding to each gift identifier in the historical gift-giving identifier sequence within the time period include, but are not limited to, weighted average, weighted summation, etc., to generate a periodic interest dense vector that can represent the user's overall gift-giving preferences within the time period, thereby achieving a unified expression of the user's periodic gift interests.
[0073] Through steps 331-332 above, isolated and semantically meaningless gift identification information can be transformed into a periodic interest-dense vector that can represent the user's overall gift-giving preferences within a time period, thereby achieving a unified expression of the user's periodic gift interests.
[0074] Step 340: Based on the periodic interest density vectors corresponding to multiple different time periods, obtain the user feature vector.
[0075] For example, feature fusion is performed based on the dense vectors of users' periodic interests at multiple different time periods to obtain a user feature vector that integrates users' long-term and short-term gift-giving interests.
[0076] Through the above steps 310-340, the historical gift-giving identifier sequence of the target user in multiple preset time periods can be transformed into the user feature vector of the target user, thereby capturing the user's personalized gift-giving preferences and meeting the user's personalized needs.
[0077] Step 350: Obtain the gift feature vectors of multiple virtual gifts in the gift panel. The gift feature vectors include the consumption frequency distribution features and consumption amount distribution features based on the user's consumption level and other statistical methods.
[0078] Step 360: Input the user feature vector and the gift feature vector of each virtual gift into the pre-trained deep learning ranking model to obtain the target user's gift preference score for each virtual gift.
[0079] Step 370: Sort the virtual gifts according to their gift-giving preference scores and determine their order in the gift panel.
[0080] For details not described in steps 350-370 above, please refer to the description of steps 220-240 in the above embodiments.
[0081] The above methods can effectively capture the temporal patterns of users' gift-giving behavior, meet the needs of real-time recommendations, alleviate the data overload effect, and improve the efficiency of users' gift-giving. On the other hand, by introducing multi-dimensional input vectors and optimizing weight allocation through deep learning networks, personalized gift ranking results can be generated for users, thus meeting their personalized needs.
[0082] Please refer to Figure 4 The diagram illustrates a flowchart of a method for sorting virtual gifts according to an embodiment of this application. The execution entity for each step of this method can be a computer device; for example, the computer device could be... Figure 1 The terminal device 10 or server 20 in the computer system shown. The method may include at least one of the following steps (410-470).
[0083] Step 410: Obtain the user feature vector of the target user. The user feature vector includes historical gift-giving sequence features aggregated based on a time decay mechanism.
[0084] For details not described in step 410 above, please refer to the descriptions of steps 210 and 310-340 in the above embodiments.
[0085] Step 420: Based on the historical consumption behavior data of platform users, platform users are divided into multiple consumption levels.
[0086] For example, based on a user's cumulative spending over the past 30 days, platform users are divided into seven spending levels, from level 1 to level 7, with higher spending corresponding to higher spending levels. For example, based on a user's cumulative spending over the past 90 days, platform users are divided into three spending levels: low, medium, and high.
[0087] Step 430: For each virtual gift, collect consumption data for the virtual gift in user groups corresponding to multiple consumption levels.
[0088] In some embodiments, the consumption data includes consumption frequency data and consumption amount data.
[0089] For example, the platform divides users into three groups: low-spending, medium-spending, and high-spending. For a specific virtual gift A, the platform collects data on the frequency and amount spent on gift A by users in the low-spending group; the frequency and amount spent on gift A by users in the medium-spending group; and the frequency and amount spent on gift A by users in the high-spending group.
[0090] Step 440: Based on the consumption data, construct multi-dimensional statistical features that characterize the popularity and spending power of virtual gifts at different consumption levels.
[0091] In some embodiments, step 440 includes steps 441 to 443.
[0092] Step 441: Based on consumption frequency data, generate frequency distribution features that reflect the popularity of virtual gifts at different consumption levels.
[0093] For example, the platform divides users into three groups: low-spending, medium-spending, and high-spending. For a specific virtual gift B, the frequency of its consumption is statistically analyzed at each level. For instance, low-spending level: 100 times, medium-spending level: 300 times, high-spending level: 500 times. After normalizing or calculating the proportions of the frequency data, a set of distribution values is obtained, which represents the frequency distribution characteristics of gift B, reflecting its increasing popularity at higher levels.
[0094] Step 442: Based on the consumption amount data, generate a distribution feature of the amount that reflects the spending power of virtual gifts at different consumption levels.
[0095] For example, the platform divides users into three groups: low-spending, medium-spending, and high-spending. A spending matrix is constructed for each level and different virtual gifts. This allows for the statistical analysis of spending on different virtual gifts within each level, examining the mean and dispersion of spending across different spending levels, and also provides an overview of the overall spending scale of each virtual gift across all levels.
[0096] Step 443: Based on the frequency distribution characteristics and monetary distribution characteristics, obtain the multi-dimensional statistical characteristics of virtual gifts.
[0097] Optionally, the consumption data also includes time interval data of user purchases of each gift; the multi-dimensional statistical features also include: time interval statistical features generated based on the time interval data that reflect the pattern of user purchase behavior of each gift, such as feature vectors such as mean and median.
[0098] Through the steps 441-443 above, frequency distribution characteristics and amount distribution characteristics can be obtained based on consumption frequency data and consumption amount data, and further multi-dimensional statistical characteristics of virtual gifts can be obtained, thereby accurately depicting the activity level and consumption scale of each gift at different consumption levels.
[0099] Step 450: Determine the multi-dimensional statistical features as the gift feature vector of the virtual gift.
[0100] Through steps 420-450 above, the consumption data of virtual gifts in user groups corresponding to multiple consumption levels can be transformed into gift feature vectors of multiple virtual gifts in the gift panel, which can then be used to generate personalized gift ranking results for users to meet their personalized needs.
[0101] Step 460: Input the user feature vector and the gift feature vector of each virtual gift into the pre-trained deep learning ranking model to obtain the target user's gift preference score for each virtual gift.
[0102] Step 470: Sort the virtual gifts according to their gift-giving preference scores and determine their order in the gift panel.
[0103] For details not described in steps 460-470 above, please refer to the description of steps 230-240 in the above embodiments.
[0104] The above methods can effectively capture the temporal patterns of users' gift-giving behavior, meet the needs of real-time recommendations, alleviate the data overload effect, and improve the efficiency of users' gift-giving. On the other hand, by introducing multi-dimensional input vectors and optimizing weight allocation through deep learning networks, personalized gift ranking results can be generated for users, thus meeting their personalized needs.
[0105] Please refer to Figure 5 The diagram illustrates a flowchart of a method for sorting virtual gifts according to an embodiment of this application. The execution entity for each step of this method can be a computer device; for example, the computer device could be... Figure 1 The terminal device 10 or server 20 in the computer system shown. The method may include at least one of the following steps (510-550).
[0106] Step 510: Obtain the user feature vector of the target user. The user feature vector includes historical gift-giving sequence features aggregated based on a time decay mechanism.
[0107] Step 520: Obtain the gift feature vectors of multiple virtual gifts in the gift panel. The gift feature vectors include the consumption frequency distribution features and consumption amount distribution features based on the user's consumption level and other statistical methods.
[0108] For details not described in steps 510-520 above, please refer to the descriptions of steps 210-220 and 310-340 in the above embodiments.
[0109] Step 530: For each virtual gift, concatenate the user feature vector and the virtual gift's gift feature vector to obtain a concatenated feature vector.
[0110] In some embodiments, for each virtual gift, the user feature vector representing the target user's gift-giving preference is concatenated with the gift feature vector representing the virtual gift's attributes and the group's popularity, to obtain a concatenated feature vector that integrates the user's personalized preferences and the gift's own attribute information.
[0111] Step 540: Input the concatenated feature vector into the pre-trained deep learning ranking model, and the pre-trained deep learning ranking model outputs the virtual gift giving preference score.
[0112] In some embodiments, the pre-trained deep learning ranking model includes: an attention mechanism module, a multilayer perceptron network, and an output mapping layer.
[0113] In some embodiments, the attention mechanism module refers to a network structure used to adaptively weight and learn the importance of features of different dimensions in the concatenated feature vector. This module can automatically identify and strengthen key features that have a greater impact on users' gift-giving decisions (such as users' preference for high-value gifts, the popularity of gifts, and the matching degree of consumption level), while weakening the influence of interfering features, so that the model can focus more on effective information and improve the accuracy of predicting users' gift-giving intentions.
[0114] For example, the formula for the attention mechanism is as follows:
[0115] in, K is the query vector, also known as the user feature vector, representing the user's gift-giving interest query. K is the key vector, also known as the gift feature vector, representing the feature representation of the gift. V is the value vector, also known as the gift feature vector, representing the gift information to be weighted. This is a scaling factor to prevent the softmax gradient from vanishing due to excessively large inner product values. This indicates that a similarity score is calculated between the user and the gift. `softmax` represents normalizing the similarity score into a weighted distribution with a weight sum of 1.
[0116] In some embodiments, the multilayer perceptron network consists of at least one input layer, multiple hidden layers, and a nonlinear activation function, used to perform high-order nonlinear transformations and feature interactions on the attention-weighted features. Through fitting and learning of multiple fully connected layers, the network can uncover the complex potential correlation between user features and gift features, further extracting high-dimensional abstract features, and providing a highly expressive feature foundation for the final gift ranking score.
[0117] In some embodiments, the output mapping layer is the last network layer of the model, used to map the high-dimensional features output by the multilayer perceptron to the final prediction result. That is, this layer maps the features to the target user's gift-giving preference score for the current virtual gift, and the score directly determines the display order of the gifts in the panel.
[0118] In some embodiments, step 540 includes steps 541 to 543.
[0119] Step 541: The attention mechanism module processes the features related to the historical gift-giving sequence in the spliced feature vector to obtain the spliced feature vector enhanced by the attention mechanism.
[0120] Optionally, the process specifically includes: 1. Linear Mapping: Features related to the historical gift-giving sequence are mapped through three different linear transformation layers to generate query vectors, key vectors, and value vectors.
[0121] 2. Weight Calculation: The dot product similarity between the query vector and all key vectors is calculated and normalized using scaling and softmax functions to obtain a set of attention weights. These weights reflect the importance of different historical gift-giving behaviors in predicting the current candidate gift preference.
[0122] 3. Feature Enhancement: The calculated attention weights are used to perform a weighted summation of the corresponding value vectors, outputting a new attention-weighted sequence feature representation. This representation focuses on historical consumption patterns most relevant to the current prediction.
[0123] Step 542: The concatenated feature vector enhanced by the attention mechanism is nonlinearly transformed through a multilayer perceptron network to obtain a deep feature representation.
[0124] Optionally, the model employs a deep neural network architecture, using a multilayer perceptron as its basic structure. Its input layer receives preprocessed feature vectors, and multiple hidden layers are set in the middle to perform nonlinear transformations of the features, resulting in deep feature representations.
[0125] Step 543: The deep feature representation is represented by the output mapping layer and mapped to the gift-giving preference score of virtual gifts.
[0126] Optionally, the output mapping layer maps the deep feature representation output by the multilayer perceptron to a gift-giving preference score for virtual gifts. The score directly determines the display order of gifts in the panel.
[0127] Through steps 541-543 above, the spliced feature vector can be enhanced by an attention mechanism, transformed by a multilayer perceptron, and mapped by an output mapping layer to obtain the gift preference score of virtual gifts. This score can be directly used to determine the arrangement order of multiple virtual gifts in the gift panel, thus meeting the personalized needs of users.
[0128] Through steps 530-540 above, a concatenated feature vector can be obtained from the user feature vector and the gift feature vector of each virtual gift. This concatenated feature vector is then input into a pre-trained deep learning ranking model to obtain the target user's gift-giving preference score for each virtual gift. This determines the order of multiple virtual gifts in the gift panel, improving the user's gift-giving efficiency and meeting the user's personalized needs.
[0129] Step 550: Sort the virtual gifts according to the gift-giving preference scores of each virtual gift, and determine the arrangement order of the virtual gifts in the gift panel.
[0130] For details not described in step 550 above, please refer to the description of step 240 in the above embodiment.
[0131] The above methods can effectively capture the temporal patterns of users' gift-giving behavior, meet the needs of real-time recommendations, alleviate the data overload effect, and improve the efficiency of users' gift-giving. On the other hand, by introducing multi-dimensional input vectors and optimizing weight allocation through deep learning networks, personalized gift ranking results can be generated for users, thus meeting their personalized needs.
[0132] Please refer to Figure 6 The diagram illustrates a flowchart of a method for sorting virtual gifts according to an embodiment of this application. The execution entity for each step of this method can be a computer device; for example, the computer device could be... Figure 1 The terminal device 10 or server 20 in the computer system shown. The method may include at least one of the following steps (610-650).
[0133] Step 610: Obtain the user feature vector of the target user. The user feature vector includes historical gift-giving sequence features aggregated based on a time decay mechanism.
[0134] Step 620: Obtain the gift feature vectors of multiple virtual gifts in the gift panel. The gift feature vectors include the consumption frequency distribution features and consumption amount distribution features based on the user's consumption level and other statistical methods.
[0135] Step 630: Input the user feature vector and the gift feature vector of each virtual gift into the pre-trained deep learning ranking model to obtain the target user's gift preference score for each virtual gift.
[0136] For details not described in steps 610-630 above, please refer to the descriptions of steps 210-230 and 310-340 in the above embodiments.
[0137] Step 640: Sort the virtual gifts according to the gift-giving preference scores of each virtual gift to generate a personalized gift sorting list.
[0138] For example, virtual gifts are sorted in descending order based on their gift-giving preference scores to generate a personalized gift ranking list for the target user.
[0139] Step 650: Based on the personalized gift sorting list and combined with the preset rearrangement strategy, determine the arrangement order of multiple virtual gifts in the gift panel.
[0140] Optionally, the preset reordering strategy includes at least one of the following: pinning the event virtual gifts to the top, placing the permanent virtual gifts in a fixed position, dispersing the virtual gifts in adjacent positions based on price differences, and giving a weighted boost to newly listed virtual gifts.
[0141] For example, a user's personalized gift sorting list is: [hearts, roses, teddy bears, rockets, lollipops]. The preset reordering strategy is: active virtual gifts are pinned to the top, and permanent virtual gifts are placed in fixed positions. Among them, roses are active gifts, and lollipops are permanent gifts and are fixed in the first three positions. The order of multiple virtual gifts in the gift panel is: [roses, hearts, lollipops, teddy bears, rockets].
[0142] Through steps 640-650 above, a personalized gift ranking list can be obtained based on the gift-giving preference scores of each virtual gift. Combined with a preset rearrangement strategy, the order in which multiple virtual gifts are arranged in the gift panel can be determined. This can both generate personalized gift ranking results for users and support different business needs.
[0143] The above methods can effectively capture the temporal patterns of users' gift-giving behavior, meet the needs of real-time recommendations, alleviate the data overload effect, and improve the efficiency of users' gift-giving. On the other hand, by introducing multi-dimensional input vectors and optimizing weight allocation through deep learning networks, personalized gift ranking results can be generated for users, thus meeting their personalized needs.
[0144] The training process of the deep learning ranking model will be introduced below.
[0145] In some embodiments, the deep learning ranking model automatically models users' personalized preferences for virtual gifts by learning from their historical gift-giving behavior, consumption characteristics, and gift attribute data. During training, the model uses users' real gift-giving behavior as supervision information, obtains predicted gift preference scores through forward propagation, and continuously optimizes network parameters to improve ranking performance.
[0146] The optimization direction and convergence effect of the model parameters directly depend on the design of the loss function. The loss function is used to quantify the difference between the prediction results and the actual behavior, providing a clear optimization target for the model's parameter updates.
[0147] For example, the formula for designing a loss function suitable for a ranking task is as follows:
[0148] in, This is the weighted cross-entropy loss with sample weights, where N is the total number of training samples. For the i-th sample, the true gift-giving label is... The probability of gift-giving predicted by the model. These are the sample weight coefficients.
[0149] Step S1: Obtain the training sample set, which includes multiple training samples. Each training sample includes: the user feature vector of the sample user, the gift feature vector of the virtual gift, and a label indicating whether the sample user has given a virtual gift.
[0150] Optionally, the label used to indicate whether a sample user gave a virtual gift corresponds to the one in the loss function formula above. Of these, 1 represents a gift and 0 represents no gift.
[0151] Step S2 involves balancing the training sample set. This balancing process includes randomly filtering and deleting training samples from the interactive gift category, and / or assigning higher weights to training samples from the ordinary gift category during model training.
[0152] In some embodiments, to alleviate the problem that the consumption of interactive gifts in the training samples is too high and overwhelms the consumption of ordinary gifts, a portion of the interactive gift data is randomly selected and deleted to reduce its quantity to match that of ordinary gifts.
[0153] In some embodiments, during the model training process, ordinary gifts are assigned high weights and interactive gifts are assigned low weights based on the differences in sample categories, guiding the model to strengthen its learning focus on ordinary gift samples and balancing the influence of different categories of samples on model training.
[0154] Step S3: Construct a deep learning model. The deep learning model includes an input layer for receiving the concatenated user features and gift features, at least one hidden layer, and an output layer for outputting gift preference scores.
[0155] Optionally, the input layer receives the concatenated user features and gift features as input information for the model; the hidden layer performs nonlinear transformation and high-order interaction learning on the input features to explore the potential correlation between user features and gift features; and the output layer outputs the target user's gift-giving preference score for the corresponding virtual gift to represent the user's gift-giving tendency.
[0156] Step S4: Use the training sample set that has undergone sample balancing to train the deep learning model and obtain a pre-trained deep learning ranking model.
[0157] In some embodiments, step S4 includes steps S4a to S4b.
[0158] Step S4a: For each training sample in the training sample set after sample balancing, determine the loss function value corresponding to the training sample based on the gift preference score corresponding to the training sample output by the deep learning model, the label included in the training sample to represent whether or not a virtual gift is given, and the dynamic weight corresponding to the training sample.
[0159] Optionally, the gift-giving preference score corresponding to the training samples output by the deep learning model corresponds to the loss function formula above. The dynamic weights corresponding to the training samples correspond to the weights in the loss function formula above. The loss function value corresponding to the training sample is the cross-entropy loss function value.
[0160] Step S4b: Adjust the parameters of the deep learning model based on the loss function values corresponding to multiple training samples to obtain a pre-trained deep learning ranking model.
[0161] Through the above steps S4a~S4b, the weighted smoothing based on the amount of the gift given by the user can better optimize the ranking performance of the model, making it easier to learn the gift_id with a larger gift amount, thus conforming to the user's gift-giving preferences.
[0162] Through the above steps S1~S4, the design of the loss function is introduced, the deep learning model is trained, the ranking performance of the model is optimized, and the ranking results are more accurate.
[0163] In step S4, when the training sample is a positive sample, the dynamic weight corresponding to the training sample is determined according to the amount of virtual gifts given by the sample user; where a positive sample refers to a training sample containing labels used to represent virtual gifts given by the sample user. When the training samples are negative samples, the preset values are determined as the dynamic weights corresponding to the training samples; where negative samples refer to training samples whose labels are used to indicate that the sample users have not given virtual gifts.
[0164] Optionally, the dynamic weights corresponding to the training samples are positively correlated with the amount of virtual gifts given by the sample users.
[0165] For example, when the training samples are negative samples, the preset value is 1.
[0166] Optionally, a dynamic weight w_i is calculated for each training sample i, which is strongly correlated with the actual amount of gifts given for that sample.
[0167] 1. For positive samples (y_i = 1): their weight w_i is directly linked to the amount (or value of virtual currency) of the gift given. The higher the amount, the larger the weight w_i. The specific calculation can be a linear function of the amount (e.g., w_i = 1 + β). The purpose of using the amount_i function, logarithmic function, or piecewise function is to make the model pay more attention to learning the patterns behind users' "high consumption" behavior.
[0168] 2. For negative samples (y_i = 0): they are usually assigned a fixed base weight (e.g., w_i = 1), or a smaller weight based on business logic.
[0169] Using the above method, dynamic weights can be determined for training samples that are either positive or negative, thereby optimizing the model's ranking performance and making the ranking results more accurate.
[0170] For example, such as Figure 7 The diagram shows the overall flowchart of the virtual gift sorting method described above. The gift panel feature system includes: paid attribute information, basic gift information, gift_id sequence, and interaction features; the paid prediction model includes multiple hidden layers for non-linear transformation of features; the gift panel is verified to meet business requirements and subjected to ABT (AB Test Experiment) testing; the final sorting result is determined by combining the reordering strategy.
[0171] For example, such as Figure 8 The diagram illustrates the product-side performance of the aforementioned virtual gift sorting method. The sorting results obtained through this method are displayed in the gift panel 81 of the user interface 80; for example, the virtual gift 82 is positioned according to the sorting results. Users can select and send gifts that match their preferences to the currently viewed streamer based on the displayed sorting results, improving gift-giving efficiency and meeting users' personalized needs.
[0172] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0173] Please refer to Figure 9 This diagram illustrates a block diagram of a virtual gift sorting apparatus according to an embodiment of this application. The apparatus has the functionality to implement the aforementioned virtual gift sorting method example; this functionality can be implemented in hardware or by hardware executing corresponding software. Optionally, the apparatus can be a computer device or can be installed within a computer device. Figure 9 As shown, the device 900 may include a processing module 910, an input module 920, and a sorting module 930.
[0174] The processing module 910 is used to obtain the user feature vector of the target user, the user feature vector including historical gift-giving sequence features aggregated based on a time decay mechanism.
[0175] The processing module 910 is also used to obtain gift feature vectors of multiple virtual gifts in the gift panel. The gift feature vectors include consumption frequency distribution features and consumption amount distribution features based on user consumption level and other statistical methods.
[0176] The input module 920 is used to input the user feature vector and the gift feature vector of each virtual gift into a pre-trained deep learning ranking model to obtain the target user's gift preference score for each virtual gift.
[0177] The sorting module 930 is used to sort the multiple virtual gifts according to the gift-giving preference scores of each virtual gift, and determine the arrangement order of the multiple virtual gifts in the gift panel.
[0178] In some embodiments, the processing module 910 is configured to: Obtain the historical gift-giving identifier sequence of the target user within multiple preset different time periods; For each of the historical gift-giving identifier sequences within the time period, a time decay function is applied to assign a weight to each gift identifier in the historical gift-giving identifier sequence; wherein, the weight corresponding to the gift identifier is negatively correlated with the time interval between the historical gift given to the gift identifier and the current time. Based on the weight corresponding to each gift identifier in the historical gift-giving identifier sequence within the time period, the historical gift-giving identifier sequence within the time period is aggregated into a periodic interest dense vector. The user feature vector is obtained based on the periodic interest density vectors corresponding to the multiple different time periods.
[0179] In some embodiments, the processing module 910 is configured to: Map each gift identifier in the historical gift identifier sequence within the time period to an embedding vector; Based on the weight corresponding to each gift identifier in the historical gift-giving identifier sequence within the time period, the embedding vector corresponding to each gift identifier in the historical gift-giving identifier sequence within the time period is fused to obtain the periodic interest dense vector corresponding to the time period.
[0180] In some embodiments, the processing module 910 is configured to: Based on the platform users' historical consumption behavior data, the platform users are divided into multiple consumption levels; For each virtual gift, the consumption data of the virtual gift in the user groups corresponding to the multiple consumption levels is statistically analyzed; Based on the consumption data, a multi-dimensional statistical feature is constructed to characterize the popularity and spending power of the virtual gift in different consumption levels; The multi-dimensional statistical features are determined as the gift feature vector of the virtual gift.
[0181] In some embodiments, the consumed data includes consumption frequency data and consumption amount data; the processing module 910 is configured to: Based on the consumption frequency data, a frequency distribution feature is generated to reflect the popularity of the virtual gift at different consumption levels; Based on the consumption amount data, a distribution feature of the amount is generated to reflect the consumption capacity of the virtual gift at different consumption levels; Based on the frequency distribution characteristics and the monetary distribution characteristics, the multi-dimensional statistical characteristics of the virtual gift are obtained.
[0182] In some embodiments, the input module 920 is configured to: For each virtual gift, the user feature vector and the gift feature vector of the virtual gift are concatenated to obtain a concatenated feature vector; The concatenated feature vector is input into the pre-trained deep learning ranking model, which then outputs the gift preference score for the virtual gift.
[0183] In some embodiments, the pre-trained deep learning ranking model includes: an attention mechanism module, a multilayer perceptron network, and an output mapping layer; the input module 920 is used for: The attention mechanism module processes the features in the spliced feature vector that are related to the historical gift-giving sequence features to obtain the spliced feature vector enhanced by the attention mechanism. The deep feature representation is obtained by performing a nonlinear transformation on the spliced feature vector enhanced by the attention mechanism through the multilayer perceptron network. The deep features are represented by the output mapping layer and mapped to the gift-giving preference score of the virtual gift.
[0184] In some embodiments, the training process of the deep learning ranking model includes: Obtain a training sample set, which includes multiple training samples. Each training sample includes: a user feature vector of the sample user, a gift feature vector of the virtual gift, and a label indicating whether the sample user gave the virtual gift. The training sample set is subjected to sample balancing processing, which includes: randomly filtering and deleting training samples of the interactive gift category, and / or assigning higher weights to training samples of the ordinary gift category than to training samples of the interactive gift category during model training. Construct a deep learning model, the deep learning model including an input layer for receiving spliced user features and gift features, at least one hidden layer, and an output layer for outputting gift preference scores; The deep learning model is trained using the training sample set that has undergone the sample balancing process to obtain the pre-trained deep learning ranking model.
[0185] In some embodiments, training the deep learning model using the training sample set that has undergone the sample balancing process to obtain the pre-trained deep learning ranking model includes: For each training sample in the training sample set after the sample balancing process, the loss function value corresponding to the training sample is determined based on the gift preference score corresponding to the training sample output by the deep learning model, the label included in the training sample to represent whether or not the virtual gift is given, and the dynamic weight corresponding to the training sample. Based on the loss function values corresponding to multiple training samples, the parameters of the deep learning model are adjusted to obtain the pre-trained deep learning ranking model.
[0186] In some embodiments, the apparatus 900 further includes: a determining module ( Figure 9 (Not shown in the image).
[0187] The determining module is used to determine the dynamic weight corresponding to the training sample based on the amount of the virtual gift given by the sample user when the training sample is a positive sample; wherein, the positive sample refers to the training sample containing labels used to represent the virtual gift given by the sample user. When the training sample is a negative sample, a preset value is determined as the dynamic weight corresponding to the training sample; wherein, the negative sample refers to a training sample containing a label used to indicate that the sample user did not send the virtual gift.
[0188] In some embodiments, the sorting module 930 is configured to: Based on the gift-giving preference scores of each virtual gift, the multiple virtual gifts are sorted to generate a personalized gift sorting list; Based on the personalized gift sorting list and combined with a preset rearrangement strategy, the arrangement order of the multiple virtual gifts in the gift panel is determined.
[0189] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0190] Please refer to Figure 10 The diagram shows a structural block diagram of a computer device 1000 provided in one embodiment of this application.
[0191] Typically, computer device 1000 includes a processor 1010 and a memory 1020.
[0192] Processor 1010 may include one or more processing cores, such as a quad-core processor or a deca-core processor. Processor 1010 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1010 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1010 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1010 may also include an AI processor for handling computational operations related to machine learning.
[0193] The memory 1020 may include one or more computer-readable storage media, which may be non-transitory. The memory 1020 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1020 are used to store a computer program configured to be executed by one or more processors to implement the above-described virtual gift sorting method.
[0194] Those skilled in the art will understand that Figure 10The structure shown does not constitute a limitation on the computer device 1000, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0195] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored in the storage medium, and the computer program, when executed by a processor, implements the above-described method for sorting virtual gifts. Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0196] In an exemplary embodiment, a computer program product is also provided, the computer program product including a computer program loaded and executed by a processor to implement the above-described method for sorting virtual gifts.
[0197] It should be noted that the collection and processing of relevant data in this application (including but not limited to the multimedia resources, multimedia resource collections, interactive data, etc. mentioned above) should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0198] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.
[0199] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for sorting virtual gifts, characterized in that, The method includes: Obtain the user feature vector of the target user, the user feature vector including historical gift-giving sequence features aggregated based on a time decay mechanism; Obtain gift feature vectors for multiple virtual gifts in the gift panel. The gift feature vectors include consumption frequency distribution features and consumption amount distribution features based on user consumption level and other statistical methods. The user feature vector and the gift feature vector of each virtual gift are input into a pre-trained deep learning ranking model to obtain the target user's gift preference score for each virtual gift. Based on the gift-giving preference scores of each virtual gift, the virtual gifts are sorted to determine their arrangement order in the gift panel.
2. The method according to claim 1, characterized in that, The process of obtaining the user feature vector of the target user includes: Obtain the historical gift-giving identifier sequence of the target user within multiple preset different time periods; For each of the historical gift-giving identifier sequences within the time period, a time decay function is applied to assign a weight to each gift identifier in the historical gift-giving identifier sequence; wherein, the weight corresponding to the gift identifier is negatively correlated with the time interval between the historical gift given to the gift identifier and the current time. Based on the weight corresponding to each gift identifier in the historical gift-giving identifier sequence within the time period, the historical gift-giving identifier sequence within the time period is aggregated into a periodic interest dense vector. The user feature vector is obtained based on the periodic interest density vectors corresponding to the multiple different time periods.
3. The method according to claim 2, characterized in that, The step of aggregating the historical gift-giving identifier sequence within the time period into a periodic interest-dense vector based on the weight corresponding to each gift identifier in the historical gift-giving identifier sequence within the time period includes: Map each gift identifier in the historical gift identifier sequence within the time period to an embedding vector; Based on the weight corresponding to each gift identifier in the historical gift-giving identifier sequence within the time period, the embedding vector corresponding to each gift identifier in the historical gift-giving identifier sequence within the time period is fused to obtain the periodic interest dense vector corresponding to the time period.
4. The method according to any one of claims 1 to 3, characterized in that, The process of obtaining the gift feature vectors of multiple virtual gifts in the gift panel includes: Based on the platform users' historical consumption behavior data, the platform users are divided into multiple consumption levels; For each virtual gift, the consumption data of the virtual gift in the user groups corresponding to the multiple consumption levels is statistically analyzed; Based on the consumption data, a multi-dimensional statistical feature is constructed to characterize the popularity and spending power of the virtual gift in different consumption levels; The multi-dimensional statistical features are determined as the gift feature vector of the virtual gift.
5. The method according to claim 4, characterized in that, The consumed data includes consumption frequency data and consumption amount data; Based on the consumed data, a multi-dimensional statistical feature is constructed to characterize the popularity and spending power of the virtual gift across different consumption levels, including: Based on the consumption frequency data, a frequency distribution feature is generated to reflect the popularity of the virtual gift at different consumption levels; Based on the consumption amount data, a distribution feature of the amount is generated to reflect the consumption capacity of the virtual gift at different consumption levels; Based on the frequency distribution characteristics and the monetary distribution characteristics, the multi-dimensional statistical characteristics of the virtual gift are obtained.
6. The method according to any one of claims 1 to 5, characterized in that, The step of inputting the user feature vector and the gift feature vector of each virtual gift into a pre-trained deep learning ranking model to obtain the target user's gift-giving preference score for each virtual gift includes: For each virtual gift, the user feature vector and the gift feature vector of the virtual gift are concatenated to obtain a concatenated feature vector; The concatenated feature vector is input into the pre-trained deep learning ranking model, which then outputs the gift preference score for the virtual gift.
7. The method according to claim 6, characterized in that, The pre-trained deep learning ranking model includes: an attention mechanism module, a multilayer perceptron network, and an output mapping layer; The step of inputting the concatenated feature vector into the pre-trained deep learning ranking model, and having the pre-trained deep learning ranking model output the gift-giving preference score of the virtual gift, includes: The attention mechanism module processes the features in the spliced feature vector that are related to the historical gift-giving sequence features to obtain the spliced feature vector enhanced by the attention mechanism. The deep feature representation is obtained by performing a nonlinear transformation on the spliced feature vector enhanced by the attention mechanism through the multilayer perceptron network. The deep features are represented by the output mapping layer and mapped to the gift-giving preference score of the virtual gift.
8. The method according to any one of claims 1 to 7, characterized in that, The training process of the deep learning ranking model includes: Obtain a training sample set, which includes multiple training samples. Each training sample includes: a user feature vector of the sample user, a gift feature vector of the virtual gift, and a label indicating whether the sample user gave the virtual gift. The training sample set is subjected to sample balancing processing, which includes: randomly filtering and deleting training samples of the interactive gift category, and / or assigning higher weights to training samples of the ordinary gift category than to training samples of the interactive gift category during model training. Construct a deep learning model, the deep learning model including an input layer for receiving spliced user features and gift features, at least one hidden layer, and an output layer for outputting gift preference scores; The deep learning model is trained using the training sample set that has undergone the sample balancing process to obtain the pre-trained deep learning ranking model.
9. The method according to claim 8, characterized in that, The step of training the deep learning model using the training sample set that has undergone the sample balancing process to obtain the pre-trained deep learning ranking model includes: For each training sample in the training sample set after the sample balancing process, the loss function value corresponding to the training sample is determined based on the gift preference score corresponding to the training sample output by the deep learning model, the label included in the training sample to represent whether or not the virtual gift is given, and the dynamic weight corresponding to the training sample. Based on the loss function values corresponding to multiple training samples, the parameters of the deep learning model are adjusted to obtain the pre-trained deep learning ranking model.
10. The method according to claim 9, characterized in that, The method further includes: When the training sample is a positive sample, the dynamic weight corresponding to the training sample is determined according to the amount of the virtual gift given by the sample user; wherein, the positive sample refers to the training sample containing labels used to represent the virtual gift given by the sample user. When the training sample is a negative sample, a preset value is determined as the dynamic weight corresponding to the training sample; wherein, the negative sample refers to a training sample containing a label used to indicate that the sample user did not send the virtual gift.
11. The method according to any one of claims 1 to 10, characterized in that, The step of sorting the virtual gifts according to their gift-giving preference scores and determining their arrangement order in the gift panel includes: Based on the gift-giving preference scores of each virtual gift, the multiple virtual gifts are sorted to generate a personalized gift sorting list; Based on the personalized gift sorting list and combined with a preset rearrangement strategy, the arrangement order of the multiple virtual gifts in the gift panel is determined.
12. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program that is loaded and executed by the processor to implement the method for sorting virtual gifts as described in any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the method for sorting virtual gifts as described in any one of claims 1 to 11.
14. A computer program product, characterized in that, The computer program product includes a computer program executed by a processor to implement the virtual gift sorting method as described in any one of claims 1 to 11.