A user portrait dynamic construction method based on heterogeneous information network and attention gate fusion

By constructing a heterogeneous information network and an attention-gated fusion module, dynamically adjusting the feature fusion weights and performing incremental updates, the problems of data quality differences and consistency in user profiles are solved, and efficient and accurate user profile construction is achieved.

CN122335338APending Publication Date: 2026-07-03四川亿锦企服信息科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
四川亿锦企服信息科技有限公司
Filing Date
2026-04-07
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies fail to adequately consider data quality differences in user profiling, resulting in inaccurate fusion strategies, high computational costs, low update efficiency, and a lack of consistency verification, leading to a decline in profiling accuracy and reliability.

Method used

By constructing a heterogeneous information network, using a heterogeneous graph attention network for feature extraction, and employing an attention-gated fusion module to dynamically adjust the fusion weights, combined with a profile drift detection and incremental update mechanism, adaptive feature fusion and multi-dimensional consistency verification are achieved.

Benefits of technology

It improves the accuracy and efficiency of user profiling, reduces computational costs, ensures the credibility and consistency of profiling, and enhances the real-time performance and accuracy of updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122335338A_ABST
    Figure CN122335338A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for dynamically constructing user profiles based on heterogeneous information networks and attention gating fusion, belonging to the fields of big data processing and artificial intelligence technology. The method includes: collecting and preprocessing user attribute, behavior, and interaction data from multiple data sources; constructing a heterogeneous information network with users, behaviors, attributes, and objects as nodes; defining multiple meta-paths and extracting multi-semantic user feature representations using a two-level attention aggregation mechanism; calculating confidence scores based on feature data completeness and timeliness through an attention gating fusion module, concatenating the confidence scores with the feature representation vectors, and generating adaptive fusion weights through a gating mechanism; and weighted fusion of multi-dimensional features to obtain a comprehensive user profile vector. Furthermore, a profile drift detection mechanism based on a sliding time window can be established to achieve incremental updates, and multi-dimensional consistency checks can be used to ensure the logical consistency of the profile. This invention can adaptively adjust the fusion weights according to data quality, achieving efficient incremental profile updates, and is suitable for scenarios such as precision marketing, personalized recommendations, and risk assessment.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] A method for dynamically constructing user profiles based on the fusion of heterogeneous information networks and attention gating. Technical Field

[0002] This invention belongs to the field of big data processing and artificial intelligence technology, specifically relating to a method for dynamically constructing user profiles based on the fusion of heterogeneous information networks and attention gating. Background Technology

[0003] With the rapid development of the internet and mobile applications, users have generated a large amount of behavioral data on various platforms. How to utilize this data to build accurate and comprehensive user profiles has become a key technical issue in application scenarios such as precision marketing, personalized recommendations, and risk assessment.

[0004] In existing technologies, Wang et al. proposed a node representation learning method based on Heterogeneous Graph Attention Network (HAN) in their paper "Heterogeneous Graph Attention Network" (WWW2019), which can capture semantic associations in heterogeneous graphs through meta-paths. However, when applying this type of method to user profile construction, the following shortcomings still exist: First, existing feature fusion methods, when integrating features from multiple meta-paths or multiple dimensions, typically employ fixed weights or weight allocation methods based on simple attention mechanisms, failing to fully consider the quality differences of feature data across dimensions. In practical applications, data from different dimensions often exhibit differences in completeness and timeliness. For example, some users may have abundant transaction data but sparse social data, and a fixed fusion strategy can lead to a decrease in profile accuracy.

[0005] Second, most existing methods update user profiles by performing a full reconstruction, meaning that each update requires recalculating all dimensions of data. This approach is not only computationally expensive, but also fails to distinguish between the "truly changed parts" and the "stable parts" of user characteristics, resulting in inefficient profile updates.

[0006] Third, existing methods lack a mechanism to verify the consistency within the user profile. When profile tags from multiple dimensions are updated simultaneously, logical contradictions between dimensions may arise. For example, a user's spending power tag may be inconsistent with their spending behavior tag, reducing the credibility of the profile.

[0007] Therefore, a dynamic user profile construction method is needed that can adaptively adjust feature fusion weights, support efficient incremental updates, and ensure consistency within the profile. Summary of the Invention

[0008] Technical issues The technical problem to be solved by this invention is: how to construct a dynamic user profile construction method that can adaptively adjust the fusion strategy according to data quality, support efficient incremental profile updates, and ensure multi-dimensional consistency within the profile.

[0009] Technical solution To address the aforementioned technical problems, this invention provides a method for dynamically constructing user profiles based on the fusion of heterogeneous information networks and attention gating, comprising the following steps: S1. Multi-source heterogeneous data collection: Collect user attribute data, user behavior data, and user interaction data from multiple data sources, and obtain a standardized dataset after preprocessing.

