Method and device for generating user spatiotemporal similarity, electronic equipment and medium

By constructing a user graph and using graph neural networks to generate user embedding vectors, the problems of low efficiency in similar user discovery and insufficient utilization of spatiotemporal information in existing technologies are solved, achieving more efficient and accurate similar user identification, which is applicable to the travel and tourism sectors.

CN117251634BActive Publication Date: 2026-05-29TONGCHENG NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TONGCHENG NETWORK TECH CO LTD
Filing Date
2023-10-09
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing similar user discovery technologies are inefficient when handling large amounts of data, have low accuracy in identifying similar users, and cannot effectively utilize spatiotemporal information, resulting in poor scalability and cold start problems.

Method used

By acquiring user location information, browsing time information, and user behavior characteristics, a user graph is constructed and sampled. A graph neural network model is used to generate user embedding vectors, and the spatiotemporal similarity of users is determined based on the user embedding vectors.

Benefits of technology

It improves the efficiency and accuracy of similar user identification, solves the problems of insufficient utilization of spatiotemporal information and poor scalability, improves the sparse cold start problem, and adapts to the complex business needs of the travel and tourism sectors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117251634B_ABST
    Figure CN117251634B_ABST
Patent Text Reader

Abstract

The application provides a user spatiotemporal similarity generation method and device, electronic equipment and medium, comprising: obtaining location information, browsing time information, user portrait features and user behavior features of a user; constructing a user graph based on the location information, browsing time information and user behavior features of the user, and sampling the user graph to obtain a user sequence; wherein the user graph comprises a user directed graph or a user undirected graph; inputting the user sequence, user portrait features and user behavior features into a graph neural network model to obtain a user embedding vector; and determining the spatiotemporal similarity of the user based on the user embedding vector. The application effectively solves the problems of insufficient utilization of spatiotemporal information and poor expansibility in the field of travel and tourism, and improves the efficiency and accuracy of similar user identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, electronic device, and medium for generating user spatiotemporal similarity. Background Technology

[0002] With the widespread adoption of the internet and increased advertising spending, user marketing has become a crucial part of business operations. Proactive marketing aims to market to and disrupt target users, but its core challenge lies in selecting the appropriate audience. The small group of users targeted by advertisers is typically called "seed users," while the additional similar users to be acquired are called "look-alike users." This process of expanding from seed users to similar demographics is known as "look-alike modeling." Currently, similar user discovery technologies can be broadly categorized into four types: The first is TGI (Title, Group, Index) diffusion, which uses mathematical statistics and user profile tags to find users with similar attributes or higher preferences, such as the same age group, brand preference, or shared searches. The second is user social relationship diffusion, or Social Network Analysis (SNA), which constructs a social relationship network by analyzing user interaction behaviors (such as forwarding, liking, and saving). The third method is semi-supervised algorithm model diffusion. The fourth method is a look-alike model based on vector similarity, which embeds all users into a low-dimensional vector space and uses k-means or locality-sensitive hashing for clustering, determining the cluster a user belongs to. However, existing similar user discovery technologies still have some limitations in practical applications. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a method, apparatus, electronic device and medium for generating user spatiotemporal similarity, which effectively solves the problems of insufficient utilization and poor scalability of spatiotemporal information in the travel and tourism fields, and improves the efficiency and accuracy of similar user identification.

[0004] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:

[0005] In a first aspect, embodiments of the present invention provide a method for generating user spatiotemporal similarity, comprising: acquiring user location information, browsing time information, user profile features, and user behavior features; constructing a user graph based on the user location information, browsing time information, and user behavior features, and sampling the user graph to obtain a user sequence; wherein, the user graph includes: a directed user graph or a non-directed user graph; inputting the user sequence, user profile features, and user behavior features into a graph neural network model to obtain a user embedding vector; and determining the spatiotemporal similarity of users based on the user embedding vector.

[0006] In one implementation, a user graph is constructed based on user location information, browsing time information, and user behavior characteristics, including: encoding the user's location information to obtain a Geohash value; dividing the user's browsing time information into multiple access periods based on a preset time standard; wherein the preset time standard includes: an equal-length division standard and a popular-tidal standard; generating an ID list for each user based on the Geohash value and access period; identifying users with the same behavior in the same session based on the ID list and user behavior characteristics, and constructing an initial user graph for each session; wherein the session is within a specified Geohash range and time period; and merging the initial user graphs of different sessions to obtain a user graph.

[0007] In one implementation, after merging the initial user graphs of different sessions to obtain a user graph, the above method includes: determining the edge weights of the nodes corresponding to two users in the user graph based on the number of times each pair of users exhibits the same behavior in the same session; removing edges whose edge weights are less than a weight threshold to obtain an optimized user graph.

[0008] In one implementation, before constructing a user graph based on the user's location information, browsing time information, and user behavior characteristics, the method further includes: filtering the user's location information and browsing time information to remove data that does not conform to preset rules.

[0009] In one implementation, sampling a user graph to obtain a user sequence includes: normalizing the edge weights of each node's neighboring nodes based on the edge weights of the user graph to obtain a node transition probability matrix between each node and its neighboring nodes; and sampling the user graph using the Node2vec algorithm based on the node transition probability matrix to obtain a user sequence.

[0010] In one implementation, the graph neural network model employs a weighted Skip-Gram-like structure. User sequences, user profile features, and user behavior features are input into the graph neural network model to obtain user embedding vectors. This includes: inputting user sequences, user profile features, and user behavior features into the graph neural network model, and concatenating the user sequences, user profile features, and user behavior features to obtain a feature vector for each user; obtaining the feature weights of each feature parameter in the feature vector, and performing exponential transformation and normalization on the feature weights; wherein the feature weights are obtained based on model training; and performing weighted aggregation calculation based on the user's feature vector and the processed feature weights to obtain the user embedding vector for each user.

[0011] In one implementation, a weighted aggregation calculation is performed based on the user's feature vector and the processed feature weights to obtain the user embedding vector for each user, including: performing a weighted aggregation calculation according to the following formula:

[0012]

[0013] in, This represents the feature weight of the j-th feature parameter of the v-th user, and n represents the length of the user's feature vector. Indicates the characteristic parameters Perform an exponential transformation. H represents the j-th feature parameter of the v-th user. v Let v represent the user embedding vector of the v-th user.

[0014] Secondly, embodiments of the present invention provide a device for generating user spatiotemporal similarity, comprising: an information acquisition module for acquiring user location information, browsing time information, user profile features, and user behavior features; a user sampling module for constructing a user graph based on the user location information, browsing time information, and user behavior features, and sampling the user graph to obtain a user sequence; wherein the user graph includes: a directed user graph or a undirected user graph; a user embedding generation module for inputting the user sequence, user profile features, and user behavior features into a graph neural network model to obtain a user embedding vector; and a similarity determination module for determining the spatiotemporal similarity of users based on the user embedding vector.

[0015] Thirdly, embodiments of the present invention provide an electronic device including a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the steps of any of the methods provided in the first aspect above.

[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the method provided in any of the first aspects above.

[0017] The embodiments of the present invention bring the following beneficial effects:

[0018] The user spatiotemporal similarity generation method, apparatus, electronic device, and medium provided in this invention first acquire user location information, browsing time information, user profile features, and user behavior features; secondly, based on the user location information, browsing time information, and user behavior features, a user graph (directed or undirected) is constructed, and the user graph is sampled to obtain a user sequence; then, the user sequence, user profile features, and user behavior features are input into a graph neural network model to obtain user embedding vectors; finally, the spatiotemporal similarity of users is determined based on the user embedding vectors. This method combines user location information, browsing time information, and user behavior features to construct a user graph, and by sampling the user graph, converts the user graph structure into a vector representation of the user sequence, thereby accurately obtaining the spatiotemporal similarity between users, effectively solving the problems of insufficient utilization and poor scalability of spatiotemporal information in the travel and tourism fields; simultaneously, by combining user spatiotemporal features with a graph neural network model, this method can effectively analyze the real spatiotemporal association information of users, thereby improving the efficiency and accuracy of similar user identification.

[0019] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0020] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

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

[0022] Figure 1 A flowchart illustrating a method for generating user spatiotemporal similarity according to an embodiment of the present invention;

[0023] Figure 2An impure data graph provided as an embodiment of the present invention;

[0024] Figure 3 A flowchart for constructing a user directed graph is provided in an embodiment of the present invention;

[0025] Figure 4 This is a schematic diagram of a random walk sampling user sequence provided in an embodiment of the present invention;

[0026] Figure 5 A Skip-Gram structure diagram provided in an embodiment of the present invention;

[0027] Figure 6 An STGES model diagram provided for an embodiment of the present invention;

[0028] Figure 7 This is a schematic diagram illustrating the online performance comparison of STGES as provided in an embodiment of the present invention.

[0029] Figure 8 A schematic diagram of a user spatiotemporal similarity generation device provided in an embodiment of the present invention;

[0030] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

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

[0032] Currently, similar user discovery technologies can be mainly divided into four categories: The first is TGI index tag diffusion, which uses mathematical statistics and user profile tags to find users with similar attributes or higher preferences, such as the same age group, the same brand preference, or common searches; the second is user social relationship diffusion, namely Social Network Analysis (SNA), which constructs a social relationship network of a group by analyzing user interaction behavior (such as forwarding, liking, and collecting); the third method is semi-supervised algorithm model diffusion; and the fourth method is a look-alike model based on vector similarity, which embeds all users into a low-dimensional vector space and uses k-means or locality-sensitive hashing for clustering, and makes a judgment based on the cluster to which the current user belongs.

[0033] However, existing similar user discovery technologies still have some limitations and shortcomings in terms of processing efficiency for large amounts of data, further improvement of similar user accuracy, and rapid adaptation to new user characteristics:

