Figure portraying method based on combined space-time attention mechanism and related device

By introducing a combined space-time attention mechanism and convolutional fusion module in the user portrait method, the space-time features in the user behavior data are extracted, which solves the problem of difficulty in accurately extracting local and global space-time features in the prior art, and significantly improves the user portrait Accuracy and generation ability.

CN119475220AActive Publication Date: 2025-02-18XIAMEN UNIV

Patent Information

Application Number
CN202411504977.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-18
Estimated Expiration
2044-10-25

AI Technical Summary

Technical Problem

The prior art is difficult to accurately extract local and global spatio-temporal features when building user portraits, resulting in insufficient accuracy of user portraits.

Method used

The character portrait method based on the combined space-time attention mechanism is adopted, and the user behavior attribute data is converted into embedded vector representation through the embedding layer, and the first space-time relationship characteristics and the second space-time relationship characteristics are extracted by the space-time attention and convolutional fusion module. Including global time dependencies, local space dependencies, global space dependencies and local time dependencies.

Benefits of technology

This method can accurately and simultaneously extract local and global spatiotemporal characteristics in user behavior data, improve the accuracy and generation ability of user portraits, and ensure a more comprehensive understanding of the internal laws of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119475220A_ABST
    Figure CN119475220A_ABST
Patent Text Reader

Abstract

The invention discloses a figure portraying method based on a combined space-time attention mechanism and a related device, and relates to the technical field of user portray.The method comprises the steps that user behavior attribute data of a target user are acquired, and in order to conveniently capture complex relations and features in the user behavior attribute data, the user behavior attribute data are acquired; the method comprises the following steps of: firstly, converting discrete user behavior attribute data into embedded vector representation by adopting an embedded layer to obtain a comprehensive embedded vector, and then respectively extracting first and second space-time relationship characteristics from the comprehensive embedded vector by adopting a space-time attention and convolution fusion module; according to the method, a global time dependency relationship, a local space dependency relationship, a global space dependency relationship and a local time dependency relationship of user behaviors are extracted, classification and clustering are carried out according to the global time dependency relationship, the local space dependency relationship and the global space dependency relationship, a label of a target user is determined, and an accurate figure portrait is generated. According to the scheme, the local and global spatial-temporal features in the data can be accurately and simultaneously extracted, and a solid foundation is provided for further analysis and decision making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of user portrait technology, and in particular to a character portrait method and related device based on a combined spatiotemporal attention mechanism. Background Art

[0002] Character portrait refers to a labeled user model abstracted from the user's basic information, preferences, habits, behaviors, etc., which is generally speaking to label the user, and the label is a highly refined feature identifier obtained by analyzing the user information. By labeling, some highly generalized and easy-to-understand features can be used to describe the user, which makes it easier for people to understand the user, which is conducive to the development of personalized services, analysis and decision-making for users. Labels are divided into static labels and dynamic labels. Static labels will not change for a long time, such as gender, birthday, etc., while dynamic labels will change over time, such as the user's social relations, interests, social networks, etc. The static character portrait label system is usually difficult to meet the rapid update and iteration of social big data. Dynamic labels can timely reflect the changes in user behavior and status, and can be dynamically adjusted according to the user's real-time data. It has stronger flexibility and practicality, thereby providing a more accurate and personalized user portrait. Therefore, dynamic knowledge graphs are usually used to generalize and expand character portrait labels. The dynamic knowledge graph contains the user's social network graph, and the user's social network graph is updated in a combination of active and passive updates. The active method adopts a high-frequency entity and knowledge update strategy, and the passive method adopts a periodic update strategy to achieve the automatic evolution of character portrait labels.

[0003] In addition, the construction of user portraits involves the extraction of spatiotemporal relationships, which are the evolution over time, the changing characteristics of a single user's behavior and attributes, and the characteristics of other users related to them. Research on spatiotemporal relationship extraction can be divided into three main types: RNN-based models, CNN-based models, and Attention-based models. However, these models lack the interaction between the attention mechanism and the convolution module, which may make it impossible to accurately extract local and global spatiotemporal features at the same time.

[0004] Therefore, an appropriate solution is urgently needed to address the problem that the current feature extraction model in the process of building user portraits cannot accurately and simultaneously extract local and global spatiotemporal features. Summary of the invention

[0005] The purpose of this application is to provide a character portrait method and related devices based on a combined spatiotemporal attention mechanism, which can accurately extract local and global spatiotemporal features at the same time and improve the accuracy of character portraits.

[0006] To achieve the above objectives, this application provides the following solutions:

[0007] In a first aspect, the present application provides a character profiling method based on a combined spatiotemporal attention mechanism, comprising the following steps:

[0008] Obtain user behavior attribute data of the target user; the user behavior attribute data includes user behavior sequence and user social relationship network diagram.

[0009] The embedding layer is used to transform the user behavior attribute data into an embedded vector representation to obtain a comprehensive embedding vector.

[0010] The spatiotemporal attention and convolutional fusion modules are used to extract the first spatiotemporal relationship features and the second spatiotemporal relationship features from the comprehensive embedding vector respectively; the first spatiotemporal relationship features include global temporal dependency and local spatial dependency; the second spatiotemporal relationship features include global spatial dependency and local temporal dependency.

[0011] Classification and clustering are performed according to the first spatiotemporal relationship feature and the second spatiotemporal relationship feature, a label of the target user is determined, and a character portrait of the target user is generated.

[0012] Optionally, the user social relationship network graph is a directed weighted graph, in which nodes represent different users, edges between nodes represent the relationship between users, and the weight of the edge represents the degree of connection between two users.

[0013] Optionally, an embedding layer is used to convert the user behavior attribute data into an embedded vector representation to obtain a comprehensive embedding vector, which specifically includes the following steps:

[0014] The embedding layer is used to extract spatial embedding vectors, periodic time embedding vectors, feature sequence high-dimensional embedding vectors and adaptive embedding vectors according to user behavior sequences and user social relationship network graphs.

[0015] The spatial embedding vector, the periodic time embedding vector, the feature sequence high-dimensional embedding vector and the adaptive embedding vector are summed to obtain a comprehensive embedding vector.

[0016] Optionally, the spatiotemporal attention and convolution fusion module includes a first feature extraction branch and a second feature extraction branch; the first feature extraction branch includes a temporal attention submodule and a spatial convolution submodule; the second feature extraction branch includes a spatial attention submodule and a temporal convolution submodule; the spatiotemporal attention and convolution fusion module are used to extract the first spatiotemporal relationship feature and the second spatiotemporal relationship feature from the comprehensive embedding vector, respectively, specifically including the following steps:

[0017] The comprehensive embedding vector is input into the temporal attention submodule to extract the first temporal features containing global temporal dependencies.

[0018] The comprehensive embedding vector is input into the spatial attention submodule to extract the first spatial feature containing the global spatial dependency.

[0019] The first time feature is input into the spatial convolution submodule to extract the first spatiotemporal relationship feature containing the global time dependency and the local spatial dependency.

[0020] The first spatial feature is input into the time convolution submodule to extract the second spatiotemporal relationship feature containing local time dependency and global space dependency.

[0021] Optionally, in the temporal attention submodule, a multi-head attention mechanism is used to capture the global temporal dependencies of user behavior sequences that change over time; in the spatial attention submodule, a self-attention mechanism is used to capture the dynamic global spatial dependencies in the user social relationship network graph.

[0022] Optionally, in the spatial convolution submodule, a graph convolutional neural network is used to extract local spatial dependencies; in the temporal convolution submodule, a dilated convolution is used to extract local temporal dependencies.

[0023] In the second aspect, the present application provides a character portrait system based on a combined spatiotemporal attention mechanism, comprising:

