Video watching duration prediction method and device, electronic equipment and medium

By constructing a time token vocabulary and generating time token sequences, the bias problem in video viewing duration prediction in existing technologies is solved, enabling accurate modeling of user viewing behavior and improving prediction accuracy and user experience of recommendation products.

CN121908064APending Publication Date: 2026-04-21BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BAIDU NETCOM SCI & TECH CO LTD
Filing Date
2025-12-16
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies for predicting video viewing duration suffer from several problems, including sensitivity to long-tail distributions and outliers, large prediction biases due to fixed time interval divisions, difficulty in modeling the sequential dependencies of user viewing behavior, and inaccurate predictions, especially in scenarios involving continuous viewing of short dramas.

Method used

By constructing a time token vocabulary, multiple time tokens of non-fixed duration are used to decompose the user's historical viewing time, generate a time token sequence, and sum them through a decoder to achieve accurate fitting of continuous duration, adapt to different data distributions, and cover long-tail distributions.

Benefits of technology

It significantly improves the accuracy of video viewing duration prediction, reduces the interference of outliers on prediction results, adapts to different user data distributions, and improves the user experience of recommendation products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121908064A_ABST
    Figure CN121908064A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of big data processing, in particular to a video watching duration prediction method and device, electronic equipment and a medium. According to the specific implementation scheme, user features of a to-be-predicted user and video features of a target video are acquired; selecting n time tokens from a pre-constructed time token vocabulary according to a preset rule based on the user features and the video features, so as to decompose the historical watching duration of the user to be predicted, and generating a time token sequence; wherein the time token vocabulary comprises a plurality of time tokens with non-fixed duration; and summing the durations corresponding to the time tokens contained in the time token sequence to obtain the predicted watching duration of the to-be-predicted user for the target video. According to the method and the device, continuous historical watching durations are converted into discrete time tokens through a plurality of time tokens with non-fixed durations, and accurate modeling of user watching behaviors is realized by combining the time tokens, so that the accuracy of duration prediction is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of big data processing technology, and in particular to methods, devices, electronic equipment and media for predicting video viewing duration. Background Technology

[0002] With the rapid development of internet content creation, the current video creation ecosystem is gradually shifting towards shorter, faster, and more concise formats, with short dramas being a typical example. Compared to traditional video content, short dramas are characterized by their shorter duration. However, as a type of serialized content, short dramas naturally possess the attribute of continued viewing. For example, after watching the entry resource of a certain series, users often continue to watch subsequent related resources based on factors such as plot coherence and content interest, thus forming a continued viewing behavior. Furthermore, the user's viewing time directly reflects the changing trend of their interest in videos. Therefore, accurately predicting the user's viewing time for short dramas can provide a basis for optimizing video recommendation systems.

[0003] However, existing methods for estimating user viewing time have several technical shortcomings: First, traditional value regression methods directly use regression models (such as mean squared error as a loss function) to predict viewing time, mapping features directly to continuous duration using a single function. This method is sensitive to outliers and struggles to handle long-tailed distributions, leading to significant prediction bias. Second, ordinal regression methods discretize continuous viewing time into multiple fixed time intervals, predicting each interval independently. This method ignores the dependencies between time intervals, and prediction performance is highly dependent on the granularity of interval division; coarse division easily loses key details, while fine division leads to data sparsity. Third, weighted regression and inverse bias methods mitigate bias through weighting or inverse bias mechanisms, such as WLR, D2Q, and CWM. These methods dynamically adjust and compensate for bias based on ordinal regression, but still do not fundamentally address the essential challenges of regression tasks. They cannot effectively model the sequential dependencies of user viewing behavior, making it difficult to achieve progressive, multi-step viewing time prediction.

[0004] Therefore, there is an urgent need for a method to predict video viewing time to address the technical problem of large prediction deviations caused by long-tail distribution and fixed time interval division, so as to make up for the shortcomings of existing technologies, especially to achieve accurate prediction of users' video viewing time in the scenario of continuous viewing of short dramas. Summary of the Invention

[0005] This disclosure provides a method, device, electronic device, and medium for predicting video viewing duration.

[0006] According to one aspect of this disclosure, a method for predicting video viewing duration is provided, comprising: Obtain the user characteristics of the user to be predicted and the video characteristics of the target video; Based on the user characteristics and the video characteristics, n time tokens are selected from a pre-built time token vocabulary according to preset rules to decompose the historical viewing duration of the target video watched by the user to be predicted, and generate a time token sequence; wherein, the time token vocabulary includes multiple time tokens with non-fixed durations; The predicted viewing duration of the target video for the user to be predicted is obtained by summing the durations corresponding to each time token in the time token sequence.

[0007] Optionally, before obtaining the user features of the user to be predicted and the video features of the target video, the method further includes: The time token vocabulary is pre-built based on the actual viewing time of all users on the platform.

[0008] Optionally, the pre-construction of the time token vocabulary based on the actual viewing time of all users within the platform includes: A viewing time dataset is obtained by statistically analyzing the actual viewing time of all users. The viewing time dataset is divided into multiple time intervals using a dynamic quantile algorithm, and multiple time tokens with non-fixed durations are generated based on each of the time intervals. The time tokens are combined into the time token vocabulary.

