A method for predicting user behavior in a blockchain-based points mall based on artificial intelligence

CN122573504APending Publication Date: 2026-08-14YUEJI ENTERPRISE MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-27
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

然而,在实际应用过程中,如何在保障链上数据安全与一致性的前提下,对用户积分使用行为、商城交互行为及其演化趋势进行准确预测,仍面临诸多技术挑战

Benefits of technology

本发明通过引入改进型BERT4Rec网络对目标用户特征向量序列进行时序行为建模处理,能够在区块链积分商城场景下精准捕捉用户在积分获取、积分消耗与商品兑换等多类行为之间的复杂演化模式,输出门控行为特征向量序列,从而有效提升用户行为建模的表达能力。首先,所述改进型BERT4Rec网络结合时间嵌入模块、多粒度行为共现模块、掩码自注意力编码器和积分状态感知门控模块,在保证时序依赖性建模能力的基础上,引入链上关系偏置矩阵与积分状态门控机制,实现对链上积分行为语义关系的强化感知和用户行为状态的精准调控,解决了传统行为预测方法无法有效处理积分行为非平稳性与非线性变化的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122573504A_ABST
    Figure CN122573504A_ABST
Patent Text Reader

Abstract

This invention discloses an AI-based method for predicting user behavior in a blockchain points mall, comprising the following steps: Step 1: collecting blockchain points data, mall behavior data, and user profile data of target users; Step 2: performing preprocessing and embedding encoding to generate a target user feature vector sequence; Step 3: generating a gated behavior feature vector sequence from the target user feature vector sequence using an improved BERT4Rec network; Step 4: performing multi-task prediction based on the gated behavior feature vector sequence; Step 5: calculating the behavior prediction confidence, user activity level, risk behavior credibility, and points change slope; Step 6: generating a points mall operation strategy; and Step 7: collecting actual behavior data of target users and performing supervised training on the improved BERT4Rec network. This invention improves the accuracy and stability of user behavior prediction in a blockchain points mall through the improved BERT4Rec network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and blockchain data processing technology, and in particular to a method for predicting user behavior in a blockchain points mall based on artificial intelligence. Background Technology

[0002] With the increasing application of blockchain technology in points malls, membership systems, and digital asset operation scenarios, the demand for blockchain-based points management and user behavior analysis is growing. Blockchain points malls, through distributed ledgers, enable traceability and immutability of points acquisition, consumption, and transfer, providing a technological foundation for inter-platform points interoperability and trusted operation. However, in practical applications, accurately predicting user points usage behavior, mall interaction behavior, and their evolution trends while ensuring on-chain data security and consistency still faces numerous technical challenges.

[0003] Existing methods for analyzing user behavior in points malls mostly rely on traditional statistical analysis or recommendation models based on single behavior sequences. They typically only use browsing or redemption records for modeling, making it difficult to fully depict the complex relationships between users in points acquisition, points consumption, and changes in behavior over time. Furthermore, blockchain points data is characterized by long time spans, diverse event types, discrete points changes, and strong influence from promotional activities. Existing methods have limited ability to handle the time-series dependence, suddenness, and periodicity of points behavior, resulting in insufficient stability in user behavior prediction results.

[0004] Furthermore, existing methods often overlook the on-chain semantic relationships between points-based behaviors in blockchain scenarios, failing to effectively utilize on-chain features such as block height and contract call type to characterize the inherent constraints between different behaviors, making it difficult to identify potential abnormal points usage behaviors and risk patterns. Simultaneously, the lack of a unified multimodal modeling mechanism between user profile features, e-commerce behavior features, and on-chain points features leads to insufficient feature fusion and limited generalization ability of the prediction model.

[0005] Therefore, how to provide a method for predicting user behavior in a blockchain-based points mall based on artificial intelligence is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] One objective of this invention is to propose an AI-based method for predicting user behavior in a blockchain points mall. This invention utilizes an improved BERT4Rec network and describes in detail how to integrate on-chain points behavior, mall interaction behavior, and user profile features in a blockchain points scenario to model user behavior and generate points mall operation strategies. It has the advantages of high accuracy in behavior recognition, strong real-time prediction response, strong risk assessment capability, and strong adaptability of points strategies.

[0007] According to an embodiment of the present invention, a method for predicting user behavior in a blockchain points mall based on artificial intelligence includes the following steps: Step 1: Collect blockchain points data, e-commerce behavior data, and user profile data of the target users; Step 2: Preprocess and embed the blockchain points data, e-commerce behavior data, and user profile data to generate a target user feature vector sequence; Step 3: Input the target user feature vector sequence into the improved BERT4Rec network to perform temporal behavior modeling processing and output the gated behavior feature vector sequence. The improved BERT4Rec network includes a temporal embedding module, a multi-granularity behavior co-occurrence module, a masked self-attention encoder, and an integral state-aware gating module. The masked self-attention encoder introduces an on-chain relation bias matrix. Step 4: Based on the gated behavior feature vector sequence, perform multi-task prediction through the multi-task prediction module and output a set of multi-task prediction results; Step 5: Based on the multi-task prediction result set, calculate the behavior prediction confidence, user activity level, risk behavior credibility, and score change slope, and output the behavior decision feature set; Step Six: Generate an operational strategy for the points mall based on the multi-task prediction result set and the behavioral decision feature set; Step 7: Collect actual behavioral data of the target users and use it as a supervisory signal to perform supervised training on the improved BERT4Rec network.

[0008] Optionally, step one specifically includes: The blockchain points data includes points acquisition records, points consumption records, block height, and contract call type; The mall behavior data includes user behavior types and product identifiers. The user behavior types include browsing history, click history, shopping cart addition history, and product redemption history. The user profile data includes user account type, preferred product categories, active time periods, and price sensitivity.

[0009] Optionally, step two specifically includes: The points value corresponding to the points acquisition record is recorded as a positive value, and the points value corresponding to the points consumption record is recorded as a negative value, which serves as the change in points at each time step. At each time step, the integral change is Z-score normalized and mapped to an integral change embedding vector through an MLP structure; the block height is min-max normalized and constructed into a time position embedding vector through sine and cosine position encoding; the contract call type is one-hot encoded to generate a contract semantic vector. The integral change embedding vector, time position embedding vector, and contract semantic vector at each time step are concatenated along the feature dimension to obtain the on-chain behavior embedding vector. User behavior types are numerically encoded to obtain the behavior type number for each time step; the behavior type number is then converted into a behavior type embedding vector through one-hot encoding. Product identifiers are vectorized and mapped using a trainable embedding lookup table to generate product embedding vectors. The behavior type embedding vector and the product embedding vector at each time step are concatenated along the feature dimension to obtain the mall behavior embedding vector. User account types are numerically encoded and one-hot encoded to generate account type embedding vectors; The preferred product categories are encoded using multi-label one-hot encoding to obtain the preferred product category embedding vector; the active time periods are numbered and encoded using one-hot encoding to obtain the active time embedding vector; and the price sensitivity is processed by min-max normalization to obtain the normalized price sensitivity. The user profile embedding vector is obtained by concatenating the account type embedding vector, preferred category embedding vector, active time embedding vector, and normalized price sensitivity at each time step. The on-chain behavior embedding vector, e-commerce behavior embedding vector, and user profile embedding vector at each time step are concatenated to obtain the target user feature vector, and then the target user feature vector sequence is formed according to the time step.

[0010] Optionally, step three specifically includes: In the time embedding module, the index of each time step is converted into a time position embedding vector through Time2Vec encoding; the target user feature vector of each time step is concatenated with the time position embedding vector, and then converted into a standard user feature vector through linear mapping and layer normalization; the linear mapping is used to unify the feature vector dimension of each time step. In the multi-granularity behavior co-occurrence module, three time windows of different lengths are set, and at each time step, average pooling is performed on the standard user feature vector sequences within the three time windows to obtain three granularity behavior co-occurrence vectors. The three granularity behavior co-occurrence vectors are concatenated, and a behavior co-occurrence enhancement vector is generated through linear mapping. The vectors are then organized into a sequence of behavior co-occurrence enhancement vectors according to time steps. Construct an on-chain relation bias matrix, and input the behavior co-occurrence enhancement vector sequence and the on-chain relation bias matrix into a masked self-attention encoder to perform masked self-attention modeling and generate a behavior feature vector sequence, specifically: The behavior co-occurrence enhancement vector sequence is transformed into a query matrix, a key matrix, and a value matrix through three sets of trainable mapping matrices; Define the causal mask matrix: if time step j is greater than time step i, then set the value of the element in the i-th row and j-th column of the causal mask matrix to negative infinity; if time step j is less than or equal to time step i, then set the value of the element in the i-th row and j-th column of the causal mask matrix to 0. Perform matrix multiplication on the query matrix and the key matrix, and scale according to the dimension of the key matrix to obtain the attention score matrix; The attention score matrix is ​​added element-wise to the on-chain relation bias matrix and the causal mask matrix to obtain the corrected attention score matrix. The corrected attention score matrix is ​​then subjected to Softmax normalization to obtain the attention weight matrix. Perform matrix multiplication on the attention weight matrix and the value matrix, and organize them into a sequence of behavioral attention vectors according to time steps; The behavioral attention vector sequence and the behavioral co-occurrence enhancement vector sequence are summed by residual addition and then subjected to layer normalization to obtain the behavioral feature vector sequence. In the integral state perception gating module, the integral balance, remaining validity period of the integral, integral change rate, and integral usage ratio at each time step are obtained to form an integral state vector; the integral state vector is then transformed into integral state gating coefficients through a linear mapping and the Sigmoid function. Based on the integral state gating coefficient, the behavior feature vector at each time step is multiplied element by element to obtain the gating behavior feature vector, and the gating behavior feature vector sequence is output according to the time step.

[0011] Optionally, the constructing of the relation bias matrix on the chain is specifically as follows: Obtain the integral behavior type, contract semantic vector, and block height for time step i and time step j; the integral behavior type includes integral acquisition and integral consumption, and assign the value of integral acquisition to 1 and the value of integral consumption to -1; Calculate the product between the integral behaviors of time step i and time step j to obtain the consistency value of integral behavior; calculate the cosine similarity between the contract semantic vectors of time step i and time step j to obtain the contract semantic similarity value; calculate the absolute difference between the block heights of time step i and time step j, and perform a logarithmic decay transformation on the absolute difference to obtain the block height decay value. The on-chain relationship bias value between time step i and time step j is obtained by weighted summation of the integral behavior consistency value, contract semantic similarity value, and block height decay value, and then the on-chain relationship bias value is used as the element value of the i-th row and j-th column of the on-chain relationship bias matrix.