[0024] The user behavior attribute data acquisition module is used to acquire the user behavior attribute data of the target user; the user behavior attribute data includes the user behavior sequence and the user social relationship network diagram.

[0025] The embedded vector representation conversion module is used to convert the user behavior attribute data into an embedded vector representation using an embedding layer to obtain a comprehensive embedding vector.

[0026] The spatiotemporal relationship feature extraction module is used to extract the first spatiotemporal relationship feature and the second spatiotemporal relationship feature from the comprehensive embedding vector by using the spatiotemporal attention and convolution fusion modules; the first spatiotemporal relationship feature includes global time dependency and local space dependency; the second spatiotemporal relationship feature includes global space dependency and local time dependency.

[0027] The user character portrait generation module is used to classify and cluster according to the first spatiotemporal relationship feature and the second spatiotemporal relationship feature, determine the label of the target user, and generate a character portrait of the target user.

[0028] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the character portrait method based on the combined spatiotemporal attention mechanism described above.

[0029] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the character portrait method based on the combined spatiotemporal attention mechanism described above.

[0030] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the character portrait method based on the combined spatiotemporal attention mechanism described above.

[0031] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0032] The present application provides a character portrait method and related devices based on a combined spatiotemporal attention mechanism. In the method, the user behavior attribute data of the target user is obtained. In order to capture the complex relationships and features in the user behavior attribute data, the discrete user behavior attribute data is first converted into an embedded vector representation by an embedding layer to obtain a comprehensive embedding vector. Then, the spatiotemporal attention and convolution fusion modules are used to extract the first spatiotemporal relationship feature and the second spatiotemporal relationship feature from the comprehensive embedding vector respectively. The global time dependency, local space dependency, global space dependency and local time dependency of the user behavior are extracted. Finally, classification and clustering are performed based on this to determine the label of the target user and generate an accurate character portrait of the target user. The above scheme of the present application can accurately and simultaneously extract the local and global spatiotemporal features in the user behavior data. Specifically, the spatiotemporal attention and convolution fusion modules can deeply analyze the changing trends of the data at different time points and spatial dimensions, which can not only capture subtle local features, but also identify the overall global pattern. This accurate spatiotemporal feature extraction provides a solid foundation for further label analysis and decision-making, ensuring a more comprehensive understanding of the inherent laws of the data, thereby optimizing the generation strategy and improving the ability and effect of character portrait generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] 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 will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 A flowchart of a character portrait method based on a combined spatiotemporal attention mechanism is provided for one embodiment of the present application.

[0035] Figure 2 A data flow diagram of a character profiling method based on a combined spatiotemporal attention mechanism provided in one embodiment of the present application.

[0036] Figure 3 A flowchart of step A3 in a character portrait method based on a combined spatiotemporal attention mechanism provided in one embodiment of the present application.

[0037] Figure 4 A functional module diagram of a character portrait system based on a combined spatiotemporal attention mechanism provided in one embodiment of the present application.

[0038] Figure 5 A schematic diagram of the structure of a computer device provided in one embodiment of the present application.

[0039] Figure 6 A schematic diagram of the structure of a computer program product provided in one embodiment of the present application. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0042] In an exemplary embodiment, Figure 1 As shown, a character profiling method based on a combined spatiotemporal attention mechanism is provided, comprising the following steps:

[0043] A1. Obtain user behavior attribute data of the target user; the user behavior attribute data includes user behavior sequence and user social relationship network diagram. User behavior attribute data is usually a discrete input, such as user age, criminal history, relationship with others, etc. Specifically in this embodiment, the user social relationship network diagram is a directed weighted graph, in which nodes represent different users, edges between nodes represent the relationship between users, and the weight of the edge represents the closeness of the connection between two users.

[0044] A2. Use an embedding layer to convert the user behavior attribute data into an embedded vector representation to obtain a comprehensive embedded vector. Since the user behavior attribute data is usually a discrete input, in order to capture the complex relationships and features in the user behavior attribute data, it is necessary to first convert it into a vector representation. In this embodiment, step A2 specifically includes the following steps:

[0045] A21. Using the embedding layer, spatial embedding vectors, periodic time embedding vectors, feature sequence high-dimensional embedding vectors and adaptive embedding vectors are extracted based on the user behavior sequence and the user social relationship network graph.

[0046] In the conversion process of step A21, if Figure 2 As shown in the figure, the spatial embedding vector X is generated by performing eigenvalue decomposition on the standard Laplacian matrix of the user's social relationship network graph attributes. S In the time dimension, considering that a week has 7 days and a day has 24 hours, one-hot encoding is used to obtain the vector representation of day-of-week and time-of-day, and the two are concatenated to generate the periodic time embedding vector X T ; By inputting the user behavior sequence and the user social relationship network graph into the fully connected layer, the feature sequence high-dimensional embedding vector X is obtained f ; In addition, by adaptive embedding vector It can uniformly capture the complex spatiotemporal correlations in user behavior sequences and user social relationship network graphs. The first dimension T represents the time step, the second dimension N represents the number of nodes, and the third dimension d a It is a feature dimension, representing the feature representation of each time step and each spatial location node (i.e., each user in the social network graph). This flexible approach integrates time and space into a unified representation to facilitate the subsequent extraction of local and global spatiotemporal features.

[0047] A22, summing the spatial embedding vector, the periodic time embedding vector, the feature sequence high-dimensional embedding vector and the adaptive embedding vector to obtain a comprehensive embedding vector. The four embedding vectors converted in step A21 above are summed to obtain a comprehensive embedding vector X emb =X f +X s +X T +X a , as the output of the embedding layer, and also the input of the spatiotemporal attention and convolutional fusion modules.

[0048] A3. Use the spatiotemporal attention and convolutional fusion modules to extract the first spatiotemporal relationship features and the second spatiotemporal relationship features from the comprehensive embedding vector respectively; the first spatiotemporal relationship features include global time dependency and local space dependency; the second spatiotemporal relationship features include global space dependency and local time dependency.

[0049] The spatiotemporal attention and convolutional fusion blocks are designed to extract dynamic, nonlinear, local and global spatiotemporal dependencies. The comprehensive embedding vector X obtained in step A2 is converted into embAs its input, it extracts the spatiotemporal relationship contained in the user behavior attribute data. It is a two-branch structure, and each branch uses the attention mechanism and convolution operation to capture the temporal or spatial dependency. In this embodiment, the spatiotemporal attention and convolution fusion module includes a first feature extraction branch and a second feature extraction branch, such as Figure 2 As shown in the figure, the first feature extraction branch includes a temporal attention submodule and a spatial convolution submodule, generating features based on local spatial dependency and global temporal dependency; the second feature extraction branch includes a spatial attention submodule and a temporal convolution submodule, generating features based on global spatial dependency and local temporal dependency. Figure 3 In the flowchart shown, step A3 specifically includes the following steps:

[0050] A31. Input the comprehensive embedding vector into the time attention submodule to extract the first time feature containing the global time dependency. Specifically in this embodiment, in the time attention submodule, the global time dependency of the user behavior sequence changing over time is captured through a multi-head attention mechanism.

[0051] The comprehensive embedding vector X emb After input, a multi-head attention mechanism is used to capture the user behavior patterns that change over time. When performing dot products to calculate the similarity between the Query (Q) matrix and the Key (K) matrix, we integrate local context information by convolving Q and K. This is shown in the following formula:

[0052] Q 1 =Θ*X emb ,K 1 =Θ*X emb ,V 1 =X emb W V .

[0053]

[0054] H = softmax(A 1 )V 1 .

[0055] O 1 =Concat(H 1 ,H 2 ,…,H h )W O .

