Time series data trend prediction method based on semantic incremental update
Patent Information
- Application Number
- CN202611495620.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-10-30
AI Technical Summary
[0006]本发明提供了基于语义增量更新的时序数据趋势预测方法,目的在于解决现有技术中因缺乏对预测模型更新时机的精准判断,导致周期性全量重训计算资源消耗大或因模型更新滞后致使预测精度持续下降的技术问题
本发明提供了基于语义增量更新的时序数据趋势预测方法,通过获取多个产品品类的用户交互数据并输入预训练的多品类时序预测模型以输出趋势预测结果,在此基础上根据点击率序列生成语义描述文本并将语义描述文本编码为语义向量,通过获取历史语义向量滑动窗口并根据历史语义向量滑动窗口与语义向量计算语义漂移量,实现对数据分布变化程度的量化度量;通过统计语义漂移量连续超过预警阈值的累计持续周数,将累计持续周数达到预设周数的产品品类组成漂移事件组,并对漂移事件组内的语义漂移量进行加权聚合得到综合漂移评分,实现从漂移程度、持续时间和品类重要性三个维度对数据分布结构性变化的综合判定;当综合漂移评分超过触发阈值时,对多品类时序预测模型进行局部增量更新,继续输出趋势预测结果。本发明实现了更新时机的精准判断,避免因响应短期噪声执行不必要更新或因更新滞后导致预测精度下降,同时局部增量更新相比全量重训减少了计算资源消耗。
Smart Images