[0012] Optionally, step four specifically includes: The gating behavior feature vector sequence is input into the multi-task prediction module, which includes a behavior classification prediction head, a points consumption probability prediction head, a goods redemption probability prediction head, a user activity prediction head, and a risk behavior score prediction head. The behavior classification prediction head and the user activity prediction head respectively use a set of fully connected layers and a Softmax function to perform linear mapping and probability normalization on the gated behavior feature vector at each time step to obtain the behavior category prediction vector and the user activity prediction vector. The points consumption probability prediction head, the goods redemption probability prediction head, and the risk behavior score prediction head each use a set of fully connected layers and a Sigmoid function to perform linear mapping and probability compression on the gated behavior feature vector at each time step to obtain the points consumption prediction value, the goods redemption prediction value, and the risk behavior score value. The prediction results are composed of the behavior category prediction vector, user activity prediction vector, points consumption prediction value, product redemption prediction value, and risk behavior score value for all time steps.

[0013] Optionally, step five specifically includes: Extract the maximum component value of the behavior category prediction vector at each time step, and use it as the behavior prediction confidence. Extract the maximum component value of the user activity prediction vector at each time step, and use it as the user activity level; the user activity level includes high activity level, medium activity level and low activity level; Based on the risk behavior score at each time step, the confidence level of risk behavior is calculated using a symmetric distribution confidence mapping method. Set the sliding time window length, calculate the difference average of the integral consumption prediction value sequence within the sliding time window length, and obtain the integral change slope; The behavioral decision feature set is composed of the behavioral prediction confidence level, user activity level, risk behavior credibility, and score change slope of all time steps.

[0014] Optionally, the points mall operation strategy includes a product recommendation strategy, a points incentive strategy, and a risk warning strategy; The product recommendation strategy is as follows: Obtain the product embedding vector and the preference category embedding vector at each time step, calculate the cosine similarity between the product embedding vector and the preference category embedding vector to obtain the semantic matching score, and multiply the semantic matching score with the product redemption prediction value to obtain the product recommendation score at each time step. The product recommendation score is multiplied by the corresponding behavior prediction confidence score to generate a confidence product recommendation score; Based on the confidence product recommendation score, the set of candidate products is sorted in descending order; When the user's activity level is high, the top K1 candidate products are selected as the target recommended products; when the user's activity level is medium, the top K2 candidate products are selected as the target recommended products; when the user's activity level is low, the top K3 candidate products are selected as the target recommended products; where K1, K2, and K3 are the set number of recommendations, and ; The specific incentive strategy is as follows: Extract the integral consumption forecast, integral change slope, and normalized price sensitivity for each time step; Multiply the integral change slope by the set integral change trend coefficient to obtain the integral trend weighted value; multiply the normalized price sensitivity by the set price adjustment coefficient to obtain the price sensitivity weighted value. The integral consumption prediction value, the integral trend weighted value, and the price sensitivity weighted value are added together to obtain the integral incentive weight for each time step; The points incentive weight is multiplied by the set points return coefficient to obtain the points return ratio for the target user. The points return ratio is limited to the range of 0 to 1. When the points return ratio exceeds 1, the points return ratio is set to 1. The risk warning strategy is as follows: extract the risk behavior score and risk behavior credibility of each time step, calculate the risk warning index; set a risk threshold, and if the risk warning index is greater than or equal to the risk threshold, mark the current time step as a high-risk state of user behavior.

[0015] Optionally, the actual behavior data includes actual behavior category labels, actual points consumption values, actual product redemption records, actual activity levels, and actual risk behavior scores; the actual behavior data is aligned with the multi-task prediction result set according to time steps to construct a supervision signal and perform supervised training on the improved BERT4Rec network.

[0016] The beneficial effects of this invention are: This invention introduces an improved BERT4Rec network to perform temporal behavior modeling on the target user feature vector sequence. This enables precise capture of the complex evolutionary patterns among various user behaviors, such as points acquisition, points consumption, and product redemption, in a blockchain points mall scenario. It outputs a gated behavior feature vector sequence, thereby effectively improving the expressive power of user behavior modeling. Firstly, the improved BERT4Rec network combines a temporal embedding module, a multi-granularity behavior co-occurrence module, a masked self-attention encoder, and a points state-aware gating module. While ensuring temporal dependency modeling capabilities, it introduces an on-chain relation bias matrix and a points state gating mechanism to achieve enhanced perception of the semantic relationships of on-chain points behavior and precise control of user behavior states. This solves the problem that traditional behavior prediction methods cannot effectively handle the non-stationarity and nonlinear changes in points behavior.

[0017] Secondly, based on the gated behavior feature vector sequence, this invention constructs a multi-task prediction module, outputting user behavior classification prediction results, predicted points consumption probability, predicted product redemption probability, user activity prediction vector, and risk behavior score. Combined with confidence calculation, user activity level judgment, and points change trend assessment, it generates an actionable set of behavioral decision features, improving the interpretability and stability of user behavior. Furthermore, it generates points mall operation strategies, constructing product recommendation strategies, points incentive strategies, and risk warning strategies, dynamically generating intelligent recommendation and intervention schemes for different user states, enhancing the user responsiveness and operational flexibility of the points mall platform.

[0018] Furthermore, this invention constructs a supervision signal by collecting actual behavioral data of target users and performs supervised training on the improved BERT4Rec network using a multi-task loss function. This effectively achieves incremental updates and performance optimization of the behavior prediction model, forming a closed-loop structure of data collection, prediction modeling, policy generation, and feedback updates, thus ensuring the generalization ability and adaptability of the improved BERT4Rec network during long-term deployment.

[0019] In summary, this invention fully leverages the correlation information in blockchain points data, e-commerce behavior data, and user profile data, significantly improving the accuracy, robustness, and strategy-driven capability of user behavior prediction. Attached Figure Description

[0020] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram of a blockchain points mall user behavior prediction method based on artificial intelligence proposed in this invention; Figure 2 This is a flowchart of the improved BERT4Rec network structure in an artificial intelligence-based blockchain points mall user behavior prediction method proposed in this invention. Figure 3 This is a flowchart of multi-task prediction and decision feature generation in a blockchain points mall user behavior prediction method based on artificial intelligence proposed in this invention. Detailed Implementation

[0021] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0022] refer to Figures 1-3A method for predicting user behavior in a blockchain-based points mall based on artificial intelligence includes the following steps: Step 1: Collect blockchain points data, e-commerce behavior data, and user profile data of the target users; Step 2: Preprocess and embed the blockchain points data, e-commerce behavior data, and user profile data to generate a target user feature vector sequence; Step 3: Input the target user feature vector sequence into the improved BERT4Rec network to perform temporal behavior modeling processing and output the gated behavior feature vector sequence. The improved BERT4Rec network includes a temporal embedding module, a multi-granularity behavior co-occurrence module, a masked self-attention encoder, and an integral state-aware gating module. The masked self-attention encoder introduces an on-chain relation bias matrix. Step 4: Based on the gated behavior feature vector sequence, perform multi-task prediction through the multi-task prediction module and output a set of multi-task prediction results; Step 5: Based on the multi-task prediction result set, calculate the behavior prediction confidence, user activity level, risk behavior credibility, and score change slope, and output the behavior decision feature set; Step Six: Generate an operational strategy for the points mall based on the multi-task prediction result set and the behavioral decision feature set; Step 7: Collect actual behavioral data of the target users and use it as a supervisory signal to perform supervised training on the improved BERT4Rec network.

[0023] In this embodiment, step one specifically includes: The blockchain points data includes points acquisition records, points consumption records, block height, and contract call type; The mall behavior data includes user behavior types and product identifiers. The user behavior types include browsing history, click history, shopping cart addition history, and product redemption history. The user profile data includes user account type, preferred product categories, active time periods, and price sensitivity.

[0024] In this embodiment, step two specifically includes: The points value corresponding to the points acquisition record is recorded as a positive value, and the points value corresponding to the points consumption record is recorded as a negative value, which serves as the change in points at each time step. At each time step, the integral change is Z-score normalized and mapped to an integral change embedding vector through an MLP structure; the block height is min-max normalized and constructed into a time position embedding vector through sine and cosine position encoding; the contract call type is one-hot encoded to generate a contract semantic vector. The integral change embedding vector, time position embedding vector, and contract semantic vector at each time step are concatenated along the feature dimension to obtain the on-chain behavior embedding vector. User behavior types are numerically encoded to obtain the behavior type number for each time step. Specifically, the behavior type number for browsing records is 0, the behavior type number for click records is 1, the behavior type number for adding to cart records is 2, and the behavior type number for product redemption records is 3. The behavior type number is then converted into a behavior type embedding vector through one-hot encoding. Product identifiers are vectorized and mapped using a trainable embedding lookup table to generate product embedding vectors. The behavior type embedding vector and the product embedding vector at each time step are concatenated along the feature dimension to obtain the mall behavior embedding vector. User account types are numerically encoded and one-hot encoded to generate account type embedding vectors; The preferred product categories are encoded using multi-label one-hot encoding to obtain the preferred product category embedding vector; the active time periods are numbered and encoded using one-hot encoding to obtain the active time embedding vector; and the price sensitivity is processed by min-max normalization to obtain the normalized price sensitivity. The user profile embedding vector is obtained by concatenating the account type embedding vector, preferred category embedding vector, active time embedding vector, and normalized price sensitivity at each time step. The on-chain behavior embedding vector, e-commerce behavior embedding vector, and user profile embedding vector at each time step are concatenated to obtain the target user feature vector, and then the target user feature vector sequence is formed according to the time step.

[0025] In this embodiment, step three specifically includes: In the time embedding module, the index of each time step is converted into a time position embedding vector through Time2Vec encoding; the target user feature vector of each time step is concatenated with the time position embedding vector, and then converted into a standard user feature vector through linear mapping and layer normalization; the linear mapping is used to unify the feature vector dimension of each time step. In the multi-granularity behavior co-occurrence module, three time windows of different lengths are set, and at each time step, average pooling is performed on the standard user feature vector sequences within the three time windows to obtain three granularity behavior co-occurrence vectors. The three granularity behavior co-occurrence vectors are concatenated, and a behavior co-occurrence enhancement vector is generated through linear mapping. The vectors are then organized into a sequence of behavior co-occurrence enhancement vectors according to time steps. Construct an on-chain relation bias matrix, and input the behavior co-occurrence enhancement vector sequence and the on-chain relation bias matrix into a masked self-attention encoder to perform masked self-attention modeling and generate a behavior feature vector sequence, specifically: The behavior co-occurrence enhancement vector sequence is transformed into a query matrix, a key matrix, and a value matrix through three sets of trainable mapping matrices; Define the causal mask matrix: if time step j is greater than time step i, then set the value of the element in the i-th row and j-th column of the causal mask matrix to negative infinity, indicating that the i-th time step is not allowed to access information of future time step j; if time step j is less than or equal to time step i, then set the value of the element in the i-th row and j-th column of the causal mask matrix to 0, indicating that the i-th time step can access information of the current or past time step j. Perform matrix multiplication on the query matrix and the key matrix, and scale according to the dimension of the key matrix to obtain the attention score matrix; The attention score matrix is ​​added element-wise to the on-chain relation bias matrix and the causal mask matrix to obtain the corrected attention score matrix. The corrected attention score matrix is ​​then subjected to Softmax normalization to obtain the attention weight matrix. Perform matrix multiplication on the attention weight matrix and the value matrix, and organize them into a sequence of behavioral attention vectors according to time steps; The behavioral attention vector sequence and the behavioral co-occurrence enhancement vector sequence are summed by residual addition and then subjected to layer normalization to obtain the behavioral feature vector sequence. In the integral state perception gating module, the integral balance, remaining validity period of the integral, integral change rate, and integral usage ratio at each time step are obtained to form an integral state vector; the integral state vector is then transformed into integral state gating coefficients through a linear mapping and the Sigmoid function. Based on the integral state gating coefficient, the behavior feature vector at each time step is multiplied element by element to obtain the gating behavior feature vector, and the gating behavior feature vector sequence is output according to the time step.

