E-commerce user repurchase behavior prediction method and system fusing timing attention mechanism

By integrating a temporal attention mechanism to construct a method for predicting user repurchase behavior, this method addresses the shortcomings of existing technologies in predicting e-commerce user repurchase behavior. It enables dynamic feature recognition and cross-cycle offset analysis of user behavior, thereby improving the accuracy of repurchase prediction and operational effectiveness.

CN122022900BActive Publication Date: 2026-07-21HANGZHOU DUOYI NETWORK TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU DUOYI NETWORK TECHNOLOGY CO LTD
Filing Date
2026-04-16
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies fail to fully explore the temporal sequence, stage-specific changes, and inter-behavioral relationships in predicting e-commerce user repurchase behavior. This results in insufficient ability to represent true consumer intent, and the prediction results are not closely linked to marketing execution, affecting actual operational effectiveness.

Method used

A fusion temporal attention mechanism is adopted. By acquiring the user's historical behavior sequence, a temporal enhanced behavior representation sequence is constructed. A multi-head attention network is used to perform weighted calculations based on the behavior temporal proximity relationship, behavior type conversion relationship and product semantic similarity relationship. Combined with cross-cycle offset analysis, repeat purchase scores and offset risk labels are generated.

Benefits of technology

It improves the ability to identify changes in user behavior stages, enhances the synergy between repurchase judgment results and operational outreach, and can more accurately identify changes in user interests and potential repurchase tendencies, thereby improving the refined operation effect of e-commerce platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122022900B_ABST
    Figure CN122022900B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of e-commerce user behavior analysis, and particularly relates to an e-commerce user repurchase behavior prediction method and system fusing a time sequence attention mechanism. The method acquires a historical behavior sequence of a target user in a preset statistical period, extracts a behavior type, a behavior occurrence time and commodity information, constructs a time sequence enhanced behavior representation sequence containing a relative time difference of adjacent behaviors and a time interval from a latest purchase behavior, performs multi-head weighted processing based on a behavior time proximity relationship, a behavior type conversion relationship and a commodity semantic similarity relationship to obtain a user purchase intention vector; further performs cross-period offset analysis in combination with a historical purchase intention vector of a previous statistical period, generates a repurchase score and an offset risk label according to an analysis result, and outputs a repurchase prediction result. The application can simultaneously represent current behavior characteristics and cross-period interest migration states of a user, and improves the dynamic nature and distinguishability of repurchase identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of e-commerce user behavior analysis, specifically involving a method and system for predicting e-commerce user repurchase behavior by integrating a temporal attention mechanism. Background Technology

[0002] With the continuous development of e-commerce platforms, users accumulate a large amount of behavioral data during browsing, clicking, adding to favorites, adding to cart, placing orders, reviewing, and after-sales service. This makes data analysis-based identification of user consumption preferences and marketing decision support an important research direction in the e-commerce field. Among these, predicting user repurchase behavior is a key component of refined user operations, and its results directly affect merchants' assessment of user lifetime value, the efficiency of marketing resource allocation, and the overall conversion performance of the platform. Modeling and analyzing user repurchase probability and conducting differentiated user management accordingly has gradually become an important part of the intelligent e-commerce operation system.

[0003] In existing technologies, the analysis of e-commerce user repurchase behavior is typically based on users' historical order records, product browsing history, visit frequency, dwell time, add-to-cart and favorites status, promotional response, and basic user profile information. It employs rule-based filtering, statistical analysis, or machine learning modeling to determine whether users have a tendency to repurchase. Some solutions construct user tagging systems to classify and manage highly active users, high-value users, or users at risk of churn; others introduce regression models, tree models, or neural network models to calculate repurchase probabilities and use the prediction results for marketing outreach scenarios such as coupon distribution, SMS push notifications, and in-app message reminders.

[0004] However, the above technical approaches still have the following main technical problems: First, they do not fully explore the temporal sequence, stage change characteristics, and inter-behavioral correlations in user behavior sequences, and tend to statically process discrete behaviors, resulting in insufficient representation of true consumption intentions; second, they lack effective differentiation of the importance of behavioral information under different time windows, making it difficult to accurately identify key behavioral signals that have a stronger impact on repurchase results; and third, the prediction results are often not closely linked to subsequent outreach strategies, resulting in a disconnect between prediction and marketing execution, which affects the application effect and conversion value of repurchase prediction results in actual operational scenarios.

[0005] Therefore, it is necessary to provide a user repurchase behavior prediction solution for e-commerce scenarios to improve the ability to identify dynamic user behavior characteristics, enhance the synergy between repurchase judgment results and operational outreach, and thus better meet the development needs of refined operation of e-commerce platforms. Summary of the Invention

[0006] To address the aforementioned problems, the present invention aims to propose a method for predicting e-commerce user repurchase behavior by incorporating a temporal attention mechanism, comprising the following steps: S1. Obtain the historical behavior sequence of the target user within a preset statistical period, and extract the behavior type, behavior occurrence time and product information corresponding to each behavior; S2. Convert each behavior in the historical behavior sequence into a basic behavior representation, and perform time enhancement processing on the basic behavior representation based on the relative time difference between adjacent behaviors and the time interval between each behavior and the most recent purchase behavior to construct a time-enhanced behavior representation sequence. S3. Input the time-series enhanced behavior representation sequence into a multi-head attention network. Different attention heads independently perform weighted calculations based on behavior temporal proximity, behavior type transformation, and product semantic similarity. The output results of each attention head are then fused to obtain the user purchase intent vector for the current statistical period. S4. Extract the historical purchase intent vector of the target user in the previous statistical period, and perform cross-period offset analysis between the user purchase intent vector in the current statistical period and the historical purchase intent vector in the previous statistical period. The cross-period offset analysis includes at least vector similarity calculation, vector offset calculation and vector offset direction determination. S5. Input the cross-cycle offset analysis results and the user purchase intent vector of the current statistical period into the repurchase score generation step to generate the corresponding repurchase score and offset risk label. S6. Based on the comparison result between the repurchase score and the preset threshold, and in conjunction with the offset risk marker, output the repurchase prediction result of the target user.