[0009] Optionally, before selecting n time tokens from a pre-built time token vocabulary based on the user features and the video features, the method further includes: The user features and the video features are encoded to obtain a feature vector; The step of selecting n time tokens from a pre-built time token vocabulary based on the user features and the video features includes: Based on the feature vector, n time tokens are selected from the pre-constructed time token vocabulary.

[0010] Optionally, the step of selecting n time tokens from a pre-built time token vocabulary based on the user features and the video features to decompose the historical viewing duration of the target video watched by the user to be predicted, and generating a time token sequence, includes: Based on the user characteristics and the video characteristics, the occurrence probability of each time token in the time token vocabulary is calculated; based on the occurrence probability, the largest time token not greater than the historical viewing duration is selected from the time token vocabulary; the largest time token is used as the first time token of the time token sequence, and the next time token is selected from the time token vocabulary in sequence according to the preset rules, until the nth time token is selected. The first time token to the nth time token are combined to form the time token sequence.

[0011] Optionally, the preset rule includes: the duration corresponding to each time token in the time token sequence decreases sequentially, and the length of the time token sequence is the shortest.

[0012] Optionally, the user characteristics include at least one of the following: user identifier; video identifier of historically viewed videos.

[0013] Optionally, the video features include at least one of the following: video identifier; video title; video category; video tag; video distribution volume; video likes; video favorites.

[0014] According to another aspect of this disclosure, a device for predicting video viewing duration is provided, comprising: The acquisition module is configured to acquire user features of the user to be predicted and video features of the target video. The sequence generation module is configured to select n time tokens from a pre-built time token vocabulary according to preset rules based on the user features and the video features, so as to decompose the historical viewing duration of the target video watched by the user to be predicted and generate a time token sequence; wherein, the time token vocabulary includes multiple time tokens with non-fixed durations; The prediction module is configured to sum the durations corresponding to each time token in the time token sequence to obtain the predicted viewing duration of the user to be predicted for the target video.

[0015] According to a third aspect of this disclosure, an electronic device is provided, comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method described in any of the above technical solutions.

[0016] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any one of the methods described above.

[0017] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any one of the above technical solutions.

[0018] This disclosure provides multiple time tokens of non-fixed duration by pre-constructing a time token vocabulary, transforming continuous historical viewing duration into discrete time tokens, and generating a time token sequence by combining time tokens to achieve accurate fitting of continuous duration, significantly improving the accuracy of duration prediction.

[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0020] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is a flowchart of the steps of the first video viewing duration prediction method according to the embodiments of this disclosure; Figure 2 This is a flowchart of the steps of the second video viewing duration prediction method according to the embodiments of this disclosure; Figure 3 This is a flowchart illustrating the steps of constructing a time token vocabulary according to an embodiment of this disclosure; Figure 4 This is a schematic diagram of the duration prediction model according to the embodiments of this disclosure; Figure 5 This is a schematic diagram of the decoder structure of the duration prediction model according to the embodiments of this disclosure; Figure 6 This is a schematic diagram of the structure of the first video viewing duration prediction device according to the embodiments of this disclosure; Figure 7 This is a schematic diagram of the structure of the second video viewing duration prediction device according to the embodiments of this disclosure; Figure 8 This is a structural diagram of the building module according to the embodiments of this disclosure; Figure 9 This is a block diagram of an electronic device used to implement the video viewing duration prediction method of the embodiments of this disclosure. Detailed Implementation

[0021] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0022] Traditional value regression methods are sensitive to the long-tailed distribution and outliers of viewing duration, resulting in significant prediction bias. Ordinal regression methods discretize continuous duration into fixed time intervals, ignoring the dependencies between these intervals and leading to data loss in coarse partitioning and sparse data in fine partitioning due to difficulty in controlling the granularity of interval division. Weighted regression and inverse bias methods can only alleviate some bias and still cannot effectively model the sequential dependencies of user viewing behavior, making accurate viewing duration prediction difficult. To address the aforementioned technical problems in video viewing duration prediction in existing technologies, this disclosure provides a method for predicting video viewing duration, such as... Figure 1 As shown, it includes: Step S101: Obtain the user characteristics of the user to be predicted and the video characteristics of the target video.

[0023] In this embodiment, user characteristics refer to key indicators extracted from user data that describe user behavior and preferences. As an example, user characteristics may include one or more of the following: user identifier, video identifiers of historically viewed videos, etc. It should be noted that in this disclosure, user characteristics are obtained by collecting user-related data with the user's authorization, and the legality of data collection and use is ensured through compliant methods (explicit notification, explicit consent, privacy policy disclosure, etc.). Video characteristics in this embodiment may include one or more of the following: video identifier, video title, video category, video tag, video distribution volume, video likes, video favorites, etc.

[0024] Step S102: Based on user features and video features, select n time tokens from a pre-built time token vocabulary according to preset rules to decompose the historical viewing duration of the target video watched by the user to be predicted, and generate a time token sequence; wherein, the time token vocabulary includes multiple time tokens with non-fixed duration.

[0025] For example, before predicting the viewing duration, a time token vocabulary V = {t1: 30 seconds, t2: 15 seconds, t3: 7 seconds, t4: 3 seconds, t5: 1 second, t6: 0.5 seconds, t7: 0.1 seconds} is pre-constructed. A time token sequence is generated based on the user's historical viewing duration. For example, if user A watched a short drama for 52.3 seconds in the past, n time tokens are selected from the time token vocabulary V to decompose the historical viewing duration of 52.3 seconds into multiple time intervals. For example, the time tokens 30 seconds, 15 seconds, 7 seconds, and 0.1 seconds are selected to generate a time token sequence [30 seconds, 15 seconds, 7 seconds, 0.1 seconds, 0.1 seconds, 0.1 seconds, END], where the sequence length T = 6.

[0026] Step S103: Sum the durations corresponding to each time token in the time token sequence to obtain the predicted viewing duration of the user for the target video.

[0027] After decomposing the historical viewing duration of 52.3 seconds into a time token sequence, the sum of each time token in the sequence is: 30 + 15 + 7 + 0.1 + 0.1 + 0.1 = 52.3 seconds. This means the predicted viewing duration for the current video is 52.3 seconds. The summation formula can be expressed as: , in, This represents the predicted viewing duration of the target video; t1, t2, ..., tn represent the time tokens in the time token sequence generated by the decoder. This represents the actual duration value corresponding to the i-th time token.

[0028] The time token vocabulary disclosed herein provides multiple time tokens of non-fixed duration, which serve as the basis for the model to generate time token sequences. This transforms continuous historical viewing durations into discrete time tokens, enabling the model to accurately fit continuous durations by combining time tokens. This improves the matching degree with video viewing duration prediction requirements. Furthermore, by combining multiple time tokens, it accurately covers long-tailed distributions of viewing durations, reducing the interference of outliers on the duration prediction results and improving the accuracy of video viewing duration prediction. This effectively solves the problems of traditional regression methods being sensitive to outliers and having difficulty adapting to long-tailed distributions. On the other hand, it compensates for the shortcomings of ordinal regression methods, which predict each fixed interval independently without a correction mechanism, significantly improving the accuracy of duration prediction. In addition, the time token vocabulary is generated based on big data, can cover the viewing duration range of all users, adapts to different data distributions, and has strong versatility. It can be quickly migrated to various user recommendation products, significantly improving the user experience of recommendation products.

[0029] As an optional implementation method, such as Figure 2 As shown, before step S101, which involves obtaining the user features of the user to be predicted and the video features of the target video, the following steps are also included: Step S100: Pre-build a time token vocabulary based on the actual viewing time of all users on the platform.

[0030] Specifically, before executing steps S101 to S103, this disclosure utilizes user viewing time data across the entire platform (e.g., an application APP) as the basis for constructing the time token vocabulary. For example, the viewing time of user A watching suspense short drama A, the viewing time of user A watching romance short drama B, etc. Viewing time can reflect users' viewing preferences and viewing patterns, that is, reflect the trend of user viewing time changes within the platform. In this embodiment, the time token vocabulary is automatically constructed using the real viewing time data of all users within the platform, avoiding the bias and data sparsity problems caused by fixed interval division, while covering all viewing times from extremely short to extremely long, ensuring the completeness and balance of the time token vocabulary.

[0031] As an optional implementation, in step S100, a time token vocabulary is pre-constructed based on the actual viewing time of all users within the platform, such as... Figure 3 As shown, it includes: Step S110: Statistical analysis of the actual viewing time of all users to obtain a viewing time dataset.

[0032] As an example, in the application scenario of short drama viewing apps, the viewing time data of all users on the platform is first collected, the data is cleaned, and invalid data such as negative duration or extreme outliers (such as incorrectly counted excessively long duration) are removed to obtain a standardized duration dataset D={t1,t2,...,tn} (t is the viewing time of a single user, and n is the total amount of data).

[0033] Step S120: Divide the viewing time dataset into multiple time intervals using a dynamic quantile algorithm, and generate multiple time tokens with non-fixed durations based on each time interval.

[0034] For example, the cleaned viewing time data is sorted from smallest to largest, and then divided into intervals according to a preset number of time tokens. For instance, to generate 7 tokens, the data is divided into 7 equal-frequency intervals (each interval contains approximately n / 7 data points), ensuring that each interval contains a similar number of user viewing time data points, thus avoiding sparse data in some intervals due to long-tail distribution. The upper limit (or median) of each duration interval is used as the corresponding time token. For example, if the first interval covers 0.1 seconds to 0.5 seconds, 0.5 seconds is used as the time token; if the second interval covers 0.5 seconds to 1 second, 1 second is used as the time token; and so on, ultimately obtaining time tokens covering the entire viewing time range within the app (such as 0.1 seconds, 0.5 seconds, 1 second, 3 seconds, 7 seconds, 15 seconds, and 30 seconds).

[0035] Step S130: Combine the time tokens into a time token vocabulary.

