Video processing method, device, electronic device and storage medium
By obtaining the target video feature values in a unit time period before the estimated time period and using the XGBoost model to predict the playback volume, the problem of large video playback volume prediction errors in the existing technology is solved, and more accurate playback volume prediction and bandwidth optimization are achieved.
Patent Information
- Application Number
- CN202010636969.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-03
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2040-07-27
AI Technical Summary
The existing technology only uses the video playback volume as the only feature to predict the video playback volume, resulting in a large error between the predicted result and the actual playback volume, and is unable to accurately predict the video playback volume during peak periods.
By determining multiple unit time periods before the estimated time period, the feature values of the target video are obtained and input into the playback prediction model, and the XGBoost model is used to predict the video playback volume within the estimated time period, and the bit rate of the video to be processed is reduced according to the estimated playback volume.
It improves the accuracy of video playback volume prediction, reduces the deviation between prediction and actual playback volume, reduces the peak bandwidth during peak playback period, and improves video coverage.
Smart Images

Figure CN113962417B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a video processing method, device, electronic device, and storage medium. Background Art
[0002] With the widespread adoption of smartphones and mobile 4G, and the impending arrival of 5G, the craze for mobile live streaming has not yet subsided, and the short video industry has rapidly emerged. By embedding short videos into social network feeds, leveraging their convenience and powerful sharing capabilities, the short video craze has surged. Typically, before launching a video, it's desirable to obtain relevant data on existing videos, such as their play count. This allows users to predict future play counts based on known play counts and determine the type and number of videos to be launched based on the predicted play counts.
[0003] Typically, video playback peaks between 8:00 PM and 10:00 PM daily. To ensure video playback, videos with high predicted play counts are transcoded. Specifically, from 10:00 PM the previous day to 8:00 PM the current day, video play counts are collected every 10 minutes. The n videos with the highest play counts are then transcoded into videos with a lower bitrate. Existing methods use only play count as a single feature, resulting in significant discrepancies between predicted and actual play counts. Summary of the Invention
[0004] The embodiments of the present application provide a video processing method, device, electronic device and storage medium for reducing the deviation between the predicted video playback volume and the actual video playback volume, thereby improving the accuracy of video playback volume prediction.
[0005] In one aspect, an embodiment of the present application provides a video processing method, comprising:
[0006] Determine at least two unit time periods prior to the estimated time period;
[0007] Determine the number of videos according to the time sequence of the at least two unit time periods, and obtain target videos corresponding to the number of videos from the candidate videos played in each unit time period;
[0008] For each target video, input the feature value of the target video into the playback prediction model to obtain the estimated playback volume of the target video within the estimated time period; the playback prediction model is trained using the feature value of the training video and the actual playback volume of the training video to obtain corresponding model parameters;
[0009] According to the estimated playback volume, target videos that meet the set rules are used as videos to be processed, and the bit rate of the videos to be processed is reduced.
[0010] In another aspect, an embodiment of the present application provides a video processing device, comprising:
[0011] a determining unit, configured to determine at least two unit time periods before the estimated time period;
[0012] An acquisition unit, configured to determine the number of videos according to the time sequence of the at least two unit time periods, and acquire target videos corresponding to the number of videos from the candidate videos played in each unit time period;
[0013] An estimation unit is configured to input the characteristic value of each target video into a playback prediction model to obtain an estimated playback volume of the target video within the estimated time period; the playback prediction model is trained using the characteristic value of the training video and the actual playback volume of the training video to obtain corresponding model parameters;
[0014] The reducing unit is used to select a target video that meets the set rules as a to-be-processed video according to the estimated playback volume, and reduce the bit rate of the to-be-processed video.
[0015] In an optional embodiment, the number of target videos corresponding to the at least two unit time periods increases in chronological order;
[0016] Acquisition unit, specifically used for:
[0017] For each unit time period, determining a video to be played within the unit time period;
[0018] Sort the videos to be selected according to the amount of playback in the unit time period;
[0019] According to the sorting result, target videos corresponding to the number of videos are determined from the candidate videos.
[0020] In an optional embodiment, the acquiring unit is specifically configured to determine, from the videos to be selected, a first target video corresponding to a number of videos according to the sorting result; and use the first target video as the video to be processed;
[0021] a determining unit, specifically configured to determine a historical time period before the estimated time period; and use all videos played within the historical time period as second target videos;
[0022] an estimating unit, specifically configured to input, for each second target video, a feature value of the second target video into the playback prediction model to obtain an estimated playback volume of the second target video;
[0023] The reducing unit is specifically configured to use the second target video that meets the set rules as a video to be processed based on the estimated playback volume of the second target video.
[0024] In an optional embodiment, the historical time period is after the at least two unit time periods.
[0025] In an optional embodiment, the estimation unit is further configured to train the playback prediction model according to the following method:
[0026] Obtaining a training sample, wherein the training sample includes a feature value of a training video and an actual playback volume of the training video within a training time period;
[0027] Inputting the feature value of the training video into the playback prediction model to obtain the estimated playback volume of the training video within the training time period;
[0028] Calculating a loss function based on the actual playback volume and the estimated playback volume;
[0029] When the loss function is less than a preset threshold, parameters corresponding to the playback prediction model are determined.
[0030] In an optional embodiment, the at least two unit time periods and the estimated time period are located in different time periods, and the position of each unit time period in the corresponding time period is the same as the position of the estimated time period in the time period corresponding to the estimated time period.
[0031] In an optional embodiment, the acquiring unit is further configured to:
[0032] Delete the target video whose bit rate is lower than the set threshold;
[0033] Acquire feature values of a target video, wherein the feature values include numerical feature values and category feature values;
[0034] The categorical feature values are converted into numbers using one-hot encoding.
[0035] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the video processing method of the first aspect is implemented.
[0036] On the other hand, an embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the computer program is executed by the processor, the processor implements the video processing method of the first aspect.
[0037] The embodiment of the present application determines at least two unit time periods before the estimated time period, determines the number of videos according to the time sequence of at least two unit time periods, and obtains target videos of the corresponding number of videos from the selected videos played in each unit time period. For each target video, the characteristic value of the target video is input into the playback prediction model to obtain the estimated playback volume of the target video in the estimated time period. Here, the playback prediction model is trained using the characteristic values of the training video and the actual playback volume of the training video to obtain the corresponding model parameters. According to the estimated playback volume, the target video that meets the set rules is used as the video to be processed, and the bit rate of the video to be processed is reduced. The embodiment of the present application takes into account the relationship between time and video playback volume, and obtains the characteristic value of the video, and uses the network model to estimate the playback volume of the target video, thereby increasing the accuracy of the estimated target video playback volume, reducing the deviation between the predicted video playback volume and the actual video playback volume, and improving the coverage rate of the target video for high-play videos, thereby further reducing the peak bandwidth during the peak playback period. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 A schematic diagram of the system architecture of a video processing method provided in an embodiment of the present application;
[0040] Figure 2 A flowchart of a video processing method provided in an embodiment of the present application;
[0041] Figure 3 A flowchart of a video processing method provided in a specific embodiment of the present application;
[0042] Figure 4 A schematic diagram of the structure of a video processing device provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] To make the objectives, technical solutions, and advantages of this application more clear, this application will be further described in detail below with reference to the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0045] The word “exemplary” is used hereinafter to mean “serving as an example, example, or illustration.” Any embodiment described as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0046] The terms "first" and "second" in the text are used for descriptive purposes only and are not to be understood as expressing or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more. In addition, the term "including" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0047] The following explains some of the terms used in the embodiments of the present application to facilitate understanding by those skilled in the art.
[0048] 1. Artificial Intelligence
[0049] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive field of computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making. AI technologies primarily encompass computer vision, speech processing, and machine learning / deep learning.
[0050] 2. Machine Learning
[0051] Machine learning is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of artificial intelligence. Machine learning typically includes techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, and inductive learning.
[0052] 3. Supervised Machine Learning Models
[0053] Supervised learning is a machine learning task that infers functions from labeled training datasets. Specifically, existing training samples are used to train an optimal model. This model then maps all inputs to corresponding outputs. Simple judgments are then made on the outputs to achieve prediction and classification, thus enabling the ability to predict and classify unknown data. The data used in supervised learning is pre-classified. The training samples contain both features and labels, so the corresponding outputs are derived based on these features.
[0054] Supervised learning generally includes two types: classification and regression. In classification problems, the target variable takes values only from a finite set of values (nominal). For example, in handwritten digit recognition, the target result is in the set {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. In regression problems, the target variable is numeric, meaning it can take values from an infinite set of values. For example, in predicting product prices, the predicted result can be any number.
[0055] 4. Cloud technology
[0056] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0057] Cloud technology is a general term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies based on the cloud computing business model. It can form a resource pool that can be used flexibly and conveniently on demand. Cloud computing technology will become a crucial support. Backend services for technical network systems, such as video websites, image websites, and more portals, require extensive computing and storage resources. With the rapid development and application of the internet industry, every item will likely have its own unique identifier, requiring transmission to backend systems for logical processing. Different levels of data will be processed separately, and data from various industries will require a strong system backend, which can only be achieved through cloud computing.
[0058] 5. Video bitrate
[0059] Video bitrate refers to the number of bits transmitted per unit time during data transmission, typically measured in kbps (kilobits per second). More generally, it's the sampling rate: the higher the sampling rate per unit time, the higher the accuracy, and the closer the processed file is to the original. However, file size is directly proportional to the sampling rate, so almost all encoding formats prioritize using the lowest bitrate to minimize distortion. For example, for audio, the higher the bitrate, the less compression is applied, the less sound quality is lost, and the closer the sound quality is to the original.
[0060] 6. XGBoost Model
[0061] Extreme Gradient Boosting (EGBT) is a type of gradient boosting model. Boosting is a machine learning technique that can be used for both regression and classification problems. It generates a weak prediction model at each step and adds it to the overall model with weighted summation. If the generation of each weak prediction model is based on the gradient of the loss function, it is called gradient boosting. The gradient boosting algorithm first takes a target loss function, whose domain is the set of all feasible weak functions (basis functions). The boosting algorithm then iteratively selects basis functions with negative gradients to gradually find the local minimum. This approach to gradient boosting in the domain of functions has had a significant impact in many areas of machine learning. A typical model in gradient boosting is the Gradient Boosted Decision Tree (GBDT). The XGBoost model falls into this category. The basic idea of GBDT is to let a new base model (GBDT uses a CART classification and regression tree as its base model) fit the bias of the previous model, thereby continuously reducing the bias of the additive model. Compared to GDBT, XGBoost uses second-order gradient information, which allows for faster convergence on the training set.
[0062] The present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0063] To address technical issues in related technologies, embodiments of the present application provide a video processing method, apparatus, electronic device, and storage medium. Embodiments of the present application involve artificial intelligence (AI) and machine learning (ML) technologies, and are designed based on computer vision (CV) technology and machine learning in AI.
[0064] Artificial intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive field of computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making. AI technologies primarily encompass computer vision, speech processing, and machine learning / deep learning.
[0065] With the research and advancement of artificial intelligence technology, artificial intelligence has been studied and applied in many fields, such as common smart homes, image retrieval, video surveillance, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, etc. It is believed that with the development of technology, artificial intelligence will be applied in more fields and play an increasingly important role.
[0066] Computer vision (CV) is the science of making machines "see." Specifically, it refers to using cameras and computers to replace the human eye in identifying, tracking, and measuring objects. It also performs further image processing, transforming the computer's image into an image more suitable for human observation or transmission to instrumentation. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, and common biometric recognition technologies such as facial recognition and fingerprint recognition.
[0067] Machine learning is a multi-disciplinary interdisciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithmic complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning generally include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning and other technologies. The embodiment of the present application uses a feature extraction model based on deep reinforcement learning to extract features from the key frames of the target video and generate a target video fingerprint.
[0068] The video processing method provided in the embodiment of the present application can be applied to the determination and transcoding of videos with high playback probability during peak video playback periods. The current video playback platform obtains all video playback streams every 10 minutes, determines the video with the most playbacks based on the video playback streams, and deems it to have the highest probability of being played in the evening of the same day. Therefore, the video playback platform transcodes the n videos with the most playbacks every 10 minutes, which will reduce the bit rate and thereby reduce the peak bandwidth of the video playback platform during the peak playback period of 20:00 to 22:00 every day.
[0069] The above method only uses the playback volume as the only feature to predict the video, ignoring a large amount of data information, resulting in a large difference between the predicted playback video and the actual playback video.
[0070] In order to solve the above problems, the embodiment of the present application uses a machine learning model to predict the probability of video playback. For example, the video playback flow data of all videos played before the peak period is obtained, and after processing, it is input into the XGBoost model to predict the probability of each played video being played during the peak period of the day, determine the n videos with the highest playback probability, and transcode the n videos with the highest playback probability into low-bitrate videos.
[0071] On the other hand, this application considers the business and display scenarios and believes that the probability of video playback has historical continuity. For example, some videos that were played during the peak period yesterday are more likely to continue to be played on the same day, and the longer the time distance, the smaller the playback correlation. Therefore, for the peak period of the day from 20:00 to 22:00, determine the n1*0.3 videos that were played from 20:00 to 22:00 yesterday and played the most times, where n1 is the total number of plays of all videos during this period; extract the n2*0.2 videos that were played from 20:00 to 22:00 the day before yesterday and played the most times, where n2 is the total number of plays of all videos during this period; extract the n3*0.1 videos that were played from 20:00 to 22:00 the day before yesterday and played the most times, where n3 is the total number of plays of all videos during this period. Transcode the above n1*0.3+n2*0.2+n3*0.1 videos into low-bitrate videos.
[0072] Compared with only considering the number of views on that day, the embodiment of the present application considers the relationship between time and video views, obtains the characteristic value of the video, and uses the network model to estimate the view volume of the target video, thereby improving the coverage of the target video for high-view videos, thereby further reducing the peak bandwidth during the peak viewing period and improving the accuracy and effect of the prediction.
[0073] An application scenario of the video processing method provided in the embodiment of the present application can be found in Figure 1As shown, the application scenario includes a terminal device 101 , a server 102 and a database 103 .
[0074] Among them, the terminal device 101 is an electronic device that can install various types of clients and can display the operating interface of the installed client. The electronic device can be mobile or fixed. For example, mobile phones, tablet computers, laptops, desktop computers, various types of wearable devices, smart TVs, car-mounted devices or other electronic devices that can realize the above functions. The client can be a video client or a browser client, etc. Each terminal device 101 is connected to the server 102 through a communication network, and the communication network can be a wired network or a wireless network. The server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. It is used in video products to meet the processing needs of large amounts of video data.
[0075] in, Figure 1 The description is given assuming that the database 103 exists independently of the server 102 . In other possible implementations, the database 103 may also be located in the server 102 .
[0076] Server 102 is connected to database 103, which stores videos and their playback flow data. Server 102 obtains the playback flow data of each video from database 103, determines the target video and its characteristic values based on the playback flow data, inputs the characteristic values of the target video into a playback prediction model, and obtains the estimated playback volume of the target video during the peak time period. The target video with the highest estimated playback volume is used as the video to be processed. On the other hand, the video to be processed is determined based on the playback time of the played video and the relationship between the time distance and the playback volume. The bit rate of all the videos to be processed is reduced to achieve the purpose of reducing the peak bandwidth during the peak playback period.
[0077] When implemented based on cloud technology, the server 202 can process the video data through cloud computing and cloud storage.
[0078] Cloud computing is a computing model that distributes computing tasks across a large resource pool, enabling various application systems to access computing power, storage space, and information services as needed. The network that provides these resources is called the "cloud." To users, these resources appear infinitely scalable and can be accessed at any time, used on demand, and expanded at any time, with a pay-per-use policy. The cloud computing resource pool primarily includes computing devices (virtualized machines, including operating systems), storage devices, and network equipment.
[0079] Cloud storage is a new concept that extends and develops from cloud computing. A distributed cloud storage system (hereafter referred to as a storage system) uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (also known as storage nodes) on a network through application software or application interfaces to work together and provide external data storage and service access. In one possible implementation, video-related data is stored through cloud storage.
[0080] It should be noted that the video processing method provided in the embodiments of the present application is generally applied to the server 102, and the server executes the video processing method provided in the embodiments of the present application. However, the video processing method provided in the embodiments of the present application can also be applied to the terminal device 101, and the terminal device can execute the video processing method provided in the present application, or the server 102 and the terminal device 101 can cooperate to complete the video processing method provided in the present application.
[0081] Figure 2 FIG. 1 is a flow chart of a video processing method provided by an embodiment of the present application. Figure 2 As shown, the method includes the following steps:
[0082] Step S201: determining at least two unit time periods before the estimated time period.
[0083] Among them, the estimated time period in the embodiment of the present application is the time period corresponding to the estimated target video playback volume. Generally speaking, the time period corresponding to the daily video playback peak is, for example, 20:00-22:00 every day. Therefore, 20:00-22:00 of the day can be used as the estimated time period. The at least two unit time periods before the estimated time period can be continuous time periods, for example, at least two unit time periods are the time periods of 8:00-8:30, 8:30-9:00, 9:00-9:30... on the day, or at least two unit time periods are discontinuous time periods, for example, at least two unit time periods are the time periods of 8:00-8:15, 9:00-9:15, 10:00-10:15... on the day, or at least two unit time periods can also be time periods of different lengths, for example, at least two unit time periods are 8:00-9:00, 9:00-9:30, 9:30-10:00. That is to say, in the embodiment of the present application, there are no restrictions on the duration of at least two unit time periods, whether they are continuous, whether the interval between two adjacent unit time periods is constant, etc.
[0084] Preferably, at least two unit time periods and the estimated time period are located in different time periods, and the position of each unit time period in the corresponding time period is the same as the position of the estimated time period in the time period corresponding to the estimated time period.
[0085] Here, the time period can be in units of days, weeks, or months. Preferably, the time period in the embodiment of the present application is in units of days. That is, different unit time periods, and the unit time period and the estimated time period are time periods in different days, and the position of each unit time period in the corresponding day is the same as the position of the estimated time period in the corresponding day. For example, if the estimated time period is 20:00-22:00 on April 30, 2020, then at least two unit time periods can be 20:00-22:00 on April 29, 2020, 20:00-22:00 on April 28, 2020, and 20:00-22:00 on April 27, 2020... In the embodiment of the present application, it is believed that the playback of the video has continuity. Therefore, the probability of continuing to play the video that has been played in the corresponding time period in the past on the same day is also relatively large. Therefore, by setting the unit time period to be at the same position as the estimated time period in different time periods, the continuity of the playback can be included in the factors affecting the playback volume, thereby making the prediction of the video playback volume more accurate and comprehensive.
[0086] Those skilled in the art should understand that the above-mentioned settings of the scenarios and unit time periods are merely examples, and appropriate changes based on these examples may also be applicable to the present application. The embodiments of the present application do not limit the settings of the scenarios and unit time periods.
[0087] Step S202: Determine the number of videos according to the time sequence of at least two unit time periods, and obtain target videos corresponding to the number of videos from the candidate videos played in each unit time period.
[0088] During specific implementations, the number of videos is determined based on the chronological order of at least two unit time periods. The number of videos can be the same or different. For example, the number of videos in different unit time periods is the same, meaning the same number of target videos are obtained from the candidate videos played in each unit time period. Alternatively, the number of videos may vary depending on the unit time period. For example, the number of videos in a weekday unit time period may be smaller, while the number of videos in a weekend unit time period may be larger.
[0089] Video playback has a certain degree of continuity, but the longer the time interval between the unit time period and the estimated time period, the less impact the selected videos played during the unit time period have on the video playback during the estimated time period. For example, a video played at 8:30 PM yesterday is more likely to be played again during today's estimated time period; while a video played at 8:30 PM a week ago is less likely to be played again during today's estimated time period. Therefore, in the embodiment of the present application, the number of videos is determined according to the chronological order of the unit time periods. The number of target videos corresponding to at least two unit time periods increases in chronological order.
[0090] For example, if the estimated time period is today's 20:00-22:00, the number of videos corresponding to yesterday's 20:00-22:00 is set to 20, the number of videos corresponding to 20:00-22:00 the day before yesterday is set to 15, the number of videos corresponding to 20:00-22:00 the day before yesterday is set to 10, and so on. That is, 20 videos are determined as target videos from the videos played between 20:00 and 22:00 yesterday, 15 videos are determined as target videos from the videos played between 20:00 and 22:00 the day before yesterday, and 10 videos are determined as target videos from the videos played between 20:00 and 22:00 the day before yesterday.
[0091] Furthermore, the above step 202, determining the number of videos according to the time sequence of at least two unit time periods, and obtaining target videos corresponding to the number of videos from each unit time period, includes:
[0092] For each unit time period, determining a video to be played within the unit time period;
[0093] Sort the videos to be selected according to the number of views in a unit time period;
[0094] According to the sorting results, target videos corresponding to the number of videos are determined from the candidate videos.
[0095] In a specific implementation, for each unit time period, candidate videos played within the unit time period are determined; the candidate videos played within the unit time period are sorted according to the number of views within the unit time period; and based on the sorting result, a target video is determined from all candidate videos corresponding to the unit time period. In this way, all target videos are the set of target videos selected in each unit time period.
[0096] In another specific embodiment, for each unit time period, the candidate videos played within the unit time period may be determined; all the candidate videos may be sorted according to the number of times they were played within the unit time period. Here, all the candidate videos played within the unit time period may be sorted, and a target video may be determined from all the candidate videos based on the overall sorting result. In this way, the target video determined based on the sorting result is all the target videos.
[0097] In an embodiment of the present application, the videos to be selected are sorted, and target videos corresponding to the number of videos are selected from the videos to be selected based on the sorting results, so that the videos to be selected with relatively large playback volumes are selected as target videos, and then the target videos are screened, which can make subsequent selection and calculation more targeted.
[0098] Furthermore, since the processing of the video to be processed in the embodiment of the present application is to reduce the bit rate of the video to be processed, and the bit rate is related to the playback quality of the video, if the bit rate is too low, it will affect the user's viewing experience. Therefore, after determining the number of videos according to the time sequence of at least two unit time periods and obtaining the target videos corresponding to the number of videos from the selected videos played in each unit time period, the embodiment of the present application also includes:
[0099] Delete the target video whose bit rate is lower than the set threshold;
[0100] Obtaining feature values of the target video, which include numerical feature values and category feature values;
[0101] Use one-hot encoding to convert categorical feature values into numbers.
[0102] That is, for a video whose bit rate is already lower than a set threshold, in order to ensure the user's viewing experience, the embodiment of the present application maintains its original bit rate and does not continue to reduce the bit rate.
[0103] In an embodiment of the present application, the playback flow data of the target video can be obtained from the server, and after processing the playback flow data, the characteristic value of the target video can be obtained. The specific characteristics of the target video may include: bit rate, playback time, video time, video first loading time, whether it is a paid user, whether to use the download component, whether to play online, whether to open p2p (peer-to-peer, person to person), whether to free flow, network type, number of video fragments, number of secondary buffers, secondary buffering time, number of drags, total drag buffering time, operator, etc. Here, the corresponding values of some features of the target video are category variables, for example, the above-mentioned bit rate, playback time, etc. are digital feature values, whether to play online, whether to free flow, etc. are category feature values. In order to facilitate the input of category feature values into the machine learning model for calculation, it is necessary to use unique hot encoding to convert such feature values into digital form.
[0104] Step S203: For each target video, input the feature value of the target video into the playback prediction model to obtain the estimated playback volume of the target video within the estimated time period.
[0105] The playback prediction model is trained using the feature values of the training video and the actual playback volume of the training video to obtain corresponding model parameters.
[0106] In the specific implementation process, the feature values of the target video are input into the playback prediction model to obtain the estimated playback volume of the target video. The playback prediction model is trained using the feature values of the training videos and the actual playback volume of the training videos to obtain the corresponding model parameters.
[0107] The playback prediction model includes a gradient boosting network model. In the embodiment of the present application, an XGBoost regression model can be specifically used as the gradient boosting network model.
[0108] Step 204: Based on the estimated playback volume, target videos that meet the set rules are used as videos to be processed, and the bit rate of the videos to be processed is reduced.
[0109] Among them, the setting rule can be to set the target video with an estimated playback volume greater than the playback threshold as the video to be processed; or it can be to sort all target videos according to the estimated playback volume and set the target videos in the top N order as the video to be processed.
[0110] The embodiment of the present application determines at least two unit time periods before the estimated time period, determines the number of videos according to the time sequence of at least two unit time periods, and obtains target videos of the corresponding number of videos from the selected videos played in each unit time period. For each target video, the characteristic value of the target video is input into the playback prediction model to obtain the estimated playback volume of the target video in the estimated time period. Here, the playback prediction model is trained using the characteristic values of the training video and the actual playback volume of the training video to obtain the corresponding model parameters. According to the estimated playback volume, the target video that meets the set rules is used as the video to be processed, and the bit rate of the video to be processed is reduced. The embodiment of the present application takes into account the relationship between time and video playback volume, and obtains the characteristic value of the video, and uses the network model to estimate the playback volume of the target video, thereby increasing the accuracy of the estimated target video playback volume, reducing the deviation between the predicted video playback volume and the actual video playback volume, and improving the coverage rate of the target video for high-play videos, thereby further reducing the peak bandwidth during the peak playback period.
[0111] In one possible embodiment of the present application, target videos can be identified from at least two unit time periods. For each target video, a feature value is determined, and the feature value is input into a playback prediction model to obtain an estimated playback volume for the target video within the estimated time period. Then, based on the estimated playback volume, a video to be processed is selected from all target videos, thereby reducing the bitrate of the video to be processed.
[0112] In a possible specific embodiment, on the one hand, the target video determined in at least two unit times can be used as the first target video. In this case, according to the sorting result, the target video corresponding to the number of videos is determined from the selected videos, including:
[0113] According to the sorting result, determining a first target video of a corresponding number of videos from the candidate videos;
[0114] The first target video is used as a video to be processed.
[0115] During the specific implementation process, a first target video can be selected from the videos to be selected based on the playback volume within a unit time, and the first target video can be used as the video to be processed.
[0116] On the other hand, a historical time period before the current time point is determined, and a second target video is determined based on the historical time period. Preferably, the historical time period is at least two unit time periods later and before the estimated time period. In this case, for each target video, the feature value of the target video is input into the playback prediction model to obtain the estimated playback volume of the target video, and the following is also included:
[0117] Determine the historical time period prior to the estimated time period;
[0118] All videos played within the historical time period are used as second target videos.
[0119] In the embodiment of the present application, the historical time period is the time period before the estimated time period. For example, if the estimated time period is 20:00-22:00 on the current day, the historical time period can be from 22:00 the previous day to 20:00 on the current day. All videos played during the historical time period can be used as the second target video. Of course, in another embodiment, all videos can also be sorted according to the number of videos played during the historical time period, and the second target video can be selected from them.
[0120] In the embodiment of the present application, the feature value of the second target video is input into the playback prediction model. At this time, for each target video, the feature value of the target video is input into the playback prediction model to obtain the estimated playback volume of the target video, including:
[0121] For each second target video, the feature value of the second target video is input into the playback prediction model to obtain the estimated playback volume of the second target video.
[0122] The playback prediction model can be a Gradient Boosting Decision Tree (GBDT) model. GBDT is an iterative decision tree algorithm consisting of several decision trees. Its core concept is that, in the process of constructing a series of decision trees, each subsequent decision tree learns the conclusions and residuals of all previous decision trees. When the residual of a subsequent decision tree falls below a set threshold or reaches the number of iterations, the model training terminates. By continuously fitting the residuals of the previous decision trees, several decision trees are ultimately obtained. For the test sample, the output of the gradient boosting tree model is the sum of the outputs of k decision trees. In this process, the sample selection and feature selection are random, which means that some samples in the total training set may appear multiple times in the training set of a tree or may never appear in the training set of any tree. The main steps are as follows: Using resampling techniques, n sample sets are randomly selected from the m model training samples, and n decision trees are constructed from them. During the growth of each decision tree, each node randomly selects F features from all features as the subset for the current node split. When constructing a decision tree, the minimum mean square error is usually used as the splitting criterion to select the best split method. The n decision trees are combined to form the final GBDT model.
[0123] Preferably, the playback prediction model of the embodiment of the present application is an XGBoost model. The XGBoost model belongs to the category of GBDT models. The basic idea of GBDT is to let the new base model (GBDT uses CART classification and regression tree as the base model) fit the deviation of the previous model, thereby continuously reducing the deviation of the additive model.
[0124] Compared to the classic GBDT, the XGBoost model incorporates several improvements, resulting in significant improvements in both performance and effectiveness. For example, while GBDT Taylor expands the objective function to first order, XGBoost Taylor expands it to second order, preserving more information about the objective function and contributing to improved performance. Furthermore, XGBoost adds strategies for automatically handling missing value features, supports candidate quantile cutting, and supports feature parallelism, resulting in improved performance compared to traditional GBDT.
[0125] The playback prediction model is trained to obtain model parameters using the following method:
[0126] The playback prediction model is trained in the following way:
[0127] Obtaining training samples, which include feature values of the training video and the actual number of times the training video was played during the training period;
[0128] Input the feature values of the training video into the playback prediction model to obtain the estimated playback volume of the training video during the training period;
[0129] Calculate the loss function based on the actual and estimated playback volume;
[0130] When the loss function is less than a preset threshold, the parameters corresponding to the playback prediction model are determined.
[0131] Specifically, XGBoost is an ensemble learning algorithm based on the CART tree, which aggregates the prediction results of T CART trees as the final prediction result.
[0132] XGBoost starts T rounds of iterative training after inputting the training data, and each iteration adds a CART tree f t (x i ), this tree fits the residual of the previous tree, that is, each new round of training is the predicted value of the previous Add the function f learned this time t (x i ):
[0133]
[0134]
[0135]
[0136] Objective function It is a loss function to evaluate the degree of model fitting, the smaller the better; It is a regular term that describes the complexity of the model. The smaller it is, the better. Therefore, the smaller the overall loss function obj is, the better:
[0137]
[0138] Calculate the first and second order derivatives of the loss function:
[0139]
[0140]
[0141] The objective function is transformed into:
[0142]
[0143]
[0144]
[0145] obj is the formula for calculating a tree. Continuously iterate the training to make this value smaller to optimize the tree structure. After training T trees, the values of these trees are holidayed to get the predicted value.
[0146] In the specific implementation process, the maximum tree depth of the XGBoost model can be 5, the number of iterations can be 3000 iterations, the learning rate is 0.005, the minimum leaf node sample weight is 1.789 (min_child_weight=1.789), the weight coefficient of the L1 regularization term is 0.4640 (reg_alpha=0.4640), the weight coefficient of the L2 regularization term is 0.8571 (reg_lambda=0.8571), and the random sampling ratio is 0.5213 (subsample=0.5213).
[0147] After calculating the estimated playback volume of each target video using the playback prediction model, target videos that meet the set rules are selected as videos to be processed based on the estimated playback volume, including:
[0148] According to the estimated playback volume of the second target video, the second target video that meets the set rules is used as a video to be processed.
[0149] In other words, in the above embodiment, there are two types of videos to be processed: one is the first target video, and the other is the second target video that meets the set rules. During the specific implementation, the first target video and the second target video that meets the set rules are used as the videos to be processed, and their bit rates are reduced. This balances estimation accuracy while expanding the range of videos for which the bit rate reduction is applied.
[0150] The following is an example of the implementation process of the video processing method provided in the embodiment of the present application. The hardware implementation environment of the specific embodiment of the present application is: tlinux release 2.2, windows10, spark2.3.3 and Python3.7. Among them, real-time video data is obtained from Kafka (an open source stream processing platform), processed by Spark (computing engine), and then saved to HDFS (distributed file system). Python (a computer programming language) trains the XGBoost model and saves the trained model parameters. During the video processing process, Spark reads the historical data in HDFS and uses the trained XGBoost model to determine the video that needs to be transcoded into a low bit rate. The process of the specific embodiment is as follows. Figure 3 shown.
[0151] Step 301: Determine the estimated time period as 20:00 to 22:00 on April 20, 2020, and determine three unit time periods, namely 20:00 to 22:00 on April 17, 20:00 to 22:00 on April 18, and 20:00 to 22:00 on April 19.
[0152] Step 302: For April 17th from 20:00 to 22:00, obtain the candidate videos played within the unit time period and sort them according to the number of plays. Based on the sorting results, determine N1*0.1 videos from all the candidate videos as the first target video, where n1 is the total number of video plays within the unit time period.
[0153] Step 303: For April 18th from 20:00 to 22:00, obtain the candidate videos played within the unit time period and sort them according to the number of plays. According to the sorting result, determine N2*0.2 videos from all the candidate videos as the first target videos, where n2 is the total number of video plays within the unit time period.
[0154] Step 304: For April 19th from 20:00 to 22:00, obtain the candidate videos played within the unit time period and sort them according to the number of plays. Based on the sorting results, determine N2*0.3 videos from all the candidate videos as the first target videos, where n3 is the total number of video plays within the unit time period.
[0155] Step 305: Obtain playback flow data of all videos played during the time period from 22:00 on April 19 to 20:00 on April 20.
[0156] Step 306: Based on the playback stream data, a video with a bit rate higher than a set threshold is used as a second target video.
[0157] Step 307: Determine the feature values of the second target video based on the playback flow data of the second target video. The features include: bitrate, playback duration, video duration, initial video loading time, whether the user is a paid user, whether a download component is used, whether online playback is available, whether p2p is enabled, whether streaming is free, network type, number of video segments, number of secondary buffers, secondary buffer duration, number of drags, total drag buffering time, and operator.
[0158] Step 308: Input the feature values of the second target videos into the XGBoost model to obtain the estimated playback volume of each second target video.
[0159] Step 309: The first target video and the second target video whose estimated playback volume is greater than the playback threshold are taken as videos to be processed.
[0160] Step 310: Reduce the bit rate of the video to be processed.
[0161] The following are device embodiments of the present application. For details not fully described in the device embodiments, please refer to the above-mentioned corresponding method embodiments.
[0162] Please refer to Figure 4 , which shows a structural block diagram of a video processing device provided by an embodiment of the present application. The device includes: a determination unit 401, an acquisition unit 402, an estimation unit 403, and a reduction unit 404.
[0163] The determining unit 401 is configured to determine at least two unit time periods before the estimated time period;
[0164] An acquisition unit 402 is configured to determine the number of videos according to a time sequence of at least two unit time periods, and acquire target videos corresponding to the number of videos from the candidate videos played in each unit time period;
[0165] The estimation unit 403 is configured to input the characteristic values of each target video into a playback prediction model to obtain an estimated playback volume of the target video within an estimated time period; the playback prediction model is trained using the characteristic values of the training videos and the actual playback volume of the training videos to obtain corresponding model parameters;
[0166] The reducing unit 404 is configured to select a target video that meets a set rule as a to-be-processed video based on the estimated playback volume, and reduce the bit rate of the to-be-processed video.
[0167] In an optional embodiment, the number of target videos corresponding to the at least two unit time periods increases in chronological order;
[0168] The acquisition unit 402 is specifically configured to:
[0169] For each unit time period, determining a video to be played within the unit time period;
[0170] Sort the videos to be selected according to the number of views in a unit time period;
[0171] According to the sorting results, target videos corresponding to the number of videos are determined from the candidate videos.
[0172] In an optional embodiment, the acquisition unit 402 is specifically configured to determine, from the videos to be selected, a first target video corresponding to the number of videos according to the sorting result; and use the first target video as the video to be processed;
[0173] The determining unit 401 is specifically configured to determine a historical time period before the estimated time period; and to use all videos played within the historical time period as second target videos;
[0174] The estimation unit 403 is specifically configured to input the feature value of each second target video into the playback prediction model to obtain an estimated playback volume of the second target video;
[0175] The reducing unit 404 is specifically configured to select the second target video that meets the set rules as a video to be processed according to the estimated playback volume of the second target video.
[0176] In an optional embodiment, the historical time period is after at least two unit time periods.
[0177] In an optional embodiment, the estimation unit 403 is further configured to train and obtain a playback prediction model according to the following method:
[0178] Obtaining training samples, which include feature values of the training video and the actual number of times the training video was played during the training period;
[0179] Input the feature values of the training video into the playback prediction model to obtain the estimated playback volume of the training video during the training period;
[0180] Calculate the loss function based on the actual and estimated playback volume;
[0181] When the loss function is less than a preset threshold, the parameters corresponding to the playback prediction model are determined.
[0182] In an optional embodiment, at least two unit time periods and the estimated time period are located in different time periods, and the position of each unit time period in the corresponding time period is the same as the position of the estimated time period in the time period corresponding to the estimated time period.
[0183] In an optional embodiment, the acquiring unit 402 is further configured to:
[0184] Delete the target video whose bit rate is lower than the set threshold;
[0185] Acquire feature values of a target video, wherein the feature values include numerical feature values and category feature values;
[0186] The categorical feature values are converted into numbers using one-hot encoding.
[0187] Please refer to Figure 5 , which shows a structural block diagram of a server provided by an embodiment of the present application. The server 500 is implemented as Figure 2 Server 202 in. Specifically:
[0188] The server 500 includes a central processing unit (CPU) 501, a system memory 504 including a random access memory (RAM) 502 and a read-only memory (ROM) 503, and a system bus 505 connecting the system memory 504 and the central processing unit 501. The server 500 also includes a basic input / output system (I / O system) 506 that facilitates information transfer between various components within the computer, and a mass storage device 507 for storing an operating system 513, application programs 514, and other program modules 515.
[0189] The basic input / output system 506 includes a display 508 for displaying information and an input device 509, such as a mouse and keyboard, for user input. Both the display 508 and the input device 509 are connected to the central processing unit 501 via an input / output controller 510 connected to the system bus 505. The basic input / output system 506 may also include an input / output controller 510 for receiving and processing input from a variety of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 510 also provides output to a display screen, printer, or other types of output devices.
[0190] The mass storage device 507 is connected to the central processing unit 501 through a mass storage controller (not shown) connected to the system bus 505. The mass storage device 507 and its associated computer-readable media provide non-volatile storage for the server 500. That is, the mass storage device 507 may include computer-readable media (not shown) such as a hard disk or CD-ROM drive.
[0191] Without loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storage technologies, CD-ROM, DVD or other optical storage, magnetic cassettes, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the aforementioned types. The above-mentioned system memory 504 and mass storage device 507 may be collectively referred to as memory.
[0192] According to various embodiments of the present application, the server 500 may also be connected to a remote computer on a network such as the Internet for operation. That is, the server 500 may be connected to the network 512 via the network interface unit 511 connected to the system bus 505, or the network interface unit 511 may be used to connect to other types of networks or remote computer systems (not shown).
[0193] The memory also includes one or more programs, which are stored in the memory. The one or more programs include instructions for estimating the arrival time provided in the embodiment of the present application.
[0194] Those skilled in the art will understand that all or part of the steps in the arrival time estimation method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0195] A person skilled in the art will understand that all or part of the steps in the arrival time estimation method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0196] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0197] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A video processing method, characterized in that: The method comprises: Determine at least two unit time periods before the estimated time period; each of the unit time periods is located at the same position as the estimated time period in different time periods; For each unit time period, determining a video to be played within the unit time period; Sort the videos to be selected according to the amount of playback in the unit time period; According to the sorting result, determining the first target video corresponding to the number of videos from the selected videos; the number of the first target videos corresponding to each unit time period increases in chronological order; Using the first target video as a video to be processed; determining a historical time period that is before the estimated time period and after the at least two unit time periods; All videos played during the historical time period are used as second target videos; For each second target video, inputting the feature value of the second target video into a playback prediction model to obtain an estimated playback volume of the second target video within the estimated time period; the playback prediction model is trained using the feature values of training videos and the actual playback volume of the training videos to obtain corresponding model parameters, the playback prediction model including a gradient boosting network model; the feature value of the second target video is obtained based on playback flow data of the second target video; The second target video, whose estimated playback volume is greater than the preset playback threshold, is used as a video to be processed; Reduce the bit rate of the video to be processed.
2. The method according to claim 1, characterized in that The playback prediction model is trained in the following manner: Obtaining a training sample, wherein the training sample includes a feature value of a training video and an actual playback volume of the training video within a training time period; Inputting the feature value of the training video into the playback prediction model to obtain the estimated playback volume of the training video within the training time period; Calculating a loss function based on the actual playback volume and the estimated playback volume; When the loss function is less than a preset threshold, parameters corresponding to the playback prediction model are determined.
3. The method according to claim 1, characterized in that After taking all videos played in the historical time period as second target videos, the method further includes: Deleting the second target video whose bit rate is lower than the set threshold; Acquire feature values of each second target video, where the feature values include numerical feature values and category feature values; The categorical feature values are converted into numbers using one-hot encoding.
4. A video processing device, characterized in that: The device comprises: a determining unit, configured to determine at least two unit time periods before the estimated time period; each of the unit time periods being located at the same position as the estimated time period in different time periods; An acquisition unit is configured to determine, for each unit time period, candidate videos played within the unit time period; sort the candidate videos according to the number of videos played within the unit time period; determine, based on the sorting result, first target videos corresponding to a corresponding number of videos from the candidate videos; the number of first target videos corresponding to each unit time period increases in chronological order; determine a historical time period before the estimated time period and after the at least two unit time periods; and use all videos played within the historical time period as second target videos; An estimation unit is configured to input, for each second target video, a feature value of the second target video into a playback prediction model to obtain an estimated playback volume of the second target video within the estimated time period; the playback prediction model is trained using the feature values of training videos and the actual playback volume of the training videos to obtain corresponding model parameters, the playback prediction model including a gradient boosting network model; the feature value of the second target video is obtained based on playback flow data of the second target video; The reducing unit is used to take the first target video as the video to be processed; take the second target video whose estimated playback volume is greater than a preset playback threshold as the video to be processed; and reduce the bit rate of the video to be processed.
5. A computer-readable storage medium storing a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
6. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Video sequencing method and device based on video on-demand volume
CN105828181A
Video heat prediction method, device, device and storage medium
CN109522470A