[0007] As a preferred technical solution, in step S2, the construction method of the temporal enhanced behavior representation sequence includes: mapping behavior type to behavior type vector; mapping product information to product semantic vector; mapping the relative time difference between adjacent behaviors and the time interval from the most recent purchase behavior to time encoding vectors respectively; and fusing the behavior type vector, product semantic vector and the two time encoding vectors to obtain the temporal enhanced behavior representation of the corresponding behavior.

[0008] As a preferred technical solution, in step S2, the relative time difference between adjacent behaviors is segmented and encoded according to multiple time intervals, the time interval from the most recent purchase behavior is hierarchically encoded according to a preset post-purchase follow-up stage, and the relative time difference and the time interval from the most recent purchase behavior are used as two independent time references to participate in the construction of the temporal enhanced behavior representation.

[0009] As a preferred technical solution, in step S3, the multi-head attention network includes a temporal relationship attention head, a behavioral transformation attention head, and a product semantic attention head; The time relationship attention head calculates the time relationship weight based on the time interval between each behavior, and then performs a weighted sum of the time-series enhanced behavior representations of each behavior according to the time relationship weight to obtain the time relationship feature vector; The behavior conversion attention head calculates the behavior conversion weight based on the conversion order between each behavior type, and then weights and sums the temporal enhancement behavior representations of each behavior according to the behavior conversion weight to obtain the behavior conversion feature vector; The product semantic attention head calculates the product semantic weight based on the semantic similarity between each product information, and then weights and sums the temporal enhanced behavior representations of each behavior according to the product semantic weight to obtain the product semantic feature vector; The time relationship feature vector, behavior conversion feature vector, and product semantic feature vector are then concatenated in a preset order, and the concatenated result is linearly transformed to obtain the user purchase intent vector for the current statistical period.

[0010] As a preferred technical solution, step S4, the cross-cycle offset analysis includes the following steps: S41. Calculate the cosine similarity between the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period. S42. Calculate the vector offset of the user purchase intent vector in the current statistical period relative to the historical purchase intent vector in the previous statistical period. S43. Determine the vector offset direction based on the coordinate difference between the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period. S44. Output the cosine similarity, the vector offset, and the vector offset direction as the cross-period offset analysis results.

[0011] As a preferred technical solution, in step S5, the generation method of the repurchase score and offset risk marker includes: The values ​​of each dimension of the user purchase intent vector in the current statistical period, along with the cosine similarity and the vector offset, are arranged in a preset order to form a scoring input sequence. The scoring input sequence is then weighted and summed to obtain an initial repurchase score. The initial repurchase score is corrected according to the vector offset direction to obtain the corrected repurchase score; When the vector offset is higher than the first threshold and the cosine similarity is lower than the second threshold, an offset risk marker is generated. When the vector offset is lower than or equal to the first threshold, or the cosine similarity is higher than or equal to the second threshold, the offset risk marker is removed, and the corrected repurchase score is output as the repurchase score.

[0012] As a preferred technical solution, the cross-cycle migration analysis further includes continuous cycle stability analysis, which includes the following steps: Obtain the vector offset direction for two consecutive statistical periods; When the vector offset direction reverses for two consecutive statistical periods, the risk level corresponding to the offset risk marker is increased. When the cosine similarity of two consecutive statistical periods is higher than the second threshold and the vector offset is lower than the first threshold, the risk level corresponding to the offset risk label is reduced.

[0013] As a preferred technical solution, in step S6, the repurchase prediction result includes at least the repurchase judgment result, the repurchase score, and the dominant product category. The dominant product category is determined based on the semantic weight of each product category in the current statistical period.

[0014] This invention also provides an e-commerce user repurchase behavior prediction system that integrates a temporal attention mechanism, used to implement the method, including: The behavior acquisition unit is used to acquire the historical behavior sequence of the target user within a preset statistical period, and extract the behavior type, behavior occurrence time and product information corresponding to each behavior; The temporal augmentation representation building unit is used to perform temporal augmentation processing on the basic behavior representation based on the relative time difference between adjacent behaviors and the time interval between each behavior and the most recent purchase behavior, to generate a temporal augmentation behavior representation sequence; The multi-head relationship modeling unit is used to independently weight the temporal enhanced behavior representation sequence based on behavior temporal proximity relationship, behavior type transformation relationship and product semantic similarity relationship, and generate the user purchase intent vector for the current statistical period. The cross-period offset analysis unit is used to perform vector similarity calculation, vector offset calculation and vector offset direction determination on the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period, and output the cross-period offset analysis results. The rating generation unit is used to generate a repeat purchase rating and an offset risk label based on the cross-period offset analysis results and the user purchase intent vector of the current statistical period. The result output unit is used to output the repurchase prediction result of the target user based on the comparison result of the repurchase score and the preset threshold, and in combination with the offset risk mark.

[0015] As a preferred technical solution, the multi-head relationship modeling unit includes a time relationship weighted sub-unit, a behavior transformation weighted sub-unit, and a product semantic weighted sub-unit; The cross-cycle offset analysis unit includes a similarity calculation subunit, an offset calculation subunit, an offset direction determination subunit, and a continuous cycle stability analysis subunit. The scoring generation unit includes an initial scoring generation subunit and a risk adjustment subunit.

[0016] The beneficial effects of this invention are as follows: Compared to technical approaches that rely solely on static features or the number of simple actions to determine repeat purchases, this invention incorporates the relative time difference between adjacent actions and the time interval between each action and the most recent purchase into the behavior representation construction process. This allows user history to not only retain behavior type and product information but also reflect the rhythm of behavior occurrence and the evolution of post-purchase revisits. Consequently, it can more precisely distinguish different behavioral states such as high-frequency browsing, delayed revisits, and near-purchase, improving the ability to identify changes in user behavior stages.

[0017] This invention separates and models temporal proximity relationships, behavioral conversion chains, and product semantic associations within a multi-head attention network before fusing them, avoiding the mixing of behavioral associations from different sources. This allows for the extraction of behavioral features that contribute differentiatedly to repeat purchase prediction from multiple dimensions, resulting in a user purchase intent vector that better reflects the user's true interest focus and potential repeat purchase tendency within the current statistical period.