[0034] TGI index label diffusion relies on mathematical statistics and user profile tags to find users with similar characteristics or higher preferences. This is labor-intensive. First, building effective user profile tags and their statistical models requires significant manual effort and a certain level of data science knowledge and skills. Furthermore, as the user base changes, these tags and models need regular updates and maintenance, increasing resource investment. Second, using TGI index labels may encounter efficiency issues when dealing with large-scale datasets.

[0035] User social relationship diffusion technology has limitations in handling the complexity of large-scale graph networks and social networks. First, social networks require significant computational resources to process the nodes and edges of the graph, consuming substantial memory for storage. This not only creates significant operational pressure but also increases the computational cost of performing analysis and inference tasks. Second, SNA does not incorporate additional user and product information features during network construction, ignoring user preferences, short- and long-term historical behavior, and product attributes, potentially reducing the algorithm's accuracy and the precision of similar users. In most scenarios, social and behavioral interactions between users may be infrequent, resulting in sparse social network data and consequently affecting the accuracy of the analysis results.

[0036] While PU Learning, a semi-supervised learning algorithm, can learn from both positive and unlabeled samples, it suffers from significant drawbacks. It heavily relies on the quality of the positive and unlabeled data. Using incorrect data as positive examples or employing excessive noise in the unlabeled data can lead to biased learning outcomes. PU Learning may also perform poorly with high-dimensional and imbalanced datasets. Lacking specific negative examples, it struggles to effectively identify decision boundaries in the feature space, particularly in high-dimensional or imbalanced datasets. Even under the assumption of low sample bias, the training process for PU Learning is complex and time-consuming. Because it iteratively updates model parameters, each iteration requires traversing all positive and unlabeled samples, resulting in poor scalability and reusability. Furthermore, the algorithm's threshold for iteratively separating positive and negative samples is a rigid and inflexible value.

[0037] Vector similarity recall is widely used in information retrieval, user discovery, and behavioral analysis. However, this method also has some shortcomings. First, there is the problem of data sparsity. In high-dimensional space, the feature vectors of most users or items may have a large number of zero values, resulting in a lack of effective information when calculating similarity, thus affecting the accuracy of the recall results. Second, for new users or new items, the lack of sufficient behavioral data makes it impossible to construct effective feature vectors, leading to the cold start problem. In addition, traditional vector similarity methods cannot capture spatiotemporal relationships and domain similarity. For example, if a user's interests change over time, or if a user's behavior is influenced by geographical location, these context-related factors are often ignored when calculating similarity, which may result in unsatisfactory recall results.

[0038] Based on this, the present invention provides a method, apparatus, electronic device and medium for generating user spatiotemporal similarity, which effectively solves the problems of insufficient utilization and poor scalability of spatiotemporal information in the travel and tourism fields, and improves the efficiency and accuracy of similar user identification.

[0039] To facilitate understanding of this embodiment, a detailed description of the user spatiotemporal similarity generation method, apparatus, electronic device, and medium disclosed in this embodiment of the invention will be provided first. This method can be executed by an electronic device, such as a smartphone, computer, or tablet computer. See also... Figure 1 The flowchart shown illustrates a method for generating user spatiotemporal similarity, indicating that the method mainly includes the following steps S101 to S104:

[0040] Step S101: Obtain the user's location information, browsing time information, user profile characteristics, and user behavior characteristics.

[0041] In one implementation, user behavior is sampled, and based on the user's authorization on the travel platform, the user's location information (including departure and destination), browsing time information, user profile features, and user behavior features are collected.

[0042] After obtaining relevant spatiotemporal data of users, in order to avoid the negative impact of user behavior data on model training, it is necessary to identify and exclude user behaviors that are meaningless to the business or may lead to invalid edges in the graph. Therefore, in this embodiment of the invention, before constructing the user graph based on user location information, browsing time information, and user behavior characteristics, the method further includes: filtering the user location information and browsing time information to remove data that does not conform to preset rules.

[0043] In practice, if a user generates a large amount of spatially inconsistent data within a very short period (such as data caching) or exhibits abnormal user behavior (such as excessively short dwell time or abnormally high spatial activity), these situations may indicate machine behavior or other non-compliant actions. See [link to relevant documentation]. Figure 2 As shown, user A appeared in multiple different cities within a very short period, which is likely due to machine behavior. If such invalid user behavior is used for model training, it may weaken the representation of truly valid user behavior, thus negatively impacting the user similarity calculation results. Therefore, this invention provides a rule-based knowledge flow dewatering method. By setting rules to filter out data that does not conform to preset rules, such as filtering users who frequently access pages within a very short period, filtering users who appear in geographically distant locations within a very short period, and filtering user records that log in to the default location, the final dataset is ensured to be clean.

[0044] Step S102: Construct a user graph based on the user's location information, browsing time information, and user behavior characteristics, and sample the user graph to obtain a user sequence.

[0045] User graphs include: directed user graphs or undirected user graphs;