[0010] S2. Construction of Heterogeneous Information Network: Based on the standardized dataset, a heterogeneous information network for users is constructed, with users, behaviors, attributes, and objects as different types of nodes, and the execution relationship between users and behaviors, the attribution relationship between users and attributes, and the interaction relationship between behaviors and objects as different types of edges.

[0011] S3. Heterogeneous Graph Attention Feature Extraction Based on Meta-Paths: Multiple meta-paths are defined in the user heterogeneous information network, and each meta-path represents user association patterns under different semantics. For each meta-path, a heterogeneous graph attention network is used to aggregate the nodes on the path to obtain the user feature representation vector corresponding to each meta-path.

[0012] S4. Attention Gated Fusion: The user feature representation vectors corresponding to the multiple meta-paths are input into the attention gated fusion module. This module calculates the confidence score of each dimension based on the completeness and timeliness of the feature data through the feature confidence evaluation unit. Then, the gate weight generation unit concatenates the confidence scores with the corresponding feature representation vectors and generates adaptive fusion weights for each dimension through a gating mechanism. The user feature representation vectors are then weighted and fused to obtain the comprehensive user profile vector.

[0013] Furthermore, the method may also include: S5. Profile Drift Detection and Incremental Update: Establish a profile drift detection mechanism. Based on a sliding time window, monitor new user behavior data, compare the distribution of user behavior features within the current window with the historical baseline distribution, and use statistical tests to detect whether the user feature distribution has changed significantly. When profile drift is detected, only the feature dimensions that have changed are re-executed for incremental updates in steps S3 and S4, maintaining the stability of the profile for unchanged dimensions.

[0014] S6. Multi-dimensional consistency verification: Perform multi-dimensional consistency verification on the updated user comprehensive profile vector. Check the logical consistency between profile tags of each dimension through preset inter-dimensional constraint rules. When inconsistency is detected, resolve the conflict and output the final user multi-dimensional profile.

[0015] Beneficial effects Compared with the prior art, the beneficial effects of the present invention include: 1. By constructing a heterogeneous information network and utilizing a meta-path-based heterogeneous graph attention network for feature extraction, the complex semantic relationships between different types of data can be fully explored. Compared to simple feature concatenation methods, the constructed user profile is more accurate and comprehensive. In comparative experiments of the embodiments, the method of the present invention improves the profile accuracy by approximately 8-15 percentage points compared to traditional feature concatenation methods.

[0016] 2. Through the feature confidence evaluation and adaptive generation mechanism of the attention gating fusion module, the fusion weights can be dynamically adjusted according to the actual quality (completeness and timeliness) of the feature data in each dimension, which effectively solves the problem of portrait accuracy under the condition of uneven data quality.

[0017] 3. Through the image drift detection and incremental update mechanism, it can automatically identify the changed parts of user features and update them only locally. Compared with the full reconstruction method, the calculation time is reduced by about 60-75%, which improves the real-time performance and efficiency of image updates.

[0018] 4. Through a multi-dimensional consistency verification mechanism, logical contradictions within the profile can be detected and resolved, ensuring the credibility and usability of the output profile. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the overall process of the method described in this invention.

[0020] Figure 2 This is a schematic diagram of the heterogeneous information network described in this invention.

[0021] Figure 3 This is a schematic diagram of the attention-gated fusion module described in this invention.

[0022] Figure 4 This is a schematic diagram of the image drift detection and incremental update process described in this invention. Detailed Implementation

[0023] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0024] Example 1: Building User Profiles for E-commerce Platforms Taking a certain e-commerce platform as an example, the platform has about 5 million registered users, about 800,000 daily active users, and about 20 million browsing behavior records and 500,000 transaction records generated daily.

[0025] Step S1: Multi-source heterogeneous data acquisition Collect user-related data from multiple business systems of the e-commerce platform: (1) User attribute data: including basic information such as user ID, registration time, gender, age group, city, membership level, as well as device information such as device type and operating system version.

[0026] (2) User behavior data: including users’ browsing history on the platform (product ID, category, browsing time), click history (clicked recommendation slots, advertising slots), search history (search keywords, search result clicks), and transaction history (ordered products, payment amount, return and refund records).

[0027] (3) User interaction data: including the following relationships between users, user evaluations and ratings of products, and user posting and interaction behavior in the community.