[0026] In this embodiment, the construction of the on-chain relation bias matrix specifically involves: Obtain the integral behavior type, contract semantic vector, and block height for time step i and time step j; the integral behavior type includes integral acquisition and integral consumption, and assign the value of integral acquisition to 1 and the value of integral consumption to -1; Calculate the product between the integral behaviors of time step i and time step j to obtain the consistency value of integral behavior; calculate the cosine similarity between the contract semantic vectors of time step i and time step j to obtain the contract semantic similarity value; calculate the absolute difference between the block heights of time step i and time step j, and perform a logarithmic decay transformation on the absolute difference to obtain the block height decay value. The on-chain relationship bias value between time step i and time step j is obtained by weighted summation of the integral behavior consistency value, contract semantic similarity value, and block height decay value, and then the on-chain relationship bias value is used as the element value of the i-th row and j-th column of the on-chain relationship bias matrix.

[0027] In this embodiment, step four specifically includes: The gating behavior feature vector sequence is input into the multi-task prediction module, which includes a behavior classification prediction head, a points consumption probability prediction head, a goods redemption probability prediction head, a user activity prediction head, and a risk behavior score prediction head. The behavior classification prediction head and the user activity prediction head each use a set of fully connected layers and a Softmax function to perform linear mapping and probability normalization on the gated behavior feature vector at each time step to obtain the behavior category prediction vector and the user activity prediction vector, respectively. The behavior category prediction vector has a dimension of 4, corresponding to the probability prediction values ​​of browsing behavior, clicking behavior, adding to cart behavior, and product redemption behavior, respectively. The user activity prediction vector has a dimension of 3, corresponding to the probability prediction values ​​of low activity, medium activity, and high activity states, respectively. The points consumption probability prediction head, the goods redemption probability prediction head, and the risk behavior score prediction head each use a set of fully connected layers and a Sigmoid function to perform linear mapping and probability compression on the gated behavior feature vector at each time step to obtain the points consumption prediction value, the goods redemption prediction value, and the risk behavior score value. The prediction results are composed of the behavior category prediction vector, user activity prediction vector, points consumption prediction value, product redemption prediction value, and risk behavior score value for all time steps.

[0028] In this embodiment, step five specifically includes: Extract the maximum component value of the behavior category prediction vector at each time step, and use it as the behavior prediction confidence. Extract the maximum component value of the user activity prediction vector at each time step, and use it as the user activity level; the user activity level includes high activity level, medium activity level and low activity level; Based on the risk behavior score at each time step, a symmetric distribution confidence mapping method is used to calculate the credibility of the risk behavior; the symmetric distribution confidence mapping method is specifically as follows: ; in, This represents the risk behavior score at time step t. Indicates the credibility of risky behavior. The value ranges from 0 to 1. The closer the value is to 1, the more certain the risk behavior score predictor is about the risk at time step t; when... When the score is close to 0.5, the confidence level of risk behavior is close to 0, indicating that the predictor of risk behavior is unclear. Set the sliding time window length, calculate the difference average of the integral consumption prediction value sequence within the sliding time window length, and obtain the integral change slope; The behavioral decision feature set is composed of the behavioral prediction confidence level, user activity level, risk behavior credibility, and score change slope of all time steps.

[0029] In this embodiment, the points mall operation strategy includes a product recommendation strategy, a points incentive strategy, and a risk warning strategy; The product recommendation strategy is as follows: Obtain the product embedding vector and the preference category embedding vector at each time step, calculate the cosine similarity between the product embedding vector and the preference category embedding vector to obtain the semantic matching score, and multiply the semantic matching score with the product redemption prediction value to obtain the product recommendation score at each time step. The product recommendation score is multiplied by the corresponding behavior prediction confidence score to generate a confidence product recommendation score; Based on the confidence product recommendation score, the set of candidate products is sorted in descending order; When the user's activity level is high, the top K1 candidate products are selected as the target recommended products; when the user's activity level is medium, the top K2 candidate products are selected as the target recommended products; when the user's activity level is low, the top K3 candidate products are selected as the target recommended products; where K1, K2, and K3 are the set number of recommendations, and ; The specific incentive strategy is as follows: Extract the integral consumption forecast, integral change slope, and normalized price sensitivity for each time step; Multiply the integral change slope by the set integral change trend coefficient to obtain the integral trend weighted value; multiply the normalized price sensitivity by the set price adjustment coefficient to obtain the price sensitivity weighted value. The integral consumption prediction value, the integral trend weighted value, and the price sensitivity weighted value are added together to obtain the integral incentive weight for each time step; The points incentive weight is multiplied by the set points return coefficient to obtain the points return ratio for the target user. The points return ratio is limited to the range of 0 to 1. When the points return ratio exceeds 1, the points return ratio is set to 1. The risk warning strategy specifically involves: extracting the risk behavior score and risk behavior credibility of each time step, and calculating the risk warning index; setting a risk threshold, and if the risk warning index is greater than or equal to the risk threshold, then marking the current time step as a high-risk state of user behavior. The high-risk state of user behavior is used to indicate that the target user has abnormal point consumption behavior, suspicious redemption behavior, or abnormal operation tendencies related to contract calls at the current time step.