[0018] This invention, after obtaining the user purchase intent vector for the current statistical period, further incorporates historical purchase intent vectors from the previous statistical period for cross-period offset analysis. It then combines vector similarity, vector offset, and vector offset direction to generate a repurchase score and offset risk marker, focusing not only on the strength of current intent but also on the trend of intent change. This allows for the identification of users who appear active but whose interests have shifted, as well as users with short-term fluctuations but overall stability, thus giving repurchase prediction results a stronger dynamic discriminative ability. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the method flow of the present invention; Figure 2 This is a schematic diagram of the system structure of the present invention. Detailed Implementation

[0020] To enhance understanding of the present invention, the present invention will be further described in detail below with reference to embodiments. These embodiments are only used to explain the present invention and do not constitute a limitation on the scope of protection of the present invention. Example

[0021] according to Figure 1 As shown, this embodiment provides a method for predicting e-commerce user repurchase behavior by integrating a temporal attention mechanism. Applied to user behavior analysis scenarios on e-commerce platforms, it predicts whether a target user will have a repurchase tendency in subsequent periods based on historical behavior data within a preset statistical period. The method described in this embodiment focuses on processing the temporal rhythm of user behavior, the behavior conversion chain, product semantic association, and cross-period interest migration. Specifically, it includes: S1. Obtain the historical behavior sequence of the target user within the preset statistical period, and extract the behavior type, behavior occurrence time and product information corresponding to each behavior.

[0022] In practice, the first step is to extract all the target user's behavior records within the current statistical period from the e-commerce platform's behavior log database, and then sort them according to the order in which the behaviors occurred to form the target user's historical behavior sequence within the current statistical period.

[0023] To ensure consistency in subsequent processing, this embodiment cleans up abnormal records, duplicate reports, and records with missing key fields in the original logs during the behavior sequence processing. For records that are repeatedly written at the same time and have the same behavior type and product identifier, only one is retained; for records that do not contain behavior time or product identifier, they are removed from the sequence.

[0024] In this embodiment, each behavior record corresponds to at least three basic fields: behavior type, behavior occurrence time, and product information. The behavior type represents the operation category to which the behavior belongs, such as browsing, clicking, adding to cart, favorites, purchasing, and rating. The behavior occurrence time represents the specific time when the behavior occurred. The product information represents the product object associated with the behavior. For product information, this embodiment is not limited to using a single product number; it can further extract auxiliary information such as product category, keyword set in the product title, brand tags, and activity tags to provide a basis for subsequent calculation of product semantic similarity relationships.

[0025] After obtaining the historical behavior sequence, the purchase behaviors within it can be identified, and the time of the most recent purchase behavior can be marked. If multiple purchase behaviors exist within the current statistical period, the purchase behavior that occurs most recently is selected. If no purchase behaviors exist within the current statistical period, the time of the last purchase behavior in the previous statistical period can be used as a reference according to the platform's configuration rules, or the time interval from the most recent purchase behavior can be set to a preset upper limit. This setting ensures that subsequent time-enhanced processing has a consistent reference across different users and activity levels.

[0026] For example, a target user might exhibit the following behaviors sequentially within the current statistical period: Day 1: Browse a skincare product; Day 2: Click on the product's details page; Day 3: Add the product to their favorites; Day 5: Place an order for the product; Day 8: Browse a face mask from the same brand; Day 9: Add the face mask to their cart; Day 12: Browse a similar serum; Day 15: Click on the serum's details page; Day 18: Revisit the page for the skincare product they've already purchased. These behaviors, arranged chronologically, constitute a historical behavior sequence. Each sequence is recorded, including the corresponding behavior type, occurrence time, and product information, providing the input for subsequent modeling.

[0027] S2. Convert each behavior in the historical behavior sequence into a basic behavior representation, and perform time enhancement processing on the basic behavior representation based on the relative time difference between adjacent behaviors and the time interval between each behavior and the most recent purchase behavior to construct a time-enhanced behavior representation sequence.

[0028] In this embodiment, the construction of the basic behavior representation includes two parts: behavior type expression and product semantic expression. For behavior types, a behavior type mapping table can be pre-established, corresponding to different behavior types such as browsing, clicking, adding to cart, favoriting, purchasing, rating, and returning to the site as different behavior type vectors. This behavior type vector can be formed through discrete number mapping or through a pre-set behavior category coding table, as long as it can distinguish between different behavior types.

[0029] For product information, this embodiment integrates information such as product category, brand tags, title keywords, and activity tags to form a product semantic vector. Specifically, the product category and brand tags are first discretely encoded, then the title keywords are segmented and filtered, and finally, multiple semantic fields are combined in a unified order to form the product semantic vector. Through this process, products of the same category or with similar semantics can show a certain proximity relationship in the representation space, thus providing a data foundation for the subsequent processing of product semantic attention heads.

[0030] After obtaining the behavior type vector and the product semantic vector, this embodiment further performs dual-reference encoding on the time information. The first time reference is the relative time difference between adjacent behaviors, that is, the time interval between the current behavior and its predecessor; the second time reference is the time interval between each behavior and the most recent purchase behavior, that is, the time distance between the current behavior and the most recent purchase behavior. The above two time quantities are mapped to time-encoded vectors respectively, and participate as two independent time references in the construction of the temporal-enhanced behavior representation.

[0031] The relative time difference between adjacent behaviors is segmented and coded according to multiple time intervals. For example, intervals of up to five minutes, one hour, one day, three days, seven days, and more than seven days can be set as different intervals, and a corresponding time code label can be assigned to each interval. This method can distinguish whether the user's behavior rhythm is continuous and high-frequency or sparse and dispersed. For the time interval since the most recent purchase behavior, it is coded in layers according to the preset post-purchase follow-up stage, such as the immediate post-purchase stage, the short-term post-purchase follow-up stage, the mid-term post-purchase observation stage, and the long-term post-purchase inactivity stage, to reflect the position of the behavior occurrence point relative to the purchase event. This layered coding can indicate whether the user focuses before the purchase, follows up after the purchase, or re-engages with the relevant product within a certain period of time after the purchase.