[0028] The following preprocessing operations are performed on the collected raw data: Data cleaning: Delete obviously abnormal records (such as negative amounts, abnormal timestamps, etc.); Deduplication: Deduplicating duplicate behavior records generated by the same user within a very short period of time (e.g., within 1 second); Standardization processing: Numerical features are normalized using Min-Max and mapped to the [0,1] interval; Categorical features are encoded into d-dimensional dense vectors using Embedding Lookup (d=64 in this embodiment); Temporal features are converted to a unified Unix timestamp format.

[0029] Step S2: Construction of Heterogeneous Information Network Based on the preprocessed standardized dataset, a heterogeneous user information network G = (V, E) is constructed, where: The node set V contains four types of nodes: User node Vu: Each registered user corresponds to one node, and its initial feature is a 64-dimensional vector of its attribute data after Embedding encoding; Behavior Node Vb: Each behavior type (browse, click, search, purchase) corresponds to a behavior node. The initial feature is a 64-dimensional vector obtained by linear transformation of the one-hot encoding of the behavior type. Attribute node Va: Each attribute value (such as "female", "25-30 years old", "Beijing") corresponds to an attribute node. The initial feature is the embedding vector of the attribute value. Object node Vo: Each product corresponds to one object node, and the initial feature is a 64-dimensional vector of product category and price range after Embedding encoding.

[0030] The edge set E contains three types of edges: Execution relationship edge Eub: connects user node and behavior node, indicating that the user has performed a certain behavior; The attribution edge Eua connects a user node and an attribute node, indicating that the user has a certain attribute. Action relationship edge Ebo: connects behavior nodes and object nodes, indicating that the behavior acts on a certain object.

[0031] Each edge is accompanied by a timestamp attribute t, which records the specific time when the relationship occurred.

[0032] Step S3: Extraction of heterogeneous graph attention features based on meta-path Define the following three metapaths: Metapath P1: User → Browse → Product → Browse → User (UBOBU) This path captures the similarity in behavior among users who have viewed the same products.

[0033] Metapath P2: User → Attribute → User (UAU) This path captures connections between users with similar attributes (such as being from the same city or in the same age group).

[0034] Metapath P3: User → Purchase → Product → Attribute (UBOA) This path captures the semantic relationship between user purchasing behavior and product attributes, which is used to infer user preferences.