[0030] In this embodiment, the actual behavior data includes actual behavior category labels, actual points consumption values, actual product redemption records, actual activity levels, and actual risk behavior scores; the actual behavior data is aligned with the multi-task prediction result set according to time steps to construct a supervision signal and perform supervised training on the improved BERT4Rec network; The loss function for supervised training includes: cross-entropy loss between the predicted behavior category probability distribution and the actual behavior category label; mean square error loss between the predicted point consumption value and the actual point consumption value; binary cross-entropy loss between the predicted value of goods redemption and the actual goods redemption record; multi-class cross-entropy loss between the user activity level and the actual activity level; and L1 loss between the risk behavior score value and the actual risk behavior score value.

[0031] Example 1 To verify the feasibility of this invention in practice, the method was applied to a blockchain points mall scenario operated by a large internet platform. This points mall is open to millions of registered users, who can earn blockchain points through daily check-ins, content interaction, and spending rewards, and use these points to redeem goods, offset benefits, or participate in platform activities. In this application scenario, the platform operator aims to predict in advance the types of user behavior, the probability of points consumption, and the tendency to redeem goods in the next stage, and dynamically adjust recommendation and points incentive strategies based on user activity and risk levels, thereby improving points utilization efficiency, reducing the risk of abnormal points consumption, and enhancing overall user stickiness.

[0032] During implementation, the platform selected six consecutive months of real business data as experimental samples, covering approximately 120,000 active users. First, it collected the target users' points acquisition records, points consumption records, block heights, and contract call types on the blockchain. Simultaneously, it acquired mall behavior data and user profile data for the corresponding time periods. The blockchain points data originated from the block synchronization interface of the consortium blockchain nodes, the mall behavior data from the mall log system, and the user profile data from the platform's user center. Data preprocessing was then used to create a sequence of target user feature vectors.

[0033] Subsequently, the target user feature vector sequence is input into the improved BERT4Rec network for temporal behavior modeling, outputting a gated behavior feature vector sequence. During the prediction phase, the gated behavior feature vector sequence generates behavior category prediction results, points consumption probability prediction results, product redemption probability prediction results, user activity prediction results, and risk behavior scoring results through the task prediction module. Further, based on the prediction results, behavior prediction confidence, user activity level, risk behavior credibility, and points change slope are calculated to form a behavior decision feature set. The platform generates product recommendation strategies, points incentive strategies, and risk warning strategies based on these results, and dynamically adjusts the displayed products, points return ratio, and abnormal behavior monitoring thresholds during actual operation. It also continuously collects real user behavior data generated in subsequent periods as a supervisory signal to supervise the training of the improved BERT4Rec network.

[0034] To verify the effectiveness of the method of the present invention, a comparative experiment was conducted with three comparative methods: Comparative method A: rule-based point operation method; Comparative method B: user behavior prediction method based on traditional collaborative filtering; Comparative method C: standard BERT4Rec method without introducing on-chain relation bias and point gating. The experimental results are shown in Table 1.

[0035] Table 1. Performance Comparison of Different Methods in Blockchain Points Mall Scenarios

[0036] As shown in Table 1, the method of this invention significantly outperforms the comparative methods in user behavior modeling and intelligent recommendation for the points mall. In terms of behavior category prediction accuracy, the method of this invention reaches 0.873, representing improvements of 25.2%, 17.5%, and 6.2% respectively compared to the comparative methods. In points consumption probability prediction, the AUC value of this invention reaches 0.902, far exceeding the comparative methods, indicating that the method of this invention has a stronger ability to discriminate points consumption behavior. In terms of product redemption prediction accuracy, the method of this invention reaches 0.846, demonstrating its superior accuracy in modeling user redemption intentions. In user activity level prediction, the F1 value of this invention is 0.834, better than the 0.795 of comparative method C, demonstrating its effective ability to identify users with different activity levels. In risk behavior identification, the recall rate reaches 0.791, significantly better than the comparative methods, indicating that this method has higher risk coverage capabilities. In points change trend modeling, the MAE value of this invention is 8.7, more than 22.3% lower than the comparative methods, significantly improving the fitting accuracy of points change trends. Regarding the improvement in click-through rate for recommended products, the method of this invention achieved an increase of 18.6%, higher than the 3.2%, 9.5%, and 14.1% of the comparative methods, demonstrating the advantage of this invention in personalized recommendation effectiveness. The method of this invention exhibits leading performance across multiple key indicators and has significant comprehensive application value.

