Object recommendation method, apparatus, device, and computer-readable storage medium
Through the self-attention network model, the historical data of users and objects are mined and the cloud service recommendation list is generated, which solves the problem of low recommendation efficiency of existing cloud service platforms, and realizes dynamic and accurate cloud service combination recommendations, improving user experience and security.
Patent Information
- Application Number
- CN202210979415.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-16
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-08-16
AI Technical Summary
The existing cloud service platform lacks dynamicity when recommending cloud services, which leads to difficulties for users when choosing the right cloud service combination and reduces recommendation efficiency.
The self-attention network model is used to mine the historical purchase data of the target user, determine the user's preference dynamic vector through the first preset self-attention network model, and mine the interdependence between the historical object sets. Combined with the second preset self-attention network model, determine the object preference dynamic vector, generate an object recommendation list, and aggregate the target user's interaction intention and the collaborative information of other users.
It improves the efficiency and accuracy of cloud services recommendations, automatically provides users with combined cloud service recommendations, meets the needs of user diversity, and improves the convenience of user selection and information security.
Smart Images

Figure CN116821468B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud service technology, and in particular to an object recommendation method, apparatus, device, and computer-readable storage medium. Background Art
[0002] With the rapid development of internet technology, industrial production is increasingly turning to cloud services, which offer fast deployment, flexible services, low-cost operations and maintenance, and affordable security. Existing cloud service platforms offer separate services tailored to user needs, such as elastic computing, cloud storage, cloud networking, and cloud security. Users can choose from a variety of cloud services tailored to their specific application scenarios to meet their industrial production needs.
[0003] There are many different cloud services available. Users need to select and activate the appropriate cloud services when setting up their own production environments. Building a production environment often requires a combination of different cloud services. However, the current cloud service platform's classification of cloud services is a static strategy that only meets a small number of public needs, reducing the efficiency of cloud service recommendations. Summary of the Invention
[0004] Embodiments of the present invention provide an object recommendation method, apparatus, device, and computer-readable storage medium, which improve the efficiency of object recommendation.
[0005] The technical solution of the embodiment of the present invention is achieved as follows:
[0006] In a first aspect, an embodiment of the present invention provides an object recommendation method, the method comprising: obtaining multiple historical object sets of a target user, and multiple user sets in which each object is selected by the user; each historical object set comprises multiple historical objects selected by the target user at the same time, the users comprise the target user, and the objects comprise the historical objects; determining a user preference dynamic vector based on the multiple historical objects included in each historical object set and a first preset self-attention network model; the user preference dynamic vector represents the mutual dependence relationship between the multiple historical object sets; determining an object preference dynamic vector based on multiple user sets and a second preset self-attention network model; the object preference dynamic vector represents the relationship between multiple users; determining an object recommendation list based on the user preference dynamic vector and the object preference dynamic vector; the object recommendation list reflects the sorting relationship of multiple objects.
[0007] In a second aspect, an embodiment of the present invention provides an object recommendation device, which includes: an acquisition module for acquiring multiple historical object sets of a target user, and each user set in which each object is selected by the user; each historical object set includes multiple historical objects selected by the target user at the same time, the user includes the target user, and the object includes the historical objects; a determination module for determining a user preference dynamic vector based on the multiple historical objects included in each historical object set and a first preset self-attention network model; the user preference dynamic vector represents the mutual dependence relationship between the multiple historical object sets; an object preference dynamic vector is determined based on multiple user sets and a second preset self-attention network model; the object preference dynamic vector represents the relationship between multiple users; a list generation module for determining an object recommendation list based on the user preference dynamic vector and the object preference dynamic vector; the object recommendation list reflects the sorting relationship of multiple objects.
[0008] In a third aspect, an embodiment of the present invention provides an object recommendation device, comprising: a memory for storing an executable computer program; and a processor for implementing the above-mentioned object recommendation method when executing the executable computer program stored in the memory.
[0009] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing a computer program for implementing the above-mentioned object recommendation method when executed by a processor.
[0010] Embodiments of the present invention provide an object recommendation method, apparatus, device, and computer-readable storage medium. According to the solution provided by the embodiments of the present invention, multiple historical object sets of a target user and user sets in which each object was selected by the user are obtained. Each historical object set includes multiple historical objects selected by the target user at the same time, where the user includes the target user and the object includes the historical objects. A user preference dynamic vector is determined based on the multiple historical objects included in each historical object set and a first preset self-attention network model. The user preference dynamic vector represents the interdependencies between the multiple historical object sets, and the target user's interaction intent is mined from the multiple historical object sets to filter out related objects of interest to the target user. An object preference dynamic vector is determined based on the multiple user sets and a second preset self-attention network model. The object preference dynamic vector represents the relationship between multiple users. By integrating information about other users who purchased the same object across multiple user sets, the object preference dynamic vector reflects the synergy between different users and increases the generalizability of object recommendations. An object recommendation list is determined based on the user preference dynamic vector and the object preference dynamic vector. The object recommendation list reflects the ranking relationship between the multiple objects and aggregates the target user's interaction intent and collaborative information from other users, improving the efficiency of object recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A flowchart of optional steps of an object recommendation method provided by an embodiment of the present invention;
[0012] Figure 2 An optional structural diagram of an overall framework provided by an embodiment of the present invention;
[0013] Figure 3 A flowchart of optional steps of another object recommendation method provided by an embodiment of the present invention;
[0014] Figure 4 A flowchart of optional steps of another object recommendation method provided by an embodiment of the present invention;
[0015] Figure 5 A flowchart of optional steps of another object recommendation method provided by an embodiment of the present invention;
[0016] Figure 6 An optional structural diagram of a recommendation algorithm model provided by an embodiment of the present invention;
[0017] Figure 7 An optional structural diagram of an object recommendation device provided by an embodiment of the present invention;
[0018] Figure 8 A schematic diagram of the structure of an object recommendation device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0019] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. It should be understood that some of the embodiments described here are only used to explain the technical solutions of the present invention and are not used to limit the technical scope of the present invention.
[0020] In order to better understand the object recommendation method provided in the embodiment of the present invention, before introducing the technical solution of the embodiment of the present invention, the relevant technologies are first introduced.
[0021] The object recommendation method provided by the embodiments of the present invention can be used in the field of cloud service recommendation, and the object can be a commodity (or item) such as a cloud service. Traditional cloud service platforms are divided into different modules according to the type of cloud service. For example, elastic computing provides cloud services such as cloud hosts, container images, containers, and cloud host backup; cloud storage provides cloud services such as object storage, cloud storage gateway, cloud hard disk, and cloud space; cloud network provides cloud services such as virtual private cloud, elastic public network Internet Protocol (IP), and elastic load balancing; cloud security provides cloud services such as cloud security center, vulnerability scanning, and container security. In actual applications, users need to combine and use different cloud services according to their own production environment to ensure smooth and efficient production. The existing cloud service platform's classification of cloud service types is a static strategy, which to a certain extent alleviates the dilemma of user selection difficulties, but still cannot meet the diverse needs of users. If the cloud service provider does not provide corresponding training to users, it will cause users to face the problem of difficulty in choosing when purchasing cloud services, reducing the efficiency of cloud service recommendations.
[0022] The embodiment of the present invention provides an object recommendation method, such as Figure 1 As shown, Figure 1 This is a flowchart of optional steps of an object recommendation method provided by an embodiment of the present invention. The object recommendation method includes the following steps:
[0023] S101. Acquire multiple historical object sets of a target user and user sets in which each object is selected by the user; each historical object set includes multiple historical objects selected by the target user at the same time, the user includes the target user, and the object includes the historical objects.
[0024] In an embodiment of the present invention, the target user can represent any user among the users, and is the user for whom an object recommendation is to be made. For example, the object is a cloud service. The target user purchases different cloud services within a certain period of time. Multiple cloud services purchased at the same time (here, the same time can refer to multiple purchases within a certain period of time, for example, multiple purchases within 6 hours or a day are considered the same purchase) are considered as a historical object set. Each historical object set includes multiple cloud services, and these multiple cloud services are cloud services selected by the target user at the same time. The same cloud service may be purchased by different users. The different users who purchased the same cloud service are considered as a user set, resulting in multiple user sets corresponding to the multiple cloud services. The same cloud service may be purchased multiple times by the same user. Here, the multiple users who purchased the same cloud service are considered as a user set. The types of cloud services purchased by the target user are limited. Therefore, the types of cloud services purchased by the user include the types of cloud services purchased by the target user, that is, the object includes historical objects.
[0025] In embodiments of the present invention, obtaining multiple historical object sets for a target user can be accomplished through the following two examples. Example 1: Obtaining multiple historical object sets for the target user within a preset time period, where the preset time period is the period before an object recommendation is currently made to the target user. The preset time period can be set by those skilled in the art based on actual needs. For example, it can be determined based on the target user's purchase frequency. If the target user purchases frequently, the preset time period can be set to a shorter period, such as one month, two weeks, or one week. If the target user purchases less frequently, the preset time period can be set to a longer period, such as six months or three months. It is understood that historical object sets closer to the current recommendation are more representative of the target user's purchasing needs and have greater reference value. Example 2: Obtaining historical object sets for the target user within a preset number of times, where the preset number is the most recent number of purchases before an object recommendation is currently made to the target user, such as 10, 5, or 3 times. This embodiment of the present invention does not impose any restrictions on the purchase time or quantity of the multiple historical object sets.
[0026] S102. Determine a user preference dynamic vector based on multiple historical objects included in each historical object set and a first preset self-attention network model; the user preference dynamic vector represents the mutual dependence relationship between the multiple historical object sets.
[0027] In this embodiment of the present invention, the first preset self-attention network model is a trained model that can be used to mine correlations between different historical objects and between different sets of historical objects. The first preset self-attention network model learns the relationships between multiple historical objects in each set of historical objects, obtaining the features of each set of historical objects. It then learns the correlations between multiple sets of historical objects to obtain a dynamic vector of user preferences.
[0028] In the embodiment of the present invention, the self-attention network model learns the correlation between input data through the following steps: (1) preprocessing input data: the input data is processed through the embedding coding layer to obtain the input vector. (2) initializing weights: the weights include W corresponding to the query (Query, Q). Q , the value (Value, V) corresponding to W V 、W corresponding to key (Key, K) V. (3) Calculate the query vector, value vector and key vector: With the input vector and weight, calculate the query vector, value vector and key vector corresponding to each input vector. (4) Calculate the attention score of the input value: The attention score is obtained by multiplying the query vector with each key vector result. (5) Calculate the normalization (softmax) layer: The softmax function directly normalizes the attention score in step 4. (6) Multiply each attention score with its own value vector to obtain the output result. (7) Perform weighted summation on the output results in step 6 to obtain the output value. (8) Repeat the above steps 4-7, perform self-attention calculation on other input data respectively, and obtain other output values. Attention can capture global information. Through the self-attention network model, the global information of multiple historical objects in the same historical object set can be extracted and used as the vector of the historical object set. The global information of multiple historical object sets is further extracted to obtain the target user's interaction intention, that is, the user preference dynamic vector. The target user's interaction intention is mined from multiple historical object sets, and the related objects of interest to the target user are screened, thereby improving the accuracy of object recommendation.
[0029] It should be noted that the specific structure of the first preset self-attention network model can refer to the encoding and decoding structure of the Transformer or the encoding and decoding structure of the Deformable DETR (Deformable Transformers for end-to-end object detection) network, which will not be repeated here.
[0030] S103. Determine an object preference dynamic vector based on multiple user sets and a second preset self-attention network model; the object preference dynamic vector represents the relationship between multiple users.
[0031] In this embodiment of the present invention, a second preset self-attention network model is used to mine the interrelationships between different users. Its structure and implementation steps can be found in the description of the self-attention network model above and will not be repeated here. Using this second preset self-attention network model, the popularity trends of objects among the general public are mined based on multiple user sets to obtain collaborative information about other users, namely, the object preference dynamic vector. By integrating information about other users who purchased the same object across multiple user sets, this reflects the collaborative effects of different users and increases the generalizability of object recommendations.
[0032] It should be noted that the above S102 and the above S103 can be executed simultaneously or in sequence. For example, S103 can be executed first and then S102. The embodiment of the present invention is illustrated by taking S102 as an example and then S103 as an example, which does not mean that the embodiment of the present invention is limited to this. The embodiment of the present invention does not limit the execution order of S102 and S103.
[0033] S104: Determine an object recommendation list according to the user preference dynamic vector and the object preference dynamic vector; the object recommendation list reflects the ranking relationship of multiple objects.
[0034] In an embodiment of the present invention, after obtaining the user preference dynamic vector and the object preference dynamic vector, the probability of each object being purchased by the target user can be determined based on the user preference dynamic vector and the object preference dynamic vector. Based on the probability of each object being purchased by the target user, multiple objects can be sorted to obtain an object recommendation list. The object recommendation list aggregates the target user's interaction intention and collaborative information of other users, reflecting the probability that the object may be purchased by the target user. It can be used to recommend the target user, thereby improving the efficiency of object recommendation. For example, if the object recommendation list is a ranking relationship of the target user's selection probability for each object from large to small, a preset number of objects at the front are selected for recommendation, such as the first 3, the first 5, etc.; if the object recommendation list is a ranking relationship of the target user's selection probability for each object from small to large, a preset number of objects at the back are selected for recommendation, such as the last 3, the last 7, etc.; the embodiment of the present invention does not limit the specific screening method.
[0035] Cloud service platforms in the related art categorize cloud services statically, categorizing them according to established policies. Users are required to learn about different service types and combine them to build their desired production environment. This reduces the efficiency of cloud service recommendations for cloud service users who seek rapid production deployment.
[0036] According to the solution provided by an embodiment of the present invention, multiple historical object sets of a target user and user sets in which each object was selected by the user are obtained. Each historical object set includes multiple historical objects selected by the target user at the same time, where the user includes the target user and the object includes the historical objects. A user preference dynamic vector is determined based on the multiple historical objects included in each historical object set and a first preset self-attention network model. The user preference dynamic vector represents the interdependencies between the multiple historical object sets, and the target user's interaction intent is mined from the multiple historical object sets to filter out related objects of interest to the target user. An object preference dynamic vector is determined based on the multiple user sets and a second preset self-attention network model. The object preference dynamic vector represents the relationship between multiple users. By integrating information about other users who purchased the same object across multiple user sets, it reflects the synergy between different users and increases the generalization of object recommendations. An object recommendation list is determined based on the user preference dynamic vector and the object preference dynamic vector. The object recommendation list reflects the ranking relationship between multiple objects and aggregates the target user's interaction intent and collaborative information from other users, improving the efficiency of object recommendations.
[0037] In some embodiments, the above Figure 1 After S104, the object recommendation method further includes S105.
[0038] S105: Automatically recommend an object combination to the target user based on the object recommendation list, where the object combination includes at least one object.
[0039] In an embodiment of the present invention, after obtaining the object recommendation list, according to the object recommendation list, when the target user makes a purchase, a shopping combination (i.e., different object combinations) is automatically provided to the target user, making it convenient for the user to select the required environment at one time, thereby improving the efficiency of object recommendation.
[0040] In an embodiment of the present invention, in a cloud service recommendation scenario, the combined cloud service recommendation algorithm selects the purchase data of the target user and uses the self-attention network model to mine the user interaction intentions contained in the purchase data. When configuring a specific cloud service environment for the target user, the combined service can be recommended to the target user, and the related cloud services that the target user is interested in can be adaptively screened out for the target user to choose, making it easier for the target user to purchase and improving the recommendation efficiency of the cloud service.
[0041] In some embodiments, the above Figure 1S101 can also be implemented in the following manner: obtaining historical order information of multiple users within a preset time period; the multiple users include a target user and multiple other users; mapping the historical order information of the multiple users based on a preset mapping relationship between identifiers and users to obtain implicit feedback data; filtering the implicit feedback data using a collaborative filtering algorithm to obtain multiple historical object sets of the multiple users, and sets of users in which each object is selected by the user.
[0042] In an embodiment of the present invention, historical order information of multiple users is mapped to obtain implicit feedback data. By identifying and mapping, other user information is not displayed, which helps protect user privacy and improves information security. A collaborative filtering algorithm (CF) mines implicit user feedback data to obtain user preferences, groups users based on their preferences, and recommends items (i.e., objects) with similar tastes. The collaborative filtering algorithm in this embodiment of the present invention can be an item-based collaborative filtering algorithm. By calculating user ratings of different items (ratings represent user attitudes and preferences toward items), relationships between items are obtained. Based on these relationships, users are screened for similar items, filtering out items that users would not purchase. This results in multiple historical object sets for each user (including the target user), as well as user sets for each user in which each object was selected. Subsequent recommendations based on these filtered objects are reduced in computational effort and interference, improving both the efficiency and accuracy of object recommendations.
[0043] It should be noted that the preset mapping relationship between the identifier and the user can be set by those skilled in the art according to actual needs. For example, each user is assigned an independent identifier. The preset time period can be set by those skilled in the art according to actual needs, and this embodiment of the present invention does not limit this.
[0044] For example, Figure 2 As shown, Figure 2 This is an optional structural diagram of an overall framework provided by an embodiment of the present invention. (1) Data call: obtain user purchase record information from the database (corresponding to Figure 2 (2) Data processing: assign an independent identifier (ID) to each user, and combine the ID with its purchase record to form a mapping structure. The rest of the user's information is not used in the embodiment of the present invention, which protects user privacy and improves information security. (3) Collaborative filtering: process the data into implicit feedback data and input it into the collaborative filtering algorithm (corresponding to Figure 2(4) After generating the candidate set, the recommendation algorithm provided by the embodiment of the present invention (corresponding to the self-attention network model) is input to generate a recommendation list. (5) Front-end display: The items at the top of the recommendation list are displayed on the front-end.
[0045] In an embodiment of the present invention, in a cloud service recommendation scenario, data security is improved by processing the target user's purchase data into implicit feedback data unrelated to the target user's sensitive information. The pre-processed implicit feedback data is then used to mine dependencies between items and user intent, providing users with more convenient combination service recommendations and improving the efficiency of cloud service recommendations. By collecting the target user's implicit feedback data—that is, recording only what items the target user purchased and when—then employing a self-attention network model framework to model the sequence information embedded in the target user's historical behavior record data, valuable purchasing patterns are captured, and the synergistic effects of different users are used to predict the combination of items the target user will purchase next.
[0046] In some embodiments, the first preset self-attention network model includes a first preset sub-network model and a second preset sub-network model. Figure 1 S102 may also include S1021-S1024. Figure 3 As shown, Figure 3 A flowchart of optional steps of another object recommendation method provided by an embodiment of the present invention.
[0047] S1021 : Determine first feature matrices corresponding to each historical object set according to a time sequence in which a plurality of historical objects included in each historical object set are selected by a target user.
[0048] S1022: Input each first feature matrix into a first preset sub-network model to obtain each user preference vector corresponding to each historical object set; the user preference vector represents the mutual dependence relationship between multiple historical objects included in the historical object set.
[0049] In an embodiment of the present invention, the first preset sub-network model and the second preset sub-network model are both the self-attention network models introduced above. Take the historical object as an item, the historical object set as a shopping basket, and the shopping basket as an example to illustrate. In view of the situation where the target user purchases multiple items within a certain time period (for example, three days, one day, 6 hours, etc.) under the cloud service, the association relationship between these multiple items is distinguished and encoded by setting the form of a shopping basket, that is, for each shopping basket, the first feature matrix corresponding to the shopping basket is determined according to the time sequence in which the multiple items in the shopping basket are purchased. A shopping basket contains a collection of items purchased by the target user at a single time. The embodiment of the present invention encodes the representation of the purchase sequence by calculating the association within the shopping basket and between multiple shopping baskets.
[0050] For example, in the internal dependency calculation layer of the shopping basket of the recommendation algorithm, for each shopping basket, the first preset sub-network model is used to capture the relationship between different items in the item sequence purchased by the target user. The set of items in the purchased item sequence is regarded as a key-value pair. The key-value query has three basic elements: query (Q), key (K) and value (V). In the self-attention mechanism, the query, key and value are the same during the model training phase. Taking the item sequence purchased by the target user u as an example, which includes s items, the first feature matrix is set Represents the feature vector of the sth item purchased by the target user u. If, during modeling (model training phase), each item in the item sequence is allowed to contribute equally to the prediction of the target user's interaction effect at the next moment, a large error will be introduced into the final result. For the target user's interest preference at the next moment, the weights of each item in the historically purchased item sequence are different. Therefore, during the model training phase, the embodiment of the present invention uses a self-attention network model to learn the weights of each item in the historically purchased item sequence, and at the same time learns the correlation between different items, so as to mine the target user's preference for each item at the next moment. After the model training is completed, when making item recommendations, the latent feature matrix (corresponding to the first feature matrix) of the target user's historically purchased item sequence is input into the self-attention network model to learn the target user's preference for each item (i.e., the user preference vector), as shown in formulas (1) and (2).
[0051]
[0052]
[0053] In the above formula (1), h is the number of heads in the multi-head attention mechanism in the self-attention network model, Corresponding to the jth head, [,] corresponds to the vector splicing operation, Indicates concatenating the features output by multiple self-attention layers, Wf is the parameter to be learned. In the above formula (2), Softmax represents the normalization function, represents the normalization parameter used for normalization, represents the weight corresponding to the query (Q) in the j-th head, represents the weight corresponding to the key (K) in the jth head, It represents the weight corresponding to the j-th head median (V), and T represents the matrix transpose.
[0054] The embodiment of the present invention adopts layer normalization technology and residual connection technology to propagate the underlying features to a higher level, thereby improving the performance and stable training of the self-attention network model, as shown in formula (3), formula (4) and formula (5).
[0055] F u =LayerNorm(F u +M u ) (3)
[0056] L u =Relu(F u W1+b1) (4)
[0057] L u =L u +F u (5)
[0058] In the above formula (3), LayerNorm represents the normalization technology, which converts the F obtained in the above formula (1) into u With the first characteristic matrix M u Normalize and retain the original information. In the above formula (4), L u is the output of the self-attention layer based on the target user, which is the vector representation of the target user's hidden interest preference. W1 and b1 are parameters. The Relu function is a linear rectification function, which is used for model convergence. It is a mathematical processing method to convert L u The value of is limited to between 0 and 1. In the above formula (5), the F obtained in formula (3) is u and L obtained in formula (4) u Add them together to form the user preference vector.
[0059] S1023: Determine a second feature matrix based on the multiple user preference vectors and the time sequence in which the multiple historical object sets are selected by the target user.
[0060] S1024: Input the second feature matrix into the second preset sub-network model to obtain a user preference dynamic vector.
[0061] For example, in the calculation layer of the association relationship between shopping baskets in the recommendation algorithm, take the target user u purchasing a shopping basket as an example, that is, the sequence of items purchased by the target user u is divided into shopping baskets, and the second feature matrix is set The feature vector representing the a-th shopping basket purchased by target user u, that is, the user preference vector of target user u for the a-th shopping basket. After obtaining the interdependence of items in each shopping basket, the last output vector L from the attention network model is taken. u As the vector representation of the current shopping basket (i.e. L u ), and then the vector representations of different shopping baskets are arranged into a sequence in chronological order (corresponding to the second feature matrix), which is input into the self-attention network model to obtain the mutual dependence relationship between different shopping baskets, as shown in formula (6).
[0062]
[0063] Since the self-attention network model (i.e., the first preset sub-network model and the second preset sub-network model) is used to mine the relationship between different items in the shopping cart and the relationship between multiple shopping carts, the structure of the self-attention network model is consistent. Therefore, the meanings expressed by the parameters in the above formula (6) and the above formula (2) are consistent. The difference lies in the difference in their input and output. The input of the first preset sub-network model is M u , the output is L u ; The input of the second preset sub-network model is B u , the output is O u In the above formula (6), Softmax represents the normalization function. Represents the normalization parameter used for normalization, W Q represents the weight corresponding to the query (Q), W K Indicates the weight corresponding to the key (K), W V Indicates that the value (V) corresponds to the weight, and T represents the matrix transpose.
[0064] Related technologies in cloud service platforms fail to consider the combined effects of multiple different types of cloud services. For example, cloud security services require fixed policy support from cloud network services, which relies on manual configuration by users and fails to meet users' demand for cloud service flexibility.
[0065] In an embodiment of the present invention, recommendations are made to target users based on their shopping baskets. Within the shopping basket, the interrelationships between the target user's single purchase sequences are modeled to achieve the effect of model combination service recommendation. Between shopping baskets, the target user's changing interests over time are modeled to accurately capture the target user's user interaction intentions. By integrating modeling within and between shopping baskets, a user-personalized combined service recommendation method is implemented, improving the flexibility of recommendations. By using a recommendation algorithm with two layers of modeling, within and between shopping baskets, a coarse-grained characterization of user intentions and a fine-grained modeling of item associations can be achieved, effectively mining valuable pattern information in purchase data and improving recommendation performance and efficiency.
[0066] In some embodiments, the above Figure 1 S103 may also include S1031-S1032. Figure 4 As shown, Figure 4 A flowchart of optional steps of another object recommendation method provided by an embodiment of the present invention.
[0067] S1031 : Determine a third feature matrix according to the time sequence in which objects in each user set are selected by the user.
[0068] S1032. Input the third feature matrix into the second preset self-attention network model to obtain an object preference dynamic vector.
[0069] For example, in the user association relationship calculation layer of the recommendation algorithm, taking item i purchased by t users as an example, the t users who purchased item i are arranged into a sequence in the order of purchase time, and the third feature matrix is set The feature vector representing item i purchased by the tth user. This embodiment of the present invention uses a self-attention network model to learn the relationships between users in the item purchase sequence. This can exploit the interrelationships between different users, enhance the synergistic effect of the model, and thus explore the popularity trends of items among the general public. The latent feature matrix of the item purchase sequence (corresponding to the third feature matrix) is input into the self-attention network model to learn the latent features of the items that change over time (corresponding to the object preference dynamic vector), as shown in Formulas (7) and (8).
[0070]
[0071]
[0072] Since the self-attention network model (i.e., the first preset sub-network model and the third self-attention network model) is used to perform relationship mining when extracting the relationship between different items in the target user's shopping cart and when extracting the relationship between multiple different users corresponding to the target items, the structure of the self-attention network model is consistent. Therefore, the meanings expressed by the parameters in the above formula (7) and the above formula (1) are consistent, and the meanings expressed by the parameters in the above formula (8) and the above formula (2) are consistent, but the specific contents are different. For example, W f 、 In the above formula (7), h is the number of heads in the multi-head attention mechanism in the self-attention network model, and f i j Corresponding to the jth head, [,] corresponds to the vector splicing operation, [f i 1 ,f i 1 ,f i 1 ] means concatenating the features output by multiple self-attention layers, W f is the parameter to be learned. In the above formula (8), Softmax represents the normalization function, represents the normalization parameter used for normalization, represents the weight corresponding to the query (Q) in the j-th head, represents the weight corresponding to the key (K) in the jth head, It represents the weight corresponding to the j-th head median (V), and T represents the matrix transpose.
[0073] The embodiment of the present invention adopts layer normalization technology and residual connection technology to propagate the underlying features to a higher level, thereby improving the performance and stable training of the self-attention network model, as shown in formulas (9), (10) and (11).
[0074] F i =LayerNorm(F i +M i ) (9)
[0075] O i =Relu(F i W1+b1) (10)
[0076] O i =O i +F i (11)
[0077] In the above formula (9), LayerNorm represents the normalization technology, which is to convert the F obtained in the above formula (9) into i and the third characteristic matrix M iNormalize and retain the original information. In the above formula (10), O i is the output of the self-attention layer based on the item, which is the vector representation of the item's hidden features. W1 and b1 are parameters. The Relu function is a linear rectification function used for model convergence. It is a mathematical processing method that converts O i The value of is limited to between 0 and 1. In the above formula (11), the F obtained in formula (9) is i and O obtained in formula (10) i Add them together to form the item preference dynamic vector, that is, the object preference dynamic vector.
[0078] In some embodiments, the above Figure 1 S104 may also include S1041-S1042. Figure 5 As shown, Figure 5 A flowchart of optional steps of another object recommendation method provided by an embodiment of the present invention.
[0079] S1041 : Determine the target user's selection probability for each object based on the user preference dynamic vector and the object preference dynamic vector.
[0080] S1042: Generate an object recommendation list based on the target user's selection probability for each object.
[0081] In the embodiment of the present invention, at the prediction layer of the recommendation algorithm, the user preference dynamic vector O is obtained according to the above formulas (1) to (11): u and object preference dynamic vector O i , the probability y that the target user u purchases item i in the next moment ui The calculation is shown in formula (12).
[0082]
[0083] In the above formula (12), T represents the matrix transpose. u and object preference dynamic vector O i Multiply them together to get the target user's selection probability y for each object ui According to y ui The size of y is generated according to the order and the preset number of objects. The object recommendation list includes the preset number of y ui The front object.
[0084] In related technologies, recommendation algorithms choose to incorporate other users' vector information into the embedding layer to increase the synergistic effect, which easily affects the calculation of the original correlation between items, resulting in large deviations. At the same time, the order information between user vectors is lost, reducing the accuracy of the recommendation effect. In contrast, in the embodiment of the present invention, in the prediction layer of the recommendation algorithm, when predicting the user's rating of the item, the vector information of other users is incorporated to enhance the synergistic effect between different users (corresponding to the above formulas (7) to (11)). By incorporating other user information into the prediction layer instead of the related technology of incorporating it into the embedding layer, the problem of introducing other user information when calculating the correlation between items, which causes large errors, is avoided, thereby improving the accuracy of the recommendation effect.
[0085] An object recommendation method provided by an embodiment of the present invention integrates vector information from other users. At the prediction layer, vector information from multiple users is aggregated, centered around the target item. This information is then encoded in a sequence and incorporated into the recommendation algorithm model. Specifically, at the prediction layer, vectors of users who purchased the same item are encoded in a sequence to aggregate collaborative information from different users. This helps the recommendation algorithm model adaptively learn the synergy between different users, enhancing its generalization and ensuring that the model's recommendations are closer to reality, providing more accurate recommendations for target users.
[0086] In some embodiments, in the above Figure 5 Before S1042, the object recommendation method also includes S201-S203.
[0087] S201: Determine a user preference static vector according to multiple objects and a preset user position vector.
[0088] In some embodiments, the above S201 can also be implemented in the following manner: constructing a user initial vector of the target user based on multiple users; converting the user initial vector into a user feature vector based on a preset conversion function; the user initial vector is a sparse vector, and the user feature vector is a dense vector; and determining a user preference static vector based on the preset user position vector and the user feature vector.
[0089] S202: Determine an object preference static vector according to multiple users and preset object position vectors.
[0090] In some embodiments, the above S202 can also be implemented in the following manner: constructing an object initial vector based on multiple objects; converting the object initial vector into an object feature vector based on a preset conversion function; the object initial vector is a sparse vector and the object feature vector is a dense vector; and determining the object preference static vector based on the preset object position vector and the object feature vector.
[0091] It should be noted that the above S201 and the above S202 can be executed simultaneously or in sequence. For example, S202 can be executed first and then S201. The embodiment of the present invention is illustrated by executing S201 first and then executing S202 as an example, which does not mean that the embodiment of the present invention is limited to this. The embodiment of the present invention does not limit the execution order of S201 and S202.
[0092] In the embodiment of the present invention, at the embedding layer of the recommendation algorithm, the user vector and the object vector are encoded at the embedded coding layer so that the data encoding format can adapt to the recommendation algorithm model and thus perform the operation. Taking the object as an example, the elements of the user vector and the item vector are all composed of 0 or 1. M users are numbered starting from zero, and the user numbered j is represented as an M-dimensional vector, where the position with the subscript j is represented as 1 and the other positions are represented as 0, thereby obtaining the user initial vector E u Similarly, N items are numbered starting from zero. The item numbered k is represented as an N-dimensional vector, where the position with subscript k is represented as 1 and the other positions are represented as 0, thus obtaining the initial vector E of the item i (i.e., the object initial vector.) Both the user initial vector and the object initial vector are sparse vectors.
[0093] In the embodiment of the present invention, since the sparse vector representation will lead to an excessively large dimension, the embodiment of the present invention uses the transformation matrix in the embedding layer to transform the user initial vector E u and the item initial vector E i The sparse vector representation is converted to a dense vector representation. Each dense vector represents the implicit feature of the user or item. The user’s implicit feature vector M u (corresponding to the user feature vector) and the item latent feature vector M i The calculation formulas for (corresponding to the object feature vector) are shown in formulas (13) and (14).
[0094] M u =LOOKUP(U T ,E u ) (13)
[0095] M i =LOOKUP(W T ,E i ) (14)
[0096] In the above formulas (13) and (14), LOOKUP represents the conversion function, U∈R K×M and W∈R K×N is the transformation matrix of LOOKUP, U and W are parameters that can be trained during the recommendation algorithm model training process, and T represents the matrix transpose.
[0097] In the embodiment of the present invention, in the self-attention network model, the dependency relationship between two elements in the feature sequence is calculated independently of their positional relationship in the feature sequence. Therefore, the self-attention network model is different from the recurrent neural network model and cannot model the temporal information of the feature sequence. u ∈R p (corresponding to the preset user position vector) and the p-dimensional item position vector P i ∈R p (corresponding to the preset object position vector), p assigns a position information to each item in the feature sequence, so that the model can recognize the order of the feature sequence. The calculation formulas for the user latent feature vector (corresponding to the user feature vector) and the item latent feature vector (corresponding to the object feature vector) that can recognize the order of the feature sequence are shown in Formulas (15) and (16).
[0098] M u =M u +P u (15)
[0099] M i =M i +P i (16)
[0100] In the above formula (15), P u Represents the preset user position vector, and the user feature vector M after dense conversion in formula (13) u Add the preset user position vector P u , as the user preference static vector M u In formula (16), P i Represents the preset object position vector, and the object feature vector M after dense transformation in formula (14) i Add the preset object position vector P i , get the object preference static vector M i . M u and P u It can be obtained through training during the recommendation algorithm model training process.
[0101] It should be noted that the user prefers a static vector M u and the object preference static vector M i Related to user interaction pairs. In other words, the recommendation algorithm model predicts whether the target user u will purchase item i at the next moment. u represents the embedding representation of the item sequence purchased by the target user u, and M iThe embedded representation of the sequence of users who purchased item i. Analyzing both user and item sequences simultaneously can make the recommendation algorithm model more sensitive to the dynamics of real-world purchase scenarios.
[0102] S203: Determine the target user's correction probability for each object based on the user preference static vector and the object preference static vector.
[0103] In this embodiment of the present invention, the user preference static vector M u and the object preference static vector M i Multiply them together to obtain the target user u’s general static preference for item i (i.e., the revised probability of target user u for item i), and thus obtain the revised probability of the target user for each object.
[0104] Combined with the above S201-S203, the above Figure 5 S1042 can also be implemented through S204 and S205.
[0105] S204: Add the target user's selection probability for each object and the target user's correction probability for each object to obtain the target user's target probability for each object.
[0106] S205: Generate an object recommendation list based on the target probability of the target user for each object.
[0107] In the embodiment of the present invention, the dynamic preference of target user u for item i at the next moment is obtained according to the above formula (12). The recommendation algorithm model is too sensitive to the dynamic changes in the feature sequence, which can easily lead to the target user's insignificant purchase record affecting the target user's prediction of the degree of preference for the item. Therefore, the embodiment of the present invention adds the general static preference prediction of target user u for item i to the prediction layer, and converts the target user's selection probability for each object into the target user's selection probability. and the target user's probability of correction for each object Add together to obtain the final probability y of the target user for each object ui '. As shown in formula (17).
[0108]
[0109] In the embodiment of the present invention, after obtaining the final probability y of the target user for each object ui 'Afterwards, according to y ui 'Generate an object recommendation list. Exemplarily, according to y ui 'size, generate an object recommendation list according to the order and preset number, the object recommendation list includes the preset number of y uiThe embodiment of the present invention uses standard factorization to integrate the model's sequential dynamics and the generality of user preferences, achieving a balance between static and dynamic effects and improving the accuracy of recommended objects.
[0110] The following describes an exemplary application of an embodiment of the present invention in a practical application scenario.
[0111] In the embodiment of the present invention, the historical object is an item, the historical object set is a shopping basket, and the shopping basket includes multiple items. A shopping basket contains a collection of items purchased by a target user in a single transaction. The embodiment of the present invention encodes the representation of the purchase sequence by calculating the association within the shopping basket and between multiple shopping baskets. Figure 6 As shown, Figure 6 An optional structural diagram of a recommendation algorithm model provided by an embodiment of the present invention.
[0112] In the embodiment of the present invention, within each shopping cart, items are arranged into a sequence according to the order of purchase, and the self-attention network model ( Figure 6 The self-attention network is shown in the figure) to encode the correlation between different items in the shopping basket and obtain the vector representation of the shopping basket ( Figure 6 The vector representation of the shopping basket learns the characteristics of the items purchased by the user in a short period of time and establishes the first layer of fine-grained dependency calculation. Then, the above operation is performed on multiple shopping baskets of the target user to obtain vector representations of different shopping baskets. The shopping baskets are arranged into a sequence according to the order of purchase. The self-attention network model is further used to learn the relationship between different shopping baskets to obtain the vector representation of the shopping basket level ( Figure 6 As a comprehensive representation of the target user's purchase data, a second layer of coarse-grained dependency calculation is established. The two-layer architecture of the recommendation algorithm model can better simulate and approximate the target user's actual purchasing behavior, helping the recommendation algorithm model make more accurate recommendations and improving both efficiency and accuracy.
[0113] Then, when predicting the target user's rating of an item, the embodiment of the present invention incorporates the vector information of other users to enhance the synergy between different users. When calculating the other user information related to the fused target item, a sequence form is also used ( Figure 6In the example of multiple users inputting into the self-attention network, the sequential information of other users who have interacted with the target item will also be taken into account, which can enable the recommendation algorithm model to learn more information and improve the accuracy of the recommendation algorithm model. Then, in order to solve the problem that the recommendation algorithm model is overly sensitive to the sequence characteristics of the target item during training and often learns useless associations, the embodiment of the present invention calculates the static score ( Figure 6 Indicated by static score in the figure), in order to correct the final recommendation result of the recommendation algorithm model ( Figure 6 The final score is shown in the figure).
[0114] In related technologies, the recommendation method of the cloud service platform only coarsely analyzes the user's interest preferences from the user's overall data, that is, it treats the items that the user interacts with in different time periods as a single sequence to analyze the user's intention, ignoring that the set of items purchased by the user in the short term has a stronger mutual correlation.
[0115] An embodiment of the present invention provides a method for recommending combined cloud services in a cloud service scenario. By collecting users' historical cloud service purchase behaviors and using a recommendation algorithm model to analyze user intentions, personalized combined services are provided to target users when they have new cloud service purchase needs. When target users have new purchase needs, they can refer to the recommended solution for combined cloud services provided by the recommendation system and complete the configuration of the required environment at one time, thereby improving the recommendation efficiency of cloud services and increasing user stickiness. The embedding layer encoding of the self-attention network model is used to obtain the mutual correlation between items in the shopping basket, and then the same operation is performed on multiple shopping baskets of the target user to obtain vector representations of different shopping baskets, thereby helping the recommendation algorithm model to make more accurate recommendations. Then, when predicting the target user's rating of an item, the embodiment of the present invention incorporates the vector information of other users to enhance the synergy between different users, explore the popular trends of the target item among the public, and improve the recommendation accuracy of cloud services.
[0116] Based on the object recommendation method described in any of the above embodiments, the embodiment of the present invention conducted an effectiveness experiment of the recommendation algorithm model on three real-world datasets, namely the Amazon, Tmall, and MovieLens datasets. The dataset information is shown in Table 1.
[0117] Table 1
[0118] Dataset Amazon Tmall MovieLens Number of users 192,403 23,831 6,040 Number of projects 63,001 12,246 3706 Number of interactions 1,689,188 332,050 1,000,209 Sparsity (%) 99.98 99.88 95.53
[0119] Table 1 above shows the number of users, number of items, number of interactions, and sparsity of each dataset respectively.
[0120] This embodiment of the present invention evaluates the performance of recommendation algorithm models using two widely used metrics: Hit Ratio (HR) and Normalized Discounted Cumulative Gain (NDCG). This allows for evaluating the performance of each recommendation algorithm model from a sequential recommendation perspective. HR measures the accuracy of recommendations, while NDCG is sensitive to the ranking of the target recommended items and can assign higher weights to recommended items with higher rankings. The present invention employs a leave-one-out approach to test the recommendation algorithm model. For example, 100 items that the user has not interacted with are randomly selected together with the target item to form a new set. The probability of the user purchasing the target item from this set in the next moment is then calculated. The embedding dimension size d is fixed at 60, the batch size is fixed at 1000, and the dropout rate is fixed at 0.5. Furthermore, the maximum sequence length n is set to 50 on the three datasets (Amazon, Tmall, and MovieLens). Using the leave-one-out approach accelerates testing. The experimental results are shown in Table 2.
[0121] Table 2
[0122]
[0123] In Table 2 above, @10 indicates that the top 10 probabilities are used to comprehensively consider the accuracy metric (i.e., HR). When training the recommendation algorithm model, one portion of the dataset is used as the training set and the other portion as the validation set. The experimental results represent the hit ratio between the predicted value obtained from the training set and the true value corresponding to the validation set. @20 indicates that the top 20 probabilities are used to comprehensively consider the weighted metric (NDCG). For HR, only the item hit rate is considered, not the item ranking order. Even if the item hit rate is high, if the missed items are ranked high, it does not mean that the recommendation algorithm model has good performance. Therefore, this embodiment of the present invention also provides NDCG to evaluate the recommendation algorithm model in another dimension. Evaluating the training effect of the recommendation algorithm model based on two-dimensional evaluation criteria improves the accuracy of the training results. As can be seen from Table 1 above, the object recommendation method provided by this embodiment of the present invention achieves good recommendation results.
[0124] In some embodiments, the object recommendation method further includes a model training step of a first preset self-attention network model and a second preset self-attention network model, and the model training step may include S301-S305.
[0125] S301. Obtain historical behavior data of a target user and user set samples of each object sample selected by the user; the historical behavior data includes multiple historical set samples, each historical sample set includes multiple historical object samples selected by the target user at the same time, and the object samples include historical object samples.
[0126] S302. Determine a user preference dynamic prediction vector based on the historical behavior data and the first initial self-attention network model; the user preference dynamic prediction vector represents the interdependence between multiple historical set samples.
[0127] S303. Determine an object preference dynamic prediction vector based on multiple user set samples and the second initial self-attention network model; the object preference dynamic prediction vector represents the relationship between multiple users.
[0128] It should be noted that the above S302 and the above S303 can be executed simultaneously or in sequence. For example, S303 can be executed first and then S302. The embodiment of the present invention is illustrated by taking S302 as an example and then S303 as an example, which does not mean that the embodiment of the present invention is limited to this. The embodiment of the present invention does not limit the execution order of S302 and S303.
[0129] S304: Determine the target user's selection prediction probability for each object sample based on the user preference dynamic prediction vector and the object preference dynamic prediction vector.
[0130] S305. Continuously train the first initial self-attention network model and the second initial self-attention network model according to the preset loss function and the target user's predicted probability of selecting each object sample to obtain the first preset self-attention network model and the second preset self-attention network model.
[0131] In an embodiment of the present invention, during the training of a recommendation algorithm model, a first initial self-attention network model includes a first initial sub-network model and a second initial sub-network model. Based on the time sequence in which multiple historical object samples included in each historical sample set were selected by the target user, first feature matrix samples corresponding to each historical sample set are determined. Each first feature matrix sample is input into the first initial sub-network model to obtain a user preference prediction vector corresponding to each historical sample set. Based on the multiple user preference prediction vectors and the time sequence in which the multiple historical sample sets were selected by the target user, second feature matrix samples are determined. The second feature matrix samples are input into the second initial sub-network model to obtain a user preference dynamic prediction vector. Based on the time sequence in which the object samples in each user set sample were selected by the user, third feature matrix samples are determined. The third feature matrix samples are input into the second preset self-attention network model to obtain an object preference dynamic prediction vector. The user preference dynamic prediction vector and the object preference dynamic prediction vector are added together to output the target user's selection prediction probability for each object sample. A loss value is obtained based on the target user's predicted probability of selection for each object sample and a preset loss function; the first initial sub-network model, the second initial sub-network model, and the second initial self-attention network model are continuously trained according to the loss value until the training termination condition is reached, for example, the number of training times reaches a preset number of times, or the loss value reaches a preset threshold, etc., to obtain the first initial self-attention network model (including the first initial sub-network model and the second initial sub-network model) and the second preset self-attention network model.
[0132] It should be noted that the preset loss function (loss function) can be a loss function appropriately set by those skilled in the art according to actual conditions, and can be any of the following: intersection-over-union ratio (DiceLoss), smooth SmoothL1 loss function, logarithmic loss function (logLoss, LR), hinge loss function (hinge loss, SVM), exponential loss function (exp-loss, AdaBoost), cross-entropy loss function (cross-entropy loss, Softmax), square error loss function (quadratic loss), absolute value loss function (absolute loss) and 0-1 loss function (0-1loss), etc., which are not limited to the embodiments of the present invention.
[0133] For example, the cross entropy loss function is used as the optimization objective function of the recommendation algorithm model. The loss function formula is shown in formula (18).
[0134]
[0135] In the above formula (18), loss represents the loss function, U and I represent the user set and item set respectively, u represents the target user u, t is a sequence used to represent time, σ represents the standard deviation, represents the probability of target user u selecting the jth item in sequence t, represents the probability of the kth user selecting an item in sequence t. Furthermore, for each target item j in the training sequence, the present invention randomly extracts a negative example k (indicating that the user would not purchase the item) to avoid situations where the target user has a very high probability of selecting each item, thereby improving the accuracy of the prediction results. The Adam optimizer is used to update the parameters of the recommendation algorithm model, which includes a first preset self-attention network model, a first preset sub-network model, and a second preset sub-network model.
[0136] In some embodiments, the model training step also includes S401-S403.
[0137] S401: Determine a user preference static prediction vector based on multiple object samples and an initial user position vector.
[0138] S402: Determine an object preference static prediction vector based on multiple users and the initial object position vector.
[0139] S403: Determine the target user's revised prediction probability for each object sample based on the user preference static prediction vector and the object preference static prediction vector.
[0140] Based on the above S401-S403, the above S305 may further include S404 and S405.
[0141] S404: Add the target user's selection prediction probability for each object sample and the target user's revised prediction probability for each object sample to obtain the target user's target prediction probability for each object sample.
[0142] S405. According to the preset loss function and the target prediction probability of the target user for each object sample, the first initial self-attention network model, the second initial self-attention network model, the initial object position vector and the initial user position vector are continuously trained to obtain the first preset self-attention network model, the second preset self-attention network model, the preset object position vector and the preset user position vector.
[0143] In an embodiment of the present invention, in combination with the relevant descriptions in the above formulas (15) and (16), when training the recommendation algorithm model, the initial object position vector and the initial user position vector are also trained, and after the training is completed, the preset object position vector and the preset user position vector are obtained.
[0144] In some embodiments, the above S402 may also be implemented in the following manner: constructing an object initial vector sample based on multiple object samples; converting the object initial vector sample into an object feature prediction vector based on an initial conversion function; and determining an object preference static prediction vector based on the initial object position vector and the object feature prediction vector.
[0145] The above S401 can also be implemented in the following manner: constructing a user initial vector sample of the target user based on multiple users; converting the user initial vector sample into a user feature prediction vector based on an initial conversion function; and determining a user preference static prediction vector based on the initial user position vector and the user feature prediction vector.
[0146] Based on the specific implementation of S401 and S402 above, S405 above can also be implemented in the following manner. According to a preset loss function and the target prediction probability of the target user for each object sample, the first initial self-attention network model, the second initial self-attention network model, the initial object position vector, the initial user position vector, and the initial conversion function are continuously trained to obtain the first preset self-attention network model, the second preset self-attention network model, the preset object position vector, the preset user position vector, and the preset conversion function.
[0147] In an embodiment of the present invention, in combination with the relevant descriptions in the above formula (13) and formula (14), when training the recommendation algorithm model, the initial conversion function is also trained, and the preset conversion function is obtained after the training is completed.
[0148] In order to implement the object recommendation method of the embodiment of the present invention, the embodiment of the present invention also provides an object recommendation device, such as Figure 7 As shown, Figure 7 Schematic diagram of an optional structure of an object recommendation device provided in an embodiment of the present invention. The object recommendation device 70 includes: an acquisition module 701, configured to acquire multiple historical object sets of a target user, and user sets in which each object was selected by the user; each historical object set includes multiple historical objects selected by the target user at the same time, the user including the target user, and the object including the historical object;
[0149] Determination module 702 is configured to determine a user preference dynamic vector based on multiple historical objects included in each historical object set and a first preset self-attention network model; the user preference dynamic vector represents the interdependence between the multiple historical object sets; and determine an object preference dynamic vector based on multiple user sets and a second preset self-attention network model; the object preference dynamic vector represents the relationship between multiple users.
[0150] The list generating module 703 is configured to determine an object recommendation list according to the user preference dynamic vector and the object preference dynamic vector; the object recommendation list reflects the ranking relationship of multiple objects.
[0151] In some embodiments, the first preset self-attention network model includes a first preset sub-network model and a second preset sub-network model;
[0152] Determination module 702 is further configured to determine first feature matrices corresponding to each historical object set based on the time sequence in which the multiple historical objects included in each historical object set are selected by the target user; input each first feature matrix into a first preset sub-network model to obtain user preference vectors corresponding to each historical object set; the user preference vector represents the interdependence between the multiple historical objects included in the historical object set; determine a second feature matrix based on the multiple user preference vectors and the time sequence in which the multiple historical object sets are selected by the target user; and input the second feature matrix into a second preset sub-network model to obtain a user preference dynamic vector.
[0153] In some embodiments, the determination module 702 is further used to determine a third feature matrix based on the time sequence in which objects in each user set are selected by users; and input the third feature matrix into the second preset self-attention network model to obtain an object preference dynamic vector.
[0154] In some embodiments, the list generation module 703 is further configured to determine the target user's selection probability for each object based on the user preference dynamic vector and the object preference dynamic vector; and generate an object recommendation list based on the target user's selection probability for each object.
[0155] In some embodiments, the determination module 702 is further configured to determine a user preference static vector based on multiple objects and a preset user position vector; determine an object preference static vector based on multiple users and a preset object position vector; and determine a target user's correction probability for each object based on the user preference static vector and the object preference static vector.
[0156] The list generating module 703 is further configured to generate an object recommendation list according to the target user's selection probability for each object and the target user's correction probability for each object.
[0157] In some embodiments, the list generation module 703 is further used to add the target user's selection probability for each object and the target user's revised probability for each object to obtain the target user's target probability for each object; and generate an object recommendation list based on the target user's target probability for each object.
[0158] In some embodiments, the determination module 702 is further used to construct a user initial vector of the target user based on multiple users; convert the user initial vector into a user feature vector according to a preset conversion function; the user initial vector is a sparse vector, and the user feature vector is a dense vector; and determine the user preference static vector based on the preset user position vector and the user feature vector.
[0159] In some embodiments, the determination module 702 is further used to construct an object initial vector based on multiple objects; convert the object initial vector into an object feature vector according to a preset conversion function; the object initial vector is a sparse vector, and the object feature vector is a dense vector; and determine the object preference static vector based on the preset object position vector and the object feature vector.
[0160] In some embodiments, the object recommendation apparatus 70 further includes a recommendation module 704;
[0161] The recommendation module 704 is configured to automatically recommend an object combination to a target user based on the object recommendation list, where the object combination includes at least one object.
[0162] In some embodiments, the acquisition module 701 is also used to obtain historical order information of multiple users within a preset time period; the multiple users include a target user and multiple other users; the historical order information of the multiple users is mapped according to a preset mapping relationship between the identifier and the user to obtain implicit feedback data; the implicit feedback data is filtered through a collaborative filtering algorithm to obtain multiple historical object sets of the multiple users, as well as sets of users in which each object is selected by the user.
[0163] In some embodiments, the object recommendation device 70 further includes a training module 705;
[0164] The acquisition module 701 is further configured to acquire the target user's historical behavior data and each user set sample in which each object sample is selected by the user; the historical behavior data includes multiple historical set samples, each historical sample set includes multiple historical object samples selected by the target user at the same time, and the object samples include historical object samples;
[0165] Determination module 702 is further configured to determine a user preference dynamic prediction vector based on the historical behavior data and the first initial self-attention network model; the user preference dynamic prediction vector represents the interdependence between multiple historical set samples; determine an object preference dynamic prediction vector based on the multiple user set samples and the second initial self-attention network model; the object preference dynamic prediction vector represents the relationship between multiple users; and determine a target user's selection prediction probability for each object sample based on the user preference dynamic prediction vector and the object preference dynamic prediction vector.
[0166] The training module 705 is used to continuously train the first initial self-attention network model and the second initial self-attention network model according to the preset loss function and the target user's prediction probability of selection for each object sample to obtain the first preset self-attention network model and the second preset self-attention network model.
[0167] In some embodiments, the determination module 702 is further configured to determine a user preference static prediction vector based on the plurality of object samples and the initial user position vector; determine an object preference static prediction vector based on the plurality of users and the initial object position vector; and determine a modified prediction probability of the target user for each object sample based on the user preference static prediction vector and the object preference static prediction vector.
[0168] The training module 705 is also used to add the target user's selection prediction probability for each object sample and the target user's revised prediction probability for each object sample to obtain the target prediction probability of the target user for each object sample; according to the preset loss function and the target user's target prediction probability for each object sample, the first initial self-attention network model, the second initial self-attention network model, the initial object position vector and the initial user position vector are continuously trained to obtain the first preset self-attention network model, the second preset self-attention network model, the preset object position vector and the preset user position vector.
[0169] In some embodiments, the determination module 702 is further configured to construct an object initial vector sample based on multiple object samples; convert the object initial vector sample into an object feature prediction vector based on an initial conversion function; determine an object preference static prediction vector based on the initial object position vector and the object feature prediction vector; construct a user initial vector sample of a target user based on multiple users; convert the user initial vector sample into a user feature prediction vector based on the initial conversion function; and determine a user preference static prediction vector based on the initial user position vector and the user feature prediction vector.
[0170] The training module 705 is also used to continuously train the first initial self-attention network model, the second initial self-attention network model, the initial object position vector, the initial user position vector and the initial conversion function according to the preset loss function and the target prediction probability of the target user for each object sample, to obtain the first preset self-attention network model, the second preset self-attention network model, the preset object position vector, the preset user position vector and the preset conversion function.
[0171] It should be noted that the object recommendation device provided in the above embodiment only uses the division of the above program modules as an example to illustrate when performing object recommendation. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the object recommendation device provided in the above embodiment and the object recommendation method embodiment belong to the same concept. The specific implementation process and beneficial effects are detailed in the method embodiment and will not be repeated here. For technical details not disclosed in the embodiment of this device, please refer to the description of the method embodiment of the present invention for understanding.
[0172] In an embodiment of the present invention, Figure 8 This is a schematic diagram of the structure of the object recommendation device proposed in an embodiment of the present invention. Figure 8 As shown, the object recommendation device 80 provided in an embodiment of the present invention includes a processor 801 and a memory 802 storing an executable computer program. The processor 801 is configured to implement the object recommendation method provided in an embodiment of the present invention when executing the executable computer program stored in the memory 802. In some embodiments, the object recommendation device 80 may further include a communication interface 803 and a bus 804 for connecting the processor 801, the memory 802, and the communication interface 803.
[0173] In the embodiment of the present invention, the processor 801 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understood that for different devices, the electronic device used to implement the above-mentioned processor function may also be other, and the embodiment of the present invention does not specifically limit this.
[0174] In the embodiment of the present invention, the bus 804 is used to connect the communication interface 803, the processor 801 and the memory 802 to achieve mutual communication between these devices.
[0175] Memory 802 is used to store executable computer programs and data. The executable computer programs include computer operating instructions. Memory 802 may include high-speed RAM memory or non-volatile memory, such as at least two disk drives. In practical applications, memory 802 may be volatile memory, such as random-access memory (RAM); or non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); or a combination of the above types of memory, and provides executable computer programs and data to processor 801.
[0176] In addition, the functional modules in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or software functional modules.
[0177] If the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0178] An embodiment of the present invention provides a computer-readable storage medium storing a computer program for implementing the object recommendation method described in any of the above embodiments when executed by a processor.
[0179] Exemplarily, the program instructions corresponding to an object recommendation method in this embodiment can be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the program instructions corresponding to an object recommendation method in the storage medium are read or executed by an electronic device, the object recommendation method described in any of the above embodiments can be implemented.
[0180] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.
[0181] The present invention is described with reference to implementation flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the flowcharts. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0182] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which is implemented in the implementation flow diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process described in the flowchart. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0184] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention.
Claims
1. An object recommendation method, characterized in that: The method comprises: Acquire multiple historical object sets of a target user, and user sets in which each object is selected by the user; each historical object set includes multiple historical objects selected by the target user at the same time, the user includes the target user, and the object includes the historical objects; Determining a user preference dynamic vector based on the multiple historical objects included in each historical object set and a first preset self-attention network model; the user preference dynamic vector represents the mutual dependence relationship between the multiple historical object sets; Determining an object preference dynamic vector based on multiple user sets and a second preset self-attention network model; the object preference dynamic vector represents the relationship between the multiple users; determining an object recommendation list according to the user preference dynamic vector and the object preference dynamic vector; wherein the object recommendation list reflects a ranking relationship of multiple objects; The determining of an object recommendation list according to the user preference dynamic vector and the object preference dynamic vector includes: determining, based on the user preference dynamic vector and the object preference dynamic vector, a selection probability of the target user for each object; determining a user preference static vector based on the multiple objects and a preset user position vector; determining an object preference static vector based on the plurality of users and the preset object position vectors; determining, based on the user preference static vector and the object preference static vector, a correction probability of the target user for each object; Adding the target user's selection probability for each object and the target user's revised probability for each object to obtain the target user's target probability for each object; The object recommendation list is generated according to the target probability of the target user for each object.
2. The method according to claim 1, characterized in that The first preset self-attention network model includes: a first preset sub-network model and a second preset sub-network model; The determining of the user preference dynamic vector according to the multiple historical objects included in each historical object set and the first preset self-attention network model includes: determining first feature matrices corresponding to each of the historical object sets according to a time sequence in which the plurality of historical objects included in each of the historical object sets were selected by the target user; Inputting each of the first feature matrices into the first preset sub-network model to obtain each user preference vector corresponding to each of the historical object sets; the user preference vector represents the mutual dependence relationship between the multiple historical objects included in the historical object set; determining a second feature matrix according to a plurality of user preference vectors and a time sequence in which the plurality of historical object sets are selected by the target user; The second feature matrix is input into the second preset sub-network model to obtain the user preference dynamic vector.
3. The method according to claim 1, characterized in that The determining of the object preference dynamic vector according to the plurality of user sets and the second preset self-attention network model includes: determining a third feature matrix according to a time sequence in which objects in each user set are selected by the user; The third feature matrix is input into the second preset self-attention network model to obtain the object preference dynamic vector.
4. The method according to claim 1, wherein The determining of the user preference static vector according to the multiple objects and the preset user position vector includes: constructing a user initial vector of a target user based on the multiple users; According to a preset conversion function, the user initial vector is converted into a user feature vector; the user initial vector is a sparse vector, and the user feature vector is a dense vector; The user preference static vector is determined according to the preset user position vector and the user feature vector.
5. The method according to claim 1, wherein The determining of the object preference static vector according to the plurality of users and the preset object position vectors includes: constructing an object initialization vector according to the plurality of objects; According to a preset conversion function, the object initial vector is converted into an object feature vector; the object initial vector is a sparse vector, and the object feature vector is a dense vector; The object preference static vector is determined according to the preset object position vector and the object feature vector.
6. The method according to any one of claims 1 to 3, characterized in that Before obtaining the target user's multiple historical object sets, the method further includes: Obtaining historical order information of the plurality of users within a preset time period; the plurality of users includes the target user and a plurality of other users; Mapping the historical order information of the plurality of users according to a preset mapping relationship between the identifiers and the users to obtain implicit feedback data; The implicit feedback data is filtered by a collaborative filtering algorithm to obtain a plurality of historical object sets of the plurality of users and a plurality of user sets in which the plurality of objects are respectively selected by the users.
7. An object recommendation device, characterized in that: The device comprises: an acquisition module, configured to acquire multiple historical object sets of a target user and user sets in which each object is selected by the user; each historical object set includes multiple historical objects selected by the target user at the same time, the user includes the target user, and the object includes the historical object; A determination module is configured to determine a user preference dynamic vector based on multiple historical objects included in each historical object set and a first preset self-attention network model; the user preference dynamic vector represents the interdependence between the multiple historical object sets; and determine an object preference dynamic vector based on multiple user sets and a second preset self-attention network model; the object preference dynamic vector represents the relationship between multiple users; A list generation module is configured to determine the target user's selection probability for each object based on the user preference dynamic vector and the object preference dynamic vector; determine the user preference static vector based on the multiple objects and a preset user position vector; determine the object preference static vector based on the multiple users and the preset object position vector; determine the target user's revised probability for each object based on the user preference static vector and the object preference static vector; add the target user's selection probability for each object and the target user's revised probability for each object to obtain the target user's target probability for each object; generate an object recommendation list based on the target user's target probability for each object; the object recommendation list reflects the ranking relationship of multiple objects.
8. An object recommendation device, characterized in that: The device comprises: a memory for storing executable computer programs; The processor is configured to implement the method according to any one of claims 1 to 6 when executing the executable computer program stored in the memory.
9. A computer-readable storage medium, characterized in that A computer program is stored, which is used to implement the method according to any one of claims 1 to 6 when executed by a processor.
Citation Information
Patent Citations
Method for personalized recommendation of Web text
CN104615779A
Method, device and equipment for determining recommended object and computer storage medium
CN114817692A