[0035] For each meta-path, a two-level attention aggregation mechanism is employed: Level 1 – Node-level Attention: For the target user node u, find its meta-path neighbor set NPk(u) based on the meta-path Pk, and calculate the attention weight between the target node and each neighbor: α_uv^Pk = exp(euv_Pk) / sum(s in NPk(u)) exp(eus_Pk) Where hu and hv are the feature vectors of nodes u and v respectively (dimension d=64), W is the learnable linear transformation matrix (dimension d'×d, d'=128 in this embodiment), a is the attention vector (dimension 2d'=256), and the negative slope of LeakyReLU is 0.2.

[0036] In the implementation that introduces a time decay factor, the calculation of attention weight also considers the timestamp information of the edge. Specifically, the time decay factor exp(-γ * (t_current - t_edge)) is multiplied by the attention weight, where γ is the time decay coefficient. In this embodiment, γ = 0.005 / day is taken so that the older the relationship, the smaller the impact on the current profile.

[0037] Attention-weighted aggregation of neighboring nodes yields the feature representation of user u under metapath Pk: zu_Pk = ReLU(sum(v in NPk(u)) α_uv^Pk * W * hv) Level 2 – Semantic Attention: Semantic attention fusion is performed on user representations obtained from different meta-paths. β_Pk = exp(qT * tanh(Ws * zu_Pk + bs)) / sum(Pj) exp(qT * tanh(Ws *zu_Pj + bs)) zu = sum(k) β_Pk * zu_Pk Where q (dimension d'=128), Ws (dimension d'×d'), and bs (dimension d') are all learnable parameters. The final result is a user feature representation vector zu (dimension 128) that integrates semantic information from multiple meta-paths.

[0038] Step S4: Attention Gated Fusion In this embodiment, user features are divided into three dimensions: attribute dimension feature h1 (from meta path P2), behavior dimension feature h2 (from meta path P1), and preference dimension feature h3 (from meta path P3), with each dimension feature vector having a dimension of 128.

[0039] (1) Feature confidence assessment: For each dimension i, calculate its confidence score: Ci = μ * Ri + ν * Ti Where Ri represents the data completeness of the i-th dimension (defined as the ratio of the number of non-missing data points in this dimension to the total number of data points, ranging from [0,1]), and Ti represents the timeliness index (defined as the value mapped by an exponential decay function based on the time interval between the most recent data update in this dimension and the current time, specifically Ti = exp(-λ * Δtᵢ), where Δtᵢ is the time interval in days, and λ is the decay rate, which is taken as 0.02 / day in this embodiment). In this embodiment, mu = 0.6 and ν = 0.4, meaning that the importance of data completeness is slightly higher than that of timeliness.

[0040] Specific calculation example: User A's attribute dimensions: There are 20 fields in total, 18 of which have values, so R1 = 18 / 20 = 0.90; the attribute data was last updated 2 days ago, T1 = exp(-0.02 * 2) = 0.961. Therefore, C1 = 0.6 × 0.90 + 0.4 × 0.961 = 0.924.

[0041] The user's behavioral dimensions: There are 15 fields in total, 10 of which have values ​​(some behavioral types have never occurred), R² = 10 / 15 = 0.667; the behavioral data was last updated 1 day ago, T² = exp(-0.02 * 1) = 0.980. Therefore, C² = 0.6 × 0.667 + 0.4 × 0.980 = 0.792.

[0042] The user's preference dimensions: There are 12 fields in the preference data, of which 5 have values ​​(this user has relatively few purchasing behaviors), R3 = 5 / 12 = 0.417; the preference data was last updated 14 days ago, T3 = exp(-0.02 * 14) = 0.756. Therefore, C3 = 0.6 × 0.417 + 0.4 × 0.756 = 0.553.

[0043] As can be seen, the confidence level of the attribute dimension (0.924) is significantly higher than that of the preference dimension (0.553). Therefore, the attribute dimension will receive a higher fusion weight in the subsequent gating fusion.

[0044] (2) Generation and fusion of gating weights: Input the feature vectors and confidence scores of each dimension into the gated network: gi = σ(Wg * [hi ; Ci] + bg) Where [hi; Ci] represents concatenating the 128-dimensional feature vector hi with the scalar confidence score Ci to form a 129-dimensional vector, Wg is the learnable weight matrix (dimension 1×129), bg is the bias term, and σ is the sigmoid activation function.

[0045] wi = exp(gi) / sum(j=1,3) exp(gj) Pu = sum(i=1,3) wi * hi Where Pu is the comprehensive profile vector (128 dimensions) of user u. Since the confidence of the attribute dimensions is higher, their fusion weight will be increased accordingly to ensure that high-quality data occupies a larger proportion in the profile.

[0046] Step S5: Image drift detection and incremental update (1) Drift detection: Set the sliding time window size W = 7 days. At the end of each window period, calculate the distribution Dcurrent of user behavior characteristics in each dimension within that window and compare it with the historical baseline distribution Dbaseline.

[0047] Discretization of the distribution: For category-based features (such as browsing categories), frequency distribution is calculated by category; for numerical features (such as spending amount), frequency distribution is calculated by equal-width bins (10 bins in this embodiment). For cases where a category has a probability of 0 in the baseline distribution but appears in the current distribution (such as a new category), Laplace smoothing is used, that is, the frequency of each category in the baseline distribution is normalized by adding a smoothing constant epsilon=1e-6.

[0048] KL divergence is used to measure distributional dissimilarity. When the KL divergence exceeds a preset threshold θ, it is determined that image drift has occurred in that dimension. In this embodiment, θ = 0.15.

[0049] Specific test examples: User A's browsing category distribution over the past 7 days changed from the baseline distribution of "electronics 70%, clothing 20%, food 10%" to the current distribution of "baby products 60%, electronics 25%, clothing 15%". After Laplace smoothing, the calculated KL divergence is 0.82, which far exceeds the threshold of 0.15, indicating that the behavioral dimension has drifted.

[0050] User A's attribute dimension distribution remained basically unchanged during the same period (KL divergence = 0.03, below the threshold of 0.15), indicating that the attribute dimensions did not drift.

[0051] In the case of near-threshold boundary conditions: if a user's browsing distribution changes only slightly (e.g., "electronics 65%, clothing 25%, food 10%" becomes "electronics 55%, clothing 30%, food 15%"), the KL divergence is approximately 0.12, which is lower than the threshold of 0.15. Therefore, it is determined that there is no drift and the profile remains unchanged.

[0052] (2) Incremental update: Only for the drifting behavior dimension, the relevant calculations in steps S3 and S4 are re-executed. This involves re-collecting data related to that dimension, updating the corresponding edges in the heterogeneous information network, and re-aggregating node-level attention along the relevant meta-paths to generate the updated behavior dimension feature representation h2', which then replaces the corresponding component in the comprehensive profile vector. The attribute and preference dimensions remain unchanged from their original profiles to avoid unnecessary duplication of calculations.

[0053] (3) Historical baseline distribution update: After the incremental update is completed, the feature distribution of the current window is updated to the new historical baseline distribution, i.e., Dbaseline← Dcurrent, which serves as the comparison benchmark for drift detection in the next window period.

[0054] Step S6: Multi-dimensional consistency verification Perform consistency checks on the updated profile. Inter-dimensional constraints are expressed in a "condition → conclusion" logical format, specifically including: (1) Attribute consistency constraint: Validate the logical compatibility between user-defined static attribute tags. For example: Rule A1: IF Age Range = "18-25 years old" THEN Education NOT IN {"Retirement", "Postdoctoral"} Rule A2: IF Membership Level = "New User" THEN Registration Duration <= 30 days (2) Behavioral consistency constraint: Validate the reasonableness between user behavior tags and attribute tags. For example: Rule B1: IF Spending Power Tag = "High" THEN High-Value Item Purchase Ratio in the Last 30 Days >= 20% Rule B2: IF Activity Tag = "High Activity" THEN Login Count in the Last 7 Days >= 3 (3) Temporal consistency constraint: Verify whether the temporal evolution of the user profile conforms to a reasonable trend. For example: Rule T1: IF No downgrade event recorded for member level THEN Member level >= Previous member level Rule T2: If the change in credit label exceeds Level 2, it will be marked as abnormal and requires manual review. Conflict resolution algorithm: When a constraint rule is detected to be violated, the following conflict resolution steps are performed: (a) Identify the set of dimensions involved in the conflict and determine the specific label pairs that are in conflict; (b) Compare the confidence scores Ci for each of the conflict dimensions; (c) Retain the dimension labels with higher confidence scores unchanged; (d) For dimension labels with low confidence scores, correct them according to the preset label mapping table. The label mapping table is a set of predefined rules that "when label X conflicts with label Y, correct label X to label Z". For example, when "spending power = high" conflicts with "no purchase records in the last 30 days", if the confidence score of the behavioral dimension is higher, then the spending power label will be corrected to "medium". (e) When there is a chain of conflicts (such as A and B conflicting, B and C conflicting), resolve them in order of confidence from high to low. That is, first fix the dimension label with the highest confidence, and then correct the other conflicting labels in turn.

[0055] The final output is a multi-dimensional user profile that has passed consistency verification, including: a set of user attribute tags (stored in key-value pairs), a set of user behavior preference tags (stored in key-value pairs), and a comprehensive user profile vector Pu (a 128-dimensional floating-point vector that can be used by downstream models). This profile can be used by downstream applications such as recommendation systems, marketing systems, and risk control systems.

[0056] Model training In this embodiment, the learnable parameters involved in steps S3 and S4 include: the linear transformation matrix W, the attention vector a, the semantic-level attention parameters q / Ws / bs, and the gating network parameters Wg / bg. These parameters are trained end-to-end in the following manner: (1) Training data construction: Training samples are constructed from historical data of the e-commerce platform. A self-supervised approach is adopted, using the user's future behavior as the supervision signal—specifically, the user's data within time period T1 is used as input to construct a profile, and the actual behavior within time period T2 (T2 is later than T1) is used as the label. For example, a profile is constructed using data from the first 30 days to predict the user's click behavior from day 31 to 37.

[0057] (2) Loss function: A multi-task joint loss function is adopted: L = L_pred + eta * L_reg Where L_pred is the cross-entropy loss of the downstream prediction task (such as the cross-entropy of binary classification for click-through rate prediction), L_reg is the L2 regularization term to prevent overfitting, and eta is the regularization coefficient, which is taken as eta=1e-4 in this embodiment.

[0058] (3) Optimizer and hyperparameters: The Adam optimizer was used with a learning rate of 1e-3 and a cosine annealing learning rate scheduling strategy. The batch size was set to 512 and the number of training epochs was set to 50. An early stopping strategy was adopted, and training was stopped when the loss on the validation set did not decrease for 5 consecutive epochs.

[0059] (4) Parameter processing during incremental updates: When image drift is detected in step S5 and incremental updates are performed, the model parameters are not retrained. Instead, the pre-trained parameters are used to perform forward inference on the data in the drift dimension, and only the feature representation vector of that dimension is updated. The full update of model parameters is performed regularly according to a preset period (e.g., once a month).

[0060] Comparative experimental results The comparison results between the method of this invention and the baseline method on the aforementioned e-commerce platform data are as follows: The accuracy of the portrait is measured by the AUC metric of the downstream click-through rate prediction task. As can be seen, the method of this invention improves the accuracy by about 11 percentage points compared with the traditional method, and by about 5 percentage points compared with the attention fusion method without confidence; in terms of update efficiency, the incremental update method reduces the computation time by about 72% compared with full reconstruction (15.1 seconds of the HAN method).

[0061] Parameter sensitivity analysis The influence of the confidence weighting coefficient mu (ν = 1 - μ): As can be seen, the effect is optimal when mu=0.6, which indicates that data integrity is slightly more important than timeliness in e-commerce scenarios, but the difference between the two is not significant.

[0062] The effect of drift detection threshold θ: Example 2: Building User Credit Profiles for Fintech Platforms For example, a certain fintech platform has about 2 million registered users and provides consumer loans and installment services.

[0063] Step S1: Multi-source heterogeneous data acquisition (1) User attribute data: User real-name authentication information (age, gender, occupation, income range), address information, and education information.

[0064] (2) User behavior data: loan application records (application time, application amount, approval result), repayment records (repayment time, repayment amount, whether overdue), and browsing behavior within the platform (type of products viewed, comparison behavior).

[0065] (3) User interaction data: communication records between users and customer service, user recommendation relationships (recommendation registration link relationship).

[0066] The preprocessing method is the same as in Example 1, except that the embedding dimension of the categorical features is also set to d=64.

[0067] Step S2: Construction of Heterogeneous Information Network A heterogeneous information network for financial scenarios is constructed, with node types including: user nodes (each registered user), behavior nodes (behaviors such as application, repayment, and browsing), attribute nodes (attribute values ​​such as occupation category, income range, and education level), and object nodes (various financial products). Edge types and timestamp processing methods are the same as in Example 1.

[0068] Step S3: Extraction of heterogeneous graph attention features based on meta-path Defining the meta-path of financial scenarios: Metapath P1: User → Application → Loan Product → Application → User (Capturing the similarity of users who have applied for the same product) Metapath P2: User → Attribute → User (capturing user associations with the same occupation and income range) Meta-path P3: User → Repayment → Loan Product → Attribute (Capturing the relationship between user repayment behavior and product attributes) The attention aggregation process is the same as in Example 1, with the same parameter settings (d=64, d'=128, LeakyReLU negative slope 0.2). In the financial scenario, the time decay coefficient γ is set to 0.003 / day, making the time decay smoother than in the e-commerce scenario (because the long-term impact of financial behavior is more persistent).

[0069] Step S4: Attention Gated Fusion The feature dimensions of financial scenarios are divided into: basic credit dimension (meta-path P2 from attribute data), behavioral credit dimension (meta-path P1 from repayment behavior data), and relational credit dimension (meta-path P3 from recommendation relationships).

[0070] In confidence level calculation, timeliness is more important in financial scenarios (because the timeliness of overdue behavior directly affects credit assessment), so we take mu=0.4 and ν=0.6. The decay rate λ is taken as 0.01 / day (the timeliness decay of financial data is slower than that of e-commerce scenarios).

[0071] Specific calculation example: User B's basic credit dimensions: attribute data completeness R1 = 0.95, last updated 5 days ago, T1 = exp(-0.01 * 5) = 0.951. C1 = 0.4 × 0.95 + 0.6 × 0.951 = 0.951.

[0072] The user's behavioral credit dimension: repayment data completeness R2 = 0.80 (some historical records are missing), the most recent repayment was 3 days ago, T2 = exp(-0.01 * 3) = 0.970. C2 = 0.4 × 0.80 + 0.6 × 0.970 = 0.902.

[0073] The user's relationship credit dimension: Recommendation relationship data completeness R3 = 0.30 (most users have no recommendation relationships), the most recent relationship update was 60 days ago, T3 = exp(-0.01 * 60) = 0.549. C3 = 0.4 × 0.30 + 0.6 × 0.549 = 0.449.

[0074] The gating fusion process is the same as in Example 1.

[0075] Step S5: Image drift detection and incremental update In financial scenarios, drift detection focuses on changes in behavioral credit dimensions, as sudden changes in repayment behavior may indicate credit risk. The sliding window size is set to W=30 days to match the repayment cycle of loan products. The KL divergence threshold is set to θ=0.12 (lower than in e-commerce scenarios, to more sensitively capture changes in financial risk).

[0076] The incremental update method is the same as in Example 1.

[0077] Step S6: Multi-dimensional consistency verification Constraints specific to financial scenarios: Rule F1: IF Credit Rating = "Excellent" THEN Number of Delinquencies in the Last 12 Months = 0 Rule F2: IF Income Range = "below 5000" AND Application Amount > 100000 THEN Mark as Abnormal Rule F3: IF Repayment Behavior Label = "On-Time Payment" THEN Number of Overdue Payments in the Last 6 Months <= 1 The conflict resolution method is the same as in Example 1. The final output is a user credit profile, which can be used for loan approval decisions, risk warnings, and differentiated pricing.

[0078] Model training The training method is the same as in Example 1, except that the downstream prediction task is overdue prediction (binary classification), and the loss function is weighted cross-entropy (overdue samples are given higher weights to handle class imbalance, with a positive to negative sample weight ratio of 5:1). The learning rate is set to 5e-4, and the number of training rounds is 30.

[0079] Example 3: Building User Interest Profiles for Content Platforms Taking a content recommendation platform (such as a news or short video platform) as an example, the platform has approximately 3 million daily active users and approximately 100 million daily content views.

[0080] Step S1: Multi-source heterogeneous data acquisition (1) User attribute data: registration information, device information, and geographical location information.

[0081] (2) User behavior data: content browsing records (content ID, category, browsing duration, completion rate), likes / favorites / shares, and comments.

[0082] (3) User interaction data: user follow relationships, user interactions (comment replies, private messages).

[0083] The preprocessing method is the same as in Example 1.

[0084] Steps S2-S3 Construct a heterogeneous information network for content scenarios, with node types including users, behaviors, attributes, and content. Meta-path design revolves around users' content consumption patterns: Metapath P1: User → Browse → Content → Browse → User (captures user associations for browsing the same content) Metapath P2: User → Attribute → User (captures user associations with similar attributes) Meta-path P3: User → Like → Content → Category (Capturing the relationship between user preferences and content categories) The attention aggregation process is the same as in Example 1. In the content scenario, the time decay coefficient γ is set to 0.01 / day (the timeliness of content consumption behavior decays relatively quickly).

[0085] Step S4: Attention Gated Fusion The feature dimensions are divided into: demographic attributes (from P2), immediate interests (from P1, reflecting short-term behavior), and long-term preferences (from P3, reflecting historical cumulative behavior).

[0086] Timeliness is the most critical factor in content platforms (user interests change rapidly), therefore we set mu=0.3 and ν=0.7. The decay rate λ is set to 0.05 / day (interest data decays the fastest in terms of timeliness).

[0087] Specific calculation example: For user C, the demographic dimension is: R1 = 0.85, last updated 1 day ago, T1 = exp(-0.05 * 1) = 0.951. C1 = 0.3 × 0.85 + 0.7 × 0.951 = 0.921.

[0088] Real-time interest dimension: R2 = 0.90, last updated 0.5 days ago, T2 = exp(-0.05 * 0.5) = 0.975. C2 = 0.3 × 0.90 + 0.7 × 0.975 = 0.953.

[0089] Long-term preference dimension: R3 = 0.70, last updated 7 days ago, T3 = exp(-0.05 * 7) = 0.705. C3 = 0.3 × 0.70 + 0.7 × 0.705 = 0.704.

[0090] In content scenarios, the confidence level of the real-time interest dimension is the highest, and it plays a dominant role in the integration process.

[0091] Steps S5-S6 The interests of users on content platforms change rapidly. The sliding window size is set to W=3 days, and the KL divergence threshold is set to θ=0.10 (more sensitive than e-commerce and financial scenarios).

[0092] Example of consistency constraint rules: Rule C1: IF Activity Tag = "High Activity" THEN Last 3 Days Views >= 10 Rule C2: If the interest tag contains "finance" AND age group = "under 12" then it is marked as abnormal. The conflict resolution method is the same as in Implementation Example 1. The final output is a user interest profile, including immediate interest tags, long-term preference tags, and profile vectors, which can be used by the content recommendation engine.

[0093] Model training The training method is the same as in Example 1, except that the downstream prediction task is content click-through rate prediction, and the loss function is standard binary classification cross-entropy. The learning rate is set to 2e-3, the batch size is 1024, and the number of training epochs is 20 (the content platform has a large amount of data, resulting in faster convergence). The model parameters are fully updated once a week (more frequently than in e-commerce and financial scenarios because the data distribution in the content domain changes more rapidly).

Claims

1. A user portrait dynamic construction method based on heterogeneous information network and attention gate fusion, characterized in that, Includes the following steps: S1. Multi-source heterogeneous data collection: Collect user attribute data, user behavior data and user interaction data from multiple data sources, and obtain a standardized dataset after preprocessing; S2. Construction of Heterogeneous Information Network: Based on the standardized dataset, a heterogeneous user information network is constructed, with users, behaviors, attributes, and objects as different types of nodes, and the execution relationship between users and behaviors, the attribution relationship between users and attributes, and the interaction relationship between behaviors and objects as different types of edges. S3. Heterogeneous Graph Attention Feature Extraction Based on Meta-Paths: Multiple meta-paths are defined in the heterogeneous user information network, each representing a user association pattern under different semantics. For each meta-path, a heterogeneous graph attention network is used to aggregate the nodes on the path to obtain the user feature representation vector corresponding to each meta-path. S4. Attention Gated Fusion: The user feature representation vectors corresponding to the multiple meta-paths are input into the attention gated fusion module. The attention gated fusion module calculates the confidence score of each dimension based on the completeness and timeliness of the feature data of each dimension through the feature confidence evaluation unit. Then, the gated weight generation unit concatenates the confidence score with the corresponding feature representation vector and generates adaptive fusion weights for each dimension feature through a gating mechanism. The user feature representation vectors are then weighted and fused to obtain the comprehensive user profile vector.

2. The method according to claim 1, characterized in that, It also includes step S5, profile drift detection and incremental update: establish a profile drift detection mechanism, monitor new user behavior data based on a sliding time window, compare the distribution of user behavior features in the current window with the historical baseline distribution, and use statistical test methods to detect whether the distribution of user features has changed significantly; When image drift is detected, incremental updates are performed only on the feature dimensions that have changed, re-executing the relevant calculations in steps S3 and S4 to maintain the image stability of the unchanged dimensions.

3. The method according to claim 1 or 2, characterized in that, The process also includes step S6, multi-dimensional consistency verification: performing multi-dimensional consistency verification on the updated user comprehensive profile vector, checking the logical consistency between profile labels of each dimension through preset inter-dimensional constraint rules, the inter-dimensional constraint rules including at least one of attribute consistency constraints, behavior consistency constraints and temporal consistency constraints; when inconsistency is detected, comparing the confidence scores of conflicting dimensions, retaining the profile labels of dimensions with higher confidence scores, correcting the profile labels of dimensions with lower confidence scores according to a preset label mapping table, and outputting the final user multi-dimensional profile.

4. The method according to claim 1, characterized in that, In step S2, the construction of the heterogeneous information network further includes: assigning a timestamp attribute to each edge to record the time when the relationship occurs, forming a temporal heterogeneous information network; in step S3, the heterogeneous graph attention network introduces a time decay factor when calculating the attention weights between nodes, so that the attention weights corresponding to relationships with larger time intervals are lower.

5. The method according to claim 1, characterized in that, In step S3, the meta-path includes: (1) user-behavior-object-behavior-user path, used to capture user associations with similar behavioral preferences; (2) user-attribute-user path, used to capture user associations with the same attribute features; (3) user-behavior-object-attribute path, used to capture semantic associations between user behavioral preferences and object attributes.

6. The method according to claim 5, characterized in that, In step S3, the aggregation process of the heterogeneous graph attention network includes: firstly, using node-level attention, performing attention-weighted aggregation on neighboring nodes under the same meta-path to obtain node-level feature representations under each meta-path; then, using semantic-level attention, performing attention-weighted fusion on the node-level feature representations obtained from different meta-paths to obtain a user feature representation vector containing multiple semantic information.

7. The method according to claim 1, characterized in that, In step S4, the feature confidence evaluation unit calculates the confidence score as follows: Cᵢ = μ·Rᵢ + ν·Tᵢ, where Cᵢ is the confidence score of the i-th feature; Rᵢ is the completeness index of the i-th feature data, which is the ratio of the amount of non-missing data in this dimension to the total amount of data; Tᵢ is the timeliness index of the i-th feature data, which is calculated based on the time interval Δtᵢ between the most recent data update time of this dimension and the current time using the time decay function Tᵢ = exp(-λ·Δtᵢ), where λ is the decay rate; μ and ν are preset weight coefficients and μ + ν = 1; the gating weight generation unit concatenates the i-th feature representation vector hᵢ with the confidence score Cᵢ and generates a gating value gᵢ through a sigmoid-activated gating network, and then obtains the fusion weight wᵢ of each dimension through softmax normalization.

8. A user profile dynamic construction system based on the fusion of heterogeneous information networks and attention gating, characterized in that, include: The multi-source heterogeneous data acquisition module is used to collect user attribute data, user behavior data, and user interaction data from multiple data sources, and obtain a standardized dataset after preprocessing. The heterogeneous information network construction module is used to construct a user heterogeneous information network based on the standardized dataset, with users, behaviors, attributes, and objects as different types of nodes, and the execution relationship between users and behaviors, the attribution relationship between users and attributes, and the interaction relationship between behaviors and objects as different types of edges. The feature extraction module is used to extract features from the heterogeneous user information network based on multiple meta-paths using a heterogeneous graph attention network, and obtain the user feature representation vector corresponding to each meta-path. The attention-gated fusion module includes a feature confidence evaluation unit and a gating weight generation unit. It is used to calculate the confidence score based on the completeness and timeliness of the feature data of each dimension, and then concatenate the confidence score with the corresponding feature representation vector and generate adaptive fusion weights for each dimension feature through a gating mechanism. The user feature representation vectors are then weighted and fused to obtain a comprehensive user profile vector.

9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.