[0046] In one implementation, user location information can be encoded so that similar geographical locations are mapped to similar Geohash values. Simultaneously, user login and browsing time is divided into multiple independent access periods. To track user activities in both space and time within a travel scenario, a unique ID is generated for each user's location Geohash value and access period. Thus, multiple location changes and different access periods within a certain time range can form an ordered list of IDs. Furthermore, combining user behavior characteristics, if different users exhibit the same behavior within each specific Geohash range and access period, these users are treated as nodes in a user graph, and connected by edges to obtain the user graph, which can be either a directed user graph or an undirected user graph.

[0047] Specifically, in the context of travel and tourism businesses, a directed user graph is chosen. However, the choice between using an undirected or directed graph depends on the specific characteristics of the scenario. For example, when users are browsing homepage ads, an undirected graph is more suitable. This is because which ad a user clicks on first often depends on which ad they see first, which is not a clear-cut sequential process but rather a relationship of mutual influence. In this case, an undirected graph can better reflect the actual situation.

[0048] In one implementation, after generating the user graph, a random walk method can be used to sample the graph. First, the node transition probability matrix is ​​calculated, and then the Node2vec algorithm is used to perform biased random walk sampling to obtain a user sequence for each user in the user graph.

[0049] Step S103: Input the user sequence, user profile features and user behavior features into the graph neural network model to obtain the user embedding vector.

[0050] Step S104: Determine the spatiotemporal similarity of users based on user embedding vectors.

[0051] In one implementation, the sampled user sequences, user profile features, and user behavior features are input into a graph neural network model. A user embedding vector is obtained by weighted aggregation of the input features for each user. Furthermore, spatiotemporal similarity between users can be determined by performing similarity analysis on the user embedding vectors of each user.

[0052] The user spatiotemporal similarity generation method provided in this invention constructs a user graph by combining user location information, browsing time information, and user behavior features. By sampling the user graph, the user graph structure is converted into a vector representation of user sequences, thereby accurately obtaining the spatiotemporal similarity between users. This effectively solves the problems of insufficient utilization and poor scalability of spatiotemporal information in the travel and tourism fields. At the same time, by combining user spatiotemporal features with a graph neural network model, the above method can effectively parse the real spatiotemporal association information of users, thereby improving the efficiency and accuracy of similar user identification.

[0053] In one implementation, for the aforementioned step S102, i.e., when constructing a user graph based on the user's location information, browsing time information, and user behavior characteristics, the following methods may be used, including but not limited to:

[0054] First, the user's location information is encoded to obtain a Geohash value.

[0055] In practice, the Geohash algorithm (with a precision of 7) can be used to encode the user's location information, so that similar geographical locations are mapped to similar Geohash values.

[0056] Secondly, based on preset time standards, the user's browsing time information is divided into multiple access periods.

[0057] The preset time standards include: an equal-length segmentation standard and a peak-peak segmentation standard. In practice, user browsing time is divided into multiple independent access periods according to both the equal-length segmentation standard and the peak-peak segmentation standard. For example, during peak periods such as daytime, the period is divided into half-hour intervals, while during off-peak periods such as nighttime, the period is divided into hourly intervals.

[0058] Then, a list of IDs for each user is generated based on the Geohash value and the access period.

[0059] In practical implementation, to track users' spatial and temporal activities in travel scenarios, a unique ID is generated based on the Geohash value of each user's location and the time period of access. Multiple location changes and access times within a certain time frame create an ordered list of IDs. Based on the theory that user needs and similarity may shift with changes in time and location, this ordered ID list reflects users' behaviors and needs in time and space, providing more accurate and comprehensive data support for constructing user graphs. For example, if user A logs onto the platform at 9:00 AM, located near a train station, there is a high probability that the user will purchase tickets. If they log onto the platform after arriving in another city at 3:00 PM, their needs may change to booking a hotel or hailing a taxi. These two spatiotemporal actions demonstrate the change in the user's travel needs, and the ordered ID list effectively connects these multiple spatiotemporal actions.

[0060] Next, based on each user's ID list and user behavior characteristics, users with the same behavior in the same session are identified, and an initial user graph for each session is constructed.

[0061] In practical implementation, a session can be defined as a range and time period within a specified Geohash. Within each specific Geohash range and time period (i.e., within the same session), if different users perform the same behavior (e.g., logging into a mini-program or querying business scenarios), these users are treated as nodes in the user graph model. Then, according to the access time sequence, users in the same session are connected by edges to obtain the initial user graph for each session.

[0062] In one implementation, when constructing the user graph, the edge weights of the nodes corresponding to two users in the user graph can be determined based on the number of times each pair of users exhibits the same behavior in the same session, and edges with edge weights less than the weight threshold are removed to obtain an optimized user graph.

[0063] Specifically, the initial user graph edge weights can be set to the number of times two users co-occur (i.e., the number of times the same behavior occurs), while a function mapping is performed based on the user's dwell time. After constructing the user graph, edge weights are formed. Assuming two users are similar, the edge weight connecting them will be relatively high. However, there may also be some edges with lower weights in the graph; these edges can be considered as generated by random user behavior. In extreme cases, the edge weight may remain at the initial value of 1, making it difficult to traverse. To suppress graph noise, in this embodiment, edges with low weights (i.e., edge weights less than a weight threshold) can be considered noise in the graph and removed.

