Package service recommendation method and device, equipment, storage medium and product
By obtaining dynamic heterogeneous graph snapshots, aggregation operations based on time encoding and exponential time decay mechanisms, the problem of ignoring local dynamic evolution in traditional recommendations is solved, and the accurate recommendation of package services is achieved.
Patent Information
- Application Number
- CN202410627734.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-12-06
AI Technical Summary
When traditional recommendation tasks extract timing information through RNN, only obtain global dynamic evolution information of the whole graph and ignore the local dynamic evolution process of nodes, resulting in inaccurate recommendation results.
By obtaining a snapshot of the dynamic heterogeneous graph, determining the neighbor node set of the target node based on the dynamic metapath, and performing attention aggregation operation based on time encoding to obtain the node representation; then, based on the exponential time decay mechanism, nodes under different snapshots are embedded in the nodes under different snapshots based on the exponential time decay mechanism. Aggregate it as node encoding, and finally recommend package services based on node encoding.
The integration of local dynamic evolution of nodes and global dynamic evolution is achieved, ensuring that the evolution process of user preferences can be accurately captured in the actual recommendation scenario, thereby achieving accurate recommendation of package services.
Smart Images

Figure CN119089013A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of service recommendation, and in particular to a package service recommendation method, device, equipment, storage medium and product. Background Art
[0002] For recommendation scenarios based on dynamic heterogeneous graph neural networks, the method of combining GNN (Graph Neural Network) and RNN (Recurrent Neural Network) serialization is usually used to achieve it. Its basic idea is to divide the dynamic heterogeneous graph into multiple snapshots according to timestamps, and then use GNN to extract the graph structure information in each snapshot separately. Next, use RNN to extract information about the dynamic evolution of the graph structure over time, so as to obtain the feature embedding representation of the node. Finally, the feature embeddings of the node pairs are spliced, and the recommendation task is implemented through a multi-layer perceptron MLP. However, the traditional method of extracting time series information through RNN only obtains the global dynamic evolution information of the entire graph, while ignoring the local dynamic evolution process of the node, which will lead to inaccurate recommendation results.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide a package service recommendation method, device, equipment, storage medium and product, aiming to solve the technical problem that when traditional recommendation tasks extract time series information through RNN, only the global dynamic evolution information of the entire graph is obtained, while the local dynamic evolution process of the node is ignored, resulting in inaccurate recommendation results.
[0005] To achieve the above purpose, the present application proposes a package service recommendation method, the package service recommendation method comprising:
[0006] Obtaining a snapshot of a dynamic heterogeneous graph, wherein the dynamic heterogeneous graph is used to map a dynamic evolution process of a user's subscription package;
[0007] Based on the dynamic meta-path, determine the set of neighbor nodes of the target node in the snapshot;
[0008] Performing a time-coded attention aggregation operation on the neighbor node set to obtain a node representation;
[0009] Determine node embeddings according to the node representations, and aggregate the node embeddings under different snapshots into node encodings based on an exponential time decay mechanism;
[0010] A package service recommendation is performed based on the link prediction result of the node code.
[0011] In one embodiment, the dynamic heterogeneous graph is formally defined as Where V represents the node set, ε T represents the edge set, φ represents the node type mapping function, represents an edge type mapping function, the nodes in the node set include user nodes and package nodes, the edge set represents the user's subscription to the package, and the edges in the edge set carry the time information of the user's subscription to the package; wherein the step of obtaining a snapshot of the dynamic heterogeneous graph, the dynamic heterogeneous graph being used to map the dynamic evolution process of the user's subscription to the package includes:
[0012] Snapshot extraction is performed on the dynamic heterogeneous graph at preset time intervals to obtain a snapshot of the dynamic heterogeneous graph, wherein the snapshot retains current information and historical information, wherein the current information is node information and edge information within the current time interval, and the historical information is node information and edge information before the current time interval.
[0013] In one embodiment, determining a set of neighbor nodes of a target node in a snapshot based on a dynamic meta-path includes:
[0014] Based on the dynamic meta-path, reverse sampling is performed in the snapshot according to the sampling probability of the candidate sampling nodes to obtain a neighbor node set of the target node in the snapshot, wherein the reverse sampling is performed based on the neighbor nodes in the past time period.
[0015] In one embodiment, the step of performing a time-coded attention aggregation operation on the neighbor node set to obtain a node representation includes:
[0016] Determine the transformation matrix of different dynamic metapaths in the snapshot;
[0017] Determine the attribute characteristics and node types of neighbor nodes in the neighbor node set, and determine the projection matrix of the node type;
[0018] Determine the time code based on the current snapshot time and the link occurrence time;
[0019] A node representation of the neighbor node set is determined according to a weight parameter, the transformation matrix, the attribute feature, the projection matrix, and the time encoding.
[0020] In one embodiment, the step of determining the node embedding according to the node representation and aggregating the node embeddings under different snapshots into a node encoding based on an exponential time decay mechanism includes:
[0021] Perform semantic-level aggregation on the node representations under the same snapshot to obtain node embedding;
[0022] Determine the decay weight according to the prediction time, the current snapshot time and the decay rate;
[0023] Determining an exponential time decay weight according to the decay weight;
[0024] A node code of the target node is determined according to the exponential time decay weight and the node embeddings under the different snapshots.
[0025] In one embodiment, the step of performing semantic-level aggregation on node representations under the same snapshot to obtain node embeddings includes:
[0026] Determine the occupation weight and importance of the dynamic meta-path, and determine the semantic level mapping matrix of the dynamic meta-path under the snapshot;
[0027] A node embedding is determined based on the occupancy weight, the importance, the semantic level mapping matrix, and the node representation.
[0028] In one embodiment, the target node includes a target user node and a target package node, the node code includes a user node code and a package node code, the user node code is the node code of the target user node, and the package node code is the node code of the target package node; wherein the step of recommending a package service according to the link prediction result of the node code includes:
[0029] Input the user node code and the package node code into a link prediction model to obtain a link prediction result;
[0030] When the link prediction result is greater than a preset threshold, the package service corresponding to the target package node is recommended to the user corresponding to the target user node.
[0031] In addition, to achieve the above purpose, the present application also proposes a package service recommendation device, the package service recommendation device comprising:
[0032] An acquisition module, used to acquire a snapshot of a dynamic heterogeneous graph, where the dynamic heterogeneous graph is used to map the dynamic evolution process of a user's subscription package;
[0033] A determination module, used for determining a set of neighbor nodes of a target node in a snapshot based on a dynamic meta-path;
[0034] An aggregation module, used for performing a time-coded attention aggregation operation on the neighbor node set to obtain a node representation;
[0035] The aggregation module is further used to determine the node embedding according to the node representation, and aggregate the node embeddings under different snapshots into node encodings based on an exponential time decay mechanism;
[0036] A recommendation module is used to recommend a package service according to the link prediction result of the node code. In addition, to achieve the above purpose, the present application also proposes a package service recommendation device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the package service recommendation method as described above.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the package service recommendation method described above are implemented.
[0038] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the package service recommendation method as described above.
[0039] One or more technical solutions proposed in this application have at least the following technical effects:
[0040] The present application provides a package service recommendation method, apparatus, device, storage medium and product. The present application obtains a snapshot of a dynamic heterogeneous graph, and the dynamic heterogeneous graph is used to map the dynamic evolution process of a user's subscription package; based on a dynamic meta-path, a neighbor node set of a target node in the snapshot is determined; an attention aggregation operation based on time coding is performed on the neighbor node set to obtain a node representation; node embedding is determined according to the node representation, and node embeddings under different snapshots are aggregated into node coding based on an exponential time decay mechanism; and package service recommendation is performed according to the link prediction result of the node coding. The present invention solves the technical problem that in the traditional recommendation task method, when extracting time series information through RNN, only the global dynamic evolution information of the whole graph is obtained, while the local dynamic evolution process of the node is ignored, resulting in inaccurate recommendation results. Compared with the prior art, the present application fuses the local structural information and time series information of the node through an aggregation operation based on time coding to realize the local dynamic evolution of the node, and then fuses the global structural information and time series information through an aggregation operation based on the time decay mechanism to realize the global dynamic evolution of the node. By realizing the local evolution of the node and the global dynamic evolution, it is ensured that the user's preference evolution process can be just captured in the actual recommendation scenario, thereby realizing accurate recommendation of package services. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1 A flowchart of the first embodiment of the method for recommending package services;
[0044] Figure 2 A schematic diagram of the node encoding process of the package service recommendation method provided in Example 1 of the present application;
[0045] Figure 3 A flowchart of the second embodiment of the method for recommending package services;
[0046] Figure 4 This is a schematic diagram of the module structure of the package service recommendation device according to an embodiment of the present application;
[0047] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the package service recommendation method in the embodiment of the present application.
[0048] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0051] The main solution of the embodiment of the present application is: obtaining a snapshot of a dynamic heterogeneous graph, wherein the dynamic heterogeneous graph is used to map the dynamic evolution process of the user's subscription package; based on the dynamic meta-path, determining the neighbor node set of the target node in the snapshot; performing a time-coding-based attention aggregation operation on the neighbor node set to obtain a node representation; determining the node embedding according to the node representation, and aggregating the node embeddings under different snapshots into node codes based on an exponential time decay mechanism; and making package service recommendations based on the link prediction results of the node codes.
[0052] In this embodiment, for the convenience of description, the following description is made by taking the device for identifying package service recommendation as the execution subject.
[0053] Because the existing technology only obtains the global dynamic evolution information of the entire graph when extracting time series information through RNN when implementing recommendation tasks, and ignores the local dynamic evolution process of the node, this will lead to inaccurate recommendation results.
[0054] The present application provides a solution, which realizes the local dynamic evolution of the node by fusing the local structural information and the timing information of the node through an aggregation operation based on time coding, and then realizes the global dynamic evolution of the node by fusing the global structural information and the timing information through an aggregation operation based on the time decay mechanism. By realizing the local evolution of the node and the global dynamic evolution, it is ensured that the user's preference evolution process can be captured just right in the actual recommendation scenario, thereby realizing accurate recommendation of package services.
[0055] As can be seen from the above embodiments, the present application obtains a snapshot of a dynamic heterogeneous graph, and the dynamic heterogeneous graph is used to map the dynamic evolution process of the user's ordering package; based on the dynamic meta-path, the neighbor node set of the target node in the snapshot is determined; the neighbor node set is subjected to an attention aggregation operation based on time coding to obtain a node representation; the node embedding is determined according to the node representation, and the node embeddings under different snapshots are aggregated into node coding based on the exponential time decay mechanism; and the package service is recommended according to the link prediction result of the node coding. The technical problem that the recommendation result is not accurate when the global dynamic evolution information of the whole graph is only obtained when the timing information is extracted by RNN in the traditional recommendation task mode and the local dynamic evolution process of the node is ignored is solved. Compared with the prior art, the present application fuses the local structure information and timing information of the node through an aggregation operation based on time coding to realize the local dynamic evolution of the node, and then fuses the global structure information and timing information based on the aggregation operation of the time decay mechanism to realize the global dynamic evolution of the node. By realizing the local evolution of the node and the global dynamic evolution, it is ensured that the user's preference evolution process can be just captured in the actual recommendation scenario, thereby realizing the accurate recommendation of the package service.
[0056] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a package service recommendation device, etc. The package service recommendation device is taken as an example to illustrate this embodiment and the following embodiments.
[0057] Based on this, the present application embodiment provides a package service recommendation method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for recommending package services.
[0058] In this embodiment, the package service recommendation method includes steps S10 to S50:
[0059] Step S10, obtaining a snapshot of a dynamic heterogeneous graph, where the dynamic heterogeneous graph is used to map the dynamic evolution process of the user's subscription package;
[0060] It should be noted that in the package recommendation business, the relationship data of users' package subscriptions can be mapped into a heterogeneous graph. In order to reflect the dynamic evolution process between users, packages and users' package subscriptions, the dynamic evolution process can be mapped into a dynamic heterogeneous graph, that is, the dynamic heterogeneous graph is the situation of users' package subscriptions within a period of time; a snapshot refers to the static representation of the dynamic heterogeneous graph within a certain period of time.
[0061] It should be noted that the formal definition of dynamic heterogeneous graph is Where V represents the node set, ε T represents the edge set, φ represents the node type mapping function, represents the edge type mapping function, the node type mapping function φ:V→A, the edge type mapping function ε T →R, A and R represent the node type set and edge type set respectively. The nodes in the node set include user nodes and package nodes. The edge set represents the user ordering the package. The edges in the edge set carry the time information T of the user ordering the package.
[0062] In a feasible implementation, step S10 may include: performing snapshot extraction on the dynamic heterogeneous graph at preset time intervals to obtain a snapshot of the dynamic heterogeneous graph, wherein the snapshot retains current information and historical information, wherein the current information is the node information and edge information within the current time interval, and the historical information is the node information and edge information before the current time interval.
[0063] It should be noted that node information includes user node information and package node information, and edge information includes user package subscription information and time information; the preset time interval can be set in advance; the current time interval refers to the preset time interval at the current moment, for example, if the current moment is A and the preset time interval is B, then the current time interval is the time interval from moment (AB) to moment A.
[0064] In this embodiment, the current time interval information and past historical information are retained when the snapshot of the dynamic heterogeneous graph is extracted, which can effectively reduce information loss and provide more abundant and complete information for subsequent neighbor sampling.
[0065] Step S20, determining a set of neighbor nodes of the target node in the snapshot based on the dynamic meta-path;
[0066] It should be noted that the dynamic meta-path can represent the attributes of different nodes at different time nodes in a dynamic heterogeneous graph. For example, given a dynamic heterogeneous graph The dynamic meta-path can be expressed as P: The dynamic meta-path can be represented as a1 type source node and a l Type target node in time series Composite relations under constraints Among them, a i ∈A,r i ∈R, in the dynamic meta-path, there is a partial order constraint in time, which means that when sampling nodes, only neighboring nodes in the past time period can be selected for sampling. This constraint can ensure that the subsequent sampling process is reasonable.
[0067] In a feasible implementation, step S20 may include: based on the dynamic meta-path, performing reverse sampling in the snapshot according to the sampling probability of the candidate sampling nodes to obtain a set of neighbor nodes of the target node in the snapshot, wherein the reverse sampling is based on sampling of neighbor nodes in a past time period.
[0068] It should be noted that for node type a l The node v l , given a dynamic metapath P: Perform reverse sampling in the current snapshot s, and the candidate sampling node v l-1 The sampling probability of:
[0069] p(v l-1 |v l )=Δt l-1
[0070] Among them, for the current relationship r l-1 Repeat the above process for all other candidate nodes in the snapshot and normalize them to obtain the sampling probability. During the sampling process, ensure that the a1 type source node is not sampled without replacement (that is, when other candidate nodes are used as source nodes, the a1 type source node does not participate in the sampling of the source node), but for the intermediate nodes, repeated sampling is allowed to maintain the diversity and integrity of the sampling process. Sampling all candidate nodes in the snapshot as source nodes to obtain sampling data can facilitate subsequent aggregation based on the neighbor node set.
[0071] It should be noted that after determining the sampling probability of a candidate sampling node, whether the candidate sampling node will be sampled can be determined according to the sampling probability. For example, when the sampling probability is greater than a threshold, the candidate sampling node is used as a sampling node for reverse sampling.
[0072] In this embodiment, a sampling strategy based on dynamic meta-paths is adopted to ensure that the connection between the sampled neighbor nodes and the target node has a certain continuity in time. At the same time, neighbor nodes that are closer to the target node in time are selected as much as possible because they have a more significant impact on the target node in time. This strategy not only ensures the rationality of the sampling process, but also retains important information about the dynamic evolution of semantics, which helps to more accurately capture the dynamic relationship between nodes, thereby improving the performance of the model in recommendation tasks.
[0073] Step S30, performing a time-coded attention aggregation operation on the neighbor node set to obtain a node representation;
[0074] It should be noted that the neighbor node set refers to the set of neighbor nodes obtained after sampling all the neighbor nodes of the target node; the time-coded-based attention aggregation operation can be performed separately based on the neighbor node sets sampled based on different dynamic meta-paths, so as to realize the local dynamic evolution of the node.
[0075] In a feasible implementation, step S30 may include: determining the transformation matrix of different dynamic meta-paths in the snapshot; determining the attribute characteristics and node types of the neighbor nodes in the neighbor node set, and determining the projection matrix of the node type; determining the time coding according to the current snapshot time and the link occurrence time; determining the node representation of the neighbor node set according to the weight parameters, the transformation matrix, the attribute characteristics, the projection matrix and the time coding.
[0076] It should be noted that the set of neighbor nodes sampled by the target node v based on the dynamic meta-path p in snapshot s is N v,s,p , then the node representation z is obtained after attention aggregation based on time coding v,s,p The specific calculation method is as follows:
[0077]
[0078] Among them, σ(·) represents a nonlinear activation function (Relu is used here), || represents concatenation,
[0079] W s,p ∈R 2d×d represents the transformation matrix under the semantics p (i.e., dynamic meta-path) in snapshot s, u represents the neighbor node of v, and u∈N v,s,p , represents the attribute characteristics of node u, φ u represents the node type of u, The projection matrix representing the node type, Φ(t s -t u,v,s,p ) represents the time code, where ts Indicates the current snapshot time, t u,v,s,p represents the time when the link between node pair (u, v) occurs (i.e., the time when the edge between node u and node v is generated), the time encoder Φ(t) = cos(tω), Encode time as a d-dimensional vector. In practice, d=100 is usually chosen. α u,v,s,p Represents the weight parameter, where the weight parameter is calculated using the node-level attention mechanism. The specific calculation formula is:
[0080]
[0081]
[0082] Among them, q u,v,s,p represents the attention coefficient of node u to v, tanh(·) represents the trigonometric tangent function, W s,p,1 ∈R 4d Represents the node-level mapping matrix under the current semantics p.
[0083] In this embodiment, a time coding mechanism is used to fuse the timing information and the structural information in the message transmission process, so that the association between the temporal and spatial information is preserved, thereby realizing the local dynamic evolution of the node.
[0084] Step S40, determining a node embedding according to the node representation, and aggregating the node embeddings under different snapshots into a node encoding based on an exponential time decay mechanism;
[0085] It should be noted that obtaining the representation z of the target node under different snapshots v,s,p , the node representations in the same snapshot can be aggregated at the semantic level to obtain the node embedding z of the target node v under different snapshots s v,s ; Then an exponential decay mechanism considering time decay is adopted to determine the final representation of the target node based on the node embedding.
[0086] It should be noted that if Figure 2 As shown, Figure 2 (a) represents the dynamic meta-path based on dynamic semantic sampling, where ① node is the target node, Δt i , i∈N represents the time difference between the edge generation time and the current snapshot time; Figure 2 (b) represents the local dynamic evolution process with time coding, where the set of neighbor nodes sampled by the target node v based on the dynamic meta-path p in snapshot s is N v,s,p , then the node representation z after attention aggregation considering the time encoding v,s,p ; Figure 2(c) represents the global dynamic evolution process with time decay, in which the node representations in the same snapshot are aggregated at the semantic level to obtain the node embedding z of the target node v under different snapshots s. v,s Afterwards, the node embeddings of different snapshots are aggregated using an exponential decay mechanism that considers time decay, thereby obtaining the node encoding of the target node.
[0087] In a feasible implementation, step S40 may include: determining the occupancy weight and importance of the dynamic meta-path, and determining the semantic-level mapping matrix of the dynamic meta-path under the snapshot; determining the node embedding according to the occupancy weight, the importance, the semantic-level mapping matrix and the node representation; determining the decay weight according to the prediction time, the current snapshot time and the decay rate; determining the exponential time decay weight according to the decay weight; determining the node encoding of the target node according to the exponential time decay weight and the node embedding under the different snapshots.
[0088] It should be noted that the occupation weight refers to the weight of the dynamic meta-path in all dynamic original paths; the node representations in the same snapshot are aggregated at the semantic level to obtain the node embedding z of the target node v under different snapshots s. v,s , the specific calculation formula is as follows:
[0089]
[0090]
[0091] g v,s,p =σ(tanh(z v,s,p W s,1 ))
[0092] In the formula, β v,s,p represents the weight of the dynamic meta-path or semantics p in all semantics, g v,s,p represents the importance of semantics p, W s,1 ∈R d Represents the semantic level mapping matrix under the current snapshot.
[0093] It should be noted that the exponential decay mechanism considering time decay is adopted to aggregate the node embeddings of different snapshots to obtain the final representation z of the target node. v (i.e. the node code of the target node), the specific calculation method is as follows:
[0094]
[0095]
[0096] w s =exp(-λ(tts ))
[0097] Where W s represents the weight considering exponential time decay (i.e., exponential time decay weight), w s represents the decay weight, λ is the decay rate, t and t s Represent the prediction time and the current snapshot time respectively.
[0098] Step S50: recommending package services based on the link prediction result of the node code.
[0099] It should be noted that the node code of the target node embeds the local dynamic semantic evolution information of the node through dynamic semantic sampling and time coding technology, and at the same time, considering the factor of time attenuation, embeds the global dynamic evolution process; thereafter, when the target node is a node pair of a user node and a package node, the link prediction results obtained by link prediction of these node codes can be determined by respectively determining the node code of the user node and the node code of the package node to achieve recommendation. For example, when the link prediction result is greater than a preset threshold, the package can be recommended to the user as a recommended package.
[0100] This embodiment obtains a snapshot of a dynamic heterogeneous graph, which is used to map the dynamic evolution process of the user's subscription package; based on the dynamic meta-path, the neighbor node set of the target node in the snapshot is determined; the neighbor node set is subjected to an attention aggregation operation based on time coding to obtain a node representation; node embedding is determined according to the node representation, and node embeddings under different snapshots are aggregated into node coding based on an exponential time decay mechanism; and package service is recommended according to the link prediction result of the node coding. The technical problem that the recommendation result is not accurate when only the global dynamic evolution information of the whole graph is obtained and the local dynamic evolution process of the node is ignored when extracting time series information through RNN in the traditional recommendation task mode is solved. Compared with the prior art, this embodiment fuses the local structure information and time series information of the node through an aggregation operation based on time coding to realize the local dynamic evolution of the node, and then fuses the global structure information and time series information based on an aggregation operation based on the time decay mechanism to realize the global dynamic evolution of the node. By realizing the local evolution of the node and the global dynamic evolution, it is ensured that the user's preference evolution process can be just captured in the actual recommendation scenario, thereby realizing the accurate recommendation of package services.
[0101] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and no further description will be given later. On this basis, the target node includes a target user node and a target package node, and the node code includes a user node code and a package node code. The user node code is the node code of the target user node, and the package node code is the node code of the target package node; please refer to Figure 3 , step S50 also includes steps S501-S502:
[0102] Step S501: inputting the user node code and the package node code into a link prediction model to obtain a link prediction result;
[0103] It should be noted that the link prediction model may be an MLP (Multilayer Perceptron) model, and the link prediction result refers to the predicted probability of the existence of a link between the target user node and the target package node.
[0104] In the specific implementation, the specific calculation method of determining whether there is a link between the target user node and the target package node through the link prediction model is as follows:
[0105]
[0106] Among them, z v The user node code of the target user node, z u Indicates the package node code of the target package node.
[0107] In a feasible implementation, before step S501, it may include: obtaining a prediction node pair; inputting the prediction node pair into an initial link prediction model to obtain a prediction result; determining a loss value of the prediction result based on a cross entropy loss function; based on the loss value, using gradient propagation to update the model parameters of the initial link prediction model to obtain a link prediction model.
[0108] It should be noted that the prediction accuracy of the link prediction model can be improved by adjusting the model parameters of the link prediction model. Specifically, in the training process, the link prediction task is used, that is, the prediction of whether there is an edge between the node pair (u, v) is used as the training task, and the corresponding loss function is designed to achieve model parameter optimization, such as using the cross entropy loss function. Measure the loss and update the model parameters. For example, in this loss function, if there is an edge between the node pair (u, v), then y u,v =1, otherwise 0. The specific calculation method for determining the loss value according to the cross entropy loss function is as follows:
[0109]
[0110] Finally, after obtaining the loss value of the prediction result according to the cross entropy loss function, the Adam method (i.e., gradient propagation algorithm) is used for back propagation to adjust and update the model parameters.
[0111] Step S502: When the link prediction result is greater than a preset threshold, the package service corresponding to the target package node is recommended to the user corresponding to the target user node.
[0112] It should be noted that the preset threshold can be set in advance; when the link prediction result of the package node code is greater than the preset threshold, the package corresponding to the package service node can be recommended to the user as a recommended package.
[0113] This embodiment obtains a link prediction result by inputting the user node code and the package node code into a link prediction model; when the link prediction result is greater than a preset threshold, the package service corresponding to the target package node is recommended to the user corresponding to the target user node. This embodiment implements link prediction between the user node and each package node by setting a link prediction model, and recommends the package to the user when the link prediction result is greater than a preset threshold, thereby realizing rapid recommendation of package services.
[0114] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the package service recommendation method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0115] This application also provides a package service recommendation device, please refer to Figure 4 , the package service recommendation device includes:
[0116] An acquisition module 10 is used to acquire a snapshot of a dynamic heterogeneous graph, where the dynamic heterogeneous graph is used to map the dynamic evolution process of the user's subscription package;
[0117] A determination module 20, configured to determine a set of neighbor nodes of a target node in a snapshot based on a dynamic meta-path;
[0118] an aggregation module 30, configured to perform a time-coded attention aggregation operation on the neighbor node set to obtain a node representation;
[0119] The aggregation module 30 is further used to determine the node embedding according to the node representation, and aggregate the node embeddings under different snapshots into node encodings based on an exponential time decay mechanism;
[0120] The recommendation module 40 is used to recommend package services according to the link prediction results of the node codes.
[0121] The package service recommendation device provided by the present application adopts the package service recommendation method in the above embodiment, which can solve the technical problem that the traditional recommendation task only obtains the global dynamic evolution information of the entire graph when extracting time series information through RNN, but ignores the local dynamic evolution process of the node, resulting in inaccurate recommendation results. Compared with the prior art, the beneficial effects of the package service recommendation device provided by the present application are the same as the beneficial effects of the package service recommendation method provided by the above embodiment, and other technical features in the package service recommendation device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0122] The present application provides a package service recommendation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the package service recommendation method in the above-mentioned embodiment 1.
[0123] Reference below Figure 5 , which shows a schematic diagram of the structure of a package service recommendation device suitable for implementing the embodiment of the present application. The package service recommendation device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The package service recommendation device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0124] like Figure 5As shown, the package service recommendation device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the package recommendation service device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the package service recommendation device to communicate with other devices wirelessly or by wire to exchange data. Although the package service recommendation device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0125] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0126] The package service recommendation device provided by the present application adopts the package service recommendation method in the above embodiment, which can solve the technical problem of package service recommendation. Compared with the prior art, the beneficial effects of the package service recommendation device provided by the present application are the same as the beneficial effects of the package service recommendation method provided by the above embodiment, and other technical features in the package service recommendation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0127] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0128] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0129] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the package service recommendation method in the above-mentioned embodiment.
[0130] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0131] The computer-readable storage medium may be included in the package service recommendation device; or may exist independently without being assembled into the package service recommendation device.
[0132] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the package service recommendation device, the package service recommendation device: obtains a snapshot of a dynamic heterogeneous graph, and the dynamic heterogeneous graph is used to map the dynamic evolution process of the user's subscription package; based on the dynamic meta-path, determines the neighbor node set of the target node in the snapshot; performs a time-coding-based attention aggregation operation on the neighbor node set to obtain a node representation; determines a node embedding based on the node representation, and aggregates the node embeddings under different snapshots into a node code based on an exponential time decay mechanism; and recommends a package service based on the link prediction result of the node code.
[0133] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0134] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0135] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0136] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned package service recommendation method, and can solve the technical problem that when the traditional recommendation task extracts time series information through RNN, only the global dynamic evolution information of the entire graph is obtained, while the local dynamic evolution process of the node is ignored, resulting in inaccurate recommendation results. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the package service recommendation method provided by the above-mentioned embodiment, and will not be repeated here.
[0137] The present application also provides a computer program product, including a computer program, which implements the steps of the package service recommendation method as described above when executed by a processor.
[0138] The computer program product provided by the present application can solve the technical problem that when the traditional recommendation task extracts time series information through RNN, only the global dynamic evolution information of the entire graph is obtained, while the local dynamic evolution process of the node is ignored, resulting in inaccurate recommendation results. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the package service recommendation method provided in the above embodiment, and will not be repeated here.
[0139] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A package service recommendation method, characterized in that: The method comprises: Obtaining a snapshot of a dynamic heterogeneous graph, wherein the dynamic heterogeneous graph is used to map a dynamic evolution process of a user's subscription package; Based on the dynamic meta-path, determine the set of neighbor nodes of the target node in the snapshot; Performing a time-coded attention aggregation operation on the neighbor node set to obtain a node representation; Determine node embeddings according to the node representations, and aggregate the node embeddings under different snapshots into node encodings based on an exponential time decay mechanism; A package service recommendation is performed based on the link prediction result of the node code.
2. The method according to claim 1, characterized in that The dynamic heterogeneous graph is formally defined as Where V represents the node set, ε T represents the edge set, φ represents the node type mapping function, represents an edge type mapping function, the nodes in the node set include user nodes and package nodes, the edge set represents the user's subscription to the package, and the edges in the edge set carry the time information of the user's subscription to the package; wherein the step of obtaining a snapshot of the dynamic heterogeneous graph, the dynamic heterogeneous graph being used to map the dynamic evolution process of the user's subscription to the package includes: Snapshot extraction is performed on the dynamic heterogeneous graph at preset time intervals to obtain a snapshot of the dynamic heterogeneous graph, wherein the snapshot retains current information and historical information, wherein the current information is node information and edge information within the current time interval, and the historical information is node information and edge information before the current time interval.
3. The method according to claim 1, characterized in that The step of determining a neighbor node set of a target node in a snapshot based on a dynamic meta-path includes: Based on the dynamic meta-path, reverse sampling is performed in the snapshot according to the sampling probability of the candidate sampling nodes to obtain a neighbor node set of the target node in the snapshot, wherein the reverse sampling is performed based on the neighbor nodes in the past time period.
4. The method according to claim 1, characterized in that The step of performing a time-coded attention aggregation operation on the neighbor node set to obtain a node representation comprises: Determine the transformation matrix of different dynamic metapaths in the snapshot; Determine the attribute characteristics and node types of neighbor nodes in the neighbor node set, and determine the projection matrix of the node type; Determine the time code based on the current snapshot time and the link occurrence time; A node representation of the neighbor node set is determined according to a weight parameter, the transformation matrix, the attribute feature, the projection matrix, and the time encoding.
5. The method according to claim 1, characterized in that The step of determining the node embedding according to the node representation and aggregating the node embeddings under different snapshots into node encodings based on an exponential time decay mechanism comprises: Perform semantic-level aggregation on the node representations under the same snapshot to obtain node embedding; Determine the decay weight according to the prediction time, the current snapshot time and the decay rate; Determining an exponential time decay weight according to the decay weight; A node code of the target node is determined according to the exponential time decay weight and the node embeddings under the different snapshots.
6. The method according to claim 5, characterized in that The step of performing semantic-level aggregation on the node representations under the same snapshot to obtain node embeddings comprises: Determine the occupation weight and importance of the dynamic meta-path, and determine the semantic level mapping matrix of the dynamic meta-path under the snapshot; A node embedding is determined based on the occupancy weight, the importance, the semantic level mapping matrix, and the node representation.
7. The method according to claim 1, characterized in that The target node includes a target user node and a target package node, the node code includes a user node code and a package node code, the user node code is the node code of the target user node, and the package node code is the node code of the target package node; wherein the step of recommending a package service according to the link prediction result of the node code includes: Input the user node code and the package node code into a link prediction model to obtain a link prediction result; When the link prediction result is greater than a preset threshold, the package service corresponding to the target package node is recommended to the user corresponding to the target user node.
8. The method according to claim 7, characterized in that Before the step of inputting the user node code and the package node code into the link prediction model to obtain the link prediction result, the step further includes: Get the predicted node pair; Inputting the predicted node pair into an initial link prediction model to obtain a prediction result; Determining a loss value of the prediction result based on a cross entropy loss function; Based on the loss value, gradient propagation is used to update the model parameters of the initial link prediction model to obtain a link prediction model.
9. A package service recommendation device, characterized in that: The device comprises: An acquisition module, used to acquire a snapshot of a dynamic heterogeneous graph, where the dynamic heterogeneous graph is used to map the dynamic evolution process of a user's subscription package; A determination module, used for determining a set of neighbor nodes of a target node in a snapshot based on a dynamic meta-path; An aggregation module, used for performing a time-coded attention aggregation operation on the neighbor node set to obtain a node representation; The aggregation module is further used to determine the node embedding according to the node representation, and aggregate the node embeddings under different snapshots into node encodings based on an exponential time decay mechanism; The recommendation module is used to recommend package services based on the link prediction results of the node encoding.
10. A package service recommendation device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of recommending package services as claimed in any one of claims 1 to 8.
11. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of recommending package services according to any one of claims 1 to 8 are implemented.
12. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of recommending package services as claimed in any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Short video recommendation method based on multi-class multi-relation heterogeneous graph in complex network
CN120316358A
A short video recommendation method based on multi-class and multi-relation heterogeneous graph in complex networks
CN120316358B