[0037] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for predicting user behavior in a blockchain-based points mall based on artificial intelligence, characterized in that, Includes the following steps: Step 1: Collect blockchain points data, e-commerce behavior data, and user profile data of the target users; Step 2: Preprocess and embed the blockchain points data, e-commerce behavior data, and user profile data to generate a target user feature vector sequence; Step 3: Input the target user feature vector sequence into the improved BERT4Rec network to perform temporal behavior modeling processing and output the gated behavior feature vector sequence. The improved BERT4Rec network includes a temporal embedding module, a multi-granularity behavior co-occurrence module, a masked self-attention encoder, and an integral state-aware gating module. The masked self-attention encoder introduces an on-chain relation bias matrix. Step 4: Based on the gated behavior feature vector sequence, perform multi-task prediction through the multi-task prediction module and output a set of multi-task prediction results; Step 5: Based on the multi-task prediction result set, calculate the behavior prediction confidence, user activity level, risk behavior credibility, and score change slope, and output the behavior decision feature set; Step Six: Generate an operational strategy for the points mall based on the multi-task prediction result set and the behavioral decision feature set; Step 7: Collect actual behavioral data of the target users and use it as a supervisory signal to perform supervised training on the improved BERT4Rec network.

2. The method for predicting user behavior in a blockchain points mall based on artificial intelligence according to claim 1, characterized in that, Step one specifically includes: The blockchain points data includes points acquisition records, points consumption records, block height, and contract call type; The mall behavior data includes user behavior types and product identifiers. The user behavior types include browsing history, click history, shopping cart addition history, and product redemption history. The user profile data includes user account type, preferred product categories, active time periods, and price sensitivity.

3. The method for predicting user behavior in a blockchain points mall based on artificial intelligence according to claim 1, characterized in that, Step two specifically includes: The points value corresponding to the points acquisition record is recorded as a positive value, and the points value corresponding to the points consumption record is recorded as a negative value, which serves as the change in points at each time step. At each time step, the integral change is Z-score normalized and mapped to an integral change embedding vector through an MLP structure; the block height is min-max normalized and constructed into a time position embedding vector through sine and cosine position encoding; the contract call type is one-hot encoded to generate a contract semantic vector. The integral change embedding vector, time position embedding vector, and contract semantic vector at each time step are concatenated along the feature dimension to obtain the on-chain behavior embedding vector. User behavior types are numerically encoded to obtain the behavior type number for each time step; the behavior type number is then converted into a behavior type embedding vector through one-hot encoding. Product identifiers are vectorized and mapped using a trainable embedding lookup table to generate product embedding vectors. The behavior type embedding vector and the product embedding vector at each time step are concatenated along the feature dimension to obtain the mall behavior embedding vector. User account types are numerically encoded and one-hot encoded to generate account type embedding vectors; The preferred product categories are encoded using multi-label one-hot encoding to obtain the preferred product category embedding vector; the active time periods are numbered and encoded using one-hot encoding to obtain the active time embedding vector; and the price sensitivity is processed by min-max normalization to obtain the normalized price sensitivity. The user profile embedding vector is obtained by concatenating the account type embedding vector, preferred category embedding vector, active time embedding vector, and normalized price sensitivity at each time step. The on-chain behavior embedding vector, e-commerce behavior embedding vector, and user profile embedding vector at each time step are concatenated to obtain the target user feature vector, and then the target user feature vector sequence is formed according to the time step.

4. The method for predicting user behavior in a blockchain points mall based on artificial intelligence according to claim 1, characterized in that, Step three specifically includes: In the time embedding module, the index of each time step is converted into a time position embedding vector through Time2Vec encoding; the target user feature vector of each time step is concatenated with the time position embedding vector, and then converted into a standard user feature vector through linear mapping and layer normalization; the linear mapping is used to unify the feature vector dimension of each time step. In the multi-granularity behavior co-occurrence module, three time windows of different lengths are set, and at each time step, average pooling is performed on the standard user feature vector sequences within the three time windows to obtain three granularity behavior co-occurrence vectors. The three granularity behavior co-occurrence vectors are concatenated, and a behavior co-occurrence enhancement vector is generated through linear mapping. The vectors are then organized into a sequence of behavior co-occurrence enhancement vectors according to time steps. Construct an on-chain relation bias matrix, and input the behavior co-occurrence enhancement vector sequence and the on-chain relation bias matrix into a masked self-attention encoder to perform masked self-attention modeling and generate a behavior feature vector sequence, specifically: The behavior co-occurrence enhancement vector sequence is transformed into a query matrix, a key matrix, and a value matrix through three sets of trainable mapping matrices; Define the causal mask matrix: if time step j is greater than time step i, then set the value of the element in the i-th row and j-th column of the causal mask matrix to negative infinity; if time step j is less than or equal to time step i, then set the value of the element in the i-th row and j-th column of the causal mask matrix to 0. Perform matrix multiplication on the query matrix and the key matrix, and scale according to the dimension of the key matrix to obtain the attention score matrix; The attention score matrix is ​​added element-wise to the on-chain relation bias matrix and the causal mask matrix to obtain the corrected attention score matrix. The corrected attention score matrix is ​​then subjected to Softmax normalization to obtain the attention weight matrix. Perform matrix multiplication on the attention weight matrix and the value matrix, and organize them into a sequence of behavioral attention vectors according to time steps; The behavioral attention vector sequence and the behavioral co-occurrence enhancement vector sequence are summed by residual addition and then subjected to layer normalization to obtain the behavioral feature vector sequence. In the integral state perception gating module, the integral balance, remaining validity period of the integral, integral change rate, and integral usage ratio at each time step are obtained to form an integral state vector; the integral state vector is then transformed into integral state gating coefficients through a linear mapping and the Sigmoid function. Based on the integral state gating coefficient, the behavior feature vector at each time step is multiplied element by element to obtain the gated behavior feature vector, and the gated behavior feature vector sequence is output according to the time step.