[0064] Finally, the initial user graphs from different sessions are merged to obtain the user graph.

[0065] In practice, the user graphs generated from all sessions are merged. During this process, if an edge connects the same pair of nodes, the edge weight is accumulated. By merging the user graphs, a complete user graph containing all user information is obtained, effectively transforming user behavior into a graph model while preserving the relationships between users, thus providing efficient and accurate user behavior analysis.

[0066] See Figure 3 The diagram illustrates a flowchart for constructing a directed user graph. The left side shows the spatiotemporal changes of users, with POI representing user location information, Time01, ..., Time0n representing user access time periods, and Action representing user behavior, which may include login, search, browsing pages, etc. The center diagram shows the Space-time session sequence, representing the ordered sequence of user spatiotemporal behaviors for each session (i.e., session) obtained when constructing the directed user graph, denoted as session01, session02, etc. A, B, ..., F represent the user ID corresponding to a certain location and time period. The right side, UserGraph, represents the directed user graph constructed based on the user spatiotemporal behavior sequence, using graph to represent user spatiotemporal behavior.

[0067] In one implementation, after generating the directed user graph, a random walk method can be used to sample the graph. That is, when sampling the user graph to obtain the user sequence, the following methods can be used, including but not limited to:

[0068] First, based on the edge weights of the user graph, the edge weights of each node's neighboring nodes are normalized to obtain the node transition probability matrix between each node and its neighboring nodes.

[0069] In practice, the edge weights of each node's neighbor nodes are normalized based on the edge weights of each edge in the user graph. The normalized edge weights represent the probability of transitioning from the current node to a neighbor node, thus calculating a node transition probability matrix between each node and its neighbor nodes.

[0070] Then, based on the node transition probability matrix, the Node2vec algorithm is used to sample the user graph to obtain the user sequence.

[0071] For specific implementation, see Figure 4 As shown, the Node2vec algorithm can be used for biased random walk sampling. The Node2vec algorithm is a biased random walk method that obtains a user sequence for each user in the user graph. The Node2vec algorithm introduces hyperparameters to determine whether the sampling method emphasizes depth-first search (DFS) or breadth-first search (BFS), and can also control the step size and the maximum number of visits per node.

[0072] During a random walk, the normalized weights of the edges, i.e. the node transition probability matrix, can be used as the probability for sampling. This allows a user to obtain a sequence by performing random walks on multiple paths in the graph, even if the user has only a few interactions.

[0073] In this embodiment of the invention, in order to avoid memory overflow during the random walk, the transition probability of each node can be calculated first when traversing each node, and then the neighboring nodes can be traversed. This eliminates the need to pre-calculate the transition probabilities of all nodes and store them all in memory, significantly reducing memory usage and enabling the walk sampling to proceed normally.

[0074] In one implementation, the graph neural network model can be trained using a weighted Skip-Gram-like structure to generate an embedding representation (i.e., a user embedding vector) for each user. Skip-Gram is a general and modifiable training structure where the optimization objective is to maximize the similarity of users within a window, i.e., maximizing the conditional probability between users. Additionally, several negative samples are sampled, which have low similarity to the target user. All users within a window are paired with the target user as positive training samples. The negative sample sampling method uses the in-degree of graph nodes as sampling weights for global sampling; the specific sampling process can be accomplished using the sample softmax method in the TensorFlow deep learning framework. In practice, for a user sequence, the first user in the sequence can be designated as the target user, and the other users in the sequence can be paired with the target user as positive training samples. Simultaneously, the target user can be paired with users from other user sequences as negative training samples.

[0075] See Figure 5 As shown, Skip-Gram is a structure where the Projection Layer is the projection layer after the input layer of the neural network model. The role of the projection layer is to project the input layer vector into a high-dimensional continuous vector, i.e., the Input Matrix, through matrix multiplication. After the projection layer, the hidden representation layer is entered, which is generally composed of multiple hidden layers. An activation function is added, and the output is the final matrix vector, i.e., the Output Matrix. Here, P refers to positive samples, and N refers to negative samples. Negative samples are obtained through sampled softmax sampling.

[0076] The training approach used in this embodiment is derived from the Word2vec model, a popular word embedding learning model that maps words in a language to a vector space to capture their semantic information. In this embodiment, it is converted into a user embedding model, treating the user sequence as a sentence sequence. The Word2vec model also utilizes a Skip-Gram-like structure for training, thereby generating embedding representations for the user.

[0077] Based on this, in this embodiment, when inputting user sequences, user profile features, and user behavior features into a graph neural network model to obtain user embedding vectors, the following methods can be adopted, including but not limited to: First, inputting user sequences, user profile features, and user behavior features into a graph neural network model, and concatenating the user sequences, user profile features, and user behavior features to obtain the feature vector of each user; then, obtaining the feature weights of each feature parameter in the feature vector, and performing exponential transformation and normalization on the feature weights; wherein, the feature weights are obtained based on model training; finally, performing weighted aggregation calculation based on the user's feature vector and the processed feature weights to obtain the user embedding vector of each user.

[0078] In specific implementation, the graph neural network model constructed in this embodiment of the invention is the Space-Time Graph Embedding with Side Information (STGES) model, which is also a user embedding model capable of weighted aggregation of input features. (See [link to relevant documentation]). Figure 6 The diagram shown is an STGES model, where a0, a1, ..., a n This represents a parameter vector used to calculate the weights for each Side Information (including user profile features and user behavior features such as gender, age, and membership level), enabling the model to learn different weights for different users. In this embodiment, these weights are not randomly generated but implemented through custom, trainable network weight parameters. Furthermore, to ensure that the weight parameter of each feature is greater than 0, i.e., contributes positively to the model, an exponential transformation is used. Finally, these weight parameters are normalized so that their sum is 1, thus generating the final weight for each feature. This model network design allows the model to automatically learn the relative importance of each Side Information to the prediction target, thereby enabling the model to more precisely characterize and understand user behavior features.

[0079] See Figure 6 As shown, the upper layer of the STGES model is a Skip-Gram-like structure, such as... Figure 5 The meaning is as follows: The underlying layer of the model consists of multiple sparse features, representing discrete features, including sampled user sequences, user profile features, user behavior features, etc. After concatenation, a second-layer continuous vector (Dense Embeddings) is formed, representing the entire feature vector space; a0, a1, ..., a n These represent the training parameters, which play a crucial role in learning the importance of input features in graph neural networks and are also the most important part of the model.

[0080] Specifically, the weighted aggregation calculation process is as follows:

[0081]

[0082] in, The feature weight of the j-th feature parameter of the v-th user is obtained through model training, and n represents the length of the user's feature vector, i.e., the embedding length. Indicates the characteristic parameters The purpose of performing an exponential transformation is to ensure that the contribution of each side information is greater than 0. H represents the j-th feature parameter of the v-th user. v This represents the final user embedding vector of the v-th user, which is the user's hidden network representation.

[0083] In practical implementation, embeddings and feature weights cannot be directly generated for users not in the user graph. For the cold start problem, this embodiment uses average pooling or weight pooling of the User Side Information (user profile features and user behavior features) embeddings as the embedding results for "new" users. In other words, for users not in the user graph, their Side Information can be input into the STGES model to obtain a feature vector of the Side Information, and then average pooling or weighted pooling can be performed on this feature vector to obtain the user's embedding vector representation.

[0084] Furthermore, in this embodiment of the invention, offline similarity recall evaluation and online performance evaluation were performed on the above-mentioned STGES model. Specifically, the offline similarity recall evaluation involved experiments on the base model network, using both a model network with added spatiotemporal information and a network with optimized structure. The evaluation metric was MRR (Mean Reciprocal Rank), which refers to the accuracy of seed users, calculated by taking the reciprocal of the expected accurate results in the recall results, and then averaging the results across all seed users. The performance of different methods on the test set is shown in Table 1.

[0085] Table 1 shows the performance of different methods on the test set.

[0086] experiment MRR Basic GES 0.389 Spacetime STGES 0.480 Graph network optimization 0.514

[0087] The online evaluation model primarily involved observing the conversion rate of experiments. Over 10,000 seed users were selected, and cosine similarity was used to recall the Top K users from the candidate user set, who were then reached out via SMS. The experiment was conducted twice, the difference being the size of the recalled user group. See [link / reference] Figure 7 As shown in the experimental results, when the size of the recalled audience is the same as that of the online manual strategy, the daily conversion rate is nearly doubled compared to the manual strategy. Even when recalling a large audience, the conversion rate still surpasses that of the manual strategy. Therefore, the STGES provided in this embodiment of the invention demonstrates excellent performance when recalling a small audience. Even when facing a large number of users, although the effect is diluted, it still surpasses the manual strategy, making STGES very suitable for audience expansion or promotional scenarios.

[0088] The spatiotemporal graph neural network similarity method STGES provided in this embodiment of the invention has the following significant beneficial effects in travel and tourism scenarios:

[0089] (1) Make full use of user spatiotemporal information: Compared with the traditional look-alike strategy algorithm, this invention effectively analyzes the real spatiotemporal association information of users by combining spatiotemporal features and graph neural network similarity methods. It can not only accurately recall similar users who are more in line with the travel scenario, but also meet the needs of large-scale user recall.

[0090] (2) Enhance the scalability of the algorithm: This invention transforms the graph into a vector representation by constructing users into a graph structure, and uses random walk sampling to learn the user profile features and behavioral feature sequence information. At the same time, it captures the similarity between users in the spatiotemporal dimension, which not only improves the scalability of the algorithm, but also enables it to adapt to the various complex business needs of the travel platform.

[0091] (3) Improve the sparsity cold start problem: Considering the sparsity and cold start user problem, the STGES method integrates spatiotemporal information and side information on the basis of graph embedding. By suppressing noise in data and images, it can use head items to enhance the generalization ability of this information and obtain more accurate embeddings for tail and cold start users.

[0092] In summary, the STGES technical solution provided by this invention can effectively solve the problems of insufficient utilization of spatiotemporal information, poor scalability of look-alike algorithm strategies, and cold start in the travel and tourism fields, and can better improve business operation efficiency and user experience.

[0093] In addition to the user spatiotemporal similarity generation method provided in the foregoing embodiments, this invention also provides a user spatiotemporal similarity generation apparatus, see [link to apparatus]. Figure 8The schematic diagram shown illustrates the structure of a device for generating user spatiotemporal similarity, indicating that the device mainly comprises the following parts:

[0094] The information acquisition module 801 is used to acquire the user's location information, browsing time information, user profile characteristics, and user behavior characteristics.

[0095] The user sampling module 802 is used to construct a user graph based on the user's location information, browsing time information and user behavior characteristics, and to sample the user graph to obtain a user sequence; wherein, the user graph includes: a directed user graph or an undirected user graph.

[0096] The user embedding generation module 803 is used to input user sequences, user profile features and user behavior features into the graph neural network model to obtain user embedding vectors.

[0097] The similarity determination module 804 is used to determine the spatiotemporal similarity of users based on user embedding vectors.

[0098] The user spatiotemporal similarity generation device provided in this embodiment of the invention constructs a user graph by combining user location information, browsing time information, and user behavior characteristics. By sampling the user graph, the user graph structure is converted into a vector representation of user sequences, thereby accurately obtaining the spatiotemporal similarity between users and effectively solving the problems of insufficient utilization and poor scalability of spatiotemporal information in the travel and tourism fields. At the same time, by combining the user's spatiotemporal characteristics with a graph neural network model, the device can effectively parse the user's real spatiotemporal association information, thereby improving the efficiency and accuracy of similar user identification.

[0099] In one embodiment, the user sampling module 802 is further configured to: encode the user's location information to obtain a Geohash value; divide the user's browsing time information into multiple access periods based on a preset time standard; wherein the preset time standard includes: an equal-length division standard and a popular-tidal standard; generate an ID list for each user based on the Geohash value and access period; determine users with the same behavior in the same session based on the ID list and user behavior characteristics of each user, and construct an initial user graph for each session; wherein the session is within a specified Geohash range and time period; and merge the initial user graphs of different sessions to obtain a user graph.

[0100] In one embodiment, the user sampling module 802 is further configured to: determine the edge weights of the nodes corresponding to two users in the user graph based on the number of times each two users exhibit the same behavior in the same session; and remove edges whose edge weights are less than the weight threshold to obtain an optimized user graph.

[0101] In one embodiment, the information acquisition module 801 is further configured to: filter the user's location information and browsing time information to remove data that does not conform to preset rules.

[0102] In one embodiment, the user sampling module 802 is further configured to: normalize the edge weights of the neighboring nodes of each node based on the edge weights of the user graph to obtain the node transition probability matrix between each node and its neighboring nodes; and sample the user graph using the Node2vec algorithm based on the node transition probability matrix to obtain the user sequence.

[0103] In one implementation, the graph neural network model adopts a weighted Skip-Gram-like structure; the user embedding generation module 803 is further configured to: input user sequences, user profile features, and user behavior features into the graph neural network model, and concatenate the user sequences, user profile features, and user behavior features to obtain the feature vector of each user; obtain the feature weight of each feature parameter in the feature vector, and perform exponential transformation and normalization on the feature weight; wherein, the feature weight is obtained based on model training; and perform weighted aggregation calculation based on the user's feature vector and the processed feature weight to obtain the user embedding vector of each user.

[0104] In one embodiment, the user embedding generation module 803 is further configured to: perform weighted aggregation calculation according to the following formula:

[0105]

[0106] in, This represents the feature weight of the j-th feature parameter of the v-th user, and n represents the length of the user's feature vector. Indicates the characteristic parameters Perform an exponential transformation. H represents the j-th feature parameter of the v-th user. v Let v represent the user embedding vector of the v-th user.

[0107] It should be noted that the device provided in the embodiments of the present invention has the same implementation principle and technical effect as the aforementioned method embodiments. For the sake of brevity, any parts not mentioned in the device embodiments can be referred to the corresponding content in the aforementioned method embodiments.

[0108] This invention also provides an electronic device, specifically, the electronic device includes a processor and a storage device; the storage device stores a computer program, and the computer program, when run by the processor, executes the method described in any of the above embodiments.

[0109] Figure 9This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 100 includes: a processor 90, a memory 91, a bus 92, and a communication interface 93. The processor 90, the communication interface 93, and the memory 91 are connected through the bus 92. The processor 90 is used to execute executable modules, such as computer programs, stored in the memory 91.

[0110] The memory 91 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 93 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.

[0111] Bus 92 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0112] The memory 91 is used to store programs. After receiving an execution instruction, the processor 90 executes the programs. The method executed by the device for defining the flow process disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 90 or implemented by the processor 90.