Figure CN123015084A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of time series data processing technology, and more specifically to a method for predicting the trend of time series data based on semantic incremental updates. Background Technology
[0002] With the development of e-commerce, social media, and digital retail, fashion products such as clothing, footwear, bags, and accessories have accumulated a wealth of digital data during their design, sales, and dissemination. This data includes product images, product attributes, user browsing, favorites, searches, purchases, reviews, and social media sharing. How to utilize multi-source fashion data to accurately predict future trends and provide decision support for product design, merchandise planning, inventory management, precision marketing, and on-demand production has become an important research direction for the digital development of the fashion industry.
[0003] Existing fashion trend forecasting methods mainly include human experience-based judgment and data-driven forecasting methods. Traditional human forecasting relies primarily on designers, buyers, or industry analysts to judge trends based on market experience and changes in popular culture. While this method can combine industry knowledge and aesthetic experience, it is highly subjective and struggles to handle the massive amount of fine-grained fashion elements and the complex preferences among different consumer groups.
[0004] In recent years, with the development of machine learning and deep learning technologies, trend prediction methods based on time series data have gradually become mainstream. In the field of time series trend prediction, existing techniques typically employ statistical models or machine learning models based on historical data for prediction. Statistical models estimate future values by fitting trend, periodic, and residual terms in historical sequences, while machine learning models learn the temporal dependencies in historical sequences by constructing multi-layered nonlinear mappings, achieving end-to-end prediction of future values. After training, these models are usually deployed with fixed parameters, directly using the input data to output the corresponding prediction results.
[0005] In practical applications, the distribution characteristics of time-series data change dynamically over time. However, once the aforementioned model is trained, it maintains fixed parameters. When the data distribution changes, the prediction accuracy of the fixed-parameter prediction model will continuously decline. Existing technologies typically update the model by periodically retraining the entire dataset or through online learning after the model's accuracy declines. However, such update methods lack a precise mechanism for judging the timing of updates, and cannot distinguish between normal random fluctuations in the data and structural changes that may lead to model failure. This results in updates lagging behind actual changes in the data distribution, or unnecessary updates being performed in response to short-term noise, leading to a waste of computational resources. Summary of the Invention
[0006] This invention provides a time-series data trend prediction method based on semantic incremental updates, aiming to solve the technical problems in the prior art, such as the lack of accurate judgment on the timing of prediction model updates, which leads to high computational resource consumption during periodic full retraining or a continuous decline in prediction accuracy due to model update lag.
[0007] In view of the above problems, the present invention provides a method for predicting the trend of time series data based on semantic incremental updates, including: Acquire user interaction data for multiple product categories, input the user interaction data into a pre-trained multi-category time series prediction model, and output trend prediction results. The user interaction data includes click-through rate sequences and user feature data for multiple product categories at consecutive time points. Semantic description text is generated based on the click-through rate sequence, the semantic description text is encoded into a semantic vector, and a historical semantic vector sliding window is obtained. The semantic drift is calculated based on the historical semantic vector sliding window and the semantic vector. The cumulative number of weeks in which the semantic drift exceeds the preset warning threshold is counted. Product categories that have reached the preset number of weeks in cumulative duration are grouped into drift event groups, and the semantic drift within the drift event groups is weighted and aggregated to obtain a comprehensive drift score. When the overall drift score exceeds the preset trigger threshold, the multi-category time series prediction model is locally incrementally updated, and the trend prediction results are continued to be output.
[0008] One or more technical solutions provided in this invention have at least the following technical effects or advantages: This invention provides a method for predicting time-series data trends based on semantic incremental updates. It acquires user interaction data from multiple product categories and inputs it into a pre-trained multi-category time-series prediction model to output trend prediction results. Based on this, semantic description text is generated according to the click-through rate sequence and encoded into semantic vectors. A historical semantic vector sliding window is obtained, and semantic drift is calculated based on the historical semantic vector sliding window and the semantic vectors, achieving a quantitative measurement of the degree of change in data distribution. By statistically analyzing the cumulative number of weeks in which semantic drift exceeds a warning threshold, product categories that have reached a preset number of weeks are grouped into drift event groups. The semantic drift within each drift event group is weighted and aggregated to obtain a comprehensive drift score, achieving a comprehensive judgment of structural changes in data distribution from three dimensions: drift degree, duration, and category importance. When the comprehensive drift score exceeds a trigger threshold, a local incremental update is performed on the multi-category time-series prediction model, continuing to output trend prediction results. This invention achieves accurate judgment of update timing, avoiding unnecessary updates due to short-term noise or decreased prediction accuracy due to update lag. Furthermore, local incremental updates reduce computational resource consumption compared to full retraining. Attached Figure Description
[0009] Figure 1 A flowchart illustrating the time-series data trend prediction method based on semantic incremental update provided in an embodiment of the present invention; Figure 2 A schematic diagram of the overall logic of the time-series data trend prediction method based on semantic incremental update provided in an embodiment of the present invention; Figure 3 A schematic diagram of the structure of a time-series data trend prediction system based on semantic incremental update provided in an embodiment of the present invention; The components represented by each number in the attached diagram are explained below: Trend prediction module 11, semantic drift calculation module 12, drift event determination module 13, incremental update module 14. Detailed Implementation
[0010] This invention provides a time-series data trend prediction method based on semantic incremental updates, which addresses the technical problems in existing technologies where the lack of accurate judgment on the timing of prediction model updates leads to high computational resource consumption during periodic full retraining or a continuous decline in prediction accuracy due to model update lag.
[0011] It should be noted in advance that all data acquisition and processing in this invention are carried out with the consent of the authorized administrator and in accordance with legal provisions.
[0012] Example 1, as Figure 1 , Figure 2 As shown, this invention provides a method for predicting the trend of time-series data based on semantic incremental updates. The method includes: S100: Acquire user interaction data for multiple product categories, input the user interaction data into a pre-trained multi-category time series prediction model, and output trend prediction results. The user interaction data includes click-through rate sequences and user feature data for multiple product categories at consecutive time points.
[0013] In this embodiment of the invention, to accurately capture the differentiated interest distribution of different user groups across multiple product categories, a predictive model capable of simultaneously processing user feature information and product category temporal change information needs to be constructed. The multi-category temporal prediction model assigns user feature encoding and product category temporal feature encoding to two independent sub-networks. The user-side network maps user demographic attributes to user representation vectors, while the category-side network maps the historical click-through rate sequences of each product category to category representation vectors. By calculating the similarity between the user representation vector and each category representation vector, the click-through rate of the user group for each category is predicted, providing an accurate initial prediction baseline for subsequent semantic drift detection and incremental updates.
[0014] Step S100 in the method provided in this embodiment of the invention includes: Construct and train a multi-category time series prediction model. The initial multi-category time series prediction model includes a user-side network and a category-side network. The system acquires user interaction data from multiple product categories and inputs it into a multi-category time-series prediction model. The user-side network takes user feature data as input and outputs user representation vectors, while the category-side network takes click-through rate sequences from multiple product categories as input and outputs category representation vectors for multiple product categories. The user representation vector is fused with the category representation vectors of multiple product categories to obtain the click-through rate prediction values of multiple product categories at the next time point, which are used as the trend prediction results.
[0015] First, a multi-category time-series prediction model is constructed and trained. The initial multi-category time-series prediction model includes a user-side network and a category-side network.
[0016] This includes constructing and training a multi-category time-series prediction model, including: Acquire historical training data, which includes historical click-through rate sequences and corresponding historical user characteristic data for multiple product categories within historical time windows. An initial multi-category time-series prediction model is constructed, which includes a user-side network and a category-side network. A multi-category time-series prediction model is trained using historical training data. User feature data is input into the user-side network to obtain the user representation vector, and the click-through rate sequence is input into the category-side network to obtain the category representation vector. The user representation vector and the category representation vector are fused to obtain the click-through rate prediction value. The loss function value is calculated based on the predicted click-through rate (CTR) and the historical CTR in the historical training data. The parameters of the user-side network and the category-side network are updated according to the loss function value. The iteration continues until the training stopping condition is met, and a multi-category time-series prediction model is obtained.
[0017] First, historical training data is acquired. This data includes historical click-through rate (CTR) sequences for multiple product categories within historical time windows, along with corresponding historical user characteristic data. Historical training data refers to the set of historical samples used to train the multi-category time-series prediction model. Each historical sample contains a CTR sequence for a product category within a preset historical time window, along with corresponding user characteristic data. The CTR sequence reflects the change of that product category over time within a specific user segment, while the user characteristic data describes the demographic attributes of that user segment. A user segment refers to a group of users divided according to demographic dimensions such as city, gender, and age. For example, "Hangzhou + Female + 25-35 years old" represents a user segment containing all users located in Hangzhou who are female and aged between 25 and 35. The historical time window refers to the length of the continuous time interval used to construct the training samples. For example, a historical time window of 12 weeks means that data from 12 consecutive weeks is used as the length of a historical sequence for a single sample.
[0018] Specifically, historical click-through rate (CTR) sequences and corresponding historical user feature data for multiple product categories within a preset historical time window are obtained to form historical training data. For each product category and each user segment combination, the CTR of that product category within that user segment is calculated for each consecutive week. The CTRs for multiple consecutive weeks are arranged in chronological order to form the historical CTR sequence of that product category under that user segment. For each user segment, user feature tags for that segment are obtained, including discrete attributes such as city, gender, and age range. These discrete attributes are then converted into numerical feature vectors after one-hot encoding.
[0019] The click-through rate (CTR) is calculated as follows: the number of clicks for a product category within a user segment is divided by the total number of clicks for all product categories within that user segment, multiplied by 100 to obtain the percentage value. Before inputting the data into the model, the CTR sequence is normalized. The normalization method is as follows: for each product category, calculate the global mean and global standard deviation of its historical CTR across all user segments. Subtract the global mean from the original CTR value and then divide by the global standard deviation to obtain the normalized value. The predicted value output by the model is a value in the normalized space. When calculating the loss function, the predicted value is denormalized back to the CTR value in the original space, and then the loss is calculated by comparing it with the actual CTR. During denormalization, the predicted CTR in the normalized space is multiplied by the pre-calculated global standard deviation and then added to the global mean to obtain the predicted CTR value in the original dimensions. Since both the user representation vector and the category representation vector are normalized using the L2 norm, the theoretical range of their inner product is […]. [1,1] When the inner product is negative, it indicates that the user group's interest in the product category is lower than the average level.
[0020] For each combination of a product category and a user group, from a historical click-through rate sequence with a length of T weeks, by using a fixed window length L (L<T) and a sliding step of 1 week, each consecutive L-week click-through rate subsequence is sequentially extracted as time series data of one training sample, and the click-through rate of the week immediately following this subsequence is taken as the label value of this sample. All sliding window samples under all combinations of product categories and user groups constitute the complete historical training data. The historical training data is divided into a training set, a validation set and a test set in chronological order at a division ratio of 7:1:2. The chronological order is maintained during division, and random shuffling is not used, so as to prevent future information from leaking into the training process.
[0021] Exemplarily, the historical training dataset includes 5 product categories and 10 user groups. For each combination of a product category and a user group, the platform records the click-through rate data of this combination over 60 consecutive weeks. Taking the product category of sun-protective clothing and the user group of Hangzhou + female + 25-35 years old as an example, the click-through rate sequence of this combination within 60 weeks is: 3.2% in Week 1, 3.8% in Week 2, 4.5% in Week 3, ..., 22.0% in Week 60. The user feature data corresponding to this user group is: city = Hangzhou (encoded as the vector [1,0,0,0,0]), gender = female (encoded as [0,1]), age range = 25-35 years old (encoded as [0,0,1,0,0]). Training samples are constructed from the 60-week click-through rate sequence in a sliding window manner, the historical time window length is set to 12 weeks, the sliding step is 1 week, and the click-through rate of the week after each window is taken as the prediction label. For the sequence with a length of 60 weeks, the last valid 12-week input window is from Week 48 to Week 59, with Week 60 as the label, so each combination of a product category and a user group can generate 60 -12=48 training samples. 5 product categories and 10 user groups generate a total of 5×10×48=2400 samples. The 2400 samples are divided into a training set, a validation set and a test set in chronological order at a division ratio of 7:1:2. The training set contains 1680 samples, the validation set contains 240 samples, and the test set contains 480 samples.
[0022] Next, an initial multi-category time series prediction model is constructed, and the initial multi-category time series prediction model includes a user-side network and a category-side network. The initial multi-category time series prediction model refers to a deep learning model comprising two sub-networks: the user-side network and the category-side network. The user-side network is responsible for encoding user feature data into a user representation vector, and the category-side network is responsible for encoding the click-through rate sequence of the product category into a category representation vector.
[0023] The user-side network refers to the neural network sub-network that takes user feature data as input. The user-side network maps discrete user attribute features into a dense vector of fixed dimensions, called the user representation vector. The category-side network refers to the neural network sub-network that takes the historical click-through rate sequence of product categories as input. The category-side network maps a fixed-length time series sequence into a dense vector of fixed dimensions, called the category representation vector.
[0024] Specifically, an initial multi-category time-series prediction model is constructed, comprising two sub-networks: a user-side network and a category-side network. The user-side network maps the input user feature data into user representation vectors; the category-side network maps the input product category click-through rate sequence into category representation vectors.
[0025] The user-side network structure is as follows: An input layer receives user feature data, with the input dimension equal to the total number of features in the user feature data. Following the input layer is a first fully connected layer with 128 neurons and a rectified linear unit (RCU) activation function. After the first fully connected layer is a second fully connected layer with 64 neurons and an RCU activation function. The output of the second fully connected layer is normalized using the L2 norm to obtain a 64-dimensional user representation vector.
[0026] The category-side network structure is as follows: The input layer receives the click-through rate sequence of product categories within a historical time window, with a sequence length of 12. Following the input layer is a Long Short-Term Memory (LSTM) network layer, which has 64 hidden states and one layer. The output of the LSM layer at the last time step serves as the temporal feature vector for this sequence. This temporal feature vector is then connected to a fully connected layer with 64 neurons and a modified linear unit (MRU) activation function. The output of the fully connected layer is normalized using the L2 norm to obtain a 64-dimensional category representation vector. It should be noted that in the weight matrix of the fully connected layer's output layer, each row corresponds to the generation of a category representation vector for a single product category, and the row vectors for each product category are independent during training.
[0027] Next, a multi-category time-series prediction model is trained using historical training data. User feature data is input into the user-side network to obtain user representation vectors, and click-through rate (CTR) sequences are input into the category-side network to obtain category representation vectors. The user representation vectors and category representation vectors are then fused to obtain the predicted CTR value. The similarity between the output vectors of the user-side network and the category-side network is calculated through inner product operation and used as the predicted CTR value.
[0028] For example, the input to the user-side network is the feature data of the user group "Hangzhou + Female + 25-35 years old". Assuming the user feature data, after encoding, becomes a 200-dimensional numerical vector, this vector is input to the user-side network, passes through a first fully connected layer and a second fully connected layer, and then undergoes L2 norm normalization to obtain a 64-dimensional user representation vector. The input to the category-side network is the normalized value of the click-through rate sequence of the sun protection clothing product category over a historical 12-week period [3.2, 3.8, 4.5, 5.5, 6.8, 8.2, 10.0, 12.0, 14.5, 17.0, 19.5, 22.0] (unit: %). This sequence is input to a Long Short-Term Memory (LSTM) network layer, and the hidden state at the last time step is a 64-dimensional temporal feature vector. This vector is then passed through a fully connected layer and L2 norm normalization to obtain a 64-dimensional category representation vector for the sun protection clothing category. The user representation vector u is multiplied by the category representation vector of the sun protection clothing category, and the final product is 0.85. This product result of 0.85 is the predicted click-through rate of the sun protection clothing product category in the Hangzhou + female + 25-35 year old user segment.
[0029] Finally, the loss function value is calculated based on the predicted click-through rate (CTR) and the historical CTR in the historical training data. The parameters of the user-side network and the category-side network are updated according to the loss function value. This process is iterated until the training stopping condition is met, resulting in a multi-category time-series prediction model. In each iteration, training samples are input into the model, the loss function value between the model's predicted output and the true value is calculated, and then the gradient of the loss function value with respect to the model parameters is calculated using the backpropagation algorithm. Finally, the model parameters are updated based on the gradient direction using an optimization algorithm.
[0030] The loss function value measures the difference between the model's predicted values and the actual values. A smaller loss function value indicates a more accurate prediction. The training stopping condition refers to the conditions that terminate model training. When a preset condition is met, the training process stops, and the current model parameters become the final training result. This scheme uses early stopping, meaning training is terminated early when the loss function value on the validation set no longer decreases after several consecutive iterations to prevent overfitting. An iteration refers to traversing all training set samples once. Each iteration contains multiple batches, and each batch contains a fixed number of samples.
[0031] Specifically, an initial multi-category time-series prediction model is first trained using historical training data. A batch of training samples is sampled from the historical training data; each training sample contains a click-through rate (CTR) sequence for a product category within a historical time window and its corresponding user feature data. The sampled user feature data is input into the user-side network, and after forward propagation, a user representation vector is output. The sampled CTR sequence is input into the category-side network, and after forward propagation, a category representation vector is output. The dot product operation is performed between the user representation vector and the category representation vector to obtain the predicted CTR value for that product category.
[0032] Secondly, the loss function value is calculated based on the predicted click-through rate (CTR) and the actual CTR from historical training data. The mean squared error (MSE) loss function is used, and the calculation formula is as follows: Where N is the number of samples in the batch. Let be the predicted click-through rate value for the i-th sample. Let be the historical true click-through rate of the i-th sample.
[0033] Next, based on the loss function value, the gradient of the loss function value with respect to the user-side network parameters and the category-side network parameters is calculated using the backpropagation algorithm. An adaptive moment estimation (IME) optimization algorithm is then employed to update the parameters of the user-side and category-side networks based on the calculated gradient directions. The first-order moment decay coefficient of the IEM optimization algorithm is set to 0.9, the second-order moment decay coefficient is set to 0.999, and the learning rate is set to... .
[0034] Repeat the above steps until the training stopping condition is met. The training stopping condition is: when the loss function value on the validation set no longer decreases for 10 consecutive iterations, training is terminated early. After training is complete, save the current model parameters to obtain the trained multi-category time series prediction model.
[0035] For example, a batch of samples is sampled from the training set, with batch size N=32, containing 32 training samples. Taking one sample as an example: the product category of sun protection clothing, the user segment of Hangzhou + female + 25-35 years old, and the historical 12-week click-through rate sequence. User feature data is input into the user-side network, resulting in the user representation vector u=[0.12,-0.34,0.56,...]. The click-through rate sequence of the sun protection clothing category is input into the category-side network, resulting in the category representation vector=[0.34,-0.12,0.78,...]. The inner product operation yields a predicted click-through rate of 0.85. The actual click-through rate of this sample is 0.92. The loss value for this sample is calculated as follows: The average loss values of the 32 samples in the batch are calculated to obtain the loss function value L = 0.0052 for that batch. Based on the loss function value L = 0.0052, the gradient of the loss function value with respect to the parameters of the user-side network and the category-side network is calculated through backpropagation. The adaptive moment estimation optimization algorithm is then applied with a learning rate of... Update the parameters of the user-side network and the category-side network. Repeat the above process. After the 51st iteration, the validation set loss value is 0.0022, which no longer decreases compared to the 50th iteration; the validation set loss value is not lower than 0.0021 for 10 consecutive iterations, satisfying the early stopping condition, and training terminates. Save the model parameters of the 50th iteration as the final multi-category time series prediction model.
[0036] Furthermore, user interaction data for multiple product categories is acquired and input into a multi-category time-series prediction model. The user-side network takes user feature data as input and outputs user representation vectors, while the category-side network takes click-through rate sequences of multiple product categories as input and outputs category representation vectors for multiple product categories. User interaction data for multiple product categories to be predicted on the target platform is acquired. This user interaction data includes click-through rate sequences and user feature data for multiple product categories at consecutive time points. The acquired click-through rate sequences are input into the category-side network of the trained multi-category time-series prediction model, and the category-side network outputs category representation vectors for multiple product categories. The acquired user feature data is input into the user-side network of the trained multi-category time-series prediction model, and the user-side network outputs user representation vectors.
[0037] Finally, the user representation vector is fused with the category representation vectors of multiple product categories to obtain the predicted click-through rate (CTR) values for multiple product categories at the next time point, which serves as the trend prediction result. The trend prediction result refers to the predicted CTR values for each product category at the next time point by the multi-category time-series prediction model. The trend prediction result is a numerical vector, where each element corresponds to the predicted CTR value for a product category at a future time point. The next time point refers to the next unit of time after the current input sequence; in this embodiment, it is the next week.
[0038] Specifically, the user representation vector is multiplied by the category representation vectors of multiple product categories to obtain the predicted click-through rate (CTR) value for each product category at the next time point. The predicted CTR values for all product categories are then organized by product category to form a trend prediction result.
[0039] For example, taking the user segment of "Hangzhou + Female + 25-35 years old" as an example, we obtain the current time window, i.e., the click-through rate sequence of the most recent 12 weeks, for five product categories under this user segment: sun protection clothing, sunglasses, sandals, dresses, and down jackets. We input the user characteristic data "Hangzhou + Female + 25-35 years old" into the user-side network to obtain the user representation vector u. We then input the click-through rate sequences of the five product categories into the category-side network to obtain the five category representation vectors. , , , , Calculate the inner product of the user representation vector u with the representation vectors of each category: , , , , The above values represent the predicted click-through rates (CTR) for the five product categories in the following week. For predictions at multiple future time points, an autoregressive recursive prediction method is used: the predicted value from the previous time point is used as the last value of the input sequence for the next time point, iteratively generating the prediction results for weeks 1, 2, 3, and 4. The trend prediction results are as follows: CTR predicted for sun-protective clothing is 0.85, for sunglasses is 0.72, for sandals is 0.68, for dresses is 0.45, and for down jackets is 0.32.
[0040] In this embodiment of the invention, a multi-category time-series prediction model was constructed and trained. The model employs a user-side network and a category-side network to independently encode user features and category time-series features, respectively, and calculates the matching degree between users and categories through inner product operations. The user-side network and the category-side network are optimized for the characteristics of their respective input data. The user-side network extracts group interest representations from user attributes, while the category-side network extracts category evolution pattern representations from the time-series sequence. Model training uses a mean squared error loss function and an adaptive moment estimation optimization algorithm. On the validation set, early stopping is used to determine the convergence timing, avoiding overfitting. After training, the model can output predicted click-through rates for each product category within a future time window based on the input user feature data and the click-through rate sequence of each product category, providing an initial prediction baseline for subsequent semantic drift detection and incremental updates.
[0041] S200: Generate semantic description text based on the click-through rate sequence, encode the semantic description text into a semantic vector, obtain a historical semantic vector sliding window, and calculate the semantic drift based on the historical semantic vector sliding window and the semantic vector.
[0042] In this embodiment of the invention, the numerical click-through rate sequence is transformed into a structured natural language description and then encoded into a semantic vector. This allows for the capture of changes in data distribution from high-level semantic dimensions such as trend direction, fluctuation level, and turning points. However, the semantic vector of a single time window only reflects the data distribution state of the current period and cannot determine whether this state has deviated significantly from the historical normal state. Therefore, it is necessary to maintain a historical semantic vector sliding window to store the semantic vectors of each product category in the most recent historical time windows. The degree of semantic drift is quantified by calculating the distance between the current semantic vector and the historical semantic centroid. The amount of semantic drift is used as a quantitative basis for subsequently determining whether the prediction model needs incremental updates.
[0043] It should be noted that the semantic drift calculation in this embodiment is based on the combination of (product category, user segment) as the basic granularity. That is, for each combination of product category and user segment, a click-through rate sequence is generated for that combination, the corresponding semantic vector is encoded, and the semantic drift is calculated separately for each combination. For example, the semantic drift of the sun protection clothing product category is calculated independently for each of the Hangzhou + female + 25-35 year old user segment and the Beijing + female + 25-35 year old user segment, rather than aggregating the data from all user segments and calculating a single drift. This granularity ensures that subsequent steps can accurately pinpoint the subject of semantic drift to the specific user segment.
[0044] Step S200 in the method provided in this embodiment of the invention includes: Specifically, semantic description text is generated based on the click-through rate sequence, and the semantic description text is encoded into a semantic vector, including: The click rate sequence is input into a pre-trained language model to generate trend semantic description text, which includes the overall trend direction, the degree of fluctuation, the location of major turning points, and the recent changes. The trend semantic description text is input into a pre-trained language encoder, which maps the trend semantic description text into a fixed-dimensional semantic vector.
[0045] First, the click-through rate sequence is input into a pre-trained language model to generate trend semantic description text. This text includes the overall trend direction, the degree of fluctuation, the location of major turning points, and recent changes. The pre-trained language model refers to a natural language processing model pre-trained on a large-scale text corpus, possessing text understanding and generation capabilities. The pre-trained language model takes textual prompts as input and the generated natural language text as output. In this embodiment, the pre-trained language model is used to convert the numerical click-through rate sequence into structured trend semantic description text.
[0046] The trend semantic description text refers to natural language text in structured JSON format that describes the trend characteristics of the click-through rate sequence. The trend semantic description text contains four fields: overall trend direction, volatility, major turning points, and recent changes. The overall trend direction describes the dominant direction of change within the historical time window; the volatility describes the dispersion or oscillation amplitude of the sequence values around the trend line; the major turning points describe the points in time when the trend underwent significant directional changes; and the recent changes describe the state of the sequence at the end of the historical time window.
[0047] Specifically, the click-through rate (CTR) sequences of each product category obtained in S100 are input into a pre-trained language model to generate trend semantic description text for each product category. In this embodiment, the pre-trained language model adopts an autoregressive language model based on the Transformer decoder architecture, containing 175 billion parameters, 96 layers, and 12288 hidden dimensions. Prompt words containing CTR sequence values and metadata information are constructed and used as input to the pre-trained language model. After receiving the prompt words, the pre-trained language model generates a structured JSON object according to a preset output format. This JSON object contains four fields: overall trend direction, fluctuation intensity, major turning point locations, and recent change trends. The trend semantic description text generated by the pre-trained language model is generated solely based on the input historical CTR sequences and metadata, without involving predictions of future values or introducing external knowledge. The generated description text focuses on summarizing the trend characteristics of existing historical data.
[0048] The prompt template is as follows: "You are a time series data analysis expert. Please analyze the click-through rate (CTR) sequence data of the following [Product Category Name] product within the [User Segmentation Tag] user segment and the most recent [Historical Time Window Length] weeks, and output the trend analysis results in JSON format. CTR sequence (arranged in chronological order, unit: %): [Comma-separated list of CTR values]. Based on this sequence, please analyze and output the following fields: Overall trend direction (optional: continuous rise / continuous fall / oscillating upward / oscillating downward / sideways consolidation / rise then fall / fall then rise), volatility (optional: low / medium / high), main turning point location (optional: none / after week X / near week X, where X is the specific week number), recent change trend (optional: accelerating rise / decelerating rise / accelerating fall / decelerating fall / tending to stability / no obvious trend). The output format is structured JSON."
[0049] In this configuration, [Product Category Name] is replaced with the name of the product category currently being analyzed, [User Segmentation Label] is replaced with the user segmentation label currently being analyzed, [Historical Time Window Length] is replaced with the week number of the input sequence, and [Comma-Separated List of Click-Through Rate Values] is replaced with the click-through rate values for each week, retaining two decimal places. After receiving the prompt words, the pre-trained language model generates a structured JSON object according to the preset output format. To ensure stable descriptive output even with repeated input of the same sequence, the temperature parameter during the generation process is set to 0.0, sampling is disabled, and the seed value is fixed at 42.
[0050] In this embodiment of the invention, to ensure that the determination of each qualitative field in the trend semantic description text has a reproducible quantitative standard, the following determination rule is embedded in the pre-trained language model: the overall trend direction is determined based on the slope of the linear regression at both ends of the sequence; a slope greater than 0.01 indicates a continuous upward trend, and a slope less than 0.01 indicates a downward trend. A value of 0.01 indicates a continuous decline, while an absolute value not exceeding 0.01 indicates sideways consolidation. When the overall sequence exhibits a fluctuating upward trend, it is considered an upward oscillation; when the overall sequence exhibits a fluctuating downward trend, it is considered a downward oscillation. If the sequence shows a pattern of first rising and then falling or first falling and then rising, the corresponding output is "first rising and then falling" or "first falling and then rising." The degree of fluctuation is determined by the ratio of the standard deviation of the detrended residuals to the mean of the sequence: a ratio less than 0.05 is low, 0.05 to 0.15 is medium, and greater than 0.15 is high. The location of major turning points is determined by calculating the first difference of the sequence at each time point and comparing the change in the sign of the difference values. When the signs of two consecutive difference values are opposite to the overall trend direction and the absolute value of the difference exceeds twice the slope of the overall trend, this position is marked as a major turning point. Recent trends are determined based on the ratio of the linear regression slope of the last three weeks of the sequence to the overall slope of the 12-week sequence. A ratio greater than 1.2 indicates accelerating upward / decreasing trends, a ratio less than 0.8 indicates decelerating upward / decreasing trends, and a ratio between 0.8 and 1.2 indicates a trend towards stabilization. The language model generates natural language descriptions for each field based on these rules.
[0051] For example, taking the sun protection clothing product category under the Hangzhou + female + 25-35 age group as an example, the click-through rate sequence for this combination in the past 12 weeks is [3.2, 3.8, 4.5, 5.5, 6.8, 8.2, 10.0, 12.0, 14.5, 17.0, 19.5, 22.0]. Construct prompts containing the numerical values of the click-through rate sequence and metadata information such as the product category name. Input the prompts into a pre-trained language model. The pre-trained language model generates the following trend semantic description text: Overall trend direction: continuous rapid increase; Fluctuation intensity: low, showing a smooth accelerating upward curve; Major turning point: the growth rate significantly accelerated after week 6; Recent change trend: the last three weeks maintained a steep increase with no obvious signs of slowing down. This trend semantic description text is output in structured JSON format, with each field summarizing the trend characteristics of the click-through rate sequence in different dimensions. Similarly, for other user groups under the same sun protection clothing product category, corresponding trend semantic description texts are generated independently using the same method.
[0052] Secondly, the trend semantic description text is input into a pre-trained language encoder, which maps the trend semantic description text into a fixed-dimensional semantic vector. A pre-trained language encoder is a text encoding model pre-trained on a large-scale text corpus, capable of mapping natural language text of arbitrary length into a dense vector of fixed dimensions. This vector preserves the semantic information of the input text in the semantic space, making semantically similar texts closer together in the vector space.
[0053] Semantic vectors, in this context, refer to fixed-dimensional dense vectors output by a pre-trained language encoder after encoding trend semantic description text. Semantic vectors are the numerical representation of trend semantic description text in the semantic space and can be used to calculate the similarity or distance between trend semantic description texts of the same product category under different time windows.
[0054] Specifically, the trend semantic description text is input into a pre-trained language encoder, which maps the trend semantic description text into a fixed-dimensional semantic vector. Natural language words in the trend semantic description text are converted into word vector sequences. These word vector sequences are encoded through multiple transformation layers of the pre-trained language encoder to extract the semantic information of the entire sequence. Finally, the variable-length word vector sequence is aggregated into a fixed-dimensional semantic vector by taking the CLS position vector output from the last layer of BERT-Base. A semantic vector is generated corresponding to each product category within a time window. This semantic vector serves as the semantic representation of the product category within that time window and is used for subsequent semantic drift calculations.
[0055] In this embodiment, the pre-trained language encoder uses the BERT-Base model, a bidirectional language model based on the Transformer encoder architecture, containing 12 encoder layers, a hidden dimension of 768, and 12 attention heads. During encoding, natural language words in the trend semantic description text are converted into word vector sequences, which are then encoded by the 12 Transformer encoder layers of BERT-Base to extract the semantic information of the entire sequence. The CLS position vector output from the last layer of BERT-Base is used as the global semantic representation of the sequence; this vector has a dimension of 768. A fully connected projection layer is connected after the 768-dimensional output of BERT-Base. This projection layer has an input dimension of 768, an output dimension of 64, and uses linear activation. This projection layer is connected after the fully connected layer of the category-side network and before the L2 norm normalization layer, and is jointly trained end-to-end with the multi-category temporal prediction model during model training. During training, the mean squared error loss of click-through rate prediction in S100 is backpropagated to the projection layer through the category representation vector. The parameters of the projection layer are updated synchronously with other model parameters to gradually align the projected category representation vector with the representation space of the semantic vector. After training, the parameters of the projection layer are fixed. The 64-dimensional vector output by the projection layer is normalized using the L2 norm and used as the final semantic vector.
[0056] For example, the trend semantic description text of sun protection clothing product category is input into a pre-trained language encoder. The language encoder converts the natural language words in the trend semantic description text into a sequence of word vectors, encodes them through multiple transformation layers, and then extracts the CLS position vector to obtain a 64-dimensional semantic vector. Similarly, semantic vectors for product categories such as sunglasses, sandals, dresses, and down jackets under the same user segment can be generated.
[0057] This includes obtaining a sliding window of historical semantic vectors, and calculating the semantic drift based on the sliding window and the semantic vectors, including: Obtain historical semantic vectors of multiple product categories within multiple historical time windows, construct a historical semantic vector sliding window, and store the semantic vectors of multiple product categories in the most recent preset number of historical time windows in chronological order in the historical semantic vector sliding window; The semantic vectors of multiple historical time windows stored in the historical semantic vector sliding window are arranged in order from farthest to closest to the current time. The historical semantic vectors that are closer to the current time are assigned higher weight values, and the historical semantic vectors that are farther from the current time are assigned lower weight values. The historical semantic centroid is obtained by weighting multiple semantic vectors within the sliding window of historical semantic vectors with their respective weight values. Calculate the distance between the semantic vector of the current time window and the historical semantic centroid as the semantic drift.
[0058] First, historical semantic vectors for multiple product categories within multiple historical time windows are obtained. A sliding window of historical semantic vectors is then constructed, storing the semantic vectors of multiple product categories within the most recent preset number of historical time windows in chronological order. Historical semantic vectors refer to the semantic vectors of the click-through rate sequence of each product category within historical time windows preceding the current time window.
[0059] The historical semantic vector sliding window is a data structure that stores the historical semantic vectors of each product category within the most recent preset number of historical time windows in chronological order. The historical semantic vector sliding window is maintained using a first-in, first-out (FIFO) queue; that is, whenever a new historical time window ends, the semantic vector of that window is added to the tail of the queue; when the queue length exceeds the preset limit, the historical semantic vector at the head of the queue is removed. This sliding window is used to store the historical semantic representation of each product category, serving as the data basis for calculating the historical semantic centroid.
[0060] Specifically, historical semantic vectors for each product category within multiple historical time windows are obtained. For each product category and each historical time window combination, a corresponding historical semantic vector exists for that product category within that historical time window. The obtained historical semantic vectors are organized into a historical semantic vector sliding window in chronological order. The historical semantic vector sliding window stores the historical semantic vectors for each product category within the most recent preset number of historical time windows. The historical semantic vector sliding windows are arranged in chronological order, with the semantic vector corresponding to the earliest historical time window at the beginning and the semantic vector corresponding to the most recent historical time window at the end. Whenever a historical time window ends, the semantic vector corresponding to that time window is added to the end of the sliding window; if the length of the sliding window exceeds a preset number after adding the semantic vector, the semantic vector at the beginning of the sliding window is removed.
[0061] For example, taking the sun protection clothing product category as an example, the historical semantic vectors of this product category in the most recent four historical time windows are as follows: The historical semantic vector of the 8th week window is denoted as... The historical semantic vector of the 9th week window is denoted as The historical semantic vector of the 10th week window is denoted as The historical semantic vector of the 11th week window is denoted as The above four historical semantic vectors are arranged in chronological order to construct a sliding window of historical semantic vectors. The content of the window is as follows: ,in Located at the top of the window, Located at the end of the window. The current time window is week 12, and the semantic vector of the current time window is... After the 12th week window closes, This will be added to the tail of the sliding window, making the window... ,at the same time Removed.
[0062] Secondly, the semantic vectors of multiple historical time windows stored within the historical semantic vector sliding window are ordered from furthest to closest to the current time. Historical semantic vectors closer to the current time are assigned higher weight values, while those farther away are assigned lower weight values. The weight value refers to the coefficient assigned to each semantic vector within the historical semantic vector sliding window, reflecting the contribution of semantic vectors from different historical time windows to the historical semantic centroid. Historical semantic vectors closer to the current time have greater reference value to the current data distribution state and are assigned higher weight values; conversely, historical semantic vectors farther away have less reference value to the current data distribution state and are assigned lower weight values.
[0063] Specifically, the weights are assigned using an exponential decay method. Let the historical semantic vector sliding window contain n historical semantic vectors, arranged in chronological order. ,in The historical semantic vector furthest from the current time. This is the historical semantic vector most recent to the current time. The weights of each historical semantic vector are calculated as follows: Where i is the position index of the historical semantic vector in the sliding window, i=1,2,...,n. Let be the weight value of the i-th historical semantic vector. Let be the attenuation coefficient, and n be the sliding window length. From the above formula, we can obtain that when i=n... The weight value is the largest when i=1. The weight value is the smallest. That is, the closer the historical semantic vector is to the current time, the higher the weight value, and the farther the historical semantic vector is from the current time, the lower the weight value.
[0064] Among them, attenuation coefficient The value is preset based on the sampling frequency of the time series data and the expected period of trend changes in the business scenario. In this embodiment, the time unit is week, and the value is set accordingly. Its corresponding half-life is approximately 7 weeks, meaning that the weight of historical semantic vectors from 7 weeks ago decays to about 50% of the weight of historical semantic vectors from the most recent week. This value can filter out short-term random fluctuations while timely capturing structural changes in the distribution of interests caused by seasonal changes or shifts in market hotspots. The specific value can be adjusted through offline verification according to different application scenarios.
[0065] For example, the historical semantic vector sliding window contains four historical semantic vectors. These correspond to weeks 8, 9, 10, and 11, respectively. n=4, attenuation coefficient. The weights of each historical semantic vector are calculated as follows: : , : , : , : That is, the semantic vector weight for week 11 is 1.000, the semantic vector weight for week 10 is 0.905, the semantic vector weight for week 9 is 0.819, and the semantic vector weight for week 8 is 0.741. The closer the historical semantic vector is to the current time, the higher its weight.
[0066] Next, a weighted average is calculated by taking multiple semantic vectors within the historical semantic vector sliding window and their corresponding weight values to obtain the historical semantic centroid. The historical semantic centroid is the vector obtained by weighted averaging of all historical semantic vectors within the historical semantic vector sliding window. The historical semantic centroid represents the baseline semantic state of each product category within the historical time window and serves as a reference point for determining whether the current semantic vector has drifted.
[0067] Specifically, the historical semantic vectors stored within the historical semantic vector sliding window are weighted and averaged with their corresponding weight values to obtain the historical semantic centroid of each product category. Each historical semantic vector is then multiplied by its corresponding weight value, and all weighted vectors are summed and then divided by the sum of the weight values. The calculation formula is as follows: Where n is the length of the sliding window. For the i-th historical semantic vector, for The corresponding weight value, This is the historical semantic centroid. For example, the historical semantic centroid is obtained by performing the same weighted average calculation on all 64 dimensions. The historical semantic centroid This represents the semantic baseline status of the sun protection clothing product category over the past four historical time windows.
[0068] Finally, the distance between the semantic vector of the current time window and the historical semantic centroid is calculated as the semantic drift. The semantic drift is the distance between the semantic vector of the current time window and the historical semantic centroid. The semantic drift quantifies the degree of deviation of the current data distribution from the historical baseline. A larger distance indicates a greater difference between the current time window's data distribution and the historical normal state, meaning a more significant semantic drift. The semantic drift is calculated using cosine distance.
[0069] Cosine distance is a distance metric between two vectors based on cosine similarity. The cosine similarity between two vectors is the cosine of their angle, ranging from -1 to 1. A value closer to 1 indicates that the two vectors are more aligned in direction. Cosine distance equals 1 minus the cosine similarity, ranging from 0 to 2. A smaller value indicates that the two vectors are more similar.
[0070] Specifically, the distance between the semantic vector of the current time window and the historical semantic centroid is calculated, and this distance is taken as the semantic drift of the product category in the current time window. The distance is calculated using cosine distance. First, the cosine similarity between the current semantic vector and the historical semantic centroid is calculated. The formula for calculating cosine similarity is: .in, The semantic vector of the current time window. For the historical semantic center, This represents the dot product operation of vectors. and Let L2 and L2 be the L2 norms of the two vectors, which are the square roots of the sum of the squares of their elements. Then, calculate the cosine distance: . This represents the semantic drift of the product category within the current time window. The semantic drift ranges from [0,2]. A value closer to 0 indicates that the current semantic vector is more similar to the historical semantic centroid, meaning no drift has occurred. A larger value indicates a higher degree of deviation.
[0071] For example, the semantic vector of the current time window is The historical semantic centroid is Substituting the values into the formula, the cosine similarity between the current semantic vector and the historical semantic centroid μ is approximately 0.781, and the semantic drift is calculated as 1 - 0.781 = 0.219. Therefore, the semantic drift of the sun-protective clothing product category in the current time window is 0.219. Similarly, the semantic drift of other product categories is calculated: sunglasses have a semantic drift of 0.201, sandals have a semantic drift of 0.183, dresses have a semantic drift of 0.071, and down jackets have a semantic drift of 0.052.
[0072] In this embodiment of the invention, the numerical click-through rate sequence is transformed into structured trend semantic description text through a pre-trained language model, and then encoded into fixed-dimensional semantic vectors by a pre-trained language encoder. This allows the trend features of the time-series data to be numerically captured in the semantic vectors. By maintaining a sliding window of historical semantic vectors, a weighted average of the historical semantic vectors is obtained using an exponential decay method. This ensures that the historical semantic vectors closer to the current time contribute more to the centroid, thereby guaranteeing that the historical semantic centroid reflects the baseline state of recent data distribution. Finally, the semantic drift is obtained by calculating the cosine distance between the current semantic vector and the historical semantic centroid. The semantic drift is a dimensionless numerical value that directly reflects the degree of deviation of the current data distribution of each product category from the historical baseline state. The semantic drift serves as the basic input for subsequent steps to determine drift event groups and calculate the comprehensive drift score.
[0073] S300: Count the cumulative number of weeks in which the semantic drift exceeds the preset warning threshold. Group the product categories that have reached the preset number of weeks into drift event groups, and weight and aggregate the semantic drift within the drift event groups to obtain a comprehensive drift score.
[0074] In this embodiment of the invention, it is necessary to determine whether to trigger an incremental update of the prediction model based on the semantic drift. A single instance of semantic drift exceeding a certain threshold may be caused by random fluctuations and cannot be used as a reliable basis for triggering a model update. Therefore, it is necessary to statistically analyze the cumulative number of weeks in which the semantic drift of each product category continuously exceeds the warning threshold, and to form a drift event group for product categories identified as structurally drifting based on the duration of the drift. Simultaneously, different product categories have varying degrees of impact on the overall recommendation performance of the platform. Therefore, it is necessary to determine weighting coefficients based on the historical user interaction volume ratio of each product category, and to weight and aggregate the semantic drift of each product category within the drift event group to obtain a comprehensive drift score that comprehensively reflects the overall drift degree. The warning threshold and trigger threshold are dynamically set based on the statistical distribution of historical drift to adaptively adapt to the drift characteristics of different product categories and different time periods.
[0075] Step S300 in the method provided in this embodiment of the invention includes: When the semantic drift of at least two product categories exceeds their respective warning thresholds for a cumulative number of weeks that reaches a preset number of weeks, the at least two product categories will be grouped into a drift event group. Obtain the historical user interaction volume percentage of each product category within the drift event group on the target platform, and determine the weight coefficient of each product category based on the historical user interaction volume percentage. The semantic drift amount of each product category within the drift event group is weighted and summed based on the weighting coefficients to obtain a comprehensive drift score.
[0076] First, when the semantic drift of at least two product categories exceeds their respective warning thresholds for a cumulative number of weeks that reaches a preset number of weeks, the at least two product categories will be grouped into a drift event group.
[0077] The warning threshold is a critical value used to determine whether the semantic drift of a single product category has reached a level requiring attention. The warning threshold is dynamically set based on the statistical distribution of historical semantic drift for each product category within a preset historical period. For each product category, the historical semantic drift sequence within the preset historical period is obtained, and the mean and standard deviation of the sequence are calculated. The warning threshold is equal to the sum of the mean of the historical semantic drift for that product category and the standard deviation of a first multiple. The first multiple is greater than 1, ranging from 1.2 to 1.8; in this embodiment, the first multiple is 1.5.
[0078] The cumulative duration of weeks refers to the cumulative number of weeks within a preset historical period where the semantic drift of a product category continuously exceeds its respective warning threshold. This cumulative duration of weeks is used to distinguish between short-term random fluctuations and long-term structural changes. The preset number of weeks refers to a pre-defined threshold for the cumulative duration of weeks. When the cumulative duration of weeks for a product category reaches this preset number of weeks, it is confirmed that the product category has experienced structural drift.
[0079] A drift event group refers to a set of at least two product categories whose cumulative duration reaches a preset number of weeks. Drift event groups are used to aggregate multiple product categories experiencing structural drift for subsequent weighted aggregation scoring. A drift event group must include at least two product categories to distinguish between abnormal fluctuations in individual categories and situations where multiple categories experience simultaneous structural changes.
[0080] Specifically, the system counts the cumulative number of weeks in which the semantic drift of each product category continuously exceeds its respective warning threshold within a preset historical period. For each product category, it checks weekly whether the semantic drift exceeds the corresponding warning threshold. If it does, it is counted in the duration count; otherwise, the duration count is reset to zero. The cumulative duration count is obtained by summing the weeks in which the semantic drift exceeds the warning threshold. When the cumulative duration count of at least two product categories reaches a preset number of weeks, these two product categories are grouped into a drift event group. The preset number of weeks ranges from 3 to 5 weeks. If only one product category meets the cumulative duration count condition, it is not grouped into a drift event group.
[0081] For example, taking sun-protective clothing as an example, the historical semantic drift of this product category over the past 12 weeks has an average value of 0.10, a standard deviation of 0.033, and a first multiple of 1.5. Therefore, the warning threshold for this category is 0.10 + 1.5 × 0.033 = 0.15. The semantic drift values for weeks 1 to 3 are 0.05, 0.06, and 0.07, respectively, all below the warning threshold of 0.15. The semantic drift values for weeks 4 to 12 are 0.16, 0.17, 0.15, 0.18, 0.16, 0.19, 0.17, 0.16, and 0.18, respectively, all exceeding the warning threshold of 0.15 for 9 consecutive weeks, reaching the preset number of 3 weeks. The same logic applies to other product categories. Among them, the cumulative duration of three product categories—sunscreen clothing, sunglasses, and sandals—reached the preset number of three weeks, and the number of categories was three or more, which is greater than or equal to two. Therefore, these three product categories were grouped into a drift event group.
[0082] Secondly, obtain the historical user interaction volume percentage of each product category within the drift event group on the target platform, and determine the weight coefficient of each product category based on the historical user interaction volume percentage. The historical user interaction volume percentage refers to the proportion of the cumulative user interaction volume of each product category within the drift event group within a preset historical period to the total cumulative user interaction volume of all product categories within the drift event group.
[0083] This includes obtaining the historical user interaction volume percentage of each product category within the drift event group on the target platform, and determining the weight coefficient of each product category based on the historical user interaction volume percentage, including: Get the cumulative user interaction volume of each product category within the drift event group within a preset historical period; Calculate the proportion of the cumulative user interaction volume of each product category to the total cumulative user interaction volume of all product categories within the drift event group, and use the proportion as the weight coefficient of each product category.
[0084] First, obtain the cumulative user interaction volume for each product category within the drift event group over a preset historical period. Cumulative user interaction volume includes the sum of user behaviors such as clicks, views, adding to cart, and favorites, reflecting the level of attention and influence of that product category on the platform. The preset historical period is the most recent 12 weeks.
[0085] Secondly, the proportion of cumulative user interactions for each product category to the total cumulative user interactions for all product categories within the drift event group is calculated, and this proportion is used as the weighting coefficient for each product category. The weighting coefficient refers to the coefficient corresponding to each product category within the drift event group when calculating the overall drift score, reflecting the degree of influence of different product categories on the platform's overall recommendation performance. The higher the weighting coefficient, the greater the contribution of the semantic drift of that product category to the overall drift score. The weighting coefficients satisfy the normalization constraint, meaning the sum of the weighting coefficients for all product categories within the drift event group is 1.
[0086] Specifically, the proportion of cumulative user interactions for each product category to the total cumulative user interactions for all product categories within the drift event group is calculated, and this proportion is used as the weighting coefficient for each product category. The formula for calculating the weighting coefficient is: ,in, The number of product categories within the drift event group. Let be the cumulative user interactions for the j-th product category. This represents the cumulative user interaction volume for the k-th product category within the drift event group. Let be the weight coefficient of the j-th product category, and .
[0087] For example, the drift event group includes three product categories: sun protection clothing, sunglasses, and sandals. The cumulative user interactions for these three product categories over the past 12 weeks are obtained: sun protection clothing has 28,000 cumulative user interactions, sunglasses have 18,000 cumulative user interactions, and sandals have 12,000 cumulative user interactions. The total cumulative user interactions for all product categories within the drift event group = 28,000 + 18,000 + 12,000 = 58,000. The weight coefficients for each product category are calculated as follows: sun protection clothing weight coefficient = 28,000 / 58,000 ≈ 0.483, sunglasses weight coefficient = 18,000 / 58,000 ≈ 0.310, and sandals weight coefficient = 12,000 / 58,000 ≈ 0.207.
[0088] Finally, the semantic drift amounts of each product category within the drift event group are weighted and summed according to the weighting coefficients to obtain the comprehensive drift score. The comprehensive drift score is the numerical value obtained by weighting and summing the semantic drift amounts of each product category within the drift event group. The comprehensive drift score comprehensively reflects the overall semantic drift degree of all product categories within the drift event group, serving as the final quantitative basis for determining whether to trigger an incremental update of the prediction model.
[0089] Specifically, based on weighting coefficients, the semantic drift amounts of each product category within the drift event group are weighted and summed to obtain a comprehensive drift score. The formula for calculating the comprehensive drift score is as follows: Where M represents the number of product categories within the drift event group. Let be the weight coefficient for the j-th product category. Let be the semantic drift value for the j-th product category, and 'Score' be the overall drift score. For example, the semantic drift values for each product category within the drift event group are: sun-protective clothing 0.219, sunglasses 0.201, and sandals 0.183. The weight coefficients for each product category are: sun-protective clothing 0.483, sunglasses 0.310, and sandals 0.207. The overall drift score 'Score' = 0.483 × 0.219 + 0.310 × 0.201 + 0.207 × 0.183 ≈ 0.206.
[0090] In this embodiment of the invention, by dynamically setting a warning threshold for each product category, the warning threshold can adaptively adapt to the drift characteristics of different product categories. Based on this, the cumulative number of weeks in which the semantic drift of each product category continuously exceeds the warning threshold is counted. At least two product categories with a cumulative duration exceeding a preset number of weeks are grouped into a drift event group. This effectively distinguishes between short-term random fluctuations and long-term structural changes, avoiding unnecessary updates triggered by abnormal fluctuations in a single product category. By introducing the proportion of historical user interactions as a weighting coefficient, the semantic drift of product categories with higher user interaction volume contributes more to the comprehensive drift score. The comprehensive drift score can more accurately reflect the impact of drift events on the overall recommendation effect of the platform. The comprehensive drift score serves as a quantitative basis for subsequent judgment on whether to trigger incremental updates to the prediction model, providing a precise triggering mechanism for incremental updates.
[0091] S400: When the overall drift score exceeds the preset trigger threshold, perform a local incremental update on the multi-category time series prediction model and continue to output trend prediction results.
[0092] In this embodiment of the invention, after obtaining the comprehensive drift score, it is necessary to determine whether to update the multi-category time-series prediction model based on the comparison result between the comprehensive drift score and the trigger threshold. When the comprehensive drift score exceeds the trigger threshold, it indicates that a structural semantic drift has occurred in the data distribution of multiple product categories, and the prediction accuracy of the current multi-category time-series prediction model on this data distribution can no longer be guaranteed. However, directly retraining all model parameters would consume a large amount of computing resources and have a slow response speed. Therefore, it is necessary to identify the target user group corresponding to the drift event group, and only perform local incremental updates on the parameters associated with the target user group in the user-side network and the weight parameters corresponding to the product categories within the drift event group in the category-side network, so as to achieve model adaptation with minimal computational cost. At the same time, to prevent the incremental update from introducing negative optimization, the updated candidate model parameters need to be verified on the offline validation set. The candidate model parameters are only deployed online when the prediction accuracy of the candidate model parameters is not lower than that of the current online model parameters.
[0093] Step S400 in the method provided in this embodiment of the invention includes: When the overall drift score exceeds the preset trigger threshold, the target user group corresponding to the drift event group is determined; Using the semantic vector of the current time window as a prior constraint, a regularized loss function is constructed. The parameters are updated by minimizing the regularized loss function. The parameters associated with the target user group in the user-side network are updated incrementally, and the weight parameters corresponding to the product category in the category-side network are updated incrementally to obtain the candidate model parameters. Obtain a validation set pre-divided from historical training data, and run the online model parameters and candidate model parameters deployed on the multi-category time series prediction model at the current time on the validation set to obtain the first error value of the online model parameters and the second error value of the candidate model parameters; If the second error value is not lower than the first error value, then the incremental update is terminated and the online model parameters remain unchanged. If the second error value is lower than the first error value, the candidate model parameters will be deployed as new online model parameters on the multi-category time series prediction model, and the trend prediction results will continue to be output.
[0094] First, when the overall drift score exceeds a preset trigger threshold, the target user segment corresponding to the drift event group is determined. The trigger threshold is used to determine whether the overall drift score reaches the level required to trigger an incremental update. The trigger threshold is dynamically set based on the global statistical distribution of historical semantic drift volume for all product categories within a preset historical period. The historical semantic drift volume sequence for all product categories within the preset historical period is obtained, and the global mean and global standard deviation of this sequence are calculated. The trigger threshold is equal to the sum of the global mean and the second-largest multiple of the global standard deviation, i.e.: trigger threshold. .in, This represents the global average of the historical semantic drift of all product categories within a preset historical period. The global standard deviation of the historical semantic drift of all product categories within a preset historical period. It is a multiple of 2, ranging from 2.0 to 3.0, in this embodiment... The value is 2.5.
[0095] The second multiple is greater than the first multiple in S300, causing the trigger threshold to be higher than the warning threshold. The warning threshold is used to determine whether the semantic drift of a single product category has reached a level requiring attention, while the trigger threshold is used to determine whether the overall drift score has reached a level requiring incremental updates. Since the decision consequences of triggering incremental updates are more severe than those of triggering attention markers, the trigger threshold must be higher than the warning threshold to avoid excessively frequent incremental updates that would lead to unnecessary consumption of computational resources.
[0096] In this embodiment, the global mean of historical semantic drift for all product categories over the past 12 weeks is 0.08, the global standard deviation is 0.034, and the second multiple is 2.5. Therefore, the trigger threshold is 0.08 + 2.5 × 0.034 = 0.165. Since the overall drift score of 0.206 is greater than 0.165, it is necessary to determine the target user segment corresponding to the drift event group.
[0097] Among these, determining the target user segment corresponding to the drift event group includes: Based on the user segmentation tags corresponding to each product category within the drift event group, the percentage of user interaction volume for each user segment within each product category within the drift event group is calculated. The user segment with the highest percentage of user interactions was identified as the target user segment.
[0098] First, based on the user segmentation tags corresponding to each product category within the drift event group, the percentage of user interactions for each user segment across all product categories within the drift event group is calculated. This percentage reflects the overall participation level of each user segment across all product categories within the drift event group. The user segmentation tag refers to the user segment identifier associated with each product category when calculating user interaction data; for example, "Hangzhou + Female + 25-35 years old" constitutes a user segmentation tag. For each user segmentation tag included within the drift event group, the user interactions for that user segment across all product categories within the drift event group are summed to obtain the total user interactions for that user segment. Finally, the total user interactions for each user segment are divided by the sum of the total user interactions for all user segments to obtain the percentage of user interactions for each user segment.
[0099] For example, the drift event group includes three product categories: sun-protective clothing, sunglasses, and sandals. The user segmentation tags for each product category are: Hangzhou + Female + 25-35 years old, Beijing + Female + 25-35 years old, and Shanghai + Female + 25-35 years old. The user interaction volume for each product category within the drift event group for the three user segments is as follows: The Hangzhou + Female + 25-35 years old user segment had 28,000 interactions on sun-protective clothing, 18,000 interactions on sunglasses, and 12,000 interactions on sandals, totaling 58,000 interactions. The Beijing + Female + 25-35 years old user segment had 15,000 interactions on sun-protective clothing, 12,000 interactions on sunglasses, and 8,000 interactions on sandals, totaling 35,000 interactions. In the Shanghai user segment (female, 25-35 years old), user interactions on sun-protective clothing totaled 10,000, on sunglasses 9,000, and on sandals 6,000, for a total of 25,000. The percentage of user interactions for each segment is as follows: Hangzhou (female, 25-35 years old) = 58,000 / (58,000+35,000+25,000) = 0.492; Beijing (female, 25-35 years old) = 35,000 / 118,000 = 0.297; Shanghai (female, 25-35 years old) = 25,000 / 118,000 = 0.211.
[0100] Secondly, the user segment with the highest percentage of user interaction is identified as the target user segment. The target user segment refers to the user segment with the highest percentage of user interaction among all product categories within the drift event group. The target user segment is used to locate the target of incremental updates, ensuring that parameter updates on the user-side network are only performed for that user segment. For example, the user segment "Hangzhou + Female + 25-35 years old" has the highest percentage of user interaction (0.492), and this user segment is identified as the target user segment.
[0101] Secondly, using the semantic vector of the current time window as a prior constraint, a regularized loss function is constructed. Parameters are updated by minimizing this regularized loss function. Incremental updates are performed on the parameters associated with the target user segment in the user-side network, and incremental updates are also performed on the weight parameters corresponding to the product categories within the drift event group in the category-side network, resulting in candidate model parameters. For each product category, the semantic vector of that product category in the current time window is used as the prior constraint 's'; that is, the sun protection clothing category uses the current semantic vector of sun protection clothing, and the sunglasses category uses the current semantic vector of sunglasses. The updates for each category are independent. When updating the parameters associated with the target user segment in the user-side network, the current semantic vectors of each product category within the drift event group are first weighted and aggregated according to the proportion of historical user interactions to obtain a comprehensive semantic vector. ,in Let be the weight coefficient for the j-th product category. Let j be the current semantic vector of the j-th product category, and then... s serves as a prior constraint for user-side network updates.
[0102] Candidate model parameters refer to the new model parameters obtained by performing local incremental updates on the online model parameters currently deployed on the multi-category time-series prediction model. Candidate model parameters include updated user-side network parameters and updated category-side network parameters. Candidate model parameters must be validated on an offline validation set before deployment.
[0103] Incremental updates refer to updating only a subset of the model's parameters. In this approach, incremental updates target parameters in the user-side network associated with the target user segment, and weight parameters in the category-side network corresponding to product categories within the drift event group. Compared to full retraining, incremental updates update only a small number of parameters, resulting in lower computational overhead and faster response times.
[0104] Here, the prior constraint refers to the guiding information that uses the semantic vector of the current time window as the update direction. In the regularization loss function, the current semantic vector is used as the target value, which constrains the updated category representation vector to move closer to the direction of the current semantic vector in the semantic space, so that the updated model parameters can reflect the structural changes in the current data distribution.
[0105] The regularization loss function is a loss function that introduces a regularization term when updating model parameters. The regularization loss function contains two optimization objectives: the first constraint ensures that the updated parameters do not deviate too far from the original parameters, preventing the forgetting of existing knowledge; the second constraint constrains the updated parameters to move closer to the direction of the current semantic vector, incorporating new trend information. By minimizing this regularization loss function, a balance is achieved between preserving old knowledge and incorporating new information during parameter updates.
[0106] Specifically, when the overall drift score exceeds the trigger threshold, a regularized loss function is constructed using the semantic vector of the current time window as a prior constraint. Parameters are then updated by minimizing this regularized loss function. The mathematical form of the regularized loss function is: .in, This represents the parameter vector to be updated in the online model parameters currently deployed on the multi-category time-series forecasting model. This represents the updated parameter vector. The semantic vector representing the current time window. This represents the regularization coefficient, ranging from 0.1 to 1.0. It is the first term of the loss function. The updated parameter vector is constrained to not deviate too far from the original parameter vector in order to preserve the historical knowledge learned by the model; the second term The updated parameter vector is constrained to move closer to the direction of the current semantic vector in order to incorporate new trend information.
[0107] It should be noted that the category representation vector of the time-series prediction model and the semantic vector output by the language encoder come from different representation spaces. Although both are 64-dimensional, their dimensions do not have corresponding semantic relationships. To achieve cross-modal alignment, a cross-modal projection layer is added to the output of the category-side network. This projection layer is a 64×64 trainable linear transformation matrix. , category representation vector Projected onto the representation space of the semantic vector: The projection layer and the multi-category time-series prediction model are jointly trained using the same training data and loss function during the S100 training phase. After training, the parameters of the projection layer are fixed. The projected category representation vector is used in the regularization loss function. Calculate the distance with the semantic vector s.
[0108] Furthermore, the weight parameters of the Long Short-Term Memory (LSTM) network layer and the fully connected layer corresponding to the product category within the drift event group in the category-side network are obtained as parameters to be updated. , here This refers to the corresponding row vector in the output layer weight matrix of the category-side network, which corresponds to the target category. This row vector is stored as a trainable parameter during training and directly affects the generation of the category representation vector for the corresponding category. Using the semantic vector s of the current time window as a prior constraint, the updated weight parameters are obtained by minimizing the regularization loss function. Updated weight parameters In the next round of forward computation, the category representation vector output by the category-side network will change accordingly. The updated user-side network parameters and the updated category-side network parameters are combined to form the candidate model parameters. After the parameters are updated, gradient descent is used with a learning rate of... The step size of each parameter update is controlled to manage the magnitude of the update and prevent catastrophic forgetting. The updated parameter values are calculated iteratively using gradient descent, with a preset number of iterations ranging from 10 to 50 steps.
[0109] For example, the target user group is Hangzhou + female + 25-35 years old, and the drift event group includes three product categories: sun protection clothing, sunglasses, and sandals. Taking the sun protection clothing product category as an example, the category representation vector corresponding to the sun protection clothing category is obtained from the online model parameters currently deployed on the multi-category time series prediction model. Obtain the semantic vector of the current time window encoded in S200. Let the regularization coefficient be... Learning rate Construct the regularized loss function: Gradient descent is used, with iterative updates at a learning rate η=0.01. After 10 iterations, the updated category representation vector is: Taking the third dimension as an example, the original value ,Target After the update It moves closer to the target s; taking the 4th dimension as an example, the original value ,Target After the update Similarly, the same incremental updates are performed on the category representation vectors of sunglasses and sandals. The same incremental updates are also performed on the user representation vector parameters associated with the Hangzhou + female + 25-35 year old user segment in the user-side network. The updated user-side network parameters and category-side network parameters are then combined into candidate model parameters.
[0110] Next, a validation set pre-defined from the historical training data is obtained. The online model parameters and candidate model parameters currently deployed on the multi-category time-series prediction model are then run on the validation set to obtain the first error value of the online model parameters and the second error value of the candidate model parameters. The validation set does not participate in model training or the generation of candidate model parameters; it is only used to objectively evaluate the prediction accuracy of the online model parameters and candidate model parameters. The validation set comes from the validation portion of the historical training data in S100.
[0111] Here, online model parameters refer to the model parameters actually deployed on the multi-category time-series forecasting model at the current moment to output trend prediction results. The first error value is the error metric obtained after running the online model parameters on the validation set, serving as a benchmark for judging whether candidate model parameters are superior to the current online model parameters. The second error value is the error metric obtained after running the candidate model parameters on the validation set, used to compare with the first error value to determine whether to deploy the candidate model parameters online.
[0112] Specifically, a validation set is pre-defined from historical training data. On the validation set, the online model parameters and candidate model parameters deployed on the multi-category time-series prediction model at the current time are run, yielding the first error value for the online model parameters and the second error value for the candidate model parameters. The error values are measured as root mean square error (RMSE) or mean absolute error (MAE). A smaller error value indicates higher model prediction accuracy. RMSE is calculated as the square root of the mean of the squares of the differences between predicted and true values. MAE is calculated as the mean of the absolute values of the differences between predicted and true values.
[0113] For example, a validation set pre-defined from historical training data in S100 is obtained, containing 240 samples. The online model parameters and candidate model parameters are run on the validation set respectively, and the error values of the two model parameters are calculated. The mean absolute error (MAE) is used as the metric for the error values: the MAE of the online model parameters on the validation set is 0.072, which is taken as the first error value. The MAE of the candidate model parameters on the validation set is 0.068, which is taken as the second error value. The second error value of 0.068 is less than the first error value of 0.072, indicating that the prediction accuracy of the candidate model parameters is higher than that of the online model parameters.
[0114] Furthermore, if the second error value is not lower than the first error value, the incremental update is terminated, and the online model parameters remain unchanged. After the incremental update is terminated, the platform returns to step S200 and enters the semantic drift detection cycle of the next time window. If the second error value is lower than the first error value, the candidate model parameters are deployed as new online model parameters on the multi-category time-series prediction model, and trend prediction results continue to be output. The deployed multi-category time-series prediction model continues to output trend prediction results using the updated parameters. After the incremental update is completed, the platform returns to step S200 and enters the semantic drift detection cycle of the next time window.
[0115] For example, the first error value is 0.072, and the second error value is 0.068. The second error value of 0.068 is less than the first error value of 0.072, indicating that the prediction accuracy of the candidate model parameters is higher than that of the online model parameters. Since the second error value is lower than the first error value, the candidate model parameters are deployed on the multi-category time-series prediction model, replacing the original online model parameters. After deployment, the multi-category time-series prediction model continues to output trend prediction results using the updated parameters. If the second error value is 0.075, which is greater than the first error value of 0.072 (i.e., the second error value is not lower than the first error value), then this incremental update is terminated, the online model parameters remain unchanged, and the multi-category time-series prediction model continues to output trend prediction results using the original online model parameters.
[0116] In this embodiment of the invention, by statistically analyzing the proportion of user interactions of each user segment within each product category of the drift event group, the user segment with the highest proportion of user interactions is identified as the target user segment, thus accurately locating the target of incremental updates. Using the semantic vector of the current time window as a prior constraint, a regularized loss function is used to simultaneously perform local incremental updates on the parameters associated with the target user segment in the user-side network and the weight parameters corresponding to the product categories within the drift event group in the category-side network. Updating only a small number of parameters enables the model to adapt to the current data distribution, avoiding the computational overhead of full retraining. By comparing the prediction accuracy of the online model parameters and the candidate model parameters on the validation set, deployment is only initiated when the prediction accuracy of the candidate model parameters is not lower than that of the online model parameters. This effectively prevents negative optimization that incremental updates may cause, ensuring that the prediction accuracy of the multi-category time-series prediction model does not degrade due to updates. After S400, the updated multi-category time-series prediction model continues to output trend prediction results and returns to S200 to enter the next semantic drift detection cycle, forming a continuous adaptive optimization closed loop.
[0117] Through the specific implementation methods described above, the embodiments of the present invention achieve the following technical effects: This invention provides a method for predicting time-series data trends based on semantic incremental updates. It establishes an initial prediction baseline by constructing a multi-category time-series prediction model including a user-side network and a category-side network. Click-through rate sequences are transformed into trend semantic description text and encoded as semantic vectors. Historical semantic centroids are obtained using a sliding window and exponentially decaying weighted average of historical semantic vectors. The cosine distance between the current semantic vector and the historical semantic centroid is calculated as the semantic drift, enabling a quantitative measurement of the degree of change in data distribution. By statistically analyzing the cumulative number of weeks in which the semantic drift of each product category continuously exceeds a warning threshold, product categories that have reached a preset number of weeks are grouped into drift event groups. The proportion of historical user interactions is introduced as a weighting coefficient to weighted aggregate and obtain a comprehensive drift score, achieving a comprehensive judgment of structural changes in data distribution from three dimensions: drift degree, duration, and category importance. When the overall drift score exceeds the trigger threshold, the target user group is determined by tracing the proportion of interaction volume among the source user groups. Using the semantic vector of the current time window as a prior constraint, local incremental updates are performed on the parameters associated with the target user group in the user-side network and the weight parameters corresponding to the product categories within the drift event group in the category-side network. After verifying the accuracy of the candidate model on the validation set, it is deployed online to continue prediction. This invention achieves accurate identification of structural changes in data distribution and accurate judgment of update timing, avoiding unnecessary updates due to short-term noise or decreased prediction accuracy due to update lag. At the same time, local incremental updates reduce computational resource consumption compared to full retraining.
[0118] Example 2, as Figure 3As shown, the present invention also provides a time-series data trend prediction system based on semantic incremental updates, the system comprising: The trend prediction module 11 is used to acquire user interaction data of multiple product categories, input the user interaction data into a pre-trained multi-category time series prediction model, and output trend prediction results. The user interaction data includes click-through rate sequences and user feature data of multiple product categories at consecutive time points. The semantic drift calculation module 12 is used to generate semantic description text based on the click rate sequence, encode the semantic description text into a semantic vector, obtain a historical semantic vector sliding window, and calculate the semantic drift based on the historical semantic vector sliding window and the semantic vector. The drift event determination module 13 is used to count the cumulative number of weeks in which the semantic drift amount continuously exceeds the preset warning threshold, form a drift event group for product categories whose cumulative number of weeks reaches the preset number of weeks, and perform weighted aggregation on the semantic drift amount within the drift event group to obtain a comprehensive drift score. The incremental update module 14 is used to perform local incremental updates on the multi-category time series prediction model when the comprehensive drift score exceeds the preset trigger threshold, and continue to output the trend prediction results.
[0119] In one embodiment, the trend prediction module 11 is further configured to: Construct and train a multi-category time series prediction model. The initial multi-category time series prediction model includes a user-side network and a category-side network. The system acquires user interaction data from multiple product categories and inputs it into a multi-category time-series prediction model. The user-side network takes user feature data as input and outputs user representation vectors, while the category-side network takes click-through rate sequences from multiple product categories as input and outputs category representation vectors for multiple product categories. The user representation vector is fused with the category representation vectors of multiple product categories to obtain the click-through rate prediction values of multiple product categories at the next time point, which are used as the trend prediction results.
[0120] This includes constructing and training a multi-category time-series prediction model, including: Acquire historical training data, which includes historical click-through rate sequences and corresponding historical user characteristic data for multiple product categories within historical time windows. An initial multi-category time-series prediction model is constructed, which includes a user-side network and a category-side network. A multi-category time-series prediction model is trained using historical training data. User feature data is input into the user-side network to obtain the user representation vector, and the click-through rate sequence is input into the category-side network to obtain the category representation vector. The user representation vector and the category representation vector are fused to obtain the click-through rate prediction value. The loss function value is calculated based on the predicted click-through rate (CTR) and the historical CTR in the historical training data. The parameters of the user-side network and the category-side network are updated according to the loss function value. The iteration continues until the training stopping condition is met, and a multi-category time-series prediction model is obtained.
[0121] In one embodiment, the semantic drift calculation module 12 is further configured to: Specifically, semantic description text is generated based on the click-through rate sequence, and the semantic description text is encoded into a semantic vector, including: The click rate sequence is input into a pre-trained language model to generate trend semantic description text, which includes the overall trend direction, the degree of fluctuation, the location of major turning points, and the recent changes. The trend semantic description text is input into a pre-trained language encoder, which maps the trend semantic description text into a fixed-dimensional semantic vector.
[0122] This includes obtaining a sliding window of historical semantic vectors, and calculating the semantic drift based on the sliding window and the semantic vectors, including: Obtain historical semantic vectors of multiple product categories within multiple historical time windows, construct a historical semantic vector sliding window, and store the semantic vectors of multiple product categories in the most recent preset number of historical time windows in chronological order in the historical semantic vector sliding window; The semantic vectors of multiple historical time windows stored in the historical semantic vector sliding window are arranged in order from farthest to closest to the current time. The historical semantic vectors that are closer to the current time are assigned higher weight values, and the historical semantic vectors that are farther from the current time are assigned lower weight values. The historical semantic centroid is obtained by weighting multiple semantic vectors within the sliding window of historical semantic vectors with their respective weight values. Calculate the distance between the semantic vector of the current time window and the historical semantic centroid as the semantic drift.
[0123] In one embodiment, the drift event determination module 13 is further configured to: When the semantic drift of at least two product categories exceeds their respective warning thresholds for a cumulative number of weeks that reaches a preset number of weeks, the at least two product categories will be grouped into a drift event group. Obtain the historical user interaction volume percentage of each product category within the drift event group on the target platform, and determine the weight coefficient of each product category based on the historical user interaction volume percentage. The semantic drift amount of each product category within the drift event group is weighted and summed based on the weighting coefficients to obtain a comprehensive drift score.
[0124] This includes obtaining the historical user interaction volume percentage of each product category within the drift event group on the target platform, and determining the weight coefficient of each product category based on the historical user interaction volume percentage, including: Get the cumulative user interaction volume of each product category within the drift event group within a preset historical period; Calculate the proportion of the cumulative user interaction volume of each product category to the total cumulative user interaction volume of all product categories within the drift event group, and use the proportion as the weight coefficient of each product category.
[0125] In one embodiment, the incremental update module 14 is further configured to: When the overall drift score exceeds the trigger threshold, the target user group corresponding to the drift event group is determined; Using the semantic vector of the current time window as a prior constraint, a regularized loss function is constructed. The parameters are updated by minimizing the regularized loss function. The parameters associated with the target user group in the user-side network are updated incrementally, and the weight parameters corresponding to the product category in the category-side network are updated incrementally to obtain the candidate model parameters. Obtain a validation set pre-divided from historical training data, and run the online model parameters and candidate model parameters deployed on the multi-category time series prediction model at the current time on the validation set to obtain the first error value of the online model parameters and the second error value of the candidate model parameters; If the second error value is not lower than the first error value, then the incremental update is terminated and the online model parameters remain unchanged. If the second error value is lower than the first error value, the candidate model parameters will be deployed as new online model parameters on the multi-category time series prediction model, and the trend prediction results will continue to be output.
[0126] Among these, determining the target user segment corresponding to the drift event group includes: Based on the user segmentation tags corresponding to each product category within the drift event group, the percentage of user interaction volume for each user segment within each product category within the drift event group is calculated. The user segment with the highest percentage of user interactions was identified as the target user segment.
[0127] It should be noted that the above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A time-series data trend prediction method based on semantic incremental updates, characterized in that, The methods include: Acquire user interaction data for multiple product categories, input the user interaction data into a pre-trained multi-category time series prediction model, and output trend prediction results. The user interaction data includes click-through rate sequences and user feature data for multiple product categories at consecutive time points. Semantic description text is generated based on the click-through rate sequence, the semantic description text is encoded into a semantic vector, and a historical semantic vector sliding window is obtained. The semantic drift is calculated based on the historical semantic vector sliding window and the semantic vector. The cumulative number of weeks in which the semantic drift exceeds the preset warning threshold is counted. Product categories that have reached the preset number of weeks in cumulative duration are grouped into drift event groups, and the semantic drift within the drift event groups is weighted and aggregated to obtain a comprehensive drift score. When the overall drift score exceeds the preset trigger threshold, the multi-category time series prediction model is locally incrementally updated, and the trend prediction results are continued to be output.
2. The time-series data trend prediction method based on semantic incremental update as described in claim 1, characterized in that, Acquire user interaction data from multiple product categories, input the user interaction data into a pre-trained multi-category time-series prediction model, and output trend prediction results, including: Construct and train a multi-category time series prediction model. The initial multi-category time series prediction model includes a user-side network and a category-side network. The system acquires user interaction data from multiple product categories and inputs it into a multi-category time-series prediction model. The user-side network takes user feature data as input and outputs user representation vectors, while the category-side network takes click-through rate sequences from multiple product categories as input and outputs category representation vectors for multiple product categories. The user representation vector is fused with the category representation vectors of multiple product categories to obtain the click-through rate prediction values of multiple product categories at the next time point, which are used as the trend prediction results.
3. The time-series data trend prediction method based on semantic incremental update as described in claim 2, characterized in that, Construct and train a multi-category time-series prediction model, including: Acquire historical training data, which includes historical click-through rate sequences and corresponding historical user characteristic data for multiple product categories within historical time windows. An initial multi-category time-series prediction model is constructed, which includes a user-side network and a category-side network. A multi-category time-series prediction model is trained using historical training data. User feature data is input into the user-side network to obtain the user representation vector, and the click-through rate sequence is input into the category-side network to obtain the category representation vector. The user representation vector and the category representation vector are fused to obtain the click-through rate prediction value. The loss function value is calculated based on the predicted click-through rate (CTR) and the historical CTR in the historical training data. The parameters of the user-side network and the category-side network are updated according to the loss function value. The iteration continues until the training stopping condition is met, and a multi-category time-series prediction model is obtained.
4. The time-series data trend prediction method based on semantic incremental update as described in claim 1, characterized in that, Generate semantic description text based on the click-through rate sequence, and encode the semantic description text into a semantic vector, including: The click rate sequence is input into a pre-trained language model to generate trend semantic description text, which includes the overall trend direction, the degree of fluctuation, the location of major turning points, and the recent changes. The trend semantic description text is input into a pre-trained language encoder, which maps the trend semantic description text into a fixed-dimensional semantic vector.
5. The time-series data trend prediction method based on semantic incremental update as described in claim 4, characterized in that, Obtain a sliding window of historical semantic vectors. Based on the sliding window of historical semantic vectors and the semantic vectors, calculate the semantic drift, including: Obtain historical semantic vectors of multiple product categories within multiple historical time windows, construct a historical semantic vector sliding window, and store the semantic vectors of multiple product categories in the most recent preset number of historical time windows in chronological order in the historical semantic vector sliding window; The semantic vectors of multiple historical time windows stored in the historical semantic vector sliding window are arranged in order from farthest to closest to the current time. The historical semantic vectors that are closer to the current time are assigned higher weight values, and the historical semantic vectors that are farther from the current time are assigned lower weight values. The historical semantic centroid is obtained by weighting multiple semantic vectors within the sliding window of historical semantic vectors with their respective weight values. Calculate the distance between the semantic vector of the current time window and the historical semantic centroid as the semantic drift.
6. The time-series data trend prediction method based on semantic incremental update as described in claim 1, characterized in that, The cumulative number of weeks in which semantic drift exceeds a preset warning threshold is counted. Product categories that have reached the preset number of weeks in cumulative drift are grouped into drift event groups. The semantic drift within each drift event group is then weighted and aggregated to obtain a comprehensive drift score, including: When the semantic drift of at least two product categories exceeds their respective warning thresholds for a cumulative number of weeks that reaches a preset number of weeks, the at least two product categories will be grouped into a drift event group. Obtain the historical user interaction volume percentage of each product category within the drift event group on the target platform, and determine the weight coefficient of each product category based on the historical user interaction volume percentage. The semantic drift amount of each product category within the drift event group is weighted and summed based on the weighting coefficients to obtain a comprehensive drift score.
7. The time-series data trend prediction method based on semantic incremental update as described in claim 6, characterized in that, Obtain the historical user interaction volume percentage of each product category within the drift event group on the target platform, and determine the weight coefficient of each product category based on the historical user interaction volume percentage, including: Get the cumulative user interaction volume of each product category within the drift event group within a preset historical period; Calculate the proportion of the cumulative user interaction volume of each product category to the total cumulative user interaction volume of all product categories within the drift event group, and use the proportion as the weight coefficient of each product category.
8. The time-series data trend prediction method based on semantic incremental update as described in claim 1, characterized in that, When the overall drift score exceeds a preset trigger threshold, a local incremental update is performed on the multi-category time-series prediction model, and the trend prediction results continue to be output, including: When the overall drift score exceeds the preset trigger threshold, the target user group corresponding to the drift event group is determined; Using the semantic vector of the current time window as a prior constraint, a regularized loss function is constructed. The parameters are updated by minimizing the regularized loss function. The parameters associated with the target user group in the user-side network are updated incrementally, and the weight parameters corresponding to the product category in the category-side network are updated incrementally to obtain the candidate model parameters. Obtain a validation set pre-divided from historical training data, and run the online model parameters and candidate model parameters deployed on the multi-category time series prediction model at the current time on the validation set to obtain the first error value of the online model parameters and the second error value of the candidate model parameters; If the second error value is not lower than the first error value, then the incremental update is terminated and the online model parameters remain unchanged. If the second error value is lower than the first error value, the candidate model parameters will be deployed as new online model parameters on the multi-category time series prediction model, and the trend prediction results will continue to be output.
9. The time-series data trend prediction method based on semantic incremental update as described in claim 8, characterized in that, Identify the target user segments corresponding to the drift event groups, including: Based on the user segmentation tags corresponding to each product category within the drift event group, the percentage of user interaction volume for each user segment within each product category within the drift event group is calculated. The user segment with the highest percentage of user interactions was identified as the target user segment.