[0032] Subsequently, the behavior type vector, product semantic vector, and two time-encoding vectors are fused to obtain the temporal-enhanced behavior representation of the corresponding behavior. This fusion can be achieved through vector concatenation, bit-by-bit superposition, or combination in a preset order. In this embodiment, to ensure a uniform input structure for the subsequent multi-head attention network, a fixed-order concatenation method can be used to form the temporal-enhanced behavior representation for each behavior record. After performing the above processing on all behaviors according to the order of the historical behavior sequence, a temporal-enhanced behavior representation sequence can be constructed.

[0033] Taking the aforementioned user behavior in this embodiment as an example, if a user completes a purchase of a skincare product on the fifth day, then browsing the same brand's face mask on the eighth day after the fifth day would have a relative time difference of three days between these adjacent behaviors, and the time interval from the most recent purchase would also be three days. If the user revisits the purchased skincare product page on the eighteenth day, the relative time difference between these adjacent behaviors might be larger, and the time interval from the most recent purchase would be thirteen days. The former is more likely to represent short-term extended interest after purchase, while the latter is more likely to represent a return visit or continued interest after purchase. Through dual-time reference coding, although both are browsing behaviors, they will be effectively distinguished in the temporal-enhanced behavior representation.

[0034] S3. Input the temporal enhanced behavior representation sequence into a multi-head attention network. Different attention heads independently perform weighted calculations based on the temporal proximity of behavior, the transformation relationship of behavior type, and the semantic similarity relationship of goods. The output results of each attention head are then fused to obtain the user purchase intent vector for the current statistical period.

[0035] In this embodiment, the multi-head attention network includes at least a temporal relationship attention head, a behavior transformation attention head, and a product semantic attention head. Each of the three attention heads independently models the behavioral relationships within the temporally enhanced behavior representation sequence to avoid the confounding effect of a single association pattern on the expression of user intent.

[0036] The temporal relationship attention head is used to calculate temporal relationship weights based on the time intervals between actions. Its focus is on identifying temporally clustered regions where actions occur. For example, if browsing, clicking, adding to cart, and purchasing occur consecutively within a certain time frame, it indicates that the actions within that time slice are more likely related to the user's immediate purchase intention; conversely, if the intervals between actions are too long, their contribution to the current intention may be relatively reduced. Based on this, the temporal relationship attention head assigns different temporal relationship weights to each action in the temporally enhanced action representation sequence, and performs a weighted summation according to these weights to obtain a temporal relationship feature vector.

[0037] Behavioral conversion attention heads are used to calculate behavioral conversion weights based on the conversion sequence between different behavior types. Their focus is on identifying the progression of the behavioral chain. For example, a progressively stronger behavioral conversion chain, such as from browsing to clicking, from clicking to adding to favorites, from adding to cart, and from adding to cart to purchasing, typically has a stronger tendency for repeat purchases; while browsing without further action for a long period can have a lower weight. Behavioral conversion attention heads identify the sequential relationships and conversion paths between different behavior types, and then perform a weighted summation of each behavior to obtain a behavioral conversion feature vector.

[0038] The product semantic attention head is used to calculate product semantic weights based on the semantic similarity between product information. Its focus is on identifying whether a user's needs consistently concentrate on a specific product category, brand, or functionality within a statistical period. For example, if a user browses, clicks, purchases, and revisits products belonging to the same skincare category or brand series, it indicates a high degree of focused interest and a higher likelihood of repeat purchases. Conversely, if the products involved are scattered across significantly different categories, it suggests a more dispersed interest. The product semantic attention head then generates a product semantic feature vector based on this information.

[0039] After obtaining the time relationship feature vector, behavior conversion feature vector, and product semantic feature vector respectively, the three are concatenated in a preset order, and a linear transformation is performed on the concatenated result to obtain the user purchase intention vector for the current statistical period. This user purchase intention vector is used to characterize the target user's overall purchase tendency and interest focus state within the current statistical period, and is the core input for subsequent cross-period offset analysis.

[0040] It should be noted that the "linear transformation" described in this embodiment is used to uniformly map the concatenated multidimensional features, forming a purchase intent vector with a consistent structure. This description is not a generalized uncertain processing, but rather a specific processing method for standardizing the output of the concatenated feature dimensions. Through the separate calculation and subsequent fusion of the three attention heads, the time urgency of user behavior, the progress of behavior, and the concentration of product interest within the current statistical period can all be reflected in the purchase intent vector.

[0041] S4. Extract the historical purchase intent vector of the target user in the previous statistical period, and perform cross-period offset analysis between the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period. The cross-period offset analysis includes at least vector similarity calculation, vector offset calculation and vector offset direction determination.

[0042] In this embodiment, the historical purchase intent vector of the previous statistical period can be pre-calculated and stored using the same method as the current statistical period. When entering a new statistical period for repeat purchase prediction, the historical purchase intent vector of the target user from the previous statistical period is read from the historical records and compared with the user's purchase intent vector in the current statistical period.

[0043] Specifically, cross-cycle offset analysis includes the following processing steps.

[0044] S41. Calculate the cosine similarity between the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period. The cosine similarity is used to characterize the consistency of the overall direction of purchase intent between the two periods. If the similarity is high, it indicates that the user's interest structure is relatively stable between the two periods; if the similarity is low, it indicates that the user's interest direction has changed significantly.

[0045] S42. Calculate the vector offset of the user purchase intent vector for the current statistical period relative to the historical purchase intent vector for the previous statistical period. This offset is used to characterize the overall magnitude of the difference in purchase intent intensity between the two periods. Even if the directions of the two periods are relatively similar, a large offset may indicate that the intensity of user interest has significantly increased or decreased.

[0046] S43. Determine the vector offset direction based on the coordinate difference between the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period. The vector offset direction is used to characterize which feature dimension the purchase intent is mainly shifting towards. For example, if the semantic relevance dimension of the product increases while the behavioral conversion relevance dimension decreases, it can indicate that the user's interest is gradually shifting from broad browsing to focusing on specific products; conversely, if the semantic concentration decreases, it may indicate that the user's interest is scattered or deviating from the original repeat purchase target.