5. The method for predicting user behavior in a blockchain points mall based on artificial intelligence according to claim 4, characterized in that, The constructed chain relation bias matrix is ​​specifically as follows: Obtain the integral behavior type, contract semantic vector, and block height for time step i and time step j; the integral behavior type includes integral acquisition and integral consumption, and assign the value of integral acquisition to 1 and the value of integral consumption to -1; Calculate the product between the integral behaviors of time step i and time step j to obtain the consistency value of integral behavior; calculate the cosine similarity between the contract semantic vectors of time step i and time step j to obtain the contract semantic similarity value; calculate the absolute difference between the block heights of time step i and time step j, and perform a logarithmic decay transformation on the absolute difference to obtain the block height decay value. The on-chain relationship bias value between time step i and time step j is obtained by weighted summation of the integral behavior consistency value, contract semantic similarity value, and block height decay value, and then the on-chain relationship bias value is used as the element value of the i-th row and j-th column of the on-chain relationship bias matrix.

6. The method for predicting user behavior in a blockchain points mall based on artificial intelligence according to claim 1, characterized in that, Step four specifically includes: The gating behavior feature vector sequence is input into the multi-task prediction module, which includes a behavior classification prediction head, a points consumption probability prediction head, a goods redemption probability prediction head, a user activity prediction head, and a risk behavior score prediction head. The behavior classification prediction head and the user activity prediction head respectively use a set of fully connected layers and a Softmax function to perform linear mapping and probability normalization on the gated behavior feature vector at each time step to obtain the behavior category prediction vector and the user activity prediction vector. The points consumption probability prediction head, the goods redemption probability prediction head, and the risk behavior score prediction head each use a set of fully connected layers and a Sigmoid function to perform linear mapping and probability compression on the gated behavior feature vector at each time step to obtain the points consumption prediction value, the goods redemption prediction value, and the risk behavior score value. The prediction results are composed of the behavior category prediction vector, user activity prediction vector, points consumption prediction value, product redemption prediction value, and risk behavior score value for all time steps.

7. The method for predicting user behavior in a blockchain points mall based on artificial intelligence according to claim 1, characterized in that, Step five specifically includes: Extract the maximum component value of the behavior category prediction vector at each time step, and use it as the behavior prediction confidence. Extract the maximum component value of the user activity prediction vector at each time step, and use it as the user activity level; the user activity level includes high activity level, medium activity level and low activity level; Based on the risk behavior score at each time step, the confidence level of risk behavior is calculated using a symmetric distribution confidence mapping method. Set the sliding time window length, calculate the difference average of the integral consumption prediction value sequence within the sliding time window length, and obtain the integral change slope; The behavioral decision feature set is composed of the behavioral prediction confidence level, user activity level, risk behavior credibility, and score change slope of all time steps.

8. The method for predicting user behavior in a blockchain points mall based on artificial intelligence according to claim 1, characterized in that, The points mall operation strategy includes product recommendation strategy, points incentive strategy, and risk warning strategy; The product recommendation strategy is as follows: Obtain the product embedding vector and the preference category embedding vector at each time step, calculate the cosine similarity between the product embedding vector and the preference category embedding vector to obtain the semantic matching score, and multiply the semantic matching score with the product redemption prediction value to obtain the product recommendation score at each time step. The product recommendation score is multiplied by the corresponding behavior prediction confidence score to generate a confidence product recommendation score; Based on the confidence product recommendation score, the set of candidate products is sorted in descending order; When a user's activity level is high, the top K1 candidate products are selected as the target recommended products. When the user's activity level is medium-active, select the top K2 candidate products as the target recommended products; When a user's activity level is low, the top K3 candidate products are selected as the target recommended products; where K1, K2, and K3 are the set number of recommendations, and ; The specific incentive strategy is as follows: Extract the integral consumption forecast, integral change slope, and normalized price sensitivity for each time step; Multiply the slope of the integral change by the set coefficient of the integral change to obtain the integral trend weighted value; The normalized price sensitivity is multiplied by the set price adjustment coefficient to obtain the price sensitivity weighted value; The integral consumption prediction value, the integral trend weighted value, and the price sensitivity weighted value are added together to obtain the integral incentive weight for each time step; The points incentive weight is multiplied by the set points return coefficient to obtain the points return ratio for the target user. The points return ratio is limited to the range of 0 to 1. When the points return ratio exceeds 1, the points return ratio is set to 1. The risk warning strategy specifically involves: extracting the risk behavior score and risk behavior credibility at each time step, and calculating the risk warning index; Set a risk threshold. If the risk warning index is greater than or equal to the risk threshold, mark the current time step as a high-risk state of user behavior.

9. The method for predicting user behavior in a blockchain points mall based on artificial intelligence according to claim 1, characterized in that, The actual behavior data includes actual behavior category tags, actual points consumption value, actual product redemption records, actual activity level and actual risk behavior score; The actual behavior data is aligned with the multi-task prediction result set according to the time step to construct a supervision signal, and the improved BERT4Rec network is trained under supervision.