[0056] In the above formula, Θ represents the convolution kernel parameter, * represents the convolution operation, and W V is the weight matrix of the Value matrix, d k is the dimension of the Query matrix and the Key matrix, which is used to scale the dot product calculation results; the time attention score A 1It is obtained by calculating the similarity between the Query matrix and the Key matrix, and then using the softmax function to 1 Normalization is performed to determine the time attention weight; H is the output feature of each head, and the output of h heads is concatenated and then the linear transformation matrix W is used O , and get the final output O of the temporal attention submodule 1 , the output feature O 1 It can effectively capture the global temporal dependencies in user behaviors and can be further used as the input of the spatial convolution submodule.

[0057] A32. Input the comprehensive embedding vector into the spatial attention submodule to extract the first spatial feature containing the global spatial dependency. Specifically in this embodiment, in the spatial attention submodule, a self-attention mechanism is used to capture the dynamic global spatial dependency in the user social relationship network graph.

[0058] In the spatial attention submodule, considering that the relationship between nodes changes dynamically over time and is affected by geographic neighbors (direct neighbor nodes, users with direct relationships with the target user) and semantic neighbor nodes (also known as potential neighbors, which are not directly connected to the target user at present, but may be indirectly connected through several users, or have similar behavioral attributes to the target user), the self-attention mechanism is used to capture the dynamic global spatial dependencies in the user social relationship network graph. At the same time, in addition to the Query, Key, and Value matrices used to scale the dot product, a Z matrix is ​​also used to retain the original features of the user node. The formula is as follows:

[0059] Q 2 =X emb W Q ,K 2 =X emb W K ,V 2 =X emb W V .

[0060] Z=X emb W Z .

[0061]

[0062] H = α softma (A 2 )V 2 +(1-α)·Z.

[0063] O 2 =Concat(H 1 ,H 2 ,…,H h)W o .

[0064] In the above formula, X emb is the comprehensive embedding vector output by the embedding layer in step A2, W Q , W K , W V and W Z Represents the weight matrices of the Query matrix, Key matrix, Value matrix, and Z matrix, respectively. k is the dimension of the Query and Key matrices, used to scale the dot product calculation results. Spatial attention score A 2 It is obtained by calculating the similarity between Query and Key, and then using the softmax function to 2 Normalization is performed to determine the attention weight. α is the threshold that controls the output of the attention mechanism and the proportion of the original output. H is the output feature of each head. The output of h heads is concatenated and then the linear transformation matrix W is used. O , and obtain the output O of the spatial attention submodule that captures the global spatial dependencies 2 , and this output serves as the input of the temporal convolution submodule.

[0065] A33, input the first time feature into the spatial convolution submodule, and extract the first spatiotemporal relationship feature containing the global time dependency and the local spatial dependency. Specifically in this embodiment, in the spatial convolution submodule, a graph convolutional neural network is used to extract the local spatial dependency.

[0066] After the temporal attention submodule extracts the global temporal dependency of the data, the output O 1 The input is sent to the spatial convolution submodule to extract the local spatial dependency of the data. In the spatial convolution submodule, the graph convolutional neural network (GCN) is used to extract the local spatial dependency and utilize the topological properties of the graph structure. Because the computational complexity of eigenvalue decomposition is high, the Chebyshev polynomial approximation is used here, and the formula is as follows:

[0067]

[0068] Among them, θ k represents the coefficients of the polynomial, is a k-order Chebyshev polynomial. There exists The relationship between θ Represents the convolution kernel parameters of the graph convolution operation, * G Represents the convolution operation on the graph G, where O 1This is the input of this submodule, which is also the output of the temporal attention submodule. Since the relationship between nodes in the graph changes dynamically over time, the spatial attention score A learned by the spatial attention module is used. 2 To adjust the above formula:

[0069]

[0070] The temporal attention submodule and the spatial convolution submodule constitute the first branch, which extracts the global temporal dependency of user behavior attribute data and learns the local spatial dependency. The output of the first branch is represented as 3 .

[0071] A34, input the first spatial feature into the time convolution submodule, and extract a second spatiotemporal relationship feature containing a local time dependency and a global space dependency. Specifically in this embodiment, in the time convolution submodule, causal convolution and dilated convolution are used to extract the local time dependency.