[0047] S44. Output the cosine similarity, the vector offset, and the vector offset direction as the cross-period offset analysis results. By using these three analytical quantities in combination, it is possible to avoid making judgments based solely on the strength of behavior in a single period. For example, if a user remains active in the current period, but the categories of goods they are interested in have deviated significantly from the categories of goods they purchased in the previous period, then even if their activity level is high, it is not appropriate to directly conclude that they have a high repurchase tendency. Conversely, if a user's activity level in the current period is not very intensive, but their interests are highly consistent with those in the previous period and the offset is small, then they may still have a high probability of repurchase.

[0048] In a further embodiment, the cross-period offset analysis described in this example may also include continuous period stability analysis. This analysis is used to examine whether changes in user intent have a continuous and stable trend. Specifically, the vector offset direction of two consecutive statistical periods can be obtained. When the vector offset direction of two consecutive statistical periods reverses, the risk level corresponding to the offset risk label is increased; when the cosine similarity of two consecutive statistical periods is higher than a second threshold and the vector offset is lower than a first threshold, the risk level corresponding to the offset risk label is decreased. Through continuous period stability analysis, two different states, short-term fluctuations and continuous migration, can be further distinguished, thereby improving the explanatory power of subsequent risk labels.

[0049] S5. Input the cross-cycle offset analysis results and the user purchase intent vector of the current statistical period into the repurchase score generation step to generate the corresponding repurchase score and offset risk label.

[0050] In practice, the scores for each dimension of the user purchase intent vector for the current statistical period, along with cosine similarity and vector offset, are first arranged in a preset order to form a scoring input sequence. This preset order can be: first, arranging the dimensions of the user purchase intent vector for the current statistical period, and then arranging the cosine similarity and vector offset in sequence. To ensure the comparability of data from different sources, the dimensions can be standardized before forming the scoring input sequence.

[0051] Subsequently, the weighted summation of the input scoring sequence yields an initial repurchase score. This initial repurchase score primarily reflects the overall strength of purchase intent within the current statistical period and its consistency across periods. Then, the initial repurchase score is corrected based on the vector offset direction to obtain a revised repurchase score. Directional correction refers to adjusting the initial repurchase score according to whether the purchase intent offset focuses on previously purchased product categories, extends to related products, or disperses towards unrelated categories. If the offset direction indicates that the user continues to focus on previously purchased products or strongly related product categories, the correction can increase the repurchase score; if the offset direction indicates that the user significantly deviates from previously purchased product categories, the correction can decrease the repurchase score.

[0052] After obtaining the revised repurchase score, a deviation risk marker needs to be generated. Specifically, a deviation risk marker is generated when the vector deviation is higher than a first threshold and the cosine similarity is lower than a second threshold; when the vector deviation is lower than or equal to the first threshold, or the cosine similarity is higher than or equal to the second threshold, the deviation risk marker is canceled, and the revised repurchase score is output as the repurchase score. The deviation risk marker is used to indicate that although the current user may still have some active behavior, their purchase intention has changed significantly, and it is necessary to carefully distinguish between repurchase tendency and new interest migration in subsequent operations.

[0053] With the introduction of the aforementioned continuous period stability analysis, if the vector offset direction reverses between two consecutive statistical periods, it indicates that the user's intention is fluctuating unstablely, which can increase the risk level corresponding to the offset risk marker. Conversely, if two consecutive statistical periods show high similarity and low offset, it indicates that the user's interest remains stable, which can decrease the risk level corresponding to the offset risk marker. Therefore, the offset risk marker is no longer a simple binary result but carries certain hierarchical information, providing richer judgment criteria for subsequent result interpretation.

[0054] S6. Based on the comparison result between the repurchase score and the preset threshold, and in conjunction with the offset risk marker, output the repurchase prediction result of the target user.

[0055] In this embodiment, the repurchase prediction result includes at least a repurchase determination result, a repurchase score, and a dominant product category. The repurchase determination result indicates whether the target user is considered to have a repurchase tendency; the repurchase score reflects the strength of the repurchase tendency; and the dominant product category represents the product category that best represents the user's focus of interest within the current statistical period.

[0056] In practice, the repurchase score can be compared with a preset threshold first. When the repurchase score is higher than the preset threshold and no offset risk marker is generated, the target user is identified as a high-probability repurchase user; when the repurchase score is higher than the preset threshold but an offset risk marker exists, the target user is identified as a repurchase risk user requiring secondary identification; when the repurchase score is lower than the preset threshold, the user is identified as a low-probability repurchase user. This method avoids making a single judgment based solely on the score size, but rather considers the score result in conjunction with offset risk.

[0057] For determining the dominant product category, this embodiment judges it based on the semantic weight of each product category within the current statistical period. In other words, during the product semantic attention head processing, a product semantic weight distribution has been formed for the product information corresponding to each behavior, and the product category with the highest weight within the statistical period can be output as the dominant product category.

[0058] This dominant product category can be used to indicate the area of ​​interest where the target user is currently most concentrated. For example, when multiple categories such as skincare, makeup, and daily necessities exist simultaneously, if the skincare category has the highest semantic weight, then the skincare category can be identified as the dominant product category. This provides a more targeted basis for marketing outreach, product recommendations, or the distribution of repeat purchase coupons.

[0059] The method described in this embodiment will be explained below with reference to a specific application process.

[0060] Suppose that a target user mainly browsed, clicked, added to favorites, and purchased baby formula products in the previous statistical period, forming a corresponding historical purchase intent vector during that period; in the current statistical period, the user browsed, clicked, added to cart, and revisited products of the same brand, such as baby formula, bottle cleaning products, and infant complementary foods, while also browsing a small number of household products sporadically.