[0036] After obtaining time tokens covering all viewing durations, construct a time token vocabulary V = {t1: 30 seconds, t2: 15 seconds, t3: 7 seconds, t4: 3 seconds, t5: 1 second, t6: 0.5 seconds, t7: 0.1 seconds}.

[0037] This embodiment uses a dynamic quantile algorithm to perform quantile statistics on the short drama viewing time data of a large number of users within the APP to achieve quantile division, ultimately forming non-fixed duration intervals that cover all viewing time and are evenly distributed. This algorithm does not require preset time segment size, number, or interval division rules, but rather achieves interval division based on the distribution characteristics of users' actual viewing time data, adapting to different data distributions. Compared with traditional ordinal regression methods that use manually preset fixed duration intervals (such as 0-10 seconds, 10-20 seconds, 20-30 seconds, etc.), where there is a lack of correlation between intervals (such as the continuity between 10-20 seconds and 20-30 seconds) and the granularity of division is difficult to control, this disclosure uses dynamic interval division based on actual viewing time data, which can adapt to long-tail distributions and avoids the drawbacks of interval division in traditional ordinal regression methods.

[0038] As an optional implementation, before selecting n time tokens from a pre-built time token vocabulary based on user characteristics and video characteristics in step S102, the method further includes: User features and video features are encoded to obtain feature vectors.

[0039] Based on user and video features, n time tokens are selected from a pre-built time token vocabulary, including: Select n time tokens from a pre-built time token vocabulary based on feature vectors.

[0040] Specifically, such as Figure 4 The flowchart shown illustrates the duration prediction process. The duration prediction model includes an encoder 401 and a decoder 402. User features and video features are acquired and input into the encoder 401 of the duration prediction model. The encoder 401 performs feature fusion and dimensionality reduction on the user features and video features, outputting a feature vector. Figure 5 The hidden vector (shown) is used as the input data for the Decoder. In this embodiment, the encoder encodes user features and video features, transforming the original features into a unified vector representation, which provides effective input for the decoder to generate autoregressive sequences. The decoder 402 generates time token sequences t1 to tn based on the feature vector output by the encoder 401 and the time token vocabulary 403.

[0041] As an optional implementation, step S102 involves selecting n time tokens from a pre-built time token vocabulary based on user and video features to decompose the historical viewing duration of the target video watched by the user to be predicted, generating a time token sequence, including: Based on user and video characteristics, the occurrence probability of each time token in the time token vocabulary is calculated; based on the occurrence probability, the largest time token not greater than the historical viewing duration is selected from the time token vocabulary; the largest time token is used as the first time token in the time token sequence, and the next time token is selected from the time token vocabulary in sequence according to the preset rules, until the nth time token is selected.

[0042] Combine the first time token to the nth time token into a time token sequence.

[0043] In this embodiment, the decoder uses an autoregressive structure based on RNN (such as LSTM) to progressively generate a sequence of time tokens representing viewing duration. It can also be replaced with a more complex network structure (such as the Transformer structure). Figure 5The diagram shows the specific structure of decoder 402. The input to decoder 402 is the hidden feature vector output by encoder 401. This feature vector carries semantic information about user and video features and serves as the basic state for the decoder's generated sequence. SOS (Start Of Sequence) is the sequence start marker, the initial input signal for the model's generated sequence, used to trigger the decoder to generate its first output. Decoder 402 includes multiple LSTM units responsible for calculating the output and state update at the next time step based on the current input and hidden state. Each LSTM unit calculates the probability of occurrence of each time token to determine the currently generated time token. Furthermore, starting from the second LSTM unit, each LSTM unit calculates the time token with the highest probability of occurrence based on the time token output from the previous level. p1 to pn represent the probability distribution of tokens at each time step, used to select the time token with the highest probability of occurrence as the current output. to This indicates that the time tokens generated at each time point (i.e., the elements contained in the time token sequence) are the optimal results selected from each probability distribution P1 to Pn, such as selecting the time token with the highest probability of occurrence through a greedy strategy.

[0044] Here's an example of how the decoder generates a time token sequence based on the feature vector. For instance, if user A watched a short drama for 52.3 seconds (i.e., the historical viewing time is 52.3 seconds), when generating the first time token, it matches the largest time token with a duration ≤ 52.3 seconds: 30 seconds, leaving 22.3 seconds remaining. Next, it calculates the probability of the remaining candidate time tokens, matching the largest time token with a duration ≤ 22.3 seconds: 15 seconds as the second time token, leaving 7.3 seconds remaining; matching the largest time token with a duration ≤ 7.3 seconds: 7 seconds, leaving 0.3 seconds remaining; finally, matching the largest time token with a duration ≤ 0.3 seconds: 0.1 seconds, combining three 0.1-second time tokens to form 0.3 seconds, leaving 0 seconds remaining. This completes the matching of the first to nth time tokens, generating the time token sequence [30 seconds, 15 seconds, 7 seconds, 0.1 seconds, 0.1 seconds, 0.1 seconds, END], and then decodes and verifies it to obtain the predicted viewing time of 52.3 seconds. In short, a time token vocabulary is used as the basis for generating time token sequences. The time tokens with the highest probability of occurrence are selected from this vocabulary. Historical viewing time is broken down into multiple intervals and combined to form a time token sequence. The probability of occurrence for each time token is calculated based on the previous time token, and the probability of occurrence for the next time token is calculated sequentially based on the remaining time.

