CN109508405B - Method and device for determining recommended video, electronic equipment and storage medium - Google Patents

Method and device for determining recommended video, electronic equipment and storage medium Download PDF

Info

Publication number
CN109508405B
CN109508405B CN201811581350.6A CN201811581350A CN109508405B CN 109508405 B CN109508405 B CN 109508405B CN 201811581350 A CN201811581350 A CN 201811581350A CN 109508405 B CN109508405 B CN 109508405B
Authority
CN
China
Prior art keywords
weight
sampling
point
recommended
interval
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811581350.6A
Other languages
Chinese (zh)
Other versions
CN109508405A (en
Inventor
胡嘉伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing IQIYI Science and Technology Co Ltd
Original Assignee
Beijing IQIYI Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing IQIYI Science and Technology Co Ltd filed Critical Beijing IQIYI Science and Technology Co Ltd
Priority to CN201811581350.6A priority Critical patent/CN109508405B/en
Publication of CN109508405A publication Critical patent/CN109508405A/en
Application granted granted Critical
Publication of CN109508405B publication Critical patent/CN109508405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention provides a method and a device for determining a recommended video, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring alternative videos and corresponding categories thereof and recommendation weights corresponding to the categories; constructing a weight model based on the recommendation weight; constructing a sampling model based on the number of videos to be recommended and the recommendation weight; randomly collecting a sampling point from a sampling interval, and determining sampling points of other sampling intervals according to the sampling point; determining the weight points corresponding to the sampling points from the weight model; determining a target type corresponding to a weight interval where each weight point is located; and acquiring videos corresponding to each target category from the alternative videos to serve as recommended videos. Because the lengths of the sampling intervals are the same and the total length is the sum of the recommended weights, when the target type corresponding to the weight interval where each weight point is located is determined, traversal from the head of the weight model is not required, the complexity of determining the recommended video can be reduced, and the efficiency of determining the recommended video is improved.

Description

Method and device for determining recommended video, electronic equipment and storage medium
Technical Field
The present invention relates to the field of video recommendation technologies, and in particular, to a method and an apparatus for determining a recommended video, an electronic device, and a storage medium.
Background
At present, in a network platform, in order to enable a user to see a favorite video, the video needs to be recommended to the user according to the favorite of the user. The videos can be divided into a plurality of categories, such as gourmet, fun, games and the like, the user often has different preference degrees for each video, so that the interest distribution of the user is formed, and the videos can be recommended according to the interest distribution condition of the user in a video recommendation scene.
To facilitate the determination of the videos to be recommended, a label may be set for each alternative video. Assume that the video tag set T ═ T1, T2, T3, …, for example T may be { gourmet, fun, game … }. In the process of determining the recommended video, the tags can be sampled according to the interest distribution of the user, and then the recommended video is determined according to the tags obtained by sampling.
For example, the interest distribution of a user is { t1:0.4, t2:0.4, t3:0.2}, and assuming that 10 videos are to be recommended, a line segment with a length wl ═ w1+ w2+ w3 ═ 0.4+0.4+0.2 ═ 1 can be determined, wherein the weights w1, w2, w3 divide the line segment into three regions. Then a random number between 0 and 1 is randomly generated, and the label corresponding to the weight is adopted according to which weight area the random number is located in. For example, the list of tags obtained after sampling is [ t1, t2, t2, t1, t2, t3, t2, t1, t1, t2], and then according to the type of each tag, the corresponding video is determined from the candidate videos, which is the recommended video.
In the process of determining the recommended video, when sampling the tag each time, it is necessary to traverse the line segment formed by the weight from the beginning, and determine whether the random number is in the current region, and in the process of sampling the tag, if the type of the tag is N and the number of the recommended video is M, it is necessary to traverse the line segment formed by the weight from the beginning 10 times, and the required time complexity may be denoted as o (nm), so that it is determined that the recommended video is high in complexity and low in efficiency.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for determining a recommended video, an electronic device and a storage medium, so as to reduce the complexity of determining the recommended video and improve the efficiency. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for determining a recommended video, where the method includes:
acquiring alternative videos and corresponding categories thereof and recommendation weights corresponding to the categories;
constructing a weight model based on the recommendation weight, wherein the weight model comprises a plurality of weight intervals, and the lengths of the weight intervals are respectively the same as the recommendation weight;
constructing a sampling model based on the number of videos to be recommended and the recommendation weight, wherein the sampling model comprises a plurality of sampling intervals, the total length of the sampling intervals is the sum of the recommendation weight, the length of each sampling interval is the same, and the number of the sampling intervals is the same as the number of the videos to be recommended;
randomly collecting a sampling point from one sampling interval, and determining sampling points of other sampling intervals according to the sampling point;
determining the weight points corresponding to the sampling points from the weight model;
determining a target type corresponding to the weight interval where each weight point is located;
and acquiring videos corresponding to each target category from the alternative videos to serve as recommended videos.
Optionally, the step of constructing a weight model based on the recommendation weight includes:
constructing a weight line segment, wherein the length of the weight line segment is the sum of the recommended weights;
dividing the weight line segment into a plurality of weight intervals according to the recommended weight;
the step of constructing a sampling model based on the number of videos to be recommended and the recommendation weight comprises the following steps:
constructing a sampling line segment, wherein the length of the sampling line segment is the sum of the recommended weights;
and dividing the sampling line segment into a plurality of sampling intervals according to the number of the videos to be recommended.
Optionally, the step of determining the weighting point corresponding to the sampling point from the weighting model includes:
and vertically mapping the sampling points to the weighting line segments to obtain weighting points corresponding to the sampling points.
Optionally, the step of determining the target category corresponding to the weight interval in which each weight point is located includes:
sequentially determining the weight interval where each weight point is located;
determining the type of the video corresponding to the determined weight interval as a target type;
the method for determining the weight interval where each weight point is located includes:
traversing the weight line segment from the beginning for a first weight point, judging whether the first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the first weight point is positioned;
and traversing the weight line segment from a target position aiming at the non-first weight point, judging whether the non-first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the non-first weight point is positioned, wherein the target position is the position in the weight line segment corresponding to the end of a sampling interval in which a sampling point corresponding to the non-first weight point is positioned.
Optionally, the step of randomly collecting a sampling point from one sampling interval and determining sampling points of other sampling intervals according to the sampling point includes:
randomly collecting a sampling point r1 from a first sampling interval;
according to the formula rmM × wl/M-r 1 determines the sampling points for other sampling intervals, where rmAnd M is 1, 2 … M, where M is the number of the videos to be recommended, and wl is the sum of the recommendation weights.
Optionally, before the step of obtaining the candidate videos and the corresponding categories thereof and the recommendation weight corresponding to each category, the method further includes:
acquiring a video history watching record of a user, wherein the video history watching record comprises the type and watching times of a video;
and determining the recommendation weight of each type of video based on the types of the videos and the watching times.
Optionally, the method further includes:
and recommending the recommended video to the user.
In a second aspect, an embodiment of the present invention provides an apparatus for determining a recommended video, where the apparatus includes:
the alternative video acquisition module is used for acquiring alternative videos, corresponding types of the alternative videos and recommendation weights corresponding to the types;
the weight model building module is used for building a weight model based on the recommended weight, wherein the weight model comprises a plurality of weight intervals, and the lengths of the weight intervals are respectively the same as the recommended weight;
the sampling model building module is used for building a sampling model based on the number of videos to be recommended and the recommendation weight, wherein the sampling model comprises a plurality of sampling intervals, the total length of the sampling intervals is the sum of the recommendation weight, the length of each sampling interval is the same, and the number of the sampling intervals is the same as the number of the videos to be recommended;
the sampling point determining module is used for randomly collecting a sampling point from one sampling interval and determining sampling points of other sampling intervals according to the sampling point;
the weight point determining module is used for determining the weight points corresponding to the sampling points from the weight model;
the target type determining module is used for determining a target type corresponding to the weight interval where each weight point is located;
and the recommended video determining module is used for acquiring videos corresponding to each target category from the alternative videos to serve as recommended videos.
Optionally, the weight model building module includes:
the weight line segment construction unit is used for constructing a weight line segment, wherein the length of the weight line segment is the sum of the recommended weights;
the weight line segment dividing unit is used for dividing the weight line segment into a plurality of weight intervals according to the recommended weight;
the sampling model building module comprises:
the sampling line segment construction unit is used for constructing a sampling line segment in a module mode, wherein the length of the sampling line segment is the sum of the recommended weights;
and the sampling line segment dividing unit is used for dividing the sampling line segments into a plurality of sampling intervals according to the number of the videos to be recommended.
Optionally, the weight point determining module includes:
and the weight point determining unit is used for vertically mapping the sampling points to the weight line segments to obtain the weight points corresponding to the sampling points.
Optionally, the target category determining module includes:
a weight interval determination unit, configured to sequentially determine a weight interval in which each of the weight points is located;
a target category determination unit configured to determine a category of the video corresponding to the determined weight section as a target category;
the method for determining the weight section in which each of the weight points is located by the weight section determination unit includes:
traversing the weight line segment from the beginning for a first weight point, judging whether the first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the first weight point is positioned;
and traversing the weight line segment from a target position aiming at the non-first weight point, judging whether the non-first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the non-first weight point is positioned, wherein the target position is the position in the weight line segment corresponding to the end of a sampling interval in which a sampling point corresponding to the non-first weight point is positioned.
Optionally, the sampling point determining module includes:
a first sampling point determining unit, configured to randomly acquire a sampling point r1 from a first one of the sampling intervals;
a second sample point determining unit for determining a second sample point according to the formula rmM × wl/M-r 1 determines the sampling points for other sampling intervals, where rmAnd M is 1, 2 … M, where M is the number of the videos to be recommended, and wl is the sum of the recommendation weights.
Optionally, the apparatus further comprises:
a viewing record obtaining module, configured to obtain a video history viewing record of a user before the alternative video and the corresponding category thereof and the recommendation weight corresponding to each category are obtained, where the video history viewing record includes the category and the viewing frequency of the video;
and the recommendation weight determining module is used for determining the recommendation weight of each type of video based on the types of the videos and the watching times.
Optionally, the apparatus further comprises:
and the video recommending module is used for recommending the recommended video to the user.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the steps of the method for determining the recommended video when the program stored in the memory is executed.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements any of the above steps of the method for determining a recommended video.
In the scheme provided by the embodiment of the invention, the electronic equipment can obtain alternative videos, corresponding types of the alternative videos and recommendation weights corresponding to all the types, construct a weight model based on recommendation weights, construct a sampling model based on the number of videos to be recommended and the recommendation weights, randomly collect one sampling point in one sampling interval, determine sampling points of other sampling intervals according to the sampling points, determine weight points corresponding to the sampling points from the weight model, further determine target types corresponding to the weight intervals where the weight points are located, and finally obtain videos corresponding to all the target types from the alternative videos as the recommendation videos. The sampling model comprises a plurality of sampling intervals, the lengths of the sampling intervals are the same, the total length is the sum of the recommendation weights, and the number of the sampling intervals is the same as that of the videos to be recommended.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for determining a recommended video according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a weighting line segment and a sampling line segment according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a method for determining weight points according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a device for determining recommended video according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to reduce complexity of determining a recommended video and improve efficiency, embodiments of the present invention provide a method and an apparatus for determining a recommended video, an electronic device, and a computer-readable storage medium.
First, a method for determining a recommended video according to an embodiment of the present invention is described below.
The method for determining the recommended video provided by the embodiment of the invention can be applied to any electronic equipment needing to determine the recommended video, for example, the electronic equipment can be electronic equipment such as a server and a terminal, and is not particularly limited herein.
As shown in fig. 1, a method for determining a recommended video includes:
s101, acquiring alternative videos, corresponding categories of the alternative videos and recommendation weights corresponding to the categories;
s102, constructing a weight model based on the recommendation weight;
the weight model comprises a plurality of weight intervals, and the lengths of the weight intervals are respectively the same as the recommended weights.
S103, constructing a sampling model based on the number of videos to be recommended and the recommendation weight;
the sampling model comprises a plurality of sampling intervals, the total length of the sampling intervals is the sum of the recommendation weights, the length of each sampling interval is the same, and the number of the sampling intervals is the same as that of the videos to be recommended.
S104, randomly collecting a sampling point from a sampling interval, and determining sampling points of other sampling intervals according to the sampling point;
s105, determining a weight point corresponding to the sampling point from the weight model;
s106, determining a target type corresponding to the weight interval where each weight point is located;
s107, acquiring videos corresponding to each target category from the alternative videos to serve as recommended videos.
Therefore, in the scheme provided by the embodiment of the invention, the electronic device can obtain the alternative videos and the corresponding types thereof and the recommendation weight corresponding to each type, construct a weight model based on the recommendation weight, construct a sampling model based on the number of the videos to be recommended and the recommendation weight, randomly collect one sampling point from one sampling interval, determine sampling points of other sampling intervals according to the sampling points, determine the weight point corresponding to the sampling point from the weight model, further determine the target type corresponding to the weight interval where each weight point is located, and finally obtain the video corresponding to each target type from the alternative videos as the recommendation video. The sampling model comprises a plurality of sampling intervals, the lengths of the sampling intervals are the same, the total length is the sum of the recommendation weights, and the number of the sampling intervals is the same as that of the videos to be recommended.
In step S101, the electronic device may obtain the candidate video and the corresponding category thereof, and the recommendation weight corresponding to each category. The alternative video is a video which can be used as an alternative of the recommended video. Alternative videos may generally be categorized into a variety of categories, such as, for example, fun, games, warmth, travel, and the like, and are not specifically limited herein. The electronic device can obtain the alternative video and the category of the alternative video simultaneously, so that the recommended video can be determined subsequently.
Since different users have different preferences for different types of videos, for example, some people like a funny type of video, some people like a travel type of video, and so on. So in order to recommend videos that the user likes to for the purpose, recommendation weights for each category of videos can be obtained. The recommendation weight is determined according to the interest statistical data of the user on each type of video, and the higher the recommendation weight is, the more the user likes the corresponding type of video; the lower the recommendation weight, the less the user likes its corresponding category of video.
Next, the electronic device can build a weight model based on the obtained recommended weights. The weight model may include a plurality of weight intervals, and lengths of the weight intervals may be respectively the same as the recommended weights. Since a general candidate video includes multiple categories, each category corresponds to one recommendation weight, and the recommendation weight is multiple. The weight model may include a plurality of weight intervals, the number of the weight intervals is the same as the number of the recommended weights, and the lengths of the weight intervals are respectively the same as the recommended weights.
For example, if the types of the candidate videos are food, fun and game, and the corresponding recommended weights are 0.2, 0.3 and 0.5, respectively, the weight model may include three weight intervals, and the lengths of the three weight intervals are 0.2, 0.3 and 0.5, respectively.
After obtaining the number of the videos to be recommended and the recommendation weight, the electronic device may execute step S103, that is, construct a sampling model based on the number of the videos to be recommended and the recommendation weight. The sampling model can comprise a plurality of sampling intervals, the total length of the sampling intervals is the sum of the recommendation weights, the length of each sampling interval is the same, and the number of the sampling intervals is the same as the number of videos to be recommended.
That is to say, the total length of the sampling model is the sum of the recommendation weights, and the sampling model is equally divided into a plurality of intervals of the videos to be recommended, that is, a plurality of sampling intervals are obtained. For example, if the types of the candidate videos are food, fun and game, the corresponding recommendation weights are 0.2, 0.3 and 0.5, respectively, and the number of videos to be recommended is 10, the total length of the sampling model is 0.2+0.3+ 0.5-1, and the length of each sampling interval is 1/10-0.1.
After determining the weight model and the sampling model, the electronic device may determine a sampling point from a sampling interval, and determine sampling points of other sampling intervals according to the sampling point, that is, execute the step S104. For example, taking the length of each sampling interval 1/10 being 0.1 and the number of sampling intervals being 10 as examples, the electronic device may determine one sampling point in one of the 10 sampling intervals.
As an embodiment, the electronic device may randomly acquire one sampling point from one sampling interval, that is, may randomly acquire one sampling point from one sampling interval in a uniform sampling manner. The electronic device can then determine sampling points for other sampling intervals from the sampling points. Specifically, the sampling points in other sampling intervals can be determined according to the relationship between the sampling interval in which the sampling point is located and other sampling intervals.
For example, if the electronic device randomly samples one sampling point 0.4 from the second sampling interval, the sampling point of the first sampling interval may be 0.4-0.25-0.15, the sampling point of the third sampling interval may be 0.4+ 0.25-0.65, and the sampling point of the fourth sampling interval may be 0.4+2 × 0.25.25-0.9, where the length of each sampling interval is 0.25.
Furthermore, the electronic device may determine the weighting points corresponding to the sampling points from the weighting model. In an embodiment, the electronic device may determine the weight point corresponding to the sampling point by traversing the weight model according to the position of the sampling point and the corresponding relationship between the weight model and the sampling model.
For example, the types of candidate videos are gourmet, fun, and game, and the corresponding recommended weights are 0.2, 0.3, and 0.5, respectively. The weight model includes three weight intervals, namely a first weight interval, a second weight interval and a third weight interval, and the lengths of the three weight intervals are 0.2, 0.3 and 0.5 respectively. The length of each sampling interval is 0.1, and the number of sampling intervals is 10.
Then if the first sample point is 0.03, the electronic device may traverse the weight model from the beginning, and further determine that the weight point corresponding to the first sample point 0.03 is the point 0.03 in the first weight interval. If the second sampling point is 0.67, since the sampling points are respectively determined from different sampling intervals, the second sampling point cannot be located between 0 and 0.1, the electronic device can traverse the weight model from a point 0.1 in the first weight interval to a beginning point, and then the second sampling point does not start from the beginning point, so that the required time complexity is reduced, and the traversal efficiency is improved. Next, the determination manner of the weight point corresponding to the third to tenth sampling points is the same as the determination manner of the weight point corresponding to the second sampling point, and it can be understood that the portion of the weight model that needs to be traversed each time is reduced.
After the weight points corresponding to the sampling points are determined, the electronic device can determine the target type corresponding to the weight interval where each weight point is located. For example, the weight model includes three weight sections, namely a first weight section, a second weight section and a third weight section, the lengths of the three weight sections are 0.2, 0.3 and 0.5 respectively, and the types of the corresponding videos are cate, fun and game respectively. If 2 weight intervals in the 10 weight points are the first weight interval, the target type corresponding to the weight interval in which the 2 weight points are located is the food.
Furthermore, the electronic device may perform the step S107, namely, obtain the video corresponding to each target category from the candidate videos as the recommended video. Because each sampling point corresponds to a weight point and each weight point corresponds to a target type, the number of the target types is the same as that of videos to be recommended. Furthermore, the required recommended video can be obtained by obtaining the video corresponding to each target type from the candidate videos.
For example, if the target types determined in step S106 are 10, which are 2 gourmets, 2 puzzles and 4 games, respectively, the electronic device may obtain 2 candidate videos of the gourmet type, 2 candidate videos of the puzzles, and 4 candidate videos of the games from the candidate videos, where the 10 candidate videos are the recommended videos.
In one embodiment, in order to ensure that each alternative video is likely to be selected as the recommended video, when a video is selected from each alternative video, a random sampling mode may be adopted, and the video is randomly selected from the alternative videos as the recommended video.
As an implementation manner of the embodiment of the present invention, the step of constructing the weight model based on the recommendation weight may include:
constructing a weight line segment; and dividing the weight line segment into a plurality of weight intervals according to the recommended weight.
The electronic devices may each establish a weight line segment, wherein the length of the weight line segment is the sum of the recommended weights. For example, the recommended weights are 0.1, 0.2, 0.4, and 0.3, respectively, and the length of the weight line segment is 0.1+0.2+0.4+0.3 — 1.
After the weight line segment is constructed, the electronic device may divide the weight line segment into a plurality of weight intervals according to the recommended weight, so that the lengths of the weight intervals are respectively the same as the recommended weight. For example, as shown in the schematic diagram of the weight line segment 210 in fig. 2, the length of the weight line segment is the sum of the recommended weights w1 and w2 … wn. The length of the weight section is the same as the recommended weights W1 and W2 … Wn, wherein W1 and W2 … Wn denote the weight section.
Correspondingly, the step of constructing the sampling model based on the number of videos to be recommended and the recommendation weight may include:
constructing a sampling line segment; and dividing the sampling line segment into a plurality of sampling intervals according to the number of the videos to be recommended.
The electronic devices may each create a sampling line segment, wherein the length of the sampling line segment is the sum of the recommended weights, i.e. the same as the length of the weighting line segment. For example, the recommended weights are 0.1, 0.2, 0.4, and 0.3, respectively, and the length of the sampling line segment is 0.1+0.2+0.4+0.3 — 1.
After the sampling line segments are constructed, the electronic equipment can divide the sampling line segments into a plurality of sampling intervals according to the number of videos to be recommended, so that the length of each sampling interval is the same. For example, as shown in the schematic diagram of the sampling line segment 220 in fig. 2, the length of the sampling line segment is the sum of the recommended weights w1, w2 … wn. The length of each sampling interval is the same, and the number of the sampling intervals is m, wherein A1 and A2 … Am represent the sampling intervals.
Therefore, in this embodiment, the electronic device may construct a weight line segment, divide the weight line segment into a plurality of weight intervals according to the recommended weight, construct a sampling line segment, and divide the sampling line segment into a plurality of sampling intervals according to the number of videos to be recommended. The weight model and the sampling model are expressed in a line segment form, so that the weight model and the sampling model can be simply and quickly constructed.
As an implementation manner of the embodiment of the present invention, when the weighting model is a weighting line segment and the sampling model is a sampling line segment, the step of determining the weighting point corresponding to the sampling point from the weighting model may include:
and vertically mapping the sampling points to the weighting line segments to obtain weighting points corresponding to the sampling points.
After the electronic device determines a sampling point from each sampling interval, the electronic device can vertically map the sampling point to the weight line segment, so that a point corresponding to the sampling point is obtained. Wherein, the vertical mapping is to map the sampling points to the positions corresponding to the positions in the weighting line segments. Because the sampling line segments and the weighting line segments have the same length, the electronic device can align the sampling line segments with the weighting line segments to facilitate vertical mapping.
For example, as shown in fig. 3, after the sampling point c2 of the sampling interval a2 is determined in the sampling line segment 320, it can be vertically mapped to the weighting line segment 310 to obtain the weighting point d2 corresponding to the sampling point c 2.
Therefore, in this embodiment, the electronic device may vertically map the sampling points to the weight line segments, so as to obtain the weight point corresponding to each sampling point. In this way, the electronic device can quickly and accurately determine the weight point corresponding to each sampling point.
As an implementation manner of the embodiment of the present invention, when the weight model is a weight line segment and the sampling model is a sampling line segment, the step of determining the target type corresponding to the weight interval where each weight point is located may include:
sequentially determining the weight interval where each weight point is located; determining the type of the video corresponding to the determined weight interval as a target type;
since the sampling point is generally multiple, the weighting point is multiple, and when determining the weighting interval in which each weighting point is located, the weighting point has an effect on each other, the electronic device may sequentially determine the weighting interval in which each weighting point is located, and then determine the type of the video corresponding to the determined weighting interval as the target type.
For the weight points, two types can be used, one type is the first weight point, and the other type is the non-first weight point, i.e. the weight points other than the first weight point. The first weight point is a weight point corresponding to the first sampling point, and the first sampling point is a sampling point determined from the first sampling interval.
For example, as shown in fig. 3, the sampling interval a1 is the first sampling interval, the sampling point determined from the sampling interval a1 is the first sampling point, and the corresponding weight point is the first weight point.
According to the two types of weight points, as an embodiment, the method for determining the weight interval in which each weight point is located may include:
and traversing the weight line segment from the beginning for a first weight point, judging whether the first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the first weight point is.
For the first type of weight point, i.e. the first weight point, since it is the first weight point, there is no other weight point associated with it, and since the first weight point corresponds to the first sampling point, the weight interval is located at the head of the weight line segment, so that the weight line segment can be traversed from the beginning.
While traversing the weight line segment, the electronic device may determine whether the first weight point is in the currently traversed weight interval. Since the weight points are obtained through the vertical mapping, when traversing the weight line segment, if the first weight point is convenient to be reached, the traversal can be stopped, and the currently traversed weight interval is determined as the weight interval in which the first weight point is located.
For example, as shown in fig. 3, after a sampling point c1 of a sampling interval a1 is determined in the sampling line segment 320, the sampling point c1 is vertically mapped to the weight line segment 310, and a weight point d1 corresponding to the sampling point c1 is obtained. The electronic device may traverse the weight segments 310 from the beginning, and determine whether the weight point d1 is in the currently traversed weight interval until the weight point d1 is reached, and stop the traversal, where the currently traversed weight interval W1 is the weight interval in which the first weight point d1 is located.
And for the second type of weight point, namely the non-first weight point, traversing the weight line segment from the target position, judging whether the non-first weight point is in the currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the non-first weight point is.
And the target position is the position in the weight line segment corresponding to the end of the sampling interval where the sampling point corresponding to the non-first weight point is located. Because only one sampling point is collected in each sampling interval, the current weight point cannot appear in the weight line segment corresponding to the sampling interval before the sampling interval where the sampling point corresponding to the current weight point is located. The electronic device can traverse the weight line segments starting at the target location without having to traverse the weight line segments from scratch.
For example, as shown in fig. 3, after the sampling point c2 of the sampling interval a2 is determined in the sampling line segment 320, the sampling point c2 is vertically mapped to the weight line segment 310 to obtain the weight point d2 corresponding to the sampling point c2, and when the weight interval where the weight point d2 is located is determined, the weight line segment 310 may be traversed from the position d0 in the weight line segment corresponding to the end of the sampling interval a 1.
While traversing the weight line segment 310 from the target position, the electronic device may determine whether the non-first weight point is in the currently traversed weight interval, and if so, stop the traversal, and determine the currently traversed weight interval as the weight interval in which the non-first weight point is located.
For example, as shown in fig. 3, the electronic device may traverse the weight line segment 310 from d0 until the weight point d2 is located, and then determine that the weight point d2 is in the currently traversed weight interval, and then determine the currently traversed weight interval W2 as the weight interval in which the first weight point d2 is located.
Therefore, in this embodiment, when determining the weight interval in which each weight point is located, the weight line segments may be traversed for the first weight point and the non-first weight point, and when traversing the non-first weight point, the weight line segments do not need to be traversed from the beginning, so that the complexity of determining the recommended video is reduced, and the efficiency of determining the recommended video is improved.
As an implementation manner of the embodiment of the present invention, the step of randomly collecting one sampling point from one sampling interval and determining sampling points of other sampling intervals according to the sampling point may include:
randomly collecting a sampling point r1 from a first sampling interval; according to the formula rmThe sampling points for the other sampling intervals are determined M × wl/M-r 1.
Wherein r ismAnd M is 1, 2 … M, where M is the number of the videos to be recommended, and wl is the sum of the recommendation weights.
The electronic device can randomly acquire a sampling point r1 from the first sampling interval, and further use the formula rmFor example, if the length of each sampling interval included in the sampling segment is 0.1 and the number of sampling intervals is 10, the electronic device may randomly acquire one sampling point r1 from the first sampling interval, that is, randomly acquire one sampling point r1 from the sampling interval of 0-0.1.
Assuming that r1 is 0.04, the sampling point of the second sampling interval is r22 × 1/10-0.04-0.16, and the sampling point of the third sampling interval is r3By analogy, 3 × 1/10-0.04-0.26, and so on, 10 sampling intervals of sampling points can be obtained.
It can be seen that, in this embodiment, the electronic device may randomly collect one sampling point r1 from the first sampling interval, and according to the formula rmM × wl/M-r 1 determines sampling points of other sampling intervals, only one random sampling point needs to be generated in the process, and other sampling points can be determined according to the sampling point, so that the complexity of determining the recommended video is further reduced.
In the sampling process, assuming that the number of populations is N, the number of samples is N, the corresponding number of populations is Nh, and the corresponding number of samples is Nh for each layer h, a sampling Weight of samples per layer Weight is (Nh/N)/(Nh/N) — (Nh/Nh)/(N) — f/fh, where f ═ N/N is a sampling rate of the population samples, and fh ═ Nh/Nh is a sampling rate of the samples in the layer h. It is thus possible to obtain: when fh > f, Weight _ h <1, at which point the samples within layer h are oversampled; when fh equals f, Weight _ h equals 1, and the sampling rate of the samples in the layer h is equal to the total sampling rate; weight _ h >1 when fh < f, at which time the samples within layer h are undersampled.
In the method for determining a recommended video according to the embodiment of the present invention, the total number is the sum of recommendation weights N ═ wl ═ recommendation weights, the number of samples N ═ M ═ the number of videos to be recommended, for each sampling interval, the corresponding total number is Nh ═ wl/N, the corresponding number of sampling points is Nh ═ 1, and the above formula is substituted to obtain: weight _ h is (Nh/N)/(Nh/N) ((wl/M)/wl)/(1/M) ═ 1. Therefore, in the method for determining the recommended video provided by the embodiment of the invention, the weights of the sampling points in all the sampling intervals are all 1, so that the distribution of the sampling points obtained by sampling is approximate to the overall distribution, and the obtained result is reasonable.
As an implementation manner of the embodiment of the present invention, before the step of acquiring the candidate videos and the corresponding categories thereof and the recommendation weight corresponding to each category, the method may further include:
acquiring a video history watching record of a user; and determining the recommendation weight of each type of video based on the types of the videos and the watching times.
The video history watching record can include the type and watching times of the video. The electronic equipment can acquire the historical watching records of the videos of the user from channels such as a video platform and the like, and further determines the preference degrees of the user to the videos of different types according to the types of the videos and the watching times corresponding to the types of the videos, wherein the preference degrees can be represented by recommendation weights.
For example, the video history viewing record of user a is: the number of times of watching the video of the funny kind is 25; the number of views of the video of the sports genre is 55; the number of viewing times of the video of the temperate category is 5; the number of viewing times of the video of the game category is 15. The electronic device may determine that the recommended weight for the funny category of video for user a is 25/(25+55+5+15) ═ 0.25; the recommended weight of the video of the sports genre is 55/(25+55+5+15) ═ 0.55; the recommended weight of the video of the category of the warmth is 5/(25+55+5+15) ═ 0.05; the recommended weight of the video of the game category is 15/(25+55+5+15) ═ 0.15.
As can be seen, in this embodiment, before the candidate videos and the corresponding categories thereof and the recommendation weights corresponding to each category are obtained, the electronic device may obtain the video history viewing records of the user, and determine the recommendation weight of the video of each category based on the category and the viewing times of the video. Furthermore, recommendation weights of different types of videos can be obtained in a targeted manner for different users, so that subsequently determined recommendation videos better accord with the preference of the users, and the user experience is improved.
As an implementation manner of the embodiment of the present invention, the method may further include:
and recommending the recommended video to the user.
After the electronic equipment determines the recommended video, the recommended video can be recommended to the user. In one embodiment, the electronic device may display a video list of recommended videos in the video recommendation interface, so that the user may view the corresponding recommended videos by clicking on the recommended video information in the video list. Of course, the electronic device may recommend the recommended video to the user in other manners, which is not limited herein.
Corresponding to the determination method of the recommended video, the embodiment of the invention also provides a determination device of the recommended video.
The following describes a device for determining a recommended video according to an embodiment of the present invention.
As shown in fig. 4, a determination apparatus of a recommended video, the apparatus comprising:
an alternative video obtaining module 410, configured to obtain alternative videos and corresponding categories thereof, and recommendation weights corresponding to each category;
a weight model construction module 420 for constructing a weight model based on the recommended weights;
the weight model comprises a plurality of weight intervals, and the lengths of the weight intervals are respectively the same as the recommended weights.
The sampling model building module 430 is used for building a sampling model based on the number of videos to be recommended and the recommendation weight;
the sampling model comprises a plurality of sampling intervals, the total length of the sampling intervals is the sum of the recommendation weights, the length of each sampling interval is the same, and the number of the sampling intervals is the same as that of the videos to be recommended.
The sampling point determining module 440 is configured to randomly acquire a sampling point from a sampling interval, and determine sampling points of other sampling intervals according to the sampling point;
a weight point determining module 450, configured to determine, from the weight model, a weight point corresponding to the sampling point;
a target category determining module 460, configured to determine a target category corresponding to the weight interval where each weight point is located;
a recommended video determining module 470, configured to obtain, from the candidate videos, a video corresponding to each target category as a recommended video.
Therefore, in the scheme provided by the embodiment of the invention, the electronic device can obtain the alternative videos and the corresponding types thereof and the recommendation weight corresponding to each type, construct a weight model based on the recommendation weight, construct a sampling model based on the number of the videos to be recommended and the recommendation weight, randomly collect one sampling point from one sampling interval, determine sampling points of other sampling intervals according to the sampling points, determine the weight point corresponding to the sampling point from the weight model, further determine the target type corresponding to the weight interval where each weight point is located, and finally obtain the video corresponding to each target type from the alternative videos as the recommendation video. The sampling model comprises a plurality of sampling intervals, the lengths of the sampling intervals are the same, the total length is the sum of the recommendation weights, and the number of the sampling intervals is the same as that of the videos to be recommended.
As an implementation manner of the embodiment of the present invention, the weight model building module 420 may include:
a weight line segment construction unit (not shown in fig. 4) for constructing a weight line segment, wherein the length of the weight line segment is the sum of the recommended weights;
a weight line segment dividing unit (not shown in fig. 4) for dividing the weight line segment into a plurality of weight sections according to the recommended weight;
the sampling model building module 430 may include:
a sampling line segment construction unit (not shown in fig. 4) for modularly constructing a sampling line segment, wherein the length of the sampling line segment is the sum of the recommended weights;
a sampling line segment dividing unit (not shown in fig. 4) configured to divide the sampling line segment into a plurality of sampling intervals according to the number of the videos to be recommended.
As an implementation manner of the embodiment of the present invention, the weight point determining module 450 may include:
and a weight point determining unit (not shown in fig. 4) configured to vertically map the sampling points to the weight line segments to obtain weight points corresponding to the sampling points.
As an implementation manner of the embodiment of the present invention, the target category determining module 460 may include:
a weight section determination unit (not shown in fig. 4) configured to sequentially determine a weight section in which each of the weight points is located;
a target category determining unit (not shown in fig. 4) for determining a category of the video corresponding to the determined weight section as a target category;
the method for determining the weight section in which each of the weight points is located by the weight section determination unit may include:
traversing the weight line segment from the beginning for a first weight point, judging whether the first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the first weight point is positioned;
and traversing the weight line segment from a target position aiming at the non-first weight point, judging whether the non-first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the non-first weight point is positioned, wherein the target position is the position in the weight line segment corresponding to the end of a sampling interval in which a sampling point corresponding to the non-first weight point is positioned.
As an implementation manner of the embodiment of the present invention, the sampling point determining module 440 may include:
a first sampling point determination unit (not shown in fig. 4) for randomly acquiring one sampling point r1 from a first one of the sampling intervals;
a second sample point determining unit (not shown in FIG. 4) for determining a second sample point according to the formula rmM × wl/M-r 1 determines the sampling points for other sampling intervals, where rmAnd M is 1, 2 … M, where M is the number of the videos to be recommended, and wl is the sum of the recommendation weights.
As an implementation manner of the embodiment of the present invention, the apparatus may further include:
a viewing record obtaining module (not shown in fig. 4) configured to obtain a video history viewing record of the user before the candidate video and the category corresponding to the candidate video and the recommendation weight corresponding to each category are obtained, where the video history viewing record includes the category and the viewing frequency of the video;
and a recommendation weight determining module (not shown in fig. 4) for determining a recommendation weight of each video category based on the video category and the watching times.
As an implementation manner of the embodiment of the present invention, the apparatus may further include:
a video recommendation module (not shown in fig. 4) for recommending the recommended video to the user.
An embodiment of the present invention further provides an electronic device, as shown in fig. 5, the electronic device may include a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete communication with each other through the communication bus 504.
A memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps:
acquiring alternative videos and corresponding categories thereof and recommendation weights corresponding to the categories;
building a weight model based on the recommendation weight;
the weight model comprises a plurality of weight intervals, and the lengths of the weight intervals are respectively the same as the recommended weights.
Constructing a sampling model based on the number of videos to be recommended and the recommendation weight;
the sampling model comprises a plurality of sampling intervals, the total length of the sampling intervals is the sum of the recommendation weights, the length of each sampling interval is the same, and the number of the sampling intervals is the same as that of the videos to be recommended.
Randomly collecting a sampling point from one sampling interval, and determining sampling points of other sampling intervals according to the sampling point;
determining the weight points corresponding to the sampling points from the weight model;
determining a target type corresponding to the weight interval where each weight point is located;
and acquiring videos corresponding to each target category from the alternative videos to serve as recommended videos.
Therefore, in the scheme provided by the embodiment of the invention, the electronic device can obtain the alternative videos and the corresponding types thereof and the recommendation weight corresponding to each type, construct a weight model based on the recommendation weight, construct a sampling model based on the number of the videos to be recommended and the recommendation weight, randomly collect one sampling point from one sampling interval, determine sampling points of other sampling intervals according to the sampling points, determine the weight point corresponding to the sampling point from the weight model, further determine the target type corresponding to the weight interval where each weight point is located, and finally obtain the video corresponding to each target type from the alternative videos as the recommendation video. The sampling model comprises a plurality of sampling intervals, the lengths of the sampling intervals are the same, the total length is the sum of the recommendation weights, and the number of the sampling intervals is the same as that of the videos to be recommended.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
The step of constructing a weight model based on the recommendation weight may include:
constructing a weight line segment, wherein the length of the weight line segment is the sum of the recommended weights;
dividing the weight line segment into a plurality of weight intervals according to the recommended weight;
the step of constructing a sampling model based on the number of videos to be recommended and the recommendation weight may include:
constructing a sampling line segment, wherein the length of the sampling line segment is the sum of the recommended weights;
and dividing the sampling line segment into a plurality of sampling intervals according to the number of the videos to be recommended.
The step of determining the weighting point corresponding to the sampling point from the weighting model may include:
and vertically mapping the sampling points to the weighting line segments to obtain weighting points corresponding to the sampling points.
The step of determining the target type corresponding to the weight interval where each of the weight points is located may include:
sequentially determining the weight interval where each weight point is located;
determining the type of the video corresponding to the determined weight interval as a target type;
the determining a weight interval in which each of the weight points is located may include:
traversing the weight line segment from the beginning for a first weight point, judging whether the first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the first weight point is positioned;
and traversing the weight line segment from a target position aiming at the non-first weight point, judging whether the non-first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the non-first weight point is positioned, wherein the target position is the position in the weight line segment corresponding to the end of a sampling interval in which a sampling point corresponding to the non-first weight point is positioned.
The step of randomly collecting a sampling point from one sampling interval and determining sampling points of other sampling intervals according to the sampling point may include:
randomly collecting a sampling point r1 from a first sampling interval;
according to the formula rmM × wl/M-r 1 determines the sampling points for other sampling intervals, where rmAnd M is 1, 2 … M, where M is the number of the videos to be recommended, and wl is the sum of the recommendation weights.
Before the step of obtaining the candidate videos and the corresponding categories thereof and the recommendation weight corresponding to each category, the method may further include:
acquiring a video history watching record of a user, wherein the video history watching record comprises the type and watching times of a video;
and determining the recommendation weight of each type of video based on the types of the videos and the watching times.
Wherein, the method can also comprise:
and recommending the recommended video to the user.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when executed by a processor, the computer program implements the following steps:
acquiring alternative videos and corresponding categories thereof and recommendation weights corresponding to the categories;
building a weight model based on the recommendation weight;
the weight model comprises a plurality of weight intervals, and the lengths of the weight intervals are respectively the same as the recommended weights.
Constructing a sampling model based on the number of videos to be recommended and the recommendation weight;
the sampling model comprises a plurality of sampling intervals, the total length of the sampling intervals is the sum of the recommendation weights, the length of each sampling interval is the same, and the number of the sampling intervals is the same as that of the videos to be recommended.
Randomly collecting a sampling point from one sampling interval, and determining sampling points of other sampling intervals according to the sampling point;
determining the weight points corresponding to the sampling points from the weight model;
determining a target type corresponding to the weight interval where each weight point is located;
and acquiring videos corresponding to each target category from the alternative videos to serve as recommended videos.
It can be seen that, in the scheme provided in the embodiment of the present invention, when the computer program is executed by the processor, the candidate videos and the corresponding categories thereof and the recommendation weights corresponding to each category may be obtained, a weight model is constructed based on the recommendation weights, a sampling model is constructed based on the number of videos to be recommended and the recommendation weights, then a sampling point is randomly collected from one sampling interval, sampling points of other sampling intervals are determined according to the sampling point, the weight point corresponding to the sampling point is determined from the weight model, the target category corresponding to the weight interval where each weight point is located is further determined, and finally, the video corresponding to each target category is obtained from the candidate videos as the recommendation video. The sampling model comprises a plurality of sampling intervals, the lengths of the sampling intervals are the same, the total length is the sum of the recommendation weights, and the number of the sampling intervals is the same as that of the videos to be recommended.
The step of constructing a weight model based on the recommendation weight may include:
constructing a weight line segment, wherein the length of the weight line segment is the sum of the recommended weights;
dividing the weight line segment into a plurality of weight intervals according to the recommended weight;
the step of constructing a sampling model based on the number of videos to be recommended and the recommendation weight may include:
constructing a sampling line segment, wherein the length of the sampling line segment is the sum of the recommended weights;
and dividing the sampling line segment into a plurality of sampling intervals according to the number of the videos to be recommended.
The step of determining the weighting point corresponding to the sampling point from the weighting model may include:
and vertically mapping the sampling points to the weighting line segments to obtain weighting points corresponding to the sampling points.
The step of determining the target type corresponding to the weight interval where each of the weight points is located may include:
sequentially determining the weight interval where each weight point is located;
determining the type of the video corresponding to the determined weight interval as a target type;
the determining a weight interval in which each of the weight points is located may include:
traversing the weight line segment from the beginning for a first weight point, judging whether the first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the first weight point is positioned;
and traversing the weight line segment from a target position aiming at the non-first weight point, judging whether the non-first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the non-first weight point is positioned, wherein the target position is the position in the weight line segment corresponding to the end of a sampling interval in which a sampling point corresponding to the non-first weight point is positioned.
The step of randomly collecting a sampling point from one sampling interval and determining sampling points of other sampling intervals according to the sampling point may include:
randomly collecting a sampling point r1 from a first sampling interval;
according to the formula rmM × wl/M-r 1 determines the sampling points for other sampling intervals, where rmAnd M is 1, 2 … M, where M is the number of the videos to be recommended, and wl is the sum of the recommendation weights.
Before the step of obtaining the candidate videos and the corresponding categories thereof and the recommendation weight corresponding to each category, the method may further include:
acquiring a video history watching record of a user, wherein the video history watching record comprises the type and watching times of a video;
and determining the recommendation weight of each type of video based on the types of the videos and the watching times.
Wherein, the method can also comprise:
and recommending the recommended video to the user.
It should be noted that, for the above-mentioned apparatus, electronic device and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (14)

1. A method for determining recommended videos, the method comprising:
acquiring alternative videos and corresponding categories thereof and recommendation weights corresponding to the categories;
constructing a weight model based on the recommendation weight, wherein the weight model comprises a plurality of weight intervals, and the lengths of the weight intervals are respectively the same as the recommendation weight;
constructing a sampling model based on the number of videos to be recommended and the recommendation weight, wherein the sampling model comprises a plurality of sampling intervals, the total length of the sampling intervals is the sum of the recommendation weight, the length of each sampling interval is the same, and the number of the sampling intervals is the same as the number of the videos to be recommended;
randomly collecting a sampling point from one sampling interval, and determining sampling points of other sampling intervals according to the sampling point;
vertically mapping the sampling points to weight line segments in the weight model to obtain weight points corresponding to the sampling points;
determining a target type corresponding to the weight interval where each weight point is located;
and randomly acquiring a video corresponding to each target category from the alternative videos to serve as a recommended video.
2. The method of claim 1, wherein the step of building a weight model based on the recommendation weights comprises:
constructing a weight line segment, wherein the length of the weight line segment is the sum of the recommended weights;
dividing the weight line segment into a plurality of weight intervals according to the recommended weight;
the step of constructing a sampling model based on the number of videos to be recommended and the recommendation weight comprises the following steps:
constructing a sampling line segment, wherein the length of the sampling line segment is the sum of the recommended weights;
and dividing the sampling line segment into a plurality of sampling intervals according to the number of the videos to be recommended.
3. The method of claim 2, wherein the step of determining the target class corresponding to the weight interval in which each of the weight points is located comprises:
sequentially determining the weight interval where each weight point is located;
determining the type of the video corresponding to the determined weight interval as a target type;
the method for determining the weight interval where each weight point is located includes:
traversing the weight line segment from the beginning for a first weight point, judging whether the first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the first weight point is positioned;
and traversing the weight line segment from a target position aiming at the non-first weight point, judging whether the non-first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the non-first weight point is positioned, wherein the target position is the position in the weight line segment corresponding to the end of a sampling interval in which a sampling point corresponding to the non-first weight point is positioned.
4. The method of claim 1, wherein said step of randomly collecting a sample point from one of said sampling intervals and determining sample points for other sampling intervals based on said sample point comprises:
randomly collecting a sampling point r1 from a first sampling interval;
according to the formula rmDetermination of other picks M × wl/M-r 1Sampling points of the sample interval, wherein rmAnd M is 1, 2 … M, where M is the number of the videos to be recommended, and wl is the sum of the recommendation weights.
5. The method of any one of claims 1-4, wherein prior to the step of obtaining the candidate videos and their corresponding categories and the recommendation weight corresponding to each category, the method further comprises:
acquiring a video history watching record of a user, wherein the video history watching record comprises the type and watching times of a video;
and determining the recommendation weight of each type of video based on the types of the videos and the watching times.
6. The method of any one of claims 1-4, further comprising:
and recommending the recommended video to the user.
7. An apparatus for determining a recommended video, the apparatus comprising:
the alternative video acquisition module is used for acquiring alternative videos, corresponding types of the alternative videos and recommendation weights corresponding to the types;
the weight model building module is used for building a weight model based on the recommended weight, wherein the weight model comprises a plurality of weight intervals, and the lengths of the weight intervals are respectively the same as the recommended weight;
the sampling model building module is used for building a sampling model based on the number of videos to be recommended and the recommendation weight, wherein the sampling model comprises a plurality of sampling intervals, the total length of the sampling intervals is the sum of the recommendation weight, the length of each sampling interval is the same, and the number of the sampling intervals is the same as the number of the videos to be recommended;
the sampling point determining module is used for randomly collecting a sampling point from one sampling interval and determining sampling points of other sampling intervals according to the sampling point;
the weight point determining module is used for vertically mapping the sampling points to weight line segments in the weight model to obtain weight points corresponding to the sampling points;
the target type determining module is used for determining a target type corresponding to the weight interval where each weight point is located;
and the recommended video determining module is used for randomly acquiring a video corresponding to each target category from the alternative videos to serve as a recommended video.
8. The apparatus of claim 7, wherein the weight model building module comprises:
the weight line segment construction unit is used for constructing a weight line segment, wherein the length of the weight line segment is the sum of the recommended weights;
the weight line segment dividing unit is used for dividing the weight line segment into a plurality of weight intervals according to the recommended weight;
the sampling model building module comprises:
the sampling line segment construction unit is used for constructing a sampling line segment in a module mode, wherein the length of the sampling line segment is the sum of the recommended weights;
and the sampling line segment dividing unit is used for dividing the sampling line segments into a plurality of sampling intervals according to the number of the videos to be recommended.
9. The apparatus of claim 8, wherein the target class determination module comprises:
a weight interval determination unit, configured to sequentially determine a weight interval in which each of the weight points is located;
a target category determination unit configured to determine a category of the video corresponding to the determined weight section as a target category;
the method for determining the weight section in which each of the weight points is located by the weight section determination unit includes:
traversing the weight line segment from the beginning for a first weight point, judging whether the first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the first weight point is positioned;
and traversing the weight line segment from a target position aiming at the non-first weight point, judging whether the non-first weight point is in a currently traversed weight interval, if so, stopping traversing, and determining the currently traversed weight interval as the weight interval in which the non-first weight point is positioned, wherein the target position is the position in the weight line segment corresponding to the end of a sampling interval in which a sampling point corresponding to the non-first weight point is positioned.
10. The apparatus of claim 7, wherein the sample point determination module comprises:
a first sampling point determining unit, configured to randomly acquire a sampling point r1 from a first one of the sampling intervals;
a second sample point determining unit for determining a second sample point according to the formula rmM × wl/M-r 1 determines the sampling points for other sampling intervals, where rmAnd M is 1, 2 … M, where M is the number of the videos to be recommended, and wl is the sum of the recommendation weights.
11. The apparatus of any one of claims 7-10, further comprising:
a viewing record obtaining module, configured to obtain a video history viewing record of a user before the alternative video and the corresponding category thereof and the recommendation weight corresponding to each category are obtained, where the video history viewing record includes the category and the viewing frequency of the video;
and the recommendation weight determining module is used for determining the recommendation weight of each type of video based on the types of the videos and the watching times.
12. The apparatus of any one of claims 7-10, further comprising:
and the video recommending module is used for recommending the recommended video to the user.
13. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-6 when executing a program stored in the memory.
14. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 6.
CN201811581350.6A 2018-12-24 2018-12-24 Method and device for determining recommended video, electronic equipment and storage medium Active CN109508405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811581350.6A CN109508405B (en) 2018-12-24 2018-12-24 Method and device for determining recommended video, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811581350.6A CN109508405B (en) 2018-12-24 2018-12-24 Method and device for determining recommended video, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109508405A CN109508405A (en) 2019-03-22
CN109508405B true CN109508405B (en) 2020-07-31

Family

ID=65754326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811581350.6A Active CN109508405B (en) 2018-12-24 2018-12-24 Method and device for determining recommended video, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109508405B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112714339B (en) * 2019-10-24 2023-04-28 上海哔哩哔哩科技有限公司 Unordered video sampling method, readable storage medium and computer device
CN112291624B (en) * 2020-09-23 2023-10-17 咪咕视讯科技有限公司 Video processing method, device, electronic equipment and storage medium
CN114398514B (en) * 2021-12-24 2022-11-22 北京达佳互联信息技术有限公司 Video display method and device and electronic equipment
CN116958331B (en) * 2023-09-20 2024-01-19 四川蜀天信息技术有限公司 Sound and picture synchronization adjusting method and device and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514304A (en) * 2013-10-29 2014-01-15 海南大学 Project recommendation method and device
CN105677715A (en) * 2015-12-29 2016-06-15 海信集团有限公司 Multiuser-based video recommendation method and apparatus

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103198418A (en) * 2013-03-15 2013-07-10 北京亿赞普网络技术有限公司 Application recommendation method and application recommendation system
CN106708888B (en) * 2015-11-17 2020-06-26 阿里巴巴集团控股有限公司 Recommendation method and device
CN108228684B (en) * 2017-05-26 2020-11-27 北京市商汤科技开发有限公司 Method and device for training clustering model, electronic equipment and computer storage medium
CN108334640A (en) * 2018-03-21 2018-07-27 北京奇艺世纪科技有限公司 A kind of video recommendation method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514304A (en) * 2013-10-29 2014-01-15 海南大学 Project recommendation method and device
CN105677715A (en) * 2015-12-29 2016-06-15 海信集团有限公司 Multiuser-based video recommendation method and apparatus

Also Published As

Publication number Publication date
CN109508405A (en) 2019-03-22

Similar Documents

Publication Publication Date Title
CN109508405B (en) Method and device for determining recommended video, electronic equipment and storage medium
CN103647800A (en) Method and system of recommending application resources
CN103686237A (en) Method and system for recommending video resource
CN110348519A (en) Financial product cheats recognition methods and the device of clique
CN107908686B (en) Information pushing method and device, server and readable storage medium
CN105243105B (en) Content ordering method and device
CN109165691A (en) Training method, device and the electronic equipment of the model of cheating user for identification
CN111815375B (en) User portrayal method and device in advertisement putting
CN112364202A (en) Video recommendation method and device and electronic equipment
CN110209551B (en) Abnormal equipment identification method and device, electronic equipment and storage medium
CN111767430B (en) Video resource pushing method, video resource pushing device and storage medium
CN108390883A (en) Recognition methods, device and the terminal device of brush popularity user
CN108197336A (en) A kind of method and device of video retrieval
CN108366012A (en) A kind of social networks method for building up, device and electronic equipment
WO2017156994A1 (en) Multimedia resource quality assessment method and apparatus
CN111225246B (en) Video recommendation method and device and electronic equipment
CN108897592A (en) A kind of software methods of exhibiting and relevant device
CN109240899A (en) Information acquisition method and device
CN109753585B (en) Method and device for determining recommended video, electronic equipment and storage medium
CN107122805A (en) A kind of user clustering method and apparatus
CN111090810A (en) Application message pushing method and device and electronic equipment
CN104252541B (en) A kind of webpage information method for pushing, data server and terminal
CN109120955A (en) A kind of recommended method and relevant device of direct broadcasting room
CN109886300A (en) A kind of user&#39;s clustering method, device and equipment
CN108959443A (en) A kind of information-pushing method, information processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant