Video preloading method and device, storage medium and electronic equipment
By using behavior prediction models in the video player to predict the videos clicked by users and preload only the videos predicted for possible clicks by users, it solves the problem of resource waste caused by the single traditional preloading strategy and improves user experience and system efficiency.
Patent Information
- Application Number
- CN202411540894.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-11
AI Technical Summary
The traditional video preloading strategy is relatively single, resulting in the videos clicked by users that are not preloaded while the preloaded videos are not viewed, resulting in waste of resources.
By taking each video in the video list and entering it into the target prediction model for behavior prediction, predicting whether the user will click play. Preload the video that is predicted by the user to click so that the user can play it directly after clicking.
It has achieved the reduction of bandwidth and traffic waste, optimized resource utilization, improved user experience and system efficiency, while reducing cache usage and server pressure.
Smart Images

Figure CN119420965A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a video preloading method, device, storage medium and electronic device. Background Art
[0002] In order to increase the speed of broadcasting, players usually adopt a preloading strategy. For example, when the user starts the software and enters the homepage, the player module will preload the content on the homepage. For example, if there are 6 episodes on the homepage, the player will preload the videos of these 6 episodes respectively. After the preloading is completed, you can directly use the preloaded video to play when you click on a certain episode, which greatly speeds up the video broadcast time. The number of preloaded episodes is limited, and the traditional preloading strategy is relatively simple. This often results in the user clicking on the preloaded video not being preloaded, and the user not watching the preloaded video, which wastes the company's bandwidth and the user's traffic. Summary of the invention
[0003] The present application provides a video preloading method, device, storage medium and electronic device to solve the technical problem that the traditional preloading strategy is relatively simple and wastes resources.
[0004] In a first aspect, the present application provides a method for preloading videos, comprising: obtaining each video in a video list; inputting each of the above videos into a target prediction model, performing behavior prediction on each of the above videos, and obtaining a behavior prediction result for each of the above videos, wherein the above behavior prediction results include a prediction that the user will click to play and a prediction that the user will not click to play; preloading each video whose behavior prediction result is that the user is predicted to click to play, so that when the user clicks to play the target video, the target video is directly played, wherein the above target video is any one of all the videos that have completed preloading.
[0005] In a second aspect, the present application provides a video preloading device, comprising: a first acquisition module, used to acquire each video in a video list; a prediction module, used to input each of the above videos into a target prediction model, perform behavior prediction on each of the above videos, and obtain a behavior prediction result for each of the above videos, wherein the above behavior prediction results include a prediction that the user will click to play and a prediction that the user will not click to play; a preloading module, used to preload each video whose behavior prediction result is that the user is predicted to click to play, so that when the user clicks to play the target video, the target video is played directly, wherein the above target video is any one of all the videos that have completed preloading.
[0006] As an optional example, the above-mentioned device also includes: a second acquisition module, used to obtain the power and processor usage of the target terminal before inputting each of the above-mentioned videos into the target prediction model; a third acquisition module, used to obtain the click-to-play behavior data of the above-mentioned user when the above-mentioned power is greater than the first threshold and the above-mentioned processor usage is less than or equal to the second threshold; a first training module, used to train the initial prediction model according to the above-mentioned click-to-play behavior data when it is determined that the data volume of the above-mentioned click-to-play behavior data is greater than the third threshold, so as to obtain the above-mentioned target prediction model.
[0007] As an optional example, the above-mentioned device also includes: a determination module, which is used to determine whether the video corresponding to the above-mentioned video click behavior is played when it is detected that the above-mentioned user has performed a video click behavior before obtaining the above-mentioned user's click and play behavior data; a saving module, which is used to save the above-mentioned video click behavior and the corresponding video to the above-mentioned click and play behavior data when it is determined that the video corresponding to the above-mentioned video click behavior is played.
[0008] As an optional example, the above-mentioned first training module includes: an acquisition unit, used to acquire the click-to-play behavior data of the above-mentioned user; a division unit, used to divide the above-mentioned click-to-play behavior data into training data and verification data; a training unit, used to input the above-mentioned training data into the above-mentioned initial prediction model to obtain the result data of the above-mentioned training data; a calculation unit, used to calculate the difference between the above-mentioned result data and the above-mentioned verification data to obtain a loss value; an adjustment unit, used to adjust the model parameters of the above-mentioned initial prediction model according to the above-mentioned loss value, and recalculate the above-mentioned loss value until the recalculated above-mentioned loss value is less than or equal to the fourth threshold value, so as to obtain the above-mentioned target prediction model.
[0009] As an optional example, the above-mentioned device also includes: a second training module, which is used to train the initial prediction model according to the above-mentioned click-to-play behavior data to obtain the above-mentioned target prediction model, obtain the above-mentioned click-to-play behavior data once every target duration, and train the above-mentioned target prediction model according to the latest obtained click-to-play behavior data to obtain the trained target prediction model.
[0010] As an optional example, the above-mentioned preloading module includes: a processing unit, used to take each video that the user is predicted to click to play as the current video as the above-mentioned behavior prediction result, and perform the following operations on the above-mentioned current video: obtain the above-mentioned current video from the server cache; save part or all of the content of the above-mentioned current video to the local cache.
[0011] As an optional example, the above-mentioned processing unit is used to obtain the playback probability in the behavior prediction result of the above-mentioned current video; when the above-mentioned playback probability is greater than the fifth threshold, the entire content of the above-mentioned current video is saved to the above-mentioned local cache; when the above-mentioned playback probability is less than or equal to the above-mentioned fifth threshold, part of the content of the above-mentioned current video is saved to the above-mentioned local cache.
[0012] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the above-mentioned video preloading method when executed by a processor.
[0013] In a fourth aspect, the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the video preloading method through the computer program.
[0014] In an embodiment of the present application, a method is adopted to obtain each video in a video list; input each of the above videos into a target prediction model, perform behavior prediction on each of the above videos, and obtain a behavior prediction result for each of the above videos, wherein the above behavior prediction results include predictions that the user will click to play and predictions that the user will not click to play; and preload each video for which the above behavior prediction result predicts that the user will click to play, so that when the user clicks to play the target video, the target video is directly played, wherein the target video is any one of all the preloaded videos. In the above method, the behavior prediction model is used to analyze the videos that the user may click on the video list, and these videos are preloaded, so that the cached video can be directly played after the user clicks, thereby achieving the purpose of reducing the waste of bandwidth and traffic, optimizing resource utilization, improving user experience and system efficiency, and reducing cache occupancy and server pressure, thereby solving the technical problem that the traditional preloading strategy is relatively single and wastes resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0018] Figure 1 is a flowchart of an optional video preloading method according to an embodiment of the present application;
[0019] Figure 2 is a specific implementation flow chart of an optional video preloading method according to an embodiment of the present application;
[0020] Figure 3 is a schematic structural diagram of an optional video preloading device according to an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0023] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0024] According to a first aspect of an embodiment of the present application, a video preloading method is provided, optionally, as follows: Figure 1 As shown, the above method includes:
[0025] S102, obtaining each video in the video list;
[0026] S104, inputting each video into the target prediction model, performing behavior prediction on each video, and obtaining a behavior prediction result for each video, wherein the behavior prediction result includes a prediction that the user will click to play and a prediction that the user will not click to play;
[0027] S106, preloading each video predicted by the behavior prediction result that the user will click to play, so that when the user clicks to play the target video, the target video is played directly, wherein the target video is any video among all the preloaded videos.
[0028] Optionally, in this embodiment, first, a list of all videos currently visible to the user is obtained from the homepage or recommendation page of the video application. These videos can be based on the user's interests, historical behaviors, or real-time popular content. Each video will be input into a behavior prediction model. The model is analyzed based on multiple features, such as the user's historical viewing behavior and other user-related data, with the goal of predicting the click probability of each video, that is, judging whether the user will click to play the video. The output result of the behavior prediction model will generate a behavior prediction label for each video, which is usually divided into two categories: Prediction of user click to play: The video is considered to have a high probability of being clicked by the user. Prediction of user will not click to play: The video is considered to be of no interest to the user and has a low probability of being clicked. For videos that the prediction model determines that the user may click, these videos will be preloaded. Preloading means obtaining part or all of the video data from the server or CDN (Content Delivery Network) in the background in advance and caching it in the local storage or memory of the user's device. In this way, when the user actually clicks on these videos, the playback process will proceed seamlessly, reducing loading time and improving response speed. When a user clicks on any preloaded video, the player does not need to request data from the server again. It can directly use the locally cached video clip and play it immediately, which greatly shortens the video startup time and makes the user hardly feel any delay.
[0029] Optionally, in this embodiment, through intelligent preloading, the video can be played immediately after the user clicks the play button, avoiding the waiting time caused by network delays or long server response times, thereby significantly improving the user's viewing experience. Traditional preloading may load videos that the user is not interested in, wasting server bandwidth and user traffic. By introducing a behavior prediction model, preloading is limited to the videos that the user is most likely to click, reducing unnecessary data transmission and saving valuable network resources.
[0030] As an optional example, before inputting each video into the target prediction model, the method further includes:
[0031] Get the power and processor usage of the target terminal;
[0032] When the power level is greater than the first threshold and the processor usage rate is less than or equal to the second threshold, obtaining the user's click-to-play behavior data;
[0033] When it is determined that the data volume of the click-to-play behavior data is greater than the third threshold, the initial prediction model is trained according to the click-to-play behavior data to obtain a target prediction model.
[0034] Optionally, in this embodiment, the battery power and processor usage of the user device are monitored in real time to ensure that the performance and power of the device are sufficient when any data processing and model training are performed to avoid affecting the user experience and device performance. Only when the power of the device is higher than the preset first threshold value, the next step will be performed to ensure that the device will not be interrupted due to insufficient power when performing subsequent operations. When the processor usage rate is lower than or equal to the second threshold value, it indicates that the device has sufficient computing resources for data processing and model training. If the processor is busy, it may cause slow response or system instability. When the power and processor usage conditions are met, the user's click-to-play behavior data is obtained, which includes information such as which videos the user clicked, the click frequency, and the viewing time. Check the amount of click-to-play behavior data collected to ensure that it is greater than the third threshold value. Only when the amount of data is large enough can effective model training be performed to ensure the accuracy and generalization ability of the model. Once it is confirmed that the amount of click-to-play behavior data is sufficient, the initial prediction model is trained using these data to generate a target prediction model. By monitoring the power and processor usage rate, the system ensures that data processing is performed when the device has good performance and sufficient power, reducing the risk of operation failure due to insufficient device performance. When collecting user click-to-play behavior data, ensuring that the data volume is greater than the third threshold can improve the representativeness and reliability of the data, reduce model training errors caused by insufficient data, and thus improve the prediction effect of the final prediction model. By performing data processing and model training under appropriate device conditions, device resources can be effectively utilized, avoiding unnecessary operations when the battery is low or the processor is busy, and reducing the impact on user devices.
[0035] As an optional example, before obtaining the user's click-to-play behavior data, the above method further includes:
[0036] When detecting that a user has clicked on a video, determining whether the video corresponding to the video click is played;
[0037] When it is determined that the video click behavior corresponds to the video playback, the video click behavior and the corresponding video are saved in the click-to-play behavior data.
[0038] Optionally, in this embodiment, when obtaining the user's click-to-play behavior data. Monitor the user's operation in real time. Once it is detected that the user clicks on a video (for example, the user clicks the play button in the video list), check whether the video clicked by the user starts playing successfully. If it is confirmed that the video corresponding to the video click behavior is successfully played, the following information will be recorded: video click behavior, record the specific time, location, click method (for example, direct click or long press, etc.) when the user clicks to play, corresponding video information, record relevant information of the video, such as video tags, titles, duration, play time, etc. These data will be stored in the "click-to-play behavior data" for subsequent analysis and model training. By confirming whether the video is played, it can be ensured that the recorded click behavior data is true and valid, and avoid recording click behaviors caused by network problems or player failures. Recording the user's click-to-play behavior and corresponding video information can provide a rich data basis for subsequent analysis, thereby optimizing content recommendations and playback strategies.
[0039] As an optional example, when it is determined that the amount of click-to-play behavior data is greater than the third threshold, the initial prediction model is trained according to the click-to-play behavior data to obtain the target prediction model, including:
[0040] Get the user's click-to-play behavior data;
[0041] Divide the click-to-play behavior data into training data and validation data;
[0042] Input the training data into the initial prediction model to obtain the result data of the training data;
[0043] Calculate the difference between the result data and the validation data to get the loss value;
[0044] The model parameters of the initial prediction model are adjusted according to the loss value, and the loss value is recalculated until the recalculated loss value is less than or equal to the fourth threshold, thereby obtaining the target prediction model.
[0045] Optionally, in this embodiment, after confirming that the amount of data of the click-to-play behavior exceeds the third threshold, the collected user click-to-play behavior data is used as the input of the prediction model. These data contain information such as the specific video clicked by the user, the viewing time, and the click time, which is the basis for training the prediction model. The acquired click-to-play behavior data is divided into two parts: training data: used to train the prediction model to help the prediction model learn the user's behavior pattern. Verification data: used to verify the performance of the prediction model, check the prediction ability of the prediction model for new data, and ensure the generalization of the prediction model. The training data is input into the prediction model for training. At this time, the prediction model will generate corresponding result data by learning the features and patterns in the training data. By comparing the result data generated by the prediction model with the verification data, the difference between the two is calculated. This difference is usually represented by a loss function. Common loss functions include mean square error, cross entropy, etc. The smaller the loss value, the more accurate the prediction of the prediction model. According to the calculated loss value, the parameters of the initial prediction model are adjusted using an optimization algorithm to reduce the loss value. This process requires multiple iterations until the loss value is reduced to an acceptable range. After adjusting the parameters, the new loss value is calculated again to check whether it is less than or equal to the fourth threshold, which is used as the stopping criterion for the prediction model training to ensure that the prediction model reaches a certain accuracy. When the recalculated loss value meets the condition, the training will be stopped and the final target prediction model will be obtained, which can better predict the user's click-to-play behavior.
[0046] As an optional example, after the initial prediction model is trained according to the click-to-play behavior data to obtain the target prediction model, the method further includes:
[0047] The click-to-play behavior data is obtained once at each target duration, and the target prediction model is trained according to the latest obtained click-to-play behavior data to obtain a trained target prediction model.
[0048] Optionally, in this embodiment, the target duration can be several minutes or several hours, depending on the needs of user behavior analysis. The target duration is a key parameter that determines the frequency of data acquisition. Every set target duration, the target prediction model will be automatically retrained based on the latest click-to-play behavior data to generate a new, updated target prediction model. This new model will better reflect the latest user behavior data and can more accurately predict the user's click-to-play behavior.
[0049] As an optional example, preloading each video for which the behavior prediction result is predicted that the user will click to play includes:
[0050] Take each video that is predicted to be clicked by the user as the current video and perform the following operations on the current video:
[0051] Get the current video from the server cache;
[0052] Save part or all of the current video to the local cache.
[0053] Optionally, in this embodiment, each video whose behavior prediction result is "predicted that the user will click to play" is preloaded. Taking a certain video as an example, the server is accessed through a network request to obtain the video from the server's cache. The cache usually stores content that users access frequently to increase loading speed and reduce server burden. Once the video is successfully obtained from the server cache, part or all of the content of the video will be saved to the local cache of the user's device. By pre-downloading the video content to the local cache, the user can load the video more quickly when clicking to play, reducing waiting time, thereby improving the user experience.
[0054] As an optional example, saving part or all of the current video content to the local cache includes:
[0055] Get the playback probability of the current video in the behavior prediction result;
[0056] When the playback probability is greater than a fifth threshold, saving all contents of the current video to a local cache;
[0057] When the playback probability is less than or equal to the fifth threshold, part of the content of the current video is saved to the local cache.
[0058] Optionally, in this embodiment, the playback probability of the current video is extracted from the behavior prediction result. This probability is generated based on the user's historical behavior and the prediction of the model, and represents the possibility of the user clicking and watching the current video. If the playback probability is greater than the fifth threshold, it means that the user is predicted to be likely to watch the video. In this case, the system saves the entire content of the current video to the local cache, which can ensure that the user has a smooth experience when watching, because all the content has been pre-downloaded. If the playback probability is less than or equal to the fifth threshold, it indicates that the user is less likely to watch the video. In this case, part of the content of the current video is saved to the local cache, and the first few minutes or some key clips of the video can be saved to reduce storage usage, while providing a certain degree of smoothness when the user clicks to play. At the same time, through an intelligent cache management mechanism, outdated cache content is regularly cleaned up to ensure the effective use of local storage and avoid unnecessary storage usage.
[0059] In conjunction with an example, the present application relates to a video preloading method, which uses a behavior prediction model to analyze videos that users may click on in a video list, and preloads these videos so that users can directly play cached videos after clicking them, thereby reducing the waste of bandwidth and traffic, optimizing resource utilization, improving user experience and system efficiency, and reducing cache occupancy and server pressure, thereby solving the technical problem that traditional preloading strategies are relatively simple and waste resources. The specific implementation process is as follows: Figure 2 As shown:
[0060] Step 1: Collect user click-to-play behavior data: Monitor user operations in real time. Once a user clicks on a video, check whether the video clicked by the user starts playing successfully. If the video corresponding to the video click behavior is confirmed to be successfully played, record the video click behavior and the corresponding video information, and store them in the "click-to-play behavior data";
[0061] Step 2: Training the prediction model: monitor the battery power and processor usage of the user's device in real time. When the battery power and processor usage conditions are met, check the amount of click-to-play behavior data collected to ensure that it is greater than a third threshold. Only when the amount of data is large enough, train the initial prediction model based on the click-to-play behavior data to obtain the target prediction model.
[0062] Step 3: Get the target video list: Get the video list to be analyzed;
[0063] Step 4: Behavior prediction: Input each video into the target prediction model to perform behavior prediction and obtain the behavior prediction results for each video;
[0064] Step 5: Video preloading: Preload each video that is predicted to be clicked by the user for playback by the behavior prediction result, and obtain these videos from the server cache. If the playback probability of the video is greater than the fifth threshold, save the entire content of these videos to the local cache. If the playback probability of the video is less than or equal to the fifth threshold, save part of the content of these videos to the local cache.
[0065] Step 6: Update the prediction model: Get the latest data from the user's click-to-play behavior at set target durations to update the prediction model.
[0066] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0067] According to another aspect of the embodiment of the present application, a video preloading device is also provided. Figure 3 As shown, including:
[0068] A first acquisition module 302 is used to acquire each video in the video list;
[0069] The prediction module 304 is used to input each video into the target prediction model, perform behavior prediction on each video, and obtain a behavior prediction result for each video, wherein the behavior prediction result includes a prediction that the user will click to play and a prediction that the user will not click to play;
[0070] The preloading module 306 is used to preload each video that is predicted to be clicked by the user for playing by the behavior prediction result, so that when the user clicks to play the target video, the target video is played directly, wherein the target video is any one of all the preloaded videos.
[0071] Optionally, in this embodiment, first, a list of all videos currently visible to the user is obtained from the homepage or recommendation page of the video application. These videos can be based on the user's interests, historical behaviors, or real-time popular content. Each video will be input into a behavior prediction model. The model is analyzed based on multiple features, such as the user's historical viewing behavior and other user-related data, with the goal of predicting the click probability of each video, that is, judging whether the user will click to play the video. The output result of the behavior prediction model will generate a behavior prediction label for each video, which is usually divided into two categories: Prediction of user click to play: The video is considered to have a high probability of being clicked by the user. Prediction of user will not click to play: The video is considered to be of no interest to the user and has a low probability of being clicked. For videos that the prediction model determines that the user may click, these videos will be preloaded. Preloading means obtaining part or all of the video data from the server or CDN (Content Delivery Network) in the background in advance and caching it in the local storage or memory of the user's device. In this way, when the user actually clicks on these videos, the playback process will proceed seamlessly, reducing loading time and improving response speed. When a user clicks on any preloaded video, the player does not need to request data from the server again. It can directly use the locally cached video clip and play it immediately, which greatly shortens the video startup time and makes the user hardly feel any delay.
[0072] Optionally, in this embodiment, through intelligent preloading, the video can be played immediately after the user clicks the play button, avoiding the waiting time caused by network delays or long server response times, thereby significantly improving the user's viewing experience. Traditional preloading may load videos that the user is not interested in, wasting server bandwidth and user traffic. By introducing a behavior prediction model, preloading is limited to the videos that the user is most likely to click, reducing unnecessary data transmission and saving valuable network resources.
[0073] As an optional example, the above device further includes:
[0074] A second acquisition module is used to obtain the power and processor usage of the target terminal before inputting each video into the target prediction model;
[0075] A third acquisition module is used to acquire the user's click-to-play behavior data when the power level is greater than the first threshold and the processor usage rate is less than or equal to the second threshold;
[0076] The first training module is used to train the initial prediction model according to the click-to-play behavior data to obtain a target prediction model when it is determined that the data volume of the click-to-play behavior data is greater than a third threshold.
[0077] Optionally, in this embodiment, the battery power and processor usage of the user device are monitored in real time to ensure that the performance and power of the device are sufficient when any data processing and model training are performed to avoid affecting the user experience and device performance. Only when the power of the device is higher than the preset first threshold value, the next step will be performed to ensure that the device will not be interrupted due to insufficient power when performing subsequent operations. When the processor usage rate is lower than or equal to the second threshold value, it indicates that the device has sufficient computing resources for data processing and model training. If the processor is busy, it may cause slow response or system instability. When the power and processor usage conditions are met, the user's click-to-play behavior data is obtained, which includes information such as which videos the user clicked, the click frequency, and the viewing time. Check the amount of click-to-play behavior data collected to ensure that it is greater than the third threshold value. Only when the amount of data is large enough can effective model training be performed to ensure the accuracy and generalization ability of the model. Once it is confirmed that the amount of click-to-play behavior data is sufficient, the initial prediction model is trained using these data to generate a target prediction model. By monitoring the power and processor usage rate, the system ensures that data processing is performed when the device has good performance and sufficient power, reducing the risk of operation failure due to insufficient device performance. When collecting user click-to-play behavior data, ensuring that the data volume is greater than the third threshold can improve the representativeness and reliability of the data, reduce model training errors caused by insufficient data, and thus improve the prediction effect of the final prediction model. By performing data processing and model training under appropriate device conditions, device resources can be effectively utilized, avoiding unnecessary operations when the battery is low or the processor is busy, and reducing the impact on user devices.
[0078] As an optional example, the above device further includes:
[0079] A determination module, used for determining whether the video corresponding to the video click behavior is played when detecting that the user has clicked on the video before obtaining the user's click-to-play behavior data;
[0080] The saving module is used to save the video click behavior and the corresponding video to the click-to-play behavior data when it is determined that the video is being played corresponding to the video click behavior.
[0081] Optionally, in this embodiment, when obtaining the user's click-to-play behavior data. Monitor the user's operation in real time. Once it is detected that the user clicks on a video (for example, the user clicks the play button in the video list), check whether the video clicked by the user starts playing successfully. If it is confirmed that the video corresponding to the video click behavior is successfully played, the following information will be recorded: video click behavior, record the specific time, location, click method (for example, direct click or long press, etc.) when the user clicks to play, corresponding video information, record relevant information of the video, such as video tags, titles, duration, play time, etc. These data will be stored in the "click-to-play behavior data" for subsequent analysis and model training. By confirming whether the video is played, it can be ensured that the recorded click behavior data is true and valid, and avoid recording click behaviors caused by network problems or player failures. Recording the user's click-to-play behavior and corresponding video information can provide a rich data basis for subsequent analysis, thereby optimizing content recommendations and playback strategies.
[0082] As an optional example, the first training module includes:
[0083] An acquisition unit, used to acquire the user's click-to-play behavior data;
[0084] A division unit, used for dividing the click-to-play behavior data into training data and verification data;
[0085] A training unit, used for inputting training data into an initial prediction model to obtain result data of the training data;
[0086] A calculation unit is used to calculate the difference between the result data and the verification data to obtain the loss value;
[0087] An adjustment unit is used to adjust the model parameters of the initial prediction model according to the loss value, and recalculate the loss value until the recalculated loss value is less than or equal to a fourth threshold, so as to obtain a target prediction model.
[0088] Optionally, in this embodiment, after confirming that the amount of data of the click-to-play behavior exceeds the third threshold, the collected user click-to-play behavior data is used as the input of the prediction model. These data contain information such as the specific video clicked by the user, the viewing time, and the click time, which is the basis for training the prediction model. The acquired click-to-play behavior data is divided into two parts: training data: used to train the prediction model to help the prediction model learn the user's behavior pattern. Verification data: used to verify the performance of the prediction model, check the prediction ability of the prediction model for new data, and ensure the generalization of the prediction model. The training data is input into the prediction model for training. At this time, the prediction model will generate corresponding result data by learning the features and patterns in the training data. By comparing the result data generated by the prediction model with the verification data, the difference between the two is calculated. This difference is usually represented by a loss function. Common loss functions include mean square error, cross entropy, etc. The smaller the loss value, the more accurate the prediction of the prediction model. According to the calculated loss value, the parameters of the initial prediction model are adjusted using an optimization algorithm to reduce the loss value. This process requires multiple iterations until the loss value is reduced to an acceptable range. After adjusting the parameters, the new loss value is calculated again to check whether it is less than or equal to the fourth threshold, which is used as the stopping criterion for the prediction model training to ensure that the prediction model reaches a certain accuracy. When the recalculated loss value meets the condition, the training will be stopped and the final target prediction model will be obtained, which can better predict the user's click-to-play behavior.
[0089] As an optional example, the above device further includes:
[0090] The second training module is used to train the initial prediction model according to the click-to-play behavior data to obtain the target prediction model, obtain the click-to-play behavior data once every target duration, and train the target prediction model according to the latest click-to-play behavior data to obtain the trained target prediction model.
[0091] Optionally, in this embodiment, the target duration can be several minutes or several hours, depending on the needs of user behavior analysis. The target duration is a key parameter that determines the frequency of data acquisition. Every set target duration, the target prediction model will be automatically retrained based on the latest click-to-play behavior data to generate a new, updated target prediction model. This new model will better reflect the latest user behavior data and can more accurately predict the user's click-to-play behavior.
[0092] As an optional example, the preloaded module includes:
[0093] The processing unit is used to take each video predicted by the behavior prediction result that the user will click to play as the current video, and perform the following operations on the current video:
[0094] Get the current video from the server cache; save part or all of the current video content to the local cache.
[0095] Optionally, in this embodiment, each video whose behavior prediction result is "predicted that the user will click to play" is preloaded. Taking a certain video as an example, the server is accessed through a network request to obtain the video from the server's cache. The cache usually stores content that users access frequently to increase loading speed and reduce server burden. Once the video is successfully obtained from the server cache, part or all of the content of the video will be saved to the local cache of the user's device. By pre-downloading the video content to the local cache, the user can load the video more quickly when clicking to play, reducing waiting time, thereby improving the user experience.
[0096] As an optional example, the processing unit is used to obtain the playback probability of the current video in the behavior prediction result;
[0097] When the playback probability is greater than a fifth threshold, saving all contents of the current video to a local cache;
[0098] When the playback probability is less than or equal to the fifth threshold, part of the content of the current video is saved to the local cache.
[0099] Optionally, in this embodiment, the playback probability of the current video is extracted from the behavior prediction result. This probability is generated based on the user's historical behavior and the prediction of the model, and represents the possibility of the user clicking and watching the current video. If the playback probability is greater than the fifth threshold, it means that the user is predicted to be likely to watch the video. In this case, the system saves the entire content of the current video to the local cache, which can ensure that the user has a smooth experience when watching, because all the content has been pre-downloaded. If the playback probability is less than or equal to the fifth threshold, it indicates that the user is less likely to watch the video. In this case, part of the content of the current video is saved to the local cache, and the first few minutes or some key clips of the video can be saved to reduce storage usage, while providing a certain degree of smoothness when the user clicks to play. At the same time, through an intelligent cache management mechanism, outdated cache content is regularly cleaned up to ensure the effective use of local storage and avoid unnecessary storage usage.
[0100] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 4 As shown, it includes a processor 402, a communication interface 404, a memory 406 and a communication bus 408, wherein the processor 402, the communication interface 404 and the memory 406 communicate with each other through the communication bus 408, wherein,
[0101] Memory 406, used to store computer programs;
[0102] The processor 402 is used to implement the following steps when executing the computer program stored in the memory 406:
[0103] Get each video in the video list;
[0104] Input each video into the target prediction model, perform behavior prediction on each video, and obtain the behavior prediction result of each video, wherein the behavior prediction result includes the prediction that the user will click to play and the prediction that the user will not click to play;
[0105] Preload each video that is predicted to be clicked by the user for playback as a result of the behavior prediction, so that when the user clicks to play the target video, the target video is played directly, wherein the target video is any one of all the preloaded videos.
[0106] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The communication interface is used for communication between the above electronic device and other devices.
[0107] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0108] As an example, the memory 406 may include but is not limited to the first acquisition module 302, prediction module 304 and preloading module 306 in the video preloading device. In addition, it may also include but is not limited to other module units in the video preloading device, which will not be repeated in this example.
[0109] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0110] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0111] It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only. The device for implementing the above-mentioned video preloading method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 4 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 4 Different configurations shown.
[0112] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.
[0113] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned video preloading method when executed by a processor.
[0114] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0115] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0116] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0117] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0118] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0120] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0121] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A video preloading method, characterized in that: include: Get each video in the video list; Input each of the videos into the target prediction model, perform behavior prediction on each of the videos, and obtain a behavior prediction result for each of the videos, wherein the behavior prediction result includes a prediction that the user will click to play and a prediction that the user will not click to play; Preload each video that is predicted to be clicked by the user for playback as a result of the behavior prediction, so that when the user clicks to play the target video, the target video is played directly, wherein the target video is any one of all the preloaded videos.
2. The method according to claim 1, characterized in that Before inputting each of the videos into the target prediction model, the method further comprises: Get the power and processor usage of the target terminal; When the power level is greater than a first threshold and the processor usage rate is less than or equal to a second threshold, acquiring click-to-play behavior data of the user; When it is determined that the data volume of the click-to-play behavior data is greater than a third threshold, the initial prediction model is trained according to the click-to-play behavior data to obtain the target prediction model.
3. The method according to claim 2, characterized in that Before obtaining the click-to-play behavior data of the user, the method further includes: In the case of detecting that the user has clicked on a video, determining whether a video corresponding to the video clicked on behavior is played; When it is determined that the video click behavior corresponds to the video playback, the video click behavior and the corresponding video are saved in the click-to-play behavior data.
4. The method according to claim 2, characterized in that: When it is determined that the amount of the click-to-play behavior data is greater than a third threshold, training the initial prediction model according to the click-to-play behavior data to obtain the target prediction model includes: Obtaining click-to-play behavior data of the user; Dividing the click-to-play behavior data into training data and verification data; Inputting the training data into the initial prediction model to obtain result data of the training data; Calculate the difference between the result data and the verification data to obtain a loss value; The model parameters of the initial prediction model are adjusted according to the loss value, and the loss value is recalculated until the recalculated loss value is less than or equal to a fourth threshold, so as to obtain the target prediction model.
5. The method according to claim 2, characterized in that: After the initial prediction model is trained according to the click-to-play behavior data to obtain the target prediction model, the method further includes: The click-to-play behavior data is acquired once at each target duration, and the target prediction model is trained according to the latest acquired click-to-play behavior data to obtain a trained target prediction model.
6. The method according to claim 1, characterized in that The preloading of each video predicted to be clicked by the user for playback by the behavior prediction result comprises: Each video predicted by the behavior prediction result to be clicked by the user for playback is taken as the current video, and the following operations are performed on the current video: Obtain the current video from the server cache; Save part or all of the content of the current video to the local cache.
7. The method according to claim 6, characterized in that Saving part or all of the content of the current video to the local cache includes: Obtaining a playback probability in the behavior prediction result of the current video; When the playback probability is greater than a fifth threshold, saving all contents of the current video to the local cache; When the playback probability is less than or equal to the fifth threshold, part of the content of the current video is saved to the local cache.
8. A video preloading device, characterized in that: include: A first acquisition module is used to acquire each video in the video list; A prediction module, used for inputting each of the videos into a target prediction model, performing behavior prediction on each of the videos, and obtaining a behavior prediction result for each of the videos, wherein the behavior prediction result includes a prediction that the user will click to play and a prediction that the user will not click to play; The preloading module is used to preload each video that is predicted to be clicked by the user for playing by the behavior prediction result, so that when the user clicks to play the target video, the target video is played directly, wherein the target video is any one of all the preloaded videos.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.