[0072] Compared with the traditional time recurrent neural network RNN ​​(LSTM, GRU), causal convolution has the advantages of fewer parameters and simpler structure. In addition, due to the parallel calculation, the training time of the model is greatly shortened. Therefore, in the time convolution submodule, the convolution operation is chosen to replace the traditional iterative RNN. At the same time, due to the limited historical range that can be covered by causal convolution, on this basis, the dilated convolution increases the dilation factor on the basis of the causal convolution, which can achieve a larger perception field of view (covering a wider range of moments) with a small number of stacked layers, thereby being able to capture a wider range of time dependencies, which can be expressed by the following formula:

[0073]

[0074] Among them, O 2 represents the output of the spatial attention submodule, O 2,t-d·k represents the value output by the spatial attention submodule at time step td·k, w k represents the weight of the convolution kernel, K represents the size of the convolution kernel, d represents the dilation factor, which is used to control the interval of the input time step in the convolution operation, and the output of the time convolution submodule is represented by O 4 .

[0075] In order to learn local and global spatiotemporal correlations more effectively, the outputs of the two branches focusing on different aspects can be concatenated using the following formula as the final output of the spatiotemporal attention and convolutional fusion modules.

[0076] O = Concat(O 3 O 4 ).

[0077] This not only takes into account the local and global spatial relationships between users, but also takes into account the user behavior patterns that change over time from both the short-term and long-term perspectives, thereby improving the accuracy of user portraits and the generalization ability of the model.

[0078] A4. Classify and cluster the first spatiotemporal relationship feature and the second spatiotemporal relationship feature, determine the label of the target user, and generate a character portrait of the target user. Specifically, by integrating the user behavior features extracted from the time and space dimensions, these features can be classified and clustered to generate more accurate user portraits of different categories. Classifying user features refers to predicting which behavior category or group the user belongs to, classifying user behavior, and generating labels based on behavioral features. Clustering user features refers to dividing users with similar features into several categories, generating user group portraits, and finding user groups with similar behaviors or social relationships. In this way, combined with the user's historical behavior, social relationships, and their dynamic properties that change over time, the user's preferences, interests, and potential behavior patterns can be identified.

[0079] As an illustrative case, when the above scheme is applied to the scenario of constructing a user portrait of criminal intent based on social network behavior and access records, user behavior attribute data related to the user's potential criminal intent can be obtained from multiple sources, including the user's social network activity data (published remarks, comments, likes and forwarded content, etc.), the user's social relationship network data (which users frequently interact with), the user's browsing history and website access data (monitoring specific websites frequently visited by users), etc. The obtained multi-dimensional data is converted into a high-dimensional embedding representation. After extracting spatiotemporal features through spatiotemporal blocks, the user's long-term and short-term behavior patterns in the social network and the user's local (specific groups) and global (broad suspicious social groups) dependencies in the social network can be obtained. Based on the extracted spatiotemporal features, dynamic user labels can be generated, such as whether the user is a violent user, a disseminator of extreme ideas, a potential member of a criminal group, etc.

[0080] In addition, it also includes a variety of common scenarios, such as interest change analysis in intelligent recommendation. In order to better perform personalized recommendations for users, the platform needs to capture users' viewing preferences at different times and generate dynamic user portraits based on users' social relationship networks. In the travel mode analysis of the smart travel platform, in order to provide better taxi or navigation services, the platform needs to analyze users' travel habits and make predictions based on historical data and relationships in social networks, because users' travel needs are strongly affected by time and geographic location.