[0045] It's important to note that the time tokens in the time token sequence are not generated simultaneously, but sequentially. After the first time token is generated, the second time token is generated based on it, and so on, until the last time token is generated. In other words, the generation of each subsequent time token depends on the output of the previous time token. The predictions of each time token are interdependent, and the system possesses dynamic bias compensation capabilities. For example, if there is a slight bias in the generation of a preceding time token, subsequent time tokens can be adjusted to compensate for it, thus overcoming the shortcomings of traditional ordinal regression where the intervals are independent and lack a correction mechanism.

[0046] As an optional implementation, in step S102, the next time token is selected sequentially from the time token vocabulary according to a preset rule, until the nth time token is selected. The preset rule includes that the duration corresponding to each time token in the time token sequence decreases sequentially, and that the length of the time token sequence is minimized.

[0047] like Figure 4 As shown, decoder 402 includes multiple LSTM units (402a, 402b to 402n). Each LSTM unit calculates the probability of occurrence of each time token in the time token sequence, thereby selecting the time token with the highest probability of occurrence that is not greater than the user's historical viewing duration. Each LSTM unit needs to calculate the probability of occurrence of the current time token based on the output of the previous time token, and gradually generate subsequent time tokens. For example, after generating 30 seconds of time tokens, based on the 30-second time tokens and the remaining duration of 22.3 seconds, the maximum time token of 15 seconds, which is not greater than the remaining duration, is selected as the next time token. This ensures that the time token sequence follows the rules of greedy decomposition and monotonically decreasing, which conforms to the changing trend of the user's interest in watching videos gradually decreasing, thereby achieving accurate modeling of the user's viewing behavior and improving the accuracy of duration prediction.

[0048] As an optional implementation, user features include at least one of the following: user identifier; video identifier of historically viewed videos. User features are key indicators used to describe user behavior and preferences, which can assist the decoder in generating time token sequences based on user viewing preferences, making the generated time token sequences more consistent with user viewing preferences, thereby improving the accuracy of viewing duration prediction.

[0049] As an optional implementation, video features include at least one of the following: video identifier; video title; video category; video tag; video distribution volume; video likes; video favorites.

[0050] Specifically, video features include metrics such as popularity and user approval, accurately matching user preferences and helping the model learn the correlation between video popularity and user viewing preferences. For example, it can learn which types of videos better suit user viewing preferences based on the number of video favorites. After being encoded by the encoder, these features generate vector representations rich in deep semantics, providing a reliable basis for the decoder to autoregressively generate time token sequences that match user viewing preferences. This effectively improves the accuracy of viewing duration prediction and adapts to different types and popularity of videos, further optimizing the user experience of video recommendation products.

[0051] This disclosure also provides a video viewing duration prediction device 600, such as... Figure 6 As shown, it includes: The acquisition module 601 is configured to acquire user features of the user to be predicted and video features of the target video.

[0052] In this embodiment, user characteristics refer to key indicators extracted from user data that describe user attributes, behaviors, and preferences. As an example, user characteristics may include one or more of the following: user identifier, video identifiers of historically viewed videos, etc. It should be noted that the prediction device in this disclosure acquires user characteristics only after obtaining user authorization, and ensures the legality of data collection and use through compliant methods (explicit notification, explicit consent, privacy policy disclosure, etc.). Video characteristics in this embodiment may include one or more of the following: video identifier, video title, video category, video tag, video distribution volume, video likes, video favorites, etc.

[0053] The sequence generation module 602 is configured to select n time tokens from a pre-built time token vocabulary according to preset rules based on user features and video features, in order to decompose the historical viewing duration of the target video watched by the user to be predicted, and generate a time token sequence; wherein, the time token vocabulary includes multiple time tokens with non-fixed duration.

[0054] For example, before predicting the viewing duration, a time token vocabulary V = {t1: 30 seconds, t2: 15 seconds, t3: 7 seconds, t4: 3 seconds, t5: 1 second, t6: 0.5 seconds, t7: 0.1 seconds} is pre-constructed. A time token sequence is generated based on the user's historical viewing duration. For example, if user A watched a short drama for 52.3 seconds in the past, n time tokens are selected from the time token vocabulary V to decompose the historical viewing duration of 52.3 seconds into multiple time intervals. For example, the time tokens 30 seconds, 15 seconds, 7 seconds, and 0.1 seconds are selected to generate a time token sequence [30 seconds, 15 seconds, 7 seconds, 0.1 seconds, 0.1 seconds, 0.1 seconds, END], where the sequence length T = 6.

[0055] The prediction module 603 is configured to sum the durations corresponding to each time token in the time token sequence to obtain the predicted viewing duration of the user watching the target video.

[0056] After decomposing the historical viewing duration of 52.3 seconds into a time token sequence, the time tokens in the time token sequence are summed, i.e., 30 + 15 + 7 + 0.1 + 0.1 + 0.1 = 52.3 seconds, which means that the user's predicted viewing duration for the current video is 52.3 seconds.