[0113] The processor 90 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 90 or by instructions in software form. The processor 90 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 91. Processor 90 reads the information in memory 91 and, in conjunction with its hardware, completes the steps of the above method.

[0114] The computer program product of the readable storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the foregoing method embodiments. For specific implementation, please refer to the foregoing method embodiments, which will not be repeated here.

[0115] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0116] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for generating user spatiotemporal similarity, characterized in that, include: Obtain user location information, browsing time information, user profile characteristics, and user behavior characteristics; A user graph is constructed based on the user's location information, browsing time information, and user behavior characteristics, and the user graph is sampled to obtain a user sequence. The user graph includes either a directed user graph or an undirected user graph. Constructing the user graph involves: encoding the user's location information, mapping similar geographical locations to similar Geohash values; dividing the user's login browsing time into multiple independent access periods; generating a unique ID for each user's location Geohash value and access period, thus forming an ID list for multiple location changes and different access periods within a certain time range; and combining user behavior characteristics, if different users exhibit the same behavior within each specific Geohash range and access period, then the user is treated as a node in the user graph, and the users are connected using edges to obtain the user graph. The user sequence, the user profile features, and the user behavior features are input into a graph neural network model to obtain a user embedding vector; The spatiotemporal similarity of the user is determined based on the user embedding vector.

2. The method according to claim 1, characterized in that, A user graph is constructed based on the user's location information, browsing time information, and user behavior characteristics, including: The user's location information is encoded to obtain a Geohash value; The user's browsing time information is divided into multiple access periods based on a preset time standard; wherein, the preset time standard includes: an equal-length time division standard and a popular peak / peak time standard; Generate a list of IDs for each user based on the Geohash value and the access period; Based on the ID list of each user and the user behavior characteristics, users with the same behavior in the same session are identified, and an initial user graph for each session is constructed; wherein, the session is within a specified Geohash range and time period; The initial user graphs from different sessions are merged to obtain the user graph.

3. The method according to claim 2, characterized in that, After merging the initial user graphs from different sessions to obtain a user graph, the method includes: The edge weights of the nodes corresponding to the two users in the user graph are determined based on the number of times each pair of users exhibits the same behavior in the same session. Edges with weights less than the weight threshold are removed to obtain the optimized user graph.

4. The method according to claim 1, characterized in that, Before constructing a user graph based on the user's location information, browsing time information, and user behavior characteristics, the method further includes: The user's location information and browsing time information are filtered to remove data that does not conform to preset rules.

5. The method according to claim 3, characterized in that, The user sequence is obtained by sampling the user graph, including: Based on the edge weights of the user graph, the edge weights of the neighboring nodes of each node are normalized to obtain the node transition probability matrix between each node and its neighboring nodes. Based on the node transition probability matrix, the Node2vec algorithm is used to sample the user graph to obtain the user sequence.

6. The method according to claim 1, characterized in that, The graph neural network model adopts a weighted Skip-Gram-like structure. The user sequence, user profile features, and user behavior features are input into a graph neural network model to obtain a user embedding vector, including: The user sequence, user profile features, and user behavior features are input into a graph neural network model, and the user sequence, user profile features, and user behavior features are concatenated to obtain the feature vector of each user. The feature weights of each feature parameter in the feature vector are obtained, and the feature weights are subjected to exponential transformation and normalization; wherein, the feature weights are obtained based on model training. The user embedding vector for each user is obtained by weighted aggregation calculation based on the user's feature vector and the processed feature weights.

7. The method according to claim 1, characterized in that, The user embedding vector for each user is obtained by weighted aggregation calculation based on the user's feature vector and the processed feature weights, including: The weighted aggregation calculation is performed according to the following formula: in, Indicates the first v The first user's j The feature weights of each feature parameter, where n represents the length of the user's feature vector. Indicates the characteristic parameters Perform an exponential transformation. Indicates the first v The first user's j One feature parameter, Indicates the first v User embedding vectors for each user.

8. A device for generating user spatiotemporal similarity, characterized in that, include: The information acquisition module is used to acquire user location information, browsing time information, user profile characteristics, and user behavior characteristics. The user sampling module is used to construct a user graph based on the user's location information, browsing time information, and user behavior characteristics, and to sample the user graph to obtain a user sequence. The user graph includes either a directed user graph or an undirected user graph. Constructing the user graph includes: encoding the user's location information, mapping similar geographical locations to similar Geohash values; dividing the user's login browsing time into multiple independent access periods; generating a unique ID from the user's Geohash value and access period for each location, thus forming an ID list based on multiple location changes and access periods within a certain time range; and combining user behavior characteristics, if different users exhibit the same behavior within each specific Geohash range and access period, then these users are treated as nodes in the user graph, and the users are connected using edges to obtain the user graph. The user embedding generation module is used to input the user sequence, the user profile features, and the user behavior features into a graph neural network model to obtain a user embedding vector; A similarity determination module is used to determine the spatiotemporal similarity of the user based on the user embedding vector.

9. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program is executed by the processor to perform the steps of the method described in any one of claims 1 to 7.