[0081] The character profiling method based on the combined spatiotemporal attention mechanism provided in the above embodiment of the present application can more accurately extract local and global spatiotemporal features in the data at the same time. Specifically, the above scheme can deeply analyze the changing trends of data at different time points and spatial dimensions, and can not only capture subtle local features, such as emergencies in a short period of time or abnormal fluctuations of a specific user, but also identify overall global patterns, such as long-term trends or collective behaviors over a large range. This precise spatiotemporal feature extraction provides a solid foundation for further analysis and decision-making, ensuring a more comprehensive understanding of the inherent laws of the data, thereby optimizing strategies and improving the predictive ability and application effect of the model.

[0082] Based on the same inventive concept, the embodiment of the present application also provides a system for implementing the above-mentioned character portrait method based on the combined spatiotemporal attention mechanism. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more system embodiments provided below can refer to the above-mentioned limitations on the character portrait method based on the combined spatiotemporal attention mechanism, which will not be repeated here.

[0083] In an exemplary embodiment, Figure 4 As shown in the figure, a character portrait system based on a combined spatiotemporal attention mechanism is provided, including the following modules:

[0084] The user behavior attribute data acquisition module is used to acquire the user behavior attribute data of the target user; the user behavior attribute data includes the user behavior sequence and the user social relationship network diagram.

[0085] The embedded vector representation conversion module is used to convert the user behavior attribute data into an embedded vector representation using an embedding layer to obtain a comprehensive embedding vector.

[0086] The spatiotemporal relationship feature extraction module is used to extract the first spatiotemporal relationship feature and the second spatiotemporal relationship feature from the comprehensive embedding vector by using the spatiotemporal attention and convolution fusion modules; the first spatiotemporal relationship feature includes global time dependency and local space dependency; the second spatiotemporal relationship feature includes global space dependency and local time dependency.

[0087] The user character portrait generation module is used to classify and cluster according to the first spatiotemporal relationship feature and the second spatiotemporal relationship feature, determine the label of the target user, and generate a character portrait of the target user.

[0088] certainly, Figure 4 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different functions. Figure 4 One or at least two components of the system shown.

[0089] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store user behavior attribute data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a character portrait method based on a combined spatiotemporal attention mechanism mentioned in the previous embodiment is implemented.

[0090] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0091] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiment when executing the computer program.

[0092] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiment are implemented.

[0093] In an exemplary embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiment when executed by a processor.

[0094] In an exemplary embodiment, the provided computer program product adopts a two-layer structure. The front end is developed using Vue, which mainly provides an interface for users to interact with the system, including functions such as adding, deleting, modifying, searching and viewing user portrait tags, searching for people, and viewing task details. Administrators only need to perform simple operations to complete complex user tag management and data query tasks. The back end of tag management is developed using the Spring framework, and the database uses Mysql. The back end of portrait generation is developed using Flask, and the database uses neo4j. The architecture diagram of the computer program product is shown in the figure below. Figure 6 The computer program product provided in the embodiment has advantages in performance, scalability, user experience and data processing capability, and can meet the user analysis and management requirements in complex business scenarios.

[0095] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0096] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0097] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0098] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0099] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A character profiling method based on a combined spatiotemporal attention mechanism, characterized in that: include: Acquire user behavior attribute data of the target user; the user behavior attribute data includes a user behavior sequence and a user social relationship network diagram; Using an embedding layer to convert the user behavior attribute data into an embedded vector representation to obtain a comprehensive embedding vector; Using a spatiotemporal attention and a convolutional fusion module to extract a first spatiotemporal relationship feature and a second spatiotemporal relationship feature from the comprehensive embedding vector respectively; The first spatiotemporal relationship feature includes a global time dependency and a local space dependency; the second spatiotemporal relationship feature includes a global space dependency and a local time dependency; Classification and clustering are performed according to the first spatiotemporal relationship feature and the second spatiotemporal relationship feature, a label of the target user is determined, and a character portrait of the target user is generated.

2. The character profiling method based on the combined spatiotemporal attention mechanism according to claim 1, characterized in that: The user social relationship network graph is a directed weighted graph, in which nodes represent different users, edges between nodes represent the relationship between users, and the weight of the edge represents the degree of connection between two users.