[0057] In this disclosure, the prediction device transforms continuous historical viewing durations into discrete time tokens based on multiple non-fixed-duration time tokens provided by a time token vocabulary. This allows the model to accurately fit continuous durations by combining time tokens, improving the matching degree with video viewing duration prediction requirements. Furthermore, by combining multiple time tokens, it accurately covers long-tailed distributions of viewing durations, reducing the interference of outliers on the duration prediction results and improving the accuracy of video viewing duration prediction. This effectively solves the problems of traditional regression methods being sensitive to outliers and having difficulty adapting to long-tailed distributions. On the other hand, it compensates for the shortcomings of ordinal regression methods, which predict each fixed interval independently without a correction mechanism, significantly improving the accuracy of duration prediction. In addition, the time token vocabulary is generated based on big data, which can cover the viewing duration range of all users, adapt to different data distributions, and has strong versatility. It can be quickly migrated to various user recommendation products, significantly improving the user experience of recommendation products.

[0058] As an optional implementation method, such as Figure 7 As shown, the prediction device 600 also includes: Module 604 is configured to pre-build a time token vocabulary based on the actual viewing time of all users on the platform before the acquisition module acquires the user characteristics of the user to be predicted and the video characteristics of the target video.

[0059] Specifically, before the prediction device performs viewing duration prediction, the viewing duration data of all users across the platform is used as the basis for constructing the time token vocabulary. For example, the viewing duration of user A watching suspense short drama A, the viewing duration of user A watching romance short drama B, etc. Viewing duration can reflect users' viewing preferences and viewing patterns, that is, reflect the trend of users' viewing duration changes within the platform. In this embodiment, the time token vocabulary is automatically constructed using the real viewing duration data of all users within the platform, avoiding the bias and data sparsity problems caused by fixed interval division, while covering all viewing durations from extremely short to extremely long, ensuring the completeness and balance of the time token vocabulary.

[0060] As an optional implementation method, such as Figure 8 As shown, building module 604 includes: The statistics unit 604a is configured to statistically analyze the actual viewing time of all users to obtain a viewing time dataset.

[0061] As an example, in the application scenario of short drama viewing apps, the viewing time data of all users on the platform is first collected, the data is cleaned, and invalid data such as negative duration or extreme outliers (such as incorrectly counted excessively long duration) are removed to obtain a standardized duration dataset D={t1,t2,...,tn} (t is the viewing time of a single user, and n is the total amount of data).

[0062] Interval partitioning unit 604b is configured to divide the viewing duration dataset into multiple duration intervals using a dynamic quantile algorithm, and generate multiple time tokens of non-fixed duration based on each duration interval.

[0063] For example, the cleaned viewing time data is sorted in ascending order, and divided into intervals according to a preset number of time tokens. For instance, to generate 7 tokens, the data is divided into 7 equal-frequency intervals (each interval contains approximately n / 7 data points), ensuring that each interval contains a similar number of user viewing time data points, avoiding sparse data in some intervals due to long-tail distribution. The upper limit (or median) of each duration interval is used as the corresponding time token. For example, the first interval covers 0.1 seconds to 0.5 seconds, so 0.5 seconds is used as the token; the second interval covers 0.5 seconds to 1 second, so 1 second is used as the token; and so on, ultimately obtaining time tokens covering the entire viewing time range within the app (such as 0.1 seconds, 0.5 seconds, 1 second, 3 seconds, 7 seconds, 15 seconds, and 30 seconds).

[0064] Combination unit 604c is configured to combine individual time tokens into a time token vocabulary.

[0065] After obtaining time tokens covering all viewing durations, construct a time token vocabulary V = {t1: 30 seconds, t2: 15 seconds, t3: 7 seconds, t4: 3 seconds, t5: 1 second, t6: 0.5 seconds, t7: 0.1 seconds}.

[0066] In this embodiment, the construction module 604 uses a dynamic quantile algorithm to perform quantile statistics on the data based on the massive short drama viewing time data of users within the APP, thus dividing the data and ultimately forming non-fixed duration intervals that cover all viewing time and are evenly distributed. This algorithm does not require preset time segment size, number, or interval division rules; instead, it divides the intervals based on the distribution characteristics of users' actual viewing time data, adapting to different data distributions. Compared to traditional ordinal regression methods that use manually preset fixed duration intervals (such as 0-10 seconds, 10-20 seconds, 20-30 seconds, etc.), where there is a lack of correlation between intervals (such as the continuity between 10-20 seconds and 20-30 seconds) and the granularity of division is difficult to control, this disclosure uses dynamic interval division based on actual viewing time data, which can adapt to long-tail distributions and avoids the drawbacks of interval division in traditional ordinal regression methods.

[0067] As an optional implementation, the prediction device further includes: The encoding module is configured to encode the user features and video features to obtain a feature vector before the sequence generation module selects n time tokens from a pre-built time token vocabulary based on user features and video features.

[0068] The sequence generation module 602 selects n time tokens from a pre-built time token vocabulary based on user features and video features, including: Select n time tokens from a pre-built time token vocabulary based on feature vectors.