[0061] When processing using the method described in this embodiment, firstly, all behaviors in the current period are arranged in chronological order to form a historical behavior sequence; then, the behavior type, product semantics, time difference between adjacent behaviors, and time interval from the most recent purchase behavior are jointly encoded to form a temporally enhanced behavior representation sequence; next, the user's intensive behavior time slices on milk powder and complementary food related products are identified through the time relationship attention head, the gradual progression chain from browsing to adding to cart is identified through the behavior conversion attention head, and the semantic association between milk powder, bottle cleaning products, and infant complementary food is identified through the product semantic attention head, finally obtaining the user's purchase intent vector for the current statistical period.

[0062] After performing cross-period offset analysis between the current period vector and the previous statistical period vector, if a high cosine similarity and a small vector offset are found, and the offset direction mainly points towards the extension of maternal and infant related products, it indicates that although the user's interests have expanded from a single milk powder to maternal and infant related products, the overall interest structure remains within the original repurchase scenario. In this case, during the rating generation step, the initial repurchase rating can be high, and after direction correction, the repurchase rating further increases. Offset risk markers are not generated, and the final output result can be identified as a user with a high probability of repurchase, with maternal and infant products as the dominant product category.

[0063] Conversely, if a target user purchased athletic shoes in the previous statistical period but browsed kitchen appliances, home lighting, and office supplies extensively in the current statistical period, and their previous athletic-related behavior almost completely ceased, then although their activity level remains high in the current period, the cross-period offset analysis in this embodiment reveals a low cosine similarity and a high vector offset between their current purchase intent vector and the historical purchase intent vector from the previous statistical period, with the offset direction significantly deviating from the original product category. In this case, even if the initial repurchase score is supported by current activity and is not low, it will decrease after directional correction, and an offset risk marker will be generated. The final result can be identified as a low-repurchase-probability user with offset risk, whose dominant product category is the newly focused kitchen appliances or home lighting products. Through this result, the platform can avoid misidentifying such users as repeat purchase targets for the original product category.

[0064] In summary, the e-commerce user repurchase behavior prediction method integrating temporal attention mechanisms described in this embodiment achieves complete processing through at least the following technical paths: First, a temporally enhanced behavior representation sequence is constructed based on behavior type, product information, and dual time references; second, a user purchase intent vector for the current statistical period is formed through three attention heads: time relationship, behavior conversion, and product semantics; third, a cross-period offset analysis is performed between the current statistical period vector and the historical purchase intent vector of the previous statistical period; then, a repurchase score and offset risk label are generated based on the purchase intent strength and offset state; finally, a repurchase prediction result including the repurchase judgment result, repurchase score, and dominant product category is output. This embodiment can not only identify the strength of user interest within a single period, but also identify the stable, migrating, dispersed, or reversed states of user interest between adjacent periods, thereby making the repurchase prediction result more consistent with the actual evolution of user behavior in e-commerce scenarios. Example

[0065] This embodiment provides an e-commerce user repurchase behavior prediction system that integrates a temporal attention mechanism, used to identify and determine whether target users on an e-commerce platform have a tendency to repurchase. The system can be deployed on an e-commerce platform server, user behavior analysis platform, recommendation decision-making platform, or customer operation platform, or it can be integrated into existing business systems as an independent functional module.

[0066] like Figure 2 As shown, the system includes a behavior acquisition unit, a temporal enhancement representation construction unit, a multi-head relationship modeling unit, a cross-cycle offset analysis unit, a score generation unit, and a result output unit.

[0067] The aforementioned units can be deployed in the same computing device or in different computing nodes, and can be connected through interface calls or data transmission relationships.

[0068] The behavior acquisition unit is used to acquire the historical behavior sequence of the target user within a preset statistical period, and extract the behavior type, behavior occurrence time and product information corresponding to each behavior.

[0069] The behavior acquisition unit can extract target user behavior data within the current statistical period from browsing logs, click logs, add-to-cart records, favorites records, order records, and review records, and sort them according to the time of occurrence of the behavior to form a historical behavior sequence. To ensure the stability of subsequent processing results, the behavior acquisition unit can also perform deduplication, missing item filtering, and field unification processing on the raw data. The product information may include one or more of the following: product identifier, product category, brand tag, and title keywords. The behavior acquisition unit can also identify purchase behaviors in the historical behavior sequence and determine the time of the most recent purchase behavior, providing a reference for subsequent time-enhanced processing.

[0070] The time-enhanced representation construction unit is used to perform time-enhanced processing on the basic behavior representation based on the relative time difference between adjacent behaviors and the time interval between each behavior and the most recent purchase behavior, to generate a time-enhanced behavior representation sequence.

[0071] Specifically, the temporal augmentation representation building unit first maps behavior types to behavior type vectors, maps product information to product semantic vectors, and then maps the relative time difference between adjacent behaviors and the time interval from the most recent purchase behavior to time encoding vectors.

[0072] The relative time difference between adjacent behaviors is segmented and coded according to multiple time intervals to reflect the density of the behavior rhythm; the time interval from the most recent purchase behavior is coded in layers according to the preset post-purchase follow-up stage to reflect the position of the behavior relative to the purchase event.

[0073] Then, the temporal augmentation representation construction unit fuses the behavior type vector, the product semantic vector, and the two time-encoded vectors to obtain the temporal augmentation behavior representation of the corresponding behavior, and constructs a temporal augmentation behavior representation sequence according to the order in which the behavior occurs.

[0074] The multi-head relationship modeling unit is used to independently weight the temporal enhanced behavior representation sequence based on behavior temporal proximity relationship, behavior type transformation relationship and product semantic similarity relationship, and generate the user purchase intent vector for the current statistical period.

[0075] The multi-head relationship modeling unit includes a time relationship weighted sub-unit, a behavior transformation weighted sub-unit, and a product semantic weighted sub-unit.

[0076] The time relation weighting subunit is used to calculate the time relation weight based on the time interval between each behavior, and to weight the temporal enhancement behavior representation of each behavior according to the time relation weight to obtain the time relation feature vector.

[0077] The behavior conversion weighting subunit calculates behavior conversion weights based on the conversion order among different behavior types, and weights the temporal enhanced behavior representations of each behavior according to these weights to obtain a behavior conversion feature vector. The product semantic weighting subunit calculates product semantic weights based on the semantic similarity among different product information items, and weights the temporal enhanced behavior representations of each behavior according to these weights to obtain a product semantic feature vector. Subsequently, the multi-head relationship modeling unit concatenates the temporal relationship feature vector, behavior conversion feature vector, and product semantic feature vector in a preset order, and performs a linear transformation on the concatenated result to obtain the user purchase intent vector for the current statistical period. This vector represents the target user's overall purchase tendency within the current statistical period.

[0078] The cross-period offset analysis unit is used to perform vector similarity calculation, vector offset calculation, and vector offset direction determination on the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period, and output the cross-period offset analysis results.

[0079] The cross-cycle offset analysis unit includes a similarity calculation subunit, an offset calculation subunit, an offset direction determination subunit, and a continuous cycle stability analysis subunit.

[0080] The similarity calculation subunit is used to calculate the cosine similarity between the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period, so as to characterize the consistency of the purchase intent direction in the two statistical periods.

[0081] The offset calculation subunit calculates the vector offset of the user purchase intent vector in the current statistical period relative to the historical purchase intent vector in the previous statistical period, to characterize the overall magnitude of changes in purchase intent. The offset direction determination subunit determines the vector offset direction based on the coordinate difference between the user purchase intent vector in the current statistical period and the historical purchase intent vector in the previous statistical period, to characterize which feature dimension the purchase intent is primarily shifting towards. The continuous period stability analysis subunit obtains the vector offset direction for two consecutive statistical periods and, combined with similarity and offset information, analyzes whether changes in interest are short-term fluctuations or continuous migrations.

[0082] The scoring generation unit is used to generate a repeat purchase score and a deviation risk marker based on the cross-cycle offset analysis results and the user purchase intent vector of the current statistical period.

[0083] The scoring generation unit includes an initial scoring generation subunit and a risk adjustment subunit. The initial scoring generation subunit takes the values ​​of each dimension of the user purchase intent vector for the current statistical period, along with cosine similarity and vector offset, and arranges them into a scoring input sequence in a preset order. It then performs a weighted summation of the scoring input sequence to obtain an initial repurchase score. The risk adjustment subunit corrects the initial repurchase score based on the vector offset direction and generates or removes offset risk markers based on the comparison between the vector offset and a first threshold, and between the cosine similarity and a second threshold. Furthermore, the risk adjustment subunit can also adjust the risk level corresponding to the offset risk marker based on the results of continuous periodic stability analysis.

[0084] The result output unit is used to output the repurchase prediction result of the target user based on the comparison result of the repurchase score and the preset threshold, and in combination with the offset risk mark.

[0085] The repurchase prediction result includes at least a repurchase determination result, a repurchase score, and a dominant product category. The repurchase determination result indicates whether the target user has a repurchase tendency; the repurchase score indicates the strength of the repurchase tendency; and the dominant product category indicates the product category with the highest user interest during the current statistical period. Preferably, the dominant product category is determined based on the semantic weights of each product category during the current statistical period.

[0086] In actual operation, the behavior acquisition unit first extracts the target user's historical behavior sequence within the current statistical period; the time-series enhanced representation construction unit fuses behavior type, product information, and dual time references to generate a time-series enhanced behavior representation sequence; the multi-head relationship modeling unit performs multi-dimensional relationship modeling on the time-series enhanced behavior representation sequence to obtain the user's purchase intention vector for the current statistical period; the cross-period offset analysis unit compares this vector with the historical purchase intention vector of the previous statistical period and outputs the cross-period offset analysis result; the rating generation unit generates a repurchase rating and offset risk marker accordingly; and the result output unit finally outputs the repurchase prediction result.

[0087] For example, if a target user primarily browsed, added to cart, and purchased mother and baby products in the previous statistical period, and continues to browse, click on, and revisit similar products in the current statistical period, the system described in this embodiment will typically process the data to obtain a high vector similarity and a small vector offset. This results in a higher repurchase score, lower offset risk, and ultimately, a higher repurchase tendency result. Conversely, if another target user purchased sports products in the previous statistical period, but primarily browses home appliances and home improvement products in the current statistical period, the cross-period offset analysis will show a significant interest shift. The scoring unit will then generate an offset risk marker to prevent misclassification of this user as a repeat customer of the original product category.

[0088] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for predicting e-commerce user repurchase behavior by integrating a temporal attention mechanism, characterized in that, Includes the following steps: S1. Obtain the historical behavior sequence of the target user within a preset statistical period, and extract the behavior type, behavior occurrence time and product information corresponding to each behavior; Extract all behavioral records of the target user in the current statistical period from the behavior log database of the e-commerce platform, and sort them according to the order of the occurrence time of the behavior to form the historical behavior sequence of the target user in the current statistical period. S2. Convert each behavior in the historical behavior sequence into a basic behavior representation, and perform time enhancement processing on the basic behavior representation based on the relative time difference between adjacent behaviors and the time interval between each behavior and the most recent purchase behavior to construct a time-enhanced behavior representation sequence. The construction of basic behavior representation includes two parts: behavior type expression and product semantic expression. For behavior types, a behavior type mapping table is pre-established, and different behavior types such as browsing, clicking, adding to cart, favorites, purchasing, rating, and returning visit are respectively mapped to different behavior type vectors; For product semantic expression, product category, brand tags, title keywords, and activity tag information are integrated to form a product semantic vector; The relative time difference between adjacent actions and the time interval from the most recent purchase action are mapped to two time-encoded vectors respectively. Temporal augmentation processing involves fusing the behavior type vector, the product semantic vector, and two temporal encoding vectors to obtain a temporally augmented behavior representation of the corresponding behavior. The fusion is achieved by vector concatenation, bit-by-bit superposition, or combination in a preset order. S3. Input the time-series enhanced behavior representation sequence into a multi-head attention network. Different attention heads independently perform weighted calculations based on behavior temporal proximity, behavior type transformation, and product semantic similarity. The output results of each attention head are then fused to obtain the user purchase intent vector for the current statistical period. S4. Extract the historical purchase intent vector of the target user in the previous statistical period, and perform cross-period offset analysis between the user purchase intent vector in the current statistical period and the historical purchase intent vector in the previous statistical period. The cross-period offset analysis includes at least vector similarity calculation, vector offset calculation and vector offset direction determination. S5. Input the cross-cycle offset analysis results and the user purchase intent vector of the current statistical period into the repurchase score generation step to generate the corresponding repurchase score and offset risk label. S6. Based on the comparison result between the repurchase score and the preset threshold, and in conjunction with the offset risk marker, output the repurchase prediction result of the target user.