3. The character profiling method based on the combined spatiotemporal attention mechanism according to claim 1, characterized in that: The user behavior attribute data is converted into an embedded vector representation using an embedding layer to obtain a comprehensive embedding vector, specifically including: Using an embedding layer, according to the user behavior sequence and the user social relationship network graph, a spatial embedding vector, a periodic time embedding vector, a feature sequence high-dimensional embedding vector and an adaptive embedding vector are extracted; A comprehensive embedding vector is obtained by summing the spatial embedding vector, the periodic time embedding vector, the feature sequence high-dimensional embedding vector and the adaptive embedding vector.

4. The character profiling method based on the combined spatiotemporal attention mechanism according to claim 1, characterized in that: The spatiotemporal attention and convolution fusion module includes a first feature extraction branch and a second feature extraction branch; the first feature extraction branch includes a temporal attention submodule and a spatial convolution submodule; the second feature extraction branch includes a spatial attention submodule and a temporal convolution submodule; the spatiotemporal attention and convolution fusion module is used to extract the first spatiotemporal relationship feature and the second spatiotemporal relationship feature from the comprehensive embedding vector respectively, specifically including: Inputting the comprehensive embedding vector into the temporal attention submodule to extract a first temporal feature containing a global temporal dependency; Inputting the comprehensive embedding vector into the spatial attention submodule to extract a first spatial feature containing a global spatial dependency; Inputting the first time feature into the spatial convolution submodule to extract a first spatiotemporal relationship feature containing a global time dependency relationship and a local spatial dependency relationship; The first spatial feature is input into the time convolution submodule to extract a second spatiotemporal relationship feature containing a local time dependency and a global space dependency.

5. The character profiling method based on the combined spatiotemporal attention mechanism according to claim 4, characterized in that: In the temporal attention submodule, a multi-head attention mechanism is used to capture the global temporal dependency of user behavior sequences over time; in the spatial attention submodule, a self-attention mechanism is used to capture the dynamic global spatial dependency in the user social relationship network graph.

6. The character profiling method based on the combined spatiotemporal attention mechanism according to claim 1, characterized in that: In the spatial convolution submodule, a graph convolutional neural network is used to extract local spatial dependencies; in the temporal convolution submodule, a dilated convolution is used to extract local temporal dependencies.

7. A character portrait system based on a combined spatiotemporal attention mechanism, characterized in that: include: A user behavior attribute data acquisition module, used to acquire user behavior attribute data of a target user; the user behavior attribute data includes a user behavior sequence and a user social relationship network diagram; An embedded vector representation conversion module, used to convert the user behavior attribute data into an embedded vector representation using an embedding layer to obtain a comprehensive embedded vector; A spatiotemporal relationship feature extraction module, configured to respectively extract a first spatiotemporal relationship feature and a second spatiotemporal relationship feature from the comprehensive embedding vector using a spatiotemporal attention module and a convolutional fusion module; The first spatiotemporal relationship feature includes a global time dependency and a local space dependency; the second spatiotemporal relationship feature includes a global space dependency and a local time dependency; A user character portrait generation module is used to classify and cluster according to the first spatiotemporal relationship feature and the second spatiotemporal relationship feature, determine the label of the target user, and generate a character portrait of the target user.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the character portrait method based on the combined spatiotemporal attention mechanism described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the character portrait method based on the combined spatiotemporal attention mechanism described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the character portrait method based on the combined spatiotemporal attention mechanism described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • User portrait optimization method and device based on deep learning and storage medium

    CN112667714A

  • Financial user portraying method based on recurrent neural network and attention mechanism

    CN113468203A

  • Behavior detection method and system based on global spatial-temporal feature learning

    CN117197727A

  • Deep learning-based offline smart home user portrait construction method and system

    CN118093996A

  • Customer portrait key data mining method and system based on space-time big data

    CN118797542A

Cited By

  • Payment label intelligent processing method and system based on multi-dimensional user portraits

    CN121032500A