[0069] Specifically, such as Figure 4 The flowchart shown illustrates the duration prediction process. The duration prediction model includes an encoder 401 and a decoder 402. User features and video features are acquired and input into the encoder 401 of the duration prediction model. The encoder 401 performs feature fusion and dimensionality reduction on the user features and video features, outputting a feature vector. Figure 5 As shown, the hidden vector (also known as the latent vector) serves as the input data for the decoder. In this embodiment, the encoder encodes user features and video features, transforming the original features into a unified vector representation, providing effective input for the decoder's autoregressive sequence generation. The decoder 402 generates time token sequences t1 to tn based on the feature vector output by the encoder 401 and the time token vocabulary 403.

[0070] As an optional implementation, the sequence generation module 602 includes: The computing unit 602a is configured to calculate the occurrence probability of each time token in the time token vocabulary based on user features and video features; based on the occurrence probability, select the largest time token from the time token vocabulary that is no greater than the historical viewing duration; take the largest time token as the first time token in the time token sequence, and select the next time token from the time token vocabulary in sequence according to preset rules, until the nth time token is selected.

[0071] The combining unit is configured to combine the first time token to the nth time token into a time token sequence.

[0072] Specifically, such as Figure 5 The diagram shows the specific structure of decoder 402. The input to decoder 402 is the hidden feature vector output by encoder 401. This feature vector carries semantic information about user and video features and serves as the basic state for the decoder's generated sequence. SOS, the sequence start marker, is the initial input signal for the model's generated sequence, used to trigger the decoder to generate its first output. Decoder 402 includes multiple levels of LSTM units, responsible for calculating the output and state update at the next time step based on the current input and hidden state. Each LSTM unit calculates the probability of occurrence of each time token to determine the currently generated time token. Furthermore, starting from the second level of LSTM units, each LSTM unit calculates the time token with the highest probability of occurrence based on the time tokens output from the previous level. p1 to pn represent the probability distribution of tokens at each time step, used to select the time token with the highest probability of occurrence as the current output. to This indicates that the time tokens generated at each time point (i.e., the elements contained in the time token sequence) are the optimal results selected from each probability distribution P1 to Pn, such as selecting the time token with the highest probability of occurrence through a greedy strategy.

[0073] Here's an example of how the decoder generates a time token sequence based on the feature vector. For instance, if user A watched a short drama for 52.3 seconds (i.e., the historical viewing time is 52.3 seconds), when generating the first time token, it matches the largest time token with a duration ≤ 52.3 seconds: 30 seconds, leaving 22.3 seconds remaining. Next, it calculates the probability of the remaining candidate time tokens, matching the largest time token with a duration ≤ 22.3 seconds: 15 seconds as the second time token, leaving 7.3 seconds remaining; matching the largest time token with a duration ≤ 7.3 seconds: 7 seconds, leaving 0.3 seconds remaining; finally, matching the largest time token with a duration ≤ 0.3 seconds: 0.1 seconds, combining three 0.1-second time tokens to form 0.3 seconds, leaving 0 seconds remaining. This completes the matching of the first to nth time tokens, generating the time token sequence [30 seconds, 15 seconds, 7 seconds, 0.1 seconds, 0.1 seconds, 0.1 seconds, END], and then decodes and verifies it to obtain the predicted viewing time of 52.3 seconds. In short, a time token vocabulary is used as the basis for generating time token sequences. The time tokens with the highest probability of occurrence are selected from this vocabulary. Historical viewing time is broken down into multiple intervals and combined to form a time token sequence. The probability of occurrence for each time token is calculated based on the previous time token, and the probability of occurrence for the next time token is calculated sequentially based on the remaining time.

[0074] It's important to note that the time tokens in the time token sequence are not generated simultaneously, but sequentially. After the first time token is generated, the second time token is generated based on it, and so on, until the last time token is generated. In other words, the generation of each subsequent time token depends on the output of the previous time token. The predictions of each time token are interdependent, and the system possesses dynamic bias compensation capabilities. For example, if there is a slight bias in the generation of a preceding time token, subsequent time tokens can be adjusted to compensate for it, thus overcoming the shortcomings of traditional ordinal regression where the intervals are independent and lack a correction mechanism.

[0075] As an optional implementation, during the generation of the time token sequence by the sequence generation module 602, the next time token is selected sequentially from the time token vocabulary according to a preset rule, until the nth time token is selected. The preset rule includes that the duration corresponding to each time token in the time token sequence decreases sequentially, and that the length of the time token sequence is minimized.

[0076] like Figure 4As shown, the decoder includes multiple LSTM units (402a, 402b to 402n). Each LSTM unit calculates the probability of occurrence of each time token in the time token sequence, thereby selecting the time token with the highest probability of occurrence that is not greater than the user's historical viewing duration. Each LSTM unit needs to calculate the probability of occurrence of the current time token based on the output of the previous time token, and gradually generate subsequent time tokens. For example, after generating 30 seconds of time tokens, based on the 30-second time tokens and the remaining duration of 22.3 seconds, the maximum time token of 15 seconds, which is not greater than the remaining duration, is selected as the next time token. This ensures that the time token sequence follows the rules of greedy decomposition and monotonically decreasing, which conforms to the changing trend of the user's interest in watching videos gradually decreasing, achieving accurate modeling of the user's viewing behavior, thereby improving the accuracy of duration prediction.