2. The e-commerce user repurchase behavior prediction method based on the fusion of temporal attention mechanism according to claim 1, characterized in that: In step S2, the relative time difference between adjacent behaviors is segmented and encoded according to multiple time intervals, the time interval from the most recent purchase behavior is hierarchically encoded according to a preset post-purchase follow-up stage, and the relative time difference and the time interval from the most recent purchase behavior are used as two independent time references to participate in the construction of the temporal enhanced behavior representation.

3. The e-commerce user repurchase behavior prediction method based on the fusion of temporal attention mechanism according to claim 2, characterized in that: In step S3, the multi-head attention network includes a temporal relation attention head, a behavioral conversion attention head, and a product semantic attention head; The time relationship attention head calculates the time relationship weight based on the time interval between each behavior, and then performs a weighted sum of the time-series enhanced behavior representations of each behavior according to the time relationship weight to obtain the time relationship feature vector; The behavior conversion attention head calculates the behavior conversion weight based on the conversion order between each behavior type, and then weights and sums the temporal enhancement behavior representations of each behavior according to the behavior conversion weight to obtain the behavior conversion feature vector; The product semantic attention head calculates the product semantic weight based on the semantic similarity between each product information, and then weights and sums the temporal enhanced behavior representations of each behavior according to the product semantic weight to obtain the product semantic feature vector; The time relationship feature vector, behavior conversion feature vector, and product semantic feature vector are then concatenated in a preset order, and the concatenated result is linearly transformed to obtain the user purchase intent vector for the current statistical period.

4. The e-commerce user repurchase behavior prediction method based on the fusion of temporal attention mechanism according to claim 3, characterized in that: In step S4, the cross-cycle migration analysis includes the following steps: S41. Calculate the cosine similarity between the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period. S42. Calculate the vector offset of the user purchase intent vector in the current statistical period relative to the historical purchase intent vector in the previous statistical period. S43. Determine the vector offset direction based on the coordinate difference between the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period. S44. Output the cosine similarity, the vector offset, and the vector offset direction as the cross-period offset analysis results.

5. The e-commerce user repurchase behavior prediction method based on the fusion of temporal attention mechanism according to claim 4, characterized in that: In step S5, the methods for generating the repeat purchase score and offset risk marker include: The values ​​of each dimension of the user purchase intent vector in the current statistical period, along with the cosine similarity and the vector offset, are arranged in a preset order to form a scoring input sequence. The scoring input sequence is then weighted and summed to obtain an initial repurchase score. The initial repurchase score is corrected according to the vector offset direction to obtain the corrected repurchase score; When the vector offset is higher than the first threshold and the cosine similarity is lower than the second threshold, an offset risk marker is generated. When the vector offset is lower than or equal to the first threshold, or the cosine similarity is higher than or equal to the second threshold, the offset risk marker is removed, and the corrected repurchase score is output as the repurchase score.

6. The e-commerce user repurchase behavior prediction method based on the fusion of temporal attention mechanism according to claim 5, characterized in that: The cross-cycle migration analysis also includes continuous-cycle stability analysis, which includes the following steps: Obtain the vector offset direction for two consecutive statistical periods; When the vector offset direction reverses for two consecutive statistical periods, the risk level corresponding to the offset risk marker is increased. When the cosine similarity of two consecutive statistical periods is higher than the second threshold and the vector offset is lower than the first threshold, the risk level corresponding to the offset risk label is reduced.

7. The e-commerce user repurchase behavior prediction method based on the fusion of temporal attention mechanism according to claim 6, characterized in that: In step S6, the repurchase prediction result includes at least the repurchase judgment result, the repurchase score, and the dominant product category. The dominant product category is determined based on the semantic weight of each product category in the current statistical period.

8. An e-commerce user repurchase behavior prediction system integrating a temporal attention mechanism, used to implement the method as described in any one of claims 1-7, characterized in that, include: The behavior acquisition unit is used to acquire the historical behavior sequence of the target user within a preset statistical period, and extract the behavior type, behavior occurrence time and product information corresponding to each behavior; The temporal augmentation representation building unit is used to perform temporal augmentation processing on the basic behavior representation based on the relative time difference between adjacent behaviors and the time interval between each behavior and the most recent purchase behavior, to generate a temporal augmentation behavior representation sequence; The multi-head relationship modeling unit is used to independently weight the temporal enhanced behavior representation sequence based on behavior temporal proximity relationship, behavior type transformation relationship and product semantic similarity relationship, and generate the user purchase intent vector for the current statistical period. The cross-period offset analysis unit is used to perform vector similarity calculation, vector offset calculation and vector offset direction determination on the user purchase intent vector of the current statistical period and the historical purchase intent vector of the previous statistical period, and output the cross-period offset analysis results. The rating generation unit is used to generate a repeat purchase rating and an offset risk label based on the cross-period offset analysis results and the user purchase intent vector of the current statistical period. The result output unit is used to output the repurchase prediction result of the target user based on the comparison result of the repurchase score and the preset threshold, and in combination with the offset risk mark.

9. The e-commerce user repurchase behavior prediction system based on the fusion of temporal attention mechanism according to claim 8, characterized in that: The multi-head relationship modeling unit includes a time relationship weighted sub-unit, a behavior transformation weighted sub-unit, and a product semantic weighted sub-unit; The cross-cycle offset analysis unit includes a similarity calculation subunit, an offset calculation subunit, an offset direction determination subunit, and a continuous cycle stability analysis subunit. The scoring generation unit includes an initial scoring generation subunit and a risk adjustment subunit.