[0077] As an optional implementation, user features include at least one of the following: user identifier; video identifier of historically viewed videos. User features are key indicators used to describe user behavior and preferences, which can assist the decoder in generating time token sequences based on user viewing preferences, making the generated time token sequences more consistent with user viewing preferences, thereby improving the accuracy of viewing duration prediction.

[0078] As an optional implementation, video features include at least one of the following: video identifier; video title; video category; video tag; video distribution volume; video likes; video favorites.

[0079] Specifically, video features include metrics such as popularity and user approval, accurately matching user preferences and helping the model learn the correlation between video popularity and user viewing preferences. For example, it can learn which types of videos better suit user viewing preferences based on the number of video favorites. After being encoded by the encoder, these features generate vector representations rich in deep semantics, providing a reliable basis for the decoder to autoregressively generate time token sequences that match user viewing preferences. This effectively improves the accuracy of viewing duration prediction and adapts to different types and popularity of videos, further optimizing the user experience of video recommendation products.

[0080] The acquisition, storage, and application of any type of information, such as user personal information, involved in the technical solutions disclosed herein comply with relevant laws and regulations and do not violate public order and good morals.

[0081] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0082] Figure 9A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0083] like Figure 9 As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or a computer program loaded from storage unit 908 into random access memory (RAM) 903. RAM 903 may also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.

[0084] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0085] The computing unit 901 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as prediction methods. For example, in some embodiments, the prediction method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the prediction method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform prediction methods by any other suitable means (e.g., by means of firmware).

[0086] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0087] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0088] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0089] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0090] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0091] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0092] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.

[0093] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for predicting video viewing duration, comprising: Obtain the user characteristics of the user to be predicted and the video characteristics of the target video; Based on the user characteristics and the video characteristics, n time tokens are selected from a pre-built time token vocabulary according to preset rules to decompose the historical viewing duration of the target video watched by the user to be predicted, and generate a time token sequence; wherein, the time token vocabulary includes multiple time tokens with non-fixed durations; The predicted viewing duration of the target video for the user to be predicted is obtained by summing the durations corresponding to each time token in the time token sequence.

2. The prediction method according to claim 1, wherein, Before obtaining the user features of the user to be predicted and the video features of the target video, the process also includes: The time token vocabulary is pre-built based on the actual viewing time of all users on the platform.

3. The prediction method according to claim 2, wherein, The time token vocabulary pre-constructed based on the actual viewing time of all users within the platform includes: A viewing time dataset is obtained by statistically analyzing the actual viewing time of all users. The viewing time dataset is divided into multiple time intervals using a dynamic quantile algorithm, and multiple time tokens with non-fixed durations are generated based on each of the time intervals. The time tokens are combined into the time token vocabulary.

4. The prediction method according to claim 1, further comprising, before selecting n time tokens from a pre-constructed time token vocabulary based on the user features and the video features: The user features and the video features are encoded to obtain a feature vector; The step of selecting n time tokens from a pre-built time token vocabulary based on the user features and the video features includes: Based on the feature vector, n time tokens are selected from the pre-constructed time token vocabulary.

5. The prediction method according to claim 1, wherein selecting n time tokens from a pre-constructed time token vocabulary based on the user features and the video features to decompose the historical viewing duration of the target video watched by the user to be predicted, and generating a time token sequence, includes: Based on the user characteristics and the video characteristics, the occurrence probability of each time token in the time token vocabulary is calculated; Based on the probability of occurrence, select the largest time token from the time token vocabulary that is not greater than the historical viewing duration; The largest time token is used as the first time token in the time token sequence, and the next time token is selected from the time token vocabulary according to the preset rules, until the nth time token is selected. The first time token to the nth time token are combined to form the time token sequence.

6. The prediction method according to claim 1 or 5, wherein, The preset rules include: the duration of each time token in the time token sequence decreases sequentially, and the length of the time token sequence is the shortest.

7. The prediction method according to any one of claims 1-6, wherein, The user characteristics include at least one of the following: user identifier; video identifier of historically viewed videos.

8. The prediction method according to any one of claims 1-6, wherein, The video features include at least one of the following: video identifier; video title; video category; video tag; video distribution volume; video likes; video favorites.

9. A device for predicting video viewing duration, comprising: The acquisition module is configured to acquire user features of the user to be predicted and video features of the target video. The sequence generation module is configured to select n time tokens from a pre-built time token vocabulary according to preset rules based on the user features and the video features, so as to decompose the historical viewing duration of the target video watched by the user to be predicted and generate a time token sequence; wherein, the time token vocabulary includes multiple time tokens with non-fixed durations; The prediction module is configured to sum the durations corresponding to each time token in the time token sequence to obtain the predicted viewing duration of the user to be predicted for the target video.

10. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.

11. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-8.

12. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-8.